diff options
-rw-r--r-- | actions/register.php | 3 | ||||
-rw-r--r-- | actions/useradd.php | 34 | ||||
-rw-r--r-- | engine/lib/users.php | 5 |
3 files changed, 23 insertions, 19 deletions
diff --git a/actions/register.php b/actions/register.php index 17b6fa169..38d1893b9 100644 --- a/actions/register.php +++ b/actions/register.php @@ -45,6 +45,9 @@ $new_user = get_entity($guid); $new_user->admin = 'yes'; } + + // Send email validation on register only + request_email_validation($guid); system_message(sprintf(elgg_echo("registerok"),$CONFIG->sitename)); diff --git a/actions/useradd.php b/actions/useradd.php index cdd9adcf7..f7a96b037 100644 --- a/actions/useradd.php +++ b/actions/useradd.php @@ -27,23 +27,27 @@ if (is_array($admin)) $admin = $admin[0]; // For now, just try and register the user - if ( - ( - (trim($password)!="") && - (strcmp($password, $password2)==0) - ) && - ($guid = register_user($username, $password, $name, $email)) - ) { - if (($guid) && ($admin)) - { + try { + if ( + ( + (trim($password)!="") && + (strcmp($password, $password2)==0) + ) && + ($guid = register_user($username, $password, $name, $email, true)) + ) { + if (($guid) && ($admin)) + { + + $new_user = get_entity($guid); + $new_user->admin = 'yes'; + } - $new_user = get_entity($guid); - $new_user->admin = 'yes'; + system_message(sprintf(elgg_echo("adduser:ok"),$CONFIG->sitename)); + } else { + register_error(elgg_echo("adduser:bad")); } - - system_message(sprintf(elgg_echo("adduser:ok"),$CONFIG->sitename)); - } else { - register_error(elgg_echo("adduser:bad")); + } catch (RegistrationException $r) { + register_error($r->getMessage()); } forward($_SERVER['HTTP_REFERER']); diff --git a/engine/lib/users.php b/engine/lib/users.php index b221779dc..b3456504e 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1063,10 +1063,7 @@ } // Turn on email notifications by default - set_user_notification_setting($user->getGUID(), 'email', true);
- - // Send email validation request - request_email_validation($user->getGUID()); + set_user_notification_setting($user->getGUID(), 'email', true); return $user->getGUID();
}
|