From beb5bc650559db7771a78e57cecbe6c4fccbd4aa Mon Sep 17 00:00:00 2001 From: alec Date: Wed, 7 Mar 2012 09:48:33 +0000 Subject: - Added pw_usermod driver (#1487826) - Added option password_login_exceptions (#1487826) git-svn-id: https://svn.roundcube.net/trunk@5973 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/password/password.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'plugins/password/password.php') diff --git a/plugins/password/password.php b/plugins/password/password.php index 5ed08ed42..58b6f8cd9 100644 --- a/plugins/password/password.php +++ b/plugins/password/password.php @@ -53,6 +53,22 @@ class password extends rcube_plugin function init() { $rcmail = rcmail::get_instance(); + + $this->load_config(); + + // Exceptions list + if ($exceptions = $rcmail->config->get('password_login_exceptions')) { + $exceptions = array_map('trim', (array) $exceptions); + $exceptions = array_filter($exceptions); + $username = $_SESSION['username']; + + foreach ($exceptions as $ec) { + if ($username === $ec) { + return; + } + } + } + // add Tab label $rcmail->output->add_label('password'); $this->register_action('plugin.password', array($this, 'password_init')); @@ -73,7 +89,6 @@ class password extends rcube_plugin function password_save() { $rcmail = rcmail::get_instance(); - $this->load_config(); $this->add_texts('localization/'); $this->register_handler('plugin.body', array($this, 'password_form')); @@ -87,7 +102,6 @@ class password extends rcube_plugin $rcmail->output->command('display_message', $this->gettext('nopassword'), 'error'); } else { - $charset = strtoupper($rcmail->config->get('password_charset', 'ISO-8859-1')); $rc_charset = strtoupper($rcmail->output->get_charset()); @@ -159,7 +173,6 @@ class password extends rcube_plugin function password_form() { $rcmail = rcmail::get_instance(); - $this->load_config(); // add some labels to client $rcmail->output->add_label( -- cgit v1.2.3