summaryrefslogtreecommitdiff
path: root/plugins/password/drivers/sasl.php
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2012-02-24 10:17:19 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2012-02-24 10:17:19 +0000
commit121ae23a83555b34c28b9967113a0cdf1755387a (patch)
tree8fe7044c54773f041b2111808ff11e973e801a90 /plugins/password/drivers/sasl.php
parent85fefe3e33be4824377161c4587ec4141bfc57f4 (diff)
- Fixed drivers namespace issues
git-svn-id: https://svn.roundcube.net/trunk@5902 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/password/drivers/sasl.php')
-rw-r--r--plugins/password/drivers/sasl.php47
1 files changed, 24 insertions, 23 deletions
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;
+ }
}
-
-?>