Swat/SwatForm.php
public function isAuthenticated()
    {
        /*
         * If this form was not submitted, consider it authenticated. Processing
         * should be safe on forms that were not submitted.
         */
        if (!$this->isSubmitted()) {
            return true;
        }

        $raw_data = $this->getFormData();

        $token = null;
        if (isset($raw_data[self::AUTHENTICATION_TOKEN_FIELD])) {
            $token = SwatString::signedUnserialize(
                $raw_data[self::AUTHENTICATION_TOKEN_FIELD],
                $this->salt
            );
        }

        /*
         * If this form's authentication token is set, the token in submitted
         * data must match.
         */
        return self::$authentication_token === null ||
            self::$authentication_token === $token;
    }
public function isAuthenticated()
    {
        /*
         * If this form was not submitted, consider it authenticated. Processing
         * should be safe on forms that were not submitted.
         */
        if (!$this->isSubmitted()) {
            return true;
        }

        $raw_data = $this->getFormData();

        $token = null;
        if (isset($raw_data[self::AUTHENTICATION_TOKEN_FIELD])) {
            $token = SwatString::signedUnserialize(
                $raw_data[self::AUTHENTICATION_TOKEN_FIELD],
                $this->salt
            );
        }

        /*
         * If this form's authentication token is set, the token in submitted
         * data must match.
         */
        return self::$authentication_token === null ||
            self::$authentication_token === $token;
    }
public function isAuthenticated ( ) { /*
         * If this form was not submitted, consider it authenticated. Processing
         * should be safe on forms that were not submitted.
         */ if ( ! $ this -> isSubmitted ( ) ) { return true ; } $ raw_data = $ this -> getFormData ( ) ; $ token = null ; if ( isset ( $ raw_data [ self :: AUTHENTICATION_TOKEN_FIELD ] ) ) { $ token = SwatString :: signedUnserialize ( $ raw_data [ self :: AUTHENTICATION_TOKEN_FIELD ] , $ this -> salt ) ; } /*
         * If this form's authentication token is set, the token in submitted
         * data must match.
         */ return self :: $ authentication_token === null || self :: $ authentication_token === $ token ; }
Whether or not this form is authenticated

This can be used to catch cross-site request forgeries if the
{@link SwatForm::setAuthenticationToken()} method was previously called.

If form authentication is used, processing should only be performed on
authenticated forms. An unauthenticated form may be a malicious
request.

@return boolean true if this form is authenticated or if this form does
not use authentication. False if this form is
not authenticated.
Whether or not this form is authenticated