From 3a74f3ad8c5b566f1f0eecd420056dc86110c501 Mon Sep 17 00:00:00 2001 From: marcus Date: Tue, 12 Aug 2008 14:05:44 +0000 Subject: 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 --- actions/register.php | 3 +++ actions/useradd.php | 34 +++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 15 deletions(-) (limited to 'actions') 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']); -- cgit v1.2.3