Skip to content

Commit 7438923

Browse files
author
Marius Burkard
committed
- use password crypting function of auth module in client edit (Fixes #3147)
1 parent 33e9d6e commit 7438923

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

interface/web/client/client_edit.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,7 @@ function onAfterUpdate() {
408408
// password changed
409409
if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord["password"]) && $this->dataRecord["password"] != '') {
410410
$password = $this->dataRecord["password"];
411-
$salt="$1$";
412-
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
413-
for ($n=0;$n<8;$n++) {
414-
$salt.=$base64_alphabet[mt_rand(0, 63)];
415-
}
416-
$salt.="$";
417-
$password = crypt(stripslashes($password), $salt);
411+
$password = $app->auth->crypt_password($password);
418412
$client_id = $this->id;
419413
$sql = "UPDATE sys_user SET passwort = ? WHERE client_id = ?";
420414
$app->db->query($sql, $password, $client_id);

0 commit comments

Comments
 (0)