You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: elements/Account/account.yaml
+38-1Lines changed: 38 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,5 +6,42 @@ description: |
6
6
7
7
When a user logs in or out, the account object assigned to them will change. As such, you must not assume that the account attached to a client remains constant during their session.
8
8
9
-
PHP code to check password hashes from the MTA server database is [here](/Account_PHP).
9
+
PHP code to check password hashes from the MTA server database is
10
+
11
+
<details>
12
+
<summary>Here</summary>
13
+
This php function will return true if the password matches the hash from the accounts database.
14
+
15
+
```php
16
+
function passwordMatch( $plain, $hash )
17
+
{
18
+
//-- Empty passwords never match
19
+
if ( $plain == "" || $hash == "" )
20
+
return false;
21
+
22
+
if ( strlen($hash) == 64 + 32 + 1 )
23
+
{
24
+
//-- SHA256 + type + salt
25
+
$strSha256 = substr( $hash, 0, 64 );
26
+
$strType = substr( $hash, 64, 1 );
27
+
$strSalt = substr( $hash, 65, 32 );
28
+
29
+
//-- Password hash was generated from MD5, so do the same thing for the test
0 commit comments