more beauty!
This commit is contained in:
parent
a859694bd7
commit
97423f3d68
@ -19,7 +19,7 @@ if(isset($_GET['login'])) {
|
||||
$_SESSION['lastName'] = $user['lastName'];
|
||||
die('successfull. go to: <a href="secure.php">secure page</a><meta http-equiv="refresh" content="0; URL=secure.php">');
|
||||
} else {
|
||||
$errorMessage = "somethings wrong (maybe wrong password or wrong user)<br>";
|
||||
$errorMessage = "<div class="alert alert-danger" role="alert">somethings wrong (maybe wrong password or wrong user)</div><br>";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ $useremail = $_SESSION['email'];
|
||||
$usergn = $_SESSION['givenName'];
|
||||
$userln = $_SESSION['lastName'];
|
||||
|
||||
echo "Profile of ".$username;
|
||||
echo '<div class="alert alert-info" role="alert">Profile of '.$username.'</div>';
|
||||
echo "<br/>";
|
||||
echo '<table class="table table-dark table-striped" style="width:30%">';
|
||||
echo "<tr>";
|
||||
|
@ -10,7 +10,7 @@
|
||||
$pdo = new PDO('mysql:host=localhost;dbname=usertable', 'usertable', 'password');
|
||||
|
||||
if(!isset($_GET['userid']) || !isset($_GET['code'])) {
|
||||
die("No code delivered. nothing to do here.");
|
||||
die('<div class="alert alert-warning" role="alert">No code delivered. nothing to do here.</div>');
|
||||
}
|
||||
|
||||
$userid = $_GET['userid'];
|
||||
@ -23,17 +23,20 @@ $user = $statement->fetch();
|
||||
|
||||
//check if theres a code for the user delivered
|
||||
if($user === null || $user['passwordcode'] === null) {
|
||||
die("No User matching your request.");
|
||||
die('<div class="alert alert-danger" role="alert">
|
||||
No User matching your request.</div>');
|
||||
}
|
||||
|
||||
if($user['passwordcode_time'] === null || strtotime($user['passwordcode_time']) < (time()-24*3600) ) {
|
||||
die("Ooops. This code isn't valid anymore.");
|
||||
die('<div class="alert alert-danger" role="alert">
|
||||
Ooops. This code isnt valid anymore.</div>');
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(sha1($code) != $user['passwordcode']) {
|
||||
die("Thats not your code. Naughty user!");
|
||||
die('<div class="alert alert-danger" role="alert">
|
||||
Thats not your code. Naughty user!</div>');
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user