le mdp des comptes mails étaient changés dans certains cas où il ne fallait pas
This commit is contained in:
parent
65f994f763
commit
f6f5a15ded
|
@ -57,9 +57,19 @@ if (!$res=$mail->get_details($mail_id)) {
|
|||
exit();
|
||||
} else {
|
||||
$canbeempty = ($islocal != 1 || ($islocal == 1 && !$new_account))?true:false;
|
||||
if (!$mail->set_passwd($mail_id,$pass,$canbeempty)) { /* SET THE PASSWORD */
|
||||
include ("mail_edit.php");
|
||||
exit();
|
||||
if ($new_account || !empty($pass) || $islocal != 1) {
|
||||
if ($islocal != 1)
|
||||
$pass = "";
|
||||
|
||||
if (!$mail->set_passwd($mail_id,$pass,$canbeempty)) { /* SET THE PASSWORD */
|
||||
include ("mail_edit.php");
|
||||
exit();
|
||||
}
|
||||
} else if (!$new_account && empty($pass) && $islocal == 1 && $res['password'] == "") {
|
||||
if (!$mail->set_passwd($mail_id,$pass, false)) { /* SET THE PASSWORD */
|
||||
include ("mail_edit.php");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -615,7 +615,9 @@ ORDER BY
|
|||
if (!$admin->checkPolicy("pop", $email, $pass, $canbeempty)) {
|
||||
return false;
|
||||
}
|
||||
if (!$db->query("UPDATE address SET password= ? where id = ? ;", array(_md5cr($pass), $mail_id ))) {
|
||||
if ($canbeempty && empty($pass)) {
|
||||
return $db->query("UPDATE address SET password= ? where id = ? ;", array(null, $mail_id ));
|
||||
} else if (!$db->query("UPDATE address SET password= ? where id = ? ;", array(_md5cr($pass), $mail_id ))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue