aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-09 14:01:08 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-09 14:01:08 +0000
commit94b9d7cac30e0da63ad7042a8bec41cb09320058 (patch)
tree08f98c2ceaf196bcf09813bade8d715dae31791e /actions
parent2a9504c3b2f2c99cd52bfabb9d68cc9cf1da28c1 (diff)
downloadelgg-94b9d7cac30e0da63ad7042a8bec41cb09320058.tar.gz
elgg-94b9d7cac30e0da63ad7042a8bec41cb09320058.tar.bz2
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
Diffstat (limited to 'actions')
-rw-r--r--actions/register.php37
1 files changed, 9 insertions, 28 deletions
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"));
}