Hacked By AnonymousFox
<?php
class Auth{
/* Condition par rapport au rôle return un booléen */
public static function roleAuth($roles){
$role = $_SESSION['role']['id'];
$admin = $_SESSION['role']['admin'];
if(!$admin){
/* Si c'est pas un administrateur alors verification du role */
if(in_array($role, $roles))
return true;
else
return false;
/* Si c'est un administrateur alors true*/
}else
return true;
}
/* Limitation d'accès par rapport au rôle */
public static function roleAccesAuth($roles){
$role = $_SESSION['role']['id'];
$admin = $_SESSION['role']['admin'];
if(!$admin){
/* Si c'est pas un administrateur alors verification du role */
if(!in_array($role, $roles)){
header('location:'.BASEADMIN.'admin.php');
die();
}
}
}
}
?>
Hacked By AnonymousFox1.0, Coded By AnonymousFox