mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-19 19:22:14 +02:00
functions.inc.php
- added comment about courier-authlib supporting only two-character salt (see mail from Jan Röhrich in postfixadmin-devel about r560) - fixed vim: line - functions.inc.php uses 4 spaces - replaced "else if" with "elseif" - replaced tabs with spaces git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@564 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
parent
69034b38c9
commit
68943a5477
@ -1163,7 +1163,7 @@ function pacrypt ($pw, $pw_db="")
|
||||
|
||||
if ($CONF['encrypt'] == 'authlib') {
|
||||
$flavor = $CONF['authlib_default_flavor'];
|
||||
$salt = substr(create_salt(), 0, 2);
|
||||
$salt = substr(create_salt(), 0, 2); # courier-authlib supports only two-character salts
|
||||
if(ereg('^{.*}', $pw_db)) {
|
||||
// we have a flavor in the db -> use it instead of default flavor
|
||||
$result = split('{|}', $pw_db, 3);
|
||||
@ -1173,9 +1173,9 @@ function pacrypt ($pw, $pw_db="")
|
||||
|
||||
if(stripos($flavor, 'md5raw') === 0) {
|
||||
$password = '{' . $flavor . '}' . md5($pw);
|
||||
} else if(stripos($flavor, 'md5') === 0) {
|
||||
} elseif(stripos($flavor, 'md5') === 0) {
|
||||
$password = '{' . $flavor . '}' . base64_encode(md5($pw, TRUE));
|
||||
} else if(stripos($flavor, 'crypt') === 0) {
|
||||
} elseif(stripos($flavor, 'crypt') === 0) {
|
||||
$password = '{' . $flavor . '}' . crypt($pw, $salt);
|
||||
} else {
|
||||
die("authlib_default_flavor '" . $flavor . "' unknown. Valid flavors are 'md5raw', 'md5' and 'crypt'");
|
||||
@ -2296,4 +2296,4 @@ $table_mailbox = table_by_key ('mailbox');
|
||||
$table_vacation = table_by_key ('vacation');
|
||||
$table_vacation_notification = table_by_key('vacation_notification');
|
||||
$table_quota = table_by_key ('quota');
|
||||
/* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
|
||||
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
|
||||
|
Loading…
Reference in New Issue
Block a user