From 5375e84b75eb23e730f9fd44d042a413970bdc7f Mon Sep 17 00:00:00 2001 From: thomascube Date: Tue, 16 Aug 2011 19:44:01 +0000 Subject: Copying plugins into 0.6 release branch --- plugins/password/drivers/chpasswd.php | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 plugins/password/drivers/chpasswd.php (limited to 'plugins/password/drivers/chpasswd.php') diff --git a/plugins/password/drivers/chpasswd.php b/plugins/password/drivers/chpasswd.php new file mode 100644 index 000000000..28c3e5d7a --- /dev/null +++ b/plugins/password/drivers/chpasswd.php @@ -0,0 +1,36 @@ +config->get('password_chpasswd_cmd'); + $username = $_SESSION['username']; + + $handle = popen($cmd, "w"); + fwrite($handle, "$username:$newpass\n"); + + if (pclose($handle) == 0) { + return PASSWORD_SUCCESS; + } + else { + raise_error(array( + 'code' => 600, + 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Password plugin: Unable to execute $cmd" + ), true, false); + } + + return PASSWORD_ERROR; +} -- cgit v1.2.3