This commit is contained in:
Jérôme Bousquié 2016-12-02 10:41:48 +01:00
parent eee5cea824
commit 20ceb43532

34
admin/libhome.php Normal file
View File

@ -0,0 +1,34 @@
<?php
//
// phpCAS simple client
//
// Variables
$cas_server = 'cas.iut-rodez.fr';
$cas_path = '/cas';
$cas_port = 443;
include('ldap_connector.php');
// import phpCAS lib
include_once('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();
// force CAS authentication
phpCAS::forceAuthentication();
// at this step, the user has been authenticated by the CAS server
// and the user's login name can be read with phpCAS::getUser().
// logout if desired
if (isset($_REQUEST['logout'])) {
phpCAS::logout();
}
?>