mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge pull request #22 from phpbb/ticket/sec-184
[ticket/sec-184] Do not output passwords to HTML
This commit is contained in:
commit
bac02a348e
4 changed files with 29 additions and 6 deletions
|
@ -500,7 +500,7 @@ class acp_board
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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)
|
||||||
{
|
{
|
||||||
|
@ -532,6 +532,13 @@ class acp_board
|
||||||
|
|
||||||
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);
|
set_config($config_name, $config_value);
|
||||||
|
|
||||||
if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable']))
|
if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable']))
|
||||||
|
@ -560,6 +567,7 @@ class acp_board
|
||||||
$old_auth_config = array();
|
$old_auth_config = array();
|
||||||
foreach ($auth_providers as $provider)
|
foreach ($auth_providers as $provider)
|
||||||
{
|
{
|
||||||
|
/** @var \phpbb\auth\provider\provider_interface $provider */
|
||||||
if ($fields = $provider->acp())
|
if ($fields = $provider->acp())
|
||||||
{
|
{
|
||||||
// Check if we need to create config fields for this plugin and save config when submit was pressed
|
// Check if we need to create config fields for this plugin and save config when submit was pressed
|
||||||
|
@ -575,6 +583,14 @@ class acp_board
|
||||||
continue;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
$old_auth_config[$field] = $this->new_config[$field];
|
$old_auth_config[$field] = $this->new_config[$field];
|
||||||
$config_value = $cfg_array[$field];
|
$config_value = $cfg_array[$field];
|
||||||
$this->new_config[$field] = $config_value;
|
$this->new_config[$field] = $config_value;
|
||||||
|
|
|
@ -107,7 +107,10 @@ class acp_jabber
|
||||||
set_config('jab_host', $jab_host);
|
set_config('jab_host', $jab_host);
|
||||||
set_config('jab_port', $jab_port);
|
set_config('jab_port', $jab_port);
|
||||||
set_config('jab_username', $jab_username);
|
set_config('jab_username', $jab_username);
|
||||||
set_config('jab_password', $jab_password);
|
if ($jab_password !== '********')
|
||||||
|
{
|
||||||
|
set_config('jab_password', $jab_password);
|
||||||
|
}
|
||||||
set_config('jab_package_size', $jab_package_size);
|
set_config('jab_package_size', $jab_package_size);
|
||||||
set_config('jab_use_ssl', $jab_use_ssl);
|
set_config('jab_use_ssl', $jab_use_ssl);
|
||||||
|
|
||||||
|
@ -122,7 +125,7 @@ class acp_jabber
|
||||||
'JAB_HOST' => $jab_host,
|
'JAB_HOST' => $jab_host,
|
||||||
'JAB_PORT' => ($jab_port) ? $jab_port : '',
|
'JAB_PORT' => ($jab_port) ? $jab_port : '',
|
||||||
'JAB_USERNAME' => $jab_username,
|
'JAB_USERNAME' => $jab_username,
|
||||||
'JAB_PASSWORD' => $jab_password,
|
'JAB_PASSWORD' => $jab_password !== '' ? '********' : '',
|
||||||
'JAB_PACKAGE_SIZE' => $jab_package_size,
|
'JAB_PACKAGE_SIZE' => $jab_package_size,
|
||||||
'JAB_USE_SSL' => $jab_use_ssl,
|
'JAB_USE_SSL' => $jab_use_ssl,
|
||||||
'S_CAN_USE_SSL' => jabber::can_use_ssl(),
|
'S_CAN_USE_SSL' => jabber::can_use_ssl(),
|
||||||
|
|
|
@ -245,8 +245,13 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
|
||||||
|
|
||||||
switch ($tpl_type[0])
|
switch ($tpl_type[0])
|
||||||
{
|
{
|
||||||
case 'text':
|
|
||||||
case 'password':
|
case 'password':
|
||||||
|
if ($new[$config_key] !== '')
|
||||||
|
{
|
||||||
|
// replace passwords with asterixes
|
||||||
|
$new[$config_key] = '********';
|
||||||
|
}
|
||||||
|
case 'text':
|
||||||
case 'url':
|
case 'url':
|
||||||
case 'email':
|
case 'email':
|
||||||
case 'color':
|
case 'color':
|
||||||
|
|
|
@ -289,7 +289,6 @@ class ldap extends \phpbb\auth\provider\base
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function acp()
|
public function acp()
|
||||||
{
|
{
|
||||||
// These are fields required in the config table
|
// These are fields required in the config table
|
||||||
|
@ -308,7 +307,7 @@ class ldap extends \phpbb\auth\provider\base
|
||||||
'TEMPLATE_VARS' => array(
|
'TEMPLATE_VARS' => array(
|
||||||
'AUTH_LDAP_BASE_DN' => $new_config['ldap_base_dn'],
|
'AUTH_LDAP_BASE_DN' => $new_config['ldap_base_dn'],
|
||||||
'AUTH_LDAP_EMAIL' => $new_config['ldap_email'],
|
'AUTH_LDAP_EMAIL' => $new_config['ldap_email'],
|
||||||
'AUTH_LDAP_PASSORD' => $new_config['ldap_password'],
|
'AUTH_LDAP_PASSORD' => $new_config['ldap_password'] !== '' ? '********' : '',
|
||||||
'AUTH_LDAP_PORT' => $new_config['ldap_port'],
|
'AUTH_LDAP_PORT' => $new_config['ldap_port'],
|
||||||
'AUTH_LDAP_SERVER' => $new_config['ldap_server'],
|
'AUTH_LDAP_SERVER' => $new_config['ldap_server'],
|
||||||
'AUTH_LDAP_UID' => $new_config['ldap_uid'],
|
'AUTH_LDAP_UID' => $new_config['ldap_uid'],
|
||||||
|
|
Loading…
Add table
Reference in a new issue