/**
  * Gets all the members in a this group
  *
  * @param $group_id
  *
  * @return array|null
  */
 public function GetMembers($group_id)
 {
     $class = new DatabaseUserActions();
     if ($this->GetGroup($group_id) != null) {
         return $class->GetRelatedUserGroups($group_id);
     }
     return null;
 }
 /**
  * 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;
 }
示例#4
0
 /**
  * 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;
 }
示例#5
0
 /**
  * Gets the owner of an email
  *
  * @param $email
  *
  * @return mixed|null
  */
 public function EmailOwner($email)
 {
     $result = $this->manager->GetEmailOwner($email);
     if ($result != null) {
         return $result;
     }
     return null;
 }