# HG changeset patch # User Dan # Date 1271714863 14400 # Node ID db42b7c50e57258e64d5a99715f9f813c04957c0 # Parent 9aa09b0a7544e06dea71c1b99c28848548072aa2 Fixed registration admin override with account_activation set to disable. diff -r 9aa09b0a7544 -r db42b7c50e57 language/english/user.json --- a/language/english/user.json Sat Apr 17 03:33:14 2010 -0400 +++ b/language/english/user.json Mon Apr 19 18:07:43 2010 -0400 @@ -151,7 +151,7 @@ reg_err_captcha: 'The confirmation code you entered was incorrect.', reg_err_disabled_title: 'Registration disabled', reg_err_disabled_body: 'The administrator has disabled the registration of new accounts on this site.', - reg_err_disabled_body_adminblurb: 'Oops...it seems that you are the administrator...hehe...you can also force account registration to work.', + reg_msg_admin_forced: 'Registrations are disabled. You have been granted access to this page due to your administrator privileges.', reg_err_username_invalid: 'Your username must be at least two characters in length and may not contain any of the following characters: < > _ & ? \' " % / \\.', // Not exactly an error reg_err_password_good: 'The password you entered is valid.', diff -r 9aa09b0a7544 -r db42b7c50e57 plugins/SpecialUserFuncs.php --- a/plugins/SpecialUserFuncs.php Sat Apr 17 03:33:14 2010 -0400 +++ b/plugins/SpecialUserFuncs.php Mon Apr 19 18:07:43 2010 -0400 @@ -549,6 +549,7 @@ global $db, $session, $paths, $template, $plugins; // Common objects global $lang; + // block registration except for guests and admins if ( $session->user_level < USER_LEVEL_ADMIN && $session->user_logged_in ) { $paths->main_page(); @@ -561,10 +562,9 @@ $terms = getConfig('register_tou'); - if(getConfig('account_activation') == 'disable' && ( ( $session->user_level >= USER_LEVEL_ADMIN && !isset($_GET['IWannaPlayToo']) ) || $session->user_level < USER_LEVEL_ADMIN || !$session->user_logged_in )) + if ( getConfig('account_activation') == 'disable' && $session->user_level < USER_LEVEL_ADMIN ) { - $s = ($session->user_level >= USER_LEVEL_ADMIN) ? '
' . $lang->get('user_reg_err_disabled_body_adminblurb', array( 'reg_link' => makeUrl($paths->page, 'IWannaPlayToo&coppa=no', true) )) . '
' : ''; - die_friendly($lang->get('user_reg_err_disabled_title'), '' . $lang->get('user_reg_err_disabled_body') . '
' . $s); + die_friendly($lang->get('user_reg_err_disabled_title'), '' . $lang->get('user_reg_err_disabled_body') . '
'); } // are we locked out from logging in? if so, also lock out registration if ( getConfig('lockout_policy') === 'lockout' ) @@ -588,8 +588,11 @@ { $_GET['coppa'] = ( isset($_POST['coppa']) ) ? $_POST['coppa'] : 'x'; - $captcharesult = $session->get_captcha($_POST['captchahash']); - $session->kill_captcha(); + if ( $session->user_level < USER_LEVEL_ADMIN ) + { + $captcharesult = $session->get_captcha($_POST['captchahash']); + $session->kill_captcha(); + } // bypass captcha if logged in (at this point, if logged in, we're admin) if ( !$session->user_logged_in && strtolower($captcharesult) != strtolower($_POST['captchacode']) ) { @@ -683,6 +686,11 @@ $template->header(); echo $lang->get('user_reg_msg_greatercontrol'); + if ( getConfig('account_activation') == 'disable' && $session->user_level >= USER_LEVEL_ADMIN ) + { + echo '