From cb8231ad16a9fbd9e4b5df9af8b8d79f563a2bbb Mon Sep 17 00:00:00 2001 From: Jerome Bakker Date: Thu, 8 Nov 2012 10:57:45 +0100 Subject: fixes missing error message on manual login of an unvalidated user --- mod/uservalidationbyemail/start.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'mod/uservalidationbyemail/start.php') diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php index f98f57faf..a453f36a4 100644 --- a/mod/uservalidationbyemail/start.php +++ b/mod/uservalidationbyemail/start.php @@ -238,8 +238,16 @@ 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); -- cgit v1.2.3 From 7758aea5e6dc9cca024491cbac6de447675e4ef0 Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Wed, 14 Nov 2012 20:56:44 -0500 Subject: Style cleanup --- mod/uservalidationbyemail/start.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mod/uservalidationbyemail/start.php') diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php index a453f36a4..f44d2ab50 100644 --- a/mod/uservalidationbyemail/start.php +++ b/mod/uservalidationbyemail/start.php @@ -233,12 +233,14 @@ 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); - if(($user instanceof ElggUser) && !$user->isEnabled() && !$user->validated){ + if (($user instanceof ElggUser) && !$user->isEnabled() && !$user->validated) { // send new validation email uservalidationbyemail_request_validation($user->getGUID()); @@ -250,6 +252,4 @@ function uservalidationbyemail_check_manual_login($event, $type, $user) { } access_show_hidden_entities($access_status); - - return $return; } -- cgit v1.2.3