bernd commited on 2007-05-03 17:59:19
Zeige 1 geänderte Dateien mit 3 Einfügungen und 13 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@448 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -31,23 +31,13 @@ function get_mailaccount($id) |
31 | 31 |
return $ret; |
32 | 32 |
} |
33 | 33 |
|
34 |
-/* |
|
35 |
- FIXME: Hier auch die crypt-Funktion nehmen wie beim systemuser-Passwort |
|
36 |
-*/ |
|
37 | 34 |
function encrypt_mail_password($pw) |
38 | 35 |
{ |
39 | 36 |
DEBUG("unencrypted PW: ".$pw); |
40 |
- $descriptorspec = array( |
|
41 |
- 0 => array("pipe", "r"), |
|
42 |
- 1 => array("pipe", "w") |
|
43 |
- ); |
|
44 |
- $process = proc_open("/usr/local/bin/exec/userdbpw -md5", $descriptorspec, $pipes); |
|
45 |
- fwrite($pipes[0], $pw); |
|
46 |
- fclose($pipes[0]); |
|
47 |
- $encpw = fgets($pipes[1]); |
|
37 |
+ require_once('inc/base.php'); |
|
38 |
+ $salt = random_string(8); |
|
39 |
+ $encpw = crypt($pw, "\$1\${$salt}\$"); |
|
48 | 40 |
DEBUG("encrypted PW: ".$encpw); |
49 |
- fclose($pipes[1]); |
|
50 |
- proc_close($process); |
|
51 | 41 |
return chop($encpw); |
52 | 42 |
|
53 | 43 |
} |
54 | 44 |