aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-06-07 14:59:33 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-06-07 14:59:33 +0200
commit77bc8ee68bea99a7cd8cd6cfacb1c6292e58d01a (patch)
tree267ca83c2c796b50b932bd88c3cad275422c681f
parent1f772234f7bdafe13593f2623f989909b469d141 (diff)
parentbac02a348ee765dd7000108a0933ed03561aaecc (diff)
downloadforums-77bc8ee68bea99a7cd8cd6cfacb1c6292e58d01a.tar
forums-77bc8ee68bea99a7cd8cd6cfacb1c6292e58d01a.tar.gz
forums-77bc8ee68bea99a7cd8cd6cfacb1c6292e58d01a.tar.bz2
forums-77bc8ee68bea99a7cd8cd6cfacb1c6292e58d01a.tar.xz
forums-77bc8ee68bea99a7cd8cd6cfacb1c6292e58d01a.zip
Merge branch '3.1.x'
Conflicts: phpBB/includes/acp/acp_board.php phpBB/includes/acp/acp_jabber.php
-rw-r--r--phpBB/includes/acp/acp_board.php18
-rw-r--r--phpBB/includes/acp/acp_jabber.php7
-rw-r--r--phpBB/includes/functions_acp.php7
-rw-r--r--phpBB/phpbb/auth/provider/ldap.php3
4 files changed, 29 insertions, 6 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index ff3b50174b..018eedda2a 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -501,7 +501,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...
- 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)
{
@@ -533,6 +533,13 @@ class acp_board
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;
+ }
$config->set($config_name, $config_value);
if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable']))
@@ -562,6 +569,7 @@ class acp_board
$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
@@ -577,6 +585,14 @@ class acp_board
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];
$config_value = $cfg_array[$field];
$this->new_config[$field] = $config_value;
diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php
index d860ae27f4..5058e9c769 100644
--- a/phpBB/includes/acp/acp_jabber.php
+++ b/phpBB/includes/acp/acp_jabber.php
@@ -107,7 +107,10 @@ class acp_jabber
$config->set('jab_host', $jab_host);
$config->set('jab_port', $jab_port);
$config->set('jab_username', $jab_username);
- $config->set('jab_password', $jab_password);
+ if ($jab_password !== '********')
+ {
+ $config->set('jab_password', $jab_password);
+ }
$config->set('jab_package_size', $jab_package_size);
$config->set('jab_use_ssl', $jab_use_ssl);
@@ -122,7 +125,7 @@ class acp_jabber
'JAB_HOST' => $jab_host,
'JAB_PORT' => ($jab_port) ? $jab_port : '',
'JAB_USERNAME' => $jab_username,
- 'JAB_PASSWORD' => $jab_password,
+ 'JAB_PASSWORD' => $jab_password !== '' ? '********' : '',
'JAB_PACKAGE_SIZE' => $jab_package_size,
'JAB_USE_SSL' => $jab_use_ssl,
'S_CAN_USE_SSL' => jabber::can_use_ssl(),
diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php
index 6d59b513af..eea18a0c47 100644
--- a/phpBB/includes/functions_acp.php
+++ b/phpBB/includes/functions_acp.php
@@ -245,8 +245,13 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
switch ($tpl_type[0])
{
- case 'text':
case 'password':
+ if ($new[$config_key] !== '')
+ {
+ // replace passwords with asterixes
+ $new[$config_key] = '********';
+ }
+ case 'text':
case 'url':
case 'email':
case 'color':
diff --git a/phpBB/phpbb/auth/provider/ldap.php b/phpBB/phpbb/auth/provider/ldap.php
index c71950c698..c48b771ab0 100644
--- a/phpBB/phpbb/auth/provider/ldap.php
+++ b/phpBB/phpbb/auth/provider/ldap.php
@@ -289,7 +289,6 @@ class ldap extends \phpbb\auth\provider\base
/**
* {@inheritdoc}
*/
-
public function acp()
{
// These are fields required in the config table
@@ -308,7 +307,7 @@ class ldap extends \phpbb\auth\provider\base
'TEMPLATE_VARS' => array(
'AUTH_LDAP_BASE_DN' => $new_config['ldap_base_dn'],
'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_SERVER' => $new_config['ldap_server'],
'AUTH_LDAP_UID' => $new_config['ldap_uid'],