4 * Virtualmin Password Driver
6 * Driver that adds functionality to change the users Virtualmin password.
7 * The code is derrived from the Squirrelmail "Change Cyrus/SASL Password" Plugin
10 * It only works with virtualmin on the same host where Roundcube runs
11 * and requires shell access and gcc in order to compile the binary.
14 * @author Martijn de Munnik
17 function password_save($currpass, $newpass)
19 $curdir = realpath(dirname(__FILE__));
20 $username = escapeshellcmd($_SESSION['username']);
21 $domain = substr(strrchr($username, "@"), 1);
23 exec("$curdir/chgvirtualminpasswd modify-user --domain $domain --user $username --pass $newpass", $output, $returnvalue);
25 if ($returnvalue == 0) {
26 return PASSWORD_SUCCESS;
32 'file' => __FILE__, 'line' => __LINE__,
33 'message' => "Password plugin: Unable to execute $curdir/chgvirtualminpasswd"
37 return PASSWORD_ERROR;