bernd commited on 2010-05-06 08:13:00
Zeige 1 geänderte Dateien mit 9 Einfügungen und 0 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1730 87cf0b9e-d624-0410-a070-f6ee81989793
| ... | ... |
@@ -64,9 +64,18 @@ function save_ftpuser($data) |
| 64 | 64 |
$password_query = ''; |
| 65 | 65 |
$password_hash = ''; |
| 66 | 66 |
if ($data['password'] != '') |
| 67 |
+ {
|
|
| 68 |
+ if (defined("CRYPT_SHA512") && CRYPT_SHA512 == 1)
|
|
| 69 |
+ {
|
|
| 70 |
+ $rounds = rand(1000, 5000); |
|
| 71 |
+ $salt = "rounds=".$rounds."$".random_string(8); |
|
| 72 |
+ $password_hash = crypt($data['password'], "\$6\${$salt}\$");
|
|
| 73 |
+ } |
|
| 74 |
+ else |
|
| 67 | 75 |
{
|
| 68 | 76 |
$salt = random_string(8); |
| 69 | 77 |
$password_hash = crypt($data['password'], "\$1\${$salt}\$");
|
| 78 |
+ } |
|
| 70 | 79 |
$password_query = "password='{$password_hash}', ";
|
| 71 | 80 |
} |
| 72 | 81 |
elseif (! $id) |
| 73 | 82 |