bug fixes

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@585 a1433add-5e2c-0410-b055-b7f2511e0802
postfixadmin-2.3
David Goodwin 16 years ago
parent 8d44769372
commit 139ebbb170

@ -4,7 +4,13 @@
* Simple class to represent a user. * Simple class to represent a user.
*/ */
class UserHandler { class UserHandler {
protected $username = null;
public function __construct($username) {
$this->username = $username;
}
/** /**
* @return boolean true on success; false on failure * @return boolean true on success; false on failure
* @param string $username * @param string $username
@ -14,12 +20,9 @@ class UserHandler {
* All passwords need to be plain text; they'll be hashed appropriately * All passwords need to be plain text; they'll be hashed appropriately
* as per the configuration in config.inc.php * as per the configuration in config.inc.php
*/ */
public function change_pass($username, $old_password, $new_password) { public function change_pass($old_password, $new_password) {
global $config; global $config;
if(!UserHandler::login($username, $old_password)) { $username = $this->username;
return false;
}
$tmp = preg_split ('/@/', $username); $tmp = preg_split ('/@/', $username);
$USERID_DOMAIN = $tmp[1]; $USERID_DOMAIN = $tmp[1];

Loading…
Cancel
Save