From 121ae23a83555b34c28b9967113a0cdf1755387a Mon Sep 17 00:00:00 2001 From: alec Date: Fri, 24 Feb 2012 10:17:19 +0000 Subject: - Fixed drivers namespace issues git-svn-id: https://svn.roundcube.net/trunk@5902 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/password/drivers/sasl.php | 47 ++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 23 deletions(-) (limited to 'plugins/password/drivers/sasl.php') diff --git a/plugins/password/drivers/sasl.php b/plugins/password/drivers/sasl.php index f8ac5c606..3e6fe1c8b 100644 --- a/plugins/password/drivers/sasl.php +++ b/plugins/password/drivers/sasl.php @@ -12,33 +12,34 @@ * * For installation instructions please read the README file. * - * @version 1.0 + * @version 2.0 * @author Thomas Bruederli */ - -function password_save($currpass, $newpass) + +class rcube_sasl_password { - $curdir = realpath(dirname(__FILE__)); - $username = escapeshellcmd($_SESSION['username']); - $args = rcmail::get_instance()->config->get('password_saslpasswd_args', ''); + function save($currpass, $newpass) + { + $curdir = realpath(dirname(__FILE__)); + $username = escapeshellcmd($_SESSION['username']); + $args = rcmail::get_instance()->config->get('password_saslpasswd_args', ''); - if ($fh = popen("$curdir/chgsaslpasswd -p $args $username", 'w')) { - fwrite($fh, $newpass."\n"); - $code = pclose($fh); + if ($fh = popen("$curdir/chgsaslpasswd -p $args $username", 'w')) { + fwrite($fh, $newpass."\n"); + $code = pclose($fh); - if ($code == 0) - return PASSWORD_SUCCESS; - } - else { - raise_error(array( - 'code' => 600, - 'type' => 'php', - 'file' => __FILE__, 'line' => __LINE__, - 'message' => "Password plugin: Unable to execute $curdir/chgsaslpasswd" - ), true, false); - } + if ($code == 0) + return PASSWORD_SUCCESS; + } + else { + raise_error(array( + 'code' => 600, + 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Password plugin: Unable to execute $curdir/chgsaslpasswd" + ), true, false); + } - return PASSWORD_ERROR; + return PASSWORD_ERROR; + } } - -?> -- cgit v1.2.3