Line
Link Here
|
0 |
-- a/lib/PageRender.php |
0 |
++ b/lib/PageRender.php |
Lines 287-293
Link Here
|
287 |
break; |
287 |
break; |
288 |
|
288 |
|
289 |
default: |
289 |
default: |
290 |
$vals[$i] = password_hash($passwordvalue,$enc); |
290 |
$vals[$i] = password_hash_custom($passwordvalue,$enc); |
291 |
} |
291 |
} |
292 |
|
292 |
|
293 |
$vals = array_unique($vals); |
293 |
$vals = array_unique($vals); |
Lines 957-963
Link Here
|
957 |
if (trim($val)) |
957 |
if (trim($val)) |
958 |
$enc_type = get_enc_type($val); |
958 |
$enc_type = get_enc_type($val); |
959 |
else |
959 |
else |
960 |
$enc_type = $server->getValue('appearance','password_hash'); |
960 |
$enc_type = $server->getValue('appearance','password_hash_custom'); |
961 |
|
961 |
|
962 |
$obfuscate_password = obfuscate_password_display($enc_type); |
962 |
$obfuscate_password = obfuscate_password_display($enc_type); |
963 |
|
963 |
|
Lines 982-988
Link Here
|
982 |
if (trim($val)) |
982 |
if (trim($val)) |
983 |
$enc_type = get_enc_type($val); |
983 |
$enc_type = get_enc_type($val); |
984 |
else |
984 |
else |
985 |
$enc_type = $server->getValue('appearance','password_hash'); |
985 |
$enc_type = $server->getValue('appearance','password_hash_custom'); |
986 |
|
986 |
|
987 |
echo '<table cellspacing="0" cellpadding="0"><tr><td valign="top">'; |
987 |
echo '<table cellspacing="0" cellpadding="0"><tr><td valign="top">'; |
988 |
|
988 |
|
989 |
-- a/lib/ds_ldap_pla.php |
989 |
++ b/lib/ds_ldap_pla.php |
Lines 16-22
Link Here
|
16 |
function __construct($index) { |
16 |
function __construct($index) { |
17 |
parent::__construct($index); |
17 |
parent::__construct($index); |
18 |
|
18 |
|
19 |
$this->default->appearance['password_hash'] = array( |
19 |
$this->default->appearance['password_hash_custom'] = array( |
20 |
'desc'=>'Default HASH to use for passwords', |
20 |
'desc'=>'Default HASH to use for passwords', |
21 |
'default'=>'md5'); |
21 |
'default'=>'md5'); |
22 |
|
22 |
|
23 |
-- a/lib/functions.php |
23 |
++ b/lib/functions.php |
Lines 2127-2133
Link Here
|
2127 |
* crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, sha512, or clear. |
2127 |
* crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, sha512, or clear. |
2128 |
* @return string The hashed password. |
2128 |
* @return string The hashed password. |
2129 |
*/ |
2129 |
*/ |
2130 |
function password_hash($password_clear,$enc_type) { |
2130 |
function password_hash_custom($password_clear,$enc_type) { |
2131 |
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) |
2131 |
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) |
2132 |
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs); |
2132 |
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs); |
2133 |
|
2133 |
|
Lines 2318-2324
Link Here
|
2318 |
|
2318 |
|
2319 |
# SHA crypted passwords |
2319 |
# SHA crypted passwords |
2320 |
case 'sha': |
2320 |
case 'sha': |
2321 |
if (strcasecmp(password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0) |
2321 |
if (strcasecmp(password_hash_custom($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0) |
2322 |
return true; |
2322 |
return true; |
2323 |
else |
2323 |
else |
2324 |
return false; |
2324 |
return false; |
Lines 2327-2333
Link Here
|
2327 |
|
2327 |
|
2328 |
# MD5 crypted passwords |
2328 |
# MD5 crypted passwords |
2329 |
case 'md5': |
2329 |
case 'md5': |
2330 |
if( strcasecmp(password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0) |
2330 |
if( strcasecmp(password_hash_custom($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0) |
2331 |
return true; |
2331 |
return true; |
2332 |
else |
2332 |
else |
2333 |
return false; |
2333 |
return false; |
Lines 2392-2398
Link Here
|
2392 |
|
2392 |
|
2393 |
# SHA512 crypted passwords |
2393 |
# SHA512 crypted passwords |
2394 |
case 'sha512': |
2394 |
case 'sha512': |
2395 |
if (strcasecmp(password_hash($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0) |
2395 |
if (strcasecmp(password_hash_custom($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0) |
2396 |
return true; |
2396 |
return true; |
2397 |
else |
2397 |
else |
2398 |
return false; |
2398 |
return false; |