Lines 2126-2132
Link Here
|
2126 |
* crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, or clear. |
2126 |
* crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, or clear. |
2127 |
* @return string The hashed password. |
2127 |
* @return string The hashed password. |
2128 |
*/ |
2128 |
*/ |
2129 |
function password_hash($password_clear,$enc_type) { |
2129 |
function pla_password_hash($password_clear,$enc_type) { |
2130 |
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) |
2130 |
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) |
2131 |
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs); |
2131 |
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs); |
2132 |
|
2132 |
|
Lines 2307-2313
Link Here
|
2307 |
|
2307 |
|
2308 |
# SHA crypted passwords |
2308 |
# SHA crypted passwords |
2309 |
case 'sha': |
2309 |
case 'sha': |
2310 |
if (strcasecmp(password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0) |
2310 |
if (strcasecmp(pla_password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0) |
2311 |
return true; |
2311 |
return true; |
2312 |
else |
2312 |
else |
2313 |
return false; |
2313 |
return false; |
Lines 2316-2322
Link Here
|
2316 |
|
2316 |
|
2317 |
# MD5 crypted passwords |
2317 |
# MD5 crypted passwords |
2318 |
case 'md5': |
2318 |
case 'md5': |
2319 |
if( strcasecmp(password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0) |
2319 |
if( strcasecmp(pla_password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0) |
2320 |
return true; |
2320 |
return true; |
2321 |
else |
2321 |
else |
2322 |
return false; |
2322 |
return false; |
Lines 2545-2556
Link Here
|
2545 |
$a = array(); |
2545 |
$a = array(); |
2546 |
|
2546 |
|
2547 |
foreach ($dn as $key => $rdn) |
2547 |
foreach ($dn as $key => $rdn) |
2548 |
$a[$key] = preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$rdn); |
2548 |
$a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', |
|
|
2549 |
function ($matches) { return chr(hexdec($matches[1])); }, $rdn ); |
2549 |
|
2550 |
|
2550 |
return $a; |
2551 |
return $a; |
2551 |
|
2552 |
|
2552 |
} else { |
2553 |
} else { |
2553 |
return preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$dn); |
2554 |
return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', |
|
|
2555 |
function ($matches) { return chr(hexdec($matches[1])); }, $dn); |
2554 |
} |
2556 |
} |
2555 |
} |
2557 |
} |
2556 |
|
2558 |
|