コード例 #1
0
ファイル: acl.php プロジェクト: wwxgitcat/habari
 /**
  * Clears all caches used to hold permissions
  *
  */
 public static function clear_caches()
 {
     if (isset($_SESSION['user_token_access'])) {
         unset($_SESSION['user_token_access']);
     }
     if (isset($_SESSION['user_tokens'])) {
         unset($_SESSION['user_tokens']);
     }
     self::$token_cache = null;
 }
コード例 #2
0
ファイル: acl.php プロジェクト: habari/system
 /**
  * Get an associative array of token ids and their name.
  *
  * @return array an array in the form id => name
  */
 private static function cache_tokens()
 {
     if (ACL::$token_cache == null) {
         ACL::$token_cache = DB::get_keyvalue('SELECT id, name FROM {tokens}');
     }
     return ACL::$token_cache;
 }