Example #1
0
 protected function _accessLevelCheck($accessLevel)
 {
     $ss = SessionStorage::getInstance();
     if (@$ss->get("user")['access_level'] < $accessLevel) {
         throw new AccessDeniedException("You cannot create/update users with a access level higher than yourself.");
     }
 }
Example #2
0
 public function insert($data)
 {
     $ss = SessionStorage::getInstance();
     $data['userid'] = $ss->get("user")['uid'];
     $iTokens = $this->db->getInsertTokens($data);
     $query = "INSERT INTO storex.pages ({$iTokens['0']}, time_added) VALUES ({$iTokens['1']}, NOW())";
     $this->db->query($query);
     $id = $this->db->lastId();
     return $id;
 }
Example #3
0
 function insert($data)
 {
     if (!is_array($data)) {
         $data = ["location" => $data, "name" => $data];
     }
     $ss = SessionStorage::getInstance();
     $data['userid'] = $ss->get("user")['uid'];
     $data['access_level'] = 1;
     $iTokens = $this->db->getInsertTokens($data);
     $query = "INSERT INTO storex.files ({$iTokens['0']}, time_added) VALUES ({$iTokens['1']}, NOW())";
     $this->db->query($query);
     return $this->db->lastId();
 }
 public function logout($sid)
 {
     return SessionStorage::destroy();
 }