private function _validatePGT(&$validate_url,$text_response,$tree_response)
    {
        phpCAS::traceBegin();
        if ( $tree_response->getElementsByTagName("proxyGrantingTicket")->length == 0) {
            phpCAS::trace('<proxyGrantingTicket> not found');
            // authentication succeded, but no PGT Iou was transmitted
            throw new CAS_AuthenticationException(
                $this, 'Ticket validated but no PGT Iou transmitted',
                $validate_url, false/*$no_response*/, false/*$bad_response*/,
                $text_response
            );
        } else {
            // PGT Iou transmitted, extract it
            $pgt_iou = trim(
                $tree_response->getElementsByTagName("proxyGrantingTicket")->item(0)->nodeValue
            );
            if (preg_match('/PGTIOU-[\.\-\w]/', $pgt_iou)) {
                $pgt = $this->_loadPGT($pgt_iou);
                if ( $pgt == false ) {
                    phpCAS::trace('could not load PGT');
                    throw new CAS_AuthenticationException(
                        $this,
                        'PGT Iou was transmitted but PGT could not be retrieved',
                        $validate_url, false/*$no_response*/,
                        false/*$bad_response*/, $text_response
                    );
                }
                $this->_setPGT($pgt);
            } else {
                phpCAS::trace('PGTiou format error');
                throw new CAS_AuthenticationException(
                    $this, 'PGT Iou was transmitted but has wrong format',
                    $validate_url, false/*$no_response*/, false/*$bad_response*/,
                    $text_response
                );
            }
        }
        phpCAS::traceEnd(true);
        return true;
    }
private function _validatePGT(&$validate_url,$text_response,$tree_response)
    {
        phpCAS::traceBegin();
        if ( $tree_response->getElementsByTagName("proxyGrantingTicket")->length == 0) {
            phpCAS::trace('<proxyGrantingTicket> not found');
            // authentication succeded, but no PGT Iou was transmitted
            throw new CAS_AuthenticationException(
                $this, 'Ticket validated but no PGT Iou transmitted',
                $validate_url, false/*$no_response*/, false/*$bad_response*/,
                $text_response
            );
        } else {
            // PGT Iou transmitted, extract it
            $pgt_iou = trim(
                $tree_response->getElementsByTagName("proxyGrantingTicket")->item(0)->nodeValue
            );
            if (preg_match('/PGTIOU-[\.\-\w]/', $pgt_iou)) {
                $pgt = $this->_loadPGT($pgt_iou);
                if ( $pgt == false ) {
                    phpCAS::trace('could not load PGT');
                    throw new CAS_AuthenticationException(
                        $this,
                        'PGT Iou was transmitted but PGT could not be retrieved',
                        $validate_url, false/*$no_response*/,
                        false/*$bad_response*/, $text_response
                    );
                }
                $this->_setPGT($pgt);
            } else {
                phpCAS::trace('PGTiou format error');
                throw new CAS_AuthenticationException(
                    $this, 'PGT Iou was transmitted but has wrong format',
                    $validate_url, false/*$no_response*/, false/*$bad_response*/,
                    $text_response
                );
            }
        }
        phpCAS::traceEnd(true);
        return true;
    }
private function _validatePGT ( & $ validate_url , $ text_response , $ tree_response ) { phpCAS :: traceBegin ( ) ; if ( $ tree_response -> getElementsByTagName ( "proxyGrantingTicket" ) -> length == 0 ) { phpCAS :: trace ( '<proxyGrantingTicket> not found' ) ; // authentication succeded, but no PGT Iou was transmitted throw new CAS_AuthenticationException ( $ this , 'Ticket validated but no PGT Iou transmitted' , $ validate_url , false /*$no_response*/ , false /*$bad_response*/ , $ text_response ) ; } else { // PGT Iou transmitted, extract it $ pgt_iou = trim ( $ tree_response -> getElementsByTagName ( "proxyGrantingTicket" ) -> item ( 0 ) -> nodeValue ) ; if ( preg_match ( '/PGTIOU-[\.\-\w]/' , $ pgt_iou ) ) { $ pgt = $ this -> _loadPGT ( $ pgt_iou ) ; if ( $ pgt == false ) { phpCAS :: trace ( 'could not load PGT' ) ; throw new CAS_AuthenticationException ( $ this , 'PGT Iou was transmitted but PGT could not be retrieved' , $ validate_url , false /*$no_response*/ , false /*$bad_response*/ , $ text_response ) ; } $ this -> _setPGT ( $ pgt ) ; } else { phpCAS :: trace ( 'PGTiou format error' ) ; throw new CAS_AuthenticationException ( $ this , 'PGT Iou was transmitted but has wrong format' , $ validate_url , false /*$no_response*/ , false /*$bad_response*/ , $ text_response ) ; } } phpCAS :: traceEnd ( true ) ; return true ; }
This method is used to validate a PGT; halt on failure.

@param string &$validate_url the URL of the request to the CAS server.
@param string $text_response the response of the CAS server, as is
(XML text); result of
CAS_Client::validateCAS10() or
CAS_Client::validateCAS20().
@param string $tree_response the response of the CAS server, as a DOM XML
tree; result of CAS_Client::validateCAS10() or CAS_Client::validateCAS20().

@return bool true when successfull and issue a CAS_AuthenticationException
and false on an error
This method is used to validate a PGT ; halt on failure .