Ipaymu::checkAccountStatus

Gets ipaymu account status.

@param string $username Ipaymu account username.

@return string|bool Returns FALSE if failed.
778283
public function checkAccountStatus($username)
    {
        $statusCodes = [
            0 => 'UNVERIFIED',
            1 => 'VERIFIED',
            2 => 'CERTIFIED',
            3 => 'CERTIFIED_PREMIUM',
        ];

        if (false !== ($response = $this->request('api/CekStatus.php', ['user' => $username]))) {
            return $statusCodes[ $response[ 'StatusUser' ] ];
        }

        return false;
    }
1176263
public function validateUserName($userName)
    {
        if (empty($userName)) {
            $this->addError('userName', 'User name cannot be empty');
            return false;
        }

        if (!is_string($userName)) {
            $this->addError('userName', 'User name must be a string');
            return false;
        }

        if (mb_strlen($userName, 'UTF-8') > 255) {
            $this->addError('userName', 'User name length has to be less or equal to 255');
            return false;
        }


        return true;
    }
1293991
private function validateLogin($data, $username)
    {
        if(!is_object($data)) {
            return false; 
        }

        if (isset($data->error)) {
            return false;
        }

        if (isset($data->samaccountname) && strtolower($data->samaccountname) == strtolower($username)) {
            return true;
        }

        return null;
    }
1175168
private function getStoredPassword($username)
    {
        // Get table object
        $db = $this->app->db->reset()->table($this->table);

        // Find user by username column
        $user = $db->select($this->passwordColumn)->limit(1)->where($this->usernameColumn, $username)->getOne();

        // Abort if the user or the password column do not exist
        if (!is_array($user) || !isset($user[$this->passwordColumn])) {
            return false;
        }

        // Return password column
        return $user[$this->passwordColumn];
    }
1312484
public function loadUser(string $username): ?UserInterface
    {
        if (!isset($this->cache[$username])) {
            $this->cache[$username] = $this->user_provider->loadUserByUsername($username);
        }

        return $this->cache[$username] ?: null;
    }
1178500
protected function getHashedPassword($username)
	{
		if (!isset($this->credentialStore[$username]))
		{
			return false;
		}

		return $this->credentialStore[$username];
	}
590309
public function checkUserIsACollaborator(string $username): bool
    {
        $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/collaborators/:username',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $username));

        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
            return true;
        }

        return false;
    }
997191
public function getStuPppoeByUsername(string $username) {
        try {
            $response = $this->http()->get('check_stu_pppoe_log_utf8.php', [
                'query' => [
                    'username' => $username
                ]
            ]);
            return $this->parseResponse($response);
        } catch(RequestException $e) {
            if ($e->hasResponse()) {
                $response = $e->getResponse();
                return $response->getStatusCode() . ' ' . $response->getReasonPhrase();
            }
            return 'Exception: ' . $e->getCode();
        }
    }
207284
public function getReseller($username)
    {
        $resellers = $this->getResellers();
        return isset($resellers[$username]) ? $resellers[$username] : null;
    }
702701
public function getByUsername(string $username)
	{
		return $this->setAuthorizer($this->getModel()->where('username', '=', $username)->first());
	}
1004967
public function username($username)
    {
        $app = Application::getFacadeApplication();
        $validator = $app->make('validator/user/name');
        foreach ($validator->getValidators() as $handle => $validator) {
            if ($handle !== 'unique_username') {
                if (!$validator->isValid($username)) {
                    return false;
                }
            }
        }

        return true;
    }
638955
public function checkUA($name){
         if(empty($this->_auth_items)){
             $this->getAuthItemChild();
         }
         return isset($this->_auth_items[$name]);
     }
687965
public function isUserValid4UserName($username)
    {
        $result = false;
        $user = $this->getUser4UserName($username);
        if (!$user) {
            $result = null;
        } elseif ($user->getRoles()) {
            $result = true;
        }

        return $result;
    }
728580
public function getUserIdFromLogin(string $username): int
    {
        return (int) $this->getDriver()->user->get($username, ['by' => 'login'])->ID;
    }
908541
private function findByUsername(string $username)
    {
        if ($this->userRepository instanceof UserRepositoryInterface) {
            return $this->userRepository->findByUsername($username);
        }

        return $this->userRepository->findOneBy(['username' => $username]);
    }
409867
protected function getUserInfo($username)
    {
        if (!isset(self::$users[$username])) return null;
    
        $user = compact('username') + self::$users[$username];
        unset($user['password']);
        
        return $user;
    }
1245505
public function loadUserByUsername($username)
    {
        if (null === $user = $this->findOneBy(array('_login' => $username))) {
            throw new UsernameNotFoundException(sprintf('Unknown username `%s`.', $username));
        }

        return $this->checkActivatedStatus($user);
    }