src/AdeoSecurityBundle/EventListener/AdminListener.php line 27

Open in your IDE?
  1. <?php
  2. /**
  3.  * Active Publishing - Creative Common CC BY 4.0
  4.  *   Full copyright and license information is available in
  5.  *   LICENSE.md which is distributed with this source code.
  6.  *
  7.  * @copyright Copyright (c) Active Publishing (https://activepublishing.fr)
  8.  * @license Creative Common CC BY 4.0
  9.  * @author Active Publishing <contact@active-publishing.fr>
  10.  */
  11. namespace AdeoSecurityBundle\EventListener;
  12. use AdeoSecurityBundle\Tool\AuthTool;
  13. use Pimcore\Event\Admin\Login\LogoutEvent;
  14. use Pimcore\Tool;
  15. /**
  16.  * Class AdminListener
  17.  * @package AdeoSecurityBundle\EventListener
  18.  */
  19. class AdminListener
  20. {
  21.     /**
  22.      * @param LogoutEvent $e
  23.      */
  24.     public function onLogout(LogoutEvent $e)
  25.     {
  26.         $adminSession Tool\Session::get();
  27.         if ($adminSession->has("adeoSecurityLogin")) {
  28.             AuthTool::getClientCas();
  29.             \phpCAS::logoutWithRedirectService(Tool::getHostUrl() . "/adeo/login");
  30.         }
  31.     }
  32. }