bernd commited on 2010-04-13 11:37:39
Zeige 1 geänderte Dateien mit 9 Einfügungen und 0 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1724 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -175,8 +174,17 @@ function set_systemuser_password($uid, $newpass) |
175 | 174 |
{ |
176 | 175 |
$uid = (int) $uid; |
177 | 176 |
require_once('inc/base.php'); |
177 |
+ if (defined("CRYPT_SHA512") && CRYPT_SHA512 == 1) |
|
178 |
+ { |
|
179 |
+ $rounds = rand(1000, 5000); |
|
180 |
+ $salt = "rounds=".$rounds."$".random_string(8); |
|
181 |
+ $newpass = crypt($newpass, "\$6\${$salt}\$"); |
|
182 |
+ } |
|
183 |
+ else |
|
184 |
+ { |
|
178 | 185 |
$salt = random_string(8); |
179 | 186 |
$newpass = crypt($newpass, "\$1\${$salt}\$"); |
187 |
+ } |
|
180 | 188 |
db_query("UPDATE system.passwoerter SET passwort='$newpass' WHERE uid='".$uid."' LIMIT 1"); |
181 | 189 |
logger(LOG_INFO, "session/checkuser", "pwchange", "changed user's password."); |
182 | 190 |
} |
183 | 191 |