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,10 +57,20 @@ if (!$res=$mail->get_details($mail_id)) {
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
$canbeempty = ($islocal != 1 || ($islocal == 1 && !$new_account))?true:false;
|
$canbeempty = ($islocal != 1 || ($islocal == 1 && !$new_account))?true:false;
|
||||||
|
if ($new_account || !empty($pass) || $islocal != 1) {
|
||||||
|
if ($islocal != 1)
|
||||||
|
$pass = "";
|
||||||
|
|
||||||
if (!$mail->set_passwd($mail_id,$pass,$canbeempty)) { /* SET THE PASSWORD */
|
if (!$mail->set_passwd($mail_id,$pass,$canbeempty)) { /* SET THE PASSWORD */
|
||||||
include ("mail_edit.php");
|
include ("mail_edit.php");
|
||||||
exit();
|
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)) {
|
if (!$admin->checkPolicy("pop", $email, $pass, $canbeempty)) {
|
||||||
return false;
|
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 false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue