-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeleteUser.php
68 lines (63 loc) · 2.66 KB
/
deleteUser.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php require "header.php";
include_once "includes/dbh.inc.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge" lang="en">
</head>
<body>
<h1>Authorisation: attempts <?php echo $_SESSION["attemptsDelete"] ?></h1>
<?php
if (isset($_GET["error"])) {
switch ($_GET["error"]) {
case "attempts_2":
echo '>Warning: the username and/or the password is wrong. Probably you
committed a typo; you have two attempts.';
break;
case "attempts_1":
echo '>Warning: still incorrect... last guess - be sure before you make another mistake.';
break;
case "block":
echo '>Alert: for security reasons, you are prevented from deleting the profile.
To resolve please contact admin.';
break;
}
} else {
echo ' <p>We need to make sure it’s really you.</p>';
}
?>
<form action="includes/deleteUser.inc.php" method="post">
<?php
if (isset($_GET["error"])) {
if ($_SESSION["attemptsDelete"] < 1) {
echo '<p>This feature was blocked.</p>';
echo '<input type="text" name="username" placeholder="disabled" disabled>';
echo '<p>This feature was blocked.</p>';
echo '<input type="text" name="password" placeholder="disabled" disabled>';
echo '<p>Contact the admin:</p>';
echo '<button type="submit" name="submit-admin">Send a mail to Admin</button>';
} else {
echo '<p>Please, digit your username below:</p>
<input type="text" name="username" placeholder="condemned name">
<p>Now, insert your password.</p>
<input type="text" name="password" placeholder=">Warning: the password will be readable!">
<p>Now, insert your password.</p>
<button type="submit" name="submit-delete">DELETE ME</button>';
}
} else {
?>
<p>Please, digit your username below:</p>
<input type="text" name="username" placeholder="condemned name">
<p>Now, insert your password.</p>
<input type="text" name="password" placeholder=">Warning: the password will be readable!">
<p>Now, insert your password.</p>
<button type="submit" name="submit-delete">DELETE ME</button>
<?php
}
?>
</form>
</body>
</html> <?php require "footer.php" ?>