diff --git a/src/Controller/SecurityController.php b/src/Controller/SecurityController.php index d6a6a73..5188cf7 100755 --- a/src/Controller/SecurityController.php +++ b/src/Controller/SecurityController.php @@ -327,7 +327,7 @@ class SecurityController extends AbstractController $this->tokenstorage->setToken(null); $request->getSession()->invalidate(); - return $this->redirect($this->generateUrl('app_home')); + return $this->redirectToRoute('app_home'); } public function logoutCAS(Request $request) @@ -353,7 +353,7 @@ class SecurityController extends AbstractController $this->tokenstorage->setToken(null); $request->getSession()->invalidate(); - return $this->redirect($this->generateUrl('app_home')); + return $this->redirectToRoute('app_home'); } public function logoutOPENID(Request $request) @@ -370,11 +370,11 @@ class SecurityController extends AbstractController $callback = $this->generateUrl('app_home', [], UrlGeneratorInterface::ABSOLUTE_URL); $callback = substr($callback, 0, -1); - $url .= "?id_token_hint=$idtoken&scope=openid&post_logout_redirect_uri=$callback"; + $url .= "?id_token_hint=$idtoken&scope=openid profile email&post_logout_redirect_uri=$callback"; return $this->redirect($url); } else { - return $this->redirect($this->generateUrl('app_home')); + return $this->redirectToRoute('app_home'); } } @@ -451,7 +451,7 @@ class SecurityController extends AbstractController if ($redirect) { return $this->redirect($redirect); } else { - return $this->redirect($this->generateUrl('app_home')); + return $this->redirectToRoute('app_home'); } } } diff --git a/src/Service/LdapService.php b/src/Service/LdapService.php index 0776e18..4c4e732 100755 --- a/src/Service/LdapService.php +++ b/src/Service/LdapService.php @@ -673,6 +673,7 @@ class LdapService $connection = $this->connect(); $res = ldap_search($connection, $this->basedn, str_replace('*', $username, $this->filteruser)); $first = ldap_first_entry($this->connection, $res); + if(!$first) return false; $dn = ldap_get_dn($this->connection, $first); return $dn; }