6 * Driver that adds functionality to change the users Cyrus/SASL password.
7 * The code is derrived from the Squirrelmail "Change SASL Password" Plugin
10 * It only works with saslpasswd2 on the same host where RoundCube runs
11 * and requires shell access and gcc in order to compile the binary.
13 * For installation instructions please read the README file.
16 * @author Thomas Bruederli
19 function password_save($currpass, $newpass)
21 $curdir = realpath(dirname(__FILE__));
22 $username = escapeshellcmd($_SESSION['username']);
23 $args = rcmail::get_instance()->config->get('password_saslpasswd_args', '');
25 if ($fh = popen("$curdir/chgsaslpasswd -p $args $username", 'w')) {
26 fwrite($fh, $newpass."\n");
30 return PASSWORD_SUCCESS;
37 'message' => "Password plugin: Unable to execute $curdir/chgsaslpasswd"
41 return PASSWORD_ERROR;