diff --git a/application/modules/opac/controllers/CasServerV10Controller.php b/application/modules/opac/controllers/CasServerV10Controller.php new file mode 100644 index 0000000000000000000000000000000000000000..1c451f6781e27a1e243300674ca052029f2ce892 --- /dev/null +++ b/application/modules/opac/controllers/CasServerV10Controller.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved. + * + * AFI-OPAC 2.0 is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * AFI-OPAC 2.0 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with AFI-OPAC 2.0; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +class CasServerV10Controller extends CasServerController { + // see http://www.jasig.org/cas/protocol#validate-cas-1.0 + public function returnValidTicketResponse($user, $ticket) { + $this->getResponse()->setBody('yes'.chr(10)); + } + + + public function returnFailureTicketResponse($error,$ticket=null) { + $this->getResponse()->setBody('no'.chr(10)); + } + + + public function loginAction() { + $this->_forward('login', 'auth'); + } + + + public function logoutAction() { + ZendAfi_Auth::getInstance()->clearIdentity(); + if ($url_redirect = $this->_getParam('url')) + $this->_redirect($url_redirect); + } +} + +?> diff --git a/application/modules/opac/views/scripts/cas-server-v10/logout.phtml b/application/modules/opac/views/scripts/cas-server-v10/logout.phtml new file mode 100644 index 0000000000000000000000000000000000000000..eac5946e65c8447520821b30eba549926c87225a --- /dev/null +++ b/application/modules/opac/views/scripts/cas-server-v10/logout.phtml @@ -0,0 +1 @@ +<p><?php echo $this->_('Vous avez été déconnecté'); ?></p>