-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
27 lines (26 loc) · 1.18 KB
/
login.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
echo "user: $username | pass: $password<br>";
if ($stmt = mysqli_prepare($wsc_mysqli, "SELECT userID, password, banned, activationCode FROM wcf1_user WHERE username = ?")) {
mysqli_stmt_bind_param($stmt, "s", $username); mysqli_stmt_execute($stmt); mysqli_stmt_store_result($stmt);
if ($stmt->num_rows == 1) {
mysqli_stmt_bind_result($stmt, $userID, $wcf_pw, $banned, $activationCode);
while (mysqli_stmt_fetch($stmt)) {
if ($activationCode == 0) {
if ($banned == 0) {
if ('$2a$' == substr($wcf_pw, 0, 4) && hash_equals($wcf_pw, crypt(crypt($password, $wcf_pw), $wcf_pw))) {
echo "LOGIN ERFOLGREICH!";
} else {
echo "Benuzername oder Passwort falsch!";
}
} else {
echo "Benutzeraccount gesperrt.";
}
} else {
echo "Bitte aktiviere zuerst deinen Benutzeraccount.";
}
}
} else {
echo "Benuzername oder Passwort falsch!";
}
}
?>