From 7978f872cbd154b169fc9395a3103031f056cf29 Mon Sep 17 00:00:00 2001 From: NETLINK Date: Fri, 9 Nov 2012 05:00:22 +0000 Subject: Update plugins/password/password.php Add logic for checking supported IMAP hosts Make use of additional config option 'password_supported_hosts' (see config.inc.php.dist). If current IMAP host is not in array of defined hosts, exit and suppress Password option in Settings. --- plugins/password/password.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/password/password.php b/plugins/password/password.php index 58b6f8cd9..bf7a95f69 100644 --- a/plugins/password/password.php +++ b/plugins/password/password.php @@ -55,6 +55,12 @@ 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 ) { + return; + } // Exceptions list if ($exceptions = $rcmail->config->get('password_login_exceptions')) { -- cgit v1.2.3