Functions | Variables

InternalMisc

Functions

 CASClient::getURL ()
 This method returns the URL of the current request (without any ticket CGI parameter).
 CASClient::setURL ($url)
 This method sets the URL of the current request.
 CASClient::authError ($failure, $cas_url, $no_response, $bad_response='', $cas_response='', $err_code='', $err_msg='')
 This method is used to print the HTML output when the user was not authenticated.

Variables

 $PHPCAS_CLIENT
 This global variable is used by the interface class phpCAS.
 $PHPCAS_INIT_CALL
 This global variable is used to store where the initializer is called from (to print a comprehensive error in case of multiple calls).
 $PHPCAS_AUTH_CHECK_CALL
 This global variable is used to store where the method checking the authentication is called from (to print comprehensive errors).
 $PHPCAS_DEBUG
 This global variable is used to store phpCAS debug mode.
 CASClient::$_url
 the URL of the current request (without any ticket CGI parameter).

Function Documentation

CASClient::authError ( failure,
cas_url,
no_response,
bad_response = '',
cas_response = '',
err_code = '',
err_msg = '' 
) [private, inherited]

This method is used to print the HTML output when the user was not authenticated.

Parameters:
$failure the failure that occured
$cas_url the URL the CAS server was asked for
$no_response the response from the CAS server (other parameters are ignored if TRUE)
$bad_response bad response from the CAS server ($err_code and $err_msg ignored if TRUE)
$cas_response the response of the CAS server
$err_code the error code given by the CAS server
$err_msg the error message given by the CAS server

Definition at line 1919 of file client.php.

References exit.

Referenced by CASClient::validateST().

    {
      phpCAS::traceBegin();

      $this->printHTMLHeader($this->getString(CAS_STR_AUTHENTICATION_FAILED));
      printf($this->getString(CAS_STR_YOU_WERE_NOT_AUTHENTICATED),$this->getURL(),$_SERVER['SERVER_ADMIN']);
      phpCAS::trace('CAS URL: '.$cas_url);
      phpCAS::trace('Authentication failure: '.$failure);
      if ( $no_response ) {
        phpCAS::trace('Reason: no response from the CAS server');
      } else {
        if ( $bad_response ) {
            phpCAS::trace('Reason: bad response from the CAS server');
        } else {
          switch ($this->getServerVersion()) {
          case CAS_VERSION_1_0:
            phpCAS::trace('Reason: CAS error');
            break;
          case CAS_VERSION_2_0:
            if ( empty($err_code) )
              phpCAS::trace('Reason: no CAS error');
            else
              phpCAS::trace('Reason: ['.$err_code.'] CAS error: '.$err_msg);
            break;
          }
        }
        phpCAS::trace('CAS response: '.$cas_response);
      }
      $this->printHTMLFooter();
      phpCAS::traceExit();
      exit();
    }

Here is the caller graph for this function:

CASClient::getURL (  )  [private, inherited]

This method returns the URL of the current request (without any ticket CGI parameter).

Returns:
The URL

Definition at line 1846 of file client.php.

Referenced by CASClient::getServerLoginURL(), CASClient::getServerProxyValidateURL(), and CASClient::getServerServiceValidateURL().

    {
      phpCAS::traceBegin();
      // the URL is built when needed only
      if ( empty($this->_url) ) {
            $final_uri = '';
            // remove the ticket if present in the URL
            $final_uri = ($_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
            $final_uri .= '://';
            /* replaced by Julien Marchal - v0.4.6
             * $this->_url .= $_SERVER['SERVER_NAME'];
             */
        if(empty($_SERVER['HTTP_X_FORWARDED_SERVER'])){
          /* replaced by teedog - v0.4.12
           * $this->_url .= $_SERVER['SERVER_NAME'];
           */
          if (empty($_SERVER['SERVER_NAME'])) {
            $final_uri .= $_SERVER['HTTP_HOST'];
          } else {
            $final_uri .= $_SERVER['SERVER_NAME'];
          }
        } else {
          $final_uri .= $_SERVER['HTTP_X_FORWARDED_SERVER'];
        }
          if ( ($_SERVER['HTTPS']=='on' && $_SERVER['SERVER_PORT']!=443)
             || ($_SERVER['HTTPS']!='on' && $_SERVER['SERVER_PORT']!=80) ) {
            $final_uri .= ':';
            $final_uri .= $_SERVER['SERVER_PORT'];
          }

          $final_uri .= strtok($_SERVER['REQUEST_URI'],"?");
          $cgi_params = '?'.strtok("?");
          // remove the ticket if present in the CGI parameters
          $cgi_params = preg_replace('/&ticket=[^&]*/','',$cgi_params);
          $cgi_params = preg_replace('/\?ticket=[^&;]*/','?',$cgi_params);
          $cgi_params = preg_replace('/\?$/','',$cgi_params);
          $final_uri .= $cgi_params;
          $this->setURL($final_uri);
    }
    phpCAS::traceEnd($this->_url);
    return $this->_url;
  }

Here is the caller graph for this function:

CASClient::setURL ( url  )  [private, inherited]

This method sets the URL of the current request.

Parameters:
$url url to set for service

Definition at line 1896 of file client.php.

    {
      $this->_url = $url;
    }


Variable Documentation

CASClient::$_url [private, inherited]

the URL of the current request (without any ticket CGI parameter).

Written and read by CASClient::getURL().

Definition at line 1836 of file client.php.

$PHPCAS_AUTH_CHECK_CALL

This global variable is used to store where the method checking the authentication is called from (to print comprehensive errors).

Definition at line 195 of file CAS.php.

$PHPCAS_CLIENT

This global variable is used by the interface class phpCAS.

Definition at line 176 of file CAS.php.

Referenced by ilCASAuth::checkCASAuth().

$PHPCAS_DEBUG

This global variable is used to store phpCAS debug mode.

Definition at line 206 of file CAS.php.

$PHPCAS_INIT_CALL

This global variable is used to store where the initializer is called from (to print a comprehensive error in case of multiple calls).

Definition at line 184 of file CAS.php.