From 4f960249a9519eeab154c906fa3f9550eb0cdaab Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Thu, 23 Aug 2012 10:26:51 +0000 Subject: [PATCH] setpassword should return a value, like true, if it ran successfully (minor) --- bureau/class/m_mail.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bureau/class/m_mail.php b/bureau/class/m_mail.php index 3538a45f..597b62e7 100644 --- a/bureau/class/m_mail.php +++ b/bureau/class/m_mail.php @@ -357,12 +357,17 @@ class m_mail { /** * setpasswd a mail address. * @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){ global $db,$err,$admin; $err->log("mail","setpasswd"); 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; }