ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
Authentication
+ Collaboration diagram for Authentication:

Functions

 phpCAS::setCacheTimesForAuthRecheck ($n)
 Set the times authentication will be cached before really accessing the CAS server in gateway mode: More...
 
 phpCAS::checkAuthentication ()
 This method is called to check if the user is authenticated (use the gateway feature). More...
 
 phpCAS::forceAuthentication ()
 This method is called to force authentication if the user was not already authenticated. More...
 
 phpCAS::renewAuthentication ()
 This method is called to renew the authentication. More...
 
 phpCAS::authenticate ()
 This method has been left from version 0.4.1 for compatibility reasons. More...
 
 phpCAS::isAuthenticated ()
 This method is called to check if the user is authenticated (previously or by tickets given in the URL). More...
 
 phpCAS::isSessionAuthenticated ()
 Checks whether authenticated based on $_SESSION. More...
 
 phpCAS::getUser ()
 This method returns the CAS user's login name. More...
 
 phpCAS::getAttributes ()
 This method returns the CAS user's login name. More...
 
 phpCAS::handleLogoutRequests ($check_client=true, $allowed_clients=false)
 Handle logout requests. More...
 
 phpCAS::getServerLoginURL ()
 This method returns the URL to be used to login. More...
 
 phpCAS::setServerLoginURL ($url='')
 Set the login URL of the CAS server. More...
 
 phpCAS::setServerServiceValidateURL ($url='')
 Set the serviceValidate URL of the CAS server. More...
 
 phpCAS::setServerProxyValidateURL ($url='')
 Set the proxyValidate URL of the CAS server. More...
 
 phpCAS::setServerSamlValidateURL ($url='')
 Set the samlValidate URL of the CAS server. More...
 
 phpCAS::getServerLogoutURL ()
 This method returns the URL to be used to login. More...
 
 phpCAS::setServerLogoutURL ($url='')
 Set the logout URL of the CAS server. More...
 
 phpCAS::logout ($params="")
 This method is used to logout from CAS. More...
 
 phpCAS::logoutWithRedirectService ($service)
 This method is used to logout from CAS. More...
 
 phpCAS::logoutWithUrl ($url)
 This method is used to logout from CAS. More...
 
 phpCAS::logoutWithRedirectServiceAndUrl ($service, $url)
 This method is used to logout from CAS. More...
 
 phpCAS::setFixedCallbackURL ($url='')
 Set the fixed URL that will be used by the CAS server to transmit the PGT. More...
 
 phpCAS::setFixedServiceURL ($url)
 Set the fixed URL that will be set as the CAS service parameter. More...
 
 phpCAS::getServiceURL ()
 Get the URL that is set as the CAS service parameter. More...
 
 phpCAS::retrievePT ($target_service, & $err_code, & $err_msg)
 Retrieve a Proxy Ticket from the CAS server. More...
 
 phpCAS::setCasServerCert ($cert)
 Set the certificate of the CAS server. More...
 
 phpCAS::setCasServerCACert ($cert)
 Set the certificate of the CAS server CA. More...
 
 phpCAS::setNoCasServerValidation ()
 Set no SSL validation for the CAS server. More...
 

Detailed Description

Function Documentation

◆ authenticate()

phpCAS::authenticate ( )

This method has been left from version 0.4.1 for compatibility reasons.

Definition at line 1020 of file CAS.php.

References phpCAS\error().

1020  {
1021  phpCAS :: error('this method is deprecated. You should use ' . __CLASS__ . '::forceAuthentication() instead');
1022  }
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ checkAuthentication()

phpCAS::checkAuthentication ( )

This method is called to check if the user is authenticated (use the gateway feature).

Returns
TRUE when the user is authenticated; otherwise FALSE.

Definition at line 933 of file CAS.php.

References $auth, $PHPCAS_AUTH_CHECK_CALL, $PHPCAS_CLIENT, phpCAS\backtrace(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by ilSoapAuthenticationCAS\authenticate().

933  {
935 
937  if (!is_object($PHPCAS_CLIENT)) {
938  phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
939  }
940 
941  $auth = $PHPCAS_CLIENT->checkAuthentication();
942 
943  // store where the authentication has been checked and the result
944  $dbg = phpCAS :: backtrace();
945  $PHPCAS_AUTH_CHECK_CALL = array (
946  'done' => TRUE,
947  'file' => $dbg[0]['file'],
948  'line' => $dbg[0]['line'],
949  'method' => __CLASS__ . '::' . __FUNCTION__,
950  'result' => $auth
951  );
953  return $auth;
954  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
backtrace()
This method is a wrapper for debug_backtrace() that is not available in all PHP versions (>= 4...
Definition: CAS.php:507
$PHPCAS_AUTH_CHECK_CALL
This global variable is used to store where the method checking the authentication is called from (to...
Definition: CAS.php:195
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forceAuthentication()

phpCAS::forceAuthentication ( )

This method is called to force authentication if the user was not already authenticated.

If the user is not authenticated, halt by redirecting to the CAS server.

Definition at line 961 of file CAS.php.

References $auth, $PHPCAS_AUTH_CHECK_CALL, $PHPCAS_CLIENT, phpCAS\backtrace(), phpCAS\error(), phpCAS\getUser(), phpCAS\trace(), and phpCAS\traceBegin().

Referenced by ilCASAuth\forceCASAuth().

961  {
963 
965  if (!is_object($PHPCAS_CLIENT)) {
966  phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
967  }
968 
969  $auth = $PHPCAS_CLIENT->forceAuthentication();
970 
971  // store where the authentication has been checked and the result
972  $dbg = phpCAS :: backtrace();
973  $PHPCAS_AUTH_CHECK_CALL = array (
974  'done' => TRUE,
975  'file' => $dbg[0]['file'],
976  'line' => $dbg[0]['line'],
977  'method' => __CLASS__ . '::' . __FUNCTION__,
978  'result' => $auth
979  );
980 
981  if (!$auth) {
982  phpCAS :: trace('user is not authenticated, redirecting to the CAS server');
983  $PHPCAS_CLIENT->forceAuthentication();
984  } else {
985  phpCAS :: trace('no need to authenticate (user `' . phpCAS :: getUser() . '\' is already authenticated)');
986  }
987 
988  phpCAS :: traceEnd();
989  return $auth;
990  }
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
backtrace()
This method is a wrapper for debug_backtrace() that is not available in all PHP versions (>= 4...
Definition: CAS.php:507
$PHPCAS_AUTH_CHECK_CALL
This global variable is used to store where the method checking the authentication is called from (to...
Definition: CAS.php:195
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
getUser()
This method returns the CAS user's login name.
Definition: CAS.php:1075
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
trace($str)
This method is used to log something in debug mode.
Definition: CAS.php:569
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAttributes()

phpCAS::getAttributes ( )

This method returns the CAS user's login name.

Warning
should not be called only after phpCAS::forceAuthentication() or phpCAS::checkAuthentication().
Returns
the login name of the authenticated user

Definition at line 1096 of file CAS.php.

References $PHPCAS_AUTH_CHECK_CALL, $PHPCAS_CLIENT, and phpCAS\error().

1096  {
1098  if (!is_object($PHPCAS_CLIENT)) {
1099  phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1100  }
1101  if (!$PHPCAS_AUTH_CHECK_CALL['done']) {
1102  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()');
1103  }
1104  if (!$PHPCAS_AUTH_CHECK_CALL['result']) {
1105  phpCAS :: error('authentication was checked (by ' . $PHPCAS_AUTH_CHECK_CALL['method'] . '() at ' . $PHPCAS_AUTH_CHECK_CALL['file'] . ':' . $PHPCAS_AUTH_CHECK_CALL['line'] . ') but the method returned FALSE');
1106  }
1107  return $PHPCAS_CLIENT->getAttributes();
1108  }
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
$PHPCAS_AUTH_CHECK_CALL
This global variable is used to store where the method checking the authentication is called from (to...
Definition: CAS.php:195
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ getServerLoginURL()

phpCAS::getServerLoginURL ( )

This method returns the URL to be used to login.

or phpCAS::isAuthenticated().

Returns
the login name of the authenticated user

Definition at line 1126 of file CAS.php.

References $PHPCAS_CLIENT, and phpCAS\error().

1126  {
1127  global $PHPCAS_CLIENT;
1128  if (!is_object($PHPCAS_CLIENT)) {
1129  phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1130  }
1131  return $PHPCAS_CLIENT->getServerLoginURL();
1132  }
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ getServerLogoutURL()

phpCAS::getServerLogoutURL ( )

This method returns the URL to be used to login.

or phpCAS::isAuthenticated().

Returns
the login name of the authenticated user

Definition at line 1222 of file CAS.php.

References $PHPCAS_CLIENT, and phpCAS\error().

1222  {
1223  global $PHPCAS_CLIENT;
1224  if (!is_object($PHPCAS_CLIENT)) {
1225  phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1226  }
1227  return $PHPCAS_CLIENT->getServerLogoutURL();
1228  }
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ getServiceURL()

phpCAS::getServiceURL ( )

Get the URL that is set as the CAS service parameter.

Definition at line 1390 of file CAS.php.

References $PHPCAS_CLIENT, and phpCAS\error().

1390  {
1391  global $PHPCAS_CLIENT;
1392  if (!is_object($PHPCAS_CLIENT)) {
1393  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
1394  }
1395  return ($PHPCAS_CLIENT->getURL());
1396  }
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ getUser()

phpCAS::getUser ( )

This method returns the CAS user's login name.

Warning
should not be called only after phpCAS::forceAuthentication() or phpCAS::checkAuthentication().
Returns
the login name of the authenticated user

Definition at line 1075 of file CAS.php.

References $PHPCAS_AUTH_CHECK_CALL, $PHPCAS_CLIENT, and phpCAS\error().

Referenced by phpCAS\forceAuthentication(), ilCASAuth\getCASUser(), and ilCASAuth\login().

1075  {
1077  if (!is_object($PHPCAS_CLIENT)) {
1078  phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1079  }
1080  if (!$PHPCAS_AUTH_CHECK_CALL['done']) {
1081  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()');
1082  }
1083  if (!$PHPCAS_AUTH_CHECK_CALL['result']) {
1084  phpCAS :: error('authentication was checked (by ' . $PHPCAS_AUTH_CHECK_CALL['method'] . '() at ' . $PHPCAS_AUTH_CHECK_CALL['file'] . ':' . $PHPCAS_AUTH_CHECK_CALL['line'] . ') but the method returned FALSE');
1085  }
1086  return $PHPCAS_CLIENT->getUser();
1087  }
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
$PHPCAS_AUTH_CHECK_CALL
This global variable is used to store where the method checking the authentication is called from (to...
Definition: CAS.php:195
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleLogoutRequests()

phpCAS::handleLogoutRequests (   $check_client = true,
  $allowed_clients = false 
)

Handle logout requests.

Definition at line 1112 of file CAS.php.

References $PHPCAS_CLIENT, and phpCAS\error().

1112  {
1113  global $PHPCAS_CLIENT;
1114  if (!is_object($PHPCAS_CLIENT)) {
1115  phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1116  }
1117  return ($PHPCAS_CLIENT->handleLogoutRequests($check_client, $allowed_clients));
1118  }
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ isAuthenticated()

phpCAS::isAuthenticated ( )

This method is called to check if the user is authenticated (previously or by tickets given in the URL).

Returns
TRUE when the user is authenticated.

Definition at line 1030 of file CAS.php.

References $auth, $PHPCAS_AUTH_CHECK_CALL, $PHPCAS_CLIENT, phpCAS\backtrace(), phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1030  {
1032 
1034  if (!is_object($PHPCAS_CLIENT)) {
1035  phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1036  }
1037 
1038  // call the isAuthenticated method of the global $PHPCAS_CLIENT object
1039  $auth = $PHPCAS_CLIENT->isAuthenticated();
1040 
1041  // store where the authentication has been checked and the result
1042  $dbg = phpCAS :: backtrace();
1043  $PHPCAS_AUTH_CHECK_CALL = array (
1044  'done' => TRUE,
1045  'file' => $dbg[0]['file'],
1046  'line' => $dbg[0]['line'],
1047  'method' => __CLASS__ . '::' . __FUNCTION__,
1048  'result' => $auth
1049  );
1051  return $auth;
1052  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
backtrace()
This method is a wrapper for debug_backtrace() that is not available in all PHP versions (>= 4...
Definition: CAS.php:507
$PHPCAS_AUTH_CHECK_CALL
This global variable is used to store where the method checking the authentication is called from (to...
Definition: CAS.php:195
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ isSessionAuthenticated()

phpCAS::isSessionAuthenticated ( )

Checks whether authenticated based on $_SESSION.

Useful to avoid server calls.

Returns
true if authenticated, false otherwise.
Since
0.4.22 by Brendan Arnold

Definition at line 1060 of file CAS.php.

References $PHPCAS_CLIENT, and phpCAS\error().

1060  {
1061  global $PHPCAS_CLIENT;
1062  if (!is_object($PHPCAS_CLIENT)) {
1063  phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1064  }
1065  return ($PHPCAS_CLIENT->isSessionAuthenticated());
1066  }
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ logout()

phpCAS::logout (   $params = "")

This method is used to logout from CAS.

$params an array that contains the optional url and service parameters that will be passed to the CAS server

Definition at line 1255 of file CAS.php.

References $PHPCAS_CLIENT, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1255  {
1256  global $PHPCAS_CLIENT;
1258  if (!is_object($PHPCAS_CLIENT)) {
1259  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1260  }
1261  $parsedParams = array ();
1262  if ($params != "") {
1263  if (is_string($params)) {
1264  phpCAS :: error('method `phpCAS::logout($url)\' is now deprecated, use `phpCAS::logoutWithUrl($url)\' instead');
1265  }
1266  if (!is_array($params)) {
1267  phpCAS :: error('type mismatched for parameter $params (should be `array\')');
1268  }
1269  foreach ($params as $key => $value) {
1270  if ($key != "service" && $key != "url") {
1271  phpCAS :: error('only `url\' and `service\' parameters are allowed for method `phpCAS::logout($params)\'');
1272  }
1273  $parsedParams[$key] = $value;
1274  }
1275  }
1276  $PHPCAS_CLIENT->logout($parsedParams);
1277  // never reached
1279  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ logoutWithRedirectService()

phpCAS::logoutWithRedirectService (   $service)

This method is used to logout from CAS.

Halts by redirecting to the CAS server.

Parameters
$servicea URL that will be transmitted to the CAS server

Definition at line 1285 of file CAS.php.

References $PHPCAS_CLIENT, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1285  {
1286  global $PHPCAS_CLIENT;
1288  if (!is_object($PHPCAS_CLIENT)) {
1289  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1290  }
1291  if (!is_string($service)) {
1292  phpCAS :: error('type mismatched for parameter $service (should be `string\')');
1293  }
1294  $PHPCAS_CLIENT->logout(array (
1295  "service" => $service
1296  ));
1297  // never reached
1299  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ logoutWithRedirectServiceAndUrl()

phpCAS::logoutWithRedirectServiceAndUrl (   $service,
  $url 
)

This method is used to logout from CAS.

Halts by redirecting to the CAS server.

Parameters
$servicea URL that will be transmitted to the CAS server
$urla URL that will be transmitted to the CAS server

Definition at line 1326 of file CAS.php.

References $PHPCAS_CLIENT, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1326  {
1327  global $PHPCAS_CLIENT;
1329  if (!is_object($PHPCAS_CLIENT)) {
1330  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1331  }
1332  if (!is_string($service)) {
1333  phpCAS :: error('type mismatched for parameter $service (should be `string\')');
1334  }
1335  if (!is_string($url)) {
1336  phpCAS :: error('type mismatched for parameter $url (should be `string\')');
1337  }
1338  $PHPCAS_CLIENT->logout(array (
1339  "service" => $service,
1340  "url" => $url
1341  ));
1342  // never reached
1344  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ logoutWithUrl()

phpCAS::logoutWithUrl (   $url)

This method is used to logout from CAS.

Halts by redirecting to the CAS server.

Parameters
$urla URL that will be transmitted to the CAS server

Definition at line 1305 of file CAS.php.

References $PHPCAS_CLIENT, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1305  {
1306  global $PHPCAS_CLIENT;
1308  if (!is_object($PHPCAS_CLIENT)) {
1309  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1310  }
1311  if (!is_string($url)) {
1312  phpCAS :: error('type mismatched for parameter $url (should be `string\')');
1313  }
1314  $PHPCAS_CLIENT->logout(array (
1315  "url" => $url
1316  ));
1317  // never reached
1319  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ renewAuthentication()

phpCAS::renewAuthentication ( )

This method is called to renew the authentication.

Definition at line 995 of file CAS.php.

995  {
997 
999  if (!is_object($PHPCAS_CLIENT)) {
1000  phpCAS :: error('this method should not be called before' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1001  }
1002 
1003  // store where the authentication has been checked and the result
1004  $dbg = phpCAS :: backtrace();
1005  $PHPCAS_AUTH_CHECK_CALL = array (
1006  'done' => TRUE,
1007  'file' => $dbg[0]['file'],
1008  'line' => $dbg[0]['line'],
1009  'method' => __CLASS__ . '::' . __FUNCTION__,
1010  'result' => $auth
1011  );
1012 
1013  $PHPCAS_CLIENT->renewAuthentication();
1015  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
backtrace()
This method is a wrapper for debug_backtrace() that is not available in all PHP versions (>= 4...
Definition: CAS.php:507
$PHPCAS_AUTH_CHECK_CALL
This global variable is used to store where the method checking the authentication is called from (to...
Definition: CAS.php:195
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544

◆ retrievePT()

phpCAS::retrievePT (   $target_service,
$err_code,
$err_msg 
)

Retrieve a Proxy Ticket from the CAS server.

Definition at line 1401 of file CAS.php.

References $PHPCAS_CLIENT, and phpCAS\error().

1401  {
1402  global $PHPCAS_CLIENT;
1403  if (!is_object($PHPCAS_CLIENT)) {
1404  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
1405  }
1406  if (gettype($target_service) != 'string') {
1407  phpCAS :: error('type mismatched for parameter $target_service(should be `string\')');
1408  }
1409  return ($PHPCAS_CLIENT->retrievePT($target_service, $err_code, $err_msg));
1410  }
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ setCacheTimesForAuthRecheck()

phpCAS::setCacheTimesForAuthRecheck (   $n)

Set the times authentication will be cached before really accessing the CAS server in gateway mode:

  • -1: check only once, and then never again (until you pree login)
  • 0: always check
  • n: check every "n" time
Parameters
$nan integer.

Definition at line 918 of file CAS.php.

References $n, $PHPCAS_CLIENT, and phpCAS\error().

918  {
919  global $PHPCAS_CLIENT;
920  if (!is_object($PHPCAS_CLIENT)) {
921  phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
922  }
923  if (gettype($n) != 'integer') {
924  phpCAS :: error('type mismatched for parameter $header (should be `string\')');
925  }
926  $PHPCAS_CLIENT->setCacheTimesForAuthRecheck($n);
927  }
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
$n
Definition: RandomTest.php:80
+ Here is the call graph for this function:

◆ setCasServerCACert()

phpCAS::setCasServerCACert (   $cert)

Set the certificate of the CAS server CA.

Parameters
$certthe CA certificate

Definition at line 1435 of file CAS.php.

References $PHPCAS_CLIENT, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1435  {
1436  global $PHPCAS_CLIENT;
1438  if (!is_object($PHPCAS_CLIENT)) {
1439  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1440  }
1441  if (gettype($cert) != 'string') {
1442  phpCAS :: error('type mismatched for parameter $cert (should be `string\')');
1443  }
1444  $PHPCAS_CLIENT->setCasServerCACert($cert);
1446  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ setCasServerCert()

phpCAS::setCasServerCert (   $cert)

Set the certificate of the CAS server.

Parameters
$certthe PEM certificate

Definition at line 1417 of file CAS.php.

References $PHPCAS_CLIENT, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1417  {
1418  global $PHPCAS_CLIENT;
1420  if (!is_object($PHPCAS_CLIENT)) {
1421  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1422  }
1423  if (gettype($cert) != 'string') {
1424  phpCAS :: error('type mismatched for parameter $cert (should be `string\')');
1425  }
1426  $PHPCAS_CLIENT->setCasServerCert($cert);
1428  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ setFixedCallbackURL()

phpCAS::setFixedCallbackURL (   $url = '')

Set the fixed URL that will be used by the CAS server to transmit the PGT.

When this method is not called, a phpCAS script uses its own URL for the callback.

Parameters
$urlthe URL

Definition at line 1352 of file CAS.php.

References $PHPCAS_CLIENT, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1352  {
1353  global $PHPCAS_CLIENT;
1355  if (!is_object($PHPCAS_CLIENT)) {
1356  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
1357  }
1358  if (!$PHPCAS_CLIENT->isProxy()) {
1359  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
1360  }
1361  if (gettype($url) != 'string') {
1362  phpCAS :: error('type mismatched for parameter $url (should be `string\')');
1363  }
1364  $PHPCAS_CLIENT->setCallbackURL($url);
1366  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ setFixedServiceURL()

phpCAS::setFixedServiceURL (   $url)

Set the fixed URL that will be set as the CAS service parameter.

When this method is not called, a phpCAS script uses its own URL.

Parameters
$urlthe URL

Definition at line 1374 of file CAS.php.

References $PHPCAS_CLIENT, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by ilSoapAuthenticationCAS\__buildAuth().

1374  {
1375  global $PHPCAS_CLIENT;
1377  if (!is_object($PHPCAS_CLIENT)) {
1378  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
1379  }
1380  if (gettype($url) != 'string') {
1381  phpCAS :: error('type mismatched for parameter $url (should be `string\')');
1382  }
1383  $PHPCAS_CLIENT->setURL($url);
1385  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setNoCasServerValidation()

phpCAS::setNoCasServerValidation ( )

Set no SSL validation for the CAS server.

Definition at line 1451 of file CAS.php.

References $PHPCAS_CLIENT, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

Referenced by ilAuthContainerCAS\initCAS().

1451  {
1452  global $PHPCAS_CLIENT;
1454  if (!is_object($PHPCAS_CLIENT)) {
1455  phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1456  }
1457  $PHPCAS_CLIENT->setNoCasServerValidation();
1459  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setServerLoginURL()

phpCAS::setServerLoginURL (   $url = '')

Set the login URL of the CAS server.

Parameters
$urlthe login URL
Since
0.4.21 by Wyman Chan

Definition at line 1139 of file CAS.php.

References $PHPCAS_CLIENT, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1139  {
1140  global $PHPCAS_CLIENT;
1142  if (!is_object($PHPCAS_CLIENT)) {
1143  phpCAS :: error('this method should only be called after
1144  ' . __CLASS__ . '::client()');
1145  }
1146  if (gettype($url) != 'string') {
1147  phpCAS :: error('type mismatched for parameter $url (should be
1148  `string\')');
1149  }
1150  $PHPCAS_CLIENT->setServerLoginURL($url);
1152  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ setServerLogoutURL()

phpCAS::setServerLogoutURL (   $url = '')

Set the logout URL of the CAS server.

Parameters
$urlthe logout URL
Since
0.4.21 by Wyman Chan

Definition at line 1235 of file CAS.php.

References $PHPCAS_CLIENT, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1235  {
1236  global $PHPCAS_CLIENT;
1238  if (!is_object($PHPCAS_CLIENT)) {
1239  phpCAS :: error('this method should only be called after
1240  ' . __CLASS__ . '::client()');
1241  }
1242  if (gettype($url) != 'string') {
1243  phpCAS :: error('type mismatched for parameter $url (should be
1244  `string\')');
1245  }
1246  $PHPCAS_CLIENT->setServerLogoutURL($url);
1248  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ setServerProxyValidateURL()

phpCAS::setServerProxyValidateURL (   $url = '')

Set the proxyValidate URL of the CAS server.

Used for all CAS 2.0 validations

Parameters
$urlthe proxyValidate URL
Since
1.1.0 by Joachim Fritschi

Definition at line 1181 of file CAS.php.

References $PHPCAS_CLIENT, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1181  {
1182  global $PHPCAS_CLIENT;
1184  if (!is_object($PHPCAS_CLIENT)) {
1185  phpCAS :: error('this method should only be called after
1186  ' . __CLASS__ . '::client()');
1187  }
1188  if (gettype($url) != 'string') {
1189  phpCAS :: error('type mismatched for parameter $url (should be
1190  `string\')');
1191  }
1192  $PHPCAS_CLIENT->setServerProxyValidateURL($url);
1194  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ setServerSamlValidateURL()

phpCAS::setServerSamlValidateURL (   $url = '')

Set the samlValidate URL of the CAS server.

Parameters
$urlthe samlValidate URL
Since
1.1.0 by Joachim Fritschi

Definition at line 1201 of file CAS.php.

References $PHPCAS_CLIENT, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1201  {
1202  global $PHPCAS_CLIENT;
1204  if (!is_object($PHPCAS_CLIENT)) {
1205  phpCAS :: error('this method should only be called after
1206  ' . __CLASS__ . '::client()');
1207  }
1208  if (gettype($url) != 'string') {
1209  phpCAS :: error('type mismatched for parameter $url (should be
1210  `string\')');
1211  }
1212  $PHPCAS_CLIENT->setServerSamlValidateURL($url);
1214  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function:

◆ setServerServiceValidateURL()

phpCAS::setServerServiceValidateURL (   $url = '')

Set the serviceValidate URL of the CAS server.

Used only in CAS 1.0 validations

Parameters
$urlthe serviceValidate URL
Since
1.1.0 by Joachim Fritschi

Definition at line 1160 of file CAS.php.

References $PHPCAS_CLIENT, phpCAS\error(), phpCAS\traceBegin(), and phpCAS\traceEnd().

1160  {
1161  global $PHPCAS_CLIENT;
1163  if (!is_object($PHPCAS_CLIENT)) {
1164  phpCAS :: error('this method should only be called after
1165  ' . __CLASS__ . '::client()');
1166  }
1167  if (gettype($url) != 'string') {
1168  phpCAS :: error('type mismatched for parameter $url (should be
1169  `string\')');
1170  }
1171  $PHPCAS_CLIENT->setServerServiceValidateURL($url);
1173  }
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$PHPCAS_CLIENT
This global variable is used by the interface class phpCAS.
Definition: CAS.php:176
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
+ Here is the call graph for this function: