Unverified Commit 72f3ab1c authored by Stefano Borzì's avatar Stefano Borzì Committed by GitHub
Browse files

Merge pull request #4 from masterking32/master

Update
parents 5bd6c14c fd1a4261
...@@ -51,6 +51,8 @@ $config['battlenet_support'] = false; ...@@ -51,6 +51,8 @@ $config['battlenet_support'] = false;
/*=================================================================== /*===================================================================
If your core password encryption is SRP6, you need to enable it. If your core password encryption is SRP6, you need to enable it.
For last versions of the TrinityCore(3.3.5/master) you need to enable it. https://git.io/JJRH4 and https://git.io/JJrxq For last versions of the TrinityCore(3.3.5/master) you need to enable it. https://git.io/JJRH4 and https://git.io/JJrxq
Enable that if you use the last version of TC.
You need to enable the GMP extension for PHP.
=====================================================================*/ =====================================================================*/
$config['srp6_support'] = false; $config['srp6_support'] = false;
/*=================================================================== /*===================================================================
......
...@@ -287,7 +287,7 @@ class user ...@@ -287,7 +287,7 @@ class user
'id[=]' => $userinfo['id'] 'id[=]' => $userinfo['id']
]); ]);
} else { } else {
if (verifySRP6($userinfo['username'], $_POST['old_password'], $userinfo['salt'], $userinfo['verifier'])) { if (!verifySRP6($userinfo['username'], $_POST['old_password'], $userinfo['salt'], $userinfo['verifier'])) {
error_msg('Old password is not valid.'); error_msg('Old password is not valid.');
return false; return false;
} }
...@@ -295,10 +295,7 @@ class user ...@@ -295,10 +295,7 @@ class user
list($salt, $verifier) = getRegistrationData(strtoupper($userinfo['username']), $_POST['password']); list($salt, $verifier) = getRegistrationData(strtoupper($userinfo['username']), $_POST['password']);
database::$auth->update('account', [ database::$auth->update('account', [
'salt' => $salt, 'salt' => $salt,
'verifier' => $verifier, 'verifier' => $verifier
'sessionkey' => '',
'v' => '',
's' => ''
], [ ], [
'id[=]' => $userinfo['id'] 'id[=]' => $userinfo['id']
]); ]);
...@@ -370,7 +367,7 @@ class user ...@@ -370,7 +367,7 @@ class user
'id[=]' => $userinfo['id'] 'id[=]' => $userinfo['id']
]); ]);
} else { } else {
if (verifySRP6($userinfo['username'], $_POST['old_password'], $userinfo['salt'], $userinfo['verifier'])) { if (!verifySRP6($userinfo['username'], $_POST['old_password'], $userinfo['salt'], $userinfo['verifier'])) {
error_msg('Old password is not valid.'); error_msg('Old password is not valid.');
return false; return false;
} }
...@@ -378,10 +375,7 @@ class user ...@@ -378,10 +375,7 @@ class user
list($salt, $verifier) = getRegistrationData(strtoupper($userinfo['username']), $_POST['password']); list($salt, $verifier) = getRegistrationData(strtoupper($userinfo['username']), $_POST['password']);
database::$auth->update('account', [ database::$auth->update('account', [
'salt' => $salt, 'salt' => $salt,
'verifier' => $verifier, 'verifier' => $verifier
'sessionkey' => '',
'v' => '',
's' => ''
], [ ], [
'id[=]' => $userinfo['id'] 'id[=]' => $userinfo['id']
]); ]);
...@@ -512,9 +506,6 @@ class user ...@@ -512,9 +506,6 @@ class user
database::$auth->update('account', [ database::$auth->update('account', [
'salt' => $salt, 'salt' => $salt,
'verifier' => $verifier, 'verifier' => $verifier,
'sessionkey' => '',
'v' => '',
's' => '',
'restore_key' => '1' 'restore_key' => '1'
], [ ], [
'id[=]' => $userinfo['id'] 'id[=]' => $userinfo['id']
...@@ -546,9 +537,6 @@ class user ...@@ -546,9 +537,6 @@ class user
database::$auth->update('account', [ database::$auth->update('account', [
'salt' => $salt, 'salt' => $salt,
'verifier' => $verifier, 'verifier' => $verifier,
'sessionkey' => '',
'v' => '',
's' => '',
'restore_key' => '1' 'restore_key' => '1'
], [ ], [
'id[=]' => $userinfo['id'] 'id[=]' => $userinfo['id']
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment