Esempio n. 1
0
 public static function getHiddenPlugins()
 {
     $Cache = SpeedCache::getCache("getHiddenPlugins");
     if ($Cache !== null) {
         return $Cache;
     }
     $UD = new mUserdata();
     $UD->addAssocV3("typ", "=", "pHide");
     $UD->addAssocV3("UserID", "=", $_SESSION["S"]->getCurrentUser()->getID());
     $labels = array();
     try {
         while ($sUD = $UD->getNextEntry()) {
             $A = $sUD->getA();
             $labels[$A->wert] = 1;
         }
     } catch (StorageException $e) {
         return true;
     }
     SpeedCache::setCache("getHiddenPlugins", $labels);
     return $labels;
 }
Esempio n. 2
0
 public function doLogout()
 {
     if (isset($_SESSION["applications"])) {
         $_SESSION["applications"]->setActiveApplication("nil");
     }
     $_SESSION["CurrentAppPlugins"] = null;
     $_SESSION["BPS"] = null;
     $_SESSION["S"]->logoutUser();
     SpeedCache::clearCache();
 }
Esempio n. 3
0
 public static function checkRestrictionOrDie($restriction)
 {
     if ($_SESSION["S"]->getCurrentUser() == null) {
         return;
     }
     #throw new Exception("No user authenticated with the system!");
     if ($_SESSION["S"]->isUserAdmin()) {
         return;
     }
     if (SpeedCache::inStaticCache("checkRestrictionOrDie{$restriction}")) {
         $sUD = SpeedCache::getStaticCache("checkRestrictionOrDie{$restriction}", true);
     } else {
         $UD = new mUserdata();
         $UD->addAssocV3("wert", "=", $restriction);
         $UD->addAssocV3("UserID", "=", Session::currentUser()->getID());
         $sUD = $UD->getNextEntry();
         SpeedCache::setStaticCache("checkRestrictionOrDie{$restriction}", $sUD);
     }
     if ($sUD != null) {
         Red::errorD("Diese Aktion ist nicht erlaubt!");
     }
 }
Esempio n. 4
0
 public static function clearStaticCache()
 {
     self::$staticCache = array();
 }