From c7117e4c5824939bc0dffedb2f9e2db2bd646dcc Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Sun, 18 Jan 2004 15:24:41 +0000 Subject: [PATCH] add currently unused sql password functions --- setup/inc/hook_config.inc.php | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/setup/inc/hook_config.inc.php b/setup/inc/hook_config.inc.php index f2dcfef6a2..dc0a4d2175 100644 --- a/setup/inc/hook_config.inc.php +++ b/setup/inc/hook_config.inc.php @@ -134,4 +134,53 @@ } return $out; } + + function sql_passwdhashes($config) + { + $hashes = array( + 'md5' => 'md5' + ); + + /* Check for available crypt methods based on what is defined by php */ + if(@defined('CRYPT_BLOWFISH') && CRYPT_BLOWFISH == 1) + { + $hashes['blowish_crypt'] = 'blowish_crypt'; + } + if(@defined('CRYPT_MD5') && CRYPT_MD5 == 1) + { + $hashes['md5_crypt'] = 'md5_crypt'; + } + if(@defined('CRYPT_EXT_DES') && CRYPT_EXT_DES == 1) + { + $hashes['ext_crypt'] = 'ext_crypt'; + } + if(@defined('CRYPT_STD_DES') && CRYPT_STD_DES == 1) + { + $hashes['crypt'] = 'crypt'; + } + + if(@function_exists('mhash')) + { + $hashes += array( + 'sha' => 'sha', + 'ssha' => 'ssha' + ); + } + + while(list($key, $value) = each($hashes)) + { + if($config['sql_encryption_type'] == $value) + { + $selected = ' selected'; + } + else + { + $selected = ''; + } + $descr = strtoupper($value); + + $out .= '' . "\n"; + } + return $out; + } ?>