Aggiorna 'giocatore.php'
This commit is contained in:
@@ -41,42 +41,34 @@ This file is part of Run4Football. (C)2019 Corrado Mulas - CM TLC - R&D Dept. -
|
|||||||
//MAIN:
|
//MAIN:
|
||||||
|
|
||||||
|
|
||||||
require '/sda1/www/idp.runpolito.ml/vendor/autoload.php';
|
require '/percorso/simplesamlphp/library/vendor/autoload.php';
|
||||||
require_once '/sda1/www/idp.runpolito.ml/lib/_autoload.php';
|
require_once '/percorso/simplesamlphp/library/lib/_autoload.php';
|
||||||
require 'lib/r4fb.php';
|
require 'lib/r4fb.php';
|
||||||
//require 'lib/sns.php';
|
|
||||||
//session_start();
|
|
||||||
$auth = new \SimpleSAML\Auth\Simple('runpolito-sp');
|
|
||||||
|
|
||||||
/*if (!$auth->isAuthenticated()) {
|
$auth = new \SimpleSAML\Auth\Simple('nomeSP');
|
||||||
SimpleSAML_Session::getSessionFromRequest()->cleanup();
|
|
||||||
// Show login link.
|
|
||||||
print('<a href="/login">Login</a>');
|
|
||||||
}*/
|
|
||||||
|
|
||||||
//Auth livello 1:
|
//Auth livello 1:
|
||||||
$auth->requireAuth();
|
$auth->requireAuth();
|
||||||
SimpleSAML_Session::getSessionFromRequest()->cleanup();
|
SimpleSAML_Session::getSessionFromRequest()->cleanup();
|
||||||
|
|
||||||
//print_r($auth->getAttributes());
|
|
||||||
|
|
||||||
$guid = $auth->getAttributes()['guid'][0];
|
$guid = $auth->getAttributes()['guid'][0];
|
||||||
//print_r(r4fb::fetchUsers($guid));
|
|
||||||
$nome = r4fb::fetchUsers($guid)[0]['nome'];
|
$nome = r4fb::fetchUsers($guid)[0]['nome'];
|
||||||
$cognome = r4fb::fetchUsers($guid)[0]['cognome'];
|
$cognome = r4fb::fetchUsers($guid)[0]['cognome'];
|
||||||
$matr = r4fb::fetchUsers($guid)[0]['matr'];
|
$matr = r4fb::fetchUsers($guid)[0]['matr'];
|
||||||
//Auth livello 2:
|
//Auth livello 2:
|
||||||
$tipo = trim(r4fb::fetchUsers($guid)[0]['tipo']);
|
$tipo = trim(r4fb::fetchUsers($guid)[0]['tipo']);
|
||||||
//print $tipo;
|
|
||||||
if($tipo != 1 && $tipo != 4)
|
if($tipo != 1 && $tipo != 4)
|
||||||
{
|
{
|
||||||
$auth->logout();
|
$auth->logout();
|
||||||
header("Location: index.php?error=Privilegi insufficienti.");
|
header("Location: index.php?error=Privilegi insufficienti.");
|
||||||
die("su cunnu e tzia rua bagassa");
|
die();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo "Ciao merda"
|
echo "MESSAGGIO DI BENVENUTO A CAZZO"
|
||||||
. "<form name='logout' action='' method='post'>"
|
. "<form name='logout' action='' method='post'>"
|
||||||
. "<input type='submit' name='logout' value='Logout' />"
|
. "<input type='submit' name='logout' value='Logout' />"
|
||||||
. "</form>";
|
. "</form>";
|
||||||
|
|||||||
Reference in New Issue
Block a user