1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 07:07:51 +02:00

[ticket/11863] Grey out unavailable activation methods when emails disabled

Further fall back to USER_ACTIVATION_DISABLE when emails are disabled
but evaluate it at runtime.

PHPBB3-11863
This commit is contained in:
Oliver Schramm 2014-10-17 15:40:03 +02:00
parent 39e51e5599
commit 01df1d3301
3 changed files with 13 additions and 13 deletions

View File

@ -792,20 +792,19 @@ class acp_board
global $user, $config;
$act_ary = array(
'ACC_DISABLE' => USER_ACTIVATION_DISABLE,
'ACC_NONE' => USER_ACTIVATION_NONE,
'ACC_DISABLE' => array(true, USER_ACTIVATION_DISABLE),
'ACC_NONE' => array(true, USER_ACTIVATION_NONE),
'ACC_USER' => array($config['email_enable'], USER_ACTIVATION_SELF),
'ACC_ADMIN' => array($config['email_enable'], USER_ACTIVATION_ADMIN),
);
if ($config['email_enable'])
{
$act_ary['ACC_USER'] = USER_ACTIVATION_SELF;
$act_ary['ACC_ADMIN'] = USER_ACTIVATION_ADMIN;
}
$act_options = '';
foreach ($act_ary as $key => $value)
$act_options = '';
foreach ($act_ary as $key => $data)
{
list($available, $value) = $data;
$selected = ($selected_value == $value) ? ' selected="selected"' : '';
$act_options .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$key] . '</option>';
$class = (!$available) ? ' class="disabled-option"' : '';
$act_options .= '<option value="' . $value . '"' . $selected . $class . '>' . $user->lang($key) . '</option>';
}
return $act_options;

View File

@ -33,7 +33,8 @@ class ucp_register
global $request, $phpbb_container;
//
if ($config['require_activation'] == USER_ACTIVATION_DISABLE)
if ($config['require_activation'] == USER_ACTIVATION_DISABLE ||
(in_array($config['require_activation'], array(USER_ACTIVATION_SELF, USER_ACTIVATION_ADMIN)) && !$config['email_enable']))
{
trigger_error('UCP_REGISTER_DISABLE');
}

View File

@ -221,7 +221,7 @@ $lang = array_merge($lang, array(
'ACP_REGISTER_SETTINGS_EXPLAIN' => 'Here you are able to define registration and profile related settings.',
'ACC_ACTIVATION' => 'Account activation',
'ACC_ACTIVATION_EXPLAIN' => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations. “Board-wide email” must be enabled in order to use user or admin activation.',
'ACC_ACTIVATION_EXPLAIN' => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations. <em>“Board-wide email” must be enabled in order to use user or admin activation.</em>',
'NEW_MEMBER_POST_LIMIT' => 'New member post limit',
'NEW_MEMBER_POST_LIMIT_EXPLAIN' => 'New members are within the <em>Newly Registered Users</em> group until they reach this number of posts. You can use this group to keep them from using the PM system or to review their posts. <strong>A value of 0 disables this feature.</strong>',
'NEW_MEMBER_GROUP_DEFAULT' => 'Set Newly Registered Users group to default',
@ -556,7 +556,7 @@ $lang = array_merge($lang, array(
'EMAIL_SIG' => 'Email signature',
'EMAIL_SIG_EXPLAIN' => 'This text will be attached to all emails the board sends.',
'ENABLE_EMAIL' => 'Enable board-wide emails',
'ENABLE_EMAIL_EXPLAIN' => 'If this is set to disabled no emails will be sent by the board at all. <em>Note the user and admin account activation settings require this setting to be enabled. If currently using “user” or “admin” activation in the activation settings, disabling this setting will require no activation of new accounts.</em>',
'ENABLE_EMAIL_EXPLAIN' => 'If this is set to disabled no emails will be sent by the board at all. <em>Note the user and admin account activation settings require this setting to be enabled. If currently using “user” or “admin” activation in the activation settings, disabling this setting will disable registration.</em>',
'SMTP_AUTH_METHOD' => 'Authentication method for SMTP',
'SMTP_AUTH_METHOD_EXPLAIN' => 'Only used if a username/password is set, ask your provider if you are unsure which method to use.',
'SMTP_CRAM_MD5' => 'CRAM-MD5',