fine tuning
All checks were successful
Build and push / Pulling repo on server (push) Has been skipped
All checks were successful
Build and push / Pulling repo on server (push) Has been skipped
This commit is contained in:
@ -70,9 +70,12 @@ function callHook($url)
|
||||
$dispatch = new $componentName($component, $action, true, $queryString);
|
||||
|
||||
if (method_exists($componentName, $action)) {
|
||||
call_user_func_array(array($dispatch, $action), $queryString);
|
||||
$response = call_user_func_array(array($dispatch, $action), $queryString);
|
||||
} else if (method_exists($componentName, 'catchAll'))
|
||||
call_user_func_array(array($dispatch, 'catchAll'), array($params));
|
||||
$response = call_user_func_array(array($dispatch, 'catchAll'), array($params));
|
||||
|
||||
return $dispatch->renderPagecontent();
|
||||
if(is_string($response))
|
||||
return $response;
|
||||
else
|
||||
return $dispatch->renderPagecontent();
|
||||
}
|
@ -12,13 +12,15 @@ includeManagement();
|
||||
|
||||
if($_GET['url'])
|
||||
$url = explode('/',ltrim(parse_url($_GET['url'], PHP_URL_PATH),'/'));
|
||||
else if($_SERVER['HTTP_HX_CURRENT_URL'])
|
||||
$url = explode('/',ltrim(parse_url($_SERVER['HTTP_HX_CURRENT_URL'], PHP_URL_PATH),'/'));
|
||||
else $url = array_filter(explode('/',ltrim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH),'/')));
|
||||
|
||||
if(count($url) > 0 && ($url[0]=='api' || $url[0]=='backend'))
|
||||
array_shift($url);
|
||||
|
||||
if($url==[] && $_SERVER['HTTP_HX_CURRENT_URL'])
|
||||
$url = explode('/',ltrim(parse_url($_SERVER['HTTP_HX_CURRENT_URL'], PHP_URL_PATH),'/'));
|
||||
|
||||
|
||||
//echo print_r(['url'=>$url,'server'=>$_SERVER,'request'=>$_REQUEST,'cookie'=>$_COOKIE,'session'=>$_SESSION],true);
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@ class Auth extends Page {
|
||||
|
||||
function login()
|
||||
{
|
||||
return 'hättest gern';
|
||||
return print_r($_REQUEST, true);
|
||||
}
|
||||
|
||||
function maySeeThisPage()
|
||||
|
20
web/api/pages/err/controller.php
Normal file
20
web/api/pages/err/controller.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
class Err extends Page {
|
||||
|
||||
function notfound($params)
|
||||
{
|
||||
$this->set("page",$params[0]);
|
||||
$this->set('template', "notfound.mustache");
|
||||
}
|
||||
|
||||
function notallowed()
|
||||
{
|
||||
return json_encode(['error'=>'not allowed']);
|
||||
}
|
||||
|
||||
function maySeeThisPage()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
4
web/api/pages/err/notfound.mustache
Normal file
4
web/api/pages/err/notfound.mustache
Normal file
@ -0,0 +1,4 @@
|
||||
<div class="bg-green-100 border-l-4 border-green-500 text-green-700 p-4" role="alert">
|
||||
<p class="font-bold">404 - Not found</p>
|
||||
<p>I have no memory of {{page}}</p>
|
||||
</div>
|
Reference in New Issue
Block a user