Returns MAC address filter registrations for a given user.

@param string $username
@throws \Exception
@return array|null
356391
public function getRegistrations($username)
    {
        $params = [];
        $params['filter'] = $this->filter;
        $params['username'] = $username;
        $params['_return_fields+'] = 'fingerprint,extattrs';
        return $this->gateway->get('macfilteraddress', $params);
    }
812923
public function getByUsername ($username)
    {
        $entity = $this->er->findOneBy(array('username' => $username));

        if (NULL == $entity) {
            throw new Exception("User not found: username=$username");
        }

        return $this->getModel($entity);
    }
408758
public function getWebSrvUserGroup($username = null) {
		$result = '';
		if ($this->isOsWindows() || empty($username)) {
			return $result;
		}

		$cmd = 'groups ' . $username . ' | head -1 | cut -d\  -f1 2>/dev/null';
		$output = [];
		$exitCode = -1;
		exec($cmd, $output, $exitCode);
		if (($exitCode !== 0) || (count($output) < 1)) {
			return $result;
		}

		$result = array_shift($output);

		return $result;
	}
988966
public function getUserByUsername($username)
    {
        try {
            $user = $this->userRepo->loadUserByUsername($username);
        } catch (\Exception $e) {
            $user = null;
        }

        return $user;
    }
1162425
protected function getUserByName(string $username)
    {
        $found_user = null;
        $users      = $this->getWordpressParameter('users');

        foreach ($users as $user) {
            if ($username === $user['username']) {
                $found_user = $user;
                break;
            }
        }

        if ($found_user === null) {
            throw new RuntimeException("[W801] User not found for name \"{$username}\"");
        }

        return $found_user;
    }
657626
private function getGroups($username)
    {
        if (!$this->entityManager) {
            return [];
        }

        $db = $this->entityManager->getConnection();
        $queryBuilder = $db->createQueryBuilder();

        $rows = $queryBuilder
            ->select('g.gName', 'u.uID')->from($db->getDatabasePlatform()->quoteSingleIdentifier('Groups'), 'g')
            ->leftJoin('g', 'UserGroups', 'ug', 'ug.gID=g.gID')
            ->innerJoin('ug', 'Users', 'u', 'ug.uID=u.uID AND (u.uName=? OR u.uEmail=?)')
            ->setParameters([$username, $username])
            ->execute();

        $groups = [];
        $uID = 0;
        foreach ($rows as $row) {
            $uID = (int) $row['uID'];
            $groups[] = $row['gName'];
        }

        if ($uID == USER_SUPER_ID) {
            $groups[] = 'SUPER';
        }

        return $groups;
    }
293270
public function removeUserAsCollaborator(string $username): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/collaborators/:username',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $username),
            Request::METHOD_DELETE);
    }
652669
public static function userExists($username)
	{
		if ( ! is_array( self::$auth ) ) throw new Exception( 'Authentication not initialized' );
		return ( isset( self::$auth['users'][ $username ] ) );
	}
409867
protected function getUserInfo($username)
    {
        if (!isset(self::$users[$username])) return null;
    
        $user = compact('username') + self::$users[$username];
        unset($user['password']);
        
        return $user;
    }
718949
public function get_userinfo($username) {
        $cached = $this->get_static_user_info();
        if (!empty($cached) && $cached['username'] == $username) {
            return $cached;
        }
        return false;
    }
685466
public static function getByLogin($username)
    {    
        $fields = self::getDbConnection()->fetchAssoc( 'SELECT * FROM '.User::TABLE.' WHERE login = ?', array( $username ) );
        if (!$fields) return false;
        return self::fetch($fields);    
  	}
154306
protected function getUserEntity($userName)
    {
        if (!$userEntity = $this->getRepositoryUsers()->getUser($userName)) {
            $this->flashLogger->error(Trans::__('general.phrase.error-user-name-password-incorrect'));

            return null;
        }

        if (!$userEntity->getEnabled()) {
            $this->systemLogger->alert("Attempt to login with disabled account by '$userName'", ['event' => 'security']);
            $this->flashLogger->error(Trans::__('general.phrase.login-account-disabled'));

            return null;
        }

        return $userEntity;
    }
147100
public function usernameValidator($username)
    {
        if (empty($username)) {
            throw new \Exception('The username can not be empty');
        }

        $userManager = $this->getUserManager();
        if ($userManager->usernameExists($username)) {
            throw new \Exception('The username is already used.');
        }

        return $username;
    }
379937
public static function username($username, $permission)
    {
        try {
            $response = static::client()->request('GET', '/eeyes/permission/username', [
                'query' => [
                    'username' => $username,
                    'permission' => $permission,
                ],
            ]);
        } catch (GuzzleException $e) {
            return [
                'can' => false,
                'msg' => $e->getMessage(),
            ];
        }
        if ($response->getStatusCode() !== 200) {
            return [
                'can' => false,
                'msg' => $response->getReasonPhrase(),
            ];
        }
        $result = json_decode($response->getBody(), true);
        if ($result['code'] !== 200) {
            return [
                'can' => false,
                'msg' => isset($result['msg']) ? $result['msg'] : 'Unknown error',
            ];
        } else {
            return $result['data'];
        }
    }
4131
public function getUsername($username)
    {
        if ($this->isValidUserDn($username)) {
            return $username;
        }
        $replacements = [
            $username,
            $this->config->getDomainName(),
        ];

        return preg_replace($this->params, $replacements, $this->bindFormat);
    }
1236756
protected static function getEmailByUsername($username)
    {
        if (empty($username)) {
            throw new BadRequestException("Missing required username.");
        }

        /** @var User $user */
        $user = User::whereUsername($username)->get(['email'])->first();

        if (empty($user)) {
            throw new NotFoundException('The supplied username was not found in the system.');
        }

        return $user->email;
    }
1273001
public function listGists(string $username = null, string $since = '1970-01-01'): array
    {
        $url = '/gists';
        if (null !== $username) {
            $url = '/users/:username/gists';
        }

        return $this->getApi()->request($this->getApi()->sprintf(':url?:arg', $url, $username,
            http_build_query(['since' => (new DateTime($since))->format(DateTime::ATOM)])));
    }