daencore

Access function

May 4th, 2021
597
354 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Überprüft ob der Benutzer zugriff aufs Modul hat und gibt true oder false zurück
  3.  * @param string id Userid des Benutzers
  4.  * @param string site Modulname
  5.  * @return boolean true, wenn der Benutzer berechtigung für das modul hat, sonst false
  6.  */
  7. function modul_access($id,$site){
  8.     if (isset($id,$site)) {
  9.         $user_rechte = check_role($id);
  10.         $modul_rechte = check_modul_role($site);
  11.         //$recht = array_intersect(array($user_rechte),array($modul_rechte));
  12.        // print_r(array_values($recht));
  13.         print_r($modul_rechte);
  14.         print_r($user_rechte);
  15.         foreach($user_rechte as $actual_recht){
  16.             echo $actual_recht;
  17.        
  18.             if (in_array($actual_recht,$user_rechte)) {
  19.                echo " Recht vorhanden ";
  20.             } else {
  21.                echo " Recht nicht vorhanden ";
  22.             }
  23.         }
  24.      } else {
  25.         die('<meta http-equiv="refresh" content="0; URL=/index.php">');
  26.      }
  27. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×