introducing profile picture

This commit is contained in:
thies 2021-01-10 19:35:03 +01:00
parent 1f684c020c
commit 13ceba1e23
5 changed files with 40 additions and 8 deletions

View File

@ -15,4 +15,5 @@ $_SESSION['lastName'] = $user['lastName'];
$_SESSION['activated'] = $user['activated'];
$_SESSION['updated_at'] = $user['updated_at'];
$_SESSION['isadmin'] = $user['isadmin'];
$_SESSION['profilepicture'] = $user['profilepicture'];
?>

View File

@ -17,5 +17,6 @@ CREATE TABLE `users` (
`activated` VARCHAR(1) NOT NULL ,
`passwordcode` VARCHAR(255) NULL ,
`passwordcode_time` TIMESTAMP NULL ,
`profilepicture` VARCHAR(255) NULL DEFAULT 'https://web.td00.de/woddle.gif' ,
PRIMARY KEY (`id`), UNIQUE (`email`), UNIQUE (`username`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

View File

@ -20,6 +20,7 @@ if(isset($_GET['login'])) {
$_SESSION['activated'] = $user['activated'];
$_SESSION['updated_at'] = $user['updated_at'];
$_SESSION['isadmin'] = $user['isadmin'];
$_SESSION['profilepicture'] = $user['profilepicture'];
die('<div class="alert alert-success" role="alert"> successfull. go to: <a href="start.php">start page</a></div> <meta http-equiv="refresh" content="0; URL=start.php">');
} else {
$errorMessage = '<div class="alert alert-danger" role="alert">somethings wrong (maybe wrong password or wrong user)</div><br>';

View File

@ -1,11 +1,4 @@
<html>
<head>
<title>Profile Page</title>
<link rel="stylesheet" href="ressources/css/bootstrap.min.css" crossorigin="anonymous">
</head>
<body>
<script src="ressources/js/bootstrap.min.js"></script>
<?php
session_start();
if(!isset($_SESSION['userid'])) {
@ -18,6 +11,28 @@ $useremail = $_SESSION['email'];
$usergn = $_SESSION['givenName'];
$userln = $_SESSION['lastName'];
$activated = $_SESSION['activated'];
$isadmin = $_SESSION['isadmin'];
$profilepicture = "https://web.td00.de/woddle.gif";
?>
<html>
<head>
<title>Profile Page</title>
<link rel="stylesheet" href="ressources/css/bootstrap.min.css" crossorigin="anonymous">
</head>
<body>
<script src="ressources/js/bootstrap.min.js"></script>
<div class="float-right">
<br />
<br />
<?php
echo '<img src="'.$profilepicture.'" height=90 width=90 />';
?>
</div>
<?php
echo '<div class="alert alert-info" role="alert">Profile of '.$username.'</div>';
echo "<br/>";
@ -81,10 +96,23 @@ if ($activated == 1) {
}
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>";
echo "User Level:";
echo "</td>";
echo "<td>";
if ($isadmin == 0) {
echo '<p class="text-success">User</p><br>';
}
if ($isadmin == 1) {
echo '<p class="text-danger">Admin</p>';
}
echo "</td>";
echo "</tr>";
?>
</table>
<br>
<br/>
<br>
<a href="start.php"><button class="btn btn-info">Back</button></a>

View File

@ -13,5 +13,6 @@ CREATE TABLE `users` (
`isadmin` VARCHAR(1) NULL ,
`passwordcode` VARCHAR(255) NULL ,
`passwordcode_time` TIMESTAMP NULL ,
`profilepicture` VARCHAR(255) NULL DEFAULT 'https://web.td00.de/woddle.gif' ,
PRIMARY KEY (`id`), UNIQUE (`email`), UNIQUE (`username`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;