update route file for auth and logout
update ufc-cas config url
This commit is contained in:
parent
7f96f47af8
commit
daf4ec7305
|
@ -24,7 +24,7 @@ $phpcas_path = '../../source/';
|
|||
///////////////////////////////////////
|
||||
|
||||
// Full Hostname of your CAS Server
|
||||
$cas_host = 'cas.domain.fr';
|
||||
$cas_host = 'cas.univ-fcomte.fr';
|
||||
// Context of the CAS Server
|
||||
$cas_context = 'cas';
|
||||
// Port of your CAS server. Normally for a https server it's 443
|
||||
|
|
27
application/include/controlleurs/authentification.php
Normal file
27
application/include/controlleurs/authentification.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
// Load the settings from the central config file
|
||||
require_once CONFIG_PATH . DIRECTORY_SEPARATOR . 'cas-authentification-config-example.php';
|
||||
|
||||
// Enable debugging
|
||||
\phpCAS::setDebug();
|
||||
// Enable verbose error messages. Disable in production!
|
||||
\phpCAS::setVerbose(true);
|
||||
|
||||
// Initialize phpCAS
|
||||
\phpCAS::client(CAS_VERSION_2_0, $cas_host, $cas_port, $cas_context);
|
||||
|
||||
// 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().
|
||||
$templateData = array("login"=> \phpCAS::getUser());
|
4
application/include/controlleurs/logout.php
Normal file
4
application/include/controlleurs/logout.php
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
// Load the settings from the central config file
|
||||
require_once CONFIG_PATH . DIRECTORY_SEPARATOR . 'cas-authentification-config-example.php';
|
||||
\phpCAS::logout();
|
5
application/include/modeles/authentification.model
Normal file
5
application/include/modeles/authentification.model
Normal file
|
@ -0,0 +1,5 @@
|
|||
name : authentification
|
||||
page_title : Authentification de l'application
|
||||
description : zatou stra bracadabla
|
||||
params : params
|
||||
|
5
application/include/modeles/logout.model
Normal file
5
application/include/modeles/logout.model
Normal file
|
@ -0,0 +1,5 @@
|
|||
name : logout
|
||||
page_title : Logout de l'application
|
||||
description : zatou stra bracadabla
|
||||
params : params
|
||||
|
17
application/include/vues/view/authentification.blade.php
Normal file
17
application/include/vues/view/authentification.blade.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
@extends('body')
|
||||
|
||||
@section('sidebar')
|
||||
@parent
|
||||
|
||||
<p>This is appended to the master sidebar.</p>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<h1>Authentification</h1>
|
||||
<br /><br /><br />
|
||||
<a href="{{ \MVC\Classe\Url::link_rewrite(false, 'logout', []) }}">Log out ?</a>
|
||||
<hr/>
|
||||
Bonjour, {{$login}}
|
||||
|
||||
@endsection
|
||||
|
14
application/include/vues/view/logout.blade.php
Normal file
14
application/include/vues/view/logout.blade.php
Normal file
|
@ -0,0 +1,14 @@
|
|||
@extends('body')
|
||||
|
||||
@section('sidebar')
|
||||
@parent
|
||||
<p>This is appended to the master sidebar.</p>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<h1>Logout</h1>
|
||||
<br /><br /><br />
|
||||
<a href="{{ \MVC\Classe\Url::link_rewrite(false, 'authentification', []) }}">S'authentifier ?</a>
|
||||
<hr/>
|
||||
|
||||
@endsection
|
Loading…
Reference in a new issue