- Worked th error layout
- Added some picto for the error views - Bugfixes
This commit is contained in:
1 parent
421024f260
commit
fd693fc8fc
15 files changed
+101
-18
No files matched your search
+13
-3
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Lean;
|
||||
|
||||
use function DI\autowire, DI\create;
|
||||
use Taxus\Taxus;
|
||||
|
||||
use League\Route\RouteGroup,
|
||||
League\Route\Router;
|
||||
@@ -23,6 +23,8 @@ use Picea\Picea,
|
||||
use Storage\Cookie,
|
||||
Storage\Session;
|
||||
|
||||
use function DI\autowire, DI\create;
|
||||
|
||||
class Routing {
|
||||
|
||||
protected Session $session;
|
||||
@@ -37,6 +39,8 @@ class Routing {
|
||||
|
||||
protected LanguageHandler $language;
|
||||
|
||||
protected Taxus $taxus;
|
||||
|
||||
public function __construct(
|
||||
Session $session,
|
||||
Cookie $cookie,
|
||||
@@ -44,7 +48,8 @@ class Routing {
|
||||
Router $router,
|
||||
RouteFetcher $routeFetcher,
|
||||
SecurityHandler $security,
|
||||
LanguageHandler $language
|
||||
LanguageHandler $language,
|
||||
Taxus $taxus
|
||||
)
|
||||
{
|
||||
$this->session = $session;
|
||||
@@ -54,6 +59,7 @@ class Routing {
|
||||
$this->security = $security;
|
||||
$this->language = $language;
|
||||
$this->router = $router;
|
||||
$this->taxus = $taxus;
|
||||
}
|
||||
|
||||
public function registerRoute(ContainerInterface $container, string $urlBase) {
|
||||
@@ -84,12 +90,16 @@ class Routing {
|
||||
$object = $container->get($class);
|
||||
|
||||
# Checking if user needs to be logged
|
||||
if ( ! $object->user->logged && ( $redirect = $this->security->verify($class, $method) ) ) {
|
||||
if ( ( $redirect = $this->security->verify($class, $method) ) && ( empty($object->user) || ! $object->user->logged ) ) {
|
||||
$this->session->redirectedFrom = (string) $request->getUri();
|
||||
|
||||
return $redirect;
|
||||
}
|
||||
|
||||
if ( $forbidden = $this->security->taxus($class, $method, $object->user) ) {
|
||||
return $forbidden;
|
||||
}
|
||||
|
||||
if ( $container->has(Picea::class) ) {
|
||||
$container->get(Picea::class)->globalVariables['route'] = $annotation;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user