CAS_Client::validateCAS10 PHP Method

validateCAS10() public method

This method is used to validate a CAS 1,0 ticket; halt on failure, and sets $validate_url, $text_reponse and $tree_response on success.
public validateCAS10 ( &$validate_url, &$text_response, &$tree_response, boolean $renew = false ) : boolean
$renew boolean true to force the authentication with the CAS server
return boolean true when successfull and issue a CAS_AuthenticationException and false on an error
    public function validateCAS10(&$validate_url, &$text_response, &$tree_response, $renew = false)
    {
        phpCAS::traceBegin();
        $result = false;
        // build the URL to validate the ticket
        $validate_url = $this->getServerServiceValidateURL() . '&ticket=' . urlencode($this->getTicket());
        if ($renew) {
            // pass the renew
            $validate_url .= '&renew=true';
        }
        // open and read the URL
        if (!$this->_readURL($validate_url, $headers, $text_response, $err_msg)) {
            phpCAS::trace('could not open URL \'' . $validate_url . '\' to validate (' . $err_msg . ')');
            throw new CAS_AuthenticationException($this, 'CAS 1.0 ticket not validated', $validate_url, true);
            $result = false;
        }
        if (preg_match('/^no\\n/', $text_response)) {
            phpCAS::trace('Ticket has not been validated');
            throw new CAS_AuthenticationException($this, 'ST not validated', $validate_url, false, false, $text_response);
            $result = false;
        } else {
            if (!preg_match('/^yes\\n/', $text_response)) {
                phpCAS::trace('ill-formed response');
                throw new CAS_AuthenticationException($this, 'Ticket not validated', $validate_url, false, true, $text_response);
                $result = false;
            }
        }
        // ticket has been validated, extract the user name
        $arr = preg_split('/\\n/', $text_response);
        $this->_setUser(trim($arr[1]));
        $result = true;
        if ($result) {
            $this->_renameSession($this->getTicket());
        }
        // at this step, ticket has been validated and $this->_user has been set,
        phpCAS::traceEnd(true);
        return true;
    }
CAS_Client