setpassword should return a value, like true, if it ran successfully (minor)

This commit is contained in:
Benjamin Sonntag 2012-08-23 10:26:51 +00:00
parent 3f49b61572
commit 4f960249a9
1 changed files with 6 additions and 1 deletions

View File

@ -357,12 +357,17 @@ class m_mail {
/** /**
* setpasswd a mail address. * setpasswd a mail address.
* @param integer mail_id: unique mail identifier * @param integer mail_id: unique mail identifier
* @return boolean true if the password has been changed. Set $err to a proper error code is false.
*/ */
function setpasswd($mail_id,$pass,$passwd_type){ function setpasswd($mail_id,$pass,$passwd_type){
global $db,$err,$admin; global $db,$err,$admin;
$err->log("mail","setpasswd"); $err->log("mail","setpasswd");
if(!$admin->checkPolicy("pop",$mail_full,$pass)) return false; if(!$admin->checkPolicy("pop",$mail_full,$pass)) return false;
if(!$db->query("UPDATE address SET password='"._md5cr($pass)."' where id=$mail_id;")) return false; if(!$db->query("UPDATE address SET password='"._md5cr($pass)."' where id=$mail_id;")) {
$err->raise("mail",1);
return false;
}
return true;
} }