bernd commited on 2010-04-29 08:30:29
Zeige 1 geänderte Dateien mit 4 Einfügungen und 3 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1729 87cf0b9e-d624-0410-a070-f6ee81989793
| ... | ... |
@@ -1,19 +1,20 @@ |
| 1 | 1 |
<?php |
| 2 | 2 |
|
| 3 |
-function encrypt_mail_password($pw) |
|
| 3 |
+function encrypt_mail_password($newpass) |
|
| 4 | 4 |
{
|
| 5 |
- DEBUG("unencrypted PW: ".$pw);
|
|
| 5 |
+ DEBUG("unencrypted PW: »".$newpass."«");
|
|
| 6 | 6 |
require_once('inc/base.php');
|
| 7 |
- $newpass = ''; |
|
| 8 | 7 |
if (defined("CRYPT_SHA512") && CRYPT_SHA512 == 1)
|
| 9 | 8 |
{
|
| 10 | 9 |
$rounds = rand(1000, 5000); |
| 11 | 10 |
$salt = "rounds=".$rounds."$".random_string(8); |
| 11 |
+ DEBUG("crypt(\"{$newpass}\", \"\$6\${$salt}\$\");");
|
|
| 12 | 12 |
$newpass = crypt($newpass, "\$6\${$salt}\$");
|
| 13 | 13 |
} |
| 14 | 14 |
else |
| 15 | 15 |
{
|
| 16 | 16 |
$salt = random_string(8); |
| 17 |
+ DEBUG("crypt(\"{$newpass}\", \"\$1\${$salt}\$\");");
|
|
| 17 | 18 |
$newpass = crypt($newpass, "\$1\${$salt}\$");
|
| 18 | 19 |
} |
| 19 | 20 |
DEBUG("encrypted PW: ".$newpass);
|
| 20 | 21 |