| Total Complexity | 2 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class AuthController extends AbstractController |
||
| 17 | { |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Redirects to the CAS authentication page. |
||
| 21 | * |
||
| 22 | * @Route("/login", name="login") |
||
| 23 | * @return \Symfony\Component\HttpFoundation\Response |
||
| 24 | */ |
||
| 25 | public function login() |
||
| 26 | { |
||
| 27 | |||
| 28 | phpCAS::client(CAS_VERSION_2_0, env('CAS_HOST'), intval(env('CAS_PORT')), ''); |
||
| 29 | phpCAS::setNoCasServerValidation(); |
||
| 30 | phpCAS::forceAuthentication(); |
||
| 31 | phpCAS::getUser(); |
||
| 32 | |||
| 33 | return $this->redirectToRoute('home'); |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Logs Out by destroying the CAS Session then redirects to the home page. |
||
| 38 | * |
||
| 39 | * @Route("/logout", name="logout") |
||
| 40 | * @param Request $request |
||
| 41 | */ |
||
| 42 | public function logout(Request $request) |
||
| 46 | } |
||
| 47 | } |
||
| 48 |