diff --git a/misc/docker/apache.conf b/misc/docker/apache.conf index ecd0a6e..6d0a0e3 100755 --- a/misc/docker/apache.conf +++ b/misc/docker/apache.conf @@ -1,7 +1,7 @@ LoadModule rewrite_module modules/mod_rewrite.so ServerName nineapache.local DocumentRoot "/app/public" -Alias /ninefolio /app/public +Alias /ninecompta /app/public Options Indexes FollowSymLinks AllowOverride All diff --git a/misc/script/reconfigure.sh b/misc/script/reconfigure.sh index e503946..c0fab67 100755 --- a/misc/script/reconfigure.sh +++ b/misc/script/reconfigure.sh @@ -8,5 +8,6 @@ cd ../.. DIR=$(pwd) bin/console d:s:u --force --complete +bin/console app:init exec $@ \ No newline at end of file diff --git a/src/EventListener/LogoutListener.php b/src/EventListener/LogoutListener.php index b8cc690..f2d0544 100644 --- a/src/EventListener/LogoutListener.php +++ b/src/EventListener/LogoutListener.php @@ -19,13 +19,14 @@ final class LogoutListener public function onLogoutEvent(LogoutEvent $event): void { if ('CAS' == $this->parameterBag->get('modeAuth')) { - // Initialiser phpCAS $request = $event->getRequest(); $host = $request->headers->get('X-Forwarded-Host') ?? $request->getHost().($request->getPort() ? ':'.$request->getPort() : ''); $scheme = $request->headers->get('X-Forwarded-Proto') ?? $request->getScheme(); $url = $scheme.'://'.$host; \phpCAS::client(CAS_VERSION_2_0, $this->parameterBag->get('casHost'), (int) $this->parameterBag->get('casPort'), $this->parameterBag->get('casPath'), $url, false); \phpCAS::setNoCasServerValidation(); + + $url.=$request->getBaseUrl(); \phpCAS::logoutWithRedirectService($url); } diff --git a/src/EventListener/SessionListener.php b/src/EventListener/SessionListener.php index c2d5553..6382cac 100644 --- a/src/EventListener/SessionListener.php +++ b/src/EventListener/SessionListener.php @@ -41,7 +41,7 @@ final class SessionListener $currentPath = $request->getPathInfo(); $noCompanyPath = $this->router->generate('app_user_nocompany'); - if (!$user->getCompany() && $currentPath != $noCompanyPath) { + if (!$user->getCompany() && stripos($currentPath,'nocompany')===0) { $event->setResponse(new RedirectResponse($noCompanyPath)); } }