commit initial

This commit is contained in:
Jérôme Bousquié
2016-09-22 11:49:17 +02:00
commit 51d0c765b7
6 changed files with 194 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
//
// phpCAS simple client
//
// import phpCAS lib
include_once('CAS/CAS.php');
//phpCAS::setDebug();
// initialize phpCAS
phpCAS::client(CAS_VERSION_2_0,$cas_server,$cas_port,$cas_path);
// no SSL validation for the CAS server
phpCAS::setNoCasServerValidation();
// check CAS authentication
phpCAS::checkAuthentication();
// at this step, the user has been authenticated by the CAS server
// and the user's login name can be read with phpCAS::getUser().
function Autorise($user, $liste_users_autorises) {
return in_array($user, $liste_users_autorises);
}
// logout if desired
if (isset($_REQUEST['logout'])) {
phpCAS::logout();
}
?>