Line 26 | Line 26 |
---|
class acp_board { var $u_action;
|
class acp_board { var $u_action;
|
var $new_config = array();
| var $new_config;
|
function main($id, $mode) {
| function main($id, $mode) {
|
Line 318 | Line 318 |
---|
'title' => 'ACP_COOKIE_SETTINGS', 'vars' => array( 'legend1' => 'ACP_COOKIE_SETTINGS',
|
'title' => 'ACP_COOKIE_SETTINGS', 'vars' => array( 'legend1' => 'ACP_COOKIE_SETTINGS',
|
'cookie_domain' => array('lang' => 'COOKIE_DOMAIN', 'validate' => 'string', 'type' => 'text::255', 'explain' => false), 'cookie_name' => array('lang' => 'COOKIE_NAME', 'validate' => 'string', 'type' => 'text::16', 'explain' => false), 'cookie_path' => array('lang' => 'COOKIE_PATH', 'validate' => 'string', 'type' => 'text::255', 'explain' => false),
| 'cookie_domain' => array('lang' => 'COOKIE_DOMAIN', 'validate' => 'string', 'type' => 'text::255', 'explain' => true), 'cookie_name' => array('lang' => 'COOKIE_NAME', 'validate' => 'string', 'type' => 'text::16', 'explain' => true), 'cookie_path' => array('lang' => 'COOKIE_PATH', 'validate' => 'string', 'type' => 'text::255', 'explain' => true),
|
'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'validate' => 'bool', 'type' => 'radio:disabled_enabled', 'explain' => true), ) );
| 'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'validate' => 'bool', 'type' => 'radio:disabled_enabled', 'explain' => true), ) );
|
Line 449 | Line 449 |
---|
'legend2' => 'SMTP_SETTINGS', 'smtp_delivery' => array('lang' => 'USE_SMTP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'legend2' => 'SMTP_SETTINGS', 'smtp_delivery' => array('lang' => 'USE_SMTP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'smtp_host' => array('lang' => 'SMTP_SERVER', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => false),
| 'smtp_host' => array('lang' => 'SMTP_SERVER', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => true),
|
'smtp_port' => array('lang' => 'SMTP_PORT', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true), 'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true), 'smtp_username' => array('lang' => 'SMTP_USERNAME', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true), 'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'validate' => 'string', 'type' => 'password:25:255', 'explain' => true),
|
'smtp_port' => array('lang' => 'SMTP_PORT', 'validate' => 'int:0:99999', 'type' => 'number:0:99999', 'explain' => true), 'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true), 'smtp_username' => array('lang' => 'SMTP_USERNAME', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true), 'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'validate' => 'string', 'type' => 'password:25:255', 'explain' => true),
|
| 'smtp_verify_peer' => array('lang' => 'SMTP_VERIFY_PEER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'smtp_verify_peer_name' => array('lang' => 'SMTP_VERIFY_PEER_NAME', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'smtp_allow_self_signed'=> array('lang' => 'SMTP_ALLOW_SELF_SIGNED','validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
'legend3' => 'ACP_SUBMIT_CHANGES', )
| 'legend3' => 'ACP_SUBMIT_CHANGES', )
|
Line 482 | Line 485 |
---|
$user->add_lang($display_vars['lang']); }
|
$user->add_lang($display_vars['lang']); }
|
$this->new_config = $config;
| $this->new_config = clone $config;
|
$cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config; $error = array();
| $cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config; $error = array();
|
Line 500 | Line 503 |
---|
}
// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
|
}
// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
|
foreach ($display_vars['vars'] as $config_name => $null)
| foreach ($display_vars['vars'] as $config_name => $data)
|
{ if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) {
| { if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) {
|
Line 514 | Line 517 |
---|
if ($config_name == 'guest_style') {
|
if ($config_name == 'guest_style') {
|
if (isset($cfg_array[$config_name])) {
| if (isset($cfg_array[$config_name])) {
|
$this->guest_style_set($cfg_array[$config_name]); } continue;
| $this->guest_style_set($cfg_array[$config_name]); } continue;
|
Line 531 | Line 535 |
---|
if ($submit) {
|
if ($submit) {
|
| if (strpos($data['type'], 'password') === 0 && $config_value === '********') { // Do not update password fields if the content is ********, // because that is the password replacement we use to not // send the password to the output continue; }
|
set_config($config_name, $config_value);
if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable']))
| set_config($config_name, $config_value);
if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable']))
|
Line 559 | Line 570 |
---|
$old_auth_config = array(); foreach ($auth_providers as $provider) {
|
$old_auth_config = array(); foreach ($auth_providers as $provider) {
|
| /** @var \phpbb\auth\provider\provider_interface $provider */
|
if ($fields = $provider->acp()) { // Check if we need to create config fields for this plugin and save config when submit was pressed
| if ($fields = $provider->acp()) { // Check if we need to create config fields for this plugin and save config when submit was pressed
|
Line 571 | Line 583 |
---|
if (!isset($cfg_array[$field]) || strpos($field, 'legend') !== false) {
|
if (!isset($cfg_array[$field]) || strpos($field, 'legend') !== false) {
|
| continue; }
if (substr($field, -9) === '_password' && $cfg_array[$field] === '********') { // Do not update password fields if the content is ********, // because that is the password replacement we use to not // send the password to the output
|
continue; }
| continue; }
|
Line 825 | Line 845 |
---|
{ global $user;
|
{ global $user;
|
return '<input id="' . $key . '" type="number" size="3" maxlength="3" min="1" max="999" name="config[min_name_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . ' <input type="number" size="3" maxlength="3" min="8" max="180" name="config[max_name_chars]" value="' . $this->new_config['max_name_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
| return '<input id="' . $key . '" type="number" min="1" max="999" name="config[min_name_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . ' <input type="number" min="8" max="180" name="config[max_name_chars]" value="' . $this->new_config['max_name_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
|
}
/**
| }
/**
|
Line 853 | Line 873 |
---|
{ global $user;
|
{ global $user;
|
return '<input id="' . $key . '" type="number" size="3" maxlength="3" min="1" max="999" name="config[min_pass_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . ' <input type="number" size="3" maxlength="3" min="8" max="255" name="config[max_pass_chars]" value="' . $this->new_config['max_pass_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
| return '<input id="' . $key . '" type="number" min="1" max="999" name="config[min_pass_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . ' <input type="number" min="8" max="255" name="config[max_pass_chars]" value="' . $this->new_config['max_pass_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
|
}
/**
| }
/**
|
Line 1000 | Line 1020 |
---|
$user->timezone = $old_tz;
return "<select name=\"dateoptions\" id=\"dateoptions\" onchange=\"if (this.value == 'custom') { document.getElementById('" . addslashes($key) . "').value = '" . addslashes($value) . "'; } else { document.getElementById('" . addslashes($key) . "').value = this.value; }\">$dateformat_options</select>
|
$user->timezone = $old_tz;
return "<select name=\"dateoptions\" id=\"dateoptions\" onchange=\"if (this.value == 'custom') { document.getElementById('" . addslashes($key) . "').value = '" . addslashes($value) . "'; } else { document.getElementById('" . addslashes($key) . "').value = this.value; }\">$dateformat_options</select>
|
<input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"30\" />";
| <input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"64\" />";
|
}
/**
| }
/**
|