Return active entities of current logged user.
@return array
428539
public function getActiveEntities() {
      $response = $this->client->request('get', 'getActiveEntities');
      return [
         'statusCode' => $response->getStatusCode(),
         'body' => $response->getBody()->getContents(),
      ];
   }
907198
protected function getListUser()
    {
        $conditions = $this->query_filter;
        $conditions['limit'] = $this->data_limit;

        $list = (array) $this->user->getList($conditions);
        $this->prepareListUser($list);
        return $list;
    }
101365
private static function getFromSession()
    {
        if (empty($_SESSION['current_user'])) {
            // No user in session, create one.
            $entityClassName = static::ENTITIES_CLASS_NAME;
            $user = new $entityClassName(array(
                'source' => 'cookie',
            ));
            self::setCurrent($user);
        } else {
            Logger::get()->debug('Found user in session.');
            // Regenerate session ID every SESSION_DURATION minutes.
            if (time() > ($_SESSION['timestamp'] +  + self::SESSION_DURATION)) {
                Logger::get()->debug('Regenerated session ID.');
                session_regenerate_id();
            }
        }

        return $_SESSION['current_user'];
    }
91816
public function isActive()
    {
        $active = ($this->cookie !== null && $this->cookie != '');
        
        if ($this->sizeLimit && $this->sizeLimit === $this->pageSize) {
            $active = false;
        }
        
        return $active;
    }
626484
public function getActiveList()
    {
        return $this->find()
            ->select(['id', 'first_name', 'last_name'])
            ->where([sprintf('%s.active', $this->getAlias()) => true])
            ->order(['username' => 'ASC'])
            ->formatResults(function (ResultSet $results) {
                return $results->indexBy('id')->map(function (User $user) {
                    return $user->first_name . ' ' . $user->last_name;
                });
            })
            ->cache(sprintf('active_%s_list', $this->getTable()), $this->getCacheName());
    }
612030
public function getRolesForUserCreation()
    {
        $rolesList = [];

        // logged user
        $user = auth()->user();

        if( auth()->check() ) {
            if( $user->isSuperAdmin() ) {
                $rolesList = Roles::select('id', 'name as label')->orderBy('name')->get();
            } else {
                foreach ( $user->roles as $role ) {
                    $rolesList[] = [
                        'id'    => $role->id,
                        'label' => $role->name,
                    ];
                }
            }
        }

        return $rolesList;
    }
1074306
public function getUsersPairs()
    {
        // Check and init cache
        if (!self::$cached_users_pairs) {
            $user_collection = new AdminUserRepository;
            $user_collection->addOrderByField('name');
            foreach ($user_collection->getAsArrayOfObjects() as $v) {
                /** @var AdminUser $v */
                self::$cached_users_pairs[$v->getId()] = $v->getName() . ' ' . $v->getSurname() . ' [' . $v->getLogin() . ']';
            }
        }

        return self::$cached_users_pairs;
    }
1128096
public function getActiveServers()
    {
        $activeServers = [];

        if (isset($this->config['servers']) && is_array($this->config['servers'])) {
            foreach ($this->config['servers'] as $server) {
                if (isset($server['active']) && isset($server['objectClass']) && $server['active']) {
                    $activeServers[] = $server['name'];
                }
            }
        }

        return $activeServers;
    }
265056
public static function getStatuses()
    {
        return [
            self::STATUS_ACTIVE => Yii::t('podium/view', 'Active'),
            self::STATUS_BANNED => Yii::t('podium/view', 'Banned'),
            self::STATUS_REGISTERED => Yii::t('podium/view', 'Registered'),
        ];
    }
641254
public function getActive()
	{
		if ($this->_active)
		{
			$item =& $this->_items[$this->_active];

			return $item;
		}

		return null;
	}
479641
protected function users()
    {
        $rows   = \Antares\Modules\SampleModule\Model\ModuleRow::query()->groupBy('user_id')->with('user')->get();
        $return = ['' => trans('antares/users::messages.statuses.all')];
        foreach ($rows as $row) {
            $return[$row->user_id] = $row->user->fullname;
        }
        return $return;
    }
233019
public function members() : array
    {
        $members = [];

        if (!isset($this->info()->threadMembers) || $this->info()->threadMembers <= 0) return null;

        foreach ($this->info()->threadMembers as $member) {
            $members[] = new User($this->client, $member->onlineId);
        }

        return $members;
    }
156625
public function allLoggedIn(): Collection
    {
        return DB::table('user')
            ->join('session', 'session.user_id', '=', 'user.user_id')
            ->where('user.user_id', '>', 0)
            ->orderBy('real_name')
            ->select(['user.*'])
            ->distinct()
            ->get()
            ->map(User::rowMapper());
    }
571030
public function status()
    {
        $auth       = $this->getAuthenticationService();
        $loggedIn   = $auth->hasIdentity();
        $identity   = $loggedIn ? $auth->getIdentity() : null;

        return (object) array(
            'loggedIn'      => $loggedIn,
            'id'            => $loggedIn ? $identity->id            : null,
            'email'         => $loggedIn ? $identity->email         : null,
            'displayName'   => $loggedIn ? $identity->displayName   : null,
        );
    }
1203722
public function entityAction()
    {
        $page = (int)$this->getEvent()->getRouteMatch()->getParam('page');
        $entityClass = $this->getEvent()->getRouteMatch()->getParam('entityClass');

        return array(
            'entityClass' => $entityClass,
            'page' => $page,
        );
    }
1343611
public function getActive()
    {
        if (count($this->active) < 1) {
            return null;
        }
        while (time() > current($this->active)) {
            $key = key($this->active);
            $this->expired[$key] = current($this->active);
            $this->increment($this->active);
            unset($this->active[$key]);
            if (count($this->active) < 1) {
                return null;
            }
        }
        $active = key($this->active);
        $this->increment($this->active);
        return $active;
    }
1251870
protected function getUserId()
    {
        if (!$this->users) {
            $userStorage = $this->entityTypeManager->getStorage('user');

            $this->users = $userStorage->loadByProperties(['status' => true]);
        }

        return array_rand($this->users);
    }