1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +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;