From 98128f13fcdc8dca6ebefcdc93dc94b00322abb5 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 16 Nov 2012 19:49:02 +0100 Subject: Rename option password_supported_hosts to password_hosts, code cleanup --- plugins/password/config.inc.php.dist | 15 ++++++--------- plugins/password/package.xml | 1 + plugins/password/password.php | 10 +++++----- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/plugins/password/config.inc.php.dist b/plugins/password/config.inc.php.dist index db5c47b02..e960bbe00 100644 --- a/plugins/password/config.inc.php.dist +++ b/plugins/password/config.inc.php.dist @@ -1,14 +1,5 @@ GNU GPLv2 - Fix wrong (non-specific) error message on crypt or connection error (#1488808) +- Added option to define IMAP hosts that support password changes - password_hosts diff --git a/plugins/password/password.php b/plugins/password/password.php index cd0f5f1e0..028a58d3e 100644 --- a/plugins/password/password.php +++ b/plugins/password/password.php @@ -55,14 +55,14 @@ class password extends rcube_plugin $rcmail = rcmail::get_instance(); $this->load_config(); - - $host = isset( $_SESSION['imap_host'] ) ? $_SESSION['imap_host'] : NULL; - $hosts = $rcmail->config->get( 'password_supported_hosts' ); - if ( !empty( $hosts ) and !in_array( $host, $hosts ) ) { + + // Host exceptions + $hosts = $rcmail->config->get('password_hosts'); + if (!empty($hosts) && !in_array($_SESSION['storage_host'], $hosts)) { return; } - // Exceptions list + // Login exceptions if ($exceptions = $rcmail->config->get('password_login_exceptions')) { $exceptions = array_map('trim', (array) $exceptions); $exceptions = array_filter($exceptions); -- cgit v1.2.3