functions.inc.php: reduce global usage

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@114 a1433add-5e2c-0410-b055-b7f2511e0802
postfixadmin-2.3
David Goodwin 17 years ago
parent 04ea2698f7
commit 2ffb2ef3e6

@ -1064,12 +1064,10 @@ function pacrypt ($pw, $pw_db="")
// Action: Creates MD5 encrypted password
// Call: md5crypt (string cleartextpassword)
//
$MAGIC = "$1$";
$ITOA64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
function md5crypt ($pw, $salt="", $magic="")
{
global $MAGIC;
$MAGIC = "$1$";
if ($magic == "") $magic = $MAGIC;
if ($salt == "") $salt = create_salt ();
@ -1155,7 +1153,7 @@ function hex2bin ($str)
function to64 ($v, $n)
{
global $ITOA64;
$ITOA64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
$ret = "";
while (($n - 1) >= 0)
{

Loading…
Cancel
Save