@@ -10,7 +10,7 @@ |
||
| 10 | 10 | require_once api_get_path(SYS_PATH) . 'main/auth/external_login/functions.inc.php'; |
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | - * @return true if cas is configured |
|
| 13 | + * @return boolean if cas is configured |
|
| 14 | 14 | * |
| 15 | 15 | **/ |
| 16 | 16 | function cas_configured() |
@@ -5,9 +5,9 @@ discard block |
||
| 5 | 5 | * Gets all the info via the ldap module (ldap has to work) |
| 6 | 6 | |
| 7 | 7 | */ |
| 8 | -require_once api_get_path(SYS_PATH) . 'main/auth/cas/cas_var.inc.php'; |
|
| 9 | -require_once api_get_path(SYS_PATH) . 'main/auth/external_login/ldap.inc.php'; |
|
| 10 | -require_once api_get_path(SYS_PATH) . 'main/auth/external_login/functions.inc.php'; |
|
| 8 | +require_once api_get_path(SYS_PATH).'main/auth/cas/cas_var.inc.php'; |
|
| 9 | +require_once api_get_path(SYS_PATH).'main/auth/external_login/ldap.inc.php'; |
|
| 10 | +require_once api_get_path(SYS_PATH).'main/auth/external_login/functions.inc.php'; |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * @return true if cas is configured |
@@ -187,14 +187,14 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | function get_cas_direct_URL($in_course_code) |
| 189 | 189 | { |
| 190 | - return api_get_path(WEB_PATH) . 'main/auth/cas/logincas.php?firstpage=' . $in_course_code; |
|
| 190 | + return api_get_path(WEB_PATH).'main/auth/cas/logincas.php?firstpage='.$in_course_code; |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | function getCASLogoHTML() |
| 194 | 194 | { |
| 195 | 195 | $out_res = ""; |
| 196 | 196 | if (api_get_setting("casLogoURL") != "") { |
| 197 | - $out_res = "<img src='" . api_get_setting("casLogoURL") . "' alt='CAS Logo' />"; |
|
| 197 | + $out_res = "<img src='".api_get_setting("casLogoURL")."' alt='CAS Logo' />"; |
|
| 198 | 198 | } |
| 199 | 199 | return $out_res; |
| 200 | 200 | } |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | /** |
| 524 | 524 | * Logs a string in debug mode. |
| 525 | 525 | * |
| 526 | - * @param $str the string to write |
|
| 526 | + * @param string $str the string to write |
|
| 527 | 527 | * |
| 528 | 528 | * @private |
| 529 | 529 | */ |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | * This method is used by interface methods to print an error and where the function |
| 546 | 546 | * was originally called from. |
| 547 | 547 | * |
| 548 | - * @param $msg the message to print |
|
| 548 | + * @param string $msg the message to print |
|
| 549 | 549 | * |
| 550 | 550 | * @private |
| 551 | 551 | */ |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | /** |
| 679 | 679 | * This method returns the phpCAS version. |
| 680 | 680 | * |
| 681 | - * @return the phpCAS version. |
|
| 681 | + * @return string phpCAS version. |
|
| 682 | 682 | */ |
| 683 | 683 | function getVersion() |
| 684 | 684 | {
|
@@ -1105,7 +1105,7 @@ discard block |
||
| 1105 | 1105 | * @warning should not be called only after phpCAS::forceAuthentication() |
| 1106 | 1106 | * or phpCAS::checkAuthentication(). |
| 1107 | 1107 | * |
| 1108 | - * @return the login name of the authenticated user |
|
| 1108 | + * @return string login name of the authenticated user |
|
| 1109 | 1109 | */ |
| 1110 | 1110 | function getUser() |
| 1111 | 1111 | {
|
@@ -33,14 +33,14 @@ discard block |
||
| 33 | 33 | // hack by Vangelis Haniotakis to handle the absence of $_SERVER['REQUEST_URI'] in IIS |
| 34 | 34 | // |
| 35 | 35 | if (!$_SERVER['REQUEST_URI']) {
|
| 36 | - $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING']; |
|
| 36 | + $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING']; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // |
| 40 | 40 | // another one by Vangelis Haniotakis also to make phpCAS work with PHP5 |
| 41 | 41 | // |
| 42 | 42 | if (version_compare(PHP_VERSION, '5', '>=')) {
|
| 43 | - require_once(dirname(__FILE__) . '/CAS/domxml-php4-to-php5.php'); |
|
| 43 | + require_once(dirname(__FILE__).'/CAS/domxml-php4-to-php5.php'); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | // ######################################################################## |
| 323 | 323 | |
| 324 | 324 | // include client class |
| 325 | -include_once(dirname(__FILE__) . '/CAS/client.php'); |
|
| 325 | +include_once(dirname(__FILE__).'/CAS/client.php'); |
|
| 326 | 326 | |
| 327 | 327 | // ######################################################################## |
| 328 | 328 | // INTERFACE CLASS |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | |
| 372 | 372 | phpCAS:: traceBegin(); |
| 373 | 373 | if (is_object($PHPCAS_CLIENT)) {
|
| 374 | - phpCAS:: error($PHPCAS_INIT_CALL['method'] . '() has already been called (at ' . $PHPCAS_INIT_CALL['file'] . ':' . $PHPCAS_INIT_CALL['line'] . ')'); |
|
| 374 | + phpCAS:: error($PHPCAS_INIT_CALL['method'].'() has already been called (at '.$PHPCAS_INIT_CALL['file'].':'.$PHPCAS_INIT_CALL['line'].')'); |
|
| 375 | 375 | } |
| 376 | 376 | if (gettype($server_version) != 'string') {
|
| 377 | 377 | phpCAS:: error('type mismatched for parameter $server_version (should be `string\')');
|
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | 'done' => true, |
| 393 | 393 | 'file' => $dbg[0]['file'], |
| 394 | 394 | 'line' => $dbg[0]['line'], |
| 395 | - 'method' => __CLASS__ . '::' . __FUNCTION__ |
|
| 395 | + 'method' => __CLASS__.'::'.__FUNCTION__ |
|
| 396 | 396 | ); |
| 397 | 397 | |
| 398 | 398 | // initialize the global object $PHPCAS_CLIENT |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | |
| 422 | 422 | phpCAS:: traceBegin(); |
| 423 | 423 | if (is_object($PHPCAS_CLIENT)) {
|
| 424 | - phpCAS:: error($PHPCAS_INIT_CALL['method'] . '() has already been called (at ' . $PHPCAS_INIT_CALL['file'] . ':' . $PHPCAS_INIT_CALL['line'] . ')'); |
|
| 424 | + phpCAS:: error($PHPCAS_INIT_CALL['method'].'() has already been called (at '.$PHPCAS_INIT_CALL['file'].':'.$PHPCAS_INIT_CALL['line'].')'); |
|
| 425 | 425 | } |
| 426 | 426 | if (gettype($server_version) != 'string') {
|
| 427 | 427 | phpCAS:: error('type mismatched for parameter $server_version (should be `string\')');
|
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | 'done' => true, |
| 443 | 443 | 'file' => $dbg[0]['file'], |
| 444 | 444 | 'line' => $dbg[0]['line'], |
| 445 | - 'method' => __CLASS__ . '::' . __FUNCTION__ |
|
| 445 | + 'method' => __CLASS__.'::'.__FUNCTION__ |
|
| 446 | 446 | ); |
| 447 | 447 | |
| 448 | 448 | // initialize the global object $PHPCAS_CLIENT |
@@ -477,10 +477,10 @@ discard block |
||
| 477 | 477 | if (empty ($filename)) {
|
| 478 | 478 | if (preg_match('/^Win.*/', getenv('OS'))) {
|
| 479 | 479 | if (isset ($_ENV['TMP'])) {
|
| 480 | - $debugDir = $_ENV['TMP'] . '/'; |
|
| 480 | + $debugDir = $_ENV['TMP'].'/'; |
|
| 481 | 481 | } else {
|
| 482 | 482 | if (isset ($_ENV['TEMP'])) {
|
| 483 | - $debugDir = $_ENV['TEMP'] . '/'; |
|
| 483 | + $debugDir = $_ENV['TEMP'].'/'; |
|
| 484 | 484 | } else {
|
| 485 | 485 | $debugDir = ''; |
| 486 | 486 | } |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | } else {
|
| 489 | 489 | $debugDir = DEFAULT_DEBUG_DIR; |
| 490 | 490 | } |
| 491 | - $filename = $debugDir . 'phpCAS.log'; |
|
| 491 | + $filename = $debugDir.'phpCAS.log'; |
|
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | if (empty ($PHPCAS_DEBUG['unique_id'])) {
|
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | for ($i = 0; $i < $PHPCAS_DEBUG['indent']; $i++) {
|
| 537 | 537 | $indent_str .= '| '; |
| 538 | 538 | } |
| 539 | - error_log($PHPCAS_DEBUG['unique_id'] . ' ' . $indent_str . $str . "\n", 3, $PHPCAS_DEBUG['filename']); |
|
| 539 | + error_log($PHPCAS_DEBUG['unique_id'].' '.$indent_str.$str."\n", 3, $PHPCAS_DEBUG['filename']); |
|
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | } |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | } |
| 567 | 567 | } |
| 568 | 568 | } |
| 569 | - 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"; |
|
| 569 | + 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"; |
|
| 570 | 570 | phpCAS:: trace($msg); |
| 571 | 571 | phpCAS:: traceExit(); |
| 572 | 572 | exit (); |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | function trace($str) |
| 579 | 579 | {
|
| 580 | 580 | $dbg = phpCAS:: backtrace(); |
| 581 | - phpCAS:: log($str . ' [' . basename($dbg[1]['file']) . ':' . $dbg[1]['line'] . ']'); |
|
| 581 | + phpCAS:: log($str.' ['.basename($dbg[1]['file']).':'.$dbg[1]['line'].']'); |
|
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | /** |
@@ -591,9 +591,9 @@ discard block |
||
| 591 | 591 | $dbg = phpCAS:: backtrace(); |
| 592 | 592 | $str = '=> '; |
| 593 | 593 | if (!empty ($dbg[2]['class'])) {
|
| 594 | - $str .= $dbg[2]['class'] . '::'; |
|
| 594 | + $str .= $dbg[2]['class'].'::'; |
|
| 595 | 595 | } |
| 596 | - $str .= $dbg[2]['function'] . '(';
|
|
| 596 | + $str .= $dbg[2]['function'].'(';
|
|
| 597 | 597 | if (is_array($dbg[2]['args'])) {
|
| 598 | 598 | foreach ($dbg[2]['args'] as $index => $arg) {
|
| 599 | 599 | if ($index != 0) {
|
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | $str .= str_replace("\n", "", var_export($arg, true));
|
| 603 | 603 | } |
| 604 | 604 | } |
| 605 | - $str .= ') [' . basename($dbg[2]['file']) . ':' . $dbg[2]['line'] . ']'; |
|
| 605 | + $str .= ') ['.basename($dbg[2]['file']).':'.$dbg[2]['line'].']'; |
|
| 606 | 606 | phpCAS:: log($str); |
| 607 | 607 | $PHPCAS_DEBUG['indent']++; |
| 608 | 608 | } |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | $PHPCAS_DEBUG['indent']--; |
| 620 | 620 | $dbg = phpCAS:: backtrace(); |
| 621 | 621 | $str = ''; |
| 622 | - $str .= '<= ' . str_replace("\n", "", var_export($res, true));
|
|
| 622 | + $str .= '<= '.str_replace("\n", "", var_export($res, true));
|
|
| 623 | 623 | phpCAS:: log($str); |
| 624 | 624 | } |
| 625 | 625 | |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | {
|
| 659 | 659 | global $PHPCAS_CLIENT; |
| 660 | 660 | if (!is_object($PHPCAS_CLIENT)) {
|
| 661 | - phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
|
| 661 | + phpCAS:: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
|
|
| 662 | 662 | } |
| 663 | 663 | if (gettype($lang) != 'string') {
|
| 664 | 664 | phpCAS:: error('type mismatched for parameter $lang (should be `string\')');
|
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | {
|
| 704 | 704 | global $PHPCAS_CLIENT; |
| 705 | 705 | if (!is_object($PHPCAS_CLIENT)) {
|
| 706 | - phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
|
| 706 | + phpCAS:: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
|
|
| 707 | 707 | } |
| 708 | 708 | if (gettype($header) != 'string') {
|
| 709 | 709 | phpCAS:: error('type mismatched for parameter $header (should be `string\')');
|
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | {
|
| 721 | 721 | global $PHPCAS_CLIENT; |
| 722 | 722 | if (!is_object($PHPCAS_CLIENT)) {
|
| 723 | - phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
|
| 723 | + phpCAS:: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
|
|
| 724 | 724 | } |
| 725 | 725 | if (gettype($footer) != 'string') {
|
| 726 | 726 | phpCAS:: error('type mismatched for parameter $footer (should be `string\')');
|
@@ -750,13 +750,13 @@ discard block |
||
| 750 | 750 | |
| 751 | 751 | phpCAS:: traceBegin(); |
| 752 | 752 | if (!is_object($PHPCAS_CLIENT)) {
|
| 753 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::proxy()');
|
|
| 753 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::proxy()');
|
|
| 754 | 754 | } |
| 755 | 755 | if (!$PHPCAS_CLIENT->isProxy()) {
|
| 756 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::proxy()');
|
|
| 756 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::proxy()');
|
|
| 757 | 757 | } |
| 758 | 758 | if ($PHPCAS_AUTH_CHECK_CALL['done']) {
|
| 759 | - 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'] . ')');
|
|
| 759 | + 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'].')');
|
|
| 760 | 760 | } |
| 761 | 761 | if (gettype($format) != 'string') {
|
| 762 | 762 | phpCAS:: error('type mismatched for parameter $format (should be `string\')');
|
@@ -796,13 +796,13 @@ discard block |
||
| 796 | 796 | |
| 797 | 797 | phpCAS:: traceBegin(); |
| 798 | 798 | if (!is_object($PHPCAS_CLIENT)) {
|
| 799 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::proxy()');
|
|
| 799 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::proxy()');
|
|
| 800 | 800 | } |
| 801 | 801 | if (!$PHPCAS_CLIENT->isProxy()) {
|
| 802 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::proxy()');
|
|
| 802 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::proxy()');
|
|
| 803 | 803 | } |
| 804 | 804 | if ($PHPCAS_AUTH_CHECK_CALL['done']) {
|
| 805 | - 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'] . ')');
|
|
| 805 | + 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'].')');
|
|
| 806 | 806 | } |
| 807 | 807 | if (gettype($user) != 'string') {
|
| 808 | 808 | phpCAS:: error('type mismatched for parameter $user (should be `string\')');
|
@@ -857,16 +857,16 @@ discard block |
||
| 857 | 857 | |
| 858 | 858 | phpCAS:: traceBegin(); |
| 859 | 859 | if (!is_object($PHPCAS_CLIENT)) {
|
| 860 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::proxy()');
|
|
| 860 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::proxy()');
|
|
| 861 | 861 | } |
| 862 | 862 | if (!$PHPCAS_CLIENT->isProxy()) {
|
| 863 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::proxy()');
|
|
| 863 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::proxy()');
|
|
| 864 | 864 | } |
| 865 | 865 | if (!$PHPCAS_AUTH_CHECK_CALL['done']) {
|
| 866 | - 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()');
|
|
| 866 | + 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()');
|
|
| 867 | 867 | } |
| 868 | 868 | if (!$PHPCAS_AUTH_CHECK_CALL['result']) {
|
| 869 | - 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');
|
|
| 869 | + 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');
|
|
| 870 | 870 | } |
| 871 | 871 | if (gettype($url) != 'string') {
|
| 872 | 872 | phpCAS:: error('type mismatched for parameter $url (should be `string\')');
|
@@ -901,16 +901,16 @@ discard block |
||
| 901 | 901 | |
| 902 | 902 | phpCAS:: traceBegin(); |
| 903 | 903 | if (!is_object($PHPCAS_CLIENT)) {
|
| 904 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::proxy()');
|
|
| 904 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::proxy()');
|
|
| 905 | 905 | } |
| 906 | 906 | if (!$PHPCAS_CLIENT->isProxy()) {
|
| 907 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::proxy()');
|
|
| 907 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::proxy()');
|
|
| 908 | 908 | } |
| 909 | 909 | if (!$PHPCAS_AUTH_CHECK_CALL['done']) {
|
| 910 | - 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()');
|
|
| 910 | + 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()');
|
|
| 911 | 911 | } |
| 912 | 912 | if (!$PHPCAS_AUTH_CHECK_CALL['result']) {
|
| 913 | - 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');
|
|
| 913 | + 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');
|
|
| 914 | 914 | } |
| 915 | 915 | if (gettype($url) != 'string') {
|
| 916 | 916 | phpCAS:: error('type mismatched for parameter $url (should be `string\')');
|
@@ -947,7 +947,7 @@ discard block |
||
| 947 | 947 | {
|
| 948 | 948 | global $PHPCAS_CLIENT; |
| 949 | 949 | if (!is_object($PHPCAS_CLIENT)) {
|
| 950 | - phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
|
| 950 | + phpCAS:: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
|
|
| 951 | 951 | } |
| 952 | 952 | if (gettype($n) != 'integer') {
|
| 953 | 953 | phpCAS:: error('type mismatched for parameter $header (should be `string\')');
|
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | |
| 966 | 966 | phpCAS:: traceBegin(); |
| 967 | 967 | if (!is_object($PHPCAS_CLIENT)) {
|
| 968 | - phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
|
| 968 | + phpCAS:: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
|
|
| 969 | 969 | } |
| 970 | 970 | |
| 971 | 971 | $auth = $PHPCAS_CLIENT->checkAuthentication(); |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | 'done' => true, |
| 977 | 977 | 'file' => $dbg[0]['file'], |
| 978 | 978 | 'line' => $dbg[0]['line'], |
| 979 | - 'method' => __CLASS__ . '::' . __FUNCTION__, |
|
| 979 | + 'method' => __CLASS__.'::'.__FUNCTION__, |
|
| 980 | 980 | 'result' => $auth |
| 981 | 981 | ); |
| 982 | 982 | phpCAS:: traceEnd($auth); |
@@ -994,7 +994,7 @@ discard block |
||
| 994 | 994 | |
| 995 | 995 | phpCAS:: traceBegin(); |
| 996 | 996 | if (!is_object($PHPCAS_CLIENT)) {
|
| 997 | - phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
|
| 997 | + phpCAS:: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
|
|
| 998 | 998 | } |
| 999 | 999 | |
| 1000 | 1000 | $auth = $PHPCAS_CLIENT->forceAuthentication(); |
@@ -1005,7 +1005,7 @@ discard block |
||
| 1005 | 1005 | 'done' => true, |
| 1006 | 1006 | 'file' => $dbg[0]['file'], |
| 1007 | 1007 | 'line' => $dbg[0]['line'], |
| 1008 | - 'method' => __CLASS__ . '::' . __FUNCTION__, |
|
| 1008 | + 'method' => __CLASS__.'::'.__FUNCTION__, |
|
| 1009 | 1009 | 'result' => $auth |
| 1010 | 1010 | ); |
| 1011 | 1011 | |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | phpCAS:: trace('user is not authenticated, redirecting to the CAS server');
|
| 1014 | 1014 | $PHPCAS_CLIENT->forceAuthentication(); |
| 1015 | 1015 | } else {
|
| 1016 | - phpCAS:: trace('no need to authenticate (user `' . phpCAS:: getUser() . '\' is already authenticated)');
|
|
| 1016 | + phpCAS:: trace('no need to authenticate (user `'.phpCAS:: getUser().'\' is already authenticated)');
|
|
| 1017 | 1017 | } |
| 1018 | 1018 | |
| 1019 | 1019 | phpCAS:: traceEnd(); |
@@ -1029,7 +1029,7 @@ discard block |
||
| 1029 | 1029 | |
| 1030 | 1030 | phpCAS:: traceBegin(); |
| 1031 | 1031 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1032 | - phpCAS:: error('this method should not be called before' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
|
| 1032 | + phpCAS:: error('this method should not be called before'.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
|
|
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | 1035 | // store where the authentication has been checked and the result |
@@ -1038,7 +1038,7 @@ discard block |
||
| 1038 | 1038 | 'done' => true, |
| 1039 | 1039 | 'file' => $dbg[0]['file'], |
| 1040 | 1040 | 'line' => $dbg[0]['line'], |
| 1041 | - 'method' => __CLASS__ . '::' . __FUNCTION__, |
|
| 1041 | + 'method' => __CLASS__.'::'.__FUNCTION__, |
|
| 1042 | 1042 | 'result' => $auth |
| 1043 | 1043 | ); |
| 1044 | 1044 | |
@@ -1051,7 +1051,7 @@ discard block |
||
| 1051 | 1051 | */ |
| 1052 | 1052 | function authenticate() |
| 1053 | 1053 | {
|
| 1054 | - phpCAS:: error('this method is deprecated. You should use ' . __CLASS__ . '::forceAuthentication() instead');
|
|
| 1054 | + phpCAS:: error('this method is deprecated. You should use '.__CLASS__.'::forceAuthentication() instead');
|
|
| 1055 | 1055 | } |
| 1056 | 1056 | |
| 1057 | 1057 | /** |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | |
| 1067 | 1067 | phpCAS:: traceBegin(); |
| 1068 | 1068 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1069 | - phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
|
| 1069 | + phpCAS:: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
|
|
| 1070 | 1070 | } |
| 1071 | 1071 | |
| 1072 | 1072 | // call the isAuthenticated method of the global $PHPCAS_CLIENT object |
@@ -1078,7 +1078,7 @@ discard block |
||
| 1078 | 1078 | 'done' => true, |
| 1079 | 1079 | 'file' => $dbg[0]['file'], |
| 1080 | 1080 | 'line' => $dbg[0]['line'], |
| 1081 | - 'method' => __CLASS__ . '::' . __FUNCTION__, |
|
| 1081 | + 'method' => __CLASS__.'::'.__FUNCTION__, |
|
| 1082 | 1082 | 'result' => $auth |
| 1083 | 1083 | ); |
| 1084 | 1084 | phpCAS:: traceEnd($auth); |
@@ -1095,7 +1095,7 @@ discard block |
||
| 1095 | 1095 | {
|
| 1096 | 1096 | global $PHPCAS_CLIENT; |
| 1097 | 1097 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1098 | - phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
|
| 1098 | + phpCAS:: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
|
|
| 1099 | 1099 | } |
| 1100 | 1100 | return ($PHPCAS_CLIENT->isSessionAuthenticated()); |
| 1101 | 1101 | } |
@@ -1111,13 +1111,13 @@ discard block |
||
| 1111 | 1111 | {
|
| 1112 | 1112 | global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL; |
| 1113 | 1113 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1114 | - phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
|
| 1114 | + phpCAS:: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
|
|
| 1115 | 1115 | } |
| 1116 | 1116 | if (!$PHPCAS_AUTH_CHECK_CALL['done']) {
|
| 1117 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()');
|
|
| 1117 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::forceAuthentication() or '.__CLASS__.'::isAuthenticated()');
|
|
| 1118 | 1118 | } |
| 1119 | 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');
|
|
| 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 | 1121 | } |
| 1122 | 1122 | return $PHPCAS_CLIENT->getUser(); |
| 1123 | 1123 | } |
@@ -1133,13 +1133,13 @@ discard block |
||
| 1133 | 1133 | {
|
| 1134 | 1134 | global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL; |
| 1135 | 1135 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1136 | - phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
|
| 1136 | + phpCAS:: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
|
|
| 1137 | 1137 | } |
| 1138 | 1138 | if (!$PHPCAS_AUTH_CHECK_CALL['done']) {
|
| 1139 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()');
|
|
| 1139 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::forceAuthentication() or '.__CLASS__.'::isAuthenticated()');
|
|
| 1140 | 1140 | } |
| 1141 | 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');
|
|
| 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 | 1143 | } |
| 1144 | 1144 | return $PHPCAS_CLIENT->getAttributes(); |
| 1145 | 1145 | } |
@@ -1151,7 +1151,7 @@ discard block |
||
| 1151 | 1151 | {
|
| 1152 | 1152 | global $PHPCAS_CLIENT; |
| 1153 | 1153 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1154 | - phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
|
| 1154 | + phpCAS:: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
|
|
| 1155 | 1155 | } |
| 1156 | 1156 | return ($PHPCAS_CLIENT->handleLogoutRequests($check_client, $allowed_clients)); |
| 1157 | 1157 | } |
@@ -1166,7 +1166,7 @@ discard block |
||
| 1166 | 1166 | {
|
| 1167 | 1167 | global $PHPCAS_CLIENT; |
| 1168 | 1168 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1169 | - phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
|
| 1169 | + phpCAS:: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
|
|
| 1170 | 1170 | } |
| 1171 | 1171 | return $PHPCAS_CLIENT->getServerLoginURL(); |
| 1172 | 1172 | } |
@@ -1182,7 +1182,7 @@ discard block |
||
| 1182 | 1182 | phpCAS:: traceBegin(); |
| 1183 | 1183 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1184 | 1184 | phpCAS:: error('this method should only be called after
|
| 1185 | - ' . __CLASS__ . '::client()'); |
|
| 1185 | + ' . __CLASS__.'::client()'); |
|
| 1186 | 1186 | } |
| 1187 | 1187 | if (gettype($url) != 'string') {
|
| 1188 | 1188 | phpCAS:: error('type mismatched for parameter $url (should be
|
@@ -1204,7 +1204,7 @@ discard block |
||
| 1204 | 1204 | phpCAS:: traceBegin(); |
| 1205 | 1205 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1206 | 1206 | phpCAS:: error('this method should only be called after
|
| 1207 | - ' . __CLASS__ . '::client()'); |
|
| 1207 | + ' . __CLASS__.'::client()'); |
|
| 1208 | 1208 | } |
| 1209 | 1209 | if (gettype($url) != 'string') {
|
| 1210 | 1210 | phpCAS:: error('type mismatched for parameter $url (should be
|
@@ -1226,7 +1226,7 @@ discard block |
||
| 1226 | 1226 | phpCAS:: traceBegin(); |
| 1227 | 1227 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1228 | 1228 | phpCAS:: error('this method should only be called after
|
| 1229 | - ' . __CLASS__ . '::client()'); |
|
| 1229 | + ' . __CLASS__.'::client()'); |
|
| 1230 | 1230 | } |
| 1231 | 1231 | if (gettype($url) != 'string') {
|
| 1232 | 1232 | phpCAS:: error('type mismatched for parameter $url (should be
|
@@ -1247,7 +1247,7 @@ discard block |
||
| 1247 | 1247 | phpCAS:: traceBegin(); |
| 1248 | 1248 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1249 | 1249 | phpCAS:: error('this method should only be called after
|
| 1250 | - ' . __CLASS__ . '::client()'); |
|
| 1250 | + ' . __CLASS__.'::client()'); |
|
| 1251 | 1251 | } |
| 1252 | 1252 | if (gettype($url) != 'string') {
|
| 1253 | 1253 | phpCAS:: error('type mismatched for parameter $url (should be
|
@@ -1267,7 +1267,7 @@ discard block |
||
| 1267 | 1267 | {
|
| 1268 | 1268 | global $PHPCAS_CLIENT; |
| 1269 | 1269 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1270 | - phpCAS:: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
|
|
| 1270 | + phpCAS:: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
|
|
| 1271 | 1271 | } |
| 1272 | 1272 | return $PHPCAS_CLIENT->getServerLogoutURL(); |
| 1273 | 1273 | } |
@@ -1283,7 +1283,7 @@ discard block |
||
| 1283 | 1283 | phpCAS:: traceBegin(); |
| 1284 | 1284 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1285 | 1285 | phpCAS:: error('this method should only be called after
|
| 1286 | - ' . __CLASS__ . '::client()'); |
|
| 1286 | + ' . __CLASS__.'::client()'); |
|
| 1287 | 1287 | } |
| 1288 | 1288 | if (gettype($url) != 'string') {
|
| 1289 | 1289 | phpCAS:: error('type mismatched for parameter $url (should be
|
@@ -1303,7 +1303,7 @@ discard block |
||
| 1303 | 1303 | global $PHPCAS_CLIENT; |
| 1304 | 1304 | phpCAS:: traceBegin(); |
| 1305 | 1305 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1306 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
|
|
| 1306 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
|
|
| 1307 | 1307 | } |
| 1308 | 1308 | $parsedParams = array(); |
| 1309 | 1309 | if ($params != "") {
|
@@ -1334,7 +1334,7 @@ discard block |
||
| 1334 | 1334 | global $PHPCAS_CLIENT; |
| 1335 | 1335 | phpCAS:: traceBegin(); |
| 1336 | 1336 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1337 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
|
|
| 1337 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
|
|
| 1338 | 1338 | } |
| 1339 | 1339 | if (!is_string($service)) {
|
| 1340 | 1340 | phpCAS:: error('type mismatched for parameter $service (should be `string\')');
|
@@ -1355,7 +1355,7 @@ discard block |
||
| 1355 | 1355 | global $PHPCAS_CLIENT; |
| 1356 | 1356 | phpCAS:: traceBegin(); |
| 1357 | 1357 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1358 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
|
|
| 1358 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
|
|
| 1359 | 1359 | } |
| 1360 | 1360 | if (!is_string($url)) {
|
| 1361 | 1361 | phpCAS:: error('type mismatched for parameter $url (should be `string\')');
|
@@ -1377,7 +1377,7 @@ discard block |
||
| 1377 | 1377 | global $PHPCAS_CLIENT; |
| 1378 | 1378 | phpCAS:: traceBegin(); |
| 1379 | 1379 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1380 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
|
|
| 1380 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
|
|
| 1381 | 1381 | } |
| 1382 | 1382 | if (!is_string($service)) {
|
| 1383 | 1383 | phpCAS:: error('type mismatched for parameter $service (should be `string\')');
|
@@ -1404,10 +1404,10 @@ discard block |
||
| 1404 | 1404 | global $PHPCAS_CLIENT; |
| 1405 | 1405 | phpCAS:: traceBegin(); |
| 1406 | 1406 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1407 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::proxy()');
|
|
| 1407 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::proxy()');
|
|
| 1408 | 1408 | } |
| 1409 | 1409 | if (!$PHPCAS_CLIENT->isProxy()) {
|
| 1410 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::proxy()');
|
|
| 1410 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::proxy()');
|
|
| 1411 | 1411 | } |
| 1412 | 1412 | if (gettype($url) != 'string') {
|
| 1413 | 1413 | phpCAS:: error('type mismatched for parameter $url (should be `string\')');
|
@@ -1427,7 +1427,7 @@ discard block |
||
| 1427 | 1427 | global $PHPCAS_CLIENT; |
| 1428 | 1428 | phpCAS:: traceBegin(); |
| 1429 | 1429 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1430 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::proxy()');
|
|
| 1430 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::proxy()');
|
|
| 1431 | 1431 | } |
| 1432 | 1432 | if (gettype($url) != 'string') {
|
| 1433 | 1433 | phpCAS:: error('type mismatched for parameter $url (should be `string\')');
|
@@ -1443,7 +1443,7 @@ discard block |
||
| 1443 | 1443 | {
|
| 1444 | 1444 | global $PHPCAS_CLIENT; |
| 1445 | 1445 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1446 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::proxy()');
|
|
| 1446 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::proxy()');
|
|
| 1447 | 1447 | } |
| 1448 | 1448 | return ($PHPCAS_CLIENT->getURL()); |
| 1449 | 1449 | } |
@@ -1455,7 +1455,7 @@ discard block |
||
| 1455 | 1455 | {
|
| 1456 | 1456 | global $PHPCAS_CLIENT; |
| 1457 | 1457 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1458 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::proxy()');
|
|
| 1458 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::proxy()');
|
|
| 1459 | 1459 | } |
| 1460 | 1460 | if (gettype($target_service) != 'string') {
|
| 1461 | 1461 | phpCAS:: error('type mismatched for parameter $target_service(should be `string\')');
|
@@ -1473,7 +1473,7 @@ discard block |
||
| 1473 | 1473 | global $PHPCAS_CLIENT; |
| 1474 | 1474 | phpCAS:: traceBegin(); |
| 1475 | 1475 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1476 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
|
|
| 1476 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
|
|
| 1477 | 1477 | } |
| 1478 | 1478 | if (gettype($cert) != 'string') {
|
| 1479 | 1479 | phpCAS:: error('type mismatched for parameter $cert (should be `string\')');
|
@@ -1492,7 +1492,7 @@ discard block |
||
| 1492 | 1492 | global $PHPCAS_CLIENT; |
| 1493 | 1493 | phpCAS:: traceBegin(); |
| 1494 | 1494 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1495 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
|
|
| 1495 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
|
|
| 1496 | 1496 | } |
| 1497 | 1497 | if (gettype($cert) != 'string') {
|
| 1498 | 1498 | phpCAS:: error('type mismatched for parameter $cert (should be `string\')');
|
@@ -1509,7 +1509,7 @@ discard block |
||
| 1509 | 1509 | global $PHPCAS_CLIENT; |
| 1510 | 1510 | phpCAS:: traceBegin(); |
| 1511 | 1511 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1512 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
|
|
| 1512 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
|
|
| 1513 | 1513 | } |
| 1514 | 1514 | $PHPCAS_CLIENT->setNoCasServerValidation(); |
| 1515 | 1515 | phpCAS:: traceEnd(); |
@@ -1528,7 +1528,7 @@ discard block |
||
| 1528 | 1528 | global $PHPCAS_CLIENT; |
| 1529 | 1529 | phpCAS:: traceBegin(); |
| 1530 | 1530 | if (!is_object($PHPCAS_CLIENT)) {
|
| 1531 | - phpCAS:: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
|
|
| 1531 | + phpCAS:: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
|
|
| 1532 | 1532 | } |
| 1533 | 1533 | $PHPCAS_CLIENT->setExtraCurlOption($key, $value); |
| 1534 | 1534 | phpCAS:: traceEnd(); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * |
| 74 | 74 | * Used by CASClient::PrintHTMLHeader() and CASClient::printHTMLFooter(). |
| 75 | 75 | * |
| 76 | - * @param $str the string to filter and output |
|
| 76 | + * @param string $str the string to filter and output |
|
| 77 | 77 | * |
| 78 | 78 | * @private |
| 79 | 79 | */ |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | /** |
| 186 | 186 | * This method returns the language used by phpCAS. |
| 187 | 187 | * |
| 188 | - * @return a string representing the language |
|
| 188 | + * @return string string representing the language |
|
| 189 | 189 | * |
| 190 | 190 | * @private |
| 191 | 191 | */ |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | /** |
| 212 | 212 | * This method returns a string depending on the language. |
| 213 | 213 | * |
| 214 | - * @param $str the index of the string in $_string. |
|
| 214 | + * @param integer $str the index of the string in $_string. |
|
| 215 | 215 | * |
| 216 | 216 | * @return the string corresponding to $index in $string. |
| 217 | 217 | * |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | * This method is used to set the language used by phpCAS. |
| 233 | 233 | * @note Can be called only once. |
| 234 | 234 | * |
| 235 | - * @param $lang a string representing the language. |
|
| 235 | + * @param string $lang a string representing the language. |
|
| 236 | 236 | * |
| 237 | 237 | * @public |
| 238 | 238 | * @sa CAS_LANG_FRENCH, CAS_LANG_ENGLISH |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | |
| 427 | 427 | /** |
| 428 | 428 | * This method is used to retrieve the service validating URL of the CAS server. |
| 429 | - * @return a URL. |
|
| 429 | + * @return string URL. |
|
| 430 | 430 | * @private |
| 431 | 431 | */ |
| 432 | 432 | function getServerServiceValidateURL() |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | |
| 449 | 449 | /** |
| 450 | 450 | * This method is used to retrieve the SAML validating URL of the CAS server. |
| 451 | - * @return a URL. |
|
| 451 | + * @return string URL. |
|
| 452 | 452 | * @private |
| 453 | 453 | */ |
| 454 | 454 | function getServerSamlValidateURL() |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | |
| 469 | 469 | /** |
| 470 | 470 | * This method is used to retrieve the proxy validating URL of the CAS server. |
| 471 | - * @return a URL. |
|
| 471 | + * @return string URL. |
|
| 472 | 472 | * @private |
| 473 | 473 | */ |
| 474 | 474 | function getServerProxyValidateURL() |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | |
| 550 | 550 | /** |
| 551 | 551 | * This method checks to see if the request is secured via HTTPS |
| 552 | - * @return true if https, false otherwise |
|
| 552 | + * @return boolean if https, false otherwise |
|
| 553 | 553 | * @private |
| 554 | 554 | */ |
| 555 | 555 | function isHttps() |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | * CASClient constructor. |
| 571 | 571 | * |
| 572 | 572 | * @param $server_version the version of the CAS server |
| 573 | - * @param $proxy TRUE if the CAS client is a CAS proxy, FALSE otherwise |
|
| 573 | + * @param boolean $proxy TRUE if the CAS client is a CAS proxy, FALSE otherwise |
|
| 574 | 574 | * @param $server_hostname the hostname of the CAS server |
| 575 | 575 | * @param $server_port the port the CAS server is running on |
| 576 | 576 | * @param $server_uri the URI the CAS server is responding on |
@@ -778,7 +778,7 @@ discard block |
||
| 778 | 778 | * @warning should be called only after CASClient::forceAuthentication() or |
| 779 | 779 | * CASClient::isAuthenticated(), otherwise halt with an error. |
| 780 | 780 | * |
| 781 | - * @return the login name of the authenticated user |
|
| 781 | + * @return string login name of the authenticated user |
|
| 782 | 782 | */ |
| 783 | 783 | function getUser() |
| 784 | 784 | { |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | /** |
| 861 | 861 | * This method is called to be sure that the user is authenticated. When not |
| 862 | 862 | * authenticated, halt by redirecting to the CAS server; otherwise return TRUE. |
| 863 | - * @return TRUE when the user is authenticated; otherwise halt. |
|
| 863 | + * @return boolean when the user is authenticated; otherwise halt. |
|
| 864 | 864 | * @public |
| 865 | 865 | */ |
| 866 | 866 | function forceAuthentication() |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | |
| 907 | 907 | /** |
| 908 | 908 | * This method is called to check whether the user is authenticated or not. |
| 909 | - * @return TRUE when the user is authenticated, FALSE otherwise. |
|
| 909 | + * @return boolean when the user is authenticated, FALSE otherwise. |
|
| 910 | 910 | * @public |
| 911 | 911 | */ |
| 912 | 912 | function checkAuthentication() |
@@ -960,7 +960,7 @@ discard block |
||
| 960 | 960 | * This method is called to check if the user is authenticated (previously or by |
| 961 | 961 | * tickets given in the URL). |
| 962 | 962 | * |
| 963 | - * @return TRUE when the user is authenticated. Also may redirect to the same URL without the ticket. |
|
| 963 | + * @return boolean when the user is authenticated. Also may redirect to the same URL without the ticket. |
|
| 964 | 964 | * |
| 965 | 965 | * @public |
| 966 | 966 | */ |
@@ -1026,7 +1026,7 @@ discard block |
||
| 1026 | 1026 | |
| 1027 | 1027 | /** |
| 1028 | 1028 | * This method tells if the current session is authenticated. |
| 1029 | - * @return true if authenticated based soley on $_SESSION variable |
|
| 1029 | + * @return boolean if authenticated based soley on $_SESSION variable |
|
| 1030 | 1030 | * @since 0.4.22 by Brendan Arnold |
| 1031 | 1031 | */ |
| 1032 | 1032 | function isSessionAuthenticated() |
@@ -1040,7 +1040,7 @@ discard block |
||
| 1040 | 1040 | * |
| 1041 | 1041 | * @note This function switches to callback mode when needed. |
| 1042 | 1042 | * |
| 1043 | - * @return TRUE when the user has already been authenticated; FALSE otherwise. |
|
| 1043 | + * @return boolean when the user has already been authenticated; FALSE otherwise. |
|
| 1044 | 1044 | * |
| 1045 | 1045 | * @private |
| 1046 | 1046 | */ |
@@ -1154,7 +1154,7 @@ discard block |
||
| 1154 | 1154 | } |
| 1155 | 1155 | |
| 1156 | 1156 | /** |
| 1157 | - * @return true if the current request is a logout request. |
|
| 1157 | + * @return boolean if the current request is a logout request. |
|
| 1158 | 1158 | * @private |
| 1159 | 1159 | */ |
| 1160 | 1160 | function isLogoutRequest() |
@@ -1270,7 +1270,7 @@ discard block |
||
| 1270 | 1270 | |
| 1271 | 1271 | /** |
| 1272 | 1272 | * This method returns the Service Ticket provided in the URL of the request. |
| 1273 | - * @return The service ticket. |
|
| 1273 | + * @return string service ticket. |
|
| 1274 | 1274 | * @private |
| 1275 | 1275 | */ |
| 1276 | 1276 | function getST() |
@@ -1290,7 +1290,7 @@ discard block |
||
| 1290 | 1290 | |
| 1291 | 1291 | /** |
| 1292 | 1292 | * This method tells if a Service Ticket was stored. |
| 1293 | - * @return TRUE if a Service Ticket has been stored. |
|
| 1293 | + * @return boolean if a Service Ticket has been stored. |
|
| 1294 | 1294 | * @private |
| 1295 | 1295 | */ |
| 1296 | 1296 | function hasST() |
@@ -1365,7 +1365,7 @@ discard block |
||
| 1365 | 1365 | * $text_reponse and $tree_response on success. These parameters are used later |
| 1366 | 1366 | * by CASClient::validatePGT() for CAS proxies. |
| 1367 | 1367 | * Used for all CAS 1.0 validations |
| 1368 | - * @param $validate_url the URL of the request to the CAS server. |
|
| 1368 | + * @param string $validate_url the URL of the request to the CAS server. |
|
| 1369 | 1369 | * @param $text_response the response of the CAS server, as is (XML text). |
| 1370 | 1370 | * @param $tree_response the response of the CAS server, as a DOM XML tree. |
| 1371 | 1371 | * |
@@ -1497,7 +1497,7 @@ discard block |
||
| 1497 | 1497 | * $text_reponse and $tree_response on success. These parameters are used later |
| 1498 | 1498 | * by CASClient::validatePGT() for CAS proxies. |
| 1499 | 1499 | * |
| 1500 | - * @param $validate_url the URL of the request to the CAS server. |
|
| 1500 | + * @param string $validate_url the URL of the request to the CAS server. |
|
| 1501 | 1501 | * @param $text_response the response of the CAS server, as is (XML text). |
| 1502 | 1502 | * @param $tree_response the response of the CAS server, as a DOM XML tree. |
| 1503 | 1503 | * |
@@ -1684,7 +1684,7 @@ discard block |
||
| 1684 | 1684 | |
| 1685 | 1685 | /** |
| 1686 | 1686 | * This method returns the Proxy Granting Ticket given by the CAS server. |
| 1687 | - * @return The Proxy Granting Ticket. |
|
| 1687 | + * @return string Proxy Granting Ticket. |
|
| 1688 | 1688 | * @private |
| 1689 | 1689 | */ |
| 1690 | 1690 | function getPGT() |
@@ -1704,7 +1704,7 @@ discard block |
||
| 1704 | 1704 | |
| 1705 | 1705 | /** |
| 1706 | 1706 | * This method tells if a Proxy Granting Ticket was stored. |
| 1707 | - * @return TRUE if a Proxy Granting Ticket has been stored. |
|
| 1707 | + * @return boolean if a Proxy Granting Ticket has been stored. |
|
| 1708 | 1708 | * @private |
| 1709 | 1709 | */ |
| 1710 | 1710 | function hasPGT() |
@@ -1739,7 +1739,7 @@ discard block |
||
| 1739 | 1739 | /** |
| 1740 | 1740 | * This method sets/unsets callback mode. |
| 1741 | 1741 | * |
| 1742 | - * @param $callback_mode TRUE to set callback mode, FALSE otherwise. |
|
| 1742 | + * @param boolean $callback_mode TRUE to set callback mode, FALSE otherwise. |
|
| 1743 | 1743 | * |
| 1744 | 1744 | * @private |
| 1745 | 1745 | */ |
@@ -1752,7 +1752,7 @@ discard block |
||
| 1752 | 1752 | * This method returns TRUE when the CAs client is running i callback mode, |
| 1753 | 1753 | * FALSE otherwise. |
| 1754 | 1754 | * |
| 1755 | - * @return A boolean. |
|
| 1755 | + * @return boolean boolean. |
|
| 1756 | 1756 | * |
| 1757 | 1757 | * @private |
| 1758 | 1758 | */ |
@@ -1776,7 +1776,7 @@ discard block |
||
| 1776 | 1776 | * fact the URL of the current request without any CGI parameter, except if |
| 1777 | 1777 | * phpCAS::setFixedCallbackURL() was used). |
| 1778 | 1778 | * |
| 1779 | - * @return The callback URL |
|
| 1779 | + * @return string callback URL |
|
| 1780 | 1780 | * |
| 1781 | 1781 | * @private |
| 1782 | 1782 | */ |
@@ -1820,6 +1820,7 @@ discard block |
||
| 1820 | 1820 | * This method sets the callback url. |
| 1821 | 1821 | * |
| 1822 | 1822 | * @param $callback_url url to set callback |
| 1823 | + * @param string $url |
|
| 1823 | 1824 | * |
| 1824 | 1825 | * @private |
| 1825 | 1826 | */ |
@@ -1904,7 +1905,7 @@ discard block |
||
| 1904 | 1905 | /** |
| 1905 | 1906 | * This method reads a PGT from its Iou and deletes the corresponding storage entry. |
| 1906 | 1907 | * |
| 1907 | - * @param $pgt_iou the PGT Iou |
|
| 1908 | + * @param string $pgt_iou the PGT Iou |
|
| 1908 | 1909 | * |
| 1909 | 1910 | * @return The PGT corresponding to the Iou, FALSE when not found. |
| 1910 | 1911 | * |
@@ -2037,7 +2038,7 @@ discard block |
||
| 2037 | 2038 | * @param $err_code an error code (PHPCAS_SERVICE_OK on success). |
| 2038 | 2039 | * @param $err_msg an error message (empty on success). |
| 2039 | 2040 | * |
| 2040 | - * @return a Proxy Ticket, or FALSE on error. |
|
| 2041 | + * @return false|string Proxy Ticket, or FALSE on error. |
|
| 2041 | 2042 | * |
| 2042 | 2043 | * @private |
| 2043 | 2044 | */ |
@@ -2140,14 +2141,14 @@ discard block |
||
| 2140 | 2141 | /** |
| 2141 | 2142 | * This method is used to acces a remote URL. |
| 2142 | 2143 | * |
| 2143 | - * @param $url the URL to access. |
|
| 2144 | + * @param string $url the URL to access. |
|
| 2144 | 2145 | * @param $cookies an array containing cookies strings such as 'name=val' |
| 2145 | 2146 | * @param $headers an array containing the HTTP header lines of the response |
| 2146 | 2147 | * (an empty array on failure). |
| 2147 | 2148 | * @param $body the body of the response, as a string (empty on failure). |
| 2148 | 2149 | * @param $err_msg an error message, filled on failure. |
| 2149 | 2150 | * |
| 2150 | - * @return TRUE on success, FALSE otherwise (in this later case, $err_msg |
|
| 2151 | + * @return boolean on success, FALSE otherwise (in this later case, $err_msg |
|
| 2151 | 2152 | * contains an error message). |
| 2152 | 2153 | * |
| 2153 | 2154 | * @private |
@@ -2250,7 +2251,7 @@ discard block |
||
| 2250 | 2251 | /** |
| 2251 | 2252 | * This method is used to build the SAML POST body sent to /samlValidate URL. |
| 2252 | 2253 | * |
| 2253 | - * @return the SOAP-encased SAMLP artifact (the ticket). |
|
| 2254 | + * @return string SOAP-encased SAMLP artifact (the ticket). |
|
| 2254 | 2255 | * |
| 2255 | 2256 | * @private |
| 2256 | 2257 | */ |
@@ -2289,7 +2290,7 @@ discard block |
||
| 2289 | 2290 | * @param $output the output of the service (also used to give an error |
| 2290 | 2291 | * message on failure). |
| 2291 | 2292 | * |
| 2292 | - * @return TRUE on success, FALSE otherwise (in this later case, $err_code |
|
| 2293 | + * @return boolean on success, FALSE otherwise (in this later case, $err_code |
|
| 2293 | 2294 | * gives the reason why it failed and $output contains an error message). |
| 2294 | 2295 | * |
| 2295 | 2296 | * @public |
@@ -2436,7 +2437,7 @@ discard block |
||
| 2436 | 2437 | |
| 2437 | 2438 | /** |
| 2438 | 2439 | * This method returns the Proxy Ticket provided in the URL of the request. |
| 2439 | - * @return The proxy ticket. |
|
| 2440 | + * @return string proxy ticket. |
|
| 2440 | 2441 | * @private |
| 2441 | 2442 | */ |
| 2442 | 2443 | function getPT() |
@@ -2457,7 +2458,7 @@ discard block |
||
| 2457 | 2458 | |
| 2458 | 2459 | /** |
| 2459 | 2460 | * This method tells if a Proxy Ticket was stored. |
| 2460 | - * @return TRUE if a Proxy Ticket has been stored. |
|
| 2461 | + * @return boolean if a Proxy Ticket has been stored. |
|
| 2461 | 2462 | * @private |
| 2462 | 2463 | */ |
| 2463 | 2464 | function hasPT() |
@@ -2467,7 +2468,7 @@ discard block |
||
| 2467 | 2468 | |
| 2468 | 2469 | /** |
| 2469 | 2470 | * This method returns the SAML Ticket provided in the URL of the request. |
| 2470 | - * @return The SAML ticket. |
|
| 2471 | + * @return string SAML ticket. |
|
| 2471 | 2472 | * @private |
| 2472 | 2473 | */ |
| 2473 | 2474 | function getSA() |
@@ -2487,7 +2488,7 @@ discard block |
||
| 2487 | 2488 | |
| 2488 | 2489 | /** |
| 2489 | 2490 | * This method tells if a SAML Ticket was stored. |
| 2490 | - * @return TRUE if a SAML Ticket has been stored. |
|
| 2491 | + * @return boolean if a SAML Ticket has been stored. |
|
| 2491 | 2492 | * @private |
| 2492 | 2493 | */ |
| 2493 | 2494 | function hasSA() |
@@ -2507,6 +2508,7 @@ discard block |
||
| 2507 | 2508 | /** |
| 2508 | 2509 | * This method is used to validate a ST or PT; halt on failure |
| 2509 | 2510 | * Used for all CAS 2.0 validations |
| 2511 | + * @param string $validate_url |
|
| 2510 | 2512 | * @return bool TRUE when successfull, halt otherwise by calling CASClient::authError(). |
| 2511 | 2513 | * |
| 2512 | 2514 | * @private |
@@ -2623,7 +2625,7 @@ discard block |
||
| 2623 | 2625 | * This method returns the URL of the current request (without any ticket |
| 2624 | 2626 | * CGI parameter). |
| 2625 | 2627 | * |
| 2626 | - * @return The URL |
|
| 2628 | + * @return string URL |
|
| 2627 | 2629 | * |
| 2628 | 2630 | * @private |
| 2629 | 2631 | */ |
@@ -2701,7 +2703,7 @@ discard block |
||
| 2701 | 2703 | /** |
| 2702 | 2704 | * This method sets the URL of the current request |
| 2703 | 2705 | * |
| 2704 | - * @param $url url to set for service |
|
| 2706 | + * @param string $url url to set for service |
|
| 2705 | 2707 | * |
| 2706 | 2708 | * @private |
| 2707 | 2709 | */ |
@@ -2716,9 +2718,9 @@ discard block |
||
| 2716 | 2718 | /** |
| 2717 | 2719 | * This method is used to print the HTML output when the user was not authenticated. |
| 2718 | 2720 | * |
| 2719 | - * @param $failure the failure that occured |
|
| 2721 | + * @param string $failure the failure that occured |
|
| 2720 | 2722 | * @param $cas_url the URL the CAS server was asked for |
| 2721 | - * @param $no_response the response from the CAS server (other |
|
| 2723 | + * @param boolean $no_response the response from the CAS server (other |
|
| 2722 | 2724 | * parameters are ignored if TRUE) |
| 2723 | 2725 | * @param $bad_response bad response from the CAS server ($err_code |
| 2724 | 2726 | * and $err_msg ignored if TRUE) |
@@ -35,10 +35,10 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | |
| 37 | 37 | // include internationalization stuff |
| 38 | -include_once(dirname(__FILE__) . '/languages/languages.php'); |
|
| 38 | +include_once(dirname(__FILE__).'/languages/languages.php'); |
|
| 39 | 39 | |
| 40 | 40 | // include PGT storage classes |
| 41 | -include_once(dirname(__FILE__) . '/PGTStorage/pgt-main.php'); |
|
| 41 | +include_once(dirname(__FILE__).'/PGTStorage/pgt-main.php'); |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * @class CASClient |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | function printHTMLFooter() |
| 136 | 136 | { |
| 137 | 137 | $this->HTMLFilterOutput(empty($this->_output_footer) |
| 138 | - ? ('<hr><address>phpCAS __PHPCAS_VERSION__ ' . $this->getString(CAS_STR_USING_SERVER) . ' <a href="__SERVER_BASE_URL__">__SERVER_BASE_URL__</a> (CAS __CAS_VERSION__)</a></address></body></html>') |
|
| 138 | + ? ('<hr><address>phpCAS __PHPCAS_VERSION__ '.$this->getString(CAS_STR_USING_SERVER).' <a href="__SERVER_BASE_URL__">__SERVER_BASE_URL__</a> (CAS __CAS_VERSION__)</a></address></body></html>') |
|
| 139 | 139 | : $this->_output_footer); |
| 140 | 140 | } |
| 141 | 141 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $this->getLang(); |
| 224 | 224 | |
| 225 | 225 | if (!isset($this->_strings[$str])) { |
| 226 | - trigger_error('string `' . $str . '\' not defined for language `' . $this->getLang() . '\'', E_USER_ERROR); |
|
| 226 | + trigger_error('string `'.$str.'\' not defined for language `'.$this->getLang().'\'', E_USER_ERROR); |
|
| 227 | 227 | } |
| 228 | 228 | return $this->_strings[$str]; |
| 229 | 229 | } |
@@ -240,10 +240,10 @@ discard block |
||
| 240 | 240 | function setLang($lang) |
| 241 | 241 | { |
| 242 | 242 | // include the corresponding language file |
| 243 | - include_once(dirname(__FILE__) . '/languages/' . $lang . '.php'); |
|
| 243 | + include_once(dirname(__FILE__).'/languages/'.$lang.'.php'); |
|
| 244 | 244 | |
| 245 | 245 | if (!is_array($this->_strings)) { |
| 246 | - trigger_error('language `' . $lang . '\' is not implemented', E_USER_ERROR); |
|
| 246 | + trigger_error('language `'.$lang.'\' is not implemented', E_USER_ERROR); |
|
| 247 | 247 | } |
| 248 | 248 | $this->_lang = $lang; |
| 249 | 249 | } |
@@ -435,15 +435,15 @@ discard block |
||
| 435 | 435 | if (empty($this->_server['service_validate_url'])) { |
| 436 | 436 | switch ($this->getServerVersion()) { |
| 437 | 437 | case CAS_VERSION_1_0: |
| 438 | - $this->_server['service_validate_url'] = $this->getServerBaseURL() . 'validate'; |
|
| 438 | + $this->_server['service_validate_url'] = $this->getServerBaseURL().'validate'; |
|
| 439 | 439 | break; |
| 440 | 440 | case CAS_VERSION_2_0: |
| 441 | - $this->_server['service_validate_url'] = $this->getServerBaseURL() . 'serviceValidate'; |
|
| 441 | + $this->_server['service_validate_url'] = $this->getServerBaseURL().'serviceValidate'; |
|
| 442 | 442 | break; |
| 443 | 443 | } |
| 444 | 444 | } |
| 445 | 445 | // return $this->_server['service_validate_url'].'?service='.preg_replace('/&/','%26',$this->getURL()); |
| 446 | - return $this->_server['service_validate_url'] . '?service=' . urlencode($this->getURL()); |
|
| 446 | + return $this->_server['service_validate_url'].'?service='.urlencode($this->getURL()); |
|
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | /** |
@@ -458,12 +458,12 @@ discard block |
||
| 458 | 458 | if (empty($this->_server['saml_validate_url'])) { |
| 459 | 459 | switch ($this->getServerVersion()) { |
| 460 | 460 | case SAML_VERSION_1_1: |
| 461 | - $this->_server['saml_validate_url'] = $this->getServerBaseURL() . 'samlValidate'; |
|
| 461 | + $this->_server['saml_validate_url'] = $this->getServerBaseURL().'samlValidate'; |
|
| 462 | 462 | break; |
| 463 | 463 | } |
| 464 | 464 | } |
| 465 | - phpCAS::traceEnd($this->_server['saml_validate_url'] . '?TARGET=' . urlencode($this->getURL())); |
|
| 466 | - return $this->_server['saml_validate_url'] . '?TARGET=' . urlencode($this->getURL()); |
|
| 465 | + phpCAS::traceEnd($this->_server['saml_validate_url'].'?TARGET='.urlencode($this->getURL())); |
|
| 466 | + return $this->_server['saml_validate_url'].'?TARGET='.urlencode($this->getURL()); |
|
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | /** |
@@ -480,12 +480,12 @@ discard block |
||
| 480 | 480 | $this->_server['proxy_validate_url'] = ''; |
| 481 | 481 | break; |
| 482 | 482 | case CAS_VERSION_2_0: |
| 483 | - $this->_server['proxy_validate_url'] = $this->getServerBaseURL() . 'proxyValidate'; |
|
| 483 | + $this->_server['proxy_validate_url'] = $this->getServerBaseURL().'proxyValidate'; |
|
| 484 | 484 | break; |
| 485 | 485 | } |
| 486 | 486 | } |
| 487 | 487 | // return $this->_server['proxy_validate_url'].'?service='.preg_replace('/&/','%26',$this->getURL()); |
| 488 | - return $this->_server['proxy_validate_url'] . '?service=' . urlencode($this->getURL()); |
|
| 488 | + return $this->_server['proxy_validate_url'].'?service='.urlencode($this->getURL()); |
|
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | /** |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | $this->_server['proxy_url'] = ''; |
| 503 | 503 | break; |
| 504 | 504 | case CAS_VERSION_2_0: |
| 505 | - $this->_server['proxy_url'] = $this->getServerBaseURL() . 'proxy'; |
|
| 505 | + $this->_server['proxy_url'] = $this->getServerBaseURL().'proxy'; |
|
| 506 | 506 | break; |
| 507 | 507 | } |
| 508 | 508 | } |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | { |
| 519 | 519 | // the URL is build only when needed |
| 520 | 520 | if (empty($this->_server['logout_url'])) { |
| 521 | - $this->_server['logout_url'] = $this->getServerBaseURL() . 'logout'; |
|
| 521 | + $this->_server['logout_url'] = $this->getServerBaseURL().'logout'; |
|
| 522 | 522 | } |
| 523 | 523 | return $this->_server['logout_url']; |
| 524 | 524 | } |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | } |
| 622 | 622 | // set up a new session, of name based on the ticket |
| 623 | 623 | $session_id = preg_replace('/[^\w]/', '', $_GET['ticket']); |
| 624 | - phpCAS::LOG("Session ID: " . $session_id); |
|
| 624 | + phpCAS::LOG("Session ID: ".$session_id); |
|
| 625 | 625 | session_id($session_id); |
| 626 | 626 | session_start(); |
| 627 | 627 | // restore old session vars |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | if (empty($server_hostname) |
| 663 | 663 | || !preg_match('/[\.\d\-abcdefghijklmnopqrstuvwxyz]*/', $server_hostname) |
| 664 | 664 | ) { |
| 665 | - phpCAS::error('bad CAS server hostname (`' . $server_hostname . '\')'); |
|
| 665 | + phpCAS::error('bad CAS server hostname (`'.$server_hostname.'\')'); |
|
| 666 | 666 | } |
| 667 | 667 | $this->_server['hostname'] = $server_hostname; |
| 668 | 668 | |
@@ -670,16 +670,16 @@ discard block |
||
| 670 | 670 | if ($server_port == 0 |
| 671 | 671 | || !is_int($server_port) |
| 672 | 672 | ) { |
| 673 | - phpCAS::error('bad CAS server port (`' . $server_hostname . '\')'); |
|
| 673 | + phpCAS::error('bad CAS server port (`'.$server_hostname.'\')'); |
|
| 674 | 674 | } |
| 675 | 675 | $this->_server['port'] = $server_port; |
| 676 | 676 | |
| 677 | 677 | // check URI |
| 678 | 678 | if (!preg_match('/[\.\d\-_abcdefghijklmnopqrstuvwxyz\/]*/', $server_uri)) { |
| 679 | - phpCAS::error('bad CAS server URI (`' . $server_uri . '\')'); |
|
| 679 | + phpCAS::error('bad CAS server URI (`'.$server_uri.'\')'); |
|
| 680 | 680 | } |
| 681 | 681 | // add leading and trailing `/' and remove doubles |
| 682 | - $server_uri = preg_replace('/\/\//', '/', '/' . $server_uri . '/'); |
|
| 682 | + $server_uri = preg_replace('/\/\//', '/', '/'.$server_uri.'/'); |
|
| 683 | 683 | $this->_server['uri'] = $server_uri; |
| 684 | 684 | |
| 685 | 685 | // set to callback mode if PgtIou and PgtId CGI GET parameters are provided |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | switch ($this->getServerVersion()) { |
| 699 | 699 | case CAS_VERSION_1_0: // check for a Service Ticket |
| 700 | 700 | if (preg_match('/^ST-/', $ticket)) { |
| 701 | - phpCAS::trace('ST \'' . $ticket . '\' found'); |
|
| 701 | + phpCAS::trace('ST \''.$ticket.'\' found'); |
|
| 702 | 702 | //ST present |
| 703 | 703 | $this->setST($ticket); |
| 704 | 704 | //ticket has been taken into account, unset it to hide it to applications |
@@ -706,31 +706,31 @@ discard block |
||
| 706 | 706 | } else { |
| 707 | 707 | if (!empty($ticket)) { |
| 708 | 708 | //ill-formed ticket, halt |
| 709 | - phpCAS::error('ill-formed ticket found in the URL (ticket=`' . htmlentities($ticket) . '\')'); |
|
| 709 | + phpCAS::error('ill-formed ticket found in the URL (ticket=`'.htmlentities($ticket).'\')'); |
|
| 710 | 710 | } |
| 711 | 711 | } |
| 712 | 712 | break; |
| 713 | 713 | case CAS_VERSION_2_0: // check for a Service or Proxy Ticket |
| 714 | 714 | if (preg_match('/^[SP]T-/', $ticket)) { |
| 715 | - phpCAS::trace('ST or PT \'' . $ticket . '\' found'); |
|
| 715 | + phpCAS::trace('ST or PT \''.$ticket.'\' found'); |
|
| 716 | 716 | $this->setPT($ticket); |
| 717 | 717 | unset($_GET['ticket']); |
| 718 | 718 | } else { |
| 719 | 719 | if (!empty($ticket)) { |
| 720 | 720 | //ill-formed ticket, halt |
| 721 | - phpCAS::error('ill-formed ticket found in the URL (ticket=`' . htmlentities($ticket) . '\')'); |
|
| 721 | + phpCAS::error('ill-formed ticket found in the URL (ticket=`'.htmlentities($ticket).'\')'); |
|
| 722 | 722 | } |
| 723 | 723 | } |
| 724 | 724 | break; |
| 725 | 725 | case SAML_VERSION_1_1: // SAML just does Service Tickets |
| 726 | 726 | if (preg_match('/^[SP]T-/', $ticket)) { |
| 727 | - phpCAS::trace('SA \'' . $ticket . '\' found'); |
|
| 727 | + phpCAS::trace('SA \''.$ticket.'\' found'); |
|
| 728 | 728 | $this->setSA($ticket); |
| 729 | 729 | unset($_GET['ticket']); |
| 730 | 730 | } else { |
| 731 | 731 | if (!empty($ticket)) { |
| 732 | 732 | //ill-formed ticket, halt |
| 733 | - phpCAS::error('ill-formed ticket found in the URL (ticket=`' . htmlentities($ticket) . '\')'); |
|
| 733 | + phpCAS::error('ill-formed ticket found in the URL (ticket=`'.htmlentities($ticket).'\')'); |
|
| 734 | 734 | } |
| 735 | 735 | } |
| 736 | 736 | break; |
@@ -783,7 +783,7 @@ discard block |
||
| 783 | 783 | function getUser() |
| 784 | 784 | { |
| 785 | 785 | if (empty($this->_user)) { |
| 786 | - phpCAS::error('this method should be used only after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()'); |
|
| 786 | + phpCAS::error('this method should be used only after '.__CLASS__.'::forceAuthentication() or '.__CLASS__.'::isAuthenticated()'); |
|
| 787 | 787 | } |
| 788 | 788 | return $this->_user; |
| 789 | 789 | } |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | function getAttributes() |
| 814 | 814 | { |
| 815 | 815 | if (empty($this->_user)) { // if no user is set, there shouldn't be any attributes also... |
| 816 | - phpCAS::error('this method should be used only after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()'); |
|
| 816 | + phpCAS::error('this method should be used only after '.__CLASS__.'::forceAuthentication() or '.__CLASS__.'::isAuthenticated()'); |
|
| 817 | 817 | } |
| 818 | 818 | return $this->_attributes; |
| 819 | 819 | } |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | |
| 939 | 939 | if ($this->_cache_times_for_auth_recheck != -1) { |
| 940 | 940 | $_SESSION['phpCAS']['unauth_count']++; |
| 941 | - phpCAS::trace('user is not authenticated (cached for ' . $_SESSION['phpCAS']['unauth_count'] . ' times of ' . $this->_cache_times_for_auth_recheck . ')'); |
|
| 941 | + phpCAS::trace('user is not authenticated (cached for '.$_SESSION['phpCAS']['unauth_count'].' times of '.$this->_cache_times_for_auth_recheck.')'); |
|
| 942 | 942 | } else { |
| 943 | 943 | phpCAS::trace('user is not authenticated (cached for until login pressed)'); |
| 944 | 944 | } |
@@ -978,33 +978,33 @@ discard block |
||
| 978 | 978 | } else { |
| 979 | 979 | if ($this->hasST()) { |
| 980 | 980 | // if a Service Ticket was given, validate it |
| 981 | - phpCAS::trace('ST `' . $this->getST() . '\' is present'); |
|
| 981 | + phpCAS::trace('ST `'.$this->getST().'\' is present'); |
|
| 982 | 982 | $this->validateST($validate_url, $text_response, $tree_response); // if it fails, it halts |
| 983 | - phpCAS::trace('ST `' . $this->getST() . '\' was validated'); |
|
| 983 | + phpCAS::trace('ST `'.$this->getST().'\' was validated'); |
|
| 984 | 984 | if ($this->isProxy()) { |
| 985 | 985 | $this->validatePGT($validate_url, $text_response, $tree_response); // idem |
| 986 | - phpCAS::trace('PGT `' . $this->getPGT() . '\' was validated'); |
|
| 986 | + phpCAS::trace('PGT `'.$this->getPGT().'\' was validated'); |
|
| 987 | 987 | $_SESSION['phpCAS']['pgt'] = $this->getPGT(); |
| 988 | 988 | } |
| 989 | 989 | $_SESSION['phpCAS']['user'] = $this->getUser(); |
| 990 | 990 | $res = true; |
| 991 | 991 | } elseif ($this->hasPT()) { |
| 992 | 992 | // if a Proxy Ticket was given, validate it |
| 993 | - phpCAS::trace('PT `' . $this->getPT() . '\' is present'); |
|
| 993 | + phpCAS::trace('PT `'.$this->getPT().'\' is present'); |
|
| 994 | 994 | $this->validatePT($validate_url, $text_response, $tree_response); // note: if it fails, it halts |
| 995 | - phpCAS::trace('PT `' . $this->getPT() . '\' was validated'); |
|
| 995 | + phpCAS::trace('PT `'.$this->getPT().'\' was validated'); |
|
| 996 | 996 | if ($this->isProxy()) { |
| 997 | 997 | $this->validatePGT($validate_url, $text_response, $tree_response); // idem |
| 998 | - phpCAS::trace('PGT `' . $this->getPGT() . '\' was validated'); |
|
| 998 | + phpCAS::trace('PGT `'.$this->getPGT().'\' was validated'); |
|
| 999 | 999 | $_SESSION['phpCAS']['pgt'] = $this->getPGT(); |
| 1000 | 1000 | } |
| 1001 | 1001 | $_SESSION['phpCAS']['user'] = $this->getUser(); |
| 1002 | 1002 | $res = true; |
| 1003 | 1003 | } elseif ($this->hasSA()) { |
| 1004 | 1004 | // if we have a SAML ticket, validate it. |
| 1005 | - phpCAS::trace('SA `' . $this->getSA() . '\' is present'); |
|
| 1005 | + phpCAS::trace('SA `'.$this->getSA().'\' is present'); |
|
| 1006 | 1006 | $this->validateSA($validate_url, $text_response, $tree_response); // if it fails, it halts |
| 1007 | - phpCAS::trace('SA `' . $this->getSA() . '\' was validated'); |
|
| 1007 | + phpCAS::trace('SA `'.$this->getSA().'\' was validated'); |
|
| 1008 | 1008 | $_SESSION['phpCAS']['user'] = $this->getUser(); |
| 1009 | 1009 | $_SESSION['phpCAS']['attributes'] = $this->getAttributes(); |
| 1010 | 1010 | $res = true; |
@@ -1015,8 +1015,8 @@ discard block |
||
| 1015 | 1015 | if ($res) { |
| 1016 | 1016 | // if called with a ticket parameter, we need to redirect to the app without the ticket so that CAS-ification is transparent to the browser (for later POSTS) |
| 1017 | 1017 | // most of the checks and errors should have been made now, so we're safe for redirect without masking error messages. |
| 1018 | - header('Location: ' . $this->getURL()); |
|
| 1019 | - phpCAS::log("Prepare redirect to : " . $this->getURL()); |
|
| 1018 | + header('Location: '.$this->getURL()); |
|
| 1019 | + phpCAS::log("Prepare redirect to : ".$this->getURL()); |
|
| 1020 | 1020 | } |
| 1021 | 1021 | } |
| 1022 | 1022 | |
@@ -1060,18 +1060,18 @@ discard block |
||
| 1060 | 1060 | // authentication already done |
| 1061 | 1061 | $this->setUser($_SESSION['phpCAS']['user']); |
| 1062 | 1062 | $this->setPGT($_SESSION['phpCAS']['pgt']); |
| 1063 | - phpCAS::trace('user = `' . $_SESSION['phpCAS']['user'] . '\', PGT = `' . $_SESSION['phpCAS']['pgt'] . '\''); |
|
| 1063 | + phpCAS::trace('user = `'.$_SESSION['phpCAS']['user'].'\', PGT = `'.$_SESSION['phpCAS']['pgt'].'\''); |
|
| 1064 | 1064 | $auth = true; |
| 1065 | 1065 | } elseif ($this->isSessionAuthenticated() && empty($_SESSION['phpCAS']['pgt'])) { |
| 1066 | 1066 | // these two variables should be empty or not empty at the same time |
| 1067 | - phpCAS::trace('username found (`' . $_SESSION['phpCAS']['user'] . '\') but PGT is empty'); |
|
| 1067 | + phpCAS::trace('username found (`'.$_SESSION['phpCAS']['user'].'\') but PGT is empty'); |
|
| 1068 | 1068 | // unset all tickets to enforce authentication |
| 1069 | 1069 | unset($_SESSION['phpCAS']); |
| 1070 | 1070 | $this->setST(''); |
| 1071 | 1071 | $this->setPT(''); |
| 1072 | 1072 | } elseif (!$this->isSessionAuthenticated() && !empty($_SESSION['phpCAS']['pgt'])) { |
| 1073 | 1073 | // these two variables should be empty or not empty at the same time |
| 1074 | - phpCAS::trace('PGT found (`' . $_SESSION['phpCAS']['pgt'] . '\') but username is empty'); |
|
| 1074 | + phpCAS::trace('PGT found (`'.$_SESSION['phpCAS']['pgt'].'\') but username is empty'); |
|
| 1075 | 1075 | // unset all tickets to enforce authentication |
| 1076 | 1076 | unset($_SESSION['phpCAS']); |
| 1077 | 1077 | $this->setST(''); |
@@ -1087,7 +1087,7 @@ discard block |
||
| 1087 | 1087 | if (isset($_SESSION['phpCAS']['attributes'])) { |
| 1088 | 1088 | $this->setAttributes($_SESSION['phpCAS']['attributes']); |
| 1089 | 1089 | } |
| 1090 | - phpCAS::trace('user = `' . $_SESSION['phpCAS']['user'] . '\''); |
|
| 1090 | + phpCAS::trace('user = `'.$_SESSION['phpCAS']['user'].'\''); |
|
| 1091 | 1091 | $auth = true; |
| 1092 | 1092 | } else { |
| 1093 | 1093 | phpCAS::trace('no user found'); |
@@ -1109,12 +1109,12 @@ discard block |
||
| 1109 | 1109 | { |
| 1110 | 1110 | phpCAS::traceBegin(); |
| 1111 | 1111 | $cas_url = $this->getServerLoginURL($gateway, $renew); |
| 1112 | - header('Location: ' . $cas_url); |
|
| 1113 | - phpCAS::log("Redirect to : " . $cas_url); |
|
| 1112 | + header('Location: '.$cas_url); |
|
| 1113 | + phpCAS::log("Redirect to : ".$cas_url); |
|
| 1114 | 1114 | |
| 1115 | 1115 | $this->printHTMLHeader($this->getString(CAS_STR_AUTHENTICATION_WANTED)); |
| 1116 | 1116 | |
| 1117 | - printf('<p>' . $this->getString(CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED) . '</p>', $cas_url); |
|
| 1117 | + printf('<p>'.$this->getString(CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED).'</p>', $cas_url); |
|
| 1118 | 1118 | $this->printHTMLFooter(); |
| 1119 | 1119 | |
| 1120 | 1120 | phpCAS::traceExit(); |
@@ -1133,20 +1133,20 @@ discard block |
||
| 1133 | 1133 | $cas_url = $this->getServerLogoutURL(); |
| 1134 | 1134 | $paramSeparator = '?'; |
| 1135 | 1135 | if (isset($params['url'])) { |
| 1136 | - $cas_url = $cas_url . $paramSeparator . "url=" . urlencode($params['url']); |
|
| 1136 | + $cas_url = $cas_url.$paramSeparator."url=".urlencode($params['url']); |
|
| 1137 | 1137 | $paramSeparator = '&'; |
| 1138 | 1138 | } |
| 1139 | 1139 | if (isset($params['service'])) { |
| 1140 | - $cas_url = $cas_url . $paramSeparator . "service=" . urlencode($params['service']); |
|
| 1140 | + $cas_url = $cas_url.$paramSeparator."service=".urlencode($params['service']); |
|
| 1141 | 1141 | } |
| 1142 | - header('Location: ' . $cas_url); |
|
| 1143 | - phpCAS::log("Prepare redirect to : " . $cas_url); |
|
| 1142 | + header('Location: '.$cas_url); |
|
| 1143 | + phpCAS::log("Prepare redirect to : ".$cas_url); |
|
| 1144 | 1144 | |
| 1145 | 1145 | session_unset(); |
| 1146 | 1146 | session_destroy(); |
| 1147 | 1147 | |
| 1148 | 1148 | $this->printHTMLHeader($this->getString(CAS_STR_LOGOUT)); |
| 1149 | - printf('<p>' . $this->getString(CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED) . '</p>', $cas_url); |
|
| 1149 | + printf('<p>'.$this->getString(CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED).'</p>', $cas_url); |
|
| 1150 | 1150 | $this->printHTMLFooter(); |
| 1151 | 1151 | |
| 1152 | 1152 | phpCAS::traceExit(); |
@@ -1187,26 +1187,26 @@ discard block |
||
| 1187 | 1187 | return; |
| 1188 | 1188 | } |
| 1189 | 1189 | phpCAS::log("Logout requested"); |
| 1190 | - phpCAS::log("SAML REQUEST: " . $_POST['logoutRequest']); |
|
| 1190 | + phpCAS::log("SAML REQUEST: ".$_POST['logoutRequest']); |
|
| 1191 | 1191 | if ($check_client) { |
| 1192 | 1192 | if (!$allowed_clients) { |
| 1193 | 1193 | $allowed_clients = array($this->getServerHostname()); |
| 1194 | 1194 | } |
| 1195 | 1195 | $client_ip = $_SERVER['REMOTE_ADDR']; |
| 1196 | 1196 | $client = gethostbyaddr($client_ip); |
| 1197 | - phpCAS::log("Client: " . $client . "/" . $client_ip); |
|
| 1197 | + phpCAS::log("Client: ".$client."/".$client_ip); |
|
| 1198 | 1198 | $allowed = false; |
| 1199 | 1199 | foreach ($allowed_clients as $allowed_client) { |
| 1200 | 1200 | if (($client == $allowed_client) or ($client_ip == $allowed_client)) { |
| 1201 | - phpCAS::log("Allowed client '" . $allowed_client . "' matches, logout request is allowed"); |
|
| 1201 | + phpCAS::log("Allowed client '".$allowed_client."' matches, logout request is allowed"); |
|
| 1202 | 1202 | $allowed = true; |
| 1203 | 1203 | break; |
| 1204 | 1204 | } else { |
| 1205 | - phpCAS::log("Allowed client '" . $allowed_client . "' does not match"); |
|
| 1205 | + phpCAS::log("Allowed client '".$allowed_client."' does not match"); |
|
| 1206 | 1206 | } |
| 1207 | 1207 | } |
| 1208 | 1208 | if (!$allowed) { |
| 1209 | - phpCAS::error("Unauthorized logout request from client '" . $client . "'"); |
|
| 1209 | + phpCAS::error("Unauthorized logout request from client '".$client."'"); |
|
| 1210 | 1210 | printf("Unauthorized!"); |
| 1211 | 1211 | phpCAS::traceExit(); |
| 1212 | 1212 | exit(); |
@@ -1219,9 +1219,9 @@ discard block |
||
| 1219 | 1219 | PREG_OFFSET_CAPTURE, 3); |
| 1220 | 1220 | $wrappedSamlSessionIndex = preg_replace('|<samlp:SessionIndex>|', '', $tick[0][0]); |
| 1221 | 1221 | $ticket2logout = preg_replace('|</samlp:SessionIndex>|', '', $wrappedSamlSessionIndex); |
| 1222 | - phpCAS::log("Ticket to logout: " . $ticket2logout); |
|
| 1222 | + phpCAS::log("Ticket to logout: ".$ticket2logout); |
|
| 1223 | 1223 | $session_id = preg_replace('/[^\w]/', '', $ticket2logout); |
| 1224 | - phpCAS::log("Session id: " . $session_id); |
|
| 1224 | + phpCAS::log("Session id: ".$session_id); |
|
| 1225 | 1225 | |
| 1226 | 1226 | // destroy a possible application session created before phpcas |
| 1227 | 1227 | if (session_id()) { |
@@ -1377,15 +1377,15 @@ discard block |
||
| 1377 | 1377 | { |
| 1378 | 1378 | phpCAS::traceBegin(); |
| 1379 | 1379 | // build the URL to validate the ticket |
| 1380 | - $validate_url = $this->getServerServiceValidateURL() . '&ticket=' . $this->getST(); |
|
| 1380 | + $validate_url = $this->getServerServiceValidateURL().'&ticket='.$this->getST(); |
|
| 1381 | 1381 | if ($this->isProxy()) { |
| 1382 | 1382 | // pass the callback url for CAS proxies |
| 1383 | - $validate_url .= '&pgtUrl=' . $this->getCallbackURL(); |
|
| 1383 | + $validate_url .= '&pgtUrl='.$this->getCallbackURL(); |
|
| 1384 | 1384 | } |
| 1385 | 1385 | |
| 1386 | 1386 | // open and read the URL |
| 1387 | 1387 | if (!$this->readURL($validate_url, ''/*cookies*/, $headers, $text_response, $err_msg)) { |
| 1388 | - phpCAS::trace('could not open URL \'' . $validate_url . '\' to validate (' . $err_msg . ')'); |
|
| 1388 | + phpCAS::trace('could not open URL \''.$validate_url.'\' to validate ('.$err_msg.')'); |
|
| 1389 | 1389 | $this->authError('ST not validated', |
| 1390 | 1390 | $validate_url, |
| 1391 | 1391 | true/*$no_response*/); |
@@ -1435,7 +1435,7 @@ discard block |
||
| 1435 | 1435 | } |
| 1436 | 1436 | // insure that tag name is 'serviceResponse' |
| 1437 | 1437 | if ($tree_response->node_name() != 'serviceResponse') { |
| 1438 | - phpCAS::trace('bad XML root node (should be `serviceResponse\' instead of `' . $tree_response->node_name() . '\''); |
|
| 1438 | + phpCAS::trace('bad XML root node (should be `serviceResponse\' instead of `'.$tree_response->node_name().'\''); |
|
| 1439 | 1439 | $this->authError('ST not validated', |
| 1440 | 1440 | $validate_url, |
| 1441 | 1441 | false/*$no_response*/, |
@@ -1453,7 +1453,7 @@ discard block |
||
| 1453 | 1453 | $text_response); |
| 1454 | 1454 | } |
| 1455 | 1455 | $user = trim($user_elements[0]->get_content()); |
| 1456 | - phpCAS::trace('user = `' . $user); |
|
| 1456 | + phpCAS::trace('user = `'.$user); |
|
| 1457 | 1457 | $this->setUser($user); |
| 1458 | 1458 | |
| 1459 | 1459 | } else { |
@@ -1514,11 +1514,11 @@ discard block |
||
| 1514 | 1514 | |
| 1515 | 1515 | // open and read the URL |
| 1516 | 1516 | if (!$this->readURL($validate_url, ''/*cookies*/, $headers, $text_response, $err_msg)) { |
| 1517 | - phpCAS::trace('could not open URL \'' . $validate_url . '\' to validate (' . $err_msg . ')'); |
|
| 1517 | + phpCAS::trace('could not open URL \''.$validate_url.'\' to validate ('.$err_msg.')'); |
|
| 1518 | 1518 | $this->authError('SA not validated', $validate_url, true/*$no_response*/); |
| 1519 | 1519 | } |
| 1520 | 1520 | |
| 1521 | - phpCAS::trace('server version: ' . $this->getServerVersion()); |
|
| 1521 | + phpCAS::trace('server version: '.$this->getServerVersion()); |
|
| 1522 | 1522 | |
| 1523 | 1523 | // analyze the result depending on the version |
| 1524 | 1524 | switch ($this->getServerVersion()) { |
@@ -1544,7 +1544,7 @@ discard block |
||
| 1544 | 1544 | } |
| 1545 | 1545 | // insure that tag name is 'Envelope' |
| 1546 | 1546 | if ($tree_response->node_name() != 'Envelope') { |
| 1547 | - phpCAS::trace('bad XML root node (should be `Envelope\' instead of `' . $tree_response->node_name() . '\''); |
|
| 1547 | + phpCAS::trace('bad XML root node (should be `Envelope\' instead of `'.$tree_response->node_name().'\''); |
|
| 1548 | 1548 | $this->authError('SA not validated', |
| 1549 | 1549 | $validate_url, |
| 1550 | 1550 | false/*$no_response*/, |
@@ -1555,7 +1555,7 @@ discard block |
||
| 1555 | 1555 | if (sizeof($success_elements = $tree_response->get_elements_by_tagname("NameIdentifier")) != 0) { |
| 1556 | 1556 | phpCAS::trace('NameIdentifier found'); |
| 1557 | 1557 | $user = trim($success_elements[0]->get_content()); |
| 1558 | - phpCAS::trace('user = `' . $user . '`'); |
|
| 1558 | + phpCAS::trace('user = `'.$user.'`'); |
|
| 1559 | 1559 | $this->setUser($user); |
| 1560 | 1560 | $this->setSessionAttributes($text_response); |
| 1561 | 1561 | } else { |
@@ -1590,7 +1590,7 @@ discard block |
||
| 1590 | 1590 | $result = false; |
| 1591 | 1591 | |
| 1592 | 1592 | if (isset($_SESSION[SAML_ATTRIBUTES])) { |
| 1593 | - phpCAS::trace("session attrs already set."); //testbml - do we care? |
|
| 1593 | + phpCAS::trace("session attrs already set."); //testbml - do we care? |
|
| 1594 | 1594 | } |
| 1595 | 1595 | |
| 1596 | 1596 | $attr_array = array(); |
@@ -1610,7 +1610,7 @@ discard block |
||
| 1610 | 1610 | $value_array[] = $node->get_content(); |
| 1611 | 1611 | |
| 1612 | 1612 | } |
| 1613 | - phpCAS::trace("* " . $name . "=" . $value_array); |
|
| 1613 | + phpCAS::trace("* ".$name."=".$value_array); |
|
| 1614 | 1614 | $attr_array[$name] = $value_array; |
| 1615 | 1615 | } |
| 1616 | 1616 | $_SESSION[SAML_ATTRIBUTES] = $attr_array; |
@@ -1840,8 +1840,8 @@ discard block |
||
| 1840 | 1840 | $this->printHTMLHeader('phpCAS callback'); |
| 1841 | 1841 | $pgt_iou = $_GET['pgtIou']; |
| 1842 | 1842 | $pgt = $_GET['pgtId']; |
| 1843 | - phpCAS::trace('Storing PGT `' . $pgt . '\' (id=`' . $pgt_iou . '\')'); |
|
| 1844 | - echo '<p>Storing PGT `' . $pgt . '\' (id=`' . $pgt_iou . '\').</p>'; |
|
| 1843 | + phpCAS::trace('Storing PGT `'.$pgt.'\' (id=`'.$pgt_iou.'\')'); |
|
| 1844 | + echo '<p>Storing PGT `'.$pgt.'\' (id=`'.$pgt_iou.'\').</p>'; |
|
| 1845 | 1845 | $this->storePGT($pgt, $pgt_iou); |
| 1846 | 1846 | $this->printHTMLFooter(); |
| 1847 | 1847 | phpCAS::traceExit(); |
@@ -2053,11 +2053,11 @@ discard block |
||
| 2053 | 2053 | |
| 2054 | 2054 | // build the URL to retrieve the PT |
| 2055 | 2055 | // $cas_url = $this->getServerProxyURL().'?targetService='.preg_replace('/&/','%26',$target_service).'&pgt='.$this->getPGT(); |
| 2056 | - $cas_url = $this->getServerProxyURL() . '?targetService=' . urlencode($target_service) . '&pgt=' . $this->getPGT(); |
|
| 2056 | + $cas_url = $this->getServerProxyURL().'?targetService='.urlencode($target_service).'&pgt='.$this->getPGT(); |
|
| 2057 | 2057 | |
| 2058 | 2058 | // open and read the URL |
| 2059 | 2059 | if (!$this->readURL($cas_url, ''/*cookies*/, $headers, $cas_response, $err_msg)) { |
| 2060 | - phpCAS::trace('could not open URL \'' . $cas_url . '\' to validate (' . $err_msg . ')'); |
|
| 2060 | + phpCAS::trace('could not open URL \''.$cas_url.'\' to validate ('.$err_msg.')'); |
|
| 2061 | 2061 | $err_code = PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE; |
| 2062 | 2062 | $err_msg = 'could not retrieve PT (no response from the CAS server)'; |
| 2063 | 2063 | phpCAS::traceEnd(false); |
@@ -2100,7 +2100,7 @@ discard block |
||
| 2100 | 2100 | if (sizeof($arr = $root->get_elements_by_tagname("proxyTicket")) != 0) { |
| 2101 | 2101 | $err_code = PHPCAS_SERVICE_OK; |
| 2102 | 2102 | $err_msg = ''; |
| 2103 | - phpCAS::trace('original PT: ' . trim($arr[0]->get_content())); |
|
| 2103 | + phpCAS::trace('original PT: '.trim($arr[0]->get_content())); |
|
| 2104 | 2104 | $pt = trim($arr[0]->get_content()); |
| 2105 | 2105 | phpCAS::traceEnd($pt); |
| 2106 | 2106 | return $pt; |
@@ -2127,7 +2127,7 @@ discard block |
||
| 2127 | 2127 | |
| 2128 | 2128 | // at this step, we are sure that the response of the CAS server was ill-formed |
| 2129 | 2129 | $err_code = PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE; |
| 2130 | - $err_msg = 'Invalid response from the CAS server (response=`' . $cas_response . '\')'; |
|
| 2130 | + $err_msg = 'Invalid response from the CAS server (response=`'.$cas_response.'\')'; |
|
| 2131 | 2131 | |
| 2132 | 2132 | phpCAS::traceEnd(false); |
| 2133 | 2133 | return false; |
@@ -2230,7 +2230,7 @@ discard block |
||
| 2230 | 2230 | //phpCAS::trace('CURL: Call completed. Response body is: \''.$buf.'\''); |
| 2231 | 2231 | if ($buf === false) { |
| 2232 | 2232 | phpCAS::trace('curl_exec() failed'); |
| 2233 | - $err_msg = 'CURL error #' . curl_errno($ch) . ': ' . curl_error($ch); |
|
| 2233 | + $err_msg = 'CURL error #'.curl_errno($ch).': '.curl_error($ch); |
|
| 2234 | 2234 | //phpCAS::trace('curl error: '.$err_msg); |
| 2235 | 2235 | // close the CURL session |
| 2236 | 2236 | curl_close($ch); |
@@ -2262,7 +2262,7 @@ discard block |
||
| 2262 | 2262 | $sa = $this->getSA(); |
| 2263 | 2263 | //phpCAS::trace("SA: ".$sa); |
| 2264 | 2264 | |
| 2265 | - $body = SAML_SOAP_ENV . SAML_SOAP_BODY . SAMLP_REQUEST . SAML_ASSERTION_ARTIFACT . $sa . SAML_ASSERTION_ARTIFACT_CLOSE . SAMLP_REQUEST_CLOSE . SAML_SOAP_BODY_CLOSE . SAML_SOAP_ENV_CLOSE; |
|
| 2265 | + $body = SAML_SOAP_ENV.SAML_SOAP_BODY.SAMLP_REQUEST.SAML_ASSERTION_ARTIFACT.$sa.SAML_ASSERTION_ARTIFACT_CLOSE.SAMLP_REQUEST_CLOSE.SAML_SOAP_BODY_CLOSE.SAML_SOAP_ENV_CLOSE; |
|
| 2266 | 2266 | |
| 2267 | 2267 | phpCAS::traceEnd($body); |
| 2268 | 2268 | return ($body); |
@@ -2311,20 +2311,20 @@ discard block |
||
| 2311 | 2311 | // add cookies if necessary |
| 2312 | 2312 | if (is_array($_SESSION['phpCAS']['services'][$url]['cookies'])) { |
| 2313 | 2313 | foreach ($_SESSION['phpCAS']['services'][$url]['cookies'] as $name => $val) { |
| 2314 | - $cookies[] = $name . '=' . $val; |
|
| 2314 | + $cookies[] = $name.'='.$val; |
|
| 2315 | 2315 | } |
| 2316 | 2316 | } |
| 2317 | 2317 | |
| 2318 | 2318 | // build the URL including the PT |
| 2319 | 2319 | if (strstr($url, '?') === false) { |
| 2320 | - $service_url = $url . '?ticket=' . $pt; |
|
| 2320 | + $service_url = $url.'?ticket='.$pt; |
|
| 2321 | 2321 | } else { |
| 2322 | - $service_url = $url . '&ticket=' . $pt; |
|
| 2322 | + $service_url = $url.'&ticket='.$pt; |
|
| 2323 | 2323 | } |
| 2324 | 2324 | |
| 2325 | - phpCAS::trace('reading URL`' . $service_url . '\''); |
|
| 2325 | + phpCAS::trace('reading URL`'.$service_url.'\''); |
|
| 2326 | 2326 | if (!$this->readURL($service_url, $cookies, $headers, $output, $err_msg)) { |
| 2327 | - phpCAS::trace('could not read URL`' . $service_url . '\''); |
|
| 2327 | + phpCAS::trace('could not read URL`'.$service_url.'\''); |
|
| 2328 | 2328 | $err_code = PHPCAS_SERVICE_NOT_AVAILABLE; |
| 2329 | 2329 | // give an error message |
| 2330 | 2330 | $output = sprintf($this->getString(CAS_STR_SERVICE_UNAVAILABLE), |
@@ -2333,7 +2333,7 @@ discard block |
||
| 2333 | 2333 | $res = false; |
| 2334 | 2334 | } else { |
| 2335 | 2335 | // URL has been fetched, extract the cookies |
| 2336 | - phpCAS::trace('URL`' . $service_url . '\' has been read, storing cookies:'); |
|
| 2336 | + phpCAS::trace('URL`'.$service_url.'\' has been read, storing cookies:'); |
|
| 2337 | 2337 | foreach ($headers as $header) { |
| 2338 | 2338 | // test if the header is a cookie |
| 2339 | 2339 | if (preg_match('/^Set-Cookie:/', $header)) { |
@@ -2346,7 +2346,7 @@ discard block |
||
| 2346 | 2346 | $cookie_val = strtok('='); |
| 2347 | 2347 | // store the cookie |
| 2348 | 2348 | $_SESSION['phpCAS']['services'][$url]['cookies'][$cookie_name] = $cookie_val; |
| 2349 | - phpCAS::trace($cookie_name . ' -> ' . $cookie_val); |
|
| 2349 | + phpCAS::trace($cookie_name.' -> '.$cookie_val); |
|
| 2350 | 2350 | } |
| 2351 | 2351 | } |
| 2352 | 2352 | } |
@@ -2388,7 +2388,7 @@ discard block |
||
| 2388 | 2388 | // note: $err_code and $err_msg are filled by CASClient::retrievePT() |
| 2389 | 2389 | phpCAS::trace('PT was not retrieved correctly'); |
| 2390 | 2390 | } else { |
| 2391 | - phpCAS::trace('opening IMAP URL `' . $url . '\'...'); |
|
| 2391 | + phpCAS::trace('opening IMAP URL `'.$url.'\'...'); |
|
| 2392 | 2392 | $stream = @imap_open($url, $this->getUser(), $pt, $flags); |
| 2393 | 2393 | if (!$stream) { |
| 2394 | 2394 | phpCAS::trace('could not open URL'); |
@@ -2472,7 +2472,7 @@ discard block |
||
| 2472 | 2472 | */ |
| 2473 | 2473 | function getSA() |
| 2474 | 2474 | { |
| 2475 | - return 'ST' . substr($this->_sa, 2); |
|
| 2475 | + return 'ST'.substr($this->_sa, 2); |
|
| 2476 | 2476 | } |
| 2477 | 2477 | |
| 2478 | 2478 | /** |
@@ -2515,16 +2515,16 @@ discard block |
||
| 2515 | 2515 | { |
| 2516 | 2516 | phpCAS::traceBegin(); |
| 2517 | 2517 | // build the URL to validate the ticket |
| 2518 | - $validate_url = $this->getServerProxyValidateURL() . '&ticket=' . $this->getPT(); |
|
| 2518 | + $validate_url = $this->getServerProxyValidateURL().'&ticket='.$this->getPT(); |
|
| 2519 | 2519 | |
| 2520 | 2520 | if ($this->isProxy()) { |
| 2521 | 2521 | // pass the callback url for CAS proxies |
| 2522 | - $validate_url .= '&pgtUrl=' . $this->getCallbackURL(); |
|
| 2522 | + $validate_url .= '&pgtUrl='.$this->getCallbackURL(); |
|
| 2523 | 2523 | } |
| 2524 | 2524 | |
| 2525 | 2525 | // open and read the URL |
| 2526 | 2526 | if (!$this->readURL($validate_url, ''/*cookies*/, $headers, $text_response, $err_msg)) { |
| 2527 | - phpCAS::trace('could not open URL \'' . $validate_url . '\' to validate (' . $err_msg . ')'); |
|
| 2527 | + phpCAS::trace('could not open URL \''.$validate_url.'\' to validate ('.$err_msg.')'); |
|
| 2528 | 2528 | $this->authError('PT not validated', |
| 2529 | 2529 | $validate_url, |
| 2530 | 2530 | true/*$no_response*/); |
@@ -2742,8 +2742,8 @@ discard block |
||
| 2742 | 2742 | $this->printHTMLHeader($this->getString(CAS_STR_AUTHENTICATION_FAILED)); |
| 2743 | 2743 | printf($this->getString(CAS_STR_YOU_WERE_NOT_AUTHENTICATED), htmlentities($this->getURL()), |
| 2744 | 2744 | $_SERVER['SERVER_ADMIN']); |
| 2745 | - phpCAS::trace('CAS URL: ' . $cas_url); |
|
| 2746 | - phpCAS::trace('Authentication failure: ' . $failure); |
|
| 2745 | + phpCAS::trace('CAS URL: '.$cas_url); |
|
| 2746 | + phpCAS::trace('Authentication failure: '.$failure); |
|
| 2747 | 2747 | if ($no_response) { |
| 2748 | 2748 | phpCAS::trace('Reason: no response from the CAS server'); |
| 2749 | 2749 | } else { |
@@ -2758,12 +2758,12 @@ discard block |
||
| 2758 | 2758 | if (empty($err_code)) { |
| 2759 | 2759 | phpCAS::trace('Reason: no CAS error'); |
| 2760 | 2760 | } else { |
| 2761 | - phpCAS::trace('Reason: [' . $err_code . '] CAS error: ' . $err_msg); |
|
| 2761 | + phpCAS::trace('Reason: ['.$err_code.'] CAS error: '.$err_msg); |
|
| 2762 | 2762 | } |
| 2763 | 2763 | break; |
| 2764 | 2764 | } |
| 2765 | 2765 | } |
| 2766 | - phpCAS::trace('CAS response: ' . $cas_response); |
|
| 2766 | + phpCAS::trace('CAS response: '.$cas_response); |
|
| 2767 | 2767 | } |
| 2768 | 2768 | $this->printHTMLFooter(); |
| 2769 | 2769 | phpCAS::traceExit(); |
@@ -811,6 +811,9 @@ discard block |
||
| 811 | 811 | $this->myDOMXPath = new DOMXPath($this->myOwnerDocument->myDOMNode); |
| 812 | 812 | } |
| 813 | 813 | |
| 814 | + /** |
|
| 815 | + * @param string $eval_str |
|
| 816 | + */ |
|
| 814 | 817 | function xpath_eval($eval_str, $contextnode = null) |
| 815 | 818 | { |
| 816 | 819 | if (method_exists($this->myDOMXPath, 'evaluate')) { |
@@ -824,6 +827,10 @@ discard block |
||
| 824 | 827 | return ($xp->type === XPATH_UNDEFINED) ? false : $xp; |
| 825 | 828 | } |
| 826 | 829 | |
| 830 | + /** |
|
| 831 | + * @param string $prefix |
|
| 832 | + * @param string $namespaceURI |
|
| 833 | + */ |
|
| 827 | 834 | function xpath_register_ns($prefix, $namespaceURI) |
| 828 | 835 | { |
| 829 | 836 | return $this->myDOMXPath->registerNamespace($prefix, $namespaceURI); |
@@ -238,10 +238,10 @@ discard block |
||
| 238 | 238 | $prefix = $this->myDOMNode->lookupPrefix($uri); |
| 239 | 239 | } |
| 240 | 240 | if (($prefix == null) && (($this->myDOMNode->documentElement == null) || (!$this->myDOMNode->documentElement->isDefaultNamespace($uri)))) { |
| 241 | - $prefix = 'a' . sprintf('%u', crc32($uri)); |
|
| 241 | + $prefix = 'a'.sprintf('%u', crc32($uri)); |
|
| 242 | 242 | } |
| 243 | 243 | return new php4DOMElement($this->myDOMNode->createElementNS($uri, |
| 244 | - $prefix == null ? $name : $prefix . ':' . $name), $this); |
|
| 244 | + $prefix == null ? $name : $prefix.':'.$name), $this); |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | function create_entity_reference($content) |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | if ($this->myDOMNode->hasAttributeNS('http://www.w3.org/2000/xmlns/', $prefix)) { |
| 345 | 345 | return false; |
| 346 | 346 | } else { |
| 347 | - $this->myDOMNode->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:' . $prefix, |
|
| 347 | + $this->myDOMNode->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:'.$prefix, |
|
| 348 | 348 | $uri); //By Daniel Walker 2006-09-08 |
| 349 | 349 | return true; |
| 350 | 350 | } |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | $newNode = $this->myDOMNode->ownerDocument->createElement($name); |
| 404 | 404 | } else { |
| 405 | 405 | $newNode = $this->myDOMNode->ownerDocument->createElementNS($this->myDOMNode->namespaceURI, |
| 406 | - $this->myDOMNode->prefix . ':' . $name); |
|
| 406 | + $this->myDOMNode->prefix.':'.$name); |
|
| 407 | 407 | } |
| 408 | 408 | $myDOMNodeList = $this->myDOMNode->attributes; |
| 409 | 409 | $i = 0; |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | return $this->myDOMNode->value; |
| 458 | 458 | default: |
| 459 | 459 | $myErrors = debug_backtrace(); |
| 460 | - trigger_error('Undefined property: ' . get_class($this) . '::$' . $name . ' [' . $myErrors[0]['file'] . ':' . $myErrors[0]['line'] . ']', |
|
| 460 | + trigger_error('Undefined property: '.get_class($this).'::$'.$name.' ['.$myErrors[0]['file'].':'.$myErrors[0]['line'].']', |
|
| 461 | 461 | E_USER_NOTICE); |
| 462 | 462 | return false; |
| 463 | 463 | } |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | {//Contributions by Daniel Walker 2006-09-08 |
| 640 | 640 | $nsprefix = $this->myDOMNode->lookupPrefix($uri); |
| 641 | 641 | if ($nsprefix == null) { |
| 642 | - $nsprefix = $prefix == null ? $nsprefix = 'a' . sprintf('%u', crc32($uri)) : $prefix; |
|
| 642 | + $nsprefix = $prefix == null ? $nsprefix = 'a'.sprintf('%u', crc32($uri)) : $prefix; |
|
| 643 | 643 | if ($this->myDOMNode->nodeType === XML_ATTRIBUTE_NODE) { |
| 644 | 644 | if (($prefix != null) && $this->myDOMNode->ownerElement->hasAttributeNS('http://www.w3.org/2000/xmlns/', |
| 645 | 645 | $nsprefix) && |
@@ -651,18 +651,18 @@ discard block |
||
| 651 | 651 | $this->myDOMNode = $parent->getAttributeNode($this->myDOMNode->localName); |
| 652 | 652 | return; |
| 653 | 653 | } |
| 654 | - $this->myDOMNode->ownerElement->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:' . $nsprefix, |
|
| 654 | + $this->myDOMNode->ownerElement->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:'.$nsprefix, |
|
| 655 | 655 | $uri); |
| 656 | 656 | } |
| 657 | 657 | } |
| 658 | 658 | if ($this->myDOMNode->nodeType === XML_ATTRIBUTE_NODE) { |
| 659 | 659 | $parent = $this->myDOMNode->ownerElement; |
| 660 | 660 | $parent->removeAttributeNode($this->myDOMNode); |
| 661 | - $parent->setAttributeNS($uri, $nsprefix . ':' . $this->myDOMNode->localName, $this->myDOMNode->nodeValue); |
|
| 661 | + $parent->setAttributeNS($uri, $nsprefix.':'.$this->myDOMNode->localName, $this->myDOMNode->nodeValue); |
|
| 662 | 662 | $this->myDOMNode = $parent->getAttributeNodeNS($uri, $this->myDOMNode->localName); |
| 663 | 663 | } elseif ($this->myDOMNode->nodeType === XML_ELEMENT_NODE) { |
| 664 | 664 | $NewNode = $this->myDOMNode->ownerDocument->createElementNS($uri, |
| 665 | - $nsprefix . ':' . $this->myDOMNode->localName); |
|
| 665 | + $nsprefix.':'.$this->myDOMNode->localName); |
|
| 666 | 666 | foreach ($this->myDOMNode->attributes as $n) { |
| 667 | 667 | $NewNode->appendChild($n->cloneNode(true)); |
| 668 | 668 | } |