.
*/
/**
* Description of giocatore
*
* @author corradomulas for Run PoliTo - Corso Duca degli Abruzzi 24, 10129 Torino (TO)
*/
// put your code here
//MAIN:
require '/percorso/simplesamlphp/library/vendor/autoload.php';
require_once '/percorso/simplesamlphp/library/lib/_autoload.php';
require 'lib/r4fb.php';
$auth = new \SimpleSAML\Auth\Simple('nomeSP');
//Auth livello 1:
$auth->requireAuth();
SimpleSAML_Session::getSessionFromRequest()->cleanup();
$guid = $auth->getAttributes()['guid'][0];
$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']);
if($tipo != 1 && $tipo != 4)
{
$auth->logout();
header("Location: index.php?error=Privilegi insufficienti.");
die();
}
else
{
echo "MESSAGGIO DI BENVENUTO A CAZZO"
. "";
}
if(isset($_POST['logout']))
{
$auth->logout();
}
?>