From 94b9d7cac30e0da63ad7042a8bec41cb09320058 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 9 Oct 2010 14:01:08 +0000 Subject: pulled out special exception in registration action for first admin login git-svn-id: http://code.elgg.org/elgg/trunk@7040 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/register.php | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) (limited to 'actions/register.php') diff --git a/actions/register.php b/actions/register.php index 9c4efa9f6..b9db150c1 100644 --- a/actions/register.php +++ b/actions/register.php @@ -43,39 +43,20 @@ if ($CONFIG->allow_registration) { 'invitecode' => $invitecode ); - // if this user is admin, that means it was the first - // registered user. Don't trigger this hook. - // @todo This can be removed in the new installer - if (!$new_user->isAdmin()) { - // @todo should registration be allowed no matter what the plugins return? - if (!trigger_plugin_hook('register', 'user', $params, TRUE)) { - $new_user->delete(); - // @todo this is a generic messages. We could have plugins - // throw a RegistrationException, but that is very odd - // for the plugin hooks system. - throw new RegistrationException(elgg_echo('registerbad')); - } + // @todo should registration be allowed no matter what the plugins return? + if (!trigger_plugin_hook('register', 'user', $params, TRUE)) { + $new_user->delete(); + // @todo this is a generic messages. We could have plugins + // throw a RegistrationException, but that is very odd + // for the plugin hooks system. + throw new RegistrationException(elgg_echo('registerbad')); } system_message(sprintf(elgg_echo("registerok"), $CONFIG->sitename)); // Forward on success, assume everything else is an error... - // If just registered admin user, login the user in and forward to the - // plugins simple settings page. - if (!datalist_get('first_admin_login') && $new_user->isAdmin()) { - login($new_user); - // remove the "you've registered!" system_message(); - $_SESSION['msg']['messages'] = array(); - - // remind users to enable / disable desired tools - elgg_add_admin_notice('first_installation_plugin_reminder', elgg_echo('firstadminlogininstructions')); - - datalist_set('first_admin_login', time()); - forward('pg/admin/plugins/simple'); - } else { - login($new_user); - forward(); - } + login($new_user); + forward(); } else { register_error(elgg_echo("registerbad")); } -- cgit v1.2.3