Commit d225ef24 by Scott

Remove approve_user_required option

parent 122bb75a
...@@ -281,15 +281,9 @@ function qa_output_content($qa_content) ...@@ -281,15 +281,9 @@ function qa_output_content($qa_content)
'^1' => '<a href="' . qa_path_html('confirm') . '">', '^1' => '<a href="' . qa_path_html('confirm') . '">',
'^2' => '</a>', '^2' => '</a>',
)); ));
} elseif (($flags & QA_USER_FLAGS_MUST_APPROVE) && qa_get_logged_in_level() < QA_USER_LEVEL_APPROVED && qa_opt('moderate_users')) {
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('users/approve_title');
$qa_content['error'] = strtr(qa_lang_html('users/approve_required'), array(
'^1' => '<a href="' . qa_path_html('account') . '">',
'^2' => '</a>',
));
} }
// we no longer block access here for unapproved users; this is handled by the Permissions settings
} }
// Combine various Javascript elements in $qa_content into single array for theme layer // Combine various Javascript elements in $qa_content into single array for theme layer
......
...@@ -203,8 +203,7 @@ function qa_create_new_user($email, $password, $handle, $level = QA_USER_LEVEL_B ...@@ -203,8 +203,7 @@ function qa_create_new_user($email, $password, $handle, $level = QA_USER_LEVEL_B
} else } else
$confirm = ''; $confirm = '';
if (qa_opt('moderate_users') && qa_opt('approve_user_required') && $level < QA_USER_LEVEL_EXPERT) // we no longer use the 'approve_user_required' option to set QA_USER_FLAGS_MUST_APPROVE; this can be handled by the Permissions settings
qa_db_user_set_flag($userid, QA_USER_FLAGS_MUST_APPROVE, true);
qa_send_notification($userid, $email, $handle, qa_lang('emails/welcome_subject'), qa_lang('emails/welcome_body'), array( qa_send_notification($userid, $email, $handle, qa_lang('emails/welcome_subject'), qa_lang('emails/welcome_body'), array(
'^password' => isset($password) ? qa_lang('main/hidden') : qa_lang('users/password_to_set'), // v 1.6.3: no longer email out passwords '^password' => isset($password) ? qa_lang('main/hidden') : qa_lang('users/password_to_set'), // v 1.6.3: no longer email out passwords
...@@ -344,8 +343,10 @@ function qa_set_user_level($userid, $handle, $level, $oldlevel) ...@@ -344,8 +343,10 @@ function qa_set_user_level($userid, $handle, $level, $oldlevel)
qa_db_user_set($userid, 'level', $level); qa_db_user_set($userid, 'level', $level);
qa_db_uapprovecount_update(); qa_db_uapprovecount_update();
if ($level >= QA_USER_LEVEL_APPROVED) if ($level >= QA_USER_LEVEL_APPROVED) {
// no longer necessary as QA_USER_FLAGS_MUST_APPROVE is deprecated, but kept for posterity
qa_db_user_set_flag($userid, QA_USER_FLAGS_MUST_APPROVE, false); qa_db_user_set_flag($userid, QA_USER_FLAGS_MUST_APPROVE, false);
}
qa_report_event('u_level', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array( qa_report_event('u_level', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array(
'userid' => $userid, 'userid' => $userid,
......
...@@ -41,7 +41,7 @@ define('QA_USER_FLAGS_NO_MAILINGS', 32); ...@@ -41,7 +41,7 @@ define('QA_USER_FLAGS_NO_MAILINGS', 32);
define('QA_USER_FLAGS_WELCOME_NOTICE', 64); define('QA_USER_FLAGS_WELCOME_NOTICE', 64);
define('QA_USER_FLAGS_MUST_CONFIRM', 128); define('QA_USER_FLAGS_MUST_CONFIRM', 128);
define('QA_USER_FLAGS_NO_WALL_POSTS', 256); define('QA_USER_FLAGS_NO_WALL_POSTS', 256);
define('QA_USER_FLAGS_MUST_APPROVE', 512); define('QA_USER_FLAGS_MUST_APPROVE', 512); // @deprecated
define('QA_FIELD_FLAGS_MULTI_LINE', 1); define('QA_FIELD_FLAGS_MULTI_LINE', 1);
define('QA_FIELD_FLAGS_LINK_URL', 2); define('QA_FIELD_FLAGS_LINK_URL', 2);
...@@ -1021,7 +1021,7 @@ function qa_user_maximum_permit_error($permitoption, $limitaction = null, $check ...@@ -1021,7 +1021,7 @@ function qa_user_maximum_permit_error($permitoption, $limitaction = null, $check
* 'userblock' => the user has been blocked * 'userblock' => the user has been blocked
* 'ipblock' => the ip address has been blocked * 'ipblock' => the ip address has been blocked
* 'confirm' => the user should confirm their email address * 'confirm' => the user should confirm their email address
* 'approve' => the user needs to be approved by the site admins * 'approve' => the user needs to be approved by the site admins (no longer used as global permission)
* 'limit' => the user or IP address has reached a rate limit (if $limitaction specified) * 'limit' => the user or IP address has reached a rate limit (if $limitaction specified)
* false => the operation can go ahead * false => the operation can go ahead
*/ */
...@@ -1051,9 +1051,6 @@ function qa_user_permit_error($permitoption = null, $limitaction = null, $userle ...@@ -1051,9 +1051,6 @@ function qa_user_permit_error($permitoption = null, $limitaction = null, $userle
if (!$error && isset($userid) && ($flags & QA_USER_FLAGS_MUST_CONFIRM) && qa_opt('confirm_user_emails')) if (!$error && isset($userid) && ($flags & QA_USER_FLAGS_MUST_CONFIRM) && qa_opt('confirm_user_emails'))
$error = 'confirm'; $error = 'confirm';
if (!$error && isset($userid) && ($flags & QA_USER_FLAGS_MUST_APPROVE) && qa_opt('moderate_users'))
$error = 'approve';
if (isset($limitaction) && !$error) { if (isset($limitaction) && !$error) {
if (qa_user_limits_remaining($limitaction) <= 0) if (qa_user_limits_remaining($limitaction) <= 0)
$error = 'limit'; $error = 'limit';
......
...@@ -32,7 +32,7 @@ return array( ...@@ -32,7 +32,7 @@ return array(
'allow_self_answer' => 'Allow users to answer their own question:', 'allow_self_answer' => 'Allow users to answer their own question:',
'allow_user_walls' => 'Enable wall posts on user profiles:', 'allow_user_walls' => 'Enable wall posts on user profiles:',
'allow_view_q_bots' => 'Allow search engines to view question pages', 'allow_view_q_bots' => 'Allow search engines to view question pages',
'approve_user_required' => 'All new users must be approved:', 'approve_user_required' => 'All new users must be approved:', // @deprecated
'avatar_allow_gravatar' => 'Allow ^1Gravatar^2 avatars:', 'avatar_allow_gravatar' => 'Allow ^1Gravatar^2 avatars:',
'avatar_allow_upload' => 'Allow users to upload avatars:', 'avatar_allow_upload' => 'Allow users to upload avatars:',
'avatar_default_show' => 'Default avatar:', 'avatar_default_show' => 'Default avatar:',
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
return array( return array(
'about' => 'About', 'about' => 'About',
'add_user_x_favorites' => 'Add user ^ to my favorites', 'add_user_x_favorites' => 'Add user ^ to my favorites',
'approve_required' => 'Please wait for your account to be approved or ^1add more information^2.', 'approve_required' => 'Please wait for your account to be approved or ^1add more information^2.', // @deprecated
'approve_title' => 'User approval pending', 'approve_title' => 'User approval pending',
'approve_user_button' => 'Approve User', 'approve_user_button' => 'Approve User',
'approved_user' => 'Approved user', 'approved_user' => 'Approved user',
......
...@@ -146,7 +146,6 @@ $optiontype = array( ...@@ -146,7 +146,6 @@ $optiontype = array(
'allow_user_walls' => 'checkbox', 'allow_user_walls' => 'checkbox',
'allow_self_answer' => 'checkbox', 'allow_self_answer' => 'checkbox',
'allow_view_q_bots' => 'checkbox', 'allow_view_q_bots' => 'checkbox',
'approve_user_required' => 'checkbox',
'avatar_allow_gravatar' => 'checkbox', 'avatar_allow_gravatar' => 'checkbox',
'avatar_allow_upload' => 'checkbox', 'avatar_allow_upload' => 'checkbox',
'avatar_default_show' => 'checkbox', 'avatar_default_show' => 'checkbox',
...@@ -562,7 +561,7 @@ switch ($adminsection) { ...@@ -562,7 +561,7 @@ switch ($adminsection) {
$getoptions = qa_get_options(array('feedback_enabled', 'permit_post_q', 'permit_post_a', 'permit_post_c')); $getoptions = qa_get_options(array('feedback_enabled', 'permit_post_q', 'permit_post_a', 'permit_post_c'));
if (!QA_FINAL_EXTERNAL_USERS) if (!QA_FINAL_EXTERNAL_USERS)
array_push($showoptions, 'confirm_user_emails', 'confirm_user_required', 'moderate_users', 'approve_user_required', ''); array_push($showoptions, 'confirm_user_emails', 'confirm_user_required', 'moderate_users', '');
$captchamodules = qa_list_modules('captcha'); $captchamodules = qa_list_modules('captcha');
...@@ -625,7 +624,6 @@ switch ($adminsection) { ...@@ -625,7 +624,6 @@ switch ($adminsection) {
$checkboxtodisplay = array( $checkboxtodisplay = array(
'confirm_user_required' => 'option_confirm_user_emails', 'confirm_user_required' => 'option_confirm_user_emails',
'approve_user_required' => 'option_moderate_users',
'captcha_on_unapproved' => 'option_moderate_users', 'captcha_on_unapproved' => 'option_moderate_users',
'captcha_on_unconfirmed' => 'option_confirm_user_emails && !(option_moderate_users && option_captcha_on_unapproved)', 'captcha_on_unconfirmed' => 'option_confirm_user_emails && !(option_moderate_users && option_captcha_on_unapproved)',
'captcha_module' => 'option_captcha_on_register || option_captcha_on_anon_post || (option_confirm_user_emails && option_captcha_on_unconfirmed) || (option_moderate_users && option_captcha_on_unapproved) || option_captcha_on_reset_password || option_captcha_on_feedback', 'captcha_module' => 'option_captcha_on_register || option_captcha_on_anon_post || (option_confirm_user_emails && option_captcha_on_unconfirmed) || (option_moderate_users && option_captcha_on_unapproved) || option_captcha_on_reset_password || option_captcha_on_feedback',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment