neue BenutzeraccounSeite mit dem Button Ausloggen
This commit is contained in:
parent
b038312ae3
commit
5fb1133617
@ -14,6 +14,7 @@
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
@ -34,6 +35,10 @@
|
||||
aspect-ratio: 1/1;
|
||||
}
|
||||
|
||||
.btn-form{
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
.btn-login{
|
||||
background-color: transparent;
|
||||
}
|
||||
@ -41,3 +46,7 @@
|
||||
.btn-user > span {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.btn-logout{
|
||||
background-color: red;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
@import url(variables.css);
|
||||
@import url(style_columns.css);
|
||||
@import url(Block/header.css);
|
||||
@import url(Block/footer.css);
|
||||
@import url(Element/logo.css);
|
||||
@ -36,7 +37,6 @@ h2 {
|
||||
|
||||
main {
|
||||
margin-top: 190px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.msg {
|
||||
|
@ -6,6 +6,12 @@
|
||||
/*** 12 spaltiges Grid mit Flexboxen ***/
|
||||
|
||||
/*** Container ***/
|
||||
|
||||
.container{
|
||||
max-width: 90%;
|
||||
padding: 24px 42px 24px 42px;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
flex-flow: row;
|
||||
|
@ -130,7 +130,8 @@ class UserController{
|
||||
|
||||
public function logout(){
|
||||
$this->clearUserSession();
|
||||
echo "Erfolgreich ausgeloggt";
|
||||
header("Location: index.php?controller=user&do=showUserLoginForm");
|
||||
exit();
|
||||
}
|
||||
|
||||
public function isUserLoggenIn(){
|
||||
@ -140,4 +141,8 @@ class UserController{
|
||||
public function getCurrentUserId(){
|
||||
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="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>
|
||||
|
||||
|
||||
<?php
|
||||
include dirname(__DIR__).'/footer.phtml';
|
||||
?>
|
||||
|
@ -16,16 +16,25 @@
|
||||
<body>
|
||||
<header>
|
||||
<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">
|
||||
<?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">
|
||||
<?php echo ($_SESSION['vorname'] ?? "") . " " . ($_SESSION['name'] ?? "") ?>
|
||||
<?php echo ($_SESSION['vorname'] ?? "") . " " . ($_SESSION['name'] ?? "") . ", " . ($_SESSION['user_role']) ?>
|
||||
<span class="btn btn-user">
|
||||
<span class="material-icons">person</span>
|
||||
</span>
|
||||
</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: ?>
|
||||
<a class="btn" href="?controller=User&do=showUserLoginForm">Anmeldung</a>
|
||||
<a class="btn btn-primary" href="?controller=User&do=showUserRegisterForm">Registration</a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user