/** * Does this user exist? * * @param $user_id * * @return bool */ public function Exists($user_id) { if ($this->manager->GetUser($user_id) != null) { return true; } return false; }
/** * Checks to see if that user has a permission * * @param $permission * * @param $user_id * * @return bool */ public function HasPermission($permission, $user_id) { /** * Is this user valid? */ if ($this->user->GetUser($user_id) != null) { /** * Is this set? */ if (isset($this->groups->GetPermissions($this->user->GetGroup($user_id))[$permission])) { return true; } } return false; }
/** * Pretty much returns the value it gave us haha * * @param $user_id * * @return null */ public static function GetUserID($user_id) { $class = new DatabaseUserExtensionActions(); if ($class->GetUser($user_id) != null) { return $user_id; } return null; }
/** * Gets the username of the current user * * @return mixed|null */ public static function Username() { $result = SessionConstants::UserID(); if ($result != null) { $class = new DatabaseUserExtensionActions(); if ($class->GetUser($result) != null) { return $class->GetUsername($result); } } return null; }