introducing profile picture
This commit is contained in:
parent
1f684c020c
commit
13ceba1e23
@ -15,4 +15,5 @@ $_SESSION['lastName'] = $user['lastName'];
|
|||||||
$_SESSION['activated'] = $user['activated'];
|
$_SESSION['activated'] = $user['activated'];
|
||||||
$_SESSION['updated_at'] = $user['updated_at'];
|
$_SESSION['updated_at'] = $user['updated_at'];
|
||||||
$_SESSION['isadmin'] = $user['isadmin'];
|
$_SESSION['isadmin'] = $user['isadmin'];
|
||||||
|
$_SESSION['profilepicture'] = $user['profilepicture'];
|
||||||
?>
|
?>
|
@ -17,5 +17,6 @@ CREATE TABLE `users` (
|
|||||||
`activated` VARCHAR(1) NOT NULL ,
|
`activated` VARCHAR(1) NOT NULL ,
|
||||||
`passwordcode` VARCHAR(255) NULL ,
|
`passwordcode` VARCHAR(255) NULL ,
|
||||||
`passwordcode_time` TIMESTAMP NULL ,
|
`passwordcode_time` TIMESTAMP NULL ,
|
||||||
|
`profilepicture` VARCHAR(255) NULL DEFAULT 'https://web.td00.de/woddle.gif' ,
|
||||||
PRIMARY KEY (`id`), UNIQUE (`email`), UNIQUE (`username`)
|
PRIMARY KEY (`id`), UNIQUE (`email`), UNIQUE (`username`)
|
||||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
@ -20,6 +20,7 @@ if(isset($_GET['login'])) {
|
|||||||
$_SESSION['activated'] = $user['activated'];
|
$_SESSION['activated'] = $user['activated'];
|
||||||
$_SESSION['updated_at'] = $user['updated_at'];
|
$_SESSION['updated_at'] = $user['updated_at'];
|
||||||
$_SESSION['isadmin'] = $user['isadmin'];
|
$_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">');
|
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 {
|
} else {
|
||||||
$errorMessage = '<div class="alert alert-danger" role="alert">somethings wrong (maybe wrong password or wrong user)</div><br>';
|
$errorMessage = '<div class="alert alert-danger" role="alert">somethings wrong (maybe wrong password or wrong user)</div><br>';
|
||||||
|
44
profile.php
44
profile.php
@ -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
|
<?php
|
||||||
session_start();
|
session_start();
|
||||||
if(!isset($_SESSION['userid'])) {
|
if(!isset($_SESSION['userid'])) {
|
||||||
@ -18,6 +11,28 @@ $useremail = $_SESSION['email'];
|
|||||||
$usergn = $_SESSION['givenName'];
|
$usergn = $_SESSION['givenName'];
|
||||||
$userln = $_SESSION['lastName'];
|
$userln = $_SESSION['lastName'];
|
||||||
$activated = $_SESSION['activated'];
|
$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 '<div class="alert alert-info" role="alert">Profile of '.$username.'</div>';
|
||||||
echo "<br/>";
|
echo "<br/>";
|
||||||
@ -81,10 +96,23 @@ if ($activated == 1) {
|
|||||||
}
|
}
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
echo "</tr>";
|
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>
|
</table>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
<br>
|
<br>
|
||||||
<a href="start.php"><button class="btn btn-info">Back</button></a>
|
<a href="start.php"><button class="btn btn-info">Back</button></a>
|
||||||
|
@ -13,5 +13,6 @@ CREATE TABLE `users` (
|
|||||||
`isadmin` VARCHAR(1) NULL ,
|
`isadmin` VARCHAR(1) NULL ,
|
||||||
`passwordcode` VARCHAR(255) NULL ,
|
`passwordcode` VARCHAR(255) NULL ,
|
||||||
`passwordcode_time` TIMESTAMP NULL ,
|
`passwordcode_time` TIMESTAMP NULL ,
|
||||||
|
`profilepicture` VARCHAR(255) NULL DEFAULT 'https://web.td00.de/woddle.gif' ,
|
||||||
PRIMARY KEY (`id`), UNIQUE (`email`), UNIQUE (`username`)
|
PRIMARY KEY (`id`), UNIQUE (`email`), UNIQUE (`username`)
|
||||||
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user