Validates a user's status before taking further actions e.g login, password change, password reset
@param string $status
@throws UserAuthenticationException
160508
public function validateStatus($status)
    {
        if ($status == self::STATUS_INACTIVE) {
            throw new UserAuthenticationException(ErrorMessages::INACTIVE_ACCOUNT);
        }

        if ($status == self::STATUS_DISABLED) {
            throw new UserAuthenticationException(ErrorMessages::DISABLED_ACCOUNT);
        }
    }
209381
public static function switchStatus(string $status)
    {
        if ($status == "off") {
            self::$status = "off";
        } elseif ($status == "on") {
            self::$status = "on";
        } else {
            die("TaskBar : Undefined status '$status'. Status must be 'on' or 'off'. ");
        }
        return (1);
    }
739294
public function setStatus($status)
    {
        if (!in_array($status, array(
            self::STATUS_ACTIVE,
            self::STATUS_INACTIVE,
        ))) {
            throw new \InvalidArgumentException("Invalid status in ".get_class($this).".");
        }

        $this->status = $status;

        return $this;
    }
683673
public function setStatus($event, $status)
    {
        $handle = (string) $this->connections->getCurrentConnectionKey();

        $this->statuses[$event][$handle] = $status;
    }
606794
public function setStatus(StatusInterface $status = null)
    {
        $this->status = null;
        $this->statusChanged = true;
        if ($status instanceof StatusInterface) {
            $this->status = EmbedStatus::createFromStatus($status);
        }
    }
719578
public function setStatusUser($status)
    {
        $options = $id = $result = null;

        if ($this->getParam('all')) {
            $options = array();
        } else {

            $id = $this->getParam(0);

            if (!is_numeric($id)) { // Allow 0 for roleless users
                $this->errorAndExit($this->text('Invalid argument'));
            }

            if ($this->getParam('role')) {
                $options = array('role_id' => $id);
            } else if ($this->getParam('store')) {
                $options = array('store_id' => $id);
            }
        }

        if (isset($options)) {

            $updated = $count = 0;
            foreach ($this->user->getList($options) as $item) {
                $count++;
                $updated += (int) $this->user->update($item['user_id'], array('status' => (bool) $status));
            }

            $result = $count && $count == $updated;

        } else if (isset($id)) {
            $result = $this->user->update($id, array('status' => (bool) $status));
        }

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
1046761
public static function checkStatus($status) {
        switch ($status) {
            case Status::STATUS_OK:
                return true;
            case self::STATUS_UNREADABLE_JSON_OBJECT:
                return UnreadableRequestException::getClass();
            case self::STATUS_MALFORMED_RECEIPT_DATA:
                return MalformedReceiptDataException::getClass();
            case self::STATUS_UNAUTHENTICATED_RECEIPT:
                return UnauthenticatedReceiptException::getClass();
            case self::STATUS_UNAVAILABLE_SERVER:
                return UnavailableServerException::getClass();
            case self::STATUS_IS_PRODUCTION_RECEIPT_ON_SANDBOX:
                return ProductionReceiptOnSandboxException::getClass();
            case self::STATUS_IS_SANDBOX_RECEIPT_ON_PRODUCTION:
                return SandboxReceiptOnProductionException::getClass();
            default:
                return InvalidReceiptException::getClass();
        }
    }
826544
public function set_sslverify($status) {
		if ($status === true) {
			if (isset($this->curlopts[CURLOPT_SSL_VERIFYPEER])) {
				unset($this->curlopts[CURLOPT_SSL_VERIFYPEER]);
			}
		} else {
			$this->curlopts[CURLOPT_SSL_VERIFYPEER] = false;
		}
	}
1095680
public function setStatus($status)
    {
        if($entity = $this->getIterator()->current()) {
            $entity->setStatusMessage($status);
        }

        return $this;
    }
721833
public function setStatus(int $status) : Response
    {
        if (in_array($status, static::RESPONSE_STATUSES)) {
            $this->status = $status;

            return $this;
        }

        throw new \LogicException("Status code must be a valid status code, but {$status} is not.");
    }
546634
public function setStatus($status) {
        if (!in_array($status, array(self::STATUS_INACTIVE, self::STATUS_PUBLISHED))) {
            throw new \InvalidArgumentException("Invalid status");
        }
        $this->status = $status;
    }
215540
public function getUser($status = User::STATUS_ACTIVE)
    {
        if ($this->_user === false) {
            $this->_user = User::findByKeyfield($this->username, $status);
        }
        return $this->_user;
    }
1024068
public function validateStatus($status)
    {
        if ($status === null) {
            $this->addError('status', 'Status cannot be null');
            return false;
        }

        $valid = [Application::STATUS_ENABLED, Application::STATUS_DISABLED];

        if (!in_array($status, $valid, true)) {
            $this->addError('status', 'Status must be equal to 1 or 2');
            return false;
        }

        return true;
    }
869071
public function setStatus( $status )
	{
		if ( $status == $this->getStatus() ) { return; }

		$this->_values['status'] = (int) $status;
		$this->setModified();
	}
708497
public function beforeRedirect(Controller $controller, $url, $status = null, $exit = true) {
        if (!$this->active) {
            return;
        }

        if (is_array($this->Auth->loginAction)) {
            if (!empty($this->Auth->loginAction['controller'])) {
                $this->controller = $this->Auth->loginAction['controller'];
            }

            if (!empty($this->Auth->loginAction['action'])) {
                $this->loginAction = $this->Auth->loginAction['action'];
            }

            if (!empty($this->Auth->loginAction['plugin'])) {
                $this->plugin = $this->Auth->loginAction['plugin'];
            }
        }

        if (empty($this->controller)) {
            $this->controller = Inflector::pluralize($this->model);
        }

        // Is called after user login/logout validates, but before auth redirects
        if ($controller->plugin == Inflector::camelize($this->plugin) && $controller->name == Inflector::camelize($this->controller)) {
            $data = $controller->request->data;
            $action = isset($controller->request->params['action']) ? $controller->request->params['action'] : 'login';

            switch ($action) {
                case $this->loginAction:
                    if (isset($data[$this->model])) {
                        $this->login($data[$this->model]);
                    }
                break;

                case $this->logoutAction:
                    $this->logout();
                break;
            }
        }
    }
1341508
public function validateCurrentPassword($password, ExecutionContext $context)
    {
        if (! password_verify($password, $this->getUser()->getPassword())) {
            $context->addViolation('INVALID');
        }
    }
1345899
public function status($status = null) {
			if ($status != null) {
				if (array_key_exists($status, $this->_statusCode)) {
					$this->_status = $status;
				}

				return true;
			}
			else {
				return $this->_status;
			}
		}