Index du Forum » » Le coin des codeurs

Auteur

[Résolu] - Autorisation
Jireck
8461       

  Posté : 06-09-2023 10:06

je reposte la fonction
function autorisation($auto) {
global $user, $admin;
$affich=false;
if (($auto==-1) and (!$user)) $affich=true;
if (($auto==1) and (isset($user))) $affich=true;
if ($auto>1) {
$tab_groupe=valid_group($user);
if ($tab_groupe) {
foreach($tab_groupe as $groupevalue) {
if ($groupevalue==$auto) {
$affich=true;
break;
}
}
}
}
if ($auto==0) $affich=true;
if (($auto==-127) and ($admin)) $affich=true;
return ($affich);
}

-127 => Admin ok
0 anonyme ok
1 membre ok
>1 groupe ok

-1 ?



Cet article provient de NPDS

http://www.npds.org/viewtopic.php?topic=26839&forum=5