3 // commented in 0.4.22-RC2 for Sylvain Derosiaux
\r
4 // error_reporting(E_ALL ^ E_NOTICE);
\r
7 // hack by Vangelis Haniotakis to handle the absence of $_SERVER['REQUEST_URI'] in IIS
\r
9 if (!$_SERVER['REQUEST_URI']) {
\r
10 $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING'];
\r
14 // another one by Vangelis Haniotakis also to make phpCAS work with PHP5
\r
16 if (version_compare(PHP_VERSION,'5','>=')) {
\r
17 require_once(dirname(__FILE__).'/CAS/domxml-php4-php5.php');
\r
22 * Interface class of the phpCAS library
\r
27 // ########################################################################
\r
29 // ########################################################################
\r
31 // ------------------------------------------------------------------------
\r
33 // ------------------------------------------------------------------------
\r
36 * phpCAS version. accessible for the user by phpCAS::getVersion().
\r
38 define('PHPCAS_VERSION','1.0.1');
\r
40 // ------------------------------------------------------------------------
\r
42 // ------------------------------------------------------------------------
\r
44 * @addtogroup public
\r
51 define("CAS_VERSION_1_0",'1.0');
\r
55 define("CAS_VERSION_2_0",'2.0');
\r
59 * @addtogroup publicPGTStorage
\r
62 // ------------------------------------------------------------------------
\r
64 // ------------------------------------------------------------------------
\r
66 * Default path used when storing PGT's to file
\r
68 define("CAS_PGT_STORAGE_FILE_DEFAULT_PATH",'/tmp');
\r
70 * phpCAS::setPGTStorageFile()'s 2nd parameter to write plain text files
\r
72 define("CAS_PGT_STORAGE_FILE_FORMAT_PLAIN",'plain');
\r
74 * phpCAS::setPGTStorageFile()'s 2nd parameter to write xml files
\r
76 define("CAS_PGT_STORAGE_FILE_FORMAT_XML",'xml');
\r
78 * Default format used when storing PGT's to file
\r
80 define("CAS_PGT_STORAGE_FILE_DEFAULT_FORMAT",CAS_PGT_STORAGE_FILE_FORMAT_PLAIN);
\r
81 // ------------------------------------------------------------------------
\r
82 // DATABASE PGT STORAGE
\r
83 // ------------------------------------------------------------------------
\r
85 * default database type when storing PGT's to database
\r
87 define("CAS_PGT_STORAGE_DB_DEFAULT_DATABASE_TYPE",'mysql');
\r
89 * default host when storing PGT's to database
\r
91 define("CAS_PGT_STORAGE_DB_DEFAULT_HOSTNAME",'localhost');
\r
93 * default port when storing PGT's to database
\r
95 define("CAS_PGT_STORAGE_DB_DEFAULT_PORT",'');
\r
97 * default database when storing PGT's to database
\r
99 define("CAS_PGT_STORAGE_DB_DEFAULT_DATABASE",'phpCAS');
\r
101 * default table when storing PGT's to database
\r
103 define("CAS_PGT_STORAGE_DB_DEFAULT_TABLE",'pgt');
\r
106 // ------------------------------------------------------------------------
\r
107 // SERVICE ACCESS ERRORS
\r
108 // ------------------------------------------------------------------------
\r
110 * @addtogroup publicServices
\r
115 * phpCAS::service() error code on success
\r
117 define("PHPCAS_SERVICE_OK",0);
\r
119 * phpCAS::service() error code when the PT could not retrieve because
\r
120 * the CAS server did not respond.
\r
122 define("PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE",1);
\r
124 * phpCAS::service() error code when the PT could not retrieve because
\r
125 * the response of the CAS server was ill-formed.
\r
127 define("PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE",2);
\r
129 * phpCAS::service() error code when the PT could not retrieve because
\r
130 * the CAS server did not want to.
\r
132 define("PHPCAS_SERVICE_PT_FAILURE",3);
\r
134 * phpCAS::service() error code when the service was not available.
\r
136 define("PHPCAS_SERVICE_NOT AVAILABLE",4);
\r
139 // ------------------------------------------------------------------------
\r
141 // ------------------------------------------------------------------------
\r
143 * @addtogroup publicLang
\r
147 define("PHPCAS_LANG_ENGLISH", 'english');
\r
148 define("PHPCAS_LANG_FRENCH", 'french');
\r
149 define("PHPCAS_LANG_GREEK", 'greek');
\r
150 define("PHPCAS_LANG_GERMAN", 'german');
\r
151 define("PHPCAS_LANG_JAPANESE", 'japanese');
\r
152 define("PHPCAS_LANG_SPANISH", 'spanish');
\r
153 define("PHPCAS_LANG_CATALAN", 'catalan');
\r
158 * @addtogroup internalLang
\r
163 * phpCAS default language (when phpCAS::setLang() is not used)
\r
165 define("PHPCAS_LANG_DEFAULT", PHPCAS_LANG_ENGLISH);
\r
168 // ------------------------------------------------------------------------
\r
170 // ------------------------------------------------------------------------
\r
172 * @addtogroup publicDebug
\r
177 * The default directory for the debug file under Unix.
\r
179 define('DEFAULT_DEBUG_DIR','/tmp/');
\r
182 // ------------------------------------------------------------------------
\r
184 // ------------------------------------------------------------------------
\r
186 * @addtogroup internalMisc
\r
191 * This global variable is used by the interface class phpCAS.
\r
195 $GLOBALS['PHPCAS_CLIENT'] = null;
\r
198 * This global variable is used to store where the initializer is called from
\r
199 * (to print a comprehensive error in case of multiple calls).
\r
203 $GLOBALS['PHPCAS_INIT_CALL'] = array('done' => FALSE,
\r
209 * This global variable is used to store where the method checking
\r
210 * the authentication is called from (to print comprehensive errors)
\r
214 $GLOBALS['PHPCAS_AUTH_CHECK_CALL'] = array('done' => FALSE,
\r
218 'result' => FALSE);
\r
221 * This global variable is used to store phpCAS debug mode.
\r
225 $GLOBALS['PHPCAS_DEBUG'] = array('filename' => FALSE,
\r
227 'unique_id' => '');
\r
231 // ########################################################################
\r
233 // ########################################################################
\r
235 // include client class
\r
236 include_once(dirname(__FILE__).'/CAS/client.php');
\r
238 // ########################################################################
\r
240 // ########################################################################
\r
244 * The phpCAS class is a simple container for the phpCAS library. It provides CAS
\r
245 * authentication for web applications written in PHP.
\r
248 * @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
\r
250 * \internal All its methods access the same object ($PHPCAS_CLIENT, declared
\r
251 * at the end of CAS/client.php).
\r
259 // ########################################################################
\r
261 // ########################################################################
\r
264 * @addtogroup publicInit
\r
269 * phpCAS client initializer.
\r
270 * @note Only one of the phpCAS::client() and phpCAS::proxy functions should be
\r
271 * called, only once, and before all other methods (except phpCAS::getVersion()
\r
272 * and phpCAS::setDebug()).
\r
274 * @param $server_version the version of the CAS server
\r
275 * @param $server_hostname the hostname of the CAS server
\r
276 * @param $server_port the port the CAS server is running on
\r
277 * @param $server_uri the URI the CAS server is responding on
\r
278 * @param $start_session Have phpCAS start PHP sessions (default true)
\r
280 * @return a newly created CASClient object
\r
282 function client($server_version,
\r
286 $start_session = true)
\r
288 global $PHPCAS_CLIENT, $PHPCAS_INIT_CALL;
\r
290 phpCAS::traceBegin();
\r
291 if ( is_object($PHPCAS_CLIENT) ) {
\r
292 phpCAS::error($PHPCAS_INIT_CALL['method'].'() has already been called (at '.$PHPCAS_INIT_CALL['file'].':'.$PHPCAS_INIT_CALL['line'].')');
\r
294 if ( gettype($server_version) != 'string' ) {
\r
295 phpCAS::error('type mismatched for parameter $server_version (should be `string\')');
\r
297 if ( gettype($server_hostname) != 'string' ) {
\r
298 phpCAS::error('type mismatched for parameter $server_hostname (should be `string\')');
\r
300 if ( gettype($server_port) != 'integer' ) {
\r
301 phpCAS::error('type mismatched for parameter $server_port (should be `integer\')');
\r
303 if ( gettype($server_uri) != 'string' ) {
\r
304 phpCAS::error('type mismatched for parameter $server_uri (should be `string\')');
\r
307 // store where the initialzer is called from
\r
308 $dbg = phpCAS::backtrace();
\r
309 $PHPCAS_INIT_CALL = array('done' => TRUE,
\r
310 'file' => $dbg[0]['file'],
\r
311 'line' => $dbg[0]['line'],
\r
312 'method' => __CLASS__.'::'.__FUNCTION__);
\r
314 // initialize the global object $PHPCAS_CLIENT
\r
315 $PHPCAS_CLIENT = new CASClient($server_version,FALSE/*proxy*/,$server_hostname,$server_port,$server_uri,$start_session);
\r
316 phpCAS::traceEnd();
\r
320 * phpCAS proxy initializer.
\r
321 * @note Only one of the phpCAS::client() and phpCAS::proxy functions should be
\r
322 * called, only once, and before all other methods (except phpCAS::getVersion()
\r
323 * and phpCAS::setDebug()).
\r
325 * @param $server_version the version of the CAS server
\r
326 * @param $server_hostname the hostname of the CAS server
\r
327 * @param $server_port the port the CAS server is running on
\r
328 * @param $server_uri the URI the CAS server is responding on
\r
329 * @param $start_session Have phpCAS start PHP sessions (default true)
\r
331 * @return a newly created CASClient object
\r
333 function proxy($server_version,
\r
337 $start_session = true)
\r
339 global $PHPCAS_CLIENT, $PHPCAS_INIT_CALL;
\r
341 phpCAS::traceBegin();
\r
342 if ( is_object($PHPCAS_CLIENT) ) {
\r
343 phpCAS::error($PHPCAS_INIT_CALL['method'].'() has already been called (at '.$PHPCAS_INIT_CALL['file'].':'.$PHPCAS_INIT_CALL['line'].')');
\r
345 if ( gettype($server_version) != 'string' ) {
\r
346 phpCAS::error('type mismatched for parameter $server_version (should be `string\')');
\r
348 if ( gettype($server_hostname) != 'string' ) {
\r
349 phpCAS::error('type mismatched for parameter $server_hostname (should be `string\')');
\r
351 if ( gettype($server_port) != 'integer' ) {
\r
352 phpCAS::error('type mismatched for parameter $server_port (should be `integer\')');
\r
354 if ( gettype($server_uri) != 'string' ) {
\r
355 phpCAS::error('type mismatched for parameter $server_uri (should be `string\')');
\r
358 // store where the initialzer is called from
\r
359 $dbg = phpCAS::backtrace();
\r
360 $PHPCAS_INIT_CALL = array('done' => TRUE,
\r
361 'file' => $dbg[0]['file'],
\r
362 'line' => $dbg[0]['line'],
\r
363 'method' => __CLASS__.'::'.__FUNCTION__);
\r
365 // initialize the global object $PHPCAS_CLIENT
\r
366 $PHPCAS_CLIENT = new CASClient($server_version,TRUE/*proxy*/,$server_hostname,$server_port,$server_uri,$start_session);
\r
367 phpCAS::traceEnd();
\r
371 // ########################################################################
\r
373 // ########################################################################
\r
376 * @addtogroup publicDebug
\r
381 * Set/unset debug mode
\r
383 * @param $filename the name of the file used for logging, or FALSE to stop debugging.
\r
385 function setDebug($filename='')
\r
387 global $PHPCAS_DEBUG;
\r
389 if ( $filename != FALSE && gettype($filename) != 'string' ) {
\r
390 phpCAS::error('type mismatched for parameter $dbg (should be FALSE or the name of the log file)');
\r
393 if ( empty($filename) ) {
\r
394 if ( preg_match('/^Win.*/',getenv('OS')) ) {
\r
395 if ( isset($_ENV['TMP']) ) {
\r
396 $debugDir = $_ENV['TMP'].'/';
\r
397 } else if ( isset($_ENV['TEMP']) ) {
\r
398 $debugDir = $_ENV['TEMP'].'/';
\r
403 $debugDir = DEFAULT_DEBUG_DIR;
\r
405 $filename = $debugDir . 'phpCAS.log';
\r
408 if ( empty($PHPCAS_DEBUG['unique_id']) ) {
\r
409 $PHPCAS_DEBUG['unique_id'] = substr(strtoupper(md5(uniqid(''))),0,4);
\r
412 $PHPCAS_DEBUG['filename'] = $filename;
\r
414 phpCAS::trace('START ******************');
\r
419 * @addtogroup internalDebug
\r
424 * This method is a wrapper for debug_backtrace() that is not available
\r
425 * in all PHP versions (>= 4.3.0 only)
\r
427 function backtrace()
\r
429 if ( function_exists('debug_backtrace') ) {
\r
430 return debug_backtrace();
\r
432 // poor man's hack ... but it does work ...
\r
438 * Logs a string in debug mode.
\r
440 * @param $str the string to write
\r
447 global $PHPCAS_DEBUG;
\r
449 if ( $PHPCAS_DEBUG['filename'] ) {
\r
450 for ($i=0;$i<$PHPCAS_DEBUG['indent'];$i++) {
\r
451 $indent_str .= '| ';
\r
453 error_log($PHPCAS_DEBUG['unique_id'].' '.$indent_str.$str."\n",3,$PHPCAS_DEBUG['filename']);
\r
459 * This method is used by interface methods to print an error and where the function
\r
460 * was originally called from.
\r
462 * @param $msg the message to print
\r
466 function error($msg)
\r
468 $dbg = phpCAS::backtrace();
\r
472 if ( is_array($dbg) ) {
\r
473 for ( $i=1; $i<sizeof($dbg); $i++) {
\r
474 if ( is_array($dbg[$i]) ) {
\r
475 if ( $dbg[$i]['class'] == __CLASS__ ) {
\r
476 $function = $dbg[$i]['function'];
\r
477 $file = $dbg[$i]['file'];
\r
478 $line = $dbg[$i]['line'];
\r
483 echo "<br />\n<b>phpCAS error</b>: <font color=\"FF0000\"><b>".__CLASS__."::".$function.'(): '.htmlentities($msg)."</b></font> in <b>".$file."</b> on line <b>".$line."</b><br />\n";
\r
484 phpCAS::trace($msg);
\r
485 phpCAS::traceExit();
\r
490 * This method is used to log something in debug mode.
\r
492 function trace($str)
\r
494 $dbg = phpCAS::backtrace();
\r
495 phpCAS::log($str.' ['.basename($dbg[1]['file']).':'.$dbg[1]['line'].']');
\r
499 * This method is used to indicate the start of the execution of a function in debug mode.
\r
501 function traceBegin()
\r
503 global $PHPCAS_DEBUG;
\r
505 $dbg = phpCAS::backtrace();
\r
507 if ( !empty($dbg[2]['class']) ) {
\r
508 $str .= $dbg[2]['class'].'::';
\r
510 $str .= $dbg[2]['function'].'(';
\r
511 if ( is_array($dbg[2]['args']) ) {
\r
512 foreach ($dbg[2]['args'] as $index => $arg) {
\r
513 if ( $index != 0 ) {
\r
516 $str .= str_replace("\n","",var_export($arg,TRUE));
\r
519 $str .= ') ['.basename($dbg[2]['file']).':'.$dbg[2]['line'].']';
\r
521 $PHPCAS_DEBUG['indent'] ++;
\r
525 * This method is used to indicate the end of the execution of a function in debug mode.
\r
527 * @param $res the result of the function
\r
529 function traceEnd($res='')
\r
531 global $PHPCAS_DEBUG;
\r
533 $PHPCAS_DEBUG['indent'] --;
\r
534 $dbg = phpCAS::backtrace();
\r
536 $str .= '<= '.str_replace("\n","",var_export($res,TRUE));
\r
541 * This method is used to indicate the end of the execution of the program
\r
543 function traceExit()
\r
545 global $PHPCAS_DEBUG;
\r
547 phpCAS::log('exit()');
\r
548 while ( $PHPCAS_DEBUG['indent'] > 0 ) {
\r
550 $PHPCAS_DEBUG['indent'] --;
\r
555 // ########################################################################
\r
556 // INTERNATIONALIZATION
\r
557 // ########################################################################
\r
559 * @addtogroup publicLang
\r
564 * This method is used to set the language used by phpCAS.
\r
565 * @note Can be called only once.
\r
567 * @param $lang a string representing the language.
\r
569 * @sa PHPCAS_LANG_FRENCH, PHPCAS_LANG_ENGLISH
\r
571 function setLang($lang)
\r
573 global $PHPCAS_CLIENT;
\r
574 if ( !is_object($PHPCAS_CLIENT) ) {
\r
575 phpCAS::error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
\r
577 if ( gettype($lang) != 'string' ) {
\r
578 phpCAS::error('type mismatched for parameter $lang (should be `string\')');
\r
580 $PHPCAS_CLIENT->setLang($lang);
\r
584 // ########################################################################
\r
586 // ########################################################################
\r
588 * @addtogroup public
\r
593 * This method returns the phpCAS version.
\r
595 * @return the phpCAS version.
\r
597 function getVersion()
\r
599 return PHPCAS_VERSION;
\r
603 // ########################################################################
\r
605 // ########################################################################
\r
607 * @addtogroup publicOutput
\r
612 * This method sets the HTML header used for all outputs.
\r
614 * @param $header the HTML header.
\r
616 function setHTMLHeader($header)
\r
618 global $PHPCAS_CLIENT;
\r
619 if ( !is_object($PHPCAS_CLIENT) ) {
\r
620 phpCAS::error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
\r
622 if ( gettype($header) != 'string' ) {
\r
623 phpCAS::error('type mismatched for parameter $header (should be `string\')');
\r
625 $PHPCAS_CLIENT->setHTMLHeader($header);
\r
629 * This method sets the HTML footer used for all outputs.
\r
631 * @param $footer the HTML footer.
\r
633 function setHTMLFooter($footer)
\r
635 global $PHPCAS_CLIENT;
\r
636 if ( !is_object($PHPCAS_CLIENT) ) {
\r
637 phpCAS::error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
\r
639 if ( gettype($footer) != 'string' ) {
\r
640 phpCAS::error('type mismatched for parameter $footer (should be `string\')');
\r
642 $PHPCAS_CLIENT->setHTMLFooter($footer);
\r
646 // ########################################################################
\r
648 // ########################################################################
\r
650 * @addtogroup publicPGTStorage
\r
655 * This method is used to tell phpCAS to store the response of the
\r
656 * CAS server to PGT requests onto the filesystem.
\r
658 * @param $format the format used to store the PGT's (`plain' and `xml' allowed)
\r
659 * @param $path the path where the PGT's should be stored
\r
661 function setPGTStorageFile($format='',
\r
664 global $PHPCAS_CLIENT,$PHPCAS_AUTH_CHECK_CALL;
\r
666 phpCAS::traceBegin();
\r
667 if ( !is_object($PHPCAS_CLIENT) ) {
\r
668 phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
\r
670 if ( !$PHPCAS_CLIENT->isProxy() ) {
\r
671 phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
\r
673 if ( $PHPCAS_AUTH_CHECK_CALL['done'] ) {
\r
674 phpCAS::error('this method should only be called before '.$PHPCAS_AUTH_CHECK_CALL['method'].'() (called at '.$PHPCAS_AUTH_CHECK_CALL['file'].':'.$PHPCAS_AUTH_CHECK_CALL['line'].')');
\r
676 if ( gettype($format) != 'string' ) {
\r
677 phpCAS::error('type mismatched for parameter $format (should be `string\')');
\r
679 if ( gettype($path) != 'string' ) {
\r
680 phpCAS::error('type mismatched for parameter $format (should be `string\')');
\r
682 $PHPCAS_CLIENT->setPGTStorageFile($format,$path);
\r
683 phpCAS::traceEnd();
\r
687 * This method is used to tell phpCAS to store the response of the
\r
688 * CAS server to PGT requests into a database.
\r
689 * @note The connection to the database is done only when needed.
\r
690 * As a consequence, bad parameters are detected only when
\r
691 * initializing PGT storage, except in debug mode.
\r
693 * @param $user the user to access the data with
\r
694 * @param $password the user's password
\r
695 * @param $database_type the type of the database hosting the data
\r
696 * @param $hostname the server hosting the database
\r
697 * @param $port the port the server is listening on
\r
698 * @param $database the name of the database
\r
699 * @param $table the name of the table storing the data
\r
701 function setPGTStorageDB($user,
\r
709 global $PHPCAS_CLIENT,$PHPCAS_AUTH_CHECK_CALL;
\r
711 phpCAS::traceBegin();
\r
712 if ( !is_object($PHPCAS_CLIENT) ) {
\r
713 phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
\r
715 if ( !$PHPCAS_CLIENT->isProxy() ) {
\r
716 phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
\r
718 if ( $PHPCAS_AUTH_CHECK_CALL['done'] ) {
\r
719 phpCAS::error('this method should only be called before '.$PHPCAS_AUTH_CHECK_CALL['method'].'() (called at '.$PHPCAS_AUTH_CHECK_CALL['file'].':'.$PHPCAS_AUTH_CHECK_CALL['line'].')');
\r
721 if ( gettype($user) != 'string' ) {
\r
722 phpCAS::error('type mismatched for parameter $user (should be `string\')');
\r
724 if ( gettype($password) != 'string' ) {
\r
725 phpCAS::error('type mismatched for parameter $password (should be `string\')');
\r
727 if ( gettype($database_type) != 'string' ) {
\r
728 phpCAS::error('type mismatched for parameter $database_type (should be `string\')');
\r
730 if ( gettype($hostname) != 'string' ) {
\r
731 phpCAS::error('type mismatched for parameter $hostname (should be `string\')');
\r
733 if ( gettype($port) != 'integer' ) {
\r
734 phpCAS::error('type mismatched for parameter $port (should be `integer\')');
\r
736 if ( gettype($database) != 'string' ) {
\r
737 phpCAS::error('type mismatched for parameter $database (should be `string\')');
\r
739 if ( gettype($table) != 'string' ) {
\r
740 phpCAS::error('type mismatched for parameter $table (should be `string\')');
\r
742 $PHPCAS_CLIENT->setPGTStorageDB($this,$user,$password,$hostname,$port,$database,$table);
\r
743 phpCAS::traceEnd();
\r
747 // ########################################################################
\r
748 // ACCESS TO EXTERNAL SERVICES
\r
749 // ########################################################################
\r
751 * @addtogroup publicServices
\r
756 * This method is used to access an HTTP[S] service.
\r
758 * @param $url the service to access.
\r
759 * @param $err_code an error code Possible values are PHPCAS_SERVICE_OK (on
\r
760 * success), PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE,
\r
761 * PHPCAS_SERVICE_PT_FAILURE, PHPCAS_SERVICE_NOT AVAILABLE.
\r
762 * @param $output the output of the service (also used to give an error
\r
763 * message on failure).
\r
765 * @return TRUE on success, FALSE otherwise (in this later case, $err_code
\r
766 * gives the reason why it failed and $output contains an error message).
\r
768 function serviceWeb($url,&$err_code,&$output)
\r
770 global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL;
\r
772 phpCAS::traceBegin();
\r
773 if ( !is_object($PHPCAS_CLIENT) ) {
\r
774 phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
\r
776 if ( !$PHPCAS_CLIENT->isProxy() ) {
\r
777 phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
\r
779 if ( !$PHPCAS_AUTH_CHECK_CALL['done'] ) {
\r
780 phpCAS::error('this method should only be called after the programmer is sure the user has been authenticated (by calling '.__CLASS__.'::checkAuthentication() or '.__CLASS__.'::forceAuthentication()');
\r
782 if ( !$PHPCAS_AUTH_CHECK_CALL['result'] ) {
\r
783 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');
\r
785 if ( gettype($url) != 'string' ) {
\r
786 phpCAS::error('type mismatched for parameter $url (should be `string\')');
\r
789 $res = $PHPCAS_CLIENT->serviceWeb($url,$err_code,$output);
\r
791 phpCAS::traceEnd($res);
\r
796 * This method is used to access an IMAP/POP3/NNTP service.
\r
798 * @param $url a string giving the URL of the service, including the mailing box
\r
799 * for IMAP URLs, as accepted by imap_open().
\r
800 * @param $flags options given to imap_open().
\r
801 * @param $err_code an error code Possible values are PHPCAS_SERVICE_OK (on
\r
802 * success), PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE, PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE,
\r
803 * PHPCAS_SERVICE_PT_FAILURE, PHPCAS_SERVICE_NOT AVAILABLE.
\r
804 * @param $err_msg an error message on failure
\r
805 * @param $pt the Proxy Ticket (PT) retrieved from the CAS server to access the URL
\r
806 * on success, FALSE on error).
\r
808 * @return an IMAP stream on success, FALSE otherwise (in this later case, $err_code
\r
809 * gives the reason why it failed and $err_msg contains an error message).
\r
811 function serviceMail($url,$flags,&$err_code,&$err_msg,&$pt)
\r
813 global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL;
\r
815 phpCAS::traceBegin();
\r
816 if ( !is_object($PHPCAS_CLIENT) ) {
\r
817 phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
\r
819 if ( !$PHPCAS_CLIENT->isProxy() ) {
\r
820 phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
\r
822 if ( !$PHPCAS_AUTH_CHECK_CALL['done'] ) {
\r
823 phpCAS::error('this method should only be called after the programmer is sure the user has been authenticated (by calling '.__CLASS__.'::checkAuthentication() or '.__CLASS__.'::forceAuthentication()');
\r
825 if ( !$PHPCAS_AUTH_CHECK_CALL['result'] ) {
\r
826 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');
\r
828 if ( gettype($url) != 'string' ) {
\r
829 phpCAS::error('type mismatched for parameter $url (should be `string\')');
\r
832 if ( gettype($flags) != 'integer' ) {
\r
833 phpCAS::error('type mismatched for parameter $flags (should be `integer\')');
\r
836 $res = $PHPCAS_CLIENT->serviceMail($url,$flags,$err_code,$err_msg,$pt);
\r
838 phpCAS::traceEnd($res);
\r
843 // ########################################################################
\r
845 // ########################################################################
\r
847 * @addtogroup publicAuth
\r
852 * Set the times authentication will be cached before really accessing the CAS server in gateway mode:
\r
853 * - -1: check only once, and then never again (until you pree login)
\r
854 * - 0: always check
\r
855 * - n: check every "n" time
\r
857 * @param $n an integer.
\r
859 function setCacheTimesForAuthRecheck($n)
\r
861 global $PHPCAS_CLIENT;
\r
862 if ( !is_object($PHPCAS_CLIENT) ) {
\r
863 phpCAS::error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
\r
865 if ( gettype($n) != 'integer' ) {
\r
866 phpCAS::error('type mismatched for parameter $header (should be `string\')');
\r
868 $PHPCAS_CLIENT->setCacheTimesForAuthRecheck($n);
\r
872 * This method is called to check if the user is authenticated (use the gateway feature).
\r
873 * @return TRUE when the user is authenticated; otherwise FALSE.
\r
875 function checkAuthentication()
\r
877 global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL;
\r
879 phpCAS::traceBegin();
\r
880 if ( !is_object($PHPCAS_CLIENT) ) {
\r
881 phpCAS::error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
\r
884 $auth = $PHPCAS_CLIENT->checkAuthentication();
\r
886 // store where the authentication has been checked and the result
\r
887 $dbg = phpCAS::backtrace();
\r
888 $PHPCAS_AUTH_CHECK_CALL = array('done' => TRUE,
\r
889 'file' => $dbg[0]['file'],
\r
890 'line' => $dbg[0]['line'],
\r
891 'method' => __CLASS__.'::'.__FUNCTION__,
\r
892 'result' => $auth );
\r
893 phpCAS::traceEnd($auth);
\r
898 * This method is called to force authentication if the user was not already
\r
899 * authenticated. If the user is not authenticated, halt by redirecting to
\r
902 function forceAuthentication()
\r
904 global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL;
\r
906 phpCAS::traceBegin();
\r
907 if ( !is_object($PHPCAS_CLIENT) ) {
\r
908 phpCAS::error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
\r
911 $auth = $PHPCAS_CLIENT->forceAuthentication();
\r
913 // store where the authentication has been checked and the result
\r
914 $dbg = phpCAS::backtrace();
\r
915 $PHPCAS_AUTH_CHECK_CALL = array('done' => TRUE,
\r
916 'file' => $dbg[0]['file'],
\r
917 'line' => $dbg[0]['line'],
\r
918 'method' => __CLASS__.'::'.__FUNCTION__,
\r
919 'result' => $auth );
\r
922 phpCAS::trace('user is not authenticated, redirecting to the CAS server');
\r
923 $PHPCAS_CLIENT->forceAuthentication();
\r
925 phpCAS::trace('no need to authenticate (user `'.phpCAS::getUser().'\' is already authenticated)');
\r
928 phpCAS::traceEnd();
\r
933 * This method is called to renew the authentication.
\r
935 function renewAuthentication() {
\r
936 global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL;
\r
938 phpCAS::traceBegin();
\r
939 if ( !is_object($PHPCAS_CLIENT) ) {
\r
940 phpCAS::error('this method should not be called before'.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
\r
943 // store where the authentication has been checked and the result
\r
944 $dbg = phpCAS::backtrace();
\r
945 $PHPCAS_AUTH_CHECK_CALL = array('done' => TRUE, 'file' => $dbg[0]['file'], 'line' => $dbg[0]['line'], 'method' => __CLASS__.'::'.__FUNCTION__, 'result' => $auth );
\r
947 $PHPCAS_CLIENT->renewAuthentication();
\r
948 phpCAS::traceEnd();
\r
952 * This method has been left from version 0.4.1 for compatibility reasons.
\r
954 function authenticate()
\r
956 phpCAS::error('this method is deprecated. You should use '.__CLASS__.'::forceAuthentication() instead');
\r
960 * This method is called to check if the user is authenticated (previously or by
\r
961 * tickets given in the URL).
\r
963 * @return TRUE when the user is authenticated.
\r
965 function isAuthenticated()
\r
967 global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL;
\r
969 phpCAS::traceBegin();
\r
970 if ( !is_object($PHPCAS_CLIENT) ) {
\r
971 phpCAS::error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
\r
974 // call the isAuthenticated method of the global $PHPCAS_CLIENT object
\r
975 $auth = $PHPCAS_CLIENT->isAuthenticated();
\r
977 // store where the authentication has been checked and the result
\r
978 $dbg = phpCAS::backtrace();
\r
979 $PHPCAS_AUTH_CHECK_CALL = array('done' => TRUE,
\r
980 'file' => $dbg[0]['file'],
\r
981 'line' => $dbg[0]['line'],
\r
982 'method' => __CLASS__.'::'.__FUNCTION__,
\r
983 'result' => $auth );
\r
984 phpCAS::traceEnd($auth);
\r
989 * Checks whether authenticated based on $_SESSION. Useful to avoid
\r
991 * @return true if authenticated, false otherwise.
\r
992 * @since 0.4.22 by Brendan Arnold
\r
994 function isSessionAuthenticated ()
\r
996 global $PHPCAS_CLIENT;
\r
997 if ( !is_object($PHPCAS_CLIENT) ) {
\r
998 phpCAS::error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
\r
1000 return($PHPCAS_CLIENT->isSessionAuthenticated());
\r
1004 * This method returns the CAS user's login name.
\r
1005 * @warning should not be called only after phpCAS::forceAuthentication()
\r
1006 * or phpCAS::checkAuthentication().
\r
1008 * @return the login name of the authenticated user
\r
1010 function getUser()
\r
1012 global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL;
\r
1013 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1014 phpCAS::error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
\r
1016 if ( !$PHPCAS_AUTH_CHECK_CALL['done'] ) {
\r
1017 phpCAS::error('this method should only be called after '.__CLASS__.'::forceAuthentication() or '.__CLASS__.'::isAuthenticated()');
\r
1019 if ( !$PHPCAS_AUTH_CHECK_CALL['result'] ) {
\r
1020 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');
\r
1022 return $PHPCAS_CLIENT->getUser();
\r
1026 * Handle logout requests.
\r
1028 function handleLogoutRequests($check_client=true, $allowed_clients=false)
\r
1030 global $PHPCAS_CLIENT;
\r
1031 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1032 phpCAS::error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
\r
1034 return($PHPCAS_CLIENT->handleLogoutRequests($check_client, $allowed_clients));
\r
1038 * This method returns the URL to be used to login.
\r
1039 * or phpCAS::isAuthenticated().
\r
1041 * @return the login name of the authenticated user
\r
1043 function getServerLoginURL()
\r
1045 global $PHPCAS_CLIENT;
\r
1046 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1047 phpCAS::error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
\r
1049 return $PHPCAS_CLIENT->getServerLoginURL();
\r
1053 * Set the login URL of the CAS server.
\r
1054 * @param $url the login URL
\r
1055 * @since 0.4.21 by Wyman Chan
\r
1057 function setServerLoginURL($url='')
\r
1059 global $PHPCAS_CLIENT;
\r
1060 phpCAS::traceBegin();
\r
1061 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1062 phpCAS::error('this method should only be called after
\r
1063 '.__CLASS__.'::client()');
\r
1065 if ( gettype($url) != 'string' ) {
\r
1066 phpCAS::error('type mismatched for parameter $url (should be
\r
1069 $PHPCAS_CLIENT->setServerLoginURL($url);
\r
1070 phpCAS::traceEnd();
\r
1074 * This method returns the URL to be used to login.
\r
1075 * or phpCAS::isAuthenticated().
\r
1077 * @return the login name of the authenticated user
\r
1079 function getServerLogoutURL()
\r
1081 global $PHPCAS_CLIENT;
\r
1082 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1083 phpCAS::error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
\r
1085 return $PHPCAS_CLIENT->getServerLogoutURL();
\r
1089 * Set the logout URL of the CAS server.
\r
1090 * @param $url the logout URL
\r
1091 * @since 0.4.21 by Wyman Chan
\r
1093 function setServerLogoutURL($url='')
\r
1095 global $PHPCAS_CLIENT;
\r
1096 phpCAS::traceBegin();
\r
1097 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1098 phpCAS::error('this method should only be called after
\r
1099 '.__CLASS__.'::client()');
\r
1101 if ( gettype($url) != 'string' ) {
\r
1102 phpCAS::error('type mismatched for parameter $url (should be
\r
1105 $PHPCAS_CLIENT->setServerLogoutURL($url);
\r
1106 phpCAS::traceEnd();
\r
1110 * This method is used to logout from CAS.
\r
1111 * @params $params an array that contains the optional url and service parameters that will be passed to the CAS server
\r
1114 function logout($params = "") {
\r
1115 global $PHPCAS_CLIENT;
\r
1116 phpCAS::traceBegin();
\r
1117 if (!is_object($PHPCAS_CLIENT)) {
\r
1118 phpCAS::error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
\r
1120 $parsedParams = array();
\r
1121 if ($params != "") {
\r
1122 if (is_string($params)) {
\r
1123 phpCAS::error('method `phpCAS::logout($url)\' is now deprecated, use `phpCAS::logoutWithUrl($url)\' instead');
\r
1125 if (!is_array($params)) {
\r
1126 phpCAS::error('type mismatched for parameter $params (should be `array\')');
\r
1128 foreach ($params as $key => $value) {
\r
1129 if ($key != "service" && $key != "url") {
\r
1130 phpCAS::error('only `url\' and `service\' parameters are allowed for method `phpCAS::logout($params)\'');
\r
1132 $parsedParams[$key] = $value;
\r
1135 $PHPCAS_CLIENT->logout($parsedParams);
\r
1137 phpCAS::traceEnd();
\r
1141 * This method is used to logout from CAS. Halts by redirecting to the CAS server.
\r
1142 * @param $service a URL that will be transmitted to the CAS server
\r
1144 function logoutWithRedirectService($service) {
\r
1145 global $PHPCAS_CLIENT;
\r
1146 phpCAS::traceBegin();
\r
1147 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1148 phpCAS::error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
\r
1150 if (!is_string($service)) {
\r
1151 phpCAS::error('type mismatched for parameter $service (should be `string\')');
\r
1153 $PHPCAS_CLIENT->logout(array("service" => $service));
\r
1155 phpCAS::traceEnd();
\r
1159 * This method is used to logout from CAS. Halts by redirecting to the CAS server.
\r
1160 * @param $url a URL that will be transmitted to the CAS server
\r
1162 function logoutWithUrl($url) {
\r
1163 global $PHPCAS_CLIENT;
\r
1164 phpCAS::traceBegin();
\r
1165 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1166 phpCAS::error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
\r
1168 if (!is_string($url)) {
\r
1169 phpCAS::error('type mismatched for parameter $url (should be `string\')');
\r
1171 $PHPCAS_CLIENT->logout(array("url" => $url));
\r
1173 phpCAS::traceEnd();
\r
1177 * This method is used to logout from CAS. Halts by redirecting to the CAS server.
\r
1178 * @param $service a URL that will be transmitted to the CAS server
\r
1179 * @param $url a URL that will be transmitted to the CAS server
\r
1181 function logoutWithRedirectServiceAndUrl($service, $url) {
\r
1182 global $PHPCAS_CLIENT;
\r
1183 phpCAS::traceBegin();
\r
1184 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1185 phpCAS::error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
\r
1187 if (!is_string($service)) {
\r
1188 phpCAS::error('type mismatched for parameter $service (should be `string\')');
\r
1190 if (!is_string($url)) {
\r
1191 phpCAS::error('type mismatched for parameter $url (should be `string\')');
\r
1193 $PHPCAS_CLIENT->logout(array("service" => $service, "url" => $url));
\r
1195 phpCAS::traceEnd();
\r
1199 * Set the fixed URL that will be used by the CAS server to transmit the PGT.
\r
1200 * When this method is not called, a phpCAS script uses its own URL for the callback.
\r
1202 * @param $url the URL
\r
1204 function setFixedCallbackURL($url='')
\r
1206 global $PHPCAS_CLIENT;
\r
1207 phpCAS::traceBegin();
\r
1208 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1209 phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
\r
1211 if ( !$PHPCAS_CLIENT->isProxy() ) {
\r
1212 phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
\r
1214 if ( gettype($url) != 'string' ) {
\r
1215 phpCAS::error('type mismatched for parameter $url (should be `string\')');
\r
1217 $PHPCAS_CLIENT->setCallbackURL($url);
\r
1218 phpCAS::traceEnd();
\r
1222 * Set the fixed URL that will be set as the CAS service parameter. When this
\r
1223 * method is not called, a phpCAS script uses its own URL.
\r
1225 * @param $url the URL
\r
1227 function setFixedServiceURL($url)
\r
1229 global $PHPCAS_CLIENT;
\r
1230 phpCAS::traceBegin();
\r
1231 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1232 phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
\r
1234 if ( gettype($url) != 'string' ) {
\r
1235 phpCAS::error('type mismatched for parameter $url (should be `string\')');
\r
1237 $PHPCAS_CLIENT->setURL($url);
\r
1238 phpCAS::traceEnd();
\r
1242 * Get the URL that is set as the CAS service parameter.
\r
1244 function getServiceURL()
\r
1246 global $PHPCAS_CLIENT;
\r
1247 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1248 phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
\r
1250 return($PHPCAS_CLIENT->getURL());
\r
1254 * Retrieve a Proxy Ticket from the CAS server.
\r
1256 function retrievePT($target_service,&$err_code,&$err_msg)
\r
1258 global $PHPCAS_CLIENT;
\r
1259 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1260 phpCAS::error('this method should only be called after '.__CLASS__.'::proxy()');
\r
1262 if ( gettype($target_service) != 'string' ) {
\r
1263 phpCAS::error('type mismatched for parameter $target_service(should be `string\')');
\r
1265 return($PHPCAS_CLIENT->retrievePT($target_service,$err_code,$err_msg));
\r
1269 * Set the certificate of the CAS server.
\r
1271 * @param $cert the PEM certificate
\r
1273 function setCasServerCert($cert)
\r
1275 global $PHPCAS_CLIENT;
\r
1276 phpCAS::traceBegin();
\r
1277 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1278 phpCAS::error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
\r
1280 if ( gettype($cert) != 'string' ) {
\r
1281 phpCAS::error('type mismatched for parameter $cert (should be `string\')');
\r
1283 $PHPCAS_CLIENT->setCasServerCert($cert);
\r
1284 phpCAS::traceEnd();
\r
1288 * Set the certificate of the CAS server CA.
\r
1290 * @param $cert the CA certificate
\r
1292 function setCasServerCACert($cert)
\r
1294 global $PHPCAS_CLIENT;
\r
1295 phpCAS::traceBegin();
\r
1296 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1297 phpCAS::error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
\r
1299 if ( gettype($cert) != 'string' ) {
\r
1300 phpCAS::error('type mismatched for parameter $cert (should be `string\')');
\r
1302 $PHPCAS_CLIENT->setCasServerCACert($cert);
\r
1303 phpCAS::traceEnd();
\r
1307 * Set no SSL validation for the CAS server.
\r
1309 function setNoCasServerValidation()
\r
1311 global $PHPCAS_CLIENT;
\r
1312 phpCAS::traceBegin();
\r
1313 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1314 phpCAS::error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
\r
1316 $PHPCAS_CLIENT->setNoCasServerValidation();
\r
1317 phpCAS::traceEnd();
\r
1323 * Change CURL options.
\r
1324 * CURL is used to connect through HTTPS to CAS server
\r
1325 * @param $key the option key
\r
1326 * @param $value the value to set
\r
1328 function setExtraCurlOption($key, $value)
\r
1330 global $PHPCAS_CLIENT;
\r
1331 phpCAS::traceBegin();
\r
1332 if ( !is_object($PHPCAS_CLIENT) ) {
\r
1333 phpCAS::error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
\r
1335 $PHPCAS_CLIENT->setExtraCurlOption($key, $value);
\r
1336 phpCAS::traceEnd();
\r
1341 // ########################################################################
\r
1343 // ########################################################################
\r
1345 // ########################################################################
\r
1351 * The following pages only show the source documentation.
\r
1355 // ########################################################################
\r
1356 // MODULES DEFINITION
\r
1358 /** @defgroup public User interface */
\r
1360 /** @defgroup publicInit Initialization
\r
1361 * @ingroup public */
\r
1363 /** @defgroup publicAuth Authentication
\r
1364 * @ingroup public */
\r
1366 /** @defgroup publicServices Access to external services
\r
1367 * @ingroup public */
\r
1369 /** @defgroup publicConfig Configuration
\r
1370 * @ingroup public */
\r
1372 /** @defgroup publicLang Internationalization
\r
1373 * @ingroup publicConfig */
\r
1375 /** @defgroup publicOutput HTML output
\r
1376 * @ingroup publicConfig */
\r
1378 /** @defgroup publicPGTStorage PGT storage
\r
1379 * @ingroup publicConfig */
\r
1381 /** @defgroup publicDebug Debugging
\r
1382 * @ingroup public */
\r
1385 /** @defgroup internal Implementation */
\r
1387 /** @defgroup internalAuthentication Authentication
\r
1388 * @ingroup internal */
\r
1390 /** @defgroup internalBasic CAS Basic client features (CAS 1.0, Service Tickets)
\r
1391 * @ingroup internal */
\r
1393 /** @defgroup internalProxy CAS Proxy features (CAS 2.0, Proxy Granting Tickets)
\r
1394 * @ingroup internal */
\r
1396 /** @defgroup internalPGTStorage PGT storage
\r
1397 * @ingroup internalProxy */
\r
1399 /** @defgroup internalPGTStorageDB PGT storage in a database
\r
1400 * @ingroup internalPGTStorage */
\r
1402 /** @defgroup internalPGTStorageFile PGT storage on the filesystem
\r
1403 * @ingroup internalPGTStorage */
\r
1405 /** @defgroup internalCallback Callback from the CAS server
\r
1406 * @ingroup internalProxy */
\r
1408 /** @defgroup internalProxied CAS proxied client features (CAS 2.0, Proxy Tickets)
\r
1409 * @ingroup internal */
\r
1411 /** @defgroup internalConfig Configuration
\r
1412 * @ingroup internal */
\r
1414 /** @defgroup internalOutput HTML output
\r
1415 * @ingroup internalConfig */
\r
1417 /** @defgroup internalLang Internationalization
\r
1418 * @ingroup internalConfig
\r
1420 * To add a new language:
\r
1421 * - 1. define a new constant PHPCAS_LANG_XXXXXX in CAS/CAS.php
\r
1422 * - 2. copy any file from CAS/languages to CAS/languages/XXXXXX.php
\r
1423 * - 3. Make the translations
\r
1426 /** @defgroup internalDebug Debugging
\r
1427 * @ingroup internal */
\r
1429 /** @defgroup internalMisc Miscellaneous
\r
1430 * @ingroup internal */
\r
1432 // ########################################################################
\r
1436 * @example example_simple.php
\r
1439 * @example example_proxy.php
\r
1442 * @example example_proxy2.php
\r
1445 * @example example_lang.php
\r
1448 * @example example_html.php
\r
1451 * @example example_file.php
\r
1454 * @example example_db.php
\r
1457 * @example example_service.php
\r
1460 * @example example_session_proxy.php
\r
1463 * @example example_session_service.php
\r
1466 * @example example_gateway.php
\r