|
@@ -292,7 +292,7 @@ function Login2()
|
|
|
$other_passwords = array();
|
|
|
|
|
|
// None of the below cases will be used most of the time (because the salt is normally set.)
|
|
|
- if ($user_settings['password_salt'] == '')
|
|
|
+ if (!empty($modSettings['enable_password_conversion']) && $user_settings['password_salt'] == '')
|
|
|
{
|
|
|
// YaBB SE, Discus, MD5 (used a lot), SHA-1 (used some), SMF 1.0.x, IkonBoard, and none at all.
|
|
|
$other_passwords[] = crypt($_POST['passwrd'], substr($_POST['passwrd'], 0, 2));
|
|
@@ -318,7 +318,7 @@ function Login2()
|
|
|
$other_passwords[] = md5(crypt($_POST['passwrd'], 'CRYPT_MD5'));
|
|
|
}
|
|
|
// The hash should be 40 if it's SHA-1, so we're safe with more here too.
|
|
|
- elseif (strlen($user_settings['passwd']) == 32)
|
|
|
+ elseif (!empty($modSettings['enable_password_conversion']) && strlen($user_settings['passwd']) == 32)
|
|
|
{
|
|
|
// vBulletin 3 style hashing? Let's welcome them with open arms \o/.
|
|
|
$other_passwords[] = md5(md5($_POST['passwrd']) . $user_settings['password_salt']);
|
|
@@ -336,7 +336,8 @@ function Login2()
|
|
|
$other_passwords[] = sha1(strtolower($user_settings['member_name']) . un_htmlspecialchars($_POST['passwrd']));
|
|
|
|
|
|
// BurningBoard3 style of hashing.
|
|
|
- $other_passwords[] = sha1($user_settings['password_salt'] . sha1($user_settings['password_salt'] . sha1($_POST['passwrd'])));
|
|
|
+ if (!empty($modSettings['enable_password_conversion']))
|
|
|
+ $other_passwords[] = sha1($user_settings['password_salt'] . sha1($user_settings['password_salt'] . sha1($_POST['passwrd'])));
|
|
|
|
|
|
// Perhaps we converted to UTF-8 and have a valid password being hashed differently.
|
|
|
if ($context['character_set'] == 'utf8' && !empty($modSettings['previousCharacterSet']) && $modSettings['previousCharacterSet'] != 'utf8')
|