|
@@ 962-983 (lines=22) @@
|
| 959 |
|
* This method is called to check if the user is authenticated (use the gateway feature).
|
| 960 |
|
* @return TRUE when the user is authenticated; otherwise FALSE.
|
| 961 |
|
*/
|
| 962 |
|
function checkAuthentication()
|
| 963 |
|
{
|
| 964 |
|
global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL;
|
| 965 |
|
|
| 966 |
|
phpCAS:: traceBegin();
|
| 967 |
|
if (!is_object($PHPCAS_CLIENT)) {
|
| 968 |
|
phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
| 969 |
|
}
|
| 970 |
|
|
| 971 |
|
$auth = $PHPCAS_CLIENT->checkAuthentication();
|
| 972 |
|
|
| 973 |
|
// store where the authentication has been checked and the result
|
| 974 |
|
$dbg = phpCAS:: backtrace();
|
| 975 |
|
$PHPCAS_AUTH_CHECK_CALL = array(
|
| 976 |
|
'done' => true,
|
| 977 |
|
'file' => $dbg[0]['file'],
|
| 978 |
|
'line' => $dbg[0]['line'],
|
| 979 |
|
'method' => __CLASS__ . '::' . __FUNCTION__,
|
| 980 |
|
'result' => $auth
|
| 981 |
|
);
|
| 982 |
|
phpCAS:: traceEnd($auth);
|
| 983 |
|
return $auth;
|
| 984 |
|
}
|
| 985 |
|
|
| 986 |
|
/**
|
|
@@ 1063-1085 (lines=23) @@
|
| 1060 |
|
*
|
| 1061 |
|
* @return TRUE when the user is authenticated.
|
| 1062 |
|
*/
|
| 1063 |
|
function isAuthenticated()
|
| 1064 |
|
{
|
| 1065 |
|
global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL;
|
| 1066 |
|
|
| 1067 |
|
phpCAS:: traceBegin();
|
| 1068 |
|
if (!is_object($PHPCAS_CLIENT)) {
|
| 1069 |
|
phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
| 1070 |
|
}
|
| 1071 |
|
|
| 1072 |
|
// call the isAuthenticated method of the global $PHPCAS_CLIENT object
|
| 1073 |
|
$auth = $PHPCAS_CLIENT->isAuthenticated();
|
| 1074 |
|
|
| 1075 |
|
// store where the authentication has been checked and the result
|
| 1076 |
|
$dbg = phpCAS:: backtrace();
|
| 1077 |
|
$PHPCAS_AUTH_CHECK_CALL = array(
|
| 1078 |
|
'done' => true,
|
| 1079 |
|
'file' => $dbg[0]['file'],
|
| 1080 |
|
'line' => $dbg[0]['line'],
|
| 1081 |
|
'method' => __CLASS__ . '::' . __FUNCTION__,
|
| 1082 |
|
'result' => $auth
|
| 1083 |
|
);
|
| 1084 |
|
phpCAS:: traceEnd($auth);
|
| 1085 |
|
return $auth;
|
| 1086 |
|
}
|
| 1087 |
|
|
| 1088 |
|
/**
|