示例#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;
 }
示例#2
0
 public function doLogout()
 {
     if (isset($_SESSION["applications"])) {
         $_SESSION["applications"]->setActiveApplication("nil");
     }
     $_SESSION["CurrentAppPlugins"] = null;
     $_SESSION["BPS"] = null;
     $_SESSION["S"]->logoutUser();
     SpeedCache::clearCache();
 }
示例#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!");
     }
 }
示例#4
0
 public static function clearStaticCache()
 {
     self::$staticCache = array();
 }