/**
  * Gets all the users in a group
  *
  * @param $group_id
  *
  * @return array|null
  */
 public function GetRelatedUserGroups($group_id)
 {
     $result = Capsule::table('syscrack_users')->where('user_permission_group', $group_id)->get();
     return !empty($result) ? Result::GetAllResults($result) : null;
 }
 /**
  * Gets all the sessions linked to that user
  *
  * @param $userid
  *
  * @return array|bool|null
  */
 public function GetAllUserSessions($userid)
 {
     $result = Capsule::table('syscrack_active_sessions')->where('session_user_id', $userid)->get();
     return !empty($result) ? Result::GetAllResults($result) : false;
 }
 /**
  * Gets all the recent events
  *
  * @param $user_ip
  *
  * @param $recent_time
  *
  * @return array|bool|null
  */
 public function GetRecentAttempts($user_ip, $recent_time)
 {
     $result = Capsule::table('syscrack_login_attempt')->where('attempted_user_ip', $user_ip)->orWhere('attempted_time', ">", $recent_time)->get();
     return !empty($result) ? Result::GetAllResults($result) : false;
 }
 /**
  * Gets this user ids tokens
  *
  * @param $user_id
  *
  * @return array|null
  */
 public function GetVerifyAttempts($user_id)
 {
     $result = Capsule::table('syscrack_security_email_tokens')->where('token_user_id', $user_id)->get();
     return !empty($result) ? Result::GetAllResults($result) : null;
 }