Passed
Push — 1.10.x ( 62de0e...37d5af )
by Angel Fernando Quiroz
48:23
created
main/auth/cas/lib/CAS.php 1 patch
Spacing   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
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
 /**
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
  *
282 282
  * @hideinitializer
283 283
  */
284
-$GLOBALS['PHPCAS_INIT_CALL'] = array (
284
+$GLOBALS['PHPCAS_INIT_CALL'] = array(
285 285
 	'done' => FALSE,
286 286
 	'file' => '?',
287 287
 	'line' => -1,
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
  *
295 295
  * @hideinitializer
296 296
  */
297
-$GLOBALS['PHPCAS_AUTH_CHECK_CALL'] = array (
297
+$GLOBALS['PHPCAS_AUTH_CHECK_CALL'] = array(
298 298
 	'done' => FALSE,
299 299
 	'file' => '?',
300 300
 	'line' => -1,
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
  *
308 308
  * @hideinitializer
309 309
  */
310
-$GLOBALS['PHPCAS_DEBUG'] = array (
310
+$GLOBALS['PHPCAS_DEBUG'] = array(
311 311
 	'filename' => '/tmp/cas.log',
312 312
 	'indent' => 0,
313 313
 	'unique_id' => ''
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 // ########################################################################
321 321
 
322 322
 // include client class
323
-include_once (dirname(__FILE__) . '/CAS/client.php');
323
+include_once (dirname(__FILE__).'/CAS/client.php');
324 324
 
325 325
 // ########################################################################
326 326
 //  INTERFACE CLASS
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 
369 369
 		phpCAS :: traceBegin();
370 370
 		if (is_object($PHPCAS_CLIENT)) {
371
-			phpCAS :: error($PHPCAS_INIT_CALL['method'] . '() has already been called (at ' . $PHPCAS_INIT_CALL['file'] . ':' . $PHPCAS_INIT_CALL['line'] . ')');
371
+			phpCAS :: error($PHPCAS_INIT_CALL['method'].'() has already been called (at '.$PHPCAS_INIT_CALL['file'].':'.$PHPCAS_INIT_CALL['line'].')');
372 372
 		}
373 373
 		if (gettype($server_version) != 'string') {
374 374
 			phpCAS :: error('type mismatched for parameter $server_version (should be `string\')');
@@ -385,11 +385,11 @@  discard block
 block discarded – undo
385 385
 
386 386
 		// store where the initializer is called from
387 387
 		$dbg = phpCAS :: backtrace();
388
-		$PHPCAS_INIT_CALL = array (
388
+		$PHPCAS_INIT_CALL = array(
389 389
 			'done' => TRUE,
390 390
 			'file' => $dbg[0]['file'],
391 391
 			'line' => $dbg[0]['line'],
392
-			'method' => __CLASS__ . '::' . __FUNCTION__
392
+			'method' => __CLASS__.'::'.__FUNCTION__
393 393
 		);
394 394
 
395 395
 		// initialize the global object $PHPCAS_CLIENT
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 
418 418
 		phpCAS :: traceBegin();
419 419
 		if (is_object($PHPCAS_CLIENT)) {
420
-			phpCAS :: error($PHPCAS_INIT_CALL['method'] . '() has already been called (at ' . $PHPCAS_INIT_CALL['file'] . ':' . $PHPCAS_INIT_CALL['line'] . ')');
420
+			phpCAS :: error($PHPCAS_INIT_CALL['method'].'() has already been called (at '.$PHPCAS_INIT_CALL['file'].':'.$PHPCAS_INIT_CALL['line'].')');
421 421
 		}
422 422
 		if (gettype($server_version) != 'string') {
423 423
 			phpCAS :: error('type mismatched for parameter $server_version (should be `string\')');
@@ -434,11 +434,11 @@  discard block
 block discarded – undo
434 434
 
435 435
 		// store where the initialzer is called from
436 436
 		$dbg = phpCAS :: backtrace();
437
-		$PHPCAS_INIT_CALL = array (
437
+		$PHPCAS_INIT_CALL = array(
438 438
 			'done' => TRUE,
439 439
 			'file' => $dbg[0]['file'],
440 440
 			'line' => $dbg[0]['line'],
441
-			'method' => __CLASS__ . '::' . __FUNCTION__
441
+			'method' => __CLASS__.'::'.__FUNCTION__
442 442
 		);
443 443
 
444 444
 		// initialize the global object $PHPCAS_CLIENT
@@ -472,17 +472,17 @@  discard block
 block discarded – undo
472 472
 		if (empty ($filename)) {
473 473
 			if (preg_match('/^Win.*/', getenv('OS'))) {
474 474
 				if (isset ($_ENV['TMP'])) {
475
-					$debugDir = $_ENV['TMP'] . '/';
475
+					$debugDir = $_ENV['TMP'].'/';
476 476
 				} else
477 477
 					if (isset ($_ENV['TEMP'])) {
478
-						$debugDir = $_ENV['TEMP'] . '/';
478
+						$debugDir = $_ENV['TEMP'].'/';
479 479
 					} else {
480 480
 						$debugDir = '';
481 481
 					}
482 482
 			} else {
483 483
 				$debugDir = DEFAULT_DEBUG_DIR;
484 484
 			}
485
-			$filename = $debugDir . 'phpCAS.log';
485
+			$filename = $debugDir.'phpCAS.log';
486 486
 		}
487 487
 
488 488
 		if (empty ($PHPCAS_DEBUG['unique_id'])) {
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 			return debug_backtrace();
510 510
 		} else {
511 511
 			// poor man's hack ... but it does work ...
512
-			return array ();
512
+			return array();
513 513
 		}
514 514
 	}
515 515
 
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
 			for ($i = 0; $i < $PHPCAS_DEBUG['indent']; $i++) {
529 529
 				$indent_str .= '|    ';
530 530
 			}
531
-			error_log($PHPCAS_DEBUG['unique_id'] . ' ' . $indent_str . $str . "\n", 3, $PHPCAS_DEBUG['filename']);
531
+			error_log($PHPCAS_DEBUG['unique_id'].' '.$indent_str.$str."\n", 3, $PHPCAS_DEBUG['filename']);
532 532
 		}
533 533
 
534 534
 	}
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 				}
558 558
 			}
559 559
 		}
560
-		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";
560
+		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";
561 561
 		phpCAS :: trace($msg);
562 562
 		phpCAS :: traceExit();
563 563
 		exit ();
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
 	 */
569 569
 	function trace($str) {
570 570
 		$dbg = phpCAS :: backtrace();
571
-		phpCAS :: log($str . ' [' . basename($dbg[1]['file']) . ':' . $dbg[1]['line'] . ']');
571
+		phpCAS :: log($str.' ['.basename($dbg[1]['file']).':'.$dbg[1]['line'].']');
572 572
 	}
573 573
 
574 574
 	/**
@@ -580,9 +580,9 @@  discard block
 block discarded – undo
580 580
 		$dbg = phpCAS :: backtrace();
581 581
 		$str = '=> ';
582 582
 		if (!empty ($dbg[2]['class'])) {
583
-			$str .= $dbg[2]['class'] . '::';
583
+			$str .= $dbg[2]['class'].'::';
584 584
 		}
585
-		$str .= $dbg[2]['function'] . '(';
585
+		$str .= $dbg[2]['function'].'(';
586 586
 		if (is_array($dbg[2]['args'])) {
587 587
 			foreach ($dbg[2]['args'] as $index => $arg) {
588 588
 				if ($index != 0) {
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 				$str .= str_replace("\n", "", var_export($arg, TRUE));
592 592
 			}
593 593
 		}
594
-		$str .= ') [' . basename($dbg[2]['file']) . ':' . $dbg[2]['line'] . ']';
594
+		$str .= ') ['.basename($dbg[2]['file']).':'.$dbg[2]['line'].']';
595 595
 		phpCAS :: log($str);
596 596
 		$PHPCAS_DEBUG['indent']++;
597 597
 	}
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
 		$PHPCAS_DEBUG['indent']--;
608 608
 		$dbg = phpCAS :: backtrace();
609 609
 		$str = '';
610
-		$str .= '<= ' . str_replace("\n", "", var_export($res, TRUE));
610
+		$str .= '<= '.str_replace("\n", "", var_export($res, TRUE));
611 611
 		phpCAS :: log($str);
612 612
 	}
613 613
 
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
 	function setLang($lang) {
645 645
 		global $PHPCAS_CLIENT;
646 646
 		if (!is_object($PHPCAS_CLIENT)) {
647
-			phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
647
+			phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
648 648
 		}
649 649
 		if (gettype($lang) != 'string') {
650 650
 			phpCAS :: error('type mismatched for parameter $lang (should be `string\')');
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 	function setHTMLHeader($header) {
688 688
 		global $PHPCAS_CLIENT;
689 689
 		if (!is_object($PHPCAS_CLIENT)) {
690
-			phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
690
+			phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
691 691
 		}
692 692
 		if (gettype($header) != 'string') {
693 693
 			phpCAS :: error('type mismatched for parameter $header (should be `string\')');
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 	function setHTMLFooter($footer) {
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($footer) != 'string') {
709 709
 			phpCAS :: error('type mismatched for parameter $footer (should be `string\')');
@@ -732,13 +732,13 @@  discard block
 block discarded – undo
732 732
 
733 733
 		phpCAS :: traceBegin();
734 734
 		if (!is_object($PHPCAS_CLIENT)) {
735
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
735
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()');
736 736
 		}
737 737
 		if (!$PHPCAS_CLIENT->isProxy()) {
738
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
738
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()');
739 739
 		}
740 740
 		if ($PHPCAS_AUTH_CHECK_CALL['done']) {
741
-			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'] . ')');
741
+			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'].')');
742 742
 		}
743 743
 		if (gettype($format) != 'string') {
744 744
 			phpCAS :: error('type mismatched for parameter $format (should be `string\')');
@@ -770,13 +770,13 @@  discard block
 block discarded – undo
770 770
 
771 771
 		phpCAS :: traceBegin();
772 772
 		if (!is_object($PHPCAS_CLIENT)) {
773
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
773
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()');
774 774
 		}
775 775
 		if (!$PHPCAS_CLIENT->isProxy()) {
776
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
776
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()');
777 777
 		}
778 778
 		if ($PHPCAS_AUTH_CHECK_CALL['done']) {
779
-			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'] . ')');
779
+			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'].')');
780 780
 		}
781 781
 		if (gettype($user) != 'string') {
782 782
 			phpCAS :: error('type mismatched for parameter $user (should be `string\')');
@@ -830,16 +830,16 @@  discard block
 block discarded – undo
830 830
 
831 831
 		phpCAS :: traceBegin();
832 832
 		if (!is_object($PHPCAS_CLIENT)) {
833
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
833
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()');
834 834
 		}
835 835
 		if (!$PHPCAS_CLIENT->isProxy()) {
836
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
836
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()');
837 837
 		}
838 838
 		if (!$PHPCAS_AUTH_CHECK_CALL['done']) {
839
-			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()');
839
+			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()');
840 840
 		}
841 841
 		if (!$PHPCAS_AUTH_CHECK_CALL['result']) {
842
-			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');
842
+			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');
843 843
 		}
844 844
 		if (gettype($url) != 'string') {
845 845
 			phpCAS :: error('type mismatched for parameter $url (should be `string\')');
@@ -873,16 +873,16 @@  discard block
 block discarded – undo
873 873
 
874 874
 		phpCAS :: traceBegin();
875 875
 		if (!is_object($PHPCAS_CLIENT)) {
876
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
876
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()');
877 877
 		}
878 878
 		if (!$PHPCAS_CLIENT->isProxy()) {
879
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
879
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()');
880 880
 		}
881 881
 		if (!$PHPCAS_AUTH_CHECK_CALL['done']) {
882
-			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()');
882
+			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()');
883 883
 		}
884 884
 		if (!$PHPCAS_AUTH_CHECK_CALL['result']) {
885
-			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');
885
+			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');
886 886
 		}
887 887
 		if (gettype($url) != 'string') {
888 888
 			phpCAS :: error('type mismatched for parameter $url (should be `string\')');
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
 	function setCacheTimesForAuthRecheck($n) {
919 919
 		global $PHPCAS_CLIENT;
920 920
 		if (!is_object($PHPCAS_CLIENT)) {
921
-			phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
921
+			phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
922 922
 		}
923 923
 		if (gettype($n) != 'integer') {
924 924
 			phpCAS :: error('type mismatched for parameter $header (should be `string\')');
@@ -935,18 +935,18 @@  discard block
 block discarded – undo
935 935
 
936 936
 		phpCAS :: traceBegin();
937 937
 		if (!is_object($PHPCAS_CLIENT)) {
938
-			phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
938
+			phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
939 939
 		}
940 940
 
941 941
 		$auth = $PHPCAS_CLIENT->checkAuthentication();
942 942
 
943 943
 		// store where the authentication has been checked and the result
944 944
 		$dbg = phpCAS :: backtrace();
945
-		$PHPCAS_AUTH_CHECK_CALL = array (
945
+		$PHPCAS_AUTH_CHECK_CALL = array(
946 946
 			'done' => TRUE,
947 947
 			'file' => $dbg[0]['file'],
948 948
 			'line' => $dbg[0]['line'],
949
-			'method' => __CLASS__ . '::' . __FUNCTION__,
949
+			'method' => __CLASS__.'::'.__FUNCTION__,
950 950
 			'result' => $auth
951 951
 		);
952 952
 		phpCAS :: traceEnd($auth);
@@ -963,18 +963,18 @@  discard block
 block discarded – undo
963 963
 
964 964
 		phpCAS :: traceBegin();
965 965
 		if (!is_object($PHPCAS_CLIENT)) {
966
-			phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
966
+			phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
967 967
 		}
968 968
 
969 969
 		$auth = $PHPCAS_CLIENT->forceAuthentication();
970 970
 
971 971
 		// store where the authentication has been checked and the result
972 972
 		$dbg = phpCAS :: backtrace();
973
-		$PHPCAS_AUTH_CHECK_CALL = array (
973
+		$PHPCAS_AUTH_CHECK_CALL = array(
974 974
 			'done' => TRUE,
975 975
 			'file' => $dbg[0]['file'],
976 976
 			'line' => $dbg[0]['line'],
977
-			'method' => __CLASS__ . '::' . __FUNCTION__,
977
+			'method' => __CLASS__.'::'.__FUNCTION__,
978 978
 			'result' => $auth
979 979
 		);
980 980
 
@@ -982,7 +982,7 @@  discard block
 block discarded – undo
982 982
 			phpCAS :: trace('user is not authenticated, redirecting to the CAS server');
983 983
 			$PHPCAS_CLIENT->forceAuthentication();
984 984
 		} else {
985
-			phpCAS :: trace('no need to authenticate (user `' . phpCAS :: getUser() . '\' is already authenticated)');
985
+			phpCAS :: trace('no need to authenticate (user `'.phpCAS :: getUser().'\' is already authenticated)');
986 986
 		}
987 987
 
988 988
 		phpCAS :: traceEnd();
@@ -997,16 +997,16 @@  discard block
 block discarded – undo
997 997
 
998 998
 		phpCAS :: traceBegin();
999 999
 		if (!is_object($PHPCAS_CLIENT)) {
1000
-			phpCAS :: error('this method should not be called before' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1000
+			phpCAS :: error('this method should not be called before'.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
1001 1001
 		}
1002 1002
 
1003 1003
 		// store where the authentication has been checked and the result
1004 1004
 		$dbg = phpCAS :: backtrace();
1005
-		$PHPCAS_AUTH_CHECK_CALL = array (
1005
+		$PHPCAS_AUTH_CHECK_CALL = array(
1006 1006
 			'done' => TRUE,
1007 1007
 			'file' => $dbg[0]['file'],
1008 1008
 			'line' => $dbg[0]['line'],
1009
-			'method' => __CLASS__ . '::' . __FUNCTION__,
1009
+			'method' => __CLASS__.'::'.__FUNCTION__,
1010 1010
 			'result' => $auth
1011 1011
 		);
1012 1012
 
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
 	 * This method has been left from version 0.4.1 for compatibility reasons.
1019 1019
 	 */
1020 1020
 	function authenticate() {
1021
-		phpCAS :: error('this method is deprecated. You should use ' . __CLASS__ . '::forceAuthentication() instead');
1021
+		phpCAS :: error('this method is deprecated. You should use '.__CLASS__.'::forceAuthentication() instead');
1022 1022
 	}
1023 1023
 
1024 1024
 	/**
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
 
1033 1033
 		phpCAS :: traceBegin();
1034 1034
 		if (!is_object($PHPCAS_CLIENT)) {
1035
-			phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1035
+			phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
1036 1036
 		}
1037 1037
 
1038 1038
 		// call the isAuthenticated method of the global $PHPCAS_CLIENT object
@@ -1040,11 +1040,11 @@  discard block
 block discarded – undo
1040 1040
 
1041 1041
 		// store where the authentication has been checked and the result
1042 1042
 		$dbg = phpCAS :: backtrace();
1043
-		$PHPCAS_AUTH_CHECK_CALL = array (
1043
+		$PHPCAS_AUTH_CHECK_CALL = array(
1044 1044
 			'done' => TRUE,
1045 1045
 			'file' => $dbg[0]['file'],
1046 1046
 			'line' => $dbg[0]['line'],
1047
-			'method' => __CLASS__ . '::' . __FUNCTION__,
1047
+			'method' => __CLASS__.'::'.__FUNCTION__,
1048 1048
 			'result' => $auth
1049 1049
 		);
1050 1050
 		phpCAS :: traceEnd($auth);
@@ -1060,7 +1060,7 @@  discard block
 block discarded – undo
1060 1060
 	function isSessionAuthenticated() {
1061 1061
 		global $PHPCAS_CLIENT;
1062 1062
 		if (!is_object($PHPCAS_CLIENT)) {
1063
-			phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1063
+			phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
1064 1064
 		}
1065 1065
 		return ($PHPCAS_CLIENT->isSessionAuthenticated());
1066 1066
 	}
@@ -1075,13 +1075,13 @@  discard block
 block discarded – undo
1075 1075
 	function getUser() {
1076 1076
 		global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL;
1077 1077
 		if (!is_object($PHPCAS_CLIENT)) {
1078
-			phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1078
+			phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
1079 1079
 		}
1080 1080
 		if (!$PHPCAS_AUTH_CHECK_CALL['done']) {
1081
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()');
1081
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::forceAuthentication() or '.__CLASS__.'::isAuthenticated()');
1082 1082
 		}
1083 1083
 		if (!$PHPCAS_AUTH_CHECK_CALL['result']) {
1084
-			phpCAS :: error('authentication was checked (by ' . $PHPCAS_AUTH_CHECK_CALL['method'] . '() at ' . $PHPCAS_AUTH_CHECK_CALL['file'] . ':' . $PHPCAS_AUTH_CHECK_CALL['line'] . ') but the method returned FALSE');
1084
+			phpCAS :: error('authentication was checked (by '.$PHPCAS_AUTH_CHECK_CALL['method'].'() at '.$PHPCAS_AUTH_CHECK_CALL['file'].':'.$PHPCAS_AUTH_CHECK_CALL['line'].') but the method returned FALSE');
1085 1085
 		}
1086 1086
 		return $PHPCAS_CLIENT->getUser();
1087 1087
 	}
@@ -1096,13 +1096,13 @@  discard block
 block discarded – undo
1096 1096
 	function getAttributes() {
1097 1097
 		global $PHPCAS_CLIENT, $PHPCAS_AUTH_CHECK_CALL;
1098 1098
 		if (!is_object($PHPCAS_CLIENT)) {
1099
-			phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1099
+			phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
1100 1100
 		}
1101 1101
 		if (!$PHPCAS_AUTH_CHECK_CALL['done']) {
1102
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::forceAuthentication() or ' . __CLASS__ . '::isAuthenticated()');
1102
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::forceAuthentication() or '.__CLASS__.'::isAuthenticated()');
1103 1103
 		}
1104 1104
 		if (!$PHPCAS_AUTH_CHECK_CALL['result']) {
1105
-			phpCAS :: error('authentication was checked (by ' . $PHPCAS_AUTH_CHECK_CALL['method'] . '() at ' . $PHPCAS_AUTH_CHECK_CALL['file'] . ':' . $PHPCAS_AUTH_CHECK_CALL['line'] . ') but the method returned FALSE');
1105
+			phpCAS :: error('authentication was checked (by '.$PHPCAS_AUTH_CHECK_CALL['method'].'() at '.$PHPCAS_AUTH_CHECK_CALL['file'].':'.$PHPCAS_AUTH_CHECK_CALL['line'].') but the method returned FALSE');
1106 1106
 		}
1107 1107
 		return $PHPCAS_CLIENT->getAttributes();
1108 1108
 	}
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
 	function handleLogoutRequests($check_client = true, $allowed_clients = false) {
1113 1113
 		global $PHPCAS_CLIENT;
1114 1114
 		if (!is_object($PHPCAS_CLIENT)) {
1115
-			phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1115
+			phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
1116 1116
 		}
1117 1117
 		return ($PHPCAS_CLIENT->handleLogoutRequests($check_client, $allowed_clients));
1118 1118
 	}
@@ -1126,7 +1126,7 @@  discard block
 block discarded – undo
1126 1126
 	function getServerLoginURL() {
1127 1127
 		global $PHPCAS_CLIENT;
1128 1128
 		if (!is_object($PHPCAS_CLIENT)) {
1129
-			phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1129
+			phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
1130 1130
 		}
1131 1131
 		return $PHPCAS_CLIENT->getServerLoginURL();
1132 1132
 	}
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
 		phpCAS :: traceBegin();
1142 1142
 		if (!is_object($PHPCAS_CLIENT)) {
1143 1143
 			phpCAS :: error('this method should only be called after
1144
-							' . __CLASS__ . '::client()');
1144
+							' . __CLASS__.'::client()');
1145 1145
 		}
1146 1146
 		if (gettype($url) != 'string') {
1147 1147
 			phpCAS :: error('type mismatched for parameter $url (should be
@@ -1162,7 +1162,7 @@  discard block
 block discarded – undo
1162 1162
 		phpCAS :: traceBegin();
1163 1163
 		if (!is_object($PHPCAS_CLIENT)) {
1164 1164
 			phpCAS :: error('this method should only be called after
1165
-							' . __CLASS__ . '::client()');
1165
+							' . __CLASS__.'::client()');
1166 1166
 		}
1167 1167
 		if (gettype($url) != 'string') {
1168 1168
 			phpCAS :: error('type mismatched for parameter $url (should be
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
 		phpCAS :: traceBegin();
1184 1184
 		if (!is_object($PHPCAS_CLIENT)) {
1185 1185
 			phpCAS :: error('this method should only be called after
1186
-							' . __CLASS__ . '::client()');
1186
+							' . __CLASS__.'::client()');
1187 1187
 		}
1188 1188
 		if (gettype($url) != 'string') {
1189 1189
 			phpCAS :: error('type mismatched for parameter $url (should be
@@ -1203,7 +1203,7 @@  discard block
 block discarded – undo
1203 1203
 		phpCAS :: traceBegin();
1204 1204
 		if (!is_object($PHPCAS_CLIENT)) {
1205 1205
 			phpCAS :: error('this method should only be called after
1206
-							' . __CLASS__ . '::client()');
1206
+							' . __CLASS__.'::client()');
1207 1207
 		}
1208 1208
 		if (gettype($url) != 'string') {
1209 1209
 			phpCAS :: error('type mismatched for parameter $url (should be
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
 	function getServerLogoutURL() {
1223 1223
 		global $PHPCAS_CLIENT;
1224 1224
 		if (!is_object($PHPCAS_CLIENT)) {
1225
-			phpCAS :: error('this method should not be called before ' . __CLASS__ . '::client() or ' . __CLASS__ . '::proxy()');
1225
+			phpCAS :: error('this method should not be called before '.__CLASS__.'::client() or '.__CLASS__.'::proxy()');
1226 1226
 		}
1227 1227
 		return $PHPCAS_CLIENT->getServerLogoutURL();
1228 1228
 	}
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
1237 1237
 		phpCAS :: traceBegin();
1238 1238
 		if (!is_object($PHPCAS_CLIENT)) {
1239 1239
 			phpCAS :: error('this method should only be called after
1240
-							' . __CLASS__ . '::client()');
1240
+							' . __CLASS__.'::client()');
1241 1241
 		}
1242 1242
 		if (gettype($url) != 'string') {
1243 1243
 			phpCAS :: error('type mismatched for parameter $url (should be
@@ -1256,9 +1256,9 @@  discard block
 block discarded – undo
1256 1256
 		global $PHPCAS_CLIENT;
1257 1257
 		phpCAS :: traceBegin();
1258 1258
 		if (!is_object($PHPCAS_CLIENT)) {
1259
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1259
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
1260 1260
 		}
1261
-		$parsedParams = array ();
1261
+		$parsedParams = array();
1262 1262
 		if ($params != "") {
1263 1263
 			if (is_string($params)) {
1264 1264
 				phpCAS :: error('method `phpCAS::logout($url)\' is now deprecated, use `phpCAS::logoutWithUrl($url)\' instead');
@@ -1286,12 +1286,12 @@  discard block
 block discarded – undo
1286 1286
 		global $PHPCAS_CLIENT;
1287 1287
 		phpCAS :: traceBegin();
1288 1288
 		if (!is_object($PHPCAS_CLIENT)) {
1289
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1289
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
1290 1290
 		}
1291 1291
 		if (!is_string($service)) {
1292 1292
 			phpCAS :: error('type mismatched for parameter $service (should be `string\')');
1293 1293
 		}
1294
-		$PHPCAS_CLIENT->logout(array (
1294
+		$PHPCAS_CLIENT->logout(array(
1295 1295
 			"service" => $service
1296 1296
 		));
1297 1297
 		// never reached
@@ -1306,12 +1306,12 @@  discard block
 block discarded – undo
1306 1306
 		global $PHPCAS_CLIENT;
1307 1307
 		phpCAS :: traceBegin();
1308 1308
 		if (!is_object($PHPCAS_CLIENT)) {
1309
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1309
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
1310 1310
 		}
1311 1311
 		if (!is_string($url)) {
1312 1312
 			phpCAS :: error('type mismatched for parameter $url (should be `string\')');
1313 1313
 		}
1314
-		$PHPCAS_CLIENT->logout(array (
1314
+		$PHPCAS_CLIENT->logout(array(
1315 1315
 			"url" => $url
1316 1316
 		));
1317 1317
 		// never reached
@@ -1327,7 +1327,7 @@  discard block
 block discarded – undo
1327 1327
 		global $PHPCAS_CLIENT;
1328 1328
 		phpCAS :: traceBegin();
1329 1329
 		if (!is_object($PHPCAS_CLIENT)) {
1330
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1330
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
1331 1331
 		}
1332 1332
 		if (!is_string($service)) {
1333 1333
 			phpCAS :: error('type mismatched for parameter $service (should be `string\')');
@@ -1335,7 +1335,7 @@  discard block
 block discarded – undo
1335 1335
 		if (!is_string($url)) {
1336 1336
 			phpCAS :: error('type mismatched for parameter $url (should be `string\')');
1337 1337
 		}
1338
-		$PHPCAS_CLIENT->logout(array (
1338
+		$PHPCAS_CLIENT->logout(array(
1339 1339
 			"service" => $service,
1340 1340
 			"url" => $url
1341 1341
 		));
@@ -1353,10 +1353,10 @@  discard block
 block discarded – undo
1353 1353
 		global $PHPCAS_CLIENT;
1354 1354
 		phpCAS :: traceBegin();
1355 1355
 		if (!is_object($PHPCAS_CLIENT)) {
1356
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
1356
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()');
1357 1357
 		}
1358 1358
 		if (!$PHPCAS_CLIENT->isProxy()) {
1359
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
1359
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()');
1360 1360
 		}
1361 1361
 		if (gettype($url) != 'string') {
1362 1362
 			phpCAS :: error('type mismatched for parameter $url (should be `string\')');
@@ -1375,7 +1375,7 @@  discard block
 block discarded – undo
1375 1375
 		global $PHPCAS_CLIENT;
1376 1376
 		phpCAS :: traceBegin();
1377 1377
 		if (!is_object($PHPCAS_CLIENT)) {
1378
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
1378
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()');
1379 1379
 		}
1380 1380
 		if (gettype($url) != 'string') {
1381 1381
 			phpCAS :: error('type mismatched for parameter $url (should be `string\')');
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
 	function getServiceURL() {
1391 1391
 		global $PHPCAS_CLIENT;
1392 1392
 		if (!is_object($PHPCAS_CLIENT)) {
1393
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
1393
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()');
1394 1394
 		}
1395 1395
 		return ($PHPCAS_CLIENT->getURL());
1396 1396
 	}
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 	function retrievePT($target_service, & $err_code, & $err_msg) {
1402 1402
 		global $PHPCAS_CLIENT;
1403 1403
 		if (!is_object($PHPCAS_CLIENT)) {
1404
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::proxy()');
1404
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::proxy()');
1405 1405
 		}
1406 1406
 		if (gettype($target_service) != 'string') {
1407 1407
 			phpCAS :: error('type mismatched for parameter $target_service(should be `string\')');
@@ -1418,7 +1418,7 @@  discard block
 block discarded – undo
1418 1418
 		global $PHPCAS_CLIENT;
1419 1419
 		phpCAS :: traceBegin();
1420 1420
 		if (!is_object($PHPCAS_CLIENT)) {
1421
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1421
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
1422 1422
 		}
1423 1423
 		if (gettype($cert) != 'string') {
1424 1424
 			phpCAS :: error('type mismatched for parameter $cert (should be `string\')');
@@ -1436,7 +1436,7 @@  discard block
 block discarded – undo
1436 1436
 		global $PHPCAS_CLIENT;
1437 1437
 		phpCAS :: traceBegin();
1438 1438
 		if (!is_object($PHPCAS_CLIENT)) {
1439
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1439
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
1440 1440
 		}
1441 1441
 		if (gettype($cert) != 'string') {
1442 1442
 			phpCAS :: error('type mismatched for parameter $cert (should be `string\')');
@@ -1452,7 +1452,7 @@  discard block
 block discarded – undo
1452 1452
 		global $PHPCAS_CLIENT;
1453 1453
 		phpCAS :: traceBegin();
1454 1454
 		if (!is_object($PHPCAS_CLIENT)) {
1455
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1455
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
1456 1456
 		}
1457 1457
 		$PHPCAS_CLIENT->setNoCasServerValidation();
1458 1458
 		phpCAS :: traceEnd();
@@ -1470,7 +1470,7 @@  discard block
 block discarded – undo
1470 1470
 		global $PHPCAS_CLIENT;
1471 1471
 		phpCAS :: traceBegin();
1472 1472
 		if (!is_object($PHPCAS_CLIENT)) {
1473
-			phpCAS :: error('this method should only be called after ' . __CLASS__ . '::client() or' . __CLASS__ . '::proxy()');
1473
+			phpCAS :: error('this method should only be called after '.__CLASS__.'::client() or'.__CLASS__.'::proxy()');
1474 1474
 		}
1475 1475
 		$PHPCAS_CLIENT->setExtraCurlOption($key, $value);
1476 1476
 		phpCAS :: traceEnd();
Please login to merge, or discard this patch.
main/auth/courses_controller.php 1 patch
Spacing   +17 added lines, -18 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      * @param string   $message confirmation message(optional)
62 62
      * @param string   $error error message(optional)
63 63
      */
64
-    public function categories_list($action, $message='', $error='')
64
+    public function categories_list($action, $message = '', $error = '')
65 65
     {
66 66
         $data = array();
67 67
         $data['user_course_categories'] = $this->model->get_user_course_categories();
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
         // we need only the course codes as these will be used to match against the courses of the category
118 118
         if ($user_courses != '') {
119
-            foreach($user_courses as $key => $value) {
119
+            foreach ($user_courses as $key => $value) {
120 120
                 $user_coursecodes[] = $value['code'];
121 121
             }
122 122
         }
@@ -385,13 +385,13 @@  discard block
 block discarded – undo
385 385
                     $html .= '</strong>';
386 386
                 } else {
387 387
                     if (!empty($categoryCourses)) {
388
-                        $html .= '<a href="' . getCourseCategoryUrl(
388
+                        $html .= '<a href="'.getCourseCategoryUrl(
389 389
                                 1,
390 390
                                 $limit['length'],
391 391
                                 $categoryCode,
392 392
                                 $hiddenLinks,
393 393
                                 $action
394
-                            ) . '">';
394
+                            ).'">';
395 395
                         $html .= "$categoryName ($categoryCourses)";
396 396
                         $html .= '</a>';
397 397
                     } else {
@@ -412,13 +412,13 @@  discard block
 block discarded – undo
412 412
                         if ($code == $subCategory1Code) {
413 413
                             $html .= "<strong>$subCategory1Name ($subCategory1Courses)</strong>";
414 414
                         } else {
415
-                            $html .= '<a href="' . getCourseCategoryUrl(
415
+                            $html .= '<a href="'.getCourseCategoryUrl(
416 416
                                     1,
417 417
                                     $limit['length'],
418 418
                                     $categoryCode,
419 419
                                     $hiddenLinks,
420 420
                                     $action
421
-                                ) . '">';
421
+                                ).'">';
422 422
                             $html .= "$subCategory1Name ($subCategory1Courses)";
423 423
                             $html .= '</a>';
424 424
                         }
@@ -436,13 +436,13 @@  discard block
 block discarded – undo
436 436
                                 if ($code == $subCategory2Code) {
437 437
                                     $html .= "<strong>$subCategory2Name ($subCategory2Courses)</strong>";
438 438
                                 } else {
439
-                                    $html .= '<a href="' . getCourseCategoryUrl(
439
+                                    $html .= '<a href="'.getCourseCategoryUrl(
440 440
                                             1,
441 441
                                             $limit['length'],
442 442
                                             $categoryCode,
443 443
                                             $hiddenLinks,
444 444
                                             $action
445
-                                        ) . '">';
445
+                                        ).'">';
446 446
                                     $html .= "$subCategory2Name ($subCategory2Courses)";
447 447
                                     $html .= '</a>';
448 448
                                 }
@@ -460,13 +460,13 @@  discard block
 block discarded – undo
460 460
                                         if ($code == $subCategory3Code) {
461 461
                                             $html .= "<strong>$subCategory3Name ($subCategory3Courses)</strong>";
462 462
                                         } else {
463
-                                            $html .= '<a href="' . getCourseCategoryUrl(
463
+                                            $html .= '<a href="'.getCourseCategoryUrl(
464 464
                                                     1,
465 465
                                                     $limit['length'],
466 466
                                                     $categoryCode,
467 467
                                                     $hiddenLinks,
468 468
                                                     $action
469
-                                                ) . '">';
469
+                                                ).'">';
470 470
                                             $html .= "$subCategory3Name ($subCategory3Courses)";
471 471
                                             $html .= '</a>';
472 472
                                         }
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
         $icon = '<em class="fa fa-smile-o"></em>';
594 594
 
595 595
         return Display::div(
596
-            $icon . ' ' . get_lang("AlreadyRegisteredToSession"),
596
+            $icon.' '.get_lang("AlreadyRegisteredToSession"),
597 597
             array('class' => 'info-catalog')
598 598
         );
599 599
     }
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
      */
606 606
     public function getSessionIcon($sessionName)
607 607
     {
608
-        return Display::return_icon('window_list.png', $sessionName, null,ICON_SIZE_MEDIUM);
608
+        return Display::return_icon('window_list.png', $sessionName, null, ICON_SIZE_MEDIUM);
609 609
     }
610 610
 
611 611
     /**
@@ -626,8 +626,7 @@  discard block
 block discarded – undo
626 626
         $pageTotal = intval(ceil(intval($countSessions) / $limit['length']));
627 627
         // Do NOT show pagination if only one page or less
628 628
         $cataloguePagination = $pageTotal > 1 ?
629
-            getCataloguePagination($limit['current'], $limit['length'], $pageTotal) :
630
-            '';
629
+            getCataloguePagination($limit['current'], $limit['length'], $pageTotal) : '';
631 630
         $sessionsBlocks = $this->getFormatedSessionsBlock($sessions);
632 631
 
633 632
         // Get session list catalogue URL
@@ -638,13 +637,13 @@  discard block
 block discarded – undo
638 637
         $tpl = new Template();
639 638
         $tpl->assign('show_courses', CoursesAndSessionsCatalog::showCourses());
640 639
         $tpl->assign('show_sessions', CoursesAndSessionsCatalog::showSessions());
641
-        $tpl->assign('show_tutor', (api_get_setting('show_session_coach')==='true' ? true : false));
640
+        $tpl->assign('show_tutor', (api_get_setting('show_session_coach') === 'true' ? true : false));
642 641
         $tpl->assign('course_url', $courseUrl);
643 642
         $tpl->assign('catalog_pagination', $cataloguePagination);
644 643
         $tpl->assign('hidden_links', $hiddenLinks);
645 644
         $tpl->assign('search_token', Security::get_token());
646 645
         $tpl->assign('search_date', $date);
647
-        $tpl->assign('web_session_courses_ajax_url', api_get_path(WEB_AJAX_PATH) . 'course.ajax.php');
646
+        $tpl->assign('web_session_courses_ajax_url', api_get_path(WEB_AJAX_PATH).'course.ajax.php');
648 647
         $tpl->assign('sessions', $sessionsBlocks);
649 648
         $tpl->assign('already_subscribed_label', $this->getAlreadyRegisteredInSessionLabel());
650 649
 
@@ -671,7 +670,7 @@  discard block
 block discarded – undo
671 670
 
672 671
         $tpl->assign('show_courses', CoursesAndSessionsCatalog::showCourses());
673 672
         $tpl->assign('show_sessions', CoursesAndSessionsCatalog::showSessions());
674
-        $tpl->assign('show_tutor', (api_get_setting('show_session_coach')==='true' ? true : false));
673
+        $tpl->assign('show_tutor', (api_get_setting('show_session_coach') === 'true' ? true : false));
675 674
         $tpl->assign('course_url', $courseUrl);
676 675
         $tpl->assign('already_subscribed_label', $this->getAlreadyRegisteredInSessionLabel());
677 676
         $tpl->assign('hidden_links', $hiddenLinks);
@@ -702,7 +701,7 @@  discard block
 block discarded – undo
702 701
         $tpl = new Template();
703 702
         $tpl->assign('show_courses', CoursesAndSessionsCatalog::showCourses());
704 703
         $tpl->assign('show_sessions', CoursesAndSessionsCatalog::showSessions());
705
-        $tpl->assign('show_tutor', (api_get_setting('show_session_coach')==='true' ? true : false));
704
+        $tpl->assign('show_tutor', (api_get_setting('show_session_coach') === 'true' ? true : false));
706 705
         $tpl->assign('course_url', $courseUrl);
707 706
         $tpl->assign('already_subscribed_label', $this->getAlreadyRegisteredInSessionLabel());
708 707
         $tpl->assign('hidden_links', $hiddenLinks);
Please login to merge, or discard this patch.
main/auth/courses.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
                 $limit
204 204
             );
205 205
         } else {
206
-            header('Location: ' . api_get_self());
206
+            header('Location: '.api_get_self());
207 207
         }
208 208
         break;
209 209
     case 'display_random_courses':
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
                 $continueWithSubscription = SequenceResourceManager::checkSequenceAreCompleted($requirementsData);
279 279
 
280 280
                 if (!$continueWithSubscription) {
281
-                    header('Location: ' .  api_get_path(WEB_CODE_PATH) . 'auth/courses.php');
281
+                    header('Location: '.api_get_path(WEB_CODE_PATH).'auth/courses.php');
282 282
                     exit;
283 283
                 }
284 284
             }
@@ -296,16 +296,16 @@  discard block
 block discarded – undo
296 296
 
297 297
             if ($count <= 0) {
298 298
                 // no course in session -> return to catalog
299
-                $url = api_get_path(WEB_CODE_PATH) . 'auth/courses.php';
299
+                $url = api_get_path(WEB_CODE_PATH).'auth/courses.php';
300 300
             } elseif ($count == 1) {
301 301
                 // only one course, so redirect directly to this course
302 302
                 foreach ($coursesList as $course) {
303
-                    $url = api_get_path(WEB_COURSE_PATH) . $course['directory'] . '/index.php?id_session=' . intval($_GET['session_id']);
303
+                    $url = api_get_path(WEB_COURSE_PATH).$course['directory'].'/index.php?id_session='.intval($_GET['session_id']);
304 304
                 }
305 305
             } else {
306
-                $url = api_get_path(WEB_CODE_PATH) . 'session/index.php?session_id=' . intval($_GET['session_id']);
306
+                $url = api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.intval($_GET['session_id']);
307 307
             }
308
-            header('Location: ' . $url);
308
+            header('Location: '.$url);
309 309
             exit;
310 310
         }
311 311
         //else show error message?
Please login to merge, or discard this patch.
main/auth/gotocourse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 
42 42
     $msg .= '<div class="well_login">';
43 43
     $msg .= $form->return_form();
44
-    $msg .='</div>';
44
+    $msg .= '</div>';
45 45
     if (api_is_cas_activated()) {
46 46
         $msg .= "</div>";
47 47
     }
Please login to merge, or discard this patch.
main/auth/conditional_login/complete_phone_number.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@  discard block
 block discarded – undo
2 2
 /* For licensing terms, see /license.txt */
3 3
 
4 4
 require_once dirname(__FILE__).'/../../inc/global.inc.php';
5
-$url =  api_get_path(WEB_PATH).'main/auth/conditional_login/complete_phone_number.php';
5
+$url = api_get_path(WEB_PATH).'main/auth/conditional_login/complete_phone_number.php';
6 6
 
7
-if (! isset($_SESSION['conditional_login']['uid']))
7
+if (!isset($_SESSION['conditional_login']['uid']))
8 8
   die("Not Authorised");
9 9
 ?>
10 10
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
   </body>
21 21
 </html>
22 22
 <?php
23
-if (isset($_POST['submit'])){
23
+if (isset($_POST['submit'])) {
24 24
     $u = api_get_user_info($_SESSION['conditional_login']['uid']);
25 25
     $u['phone'] = $_POST['phone_number'];
26 26
     $password = null; // we don't want to change the password
Please login to merge, or discard this patch.
main/auth/my_progress.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,16 +54,16 @@  discard block
 block discarded – undo
54 54
         }
55 55
         $course_info = api_get_course_info_by_id($result['c_id']);
56 56
         $course_image = '<img src="'.$course_info['course_image_large'].'">';
57
-        $dates .= '<li><a href="#'.$login.'">' . api_convert_and_format_date($login, DATE_FORMAT_SHORT) . '</a></li>';
57
+        $dates .= '<li><a href="#'.$login.'">'.api_convert_and_format_date($login, DATE_FORMAT_SHORT).'</a></li>';
58 58
         $issues .= '<li id ="'.$login.'">';
59 59
         $issues .= '<div class="img-course">'.$course_image.'</div>';
60 60
         
61 61
         $issues .= '<div class="text-course">';
62
-        $issues .= '<p>' . sprintf(
62
+        $issues .= '<p>'.sprintf(
63 63
                 get_lang('YouHaveEnteredTheCourseXInY'),
64
-                '" '. $courseInfo['name'] .' "',
64
+                '" '.$courseInfo['name'].' "',
65 65
                 api_convert_and_format_date($login, DATE_TIME_FORMAT_LONG) 
66
-                ) . '</p>';
66
+                ).'</p>';
67 67
         $issues .= '</div>'; 
68 68
         $issues .= '</li>';
69 69
         $count++;
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
     $content .= '<div class="row">';
83 83
     $content .= '<div class="col-md-12">';
84 84
     $content .= '<div id="my_timeline">';
85
-    $content .= '<ul id="dates">' . $dates . '</ul>';
86
-    $content .= '<ul id="issues">' . $issues . '</ul>';
85
+    $content .= '<ul id="dates">'.$dates.'</ul>';
86
+    $content .= '<ul id="issues">'.$issues.'</ul>';
87 87
     $content .= '<div id="grad_left"></div>';
88 88
     $content .= '<div id="grad_right"></div>';
89 89
     $content .= '<a href="#" id="prev"></a>';
Please login to merge, or discard this patch.
facebook-php-sdk/src/Facebook/FacebookSignedRequestFromInputHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -157,8 +157,8 @@
 block discarded – undo
157 157
    */
158 158
   public function getRawSignedRequestFromCookie()
159 159
   {
160
-    if (isset($_COOKIE['fbsr_' . $this->appId])) {
161
-      return $_COOKIE['fbsr_' . $this->appId];
160
+    if (isset($_COOKIE['fbsr_'.$this->appId])) {
161
+      return $_COOKIE['fbsr_'.$this->appId];
162 162
     }
163 163
     return null;
164 164
   }
Please login to merge, or discard this patch.
facebook-php-sdk/src/Facebook/FacebookRedirectLoginHelper.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
       'client_id' => $this->appId,
100 100
       'redirect_uri' => $this->redirectUrl,
101 101
       'state' => $this->state,
102
-      'sdk' => 'php-sdk-' . FacebookRequest::VERSION,
102
+      'sdk' => 'php-sdk-'.FacebookRequest::VERSION,
103 103
       'scope' => implode(',', $scope)
104 104
     );
105 105
     
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
       $params['display'] = 'popup';
109 109
     }
110 110
     
111
-    return 'https://www.facebook.com/' . $version . '/dialog/oauth?' .
111
+    return 'https://www.facebook.com/'.$version.'/dialog/oauth?'.
112 112
       http_build_query($params, null, '&');
113 113
   }
114 114
 
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
       'client_id' => $this->appId,
130 130
       'redirect_uri' => $this->redirectUrl,
131 131
       'state' => $this->state,
132
-      'sdk' => 'php-sdk-' . FacebookRequest::VERSION,
132
+      'sdk' => 'php-sdk-'.FacebookRequest::VERSION,
133 133
       'auth_type' => 'rerequest',
134 134
       'scope' => implode(',', $scope)
135 135
     );
136
-    return 'https://www.facebook.com/' . $version . '/dialog/oauth?' .
136
+    return 'https://www.facebook.com/'.$version.'/dialog/oauth?'.
137 137
       http_build_query($params, null, '&');
138 138
   }
139 139
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
       'next' => $next,
160 160
       'access_token' => $session->getToken()
161 161
     );
162
-    return 'https://www.facebook.com/logout.php?' . http_build_query($params, null, '&');
162
+    return 'https://www.facebook.com/logout.php?'.http_build_query($params, null, '&');
163 163
   }
164 164
 
165 165
   /**
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
         'Session not active, could not store state.', 720
235 235
       );
236 236
     }
237
-    $_SESSION[$this->sessionPrefix . 'state'] = $state;
237
+    $_SESSION[$this->sessionPrefix.'state'] = $state;
238 238
   }
239 239
 
240 240
   /**
@@ -255,8 +255,8 @@  discard block
 block discarded – undo
255 255
         'Session not active, could not load state.', 721
256 256
       );
257 257
     }
258
-    if (isset($_SESSION[$this->sessionPrefix . 'state'])) {
259
-      $this->state = $_SESSION[$this->sessionPrefix . 'state'];
258
+    if (isset($_SESSION[$this->sessionPrefix.'state'])) {
259
+      $this->state = $_SESSION[$this->sessionPrefix.'state'];
260 260
       return $this->state;
261 261
     }
262 262
     return null;
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
       if ($fp !== FALSE) {
294 294
         $buf = fread($fp, $bytes);
295 295
         fclose($fp);
296
-        if($buf !== FALSE) {
296
+        if ($buf !== FALSE) {
297 297
           return bin2hex($buf);
298 298
         }
299 299
       }
Please login to merge, or discard this patch.
main/auth/external_login/facebook-php-sdk/src/Facebook/FacebookResponse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@
 block discarded – undo
189 189
       $url = parse_url($this->responseData->paging->$direction);
190 190
       parse_str($url['query'], $params);
191 191
 
192
-      if (isset($params['type']) && strpos($this->request->getPath(), $params['type']) !== false){
192
+      if (isset($params['type']) && strpos($this->request->getPath(), $params['type']) !== false) {
193 193
         unset($params['type']);
194 194
       }
195 195
       return new FacebookRequest(
Please login to merge, or discard this patch.