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(+) (limited to 'plugins/password/password.php') 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 From 204e1e03e9cd6a9007e4fc7ff4202b09dc9ea2b2 Mon Sep 17 00:00:00 2001 From: NETLINK Date: Fri, 9 Nov 2012 05:13:22 +0000 Subject: Update plugins/password/password.php --- plugins/password/password.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/password/password.php') diff --git a/plugins/password/password.php b/plugins/password/password.php index bf7a95f69..320d5d037 100644 --- a/plugins/password/password.php +++ b/plugins/password/password.php @@ -3,7 +3,7 @@ /* +-------------------------------------------------------------------------+ | Password Plugin for Roundcube | - | @version @package_version@ | + | @version @package_version@ | | | | Copyright (C) 2009-2010, Roundcube Dev. | | | @@ -58,7 +58,7 @@ class password extends rcube_plugin $host = isset( $_SESSION['imap_host'] ) ? $_SESSION['imap_host'] : NULL; $hosts = $rcmail->config->get( 'password_supported_hosts' ); - if ( !empty( $hosts ) and !in_array( $host, $hosts ) { + if ( !empty( $hosts ) and !in_array( $host, $hosts ) ) { return; } -- cgit v1.2.3