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:
|
||||
|
||||
|
||||
require '/sda1/www/idp.runpolito.ml/vendor/autoload.php';
|
||||
require_once '/sda1/www/idp.runpolito.ml/lib/_autoload.php';
|
||||
require '/percorso/simplesamlphp/library/vendor/autoload.php';
|
||||
require_once '/percorso/simplesamlphp/library/lib/_autoload.php';
|
||||
require 'lib/r4fb.php';
|
||||
//require 'lib/sns.php';
|
||||
//session_start();
|
||||
$auth = new \SimpleSAML\Auth\Simple('runpolito-sp');
|
||||
|
||||
/*if (!$auth->isAuthenticated()) {
|
||||
SimpleSAML_Session::getSessionFromRequest()->cleanup();
|
||||
// Show login link.
|
||||
print('<a href="/login">Login</a>');
|
||||
}*/
|
||||
$auth = new \SimpleSAML\Auth\Simple('nomeSP');
|
||||
|
||||
|
||||
|
||||
//Auth livello 1:
|
||||
$auth->requireAuth();
|
||||
SimpleSAML_Session::getSessionFromRequest()->cleanup();
|
||||
|
||||
//print_r($auth->getAttributes());
|
||||
|
||||
$guid = $auth->getAttributes()['guid'][0];
|
||||
//print_r(r4fb::fetchUsers($guid));
|
||||
$nome = r4fb::fetchUsers($guid)[0]['nome'];
|
||||
$cognome = r4fb::fetchUsers($guid)[0]['cognome'];
|
||||
$matr = r4fb::fetchUsers($guid)[0]['matr'];
|
||||
//Auth livello 2:
|
||||
$tipo = trim(r4fb::fetchUsers($guid)[0]['tipo']);
|
||||
//print $tipo;
|
||||
|
||||
if($tipo != 1 && $tipo != 4)
|
||||
{
|
||||
$auth->logout();
|
||||
header("Location: index.php?error=Privilegi insufficienti.");
|
||||
die("su cunnu e tzia rua bagassa");
|
||||
die();
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Ciao merda"
|
||||
echo "MESSAGGIO DI BENVENUTO A CAZZO"
|
||||
. "<form name='logout' action='' method='post'>"
|
||||
. "<input type='submit' name='logout' value='Logout' />"
|
||||
. "</form>";
|
||||
|
||||
Reference in New Issue
Block a user