neue BenutzeraccounSeite mit dem Button Ausloggen
This commit is contained in:
parent
b038312ae3
commit
5fb1133617
@ -14,6 +14,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
@ -34,6 +35,10 @@
|
|||||||
aspect-ratio: 1/1;
|
aspect-ratio: 1/1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-form{
|
||||||
|
padding: 10px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.btn-login{
|
.btn-login{
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
@ -41,3 +46,7 @@
|
|||||||
.btn-user > span {
|
.btn-user > span {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-logout{
|
||||||
|
background-color: red;
|
||||||
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@import url(variables.css);
|
@import url(variables.css);
|
||||||
|
@import url(style_columns.css);
|
||||||
@import url(Block/header.css);
|
@import url(Block/header.css);
|
||||||
@import url(Block/footer.css);
|
@import url(Block/footer.css);
|
||||||
@import url(Element/logo.css);
|
@import url(Element/logo.css);
|
||||||
@ -36,7 +37,6 @@ h2 {
|
|||||||
|
|
||||||
main {
|
main {
|
||||||
margin-top: 190px;
|
margin-top: 190px;
|
||||||
padding: 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.msg {
|
.msg {
|
||||||
|
@ -6,6 +6,12 @@
|
|||||||
/*** 12 spaltiges Grid mit Flexboxen ***/
|
/*** 12 spaltiges Grid mit Flexboxen ***/
|
||||||
|
|
||||||
/*** Container ***/
|
/*** Container ***/
|
||||||
|
|
||||||
|
.container{
|
||||||
|
max-width: 90%;
|
||||||
|
padding: 24px 42px 24px 42px;
|
||||||
|
}
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row;
|
flex-flow: row;
|
||||||
|
@ -130,7 +130,8 @@ class UserController{
|
|||||||
|
|
||||||
public function logout(){
|
public function logout(){
|
||||||
$this->clearUserSession();
|
$this->clearUserSession();
|
||||||
echo "Erfolgreich ausgeloggt";
|
header("Location: index.php?controller=user&do=showUserLoginForm");
|
||||||
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isUserLoggenIn(){
|
public function isUserLoggenIn(){
|
||||||
@ -140,4 +141,8 @@ class UserController{
|
|||||||
public function getCurrentUserId(){
|
public function getCurrentUserId(){
|
||||||
return $_SESSION["user_id"] ?? null;
|
return $_SESSION["user_id"] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function showUserAccountPage (){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
17
Views/User/showUserAccountPage.phtml
Normal file
17
Views/User/showUserAccountPage.phtml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
include dirname(__DIR__).'/header.phtml';
|
||||||
|
?>
|
||||||
|
|
||||||
|
<article>
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<form method="post">
|
||||||
|
<input type="hidden" name="controller" value="user">
|
||||||
|
<input type="hidden" name="do" value="logout">
|
||||||
|
<button type="submit" class="btn btn-logout">Ausloggen</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</article>
|
@ -27,12 +27,7 @@
|
|||||||
|
|
||||||
<input type="hidden" name="controller" value="user">
|
<input type="hidden" name="controller" value="user">
|
||||||
<input type="hidden" name="do" value="login">
|
<input type="hidden" name="do" value="login">
|
||||||
<button type="submit" class="btn" style="display: block">Login</button>
|
<button type="submit" class="btn btn-primary btn-form" style="display: block">Login</button>
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
<?php
|
|
||||||
include dirname(__DIR__).'/footer.phtml';
|
|
||||||
?>
|
|
||||||
|
@ -16,16 +16,25 @@
|
|||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<nav class="d-flex-between">
|
<nav class="d-flex-between">
|
||||||
<a id="logo" href="/">bib<span>course</span></a>
|
<a id="logo" href="index.php">bib<span>course</span></a>
|
||||||
<div style="column-gap: 8px;" class="d-flex-between">
|
<div style="column-gap: 8px;" class="d-flex-between">
|
||||||
<div style="column-gap: 8px;" class="d-flex-between">
|
<div style="column-gap: 8px;" class="d-flex-between">
|
||||||
<?php if (isset($_SESSION['user_id']) && $_SESSION['user_id'] !== null): ?>
|
<?php if (isset($_SESSION['user_id']) && $_SESSION['user_id'] !== null): ?>
|
||||||
|
<?php if($_SESSION['user_role'] == 'admin'): ?>
|
||||||
<a style="column-gap: 16px;" class="btn" href="?controller=Admin&do=showForm">
|
<a style="column-gap: 16px;" class="btn" href="?controller=Admin&do=showForm">
|
||||||
<?php echo ($_SESSION['vorname'] ?? "") . " " . ($_SESSION['name'] ?? "") ?>
|
<?php echo ($_SESSION['vorname'] ?? "") . " " . ($_SESSION['name'] ?? "") . ", " . ($_SESSION['user_role']) ?>
|
||||||
<span class="btn btn-user">
|
<span class="btn btn-user">
|
||||||
<span class="material-icons">person</span>
|
<span class="material-icons">person</span>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
|
<?php else: ?>
|
||||||
|
<a style="column-gap: 16px;" class="btn" href="?controller=User&do=showUserAccountPage">
|
||||||
|
<?php echo ($_SESSION['vorname'] ?? "") . " " . ($_SESSION['name'] ?? "") . ", " . ($_SESSION['user_role']) ?>
|
||||||
|
<span class="btn btn-user">
|
||||||
|
<span class="material-icons">person</span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<a class="btn" href="?controller=User&do=showUserLoginForm">Anmeldung</a>
|
<a class="btn" href="?controller=User&do=showUserLoginForm">Anmeldung</a>
|
||||||
<a class="btn btn-primary" href="?controller=User&do=showUserRegisterForm">Registration</a>
|
<a class="btn btn-primary" href="?controller=User&do=showUserRegisterForm">Registration</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user