functions.inc.php: support base64 encoded sha1 passwords (flavour=SHA); thanks to mez@sourceguru.net

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@698 a1433add-5e2c-0410-b055-b7f2511e0802
postfixadmin-2.3
David Goodwin 16 years ago
parent df41f03d96
commit d487507e8e

@ -1184,8 +1184,10 @@ function pacrypt ($pw, $pw_db="")
$password = '{' . $flavor . '}' . base64_encode(md5($pw, TRUE));
} elseif(stripos($flavor, 'crypt') === 0) {
$password = '{' . $flavor . '}' . crypt($pw, $salt);
} elseif(stripos($flavor, 'SHA') === 0) {
$password = '{' . $flavor . '}' . base64_encode(sha1($pw, TRUE));
} else {
die("authlib_default_flavor '" . $flavor . "' unknown. Valid flavors are 'md5raw', 'md5' and 'crypt'");
die("authlib_default_flavor '" . $flavor . "' unknown. Valid flavors are 'md5raw', 'md5', 'SHA' and 'crypt'");
}
}

Loading…
Cancel
Save