|
|
@ -1163,7 +1163,7 @@ function pacrypt ($pw, $pw_db="")
|
|
|
|
|
|
|
|
|
|
|
|
if ($CONF['encrypt'] == 'authlib') {
|
|
|
|
if ($CONF['encrypt'] == 'authlib') {
|
|
|
|
$flavor = $CONF['authlib_default_flavor'];
|
|
|
|
$flavor = $CONF['authlib_default_flavor'];
|
|
|
|
$salt = ' ';
|
|
|
|
$salt = substr(create_salt(), 0, 2);
|
|
|
|
if(ereg('^{.*}', $pw_db)) {
|
|
|
|
if(ereg('^{.*}', $pw_db)) {
|
|
|
|
// we have a flavor in the db -> use it instead of default flavor
|
|
|
|
// we have a flavor in the db -> use it instead of default flavor
|
|
|
|
$result = split('{|}', $pw_db, 3);
|
|
|
|
$result = split('{|}', $pw_db, 3);
|
|
|
@ -1177,6 +1177,8 @@ function pacrypt ($pw, $pw_db="")
|
|
|
|
$password = '{' . $flavor . '}' . base64_encode(md5($pw, TRUE));
|
|
|
|
$password = '{' . $flavor . '}' . base64_encode(md5($pw, TRUE));
|
|
|
|
} else if(stripos($flavor, 'crypt') === 0) {
|
|
|
|
} else if(stripos($flavor, 'crypt') === 0) {
|
|
|
|
$password = '{' . $flavor . '}' . crypt($pw, $salt);
|
|
|
|
$password = '{' . $flavor . '}' . crypt($pw, $salt);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
die("authlib_default_flavor '" . $flavor . "' unknown. Valid flavors are 'md5raw', 'md5' and 'crypt'");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|