forked from vergnet/site-accueil-insa
cas en php
This commit is contained in:
parent
7b0cf0ab0d
commit
3b24d5a8d3
1 changed files with 32 additions and 0 deletions
32
photos.php
32
photos.php
|
@ -243,6 +243,33 @@ function generatePath($path)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//CAS
|
||||
require_once("phpCAS-1.3.6/CAS.php");
|
||||
|
||||
// Initialize phpCAS
|
||||
phpCAS::client(CAS_VERSION_2_0, "cas.insa-toulouse.fr", 443, 'cas', true);
|
||||
|
||||
// For production use set the CA certificate that is the issuer of the cert
|
||||
// on the CAS server and uncomment the line below
|
||||
// phpCAS::setCasServerCACert($cas_server_ca_cert_path);
|
||||
|
||||
// For quick testing you can disable SSL validation of the CAS server.
|
||||
// THIS SETTING IS NOT RECOMMENDED FOR PRODUCTION.
|
||||
// VALIDATING THE CAS SERVER IS CRUCIAL TO THE SECURITY OF THE CAS PROTOCOL!
|
||||
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();
|
||||
}
|
||||
?>
|
||||
<div class="inner">
|
||||
|
||||
|
@ -256,6 +283,11 @@ function generatePath($path)
|
|||
<span class="circles circles-bottom"></span>
|
||||
</div>
|
||||
<section>
|
||||
<font color="red">
|
||||
<h1>Vous êtes connecté !</h1>
|
||||
<p>Connecté en tant que : <b><?php echo phpCAS::getUser(); ?></b>.</p>
|
||||
<p>Vous pouvez vous déconnecter en cliquant ici :<a href="?logout=" class="link">Se déconnecter</a></p>
|
||||
</font><br><br>
|
||||
<p>Clique sur le dossier de ton choix pour afficher les photos. Il faut que tu sois inscrit à l'INSA pour pouvoir
|
||||
les regarder (et oui, pas de spoiler).</p>
|
||||
<p>Il te suffit ensuite de cliquer sur la photo que tu veux télécharger.</p>
|
||||
|
|
Loading…
Reference in a new issue