6 * Driver that adds functionality to change the systems user password via
7 * the 'chpasswd' command.
9 * For installation instructions please read the README file.
12 * @author Alex Cartwright <acartwright@mutinydesign.co.uk)
15 function password_save($currpass, $newpass)
17 $cmd = rcmail::get_instance()->config->get('password_chpasswd_cmd');
18 $username = $_SESSION['username'];
20 $handle = popen($cmd, "w");
21 fwrite($handle, "$username:$newpass\n");
23 if (pclose($handle) == 0) {
24 return PASSWORD_SUCCESS;
30 'file' => __FILE__, 'line' => __LINE__,
31 'message' => "Password plugin: Unable to execute $cmd"
35 return PASSWORD_ERROR;