Ejemplo n.º 1
0
 /**
  * Get our permission flags.
  *
  * @param $userid
  *
  * @return bool|static
  */
 public function GetPermissionFlags($userid)
 {
     if ($this->groupmanager->IsValid($this->usergroups->GetGroup($userid))) {
         return $this->database->GetPermissionFlags($userid) . $this->groupmanager->GetPermissions($this->usergroups->GetGroup($userid));
     }
     return $this->database->GetPermissionFlags($userid);
 }
Ejemplo n.º 2
0
 /**
  * Does this post exist?
  *
  * @param $postid
  *
  * @return bool
  */
 public function PostExists($postid)
 {
     if (!$this->database->GetPost($postid)) {
         return false;
     }
     return true;
 }
Ejemplo n.º 3
0
 /**
  * Gets a selection fo music.
  *
  * @param $start
  *
  * @param $amount
  *
  * @param bool|false $json
  *
  * @return array|bool|string|static[]
  */
 public function GetSelection($start, $amount, $json = false)
 {
     $result = $this->database->SelectMusic($start, $amount);
     if ($json) {
         return $result != false ? json_encode($result) : false;
     }
     return $result != false ? $result : false;
 }
Ejemplo n.º 4
0
 /**
  * Creates a post.
  *
  * @param $userid
  *
  * @param $text
  *
  * @param array $tags
  */
 public function CreatePost($userid, $text, $tags = ['Music'])
 {
     $data = ['authorid' => $userid, 'author' => $this->database->IDToUsername($userid), 'text' => $text];
     $this->database->AddPost($userid, json_encode($tags), json_encode($data));
 }
Ejemplo n.º 5
0
 /**
  * Helper function to convert the username to userid.
  *
  * @param $username
  *
  * @return \___PHPSTORM_HELPERS\static|bool
  */
 public function FindUserID($username)
 {
     return $this->database->UsernameToID($username);
 }
Ejemplo n.º 6
0
 /**
  * Get the groups members.
  *
  * @param $groupid
  *
  * @return bool
  */
 public function GetGroupMembers($groupid)
 {
     return $this->database->GetGroupMembers($groupid);
 }
Ejemplo n.º 7
0
 /**
  * Returns the owners ID.
  *
  * @param $sessionid
  *
  * @return mixed
  */
 public function SessionUserID($sessionid)
 {
     return !empty($this->database->GetSessionUserID($sessionid)) ? $this->database->GetSessionUserID($sessionid) : false;
 }