autofworward after login
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s
All checks were successful
Build and push / Pulling repo on server (push) Successful in 3s
This commit is contained in:
parent
5dda6b958d
commit
339321a322
@ -82,7 +82,7 @@ function callHook($url)
|
||||
if (!$dispatch->maySeeThisPage()) {
|
||||
$componentName = 'err';
|
||||
$action = 'notallowed';
|
||||
$dispatch = new $componentName('error', $action, true);
|
||||
$dispatch = new $componentName('err', $action, true);
|
||||
} else
|
||||
$dispatch = new $componentName($component, $action, true, $queryString);
|
||||
|
||||
|
@ -11,7 +11,8 @@ class Err extends Page {
|
||||
|
||||
function notallowed()
|
||||
{
|
||||
return json_encode(['error'=>'not allowed']);
|
||||
$this->set("loggedin",(isset($_SESSION['user']) && $_SESSION['user'] !== false));
|
||||
$this->set('template', "notallowed.html");
|
||||
}
|
||||
|
||||
}
|
13
web/pages/err/notallowed.html
Normal file
13
web/pages/err/notallowed.html
Normal file
@ -0,0 +1,13 @@
|
||||
<div class="alert alert-danger animate__animated animate__headShake" role="alert">
|
||||
<h4 class="alert-heading">Not allowed</h4>
|
||||
Zugriff nicht erlaubt
|
||||
</div>
|
||||
|
||||
<div class="row justify-content-center align-items-center g-2">
|
||||
<div class="col"></div>
|
||||
<div class="col">
|
||||
<?php if(!$loggedin) : ?>
|
||||
<?= partial('../../pages/login/login.html'); ?>
|
||||
<?php endif; ?></div>
|
||||
<div class="col"></div>
|
||||
</div>
|
@ -78,7 +78,10 @@ class Login extends Page {
|
||||
else
|
||||
{
|
||||
$u->login();
|
||||
$this->redirect('/');
|
||||
if($_SERVER['HTTP_HX_CURRENT_URL'] && !endsWith($_SERVER['HTTP_HX_CURRENT_URL'],'/login'))
|
||||
$this->redirect($_SERVER['HTTP_HX_CURRENT_URL']);
|
||||
else
|
||||
$this->redirect('/');
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user