This commit is contained in:
afornerot 2024-12-26 19:01:07 +01:00
parent 4b798fd1f9
commit 7d56eb6e2a
4 changed files with 5 additions and 3 deletions

View File

@ -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
<Directory "/app/public">
Options Indexes FollowSymLinks
AllowOverride All

View File

@ -8,5 +8,6 @@ cd ../..
DIR=$(pwd)
bin/console d:s:u --force --complete
bin/console app:init
exec $@

View File

@ -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);
}

View File

@ -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));
}
}