aboutsummaryrefslogtreecommitdiff
path: root/mod/uservalidationbyemail/start.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-12-14 14:21:32 -0200
committerSilvio Rhatto <rhatto@riseup.net>2012-12-14 14:21:32 -0200
commitf9ca24a9407f294a9bb7305180f9f8e740ab6ec9 (patch)
tree4c9a263b7fd770151e40940d6ddaa89d27e5053d /mod/uservalidationbyemail/start.php
parente15f0fce6940ee999cf5d6405ad1b16d00c38e4b (diff)
parent3ed289b03fa3d851fd7fffbc0441ebc9b5e98310 (diff)
downloadelgg-f9ca24a9407f294a9bb7305180f9f8e740ab6ec9.tar.gz
elgg-f9ca24a9407f294a9bb7305180f9f8e740ab6ec9.tar.bz2
Merge branch 'master' of git://gitorious.org/lorea/elgg into saravea
Diffstat (limited to 'mod/uservalidationbyemail/start.php')
-rw-r--r--mod/uservalidationbyemail/start.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php
index f98f57faf..f44d2ab50 100644
--- a/mod/uservalidationbyemail/start.php
+++ b/mod/uservalidationbyemail/start.php
@@ -233,15 +233,23 @@ function uservalidationbyemail_public_pages($hook, $type, $return_value, $params
* @param string $type
* @param ElggUser $user
* @return bool
+ *
+ * @throws LoginException
*/
function uservalidationbyemail_check_manual_login($event, $type, $user) {
$access_status = access_get_show_hidden_status();
access_show_hidden_entities(TRUE);
- // @todo register_error()?
- $return = ($user instanceof ElggUser && !$user->isEnabled() && !$user->validated) ? FALSE : NULL;
+ if (($user instanceof ElggUser) && !$user->isEnabled() && !$user->validated) {
+ // send new validation email
+ uservalidationbyemail_request_validation($user->getGUID());
+
+ // restore hidden entities settings
+ access_show_hidden_entities($access_status);
+
+ // throw error so we get a nice error message
+ throw new LoginException(elgg_echo('uservalidationbyemail:login:fail'));
+ }
access_show_hidden_entities($access_status);
-
- return $return;
}