diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-12 14:05:44 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-12 14:05:44 +0000 |
commit | 3a74f3ad8c5b566f1f0eecd420056dc86110c501 (patch) | |
tree | 65937b5695115199154e61027487f8aa7dd9bd8a /actions/useradd.php | |
parent | 36ced79b9dfaeb4fcd3f5bc6e4d3fd2b25c19d2f (diff) | |
download | elgg-3a74f3ad8c5b566f1f0eecd420056dc86110c501.tar.gz elgg-3a74f3ad8c5b566f1f0eecd420056dc86110c501.tar.bz2 |
Closes #229: Admin signup now using different view + no password validation for admin signup
git-svn-id: https://code.elgg.org/elgg/trunk@1856 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions/useradd.php')
-rw-r--r-- | actions/useradd.php | 34 |
1 files changed, 19 insertions, 15 deletions
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']); |