@@ 1110-1122 (lines=13) @@ | ||
1107 | * |
|
1108 | * @return the login name of the authenticated user |
|
1109 | */ |
|
1110 | function getUser() |
|
1111 | { |
|
1112 | global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL; |
|
1113 | if (!is_object($PHPCAS_CLIENT)) { |
|
1114 | phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
1115 | } |
|
1116 | if (!$PHPCAS_AUTH_CHECK_CALL['done']) { |
|
1117 | phpCAS:: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()'); |
|
1118 | } |
|
1119 | if (!$PHPCAS_AUTH_CHECK_CALL['result']) { |
|
1120 | 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'); |
|
1121 | } |
|
1122 | return $PHPCAS_CLIENT->getUser(); |
|
1123 | } |
|
1124 | ||
1125 | /** |
|
@@ 1132-1144 (lines=13) @@ | ||
1129 | * |
|
1130 | * @return the login name of the authenticated user |
|
1131 | */ |
|
1132 | function getAttributes() |
|
1133 | { |
|
1134 | global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL; |
|
1135 | if (!is_object($PHPCAS_CLIENT)) { |
|
1136 | phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()'); |
|
1137 | } |
|
1138 | if (!$PHPCAS_AUTH_CHECK_CALL['done']) { |
|
1139 | phpCAS:: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()'); |
|
1140 | } |
|
1141 | if (!$PHPCAS_AUTH_CHECK_CALL['result']) { |
|
1142 | 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'); |
|
1143 | } |
|
1144 | return $PHPCAS_CLIENT->getAttributes(); |
|
1145 | } |
|
1146 | ||
1147 | /** |