Browse Source

initialisation Git

Frédéric 3 years ago
parent
commit
0d6a16474e
100 changed files with 17598 additions and 0 deletions
  1. 11
    0
      .project
  2. 108
    0
      classes/FiltreRecherche.php
  3. 244
    0
      classes/agenda/Agenda.php
  4. 87
    0
      classes/agenda/AgendaFeed.php
  5. 94
    0
      classes/agenda/fcagenda.js.php
  6. 50
    0
      classes/archive/model/ArchiveBean.php
  7. 48
    0
      classes/archive/model/ArchiveErrorBean.php
  8. 56
    0
      classes/archive/model/ArchiveErrorHome.php
  9. 237
    0
      classes/archive/model/ArchiveManager.php
  10. 30
    0
      classes/authentication/phpCAS/CAS.php
  11. 201
    0
      classes/authentication/phpCAS/LICENSE
  12. 81
    0
      classes/authentication/phpCAS/NOTICE
  13. 1892
    0
      classes/authentication/phpCAS/source/CAS.php
  14. 108
    0
      classes/authentication/phpCAS/source/CAS/AuthenticationException.php
  15. 105
    0
      classes/authentication/phpCAS/source/CAS/Autoload.php
  16. 3835
    0
      classes/authentication/phpCAS/source/CAS/Client.php
  17. 385
    0
      classes/authentication/phpCAS/source/CAS/CookieJar.php
  18. 59
    0
      classes/authentication/phpCAS/source/CAS/Exception.php
  19. 86
    0
      classes/authentication/phpCAS/source/CAS/GracefullTerminationException.php
  20. 46
    0
      classes/authentication/phpCAS/source/CAS/InvalidArgumentException.php
  21. 114
    0
      classes/authentication/phpCAS/source/CAS/Languages/Catalan.php
  22. 114
    0
      classes/authentication/phpCAS/source/CAS/Languages/English.php
  23. 116
    0
      classes/authentication/phpCAS/source/CAS/Languages/French.php
  24. 116
    0
      classes/authentication/phpCAS/source/CAS/Languages/German.php
  25. 115
    0
      classes/authentication/phpCAS/source/CAS/Languages/Greek.php
  26. 113
    0
      classes/authentication/phpCAS/source/CAS/Languages/Japanese.php
  27. 96
    0
      classes/authentication/phpCAS/source/CAS/Languages/LanguageInterface.php
  28. 117
    0
      classes/authentication/phpCAS/source/CAS/Languages/Spanish.php
  29. 56
    0
      classes/authentication/phpCAS/source/CAS/OutOfSequenceBeforeAuthenticationCallException.php
  30. 58
    0
      classes/authentication/phpCAS/source/CAS/OutOfSequenceBeforeClientException.php
  31. 59
    0
      classes/authentication/phpCAS/source/CAS/OutOfSequenceBeforeProxyException.php
  32. 49
    0
      classes/authentication/phpCAS/source/CAS/OutOfSequenceException.php
  33. 222
    0
      classes/authentication/phpCAS/source/CAS/PGTStorage/AbstractStorage.php
  34. 440
    0
      classes/authentication/phpCAS/source/CAS/PGTStorage/Db.php
  35. 259
    0
      classes/authentication/phpCAS/source/CAS/PGTStorage/File.php
  36. 72
    0
      classes/authentication/phpCAS/source/CAS/ProxiedService.php
  37. 149
    0
      classes/authentication/phpCAS/source/CAS/ProxiedService/Abstract.php
  38. 46
    0
      classes/authentication/phpCAS/source/CAS/ProxiedService/Exception.php
  39. 91
    0
      classes/authentication/phpCAS/source/CAS/ProxiedService/Http.php
  40. 360
    0
      classes/authentication/phpCAS/source/CAS/ProxiedService/Http/Abstract.php
  41. 85
    0
      classes/authentication/phpCAS/source/CAS/ProxiedService/Http/Get.php
  42. 152
    0
      classes/authentication/phpCAS/source/CAS/ProxiedService/Http/Post.php
  43. 280
    0
      classes/authentication/phpCAS/source/CAS/ProxiedService/Imap.php
  44. 75
    0
      classes/authentication/phpCAS/source/CAS/ProxiedService/Testable.php
  45. 127
    0
      classes/authentication/phpCAS/source/CAS/ProxyChain.php
  46. 119
    0
      classes/authentication/phpCAS/source/CAS/ProxyChain/AllowedList.php
  47. 64
    0
      classes/authentication/phpCAS/source/CAS/ProxyChain/Any.php
  48. 53
    0
      classes/authentication/phpCAS/source/CAS/ProxyChain/Interface.php
  49. 59
    0
      classes/authentication/phpCAS/source/CAS/ProxyChain/Trusted.php
  50. 71
    0
      classes/authentication/phpCAS/source/CAS/ProxyTicketException.php
  51. 379
    0
      classes/authentication/phpCAS/source/CAS/Request/AbstractRequest.php
  52. 146
    0
      classes/authentication/phpCAS/source/CAS/Request/CurlMultiRequest.php
  53. 199
    0
      classes/authentication/phpCAS/source/CAS/Request/CurlRequest.php
  54. 45
    0
      classes/authentication/phpCAS/source/CAS/Request/Exception.php
  55. 83
    0
      classes/authentication/phpCAS/source/CAS/Request/MultiRequestInterface.php
  56. 179
    0
      classes/authentication/phpCAS/source/CAS/Request/RequestInterface.php
  57. 70
    0
      classes/authentication/phpCAS/source/CAS/TypeMismatchException.php
  58. 55
    0
      classes/autoComplete/AutoComplete.php
  59. 22
    0
      classes/autoComplete/rpc2.php
  60. BIN
      classes/autoComplete/upArrow.png
  61. 185
    0
      classes/autoload/TurboleadAutoloader.php
  62. 220
    0
      classes/autoload/autoload_turbolead.php
  63. 62
    0
      classes/basics/lib/flag.php
  64. 100
    0
      classes/basics/lib/js.php
  65. 231
    0
      classes/basics/lib/strptime.php
  66. 29
    0
      classes/basics/singleton/Singleton.php
  67. 32
    0
      classes/basics/singleton/Singleton_4.php
  68. 50
    0
      classes/basics/singleton/Singleton_5.php
  69. 46
    0
      classes/basics/singleton/Singleton_5_3.php
  70. 297
    0
      classes/basics/xml/XMLizable.php
  71. 17
    0
      classes/basics/xml/object.dtd
  72. 246
    0
      classes/callback/CallbackMgr.php
  73. 90
    0
      classes/callback/CallbackObject.php
  74. 80
    0
      classes/commentaire/classes/CommentaireTools.php
  75. 141
    0
      classes/commentaire/classes/TreeParserListeSelect.php
  76. 182
    0
      classes/commentaire/classes/template/TURBOTemplate.php
  77. 30
    0
      classes/commentaire/classes/template/functions/modifier.modifierdate.php
  78. 30
    0
      classes/commentaire/classes/template/functions/modifier.modifierdatecommentaire.php
  79. 17
    0
      classes/commentaire/classes/template/functions/modifier.retourner_mail.php
  80. 13
    0
      classes/commentaire/const.php
  81. 153
    0
      classes/commentaire/control/TURBOCommentaireControl.php
  82. 28
    0
      classes/commentaire/language/lang_fr.php
  83. 25
    0
      classes/commentaire/language/language.php
  84. 244
    0
      classes/commentaire/lib.php
  85. 21
    0
      classes/commentaire/model/TURBOAnnuaireBean.php
  86. 55
    0
      classes/commentaire/model/TURBOAnnuaireHome.php
  87. 22
    0
      classes/commentaire/model/TURBOCommentaireBean.php
  88. 127
    0
      classes/commentaire/model/TURBOCommentaireHome.php
  89. 71
    0
      classes/commentaire/view/TURBOCommentaireView.php
  90. 80
    0
      classes/commentaire/view/TURBOCommentaireViewForm.php
  91. 39
    0
      classes/commentaire/view/TURBOCommentaireViewTree.php
  92. 415
    0
      classes/db/DAS.php
  93. 291
    0
      classes/db/DASField.php
  94. 99
    0
      classes/db/DASIndex.php
  95. 208
    0
      classes/db/DASParser.php
  96. 72
    0
      classes/db/DASSearchengine.php
  97. 548
    0
      classes/db/DASTable.php
  98. 104
    0
      classes/db/DASView.php
  99. 110
    0
      classes/db/Databases.php
  100. 0
    0
      classes/dbconnection/DBConnectionFactory.php

+ 11
- 0
.project View File

@@ -0,0 +1,11 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<projectDescription>
3
+	<name>turbolead</name>
4
+	<comment></comment>
5
+	<projects>
6
+	</projects>
7
+	<buildSpec>
8
+	</buildSpec>
9
+	<natures>
10
+	</natures>
11
+</projectDescription>

+ 108
- 0
classes/FiltreRecherche.php View File

@@ -0,0 +1,108 @@
1
+<?php
2
+// permet de memoriser des informations concernant une recherche de liste d'objet
3
+class FiltreRecherche
4
+{
5
+	var $filtrename; // nom du filtre
6
+	var $search_param; // parametre de recherche en fonction du type de recherche
7
+	var $search_type; // type de recherche par exemple pour les produits: recherche par famille, critere ou nom
8
+
9
+		
10
+	var $start_indice; // indice de debut dans une liste de recherche
11
+	var $size; // taille de la liste affichee
12
+	
13
+	var $resultlist; // result search list (array)
14
+	var $posinlist;
15
+
16
+	var $lastpos;
17
+
18
+	var $sizeonscreen;
19
+	
20
+	function FiltreRecherche($filtrename) {	
21
+		$this->resultlist=array();
22
+		$this->posinlist=0;
23
+			
24
+		$this->start_indice=0;
25
+		$this->sizeonscreen=1;
26
+		
27
+		$this->search_type="";
28
+		$this->search_param=array();
29
+		$this->filtrename=$filtrename;
30
+	}
31
+	
32
+	function cleanFilter() {
33
+		$this->resultlist=array();
34
+		$this->posinlist=0;
35
+			
36
+		$this->start_indice=0;
37
+		$this->sizeonscreen=1;
38
+		
39
+		$this->search_type="";
40
+		$this->search_param=array();		
41
+	}	
42
+	
43
+	function getStart() { return $this->start_indice; } 
44
+
45
+	function setStart($ind) { $this->start_indice=$ind; }
46
+
47
+	function setResult($result) { 
48
+		$this->resultlist=array();
49
+		$this->resultlist=$result; 
50
+	}
51
+
52
+	function getPos() { return $this->posinlist; } 
53
+
54
+	function setPos($pos) { $this->posinlist=$pos; }
55
+
56
+
57
+	function getLastPos() { return $this->lastpos; } 
58
+
59
+	function setLastPos($pos) { $this->lastpos=$pos; }
60
+
61
+
62
+	function getResult() { return $this->resultlist; } 
63
+
64
+	function getSize() { return $this->size; } 
65
+
66
+	function setSize($taille) { $this->size=$taille; }
67
+
68
+	function getSizeOnScreen() { return $this->sizeonscreen; } 
69
+
70
+	function setSizeOnScreen($taille) { $this->sizeonscreen=$taille; }
71
+
72
+	function getSearchType() { return $this->search_type; } 
73
+
74
+	function setSearchType($type) { 
75
+		$this->search_param=array();	// detruisons les anciens parametres
76
+		$this->search_type=$type; 
77
+	}
78
+	
79
+	function getParamValue($param_name) { return $this->search_param[$param_name]; }
80
+	
81
+	function getParamValuesWithNameBeginningWith($param_name) {
82
+		$result=array();
83
+		foreach($this->search_param as $key=>$value) {
84
+			if (substr($key,0,strlen($param_name))==$param_name) $result[$key]=$value;
85
+		}
86
+		return $result;
87
+	}
88
+		
89
+	
90
+	function saveFiltre($filtrename=false) {
91
+		if ($filtrename==false) $filtrename=$this->filtrename;
92
+		$_SESSION[$filtrename]=$this;
93
+	}
94
+
95
+	function addParam($param_name,$param_value) {
96
+		$this->search_param[$param_name]=$param_value;
97
+		$this->saveFiltre();
98
+	}
99
+	
100
+};
101
+
102
+function GetFiltreRecherche($filtrename) {
103
+	if (isset($_SESSION[$filtrename])) return $_SESSION[$filtrename];
104
+	$_SESSION[$filtrename]=new FiltreRecherche($filtrename); // creation d'un nouveau filtre
105
+	return $_SESSION[$filtrename];
106
+}
107
+
108
+?>

+ 244
- 0
classes/agenda/Agenda.php View File

@@ -0,0 +1,244 @@
1
+<?php
2
+include_once(dirname(__FILE__).'/../util/TurboleadPath.php');
3
+include_once(dirname(__FILE__).'/../../db/db.php'); // requis par tools
4
+include_once(dirname(__FILE__).'/../../tools/tools.php');
5
+
6
+/**
7
+ * Agenda
8
+ * @package turbolead.agenda
9
+ */
10
+class Agenda
11
+{
12
+	/**
13
+	 * Tableau des flux AgendaFeed
14
+	 * @var string[]
15
+	 */
16
+	protected $feeds;
17
+	
18
+	/**
19
+	 * Tableau des flux Google Calendar
20
+	 * @var string[]
21
+	 */
22
+	protected $gcal_feeds;
23
+	
24
+	/**
25
+	 * Options de fullCalendar.
26
+	 * @var array
27
+	 */
28
+	protected $options;
29
+	
30
+	/**
31
+	 * Callbacks js appelées par l'agenda
32
+	 * Tableau associatif de la forme cb => func_name, avec
33
+	 * cb l'identifiant de la fonction dans fullCalendar.
34
+	 * @var string[]
35
+	 */
36
+	protected $callbacks;
37
+	
38
+	/**
39
+	 * Url de la racine Turbolead (ça évite
40
+	 * d'instancier TurboleadPath à chaque fois)
41
+	 * @var string
42
+	 */
43
+	protected $turbo_url;
44
+	
45
+	/**
46
+	 * Constructeur
47
+	 */
48
+	public function __construct()
49
+	{
50
+		$this->feeds = array();
51
+		$this->gcal_feeds = array();
52
+		
53
+		$this->options = $this->defaultOptions();
54
+		$this->callbacks = array();
55
+		
56
+		$path = new TurboleadPath();
57
+		$this->turbo_url = $path->getURLTurbolead();
58
+	}
59
+	
60
+	/**
61
+	 * Ajoute un flux AgendaFeed
62
+	 * @param string $feed_url URL du flux
63
+	 */
64
+	public function addFeed($feed_url)
65
+	{
66
+		$feed_url = (string)$feed_url;
67
+		if (!in_array($feed_url,$this->feeds)) {
68
+			$this->feeds[] = $feed_url;
69
+		}
70
+	}
71
+	
72
+	/**
73
+	 * Ajoute un flux Google Calendar
74
+	 * @param string $feed_url URL du flux
75
+	 */
76
+	public function addGcal($feed_url)
77
+	{
78
+		$feed_url = (string)$feed_url;
79
+		if (!in_array($feed_url,$this->gcal_feeds)) {
80
+			$this->gcal_feeds[] = $feed_url;
81
+		}
82
+	}
83
+	
84
+	/**
85
+	 * @deprecated OBSOLETE.
86
+	 * Utilisez setOption.
87
+	 * @param string $view_name
88
+	 */
89
+	public function setDefaultView($view_name) {
90
+		$this->setOption('defaultView',(string)$view_name);
91
+	}
92
+	
93
+	/**
94
+	 * @deprecated OBSOLETE.
95
+	 * Utilisez setOption.
96
+	 * @param bool $editable
97
+	 */
98
+	public function setEditable($editable) {
99
+		$this->setOption('editable',(bool)$editable);
100
+	}
101
+	
102
+	/**
103
+	 * Modifie la valeur de l'option fullCalendar.
104
+	 * Cf. doc fullCalendar pour la liste des options
105
+	 * disponibles.
106
+	 * Exemples:
107
+	 * - defaultView
108
+	 * - allDaySlot
109
+	 * - editable
110
+	 * 
111
+	 * @param string $name Nom de l'option
112
+	 * @param mixed $value Valeur à assigner
113
+	 */
114
+	public function setOption($name,$value) {
115
+		$this->options[$name] = $value;
116
+	}
117
+	
118
+	/**
119
+	 * Enregistre la fonction de rappel.
120
+	 * - Cb_name doit correspondre à un nom valide de
121
+	 * callback fullCalendar (voir la doc fullCalendar).
122
+	 * - Func_name doit être une fonction js définie
123
+	 * dans le scope global.
124
+	 * @param string $cb_name Nom de callback
125
+	 * @param string $func_name Nom de la fonction js
126
+	 */
127
+	public function setCallback($cb_name,$func_name)
128
+	{
129
+		// Pas de vérif sur cb_name permet
130
+		// de supporter les futurs ajouts
131
+		// de fullCalendar.
132
+		$this->callbacks[$cb_name] = $func_name;
133
+	}
134
+	
135
+	/**
136
+	 * Renvoie le code html à insérer pour afficher l'agenda.
137
+	 * id_agenda servira d'id pour le div englobant de l'agenda,
138
+	 * et à nommer le fichier de config de l'agenda (dans cache/param),
139
+	 * il doit être soigneusement choisi.
140
+	 * @param string $id_agenda Id de l'agenda
141
+	 * @return string
142
+	 */
143
+	public function getHTML($id_agenda)
144
+	{
145
+		$bl = "\n";
146
+		$str = '';
147
+		
148
+		if ($id_agenda == '')
149
+		{
150
+			$error_msg = 'id_agenda ne peut pas être une chaine vide';
151
+			trigger_error($error_msg,E_USER_ERROR);
152
+		}
153
+		
154
+		$fc = $this->fullCalendar();
155
+		@write_cache($fc,'param_agenda_'.$id_agenda.'.txt');
156
+		
157
+		$script_arg = 'id_agenda='.urlencode($id_agenda);
158
+		$script_url = $this->turbo_url.'classes/agenda/fcagenda.js.php?'.$script_arg;
159
+		
160
+		$str .= '<script type="text/javascript" src="'.$script_url.'"></script>'.$bl;
161
+		$str .= '<div id="'.$id_agenda.'"></div>'.$bl;
162
+		return $str;
163
+	}
164
+	
165
+	/**
166
+	 * Renvoie un tableau des scripts js à inclure.
167
+	 * Typiquement, le tableau retourné peut être passé
168
+	 * directement à ViewScript::setJs().
169
+	 * @return string[]
170
+	 */
171
+	public function getScripts()
172
+	{
173
+		$scripts = array();
174
+		//$scripts[] = $this->turbo_url.'tools/librairiejs/fullcalendar/fullcalendar/fullcalendar.js';
175
+		$scripts[] = $this->turbo_url.'tools/librairiejs/fullcalendar/fullcalendar/fullcalendar_FR.js';
176
+		$scripts[] = $this->turbo_url.'tools/librairiejs/fullcalendar/fullcalendar/gcal.js';
177
+		return $scripts;
178
+	}
179
+	
180
+	/**
181
+	 * Renvoie les feuilles de style de l'agenda.
182
+	 * Typiquement, le tableau retourné peut être passé
183
+	 * directement à ViewScript::setCss().
184
+	 * @return string[]
185
+	 */
186
+	public function getCSS()
187
+	{
188
+		$css = array();
189
+		$css[] = $this->turbo_url.'tools/librairiejs/fullcalendar/fullcalendar/fullcalendar.css';
190
+		return $css;
191
+	}
192
+	
193
+	/**
194
+	 * Renvoie les feuilles de style de l'impression de l'agenda.
195
+	 * Typiquement, le tableau retourné peut être passé
196
+	 * directement à ViewScript::setCss().
197
+	 * @return string[]
198
+	 */
199
+	public function getCSSPrint()
200
+	{
201
+		$css = array();
202
+		$css[] = $this->turbo_url.'tools/librairiejs/fullcalendar/fullcalendar/fullcalendar.print.css';
203
+		return $css;
204
+	}
205
+	
206
+	/**
207
+	 * Renvoie un tableau associatif de paramètres pour fullCalendar
208
+	 * d'après les options de l'objet Agenda.
209
+	 * Ce tableau est notamment propre à être convertit en JSON,
210
+	 * puis passé à l'initialisation de fullCalendar. Les paramètres
211
+	 * "non standard" seront ignorés par fullCalendar (normalement).
212
+	 * @return array
213
+	 */
214
+	protected function fullCalendar()
215
+	{
216
+		$fc = $this->options; // copie
217
+		
218
+		// Feeds
219
+		$fc['eventSources'] = $this->feeds;
220
+		$fc['gcalFeeds'] = $this->gcal_feeds; // non standard
221
+		
222
+		// Callbacks
223
+		$fc['callbacks'] = $this->callbacks; // non standard
224
+		
225
+		return $fc;
226
+	}
227
+	
228
+	/**
229
+	 * Renvoie le tableau d'options par défaut
230
+	 * de fullCalendar.
231
+	 * @return array
232
+	 */
233
+	protected function defaultOptions()
234
+	{
235
+		$options = array(
236
+		
237
+			'defaultView'	=> 'month',
238
+			'allDaySlot'	=> false,
239
+			'editable'		=> false,
240
+		);
241
+		return $options;
242
+	}
243
+}
244
+?>

+ 87
- 0
classes/agenda/AgendaFeed.php View File

@@ -0,0 +1,87 @@
1
+<?php
2
+/**
3
+ * Agenda feed
4
+ * => Flux d'événements pour l'Agenda
5
+ * @package turbolead.agenda
6
+ */
7
+class AgendaFeed
8
+{
9
+	/**
10
+	 * Tableau des événements du flux
11
+	 * @var array
12
+	 */
13
+	protected $events;
14
+	
15
+	/**
16
+	 * Début de la période que réclame l'agenda
17
+	 * @var timestamp
18
+	 */
19
+	protected $start_time;
20
+	
21
+	/**
22
+	 * Fin de la période que réclame l'agenda
23
+	 * @var timestamp
24
+	 */
25
+	protected $end_time;
26
+	
27
+	/**
28
+	 * Constructeur.
29
+	 * Récupère les paramètres de début et de fin fournis
30
+	 * par fullCalendar lors de l'appel AJAX.
31
+	 */
32
+	public function __construct()
33
+	{
34
+		$this->events = array();
35
+		$this->start_time = 0;
36
+		$this->end_time = 0;
37
+		
38
+		if (isset($_REQUEST['start_time'])) {
39
+			$this->start_time = (int)$_REQUEST['start_time'];
40
+		}
41
+		if (isset($_REQUEST['end_time'])) {
42
+			$this->end_time = (int)$_REQUEST['end_time'];
43
+		}
44
+	}
45
+	
46
+	/**
47
+	 * Ajoute un événement au flux.
48
+	 * Event est un tableau associatif qui doit correspondre
49
+	 * à Event Object de fullCalendar (=> voir la doc fullCalendar
50
+	 * pour les clés possibles et leur signification).
51
+	 * Note: les chaines de caractères doivent être en utf8 !
52
+	 * @param array $event
53
+	 */
54
+	public function addEvent(&$event)
55
+	{
56
+		$this->events[] = $event;
57
+	}
58
+	
59
+	/**
60
+	 * Renvoie le timestamp UNIX du début de la
61
+	 * période demandée par l'agenda
62
+	 * @return timestamp
63
+	 */
64
+	public function getStartTime() {
65
+		return $this->start_time;
66
+	}
67
+	
68
+	/**
69
+	 * Renvoie le timestamp UNIX de la fin de la
70
+	 * période demandée par l'agenda
71
+	 * @return timestamp
72
+	 */
73
+	public function getEndTime() {
74
+		return $this->end_time;
75
+	}
76
+	
77
+	/**
78
+	 * Renvoie le flux au format JSON
79
+	 * @return string
80
+	 */
81
+	public function getJSON()
82
+	{
83
+		// Vive PHP5 \o/
84
+		return json_encode($this->events);
85
+	}
86
+}
87
+?>

+ 94
- 0
classes/agenda/fcagenda.js.php View File

@@ -0,0 +1,94 @@
1
+<?php
2
+#
3
+# fcagenda.js.php
4
+# Génére le script JS qui initialise l'agenda
5
+# en utilisant fullCalendar
6
+#
7
+# Le programme doit être en utf8 afin que les fonctions
8
+# de conversion php/json fonctionnent (entre autre)
9
+#
10
+mb_internal_encoding('UTF-8');
11
+header('Content-type: application/x-javascript; charset=UTF-8');
12
+
13
+include_once(dirname(__FILE__).'/../../db/db.php'); // requis par tools
14
+include_once(dirname(__FILE__).'/../../tools/tools.php');
15
+
16
+$idAgenda = '';
17
+$fcJSON = '{}';
18
+
19
+if (isset($_GET['id_agenda']))
20
+{
21
+	$idAgenda = urldecode($_GET['id_agenda']);
22
+	$idAgenda = strtr($idAgenda,'\\/:','___'); // interdit de se balader dans l'arboresence
23
+	
24
+	$fc = NULL;
25
+	@read_cache($fc,'param_agenda_'.$idAgenda.'.txt');
26
+	if (is_array($fc))
27
+	{
28
+		$fcJSON = json_encode($fc);
29
+	}
30
+}
31
+/*
32
+if ($idAgenda == '')
33
+{
34
+	// Pas la peine d'intialiser fullCalendar puisqu'il
35
+	// ne trouvera pas le div correspondant
36
+	exit;
37
+}
38
+//*/
39
+?>$(document).ready(function()
40
+{
41
+	var defaultParam =
42
+	{
43
+		aspectRatio: 2,
44
+		defaultView: "month",
45
+		timeFormat: "HH:mm",
46
+		axisFormat: "HH:mm",
47
+		allDaySlot: false,
48
+		slotMinutes: 30,
49
+		
50
+		startParam: "start_time", // pour AgendaFeed
51
+		endParam: "end_time", // pour AgendaFeed
52
+		
53
+		editable: false,
54
+		
55
+		header: {
56
+			left: "prev,next,today",
57
+			center: "title",
58
+			right: "month,agendaWeek,agendaDay"
59
+		}
60
+	};
61
+	var fcParam = $.parseJSON('<?php echo $fcJSON; ?>');
62
+	
63
+	// Feeds
64
+	if (!fcParam.eventSources) {
65
+		fcParam.eventSources = new Array();
66
+	}
67
+	if (fcParam.gcalFeeds)
68
+	{
69
+		for (i in fcParam.gcalFeeds)
70
+		{
71
+			var url = fcParam.gcalFeeds[i];
72
+			var feed = $.fullCalendar.gcalFeed(url,{className:"gcal"});
73
+			fcParam.eventSources.push(feed);
74
+		}
75
+		delete fcParam.gcalFeeds;
76
+	}
77
+	
78
+	// Callbacks
79
+	if (fcParam.callbacks)
80
+	{
81
+		for (cb in fcParam.callbacks)
82
+		{
83
+			var funcName = fcParam.callbacks[cb];
84
+			fcParam[cb] = window[funcName]; // window = scope global
85
+		}
86
+		delete fcParam.callbacks;
87
+	}
88
+	
89
+	// Merge les parametres
90
+	fcParam = $.extend(defaultParam,fcParam);
91
+	
92
+	// Init fullCalendar
93
+	$('#<?php echo $idAgenda; ?>').fullCalendar(fcParam);
94
+});

+ 50
- 0
classes/archive/model/ArchiveBean.php View File

@@ -0,0 +1,50 @@
1
+<?php
2
+include_once(dirname(__FILE__).'/../../tpb/model/ObjectBean.php');
3
+
4
+/**
5
+ * Ceci est une ligne d'archive.
6
+ * @package archive.model
7
+ */
8
+class ArchiveBean extends ObjectBean
9
+{
10
+	/**
11
+	 * Constructeur
12
+	 * Inutile de surcharger le constructeur
13
+	 * car il n'y a pas de clé primaire.
14
+	 * @param mixed $object
15
+	 */
16
+	/*public function __construct($object){
17
+		parent::ObjectBean($object);
18
+	}*/
19
+	
20
+	/**
21
+	 * Renvoie true si le xmlObject est valide,
22
+	 * c'est à dire propre à être archivé,
23
+	 * ou sinon renvoie false.
24
+	 * Les fonctions du DOMDocument sont appelées en
25
+	 * silence (@) car elles génèrent des erreurs au
26
+	 * lieu de produire des exceptions.
27
+	 * @return bool
28
+	 */
29
+	public function validate()
30
+	{
31
+		$xmlObject = $this->getAttribut('xml_object');
32
+		
33
+		// Charger le XML dans un objet DOMDocument
34
+		// permet déjà de vérifier que le XML
35
+		// est bien formé.
36
+		$domDoc = new DOMDocument('1.0','UTF-8');
37
+		if (!@$domDoc->loadXML($xmlObject)){
38
+			return false;
39
+		}
40
+		
41
+		// Ensuite on vérifie si un schéma est fourni,
42
+		// auquel cas le XML doit valider ce schéma.
43
+		$xmlSchema = $this->getAttribut('xml_schema');
44
+		if ($xmlSchema){
45
+			return @$domDoc->schemaValidateSource($xmlSchema);
46
+		}
47
+		return true;
48
+	}
49
+}
50
+?>

+ 48
- 0
classes/archive/model/ArchiveErrorBean.php View File

@@ -0,0 +1,48 @@
1
+<?php
2
+include_once(dirname(__FILE__).'/../../tpb/model/ObjectBean.php');
3
+
4
+/**
5
+ * Objet Erreur d'archivage.
6
+ * @package archive.model
7
+ */
8
+class ArchiveErrorBean extends ObjectBean
9
+{
10
+	//===========================================
11
+	// CODES D'ERREUR
12
+	//===========================================
13
+	const NO_ERROR = 0;
14
+	
15
+	/**
16
+	 * Constructeur
17
+	 * @param mixed $object
18
+	 */
19
+	public function __construct($object){
20
+		parent::ObjectBean($object,'id_archiveerror');
21
+	}
22
+	
23
+	/**
24
+	 * Copie les attributs xml de l'objet
25
+	 * ArchiveBean dans l'objet ErrorBean.
26
+	 * @param ArchiveBean $archive
27
+	 */
28
+	public function setFromArchive($archive)
29
+	{
30
+		$this->setAttribut('xml_object',$archive->getAttribut('xml_object'));
31
+		$this->setAttribut('xml_schema',$archive->getAttribut('xml_schema'));
32
+	}
33
+	
34
+	/**
35
+	 * Diagnostique l'objet et renvoie
36
+	 * le code d'erreur approprié.
37
+	 * @return int
38
+	 * 
39
+	 * @todo A implémenter
40
+	 */
41
+	public function getErrorCode()
42
+	{
43
+		//@todo
44
+		
45
+		return self::NO_ERROR;
46
+	}
47
+}
48
+?>

+ 56
- 0
classes/archive/model/ArchiveErrorHome.php View File

@@ -0,0 +1,56 @@
1
+<?php
2
+include_once(dirname(__FILE__).'/../../tpb/model/ObjectHome.php');
3
+include_once(dirname(__FILE__).'/ArchiveErrorBean.php');
4
+
5
+/**
6
+ * Manager des erreurs d'archivage.
7
+ * @package archive.model
8
+ */
9
+class ArchiveErrorHome extends ObjectHome
10
+{
11
+	/**
12
+	 * Constructeur
13
+	 * @access protected
14
+	 */
15
+	protected function __construct(){
16
+		parent::ObjectHome(DAS::create(dirname(__FILE__).'/../../../model/das.php','turbolead'));
17
+	}
18
+	
19
+	/**
20
+	 * Insert une nouvelle ligne dans la db.
21
+	 * @param array|ObjectBean $object
22
+	 * @return int
23
+	 */
24
+	public function addObject($object)
25
+	{
26
+		$aData = $object;
27
+		if (is_object($object)){
28
+			$aData = $object->getTableau();
29
+		}
30
+		
31
+		//Horodatage
32
+		$aData['date'] = date('Y-m-d H:i:s');
33
+		
34
+		return parent::addObject($aData);
35
+	}
36
+	
37
+	/**
38
+	 * Renvoie toutes les erreurs d'archivage
39
+	 * de la table spécifiée.
40
+	 * @param string $tableName Nom de la table
41
+	 * @return ArchiveErrorBean[]
42
+	 */
43
+	public function getErrorsByTable($tableName)
44
+	{
45
+		$tableName = $this->db->escape($tableName);
46
+		
47
+		$query = 'SELECT id_archiveerror FROM turbo_archiveerror';
48
+		$query.= ' WHERE target_table="'.$tableName.'"';
49
+		$query.= ' ORDER BY date DESC';
50
+		
51
+		$result = $this->db->sql_query($query);
52
+		
53
+		return $this->getResultAsObjects($result);
54
+	}
55
+}
56
+?>

+ 237
- 0
classes/archive/model/ArchiveManager.php View File

@@ -0,0 +1,237 @@
1
+<?php
2
+#
3
+# ArchiveManager.php
4
+#
5
+include_once(dirname(__FILE__).'/../../../db/db.php');
6
+include_once(dirname(__FILE__).'/../../basics/singleton/Singleton.php');
7
+include_once(dirname(__FILE__).'/ArchiveBean.php');
8
+include_once(dirname(__FILE__).'/ArchiveErrorHome.php');
9
+
10
+/**
11
+ * Manager des archives.
12
+ * CECI N'EST PAS UN HOME.
13
+ * 
14
+ * @package archive.model
15
+ * @version $Revision: 1.6 $
16
+ */
17
+abstract class ArchiveManager extends Singleton
18
+{
19
+	/**
20
+	 * Nom de la table visée.
21
+	 * @var string
22
+	 */
23
+	protected $tableName;
24
+	
25
+	/**
26
+	 * Dernière erreur générée.
27
+	 * @var ArchiveErrorBean
28
+	 */
29
+	private $lastError;
30
+	
31
+	/**
32
+	 * Interface d'accès à la base de données.
33
+	 * @var DBConnectionInterface
34
+	 */
35
+	protected $db;
36
+	
37
+	/**
38
+	 * Constructeur
39
+	 * Le constructeur doit être surchargé.
40
+	 * @param string $tableName
41
+	 * @access protected
42
+	 */
43
+	protected function __construct($tableName)
44
+	{
45
+		$this->tableName = $tableName;
46
+		$this->lastError = NULL;
47
+		
48
+		//Base de donnée courante.
49
+		$databases = Databases::getInstance();
50
+		$this->db = $databases->getDB();
51
+	}
52
+	
53
+	/**
54
+	 * Crée un objet ArchiveBean.
55
+	 * @param string|array|ObjectBean $data
56
+	 * @return ArchiveBean
57
+	 */
58
+	public function create($data=NULL)
59
+	{
60
+		$aData = array();
61
+		if ($data !== NULL)
62
+		{
63
+			if (is_array($data) || is_object($data))
64
+			{
65
+				$aData = $data;
66
+			}
67
+			else
68
+			{
69
+				$aData['xml_object'] = $data;
70
+			}
71
+		}
72
+		return new ArchiveBean($aData);
73
+	}
74
+	
75
+	/**
76
+	 * Enregistre l'objet archive après avoir vérifié son intégrité.
77
+	 * Si l'archive n'est pas intègre alors un ligne d'erreur est créée.
78
+	 * Renvoie true si l'archive a été correctement sauvée,
79
+	 * ou false si une erreur a été générée.
80
+	 * @param ArchiveBean $archive
81
+	 * @return bool
82
+	 */
83
+	public function store($archive)
84
+	{
85
+		if ($archive->validate())
86
+		{
87
+			//INSERT
88
+			if ($this->addArchive($archive)){
89
+				return true;
90
+			}
91
+		}
92
+		
93
+		//==> Erreur
94
+		$this->addError($archive);
95
+		return false;
96
+	}
97
+	
98
+	/**
99
+	 * 
100
+	 * Enter description here ...
101
+	 * @param string $xmlObject
102
+	 * @return bool
103
+	 */
104
+	public function storeXML($xmlObject)
105
+	{
106
+		$aData = array();
107
+		$aData['xml_object'] = $xmlObject;
108
+		//$aData['xml_schema'] = $xmlSchema;
109
+		
110
+		$archive = $this->create($aData);
111
+		
112
+		return $this->store($archive);
113
+	}
114
+	
115
+	/**
116
+	 * Exécute la requête SQL en argument et renvoie
117
+	 * les lignes trouvées sous forme de ArchiveBean. 
118
+	 * @param string $query Requête SQL
119
+	 * @return ArchiveBean[]
120
+	 */
121
+	public function getArchivesByQuery($query)
122
+	{
123
+		//Connexion mysql utf8
124
+		$result = $this->sql_query_utf8($query,true);
125
+		$archives = array();
126
+		
127
+		while ($row = $this->db->sql_fetchrow_assoc($result)){
128
+			$archives[] = $this->create($row);
129
+		}
130
+		return $archives;
131
+	}
132
+	
133
+	/**
134
+	 * Renvoie la dernière erreur générée par ce manager
135
+	 * sous la forme d'un objet ArchiveErrorBean,
136
+	 * ou renvoie NULL si aucune.
137
+	 * @return ArchiveErrorBean
138
+	 */
139
+	public function getLastError(){
140
+		return $this->lastError;
141
+	}
142
+	
143
+	/**
144
+	 * Renvoie le nom de la table sur laquelle
145
+	 * est branché le manager.
146
+	 * @return string
147
+	 */
148
+	public function getTableName(){
149
+		return $this->tableName;
150
+	}
151
+	
152
+	/**
153
+	 * Insert l'objet Archive dans la db et
154
+	 * renvoie true si l'insertion est réussie.
155
+	 * @param ArchiveBean $archive
156
+	 * @return bool
157
+	 */
158
+	private function addArchive($archive)
159
+	{
160
+		$aData = array();
161
+		$aCols = array();
162
+		$aVals = array();
163
+		
164
+		//Horodatage
165
+		$date = $archive->getAttribut('date');
166
+		if (!$date){
167
+			$date = date('Y-m-d H:i:s'); //Maintenant
168
+		}
169
+		$aData['date'] = $date;
170
+		
171
+		$aData['xml_object'] = $archive->getAttribut('xml_object');
172
+		
173
+		$xmlSchema = $archive->getAttribut('xml_schema');
174
+		if ($xmlSchema){
175
+			$aData['xml_schema'] = $xmlSchema;
176
+		}
177
+		
178
+		foreach ($aData as $colName => $value)
179
+		{
180
+			$aCols[] = '`'.$colName.'`';
181
+			$aVals[] = '"'.$this->db->escape($value).'"';
182
+		}
183
+		
184
+		//REQUETE INSERT
185
+		$query = 'INSERT INTO `'.$this->tableName.'`';
186
+		$query.= ' ('.implode(',',$aCols).')';
187
+		$query.= ' VALUES('.implode(',',$aVals).')';
188
+		
189
+		//echo $query.'<br/>';
190
+		//On envoie les données en UTF8
191
+		$this->sql_query_utf8($query,true);
192
+		
193
+		return true;
194
+	}
195
+	
196
+	/**
197
+	 * Insert une erreur dans la db contenant les
198
+	 * données de l'objet Archive spécifié.
199
+	 * @param ArchiveBean $archive
200
+	 */
201
+	private function addError($archive)
202
+	{
203
+		$homeError = ArchiveErrorHome::getInstance('ArchiveErrorHome');
204
+		
205
+		//Objet Error
206
+		$error = $homeError->create();
207
+		$error->setFromArchive($archive);
208
+		$error->setAttribut('target_table',$this->tableName);
209
+		
210
+		//INSERT
211
+		$idError = $homeError->addObject($error);
212
+		
213
+		$lastError = $homeError->get($idError);
214
+		if ($lastError){
215
+			$this->lastError = $lastError;
216
+		}
217
+	}
218
+	
219
+	/**
220
+	 * Ne fait rien d'autre que sql_query
221
+	 * depuis qu'on est passé à UTF-8.
222
+	 * @param string $query
223
+	 * @return resource
224
+	 * @access private
225
+	 */
226
+	private function sql_query_utf8($query)
227
+	{
228
+		//1)
229
+		//$this->db->sql_query('SET NAMES utf8',true);
230
+		//2)
231
+		$result = $this->db->sql_query($query,true);
232
+		//3)
233
+		//$this->db->sql_query('SET NAMES default',true);
234
+		return $result;
235
+	}
236
+}
237
+?>

+ 30
- 0
classes/authentication/phpCAS/CAS.php View File

@@ -0,0 +1,30 @@
1
+<?php
2
+
3
+/**
4
+ * Licensed to Jasig under one or more contributor license
5
+ * agreements. See the NOTICE file distributed with this work for
6
+ * additional information regarding copyright ownership.
7
+ *
8
+ * Jasig licenses this file to you under the Apache License,
9
+ * Version 2.0 (the "License"); you may not use this file except in
10
+ * compliance with the License. You may obtain a copy of the License at:
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ *  PHP Version 5
21
+ *
22
+ * @file     CAS.php
23
+ * @category Authentication
24
+ * @package  PhpCAS
25
+ * @author   Adam Franco <afranco@middlebury.edu>
26
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
27
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
28
+ */
29
+
30
+require_once dirname(__FILE__).'/source/CAS.php';

+ 201
- 0
classes/authentication/phpCAS/LICENSE View File

@@ -0,0 +1,201 @@
1
+                                 Apache License
2
+                           Version 2.0, January 2004
3
+                        http://www.apache.org/licenses/
4
+
5
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+   1. Definitions.
8
+
9
+      "License" shall mean the terms and conditions for use, reproduction,
10
+      and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+      "Licensor" shall mean the copyright owner or entity authorized by
13
+      the copyright owner that is granting the License.
14
+
15
+      "Legal Entity" shall mean the union of the acting entity and all
16
+      other entities that control, are controlled by, or are under common
17
+      control with that entity. For the purposes of this definition,
18
+      "control" means (i) the power, direct or indirect, to cause the
19
+      direction or management of such entity, whether by contract or
20
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+      outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+      "You" (or "Your") shall mean an individual or Legal Entity
24
+      exercising permissions granted by this License.
25
+
26
+      "Source" form shall mean the preferred form for making modifications,
27
+      including but not limited to software source code, documentation
28
+      source, and configuration files.
29
+
30
+      "Object" form shall mean any form resulting from mechanical
31
+      transformation or translation of a Source form, including but
32
+      not limited to compiled object code, generated documentation,
33
+      and conversions to other media types.
34
+
35
+      "Work" shall mean the work of authorship, whether in Source or
36
+      Object form, made available under the License, as indicated by a
37
+      copyright notice that is included in or attached to the work
38
+      (an example is provided in the Appendix below).
39
+
40
+      "Derivative Works" shall mean any work, whether in Source or Object
41
+      form, that is based on (or derived from) the Work and for which the
42
+      editorial revisions, annotations, elaborations, or other modifications
43
+      represent, as a whole, an original work of authorship. For the purposes
44
+      of this License, Derivative Works shall not include works that remain
45
+      separable from, or merely link (or bind by name) to the interfaces of,
46
+      the Work and Derivative Works thereof.
47
+
48
+      "Contribution" shall mean any work of authorship, including
49
+      the original version of the Work and any modifications or additions
50
+      to that Work or Derivative Works thereof, that is intentionally
51
+      submitted to Licensor for inclusion in the Work by the copyright owner
52
+      or by an individual or Legal Entity authorized to submit on behalf of
53
+      the copyright owner. For the purposes of this definition, "submitted"
54
+      means any form of electronic, verbal, or written communication sent
55
+      to the Licensor or its representatives, including but not limited to
56
+      communication on electronic mailing lists, source code control systems,
57
+      and issue tracking systems that are managed by, or on behalf of, the
58
+      Licensor for the purpose of discussing and improving the Work, but
59
+      excluding communication that is conspicuously marked or otherwise
60
+      designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+      "Contributor" shall mean Licensor and any individual or Legal Entity
63
+      on behalf of whom a Contribution has been received by Licensor and
64
+      subsequently incorporated within the Work.
65
+
66
+   2. Grant of Copyright License. Subject to the terms and conditions of
67
+      this License, each Contributor hereby grants to You a perpetual,
68
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+      copyright license to reproduce, prepare Derivative Works of,
70
+      publicly display, publicly perform, sublicense, and distribute the
71
+      Work and such Derivative Works in Source or Object form.
72
+
73
+   3. Grant of Patent License. Subject to the terms and conditions of
74
+      this License, each Contributor hereby grants to You a perpetual,
75
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+      (except as stated in this section) patent license to make, have made,
77
+      use, offer to sell, sell, import, and otherwise transfer the Work,
78
+      where such license applies only to those patent claims licensable
79
+      by such Contributor that are necessarily infringed by their
80
+      Contribution(s) alone or by combination of their Contribution(s)
81
+      with the Work to which such Contribution(s) was submitted. If You
82
+      institute patent litigation against any entity (including a
83
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+      or a Contribution incorporated within the Work constitutes direct
85
+      or contributory patent infringement, then any patent licenses
86
+      granted to You under this License for that Work shall terminate
87
+      as of the date such litigation is filed.
88
+
89
+   4. Redistribution. You may reproduce and distribute copies of the
90
+      Work or Derivative Works thereof in any medium, with or without
91
+      modifications, and in Source or Object form, provided that You
92
+      meet the following conditions:
93
+
94
+      (a) You must give any other recipients of the Work or
95
+          Derivative Works a copy of this License; and
96
+
97
+      (b) You must cause any modified files to carry prominent notices
98
+          stating that You changed the files; and
99
+
100
+      (c) You must retain, in the Source form of any Derivative Works
101
+          that You distribute, all copyright, patent, trademark, and
102
+          attribution notices from the Source form of the Work,
103
+          excluding those notices that do not pertain to any part of
104
+          the Derivative Works; and
105
+
106
+      (d) If the Work includes a "NOTICE" text file as part of its
107
+          distribution, then any Derivative Works that You distribute must
108
+          include a readable copy of the attribution notices contained
109
+          within such NOTICE file, excluding those notices that do not
110
+          pertain to any part of the Derivative Works, in at least one
111
+          of the following places: within a NOTICE text file distributed
112
+          as part of the Derivative Works; within the Source form or
113
+          documentation, if provided along with the Derivative Works; or,
114
+          within a display generated by the Derivative Works, if and
115
+          wherever such third-party notices normally appear. The contents
116
+          of the NOTICE file are for informational purposes only and
117
+          do not modify the License. You may add Your own attribution
118
+          notices within Derivative Works that You distribute, alongside
119
+          or as an addendum to the NOTICE text from the Work, provided
120
+          that such additional attribution notices cannot be construed
121
+          as modifying the License.
122
+
123
+      You may add Your own copyright statement to Your modifications and
124
+      may provide additional or different license terms and conditions
125
+      for use, reproduction, or distribution of Your modifications, or
126
+      for any such Derivative Works as a whole, provided Your use,
127
+      reproduction, and distribution of the Work otherwise complies with
128
+      the conditions stated in this License.
129
+
130
+   5. Submission of Contributions. Unless You explicitly state otherwise,
131
+      any Contribution intentionally submitted for inclusion in the Work
132
+      by You to the Licensor shall be under the terms and conditions of
133
+      this License, without any additional terms or conditions.
134
+      Notwithstanding the above, nothing herein shall supersede or modify
135
+      the terms of any separate license agreement you may have executed
136
+      with Licensor regarding such Contributions.
137
+
138
+   6. Trademarks. This License does not grant permission to use the trade
139
+      names, trademarks, service marks, or product names of the Licensor,
140
+      except as required for reasonable and customary use in describing the
141
+      origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+   7. Disclaimer of Warranty. Unless required by applicable law or
144
+      agreed to in writing, Licensor provides the Work (and each
145
+      Contributor provides its Contributions) on an "AS IS" BASIS,
146
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+      implied, including, without limitation, any warranties or conditions
148
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+      PARTICULAR PURPOSE. You are solely responsible for determining the
150
+      appropriateness of using or redistributing the Work and assume any
151
+      risks associated with Your exercise of permissions under this License.
152
+
153
+   8. Limitation of Liability. In no event and under no legal theory,
154
+      whether in tort (including negligence), contract, or otherwise,
155
+      unless required by applicable law (such as deliberate and grossly
156
+      negligent acts) or agreed to in writing, shall any Contributor be
157
+      liable to You for damages, including any direct, indirect, special,
158
+      incidental, or consequential damages of any character arising as a
159
+      result of this License or out of the use or inability to use the
160
+      Work (including but not limited to damages for loss of goodwill,
161
+      work stoppage, computer failure or malfunction, or any and all
162
+      other commercial damages or losses), even if such Contributor
163
+      has been advised of the possibility of such damages.
164
+
165
+   9. Accepting Warranty or Additional Liability. While redistributing
166
+      the Work or Derivative Works thereof, You may choose to offer,
167
+      and charge a fee for, acceptance of support, warranty, indemnity,
168
+      or other liability obligations and/or rights consistent with this
169
+      License. However, in accepting such obligations, You may act only
170
+      on Your own behalf and on Your sole responsibility, not on behalf
171
+      of any other Contributor, and only if You agree to indemnify,
172
+      defend, and hold each Contributor harmless for any liability
173
+      incurred by, or claims asserted against, such Contributor by reason
174
+      of your accepting any such warranty or additional liability.
175
+
176
+   END OF TERMS AND CONDITIONS
177
+
178
+   APPENDIX: How to apply the Apache License to your work.
179
+
180
+      To apply the Apache License to your work, attach the following
181
+      boilerplate notice, with the fields enclosed by brackets "[]"
182
+      replaced with your own identifying information. (Don't include
183
+      the brackets!)  The text should be enclosed in the appropriate
184
+      comment syntax for the file format. We also recommend that a
185
+      file or class name and description of purpose be included on the
186
+      same "printed page" as the copyright notice for easier
187
+      identification within third-party archives.
188
+
189
+   Copyright [yyyy] [name of copyright owner]
190
+
191
+   Licensed under the Apache License, Version 2.0 (the "License");
192
+   you may not use this file except in compliance with the License.
193
+   You may obtain a copy of the License at
194
+
195
+       http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+   Unless required by applicable law or agreed to in writing, software
198
+   distributed under the License is distributed on an "AS IS" BASIS,
199
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+   See the License for the specific language governing permissions and
201
+   limitations under the License.

+ 81
- 0
classes/authentication/phpCAS/NOTICE View File

@@ -0,0 +1,81 @@
1
+Copyright 2007-2011, JA-SIG, Inc.
2
+This project includes software developed by Jasig.
3
+http://www.jasig.org/
4
+
5
+Licensed under the Apache License, Version 2.0 (the "License");
6
+you may not use this software except in compliance with the License.
7
+You may obtain a copy of the License at:
8
+
9
+http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+Unless required by applicable law or agreed to in writing, software
12
+distributed under the License is distributed on an "AS IS" BASIS,
13
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+See the License for the specific language governing permissions and
15
+limitations under the License.
16
+
17
+===========================================================================
18
+
19
+Copyright © 2003-2007, The ESUP-Portail consortium
20
+
21
+Requirements for sources originally licensed under the New BSD License:
22
+
23
+Redistribution and use in source and binary forms, with or without
24
+modification, are permitted provided that the following conditions
25
+are met:
26
+
27
+- Redistributions of source code must retain the above copyright notice,
28
+this list of conditions and the following disclaimer.
29
+
30
+- Redistributions in binary form must reproduce the above copyright notice,
31
+this list of conditions and the following disclaimer in the documentation
32
+and/or other materials provided with the distribution.
33
+
34
+- Neither the name of JA-SIG, Inc. nor the names of its contributors may be
35
+used to endorse or promote products derived from this software without
36
+specific prior written permission.
37
+
38
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
39
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
41
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
42
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
43
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
44
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
45
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
46
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
47
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
48
+POSSIBILITY OF SUCH DAMAGE.
49
+
50
+===========================================================================
51
+
52
+Copyright (c) 2009, Regents of the University of Nebraska
53
+All rights reserved.
54
+
55
+Requirements for CAS_Autloader originally licensed under the New BSD License:
56
+
57
+Redistribution and use in source and binary forms, with or without modification,
58
+are permitted provided that the following conditions are met:
59
+
60
+Redistributions of source code must retain the above copyright notice, this list
61
+of conditions and the following disclaimer.
62
+
63
+Redistributions in binary form must reproduce the above copyright notice, this
64
+list of conditions and the following disclaimer in the documentation and/or
65
+other materials provided with the distribution.
66
+
67
+Neither the name of the University of Nebraska nor the names of its contributors
68
+may be used to endorse or promote products derived from this software without
69
+specific prior written permission.
70
+
71
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
72
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
73
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
74
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
75
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
76
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
77
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
78
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
79
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
80
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
81
+POSSIBILITY OF SUCH DAMAGE.

+ 1892
- 0
classes/authentication/phpCAS/source/CAS.php
File diff suppressed because it is too large
View File


+ 108
- 0
classes/authentication/phpCAS/source/CAS/AuthenticationException.php View File

@@ -0,0 +1,108 @@
1
+<?php
2
+
3
+/**
4
+ * Licensed to Jasig under one or more contributor license
5
+ * agreements. See the NOTICE file distributed with this work for
6
+ * additional information regarding copyright ownership.
7
+ *
8
+ * Jasig licenses this file to you under the Apache License,
9
+ * Version 2.0 (the "License"); you may not use this file except in
10
+ * compliance with the License. You may obtain a copy of the License at:
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * PHP Version 5
21
+ *
22
+ * @file     CAS/AuthenticationException.php
23
+ * @category Authentication
24
+ * @package  PhpCAS
25
+ * @author   Joachim Fritschi <jfritschi@freenet.de>
26
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
27
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
28
+ */
29
+
30
+/**
31
+ * This interface defines methods that allow proxy-authenticated service handlers
32
+ * to interact with phpCAS.
33
+ *
34
+ * Proxy service handlers must implement this interface as well as call
35
+ * phpCAS::initializeProxiedService($this) at some point in their implementation.
36
+ *
37
+ * While not required, proxy-authenticated service handlers are encouraged to
38
+ * implement the CAS_ProxiedService_Testable interface to facilitate unit testing.
39
+ *
40
+ * @class    CAS_AuthenticationException
41
+ * @category Authentication
42
+ * @package  PhpCAS
43
+ * @author   Joachim Fritschi <jfritschi@freenet.de>
44
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
45
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
46
+ */
47
+
48
+class CAS_AuthenticationException
49
+extends RuntimeException
50
+implements CAS_Exception
51
+{
52
+
53
+    /**
54
+     * This method is used to print the HTML output when the user was not
55
+     * authenticated.
56
+     *
57
+     * @param CAS_Client $client       phpcas client
58
+     * @param string     $failure      the failure that occured
59
+     * @param string     $cas_url      the URL the CAS server was asked for
60
+     * @param bool       $no_response  the response from the CAS server (other
61
+     * parameters are ignored if TRUE)
62
+     * @param bool       $bad_response bad response from the CAS server ($err_code
63
+     * and $err_msg ignored if TRUE)
64
+     * @param string     $cas_response the response of the CAS server
65
+     * @param int        $err_code     the error code given by the CAS server
66
+     * @param string     $err_msg      the error message given by the CAS server
67
+     */
68
+    public function __construct($client,$failure,$cas_url,$no_response,
69
+        $bad_response='',$cas_response='',$err_code='',$err_msg=''
70
+    ) {
71
+        phpCAS::traceBegin();
72
+        $lang = $client->getLangObj();
73
+        $client->printHTMLHeader($lang->getAuthenticationFailed());
74
+        printf(
75
+            $lang->getYouWereNotAuthenticated(),
76
+            htmlentities($client->getURL()),
77
+            isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN']:''
78
+        );
79
+        phpCAS::trace('CAS URL: '.$cas_url);
80
+        phpCAS::trace('Authentication failure: '.$failure);
81
+        if ( $no_response ) {
82
+            phpCAS::trace('Reason: no response from the CAS server');
83
+        } else {
84
+            if ( $bad_response ) {
85
+                phpCAS::trace('Reason: bad response from the CAS server');
86
+            } else {
87
+                switch ($client->getServerVersion()) {
88
+                case CAS_VERSION_1_0:
89
+                    phpCAS::trace('Reason: CAS error');
90
+                    break;
91
+                case CAS_VERSION_2_0:
92
+                case CAS_VERSION_3_0:
93
+                    if ( empty($err_code) ) {
94
+                        phpCAS::trace('Reason: no CAS error');
95
+                    } else {
96
+                        phpCAS::trace('Reason: ['.$err_code.'] CAS error: '.$err_msg);
97
+                    }
98
+                    break;
99
+                }
100
+            }
101
+            phpCAS::trace('CAS response: '.$cas_response);
102
+        }
103
+        $client->printHTMLFooter();
104
+        phpCAS::traceExit();
105
+    }
106
+
107
+}
108
+?>

+ 105
- 0
classes/authentication/phpCAS/source/CAS/Autoload.php View File

@@ -0,0 +1,105 @@
1
+<?php
2
+
3
+/**
4
+ * Autoloader Class
5
+ *
6
+ *  PHP Version 5
7
+ *
8
+ * @file      CAS/Autoload.php
9
+ * @category  Authentication
10
+ * @package   SimpleCAS
11
+ * @author    Brett Bieber <brett.bieber@gmail.com>
12
+ * @copyright 2008 Regents of the University of Nebraska
13
+ * @license   http://www1.unl.edu/wdn/wiki/Software_License BSD License
14
+ * @link      http://code.google.com/p/simplecas/
15
+ **/
16
+
17
+/**
18
+ * Autoload a class
19
+ *
20
+ * @param string $class Classname to load
21
+ *
22
+ * @return bool
23
+ */
24
+function CAS_autoload($class)
25
+{
26
+    // Static to hold the Include Path to CAS
27
+    static $include_path;
28
+    // Check only for CAS classes
29
+    if (substr($class, 0, 4) !== 'CAS_') {
30
+        return false;
31
+    }
32
+    // Setup the include path if it's not already set from a previous call
33
+    if (empty($include_path)) {
34
+        $include_path = array(dirname(dirname(__FILE__)), dirname(dirname(__FILE__)) . '/../test/' );
35
+    }
36
+
37
+    // Declare local variable to store the expected full path to the file
38
+
39
+    foreach ($include_path as $path) {
40
+        $file_path = $path . '/' . str_replace('_', '/', $class) . '.php';
41
+        $fp = @fopen($file_path, 'r', true);
42
+        if ($fp) {
43
+            fclose($fp);
44
+            include $file_path;
45
+            if (!class_exists($class, false) && !interface_exists($class, false)) {
46
+                die(
47
+                    new Exception(
48
+                        'Class ' . $class . ' was not present in ' .
49
+                        $file_path .
50
+                        ' [CAS_autoload]'
51
+                    )
52
+                );
53
+            }
54
+            return true;
55
+        }
56
+    }
57
+    $e = new Exception(
58
+        'Class ' . $class . ' could not be loaded from ' .
59
+        $file_path . ', file does not exist (Path="'
60
+        . implode(':', $include_path) .'") [CAS_autoload]'
61
+    );
62
+    $trace = $e->getTrace();
63
+    if (isset($trace[2]) && isset($trace[2]['function'])
64
+        && in_array($trace[2]['function'], array('class_exists', 'interface_exists'))
65
+    ) {
66
+        return false;
67
+    }
68
+    if (isset($trace[1]) && isset($trace[1]['function'])
69
+        && in_array($trace[1]['function'], array('class_exists', 'interface_exists'))
70
+    ) {
71
+        return false;
72
+    }
73
+    die ((string) $e);
74
+}
75
+
76
+// set up __autoload
77
+if (function_exists('spl_autoload_register')) {
78
+    if (!(spl_autoload_functions())
79
+        || !in_array('CAS_autoload', spl_autoload_functions())
80
+    ) {
81
+        spl_autoload_register('CAS_autoload');
82
+        if (function_exists('__autoload')
83
+            && !in_array('__autoload', spl_autoload_functions())
84
+        ) {
85
+            // __autoload() was being used, but now would be ignored, add
86
+            // it to the autoload stack
87
+            spl_autoload_register('__autoload');
88
+        }
89
+    }
90
+} elseif (!function_exists('__autoload')) {
91
+
92
+    /**
93
+     * Autoload a class
94
+     *
95
+     * @param string $class Class name
96
+     *
97
+     * @return bool
98
+     */
99
+    function __autoload($class)
100
+    {
101
+        return CAS_autoload($class);
102
+    }
103
+}
104
+
105
+?>

+ 3835
- 0
classes/authentication/phpCAS/source/CAS/Client.php
File diff suppressed because it is too large
View File


+ 385
- 0
classes/authentication/phpCAS/source/CAS/CookieJar.php View File

@@ -0,0 +1,385 @@
1
+<?php
2
+
3
+/**
4
+ * Licensed to Jasig under one or more contributor license
5
+ * agreements. See the NOTICE file distributed with this work for
6
+ * additional information regarding copyright ownership.
7
+ *
8
+ * Jasig licenses this file to you under the Apache License,
9
+ * Version 2.0 (the "License"); you may not use this file except in
10
+ * compliance with the License. You may obtain a copy of the License at:
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * PHP Version 5
21
+ *
22
+ * @file     CAS/CookieJar.php
23
+ * @category Authentication
24
+ * @package  PhpCAS
25
+ * @author   Adam Franco <afranco@middlebury.edu>
26
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
27
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
28
+ */
29
+
30
+/**
31
+ * This class provides access to service cookies and handles parsing of response
32
+ * headers to pull out cookie values.
33
+ *
34
+ * @class    CAS_CookieJar
35
+ * @category Authentication
36
+ * @package  PhpCAS
37
+ * @author   Adam Franco <afranco@middlebury.edu>
38
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
39
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
40
+ */
41
+class CAS_CookieJar
42
+{
43
+
44
+    private $_cookies;
45
+
46
+    /**
47
+     * Create a new cookie jar by passing it a reference to an array in which it
48
+     * should store cookies.
49
+     *
50
+     * @param array &$storageArray Array to store cookies
51
+     *
52
+     * @return void
53
+     */
54
+    public function __construct (array &$storageArray)
55
+    {
56
+        $this->_cookies =& $storageArray;
57
+    }
58
+
59
+    /**
60
+     * Store cookies for a web service request.
61
+     * Cookie storage is based on RFC 2965: http://www.ietf.org/rfc/rfc2965.txt
62
+     *
63
+     * @param string $request_url      The URL that generated the response headers.
64
+     * @param array  $response_headers An array of the HTTP response header strings.
65
+     *
66
+     * @return void
67
+     *
68
+     * @access private
69
+     */
70
+    public function storeCookies ($request_url, $response_headers)
71
+    {
72
+        $urlParts = parse_url($request_url);
73
+        $defaultDomain = $urlParts['host'];
74
+
75
+        $cookies = $this->parseCookieHeaders($response_headers, $defaultDomain);
76
+
77
+        // var_dump($cookies);
78
+        foreach ($cookies as $cookie) {
79
+            // Enforce the same-origin policy by verifying that the cookie
80
+            // would match the url that is setting it
81
+            if (!$this->cookieMatchesTarget($cookie, $urlParts)) {
82
+                continue;
83
+            }
84
+
85
+            // store the cookie
86
+            $this->storeCookie($cookie);
87
+
88
+            phpCAS::trace($cookie['name'].' -> '.$cookie['value']);
89
+        }
90
+    }
91
+
92
+    /**
93
+     * Retrieve cookies applicable for a web service request.
94
+     * Cookie applicability is based on RFC 2965: http://www.ietf.org/rfc/rfc2965.txt
95
+     *
96
+     * @param string $request_url The url that the cookies will be for.
97
+     *
98
+     * @return array An array containing cookies. E.g. array('name' => 'val');
99
+     *
100
+     * @access private
101
+     */
102
+    public function getCookies ($request_url)
103
+    {
104
+        if (!count($this->_cookies)) {
105
+            return array();
106
+        }
107
+
108
+        // If our request URL can't be parsed, no cookies apply.
109
+        $target = parse_url($request_url);
110
+        if ($target === false) {
111
+            return array();
112
+        }
113
+
114
+        $this->expireCookies();
115
+
116
+        $matching_cookies = array();
117
+        foreach ($this->_cookies as $key => $cookie) {
118
+            if ($this->cookieMatchesTarget($cookie, $target)) {
119
+                $matching_cookies[$cookie['name']] = $cookie['value'];
120
+            }
121
+        }
122
+        return $matching_cookies;
123
+    }
124
+
125
+
126
+    /**
127
+     * Parse Cookies without PECL
128
+     * From the comments in http://php.net/manual/en/function.http-parse-cookie.php
129
+     *
130
+     * @param array  $header        array of header lines.
131
+     * @param string $defaultDomain The domain to use if none is specified in
132
+     * the cookie.
133
+     *
134
+     * @return array of cookies
135
+     */
136
+    protected function parseCookieHeaders( $header, $defaultDomain )
137
+    {
138
+        phpCAS::traceBegin();
139
+        $cookies = array();
140
+        foreach ( $header as $line ) {
141
+            if ( preg_match('/^Set-Cookie2?: /i', $line)) {
142
+                $cookies[] = $this->parseCookieHeader($line, $defaultDomain);
143
+            }
144
+        }
145
+
146
+        phpCAS::traceEnd($cookies);
147
+        return $cookies;
148
+    }
149
+
150
+    /**
151
+     * Parse a single cookie header line.
152
+     *
153
+     * Based on RFC2965 http://www.ietf.org/rfc/rfc2965.txt
154
+     *
155
+     * @param string $line          The header line.
156
+     * @param string $defaultDomain The domain to use if none is specified in
157
+     * the cookie.
158
+     *
159
+     * @return array
160
+     */
161
+    protected function parseCookieHeader ($line, $defaultDomain)
162
+    {
163
+        if (!$defaultDomain) {
164
+            throw new CAS_InvalidArgumentException(
165
+                '$defaultDomain was not provided.'
166
+            );
167
+        }
168
+
169
+        // Set our default values
170
+        $cookie = array(
171
+            'domain' => $defaultDomain,
172
+            'path' => '/',
173
+            'secure' => false,
174
+        );
175
+
176
+        $line = preg_replace('/^Set-Cookie2?: /i', '', trim($line));
177
+
178
+        // trim any trailing semicolons.
179
+        $line = trim($line, ';');
180
+
181
+        phpCAS::trace("Cookie Line: $line");
182
+
183
+        // This implementation makes the assumption that semicolons will not
184
+        // be present in quoted attribute values. While attribute values that
185
+        // contain semicolons are allowed by RFC2965, they are hopefully rare
186
+        // enough to ignore for our purposes. Most browsers make the same
187
+        // assumption.
188
+        $attributeStrings = explode(';', $line);
189
+
190
+        foreach ( $attributeStrings as $attributeString ) {
191
+            // split on the first equals sign and use the rest as value
192
+            $attributeParts = explode('=', $attributeString, 2);
193
+
194
+            $attributeName = trim($attributeParts[0]);
195
+            $attributeNameLC = strtolower($attributeName);
196
+
197
+            if (isset($attributeParts[1])) {
198
+                $attributeValue = trim($attributeParts[1]);
199
+                // Values may be quoted strings.
200
+                if (strpos($attributeValue, '"') === 0) {
201
+                    $attributeValue = trim($attributeValue, '"');
202
+                    // unescape any escaped quotes:
203
+                    $attributeValue = str_replace('\"', '"', $attributeValue);
204
+                }
205
+            } else {
206
+                $attributeValue = null;
207
+            }
208
+
209
+            switch ($attributeNameLC) {
210
+            case 'expires':
211
+                $cookie['expires'] = strtotime($attributeValue);
212
+                break;
213
+            case 'max-age':
214
+                $cookie['max-age'] = (int)$attributeValue;
215
+                // Set an expiry time based on the max-age
216
+                if ($cookie['max-age']) {
217
+                    $cookie['expires'] = time() + $cookie['max-age'];
218
+                } else {
219
+                    // If max-age is zero, then the cookie should be removed
220
+                    // imediately so set an expiry before now.
221
+                    $cookie['expires'] = time() - 1;
222
+                }
223
+                break;
224
+            case 'secure':
225
+                $cookie['secure'] = true;
226
+                break;
227
+            case 'domain':
228
+            case 'path':
229
+            case 'port':
230
+            case 'version':
231
+            case 'comment':
232
+            case 'commenturl':
233
+            case 'discard':
234
+            case 'httponly':
235
+                $cookie[$attributeNameLC] = $attributeValue;
236
+                break;
237
+            default:
238
+                $cookie['name'] = $attributeName;
239
+                $cookie['value'] = $attributeValue;
240
+            }
241
+        }
242
+
243
+        return $cookie;
244
+    }
245
+
246
+    /**
247
+     * Add, update, or remove a cookie.
248
+     *
249
+     * @param array $cookie A cookie array as created by parseCookieHeaders()
250
+     *
251
+     * @return void
252
+     *
253
+     * @access protected
254
+     */
255
+    protected function storeCookie ($cookie)
256
+    {
257
+        // Discard any old versions of this cookie.
258
+        $this->discardCookie($cookie);
259
+        $this->_cookies[] = $cookie;
260
+
261
+    }
262
+
263
+    /**
264
+     * Discard an existing cookie
265
+     *
266
+     * @param array $cookie An cookie
267
+     *
268
+     * @return void
269
+     *
270
+     * @access protected
271
+     */
272
+    protected function discardCookie ($cookie)
273
+    {
274
+        if (!isset($cookie['domain'])
275
+            || !isset($cookie['path'])
276
+            || !isset($cookie['path'])
277
+        ) {
278
+            throw new CAS_InvalidArgumentException('Invalid Cookie array passed.');
279
+        }
280
+
281
+        foreach ($this->_cookies as $key => $old_cookie) {
282
+            if ( $cookie['domain'] == $old_cookie['domain']
283
+                && $cookie['path'] == $old_cookie['path']
284
+                && $cookie['name'] == $old_cookie['name']
285
+            ) {
286
+                unset($this->_cookies[$key]);
287
+            }
288
+        }
289
+    }
290
+
291
+    /**
292
+     * Go through our stored cookies and remove any that are expired.
293
+     *
294
+     * @return void
295
+     *
296
+     * @access protected
297
+     */
298
+    protected function expireCookies ()
299
+    {
300
+        foreach ($this->_cookies as $key => $cookie) {
301
+            if (isset($cookie['expires']) && $cookie['expires'] < time()) {
302
+                unset($this->_cookies[$key]);
303
+            }
304
+        }
305
+    }
306
+
307
+    /**
308
+     * Answer true if cookie is applicable to a target.
309
+     *
310
+     * @param array $cookie An array of cookie attributes.
311
+     * @param array $target An array of URL attributes as generated by parse_url().
312
+     *
313
+     * @return bool
314
+     *
315
+     * @access private
316
+     */
317
+    protected function cookieMatchesTarget ($cookie, $target)
318
+    {
319
+        if (!is_array($target)) {
320
+            throw new CAS_InvalidArgumentException(
321
+                '$target must be an array of URL attributes as generated by parse_url().'
322
+            );
323
+        }
324
+        if (!isset($target['host'])) {
325
+            throw new CAS_InvalidArgumentException(
326
+                '$target must be an array of URL attributes as generated by parse_url().'
327
+            );
328
+        }
329
+
330
+        // Verify that the scheme matches
331
+        if ($cookie['secure'] && $target['scheme'] != 'https') {
332
+            return false;
333
+        }
334
+
335
+        // Verify that the host matches
336
+        // Match domain and mulit-host cookies
337
+        if (strpos($cookie['domain'], '.') === 0) {
338
+            // .host.domain.edu cookies are valid for host.domain.edu
339
+            if (substr($cookie['domain'], 1) == $target['host']) {
340
+                // continue with other checks
341
+            } else {
342
+                // non-exact host-name matches.
343
+                // check that the target host a.b.c.edu is within .b.c.edu
344
+                $pos = strripos($target['host'], $cookie['domain']);
345
+                if (!$pos) {
346
+                    return false;
347
+                }
348
+                // verify that the cookie domain is the last part of the host.
349
+                if ($pos + strlen($cookie['domain']) != strlen($target['host'])) {
350
+                    return false;
351
+                }
352
+                // verify that the host name does not contain interior dots as per
353
+                // RFC 2965 section 3.3.2  Rejecting Cookies
354
+                // http://www.ietf.org/rfc/rfc2965.txt
355
+                $hostname = substr($target['host'], 0, $pos);
356
+                if (strpos($hostname, '.') !== false) {
357
+                    return false;
358
+                }
359
+            }
360
+        } else {
361
+            // If the cookie host doesn't begin with '.',
362
+            // the host must case-insensitive match exactly
363
+            if (strcasecmp($target['host'], $cookie['domain']) !== 0) {
364
+                return false;
365
+            }
366
+        }
367
+
368
+        // Verify that the port matches
369
+        if (isset($cookie['ports'])
370
+            && !in_array($target['port'], $cookie['ports'])
371
+        ) {
372
+            return false;
373
+        }
374
+
375
+        // Verify that the path matches
376
+        if (strpos($target['path'], $cookie['path']) !== 0) {
377
+            return false;
378
+        }
379
+
380
+        return true;
381
+    }
382
+
383
+}
384
+
385
+?>

+ 59
- 0
classes/authentication/phpCAS/source/CAS/Exception.php View File

@@ -0,0 +1,59 @@
1
+<?php
2
+
3
+/**
4
+ * Licensed to Jasig under one or more contributor license
5
+ * agreements. See the NOTICE file distributed with this work for
6
+ * additional information regarding copyright ownership.
7
+ *
8
+ * Jasig licenses this file to you under the Apache License,
9
+ * Version 2.0 (the "License"); you may not use this file except in
10
+ * compliance with the License. You may obtain a copy of the License at:
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * PHP Version 5
21
+ *
22
+ * @file     CAS/Exception.php
23
+ * @category Authentication
24
+ * @package  PhpCAS
25
+ * @author   Adam Franco <afranco@middlebury.edu>
26
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
27
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
28
+ */
29
+
30
+/**
31
+ * A root exception interface for all exceptions in phpCAS.
32
+ *
33
+ * All exceptions thrown in phpCAS should implement this interface to allow them
34
+ * to be caught as a category by clients. Each phpCAS exception should extend
35
+ * an appropriate SPL exception class that best fits its type.
36
+ *
37
+ * For example, an InvalidArgumentException in phpCAS should be defined as
38
+ *
39
+ *		class CAS_InvalidArgumentException
40
+ *			extends InvalidArgumentException
41
+ *			implements CAS_Exception
42
+ *		{ }
43
+ *
44
+ * This definition allows the CAS_InvalidArgumentException to be caught as either
45
+ * an InvalidArgumentException or as a CAS_Exception.
46
+ *
47
+ * @class    CAS_Exception
48
+ * @category Authentication
49
+ * @package  PhpCAS
50
+ * @author   Adam Franco <afranco@middlebury.edu>
51
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
52
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
53
+ *
54
+ */
55
+interface CAS_Exception
56
+{
57
+
58
+}
59
+?>

+ 86
- 0
classes/authentication/phpCAS/source/CAS/GracefullTerminationException.php View File

@@ -0,0 +1,86 @@
1
+<?php
2
+
3
+/**
4
+ * Licensed to Jasig under one or more contributor license
5
+ * agreements. See the NOTICE file distributed with this work for
6
+ * additional information regarding copyright ownership.
7
+ *
8
+ * Jasig licenses this file to you under the Apache License,
9
+ * Version 2.0 (the "License"); you may not use this file except in
10
+ * compliance with the License. You may obtain a copy of the License at:
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * PHP Version 5
21
+ *
22
+ * @file     CAS/GracefullTerminationException.php
23
+ * @category Authentication
24
+ * @package  PhpCAS
25
+ * @author   Joachim Fritschi <jfritschi@freenet.de>
26
+ * @author   Adam Franco <afranco@middlebury.edu>
27
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
28
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
29
+ */
30
+
31
+/**
32
+ * An exception for terminatinating execution or to throw for unit testing
33
+ *
34
+ * @class     CAS_GracefullTerminationException.php
35
+ * @category Authentication
36
+ * @package  PhpCAS
37
+ * @author   Joachim Fritschi <jfritschi@freenet.de>
38
+ * @author   Adam Franco <afranco@middlebury.edu>
39
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
40
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
41
+ */
42
+
43
+class CAS_GracefullTerminationException
44
+extends RuntimeException
45
+implements CAS_Exception
46
+{
47
+
48
+    /**
49
+     * Test if exceptions should be thrown or if we should just exit.
50
+     * In production usage we want to just exit cleanly when prompting the user
51
+     * for a redirect without filling the error logs with uncaught exceptions.
52
+     * In unit testing scenarios we cannot exit or we won't be able to continue
53
+     * with our tests.
54
+     *
55
+     * @param string $message Message Text
56
+     * @param string $code    Error code
57
+     *
58
+     * @return void
59
+     */
60
+    public function __construct ($message = 'Terminate Gracefully', $code = 0)
61
+    {
62
+        // Exit cleanly to avoid filling up the logs with uncaught exceptions.
63
+        if (self::$_exitWhenThrown) {
64
+            exit;
65
+        } else {
66
+            // Throw exceptions to allow unit testing to continue;
67
+            parent::__construct($message, $code);
68
+        }
69
+    }
70
+
71
+    private static $_exitWhenThrown = true;
72
+    /**
73
+    * Force phpcas to thow Exceptions instead of calling exit()
74
+    * Needed for unit testing. Generally shouldn't be used in production due to
75
+    * an increase in Apache error logging if CAS_GracefulTerminiationExceptions
76
+    * are not caught and handled.
77
+    *
78
+    * @return void
79
+    */
80
+    public static function throwInsteadOfExiting()
81
+    {
82
+        self::$_exitWhenThrown = false;
83
+    }
84
+
85
+}
86
+?>

+ 46
- 0
classes/authentication/phpCAS/source/CAS/InvalidArgumentException.php View File

@@ -0,0 +1,46 @@
1
+<?php
2
+
3
+/**
4
+ * Licensed to Jasig under one or more contributor license
5
+ * agreements. See the NOTICE file distributed with this work for
6
+ * additional information regarding copyright ownership.
7
+ *
8
+ * Jasig licenses this file to you under the Apache License,
9
+ * Version 2.0 (the "License"); you may not use this file except in
10
+ * compliance with the License. You may obtain a copy of the License at:
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * PHP Version 5
21
+ *
22
+ * @file     CAS/InvalidArgumentException.php
23
+ * @category Authentication
24
+ * @package  PhpCAS
25
+ * @author   Adam Franco <afranco@middlebury.edu>
26
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
27
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
28
+ */
29
+
30
+/**
31
+ * Exception that denotes invalid arguments were passed.
32
+ *
33
+ * @class    CAS_InvalidArgumentException
34
+ * @category Authentication
35
+ * @package  PhpCAS
36
+ * @author   Adam Franco <afranco@middlebury.edu>
37
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
38
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
39
+ */
40
+class CAS_InvalidArgumentException
41
+extends InvalidArgumentException
42
+implements CAS_Exception
43
+{
44
+
45
+}
46
+?>

+ 114
- 0
classes/authentication/phpCAS/source/CAS/Languages/Catalan.php View File

@@ -0,0 +1,114 @@
1
+<?php
2
+
3
+/**
4
+ * Licensed to Jasig under one or more contributor license
5
+ * agreements. See the NOTICE file distributed with this work for
6
+ * additional information regarding copyright ownership.
7
+ *
8
+ * Jasig licenses this file to you under the Apache License,
9
+ * Version 2.0 (the "License"); you may not use this file except in
10
+ * compliance with the License. You may obtain a copy of the License at:
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * PHP Version 5
21
+ *
22
+ * @file     CAS/Language/Catalan.php
23
+ * @category Authentication
24
+ * @package  PhpCAS
25
+ * @author   Iván-Benjamín García Torà <ivaniclixx@gmail.com>
26
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
27
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
28
+ */
29
+
30
+/**
31
+ * Catalan language class
32
+ *
33
+ * @class    CAS_Languages_Catalan
34
+ * @category Authentication
35
+ * @package  PhpCAS
36
+ * @author   Iván-Benjamín García Torà <ivaniclixx@gmail.com>
37
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
38
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
39
+ *
40
+ * @sa @link internalLang Internationalization @endlink
41
+ * @ingroup internalLang
42
+ */
43
+class CAS_Languages_Catalan implements CAS_Languages_LanguageInterface
44
+{
45
+    /**
46
+    * Get the using server string
47
+    *
48
+    * @return string using server
49
+    */
50
+    public function getUsingServer()
51
+    {
52
+        return 'usant servidor';
53
+    }
54
+
55
+    /**
56
+    * Get authentication wanted string
57
+    *
58
+    * @return string authentication wanted
59
+    */
60
+    public function getAuthenticationWanted()
61
+    {
62
+        return 'Autentificació CAS necessària!';
63
+    }
64
+
65
+    /**
66
+    * Get logout string
67
+    *
68
+    * @return string logout
69
+    */
70
+    public function getLogout()
71
+    {
72
+        return 'Sortida de CAS necessària!';
73
+    }
74
+
75
+    /**
76
+    * Get the should have been redirected string
77
+    *
78
+    * @return string should habe been redirected
79
+    */
80
+    public function getShouldHaveBeenRedirected()
81
+    {
82
+        return 'Ja hauria d\ haver estat redireccionat al servidor CAS. Feu click <a href="%s">aquí</a> per a continuar.';
83
+    }
84
+
85
+    /**
86
+    * Get authentication failed string
87
+    *
88
+    * @return string authentication failed
89
+    */
90
+    public function getAuthenticationFailed()
91
+    {
92
+        return 'Autentificació CAS fallida!';
93
+    }
94
+
95
+    /**
96
+    * Get the your were not authenticated string
97
+    *
98
+    * @return string not authenticated
99
+    */
100
+    public function getYouWereNotAuthenticated()
101
+    {
102
+        return '<p>No estàs autentificat.</p><p>Pots tornar a intentar-ho fent click <a href="%s">aquí</a>.</p><p>Si el problema persisteix hauría de contactar amb l\'<a href="mailto:%s">administrador d\'aquest llocc</a>.</p>';
103
+    }
104
+
105
+    /**
106
+    * Get the service unavailable string
107
+    *
108
+    * @return string service unavailable
109
+    */
110
+    public function getServiceUnavailable()
111
+    {
112
+        return 'El servei `<b>%s</b>\' no està disponible (<b>%s</b>).';
113
+    }
114
+}

+ 114
- 0
classes/authentication/phpCAS/source/CAS/Languages/English.php View File

@@ -0,0 +1,114 @@
1
+<?php
2
+
3
+/**
4
+ * Licensed to Jasig under one or more contributor license
5
+ * agreements. See the NOTICE file distributed with this work for
6
+ * additional information regarding copyright ownership.
7
+ *
8
+ * Jasig licenses this file to you under the Apache License,
9
+ * Version 2.0 (the "License"); you may not use this file except in
10
+ * compliance with the License. You may obtain a copy of the License at:
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * PHP Version 5
21
+ *
22
+ * @file     CAS/Language/English.php
23
+ * @category Authentication
24
+ * @package  PhpCAS
25
+ * @author   Pascal Aubry <pascal.aubry@univ-rennes1.fr>
26
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
27
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
28
+ */
29
+
30
+/**
31
+ * English language class
32
+ *
33
+ * @class    CAS_Languages_English
34
+ * @category Authentication
35
+ * @package  PhpCAS
36
+ * @author   Pascal Aubry <pascal.aubry@univ-rennes1.fr>
37
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
38
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
39
+ *
40
+ * @sa @link internalLang Internationalization @endlink
41
+ * @ingroup internalLang
42
+ */
43
+class CAS_Languages_English implements CAS_Languages_LanguageInterface
44
+{
45
+    /**
46
+     * Get the using server string
47
+     *
48
+     * @return string using server
49
+     */
50
+    public function getUsingServer()
51
+    {
52
+        return 'using server';
53
+    }
54
+
55
+    /**
56
+     * Get authentication wanted string
57
+     *
58
+     * @return string authentication wanted
59
+     */
60
+    public function getAuthenticationWanted()
61
+    {
62
+        return 'CAS Authentication wanted!';
63
+    }
64
+
65
+    /**
66
+     * Get logout string
67
+     *
68
+     * @return string logout
69
+     */
70
+    public function getLogout()
71
+    {
72
+        return 'CAS logout wanted!';
73
+    }
74
+
75
+    /**
76
+     * Get the should have been redirected string
77
+     *
78
+     * @return string should habe been redirected
79
+     */
80
+    public function getShouldHaveBeenRedirected()
81
+    {
82
+        return 'You should already have been redirected to the CAS server. Click <a href="%s">here</a> to continue.';
83
+    }
84
+
85
+    /**
86
+    * Get authentication failed string
87
+    *
88
+    * @return string authentication failed
89
+    */
90
+    public function getAuthenticationFailed()
91
+    {
92
+        return 'CAS Authentication failed!';
93
+    }
94
+
95
+    /**
96
+    * Get the your were not authenticated string
97
+    *
98
+    * @return string not authenticated
99
+    */
100
+    public function getYouWereNotAuthenticated()
101
+    {
102
+        return '<p>You were not authenticated.</p><p>You may submit your request again by clicking <a href="%s">here</a>.</p><p>If the problem persists, you may contact <a href="mailto:%s">the administrator of this site</a>.</p>';
103
+    }
104
+
105
+    /**
106
+    * Get the service unavailable string
107
+    *
108
+    * @return string service unavailable
109
+    */
110
+    public function getServiceUnavailable()
111
+    {
112
+        return 'The service `<b>%s</b>\' is not available (<b>%s</b>).';
113
+    }
114
+}

+ 116
- 0
classes/authentication/phpCAS/source/CAS/Languages/French.php View File

@@ -0,0 +1,116 @@
1
+<?php
2
+
3
+/**
4
+ * Licensed to Jasig under one or more contributor license
5
+ * agreements. See the NOTICE file distributed with this work for
6
+ * additional information regarding copyright ownership.
7
+ *
8
+ * Jasig licenses this file to you under the Apache License,
9
+ * Version 2.0 (the "License"); you may not use this file except in
10
+ * compliance with the License. You may obtain a copy of the License at:
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * PHP Version 5
21
+ *
22
+ * @file     CAS/Language/French.php
23
+ * @category Authentication
24
+ * @package  PhpCAS
25
+ * @author   Pascal Aubry <pascal.aubry@univ-rennes1.fr>
26
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
27
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
28
+ */
29
+
30
+/**
31
+ * French language class
32
+ *
33
+ * @class    CAS_Languages_French
34
+ * @category Authentication
35
+ * @package  PhpCAS
36
+ * @author   Pascal Aubry <pascal.aubry@univ-rennes1.fr>
37
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
38
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
39
+ *
40
+ * @sa @link internalLang Internationalization @endlink
41
+ * @ingroup internalLang
42
+ */
43
+class CAS_Languages_French implements CAS_Languages_LanguageInterface
44
+{
45
+    /**
46
+     * Get the using server string
47
+     *
48
+     * @return string using server
49
+     */
50
+    public function getUsingServer()
51
+    {
52
+        return 'utilisant le serveur';
53
+    }
54
+
55
+    /**
56
+     * Get authentication wanted string
57
+     *
58
+     * @return string authentication wanted
59
+     */
60
+    public function getAuthenticationWanted()
61
+    {
62
+        return 'Authentication CAS nécessaire&nbsp;!';
63
+    }
64
+
65
+    /**
66
+     * Get logout string
67
+     *
68
+     * @return string logout
69
+     */
70
+    public function getLogout()
71
+    {
72
+        return 'Déconnexion demandée&nbsp;!';
73
+    }
74
+
75
+    /**
76
+     * Get the should have been redirected string
77
+     *
78
+     * @return string should habe been redirected
79
+     */
80
+    public function getShouldHaveBeenRedirected()
81
+    {
82
+        return 'Vous auriez du etre redirigé(e) vers le serveur CAS. Cliquez <a href="%s">ici</a> pour continuer.';
83
+    }
84
+
85
+    /**
86
+     * Get authentication failed string
87
+     *
88
+     * @return string authentication failed
89
+     */
90
+    public function getAuthenticationFailed()
91
+    {
92
+        return 'Authentification CAS infructueuse&nbsp;!';
93
+    }
94
+
95
+    /**
96
+     * Get the your were not authenticated string
97
+     *
98
+     * @return string not authenticated
99
+     */
100
+    public function getYouWereNotAuthenticated()
101
+    {
102
+        return '<p>Vous n\'avez pas été authentifié(e).</p><p>Vous pouvez soumettre votre requete à nouveau en cliquant <a href="%s">ici</a>.</p><p>Si le problème persiste, vous pouvez contacter <a href="mailto:%s">l\'administrateur de ce site</a>.</p>';
103
+    }
104
+
105
+    /**
106
+     * Get the service unavailable string
107
+     *
108
+     * @return string service unavailable
109
+     */
110
+    public function getServiceUnavailable()
111
+    {
112
+        return 'Le service `<b>%s</b>\' est indisponible (<b>%s</b>)';
113
+    }
114
+}
115
+
116
+?>

+ 116
- 0
classes/authentication/phpCAS/source/CAS/Languages/German.php View File

@@ -0,0 +1,116 @@
1
+<?php
2
+
3
+/**
4
+ * Licensed to Jasig under one or more contributor license
5
+ * agreements. See the NOTICE file distributed with this work for
6
+ * additional information regarding copyright ownership.
7
+ *
8
+ * Jasig licenses this file to you under the Apache License,
9
+ * Version 2.0 (the "License"); you may not use this file except in
10
+ * compliance with the License. You may obtain a copy of the License at:
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * PHP Version 5
21
+ *
22
+ * @file     CAS/Language/German.php
23
+ * @category Authentication
24
+ * @package  PhpCAS
25
+ * @author   Henrik Genssen <hg@mediafactory.de>
26
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
27
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
28
+ */
29
+
30
+/**
31
+ * German language class
32
+ *
33
+ * @class    CAS_Languages_German
34
+ * @category Authentication
35
+ * @package  PhpCAS
36
+ * @author   Henrik Genssen <hg@mediafactory.de>
37
+ * @license  http://www.apache.org/licenses/LICENSE-2.0  Apache License 2.0
38
+ * @link     https://wiki.jasig.org/display/CASC/phpCAS
39
+ *
40
+ * @sa @link internalLang Internationalization @endlink
41
+ * @ingroup internalLang
42
+ */
43
+class CAS_Languages_German implements CAS_Languages_LanguageInterface
44
+{
45
+    /**
46
+     * Get the using server string
47
+     *
48
+     * @return string using server
49
+     */
50
+    public function getUsingServer()
51
+    {
52
+        return 'via Server';
53
+    }
54
+
55
+    /**
56
+     * Get authentication wanted string
57
+     *
58
+     * @return string authentication wanted
59
+     */
60
+    public function getAuthenticationWanted()
61
+    {
62
+        return 'CAS Authentifizierung erforderlich!';
63
+    }
64
+
65
+    /**
66
+     * Get logout string
67
+     *
68
+     * @return string logout
69
+     */
70
+    public function getLogout()
71
+    {
72
+        return 'CAS Abmeldung!';
73
+    }
74
+
75
+    /**
76
+     * Get the should have been redirected string
77
+     *
78
+     * @return string should habe been redirected
79
+     */
80
+    public function getShouldHaveBeenRedirected()
81
+    {
82
+        return 'eigentlich h&auml;ten Sie zum CAS Server weitergeleitet werden sollen. Dr&uuml;cken Sie <a href="%s">hier</a> um fortzufahren.';
83
+    }
84
+
85
+    /**
86
+     * Get authentication failed string
87
+     *
88
+     * @return string authentication failed
89
+     */
90
+    public function getAuthenticationFailed()
91
+    {
92
+        return 'CAS Anmeldung fehlgeschlagen!';
93
+    }
94
+
95
+    /**
96
+     * Get the your were not authenticated string
97
+     *
98
+     * @return string not authenticated
99
+     */
100