Returns an associative array with the data about the user.
Fields array described in the method Init::setFields

@example <code>
$this->getUser();
</code>

@return boolean|array  data provided by the ISP authentication
19702
public function getUser() {

        if($this->user === false) {

            $this->session->remove(self::KEY);
            $this->session->set(self::KEY, parent::getUser());
        }

        return $this->user;
    }
23625
public function getUsers()
    {
        // get the user list
        return $this->apiCall('users.list')->then(function (Payload $response) {
            $users = [];
            foreach ($response['members'] as $member) {
                $users[] = new User($this, $member);
            }
            return $users;
        });
    }
847027
public function getUser()
    {
        if ($this->_user === false) {
            $this->_user = User::findByKeyfield($this->username);
        }
        return $this->_user;
    }
907198
protected function getListUser()
    {
        $conditions = $this->query_filter;
        $conditions['limit'] = $this->data_limit;

        $list = (array) $this->user->getList($conditions);
        $this->prepareListUser($list);
        return $list;
    }
373374
public function getFieldsData()
    {
        $fieldsData = array();
        foreach ($this->getFields() as $field) {
            $fieldData = $this->$field;
            // If the field is an Entity, decode it.
            if ($fieldData instanceof self) {
                $fieldData = $fieldData->getFieldsData();
            } elseif (@reset($fieldData) instanceof Entity) {
                // If the field is an array of Entity, decode them all.
                $newFieldData = array();
                foreach ($fieldData as $key => $entity) {
                    $newFieldData[$key] = $entity->getFieldsData();
                }
                $fieldData = $newFieldData;
            }

            $fieldsData[$field] = $fieldData;
        }

        return $fieldsData;
    }
121075
protected function setUserModel()
    {
        $config = $this->app->make('config');

        $model = $config->get('auth.providers.users.model', function () use ($config) {
            return $config->get('auth.model', $config->get('chatmessenger.user_model'));
        });

        Models::setUserModel($model);

        Models::setTables([
            'users' => (new $model)->getTable(),
        ]);
    }
153365
function loadUserFields()
    {
        $user_fields = array();

        $this->container->get('event_dispatcher')->dispatch(SettingsEvents::BEFORE_LOAD_USERFIELDS, new FilterUserFieldsEvent($user_fields, $this->container));

        array_merge($user_fields, $user_fields = $this->container->getParameter("acs_settings.user_fields"));

        $user = $this->container->get('security.context')->getToken()->getUser();

        // If is admins we load the global system settings
        if (true === $this->container->get('security.context')->isGranted('ROLE_SUPER_ADMIN')) {
            $user_fields = array_merge($user_fields, $system_fields = $this->container->getParameter("acs_settings.system_fields"));
        }

        $object_settings = $this->container->get('acs.setting_manager')->getObjectSettingsPrototype($user);

        $user_fields = array_merge($user_fields, $object_settings);

        $this->container->get('event_dispatcher')->dispatch(SettingsEvents::AFTER_LOAD_USERFIELDS, new FilterUserFieldsEvent($user_fields,$this->container));

        return $user_fields;
    }
78139
public function getUsers()
    {
        if ($this->users === null) {
            $this->setUsers($this->userRepository->getAllByEnvironment($this));
        }
        return $this->users;
    }
833438
protected function getFields()/*# : bool */
    {
        if (null === $this->cols) {
            $result = $this->statement->result_metadata();
            if (false === $result) {
                return false;
            }

            $this->cols = [];

            // set column name
            foreach ($result->fetch_fields() as $col) {
                $this->cols[] = $col->name;
            }
        }
        return true;
    }
55664
public function getData()
    {
        $users = $this->userManager->findLoggedInUsers();

        $data = [];
        foreach ($users as $user) {
            $data[] = [
                'uid' => $user->getId(),
                'username' => $user->getUsername(),
                'image' => '/bundles/users/images/male-black-blonde.png',
            ];
        }

        return $data;
    }
452548
public function getUser()
    {
        if ( ! $this->container->has('security')) {
            return false;
        }

        $security = $this->container->get('security');

        if ( ! $token = $security->getToken()) {
            return false;
        }

        $user = $token->getUser();
        if ( ! $user instanceof UserInterface) {
            return false;
        }

        return $user;
    }
745390
protected function GetUserAddressDataParameter()
    {
        $aUserAddressData = array();
        $oActiveUser = TdbDataExtranetUser::GetInstance();
        if ($oActiveUser) {
            $oBillingAddress = $oActiveUser->GetBillingAddress();
            if ($oBillingAddress) {
                $aUserAddressData['uppCustomerDetails'] = 'yes';
                $aUserAddressData['uppCustomerFirstName'] = $oBillingAddress->fieldFirstname;
                $aUserAddressData['uppCustomerLastName'] = $oBillingAddress->fieldLastname;
                $aUserAddressData['uppCustomerStreet'] = $oBillingAddress->fieldStreet.' '.$oBillingAddress->fieldStreetnr;
                $aUserAddressData['uppCustomerZipCode'] = $oBillingAddress->fieldPostalcode;
                $aUserAddressData['uppCustomerCity'] = $oBillingAddress->fieldCity;
                $aUserAddressData['uppCustomerCountry'] = $this->GetBillingCountryISOCode($oBillingAddress);
                $aUserAddressData['uppCustomerPhone'] = $oBillingAddress->fieldTelefon;
                $aUserAddressData['uppCustomerFax'] = $oBillingAddress->fieldFax;
                $aUserAddressData['uppCustomerEmail'] = $oActiveUser->fieldName;
            }
        }

        return $aUserAddressData;
    }
215820
public function createUser() {
        $data = array();

        foreach ($this->userFields as $base => $field) {
            $data[$field] = $this->getFieldInput($base);
        }

        $model = ClassRegistry::init($this->usersModel);
        $model->create();
        $model->save($data, false);

        $this->config = $data;
        $this->user = $model->find('first', array(
            'conditions' => array($model->alias . '.' . $model->primaryKey => $model->id),
            'recursive' => -1
        ));

        return $model->id;
    }
243309
private function init_ldap()
    {
        if ($this->ldap) {
            return $this->ldap->ready;
        }

        // get LDAP config
        $config = $this->rc->config->get('acl_users_source');

        if (empty($config)) {
            return false;
        }

        // not an array, use configured ldap_public source
        if (!is_array($config)) {
            $ldap_config = (array) $this->rc->config->get('ldap_public');
            $config      = $ldap_config[$config];
        }

        $uid_field = $this->rc->config->get('acl_users_field', 'mail');
        $filter    = $this->rc->config->get('acl_users_filter');

        if (empty($uid_field) || empty($config)) {
            return false;
        }

        // get name attribute
        if (!empty($config['fieldmap'])) {
            $name_field = $config['fieldmap']['name'];
        }
        // ... no fieldmap, use the old method
        if (empty($name_field)) {
            $name_field = $config['name_field'];
        }

        // add UID field to fieldmap, so it will be returned in a record with name
        $config['fieldmap']['name'] = $name_field;
        $config['fieldmap']['uid']  = $uid_field;

        // search in UID and name fields
        // $name_field can be in a form of <field>:<modifier> (#1490591)
        $name_field = preg_replace('/:.*$/', '', $name_field);
        $search     = array_unique(array($name_field, $uid_field));

        $config['search_fields']   = $search;
        $config['required_fields'] = array($uid_field);

        // set search filter
        if ($filter) {
            $config['filter'] = $filter;
        }

        // disable vlv
        $config['vlv'] = false;

        // Initialize LDAP connection
        $this->ldap = new rcube_ldap($config,
            $this->rc->config->get('ldap_debug'),
            $this->rc->config->mail_domain($_SESSION['imap_host']));

        return $this->ldap->ready;
    }
1183710
private function init()
    {
        $aData = $this->data;

        $this
            // Required value rules
            ->addRule(
                'required',
                function ($sFieldName) use ($aData) {
                    if (\nadir\core\validator\Validator::isIndexSet(
                        $aData,
                        $sFieldName
                    )) {
                        return true;
                    }
                    return false;
                },
                function ($sFieldName) {
                    return "Field '{$sFieldName}' is required.";
                }
            )
            // String rules
            ->addRule(
                'string',
                function ($sFieldName, array $aOpt = array()) use ($aData) {
                    if (\nadir\core\validator\Validator::isIndexSet(
                        $aData,
                        $sFieldName
                    )) {
                        $mValue = \nadir\core\validator\Validator
                        ::getArrayItemByPointSeparatedKey($aData, $sFieldName);
                        if (!is_string($mValue)) {
                            return false;
                        }
                        if (isset($aOpt['notEmpty'])) {
                            $mTmp = trim($mValue);
                            if ($aOpt['notEmpty'] && empty($mTmp)) {
                                return false;
                            }
                            if (!$aOpt['notEmpty'] && !empty($mTmp)) {
                                return false;
                            }
                        }
                        if (isset($aOpt['pattern'])) {
                            if (!preg_match($aOpt['pattern'], $mValue)) {
                                return false;
                            }
                        }
                        if (isset($aOpt['length'])) {
                            $nLength = mb_strlen($mValue, 'UTF-8');
                            if (isset($aOpt['length']['min'])) {
                                if ($nLength < $aOpt['length']['min']) {
                                    return false;
                                }
                            }
                            if (isset($aOpt['length']['max'])) {
                                if ($nLength > $aOpt['length']['max']) {
                                    return false;
                                }
                            }
                            if (isset($aOpt['length']['equal'])) {
                                if ($nLength != $aOpt['length']['equal']) {
                                    return false;
                                }
                            }
                        }
                    }
                    return true;
                },
                function ($sFieldName, array $aOpt = array()) {
                    if (!empty($aOpt)) {
                        $aKeys = array_keys($aOpt);
                        $sKeys = implode(', ', $aKeys);
                        return "Invalid string field '{$sFieldName}' value. "
                        . "Validation options: {$sKeys}";
                    }
                    return "Invalid string field '{$sFieldName}' value.";
                }
            )
            // Number rules
            ->addRule(
                'number',
                function ($sFieldName, array $aOpt = array()) use ($aData) {
                    if (\nadir\core\validator\Validator::isIndexSet(
                        $aData,
                        $sFieldName
                    )) {
                        $mValue = \nadir\core\validator\Validator
                        ::getArrayItemByPointSeparatedKey($aData, $sFieldName);
                        if (!is_numeric($mValue)) {
                            return false;
                        }
                        if (isset($aOpt['float'])) {
                            if ($aOpt['float'] && !is_float($mValue)) {
                                return false;
                            }
                            if (!$aOpt['float'] && is_float($mValue)) {
                                return false;
                            }
                        }
                        if (isset($aOpt['integer'])) {
                            if ($aOpt['integer'] && !is_int($mValue)) {
                                return false;
                            }
                            if (!$aOpt['integer'] && is_int($mValue)) {
                                return false;
                            }
                        }
                        if (isset($aOpt['positive'])) {
                            if ($aOpt['positive'] && $mValue <= 0) {
                                return false;
                            }
                            if (!$aOpt['positive'] && $mValue >= 0) {
                                return false;
                            }
                        }
                        if (isset($aOpt['value'])) {
                            if (isset($aOpt['value']['equal'])) {
                                if ($mValue != $aOpt['value']['equal']) {
                                    return false;
                                }
                            }
                            if (isset($aOpt['value']['min'])) {
                                if ($mValue < $aOpt['value']['min']) {
                                    return false;
                                }
                            }
                            if (isset($aOpt['value']['max'])) {
                                if ($mValue > $aOpt['value']['max']) {
                                    return false;
                                }
                            }
                        }
                    }
                    return true;
                },
                function ($sFieldName, array $aOpt = array()) {
                    if (!empty($aOpt)) {
                        $aKeys = array_keys($aOpt);
                        $sKeys = implode(', ', $aKeys);
                        return "Invalid number field '{$sFieldName}' value. "
                        . "Validation options: {$sKeys}";
                    }
                    return "Invalid number field '{$sFieldName}' value.";
                }
            )
            // Array rules
            ->addRule(
                'array',
                function ($sFieldName, array $aOpt = array()) use ($aData) {
                    if (\nadir\core\validator\Validator::isIndexSet(
                        $aData,
                        $sFieldName
                    )) {
                        $mValue = \nadir\core\validator\Validator
                        ::getArrayItemByPointSeparatedKey($aData, $sFieldName);
                        if (!is_array($mValue)) {
                            return false;
                        }
                        if (isset($aOpt['assoc'])) {
                            $funcIsAssoc = function (array $aArray) {
                                // return false if array is empty
                                return (bool) count(array_filter(
                                    array_keys($aArray),
                                    'is_string'
                                ));
                            };
                            if ($aOpt['assoc'] && !$funcIsAssoc($mValue)) {
                                return false;
                            }
                            if (!$aOpt['assoc'] && $funcIsAssoc($mValue)) {
                                return false;
                            }
                            unset($funcIsAssoc);
                        }
                        if (isset($aOpt['length'])) {
                            $nLength = count($mValue);
                            if (isset($aOpt['length']['min'])) {
                                if ($nLength < $aOpt['length']['min']) {
                                    return false;
                                }
                            }
                            if (isset($aOpt['length']['max'])) {
                                if ($nLength > $aOpt['length']['max']) {
                                    return false;
                                }
                            }
                            if (isset($aOpt['length']['equal'])) {
                                if ($nLength != $aOpt['length']['equal']) {
                                    return false;
                                }
                            }
                        }
                    }
                    return true;
                },
                function ($sFieldName, array $aOpt = array()) {
                    if (!empty($aOpt)) {
                        $aKeys = array_keys($aOpt);
                        $sKeys = implode(', ', $aKeys);
                        return "Invalid array field '{$sFieldName}' value. "
                        . "Validation options: {$sKeys}";
                    }
                    return "Invalid array field '{$sFieldName}' value.";
                }
            )
            // Boolean rules
            ->addRule(
                'boolean',
                function ($sFieldName, array $aOpt = array()) use ($aData) {
                    if (\nadir\core\validator\Validator::isIndexSet(
                        $aData,
                        $sFieldName
                    )) {
                        $mValue = \nadir\core\validator\Validator
                        ::getArrayItemByPointSeparatedKey($aData, $sFieldName);
                        if (!is_bool($mValue)) {
                            return false;
                        }
                        if (isset($aOpt['isTrue'])) {
                            if ($aOpt['isTrue'] && !$mValue) {
                                return false;
                            }
                            if (!$aOpt['isTrue'] && $mValue) {
                                return false;
                            }
                        }
                    }
                    return true;
                },
                function ($sFieldName, array $aOpt = array()) {
                    if (!empty($aOpt)) {
                        $aKeys = array_keys($aOpt);
                        $sKeys = implode(', ', $aKeys);
                        return "Invalid boolean field '{$sFieldName}' value. "
                        . "Validation options: {$sKeys}";
                    }
                    return "Invalid boolean field '{$sFieldName}' value.";
                }
            );
    }
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;
    }
517699
protected function get_userinfo_mapping() {
        $fields = user_field_mapping::get_records(['issuerid' => $this->issuer->get('id')]);

        $map = [];
        foreach ($fields as $field) {
            $map[$field->get('externalfield')] = $field->get('internalfield');
        }
        return $map;
    }