Get the advanced session validation restrictions

Note that if User-Agent Normalization is on then the normalized user-agent
is used for user-agent validation instead of the full user-agent

@return string
330659
protected function _getAdvancedSessionValidationTargets() {
        $validation = array();
        if (Mage::getStoreConfig('web/session/use_remote_addr')) {
            $validation[] = 'client.ip';
        }
        if (Mage::getStoreConfig('web/session/use_http_via')) {
            $validation[] = 'req.http.Via';
        }
        if (Mage::getStoreConfig('web/session/use_http_x_forwarded_for')) {
            $validation[] = 'req.http.X-Forwarded-For';
        }
        if (Mage::getStoreConfig(
                    'web/session/use_http_user_agent' ) &&
                ! Mage::getStoreConfig(
                    'turpentine_vcl/normalization/user_agent' )) {
            $validation[] = 'req.http.User-Agent';
        }
        return $validation;
    }
368618
public function userInfo()
    {
        try {
            $this->startBrokerSession();

            $username = $this->getSessionData('sso_user');

            if (!$username) {
                $this->fail('User not authenticated. Session ID: ' . $this->getSessionData('id'));
            }

            if (!$user = $this->getUserInfo($username)) {
                $this->fail('User not found.');
            }
        } catch (SSOServerException $e) {
            return $this->returnJson(['error' => $e->getMessage()]);
        }

        return $this->returnUserInfo($user);
    }
281174
protected function validationData()
    {
        return $this->merge([
            // Default value.
            'is_approved' => 'owner' == user('role') or ! setting('comments.moderate'),
            'parent_id' => $this->input('parent_id', null),
            // Default value from route.
            'commentable_id' => $this->route('commentable_id'),
            'commentable_type' => string_slug($this->route('commentable_type'), '_'),
            // Aditional default value.
            'user_ip' => $this->ip(),
        ])->all();
    }
47175
public function getAuthKeyRules()
    {
        if (!is_string($this->authKeyAttribute) || empty($this->authKeyAttribute)) {
            return [];
        }
        if (empty($this->authKeyRules)) {
            $this->authKeyRules = [
                [[$this->authKeyAttribute], 'required'],
                [[$this->authKeyAttribute], 'string', 'max' => 40],
            ];
        }
        return $this->authKeyRules;
    }
372743
protected function getFormParent()
    {
        // If polymorphic relationship is actually defined, use it
        if ($this->FormID && $this->FormClass) {
            $formClass = $this->FormClass;
            return $formClass::get()->byID($this->FormID);
        }

        // Revert to checking for a form from the session
        // LeftAndMain::sessionNamespace is protected. @todo replace this with a non-deprecated equivalent.
        $sessionNamespace = $this->config()->get('session_namespace') ?: CMSMain::class;

        $formID = Controller::curr()->getRequest()->getSession()->get($sessionNamespace . '.currentPage');
        if ($formID) {
            return UserDefinedForm::get()->byID($formID);
        }
    }
556562
public function getUserAgent()
    {
        if ($this->USER_AGENT) {
            return $this->USER_AGENT;
        }

        if ($this->HTTP_USER_AGENT) {
            return $this->HTTP_USER_AGENT;
        }

        return null;
    }
80485
public function ValidateUserInput()
    {
        $bIsValid = parent::ValidateUserInput();

        if ($bIsValid) {
            $oMsgManager = TCMSMessageManager::GetInstance();

            $sField = 'pseudocardpan';
            if (!array_key_exists($sField, $this->aPaymentUserData) || empty($this->aPaymentUserData[$sField])) {
                $oMsgManager->AddMessage(self::MSG_MANAGER_NAME.'-'.$sField, 'ERROR-USER-REQUIRED-FIELD-MISSING');
                $bIsValid = false;
            }
        }

        return $bIsValid;
    }
255265
protected function _getValidationRules() {
		$language = (string)Configure::read('Config.language');
		$cachePath = 'validation_rules_' . $language;
		$cached = Cache::read($cachePath, CAKE_LDAP_CACHE_KEY_LDAP_SYNC_DB);
		if ($cached !== false) {
			return $cached;
		}

		$result = $this->_getLocalFieldsValidationRules();
		$result += $this->_getLdapFieldsValidationRules();
		Cache::write($cachePath, $result, CAKE_LDAP_CACHE_KEY_LDAP_SYNC_DB);

		return $result;
	}
632149
protected function getUserRules()
    {
        $rules = [];

        foreach ($this->repository->all() as $field) {
            $rules[$field->getName()] = $field->getOption('rules');
        }

        return $rules;
    }
1136894
public function getAccessTokenRules()
    {
        if (!is_string($this->accessTokenAttribute) || empty($this->accessTokenAttribute)) {
            return [];
        }
        if (empty($this->accessTokenRules)) {
            $this->accessTokenRules = [
                [[$this->accessTokenAttribute], 'required'],
                [[$this->accessTokenAttribute], 'string', 'max' => 40],
            ];
        }
        return $this->accessTokenRules;
    }
358762
public function getAuthority(): string
    {
        if ($this->host == '') {
            return '';
        }

        $authority = $this->host;
        if ($this->user != '') {
            $authority = $this->user.'@'.$authority;
        }

        if ($this->port !== null && !$this->isDefaultPort($this->scheme, $this->port)) {
            $authority .= ':'.$this->port;
        }

        return $authority;
    }
773998
public function rules() {

		$rules = [
			// Required, Safe
			[ [ 'firstName', 'lastName', 'email' ], 'required' ],
			[ 'phone', 'required', 'on' => [ 'phone', 'phone-captcha' ] ],
			// Text Limit
			[ [ 'email', 'phone' ], 'string', 'min' => 1, 'max' => Yii::$app->core->xLargeText ],
			// Other
			[ 'email', 'email' ]
		];

		if( empty( $this->captchaAction ) ) {

			$this->captchaAction	= '/cart/cart/captcha';
		}

		$rules[] = [ 'captcha', 'captcha', 'captchaAction' => $this->captchaAction, 'on' => [ 'captcha', 'phone-captcha' ] ];

		if( Yii::$app->core->trimFieldValue ) {

			$trim[] = [ [ 'firstName', 'lastName', 'email', 'phone' ], 'filter', 'filter' => 'trim', 'skipOnArray' => true ];

			return ArrayHelper::merge( $trim, $rules );
		}

		return $rules;
	}
616372
public function actionSession()
    {
        $user = Yii::$app->adminuser->identity;
        $session = [
            'packages' => [],
            'user' => $user->toArray(['title', 'firstname', 'lastname', 'email', 'id', 'email_verification_token_timestamp']),
            'activities' => ['open_email_validation' => $this->hasOpenEmailValidation($user)],
            'settings' => Yii::$app->adminuser->identity->setting->getArray([
                User::USER_SETTING_ISDEVELOPER, User::USER_SETTING_UILANGUAGE, User::USER_SETTING_NEWUSEREMAIL
            ], [
                User::USER_SETTING_UILANGUAGE => $this->module->interfaceLanguage,
            ]),
        ];
        
        // if developer option is enabled provide package infos
        if ($session['settings'][User::USER_SETTING_ISDEVELOPER]) {
            $session['packages'] = Yii::$app->getPackageInstaller()->getConfigs();
        }
        
        return $session;
    }
578694
public function rules()
    {
        $validationRule = [];
        $validationRule['name'] = 'required|max:255';

        if (null !== $this->request->get('dropdown-options')) {
            foreach ($this->request->get('dropdown-options') as $key => $val) {
                if ($key == '__RANDOM_STRING__') {
                    continue;
                }
                $validationRule['dropdown-options.' . $key . '.display_text'] = 'required';
            }
        }

        if ($this->getMethod() == 'POST') {
            $validationRule['identifier'] = 'required|max:255|alpha_dash|unique:attributes';
        }
        if ($this->getMethod() == 'PUT') {
            $validationRule['identifier'] = 'required|max:255|alpha_dash';
        }

        return $validationRule;
    }
62817
public function getRules()
    {
        $action = $this->getActionReplaced();
        if (method_exists($this->formRequest, $action)) {
            return call_user_func([$this->formRequest, $action]);
        }

        if (method_exists($this->formRequest, 'rules')) {
            return call_user_func([$this->formRequest, 'rules']);
        }

        return [];
    }
1005723
public function hiddenSid()
    {
        $sSid = $sToken = '';
        if ($this->isSidNeeded()) {
            $sSid = "<input type=\"hidden\" name=\"" . $this->getForcedName() . "\" value=\"" . $this->getId() . "\" />";
        }
        if ($this->getId()) {
            $sToken = "<input type=\"hidden\" name=\"stoken\" value=\"" . $this->getSessionChallengeToken() . "\" />";
        }

        return $sToken . $sSid;
    }
1311117
public function getAllowedUserClasses()
    {
        $output = $this->_allowedProjectUserClasses;

        if (\Gems_User_UserLoader::USER_RADIUS !== $this->_get('gor_user_class')) {
            unset($output[\Gems_User_UserLoader::USER_RADIUS]);
        }
        return $output;
    }