diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-11-16 19:49:02 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-11-16 19:49:02 +0100 |
commit | 98128f13fcdc8dca6ebefcdc93dc94b00322abb5 (patch) | |
tree | 58dd49ce23f2a4dde93bec3baf53ea0e078d44be /plugins/password | |
parent | 657864a29c96b15069a304693cc557b1d9b27b1c (diff) |
Rename option password_supported_hosts to password_hosts, code cleanup
Diffstat (limited to 'plugins/password')
-rw-r--r-- | plugins/password/config.inc.php.dist | 15 | ||||
-rw-r--r-- | plugins/password/package.xml | 1 | ||||
-rw-r--r-- | 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 @@ <?php -// Supported hosts -// ----------------------- -// Array of hosts that support password changing. -// Default is NULL. Supported hosts will feature -// a Password option in Settings; others will not. -// Example: -//$rcmail_config['password_supported_hosts'] = array( 'mail.example.com', 'mail2.example.org' ); -$rcmail_config['password_supported_hosts'] = NULL; - // Password Plugin options // ----------------------- // A driver to use for password change. Default: "sql". @@ -34,6 +25,12 @@ $rcmail_config['password_log'] = false; // will be not available (no Password tab in Settings) $rcmail_config['password_login_exceptions'] = null; +// Array of hosts that support password changing. Default is NULL. +// Listed hosts will feature a Password option in Settings; others will not. +// Example: +//$rcmail_config['password_hosts'] = array('mail.example.com', 'mail2.example.org'); +$rcmail_config['password_hosts'] = null; + // SQL Driver options // ------------------ diff --git a/plugins/password/package.xml b/plugins/password/package.xml index e639a04ef..9a056dec6 100644 --- a/plugins/password/package.xml +++ b/plugins/password/package.xml @@ -27,6 +27,7 @@ <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> <notes> - Fix wrong (non-specific) error message on crypt or connection error (#1488808) +- Added option to define IMAP hosts that support password changes - password_hosts </notes> <contents> <dir baseinstalldir="/" name="/"> 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); |