예제 #1
0
<?php

require_once "./cas/phpCAS-master/CAS.php";
require_once "config.example.php";
phpCAS::client(CAS_VERSION_2_0, $cas_host, $cas_port, $cas_context);
phpCAS::setNoCasServerValidation();
if (isset($_REQUEST['logout'])) {
    $_SESSION['cas'] = "yes";
    phpCAS::logoutWithRedirectService("https://osr-etudiant.unistra.fr/~r.henry/aCalendar/");
}
if (phpCAS::checkAuthentication()) {
    $_SESSION['user'] = phpCas::getUser();
    $_SESSION['cas'] = "yes";
    header('Location: ../index.php');
} else {
    phpCAS::forceAuthentication();
}
//echo phpCAS::logoutWithRedirectService('inscription.php');
//
?>
<!--<!<?php 
//if (isset($erreur)) echo '<br /><br />',$erreur;
//if(isset($_POST['connexion']) && $_POST['connexion'] == 'Connexion'){
//if((isset($_POST['login']) && isset($_POST['pass'])) && (!empty($_POST['login']) && !empty($_POST['pass'])))
//{
//$base = new PDO('mysql:host=localhost;dbname=test', 'root', '') ;
//or die("Erreur".mysql_error($base));
//mysqli_select_db ('test', $base);
//$sql = 'select count(*) from membre where login="******" and
//pass_md5="'. $base->quote($_POST['pass']).'"';
//$requete= $base->query($sql) or die('Erreur sql !'.$sql.mysql_error());
예제 #2
0
<?php

//====================================================================================
// OCS INVENTORY REPORTS
// Copyleft FranciX 2010
//http://forums.ocsinventory-ng.org/viewtopic.php?pid=30974
//
// This code is open source and may be copied and modified as long as the source
// code is always made freely available.
// Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt
//====================================================================================
require_once PHPCAS;
require_once BACKEND . 'require/cas.config.php';
$cas = new phpCas();
$cas->client(CAS_VERSION_2_0, $cas_host, $cas_port, $cas_uri);
$cas->forceAuthentication();
$login = $cas->getUser();
$mdp = "";
if ($login) {
    $login_successful = "OK";
    $cnx_origine = "CAS";
    $user_group = "CAS";
}