Rev 897 | Rev 921 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log
Rev 897 | Rev 913 | ||
---|---|---|---|
Line 22... | Line 22... | ||
22 | 22 | ||
23 | /**************************************************************** |
23 | /**************************************************************** |
24 | * GLOBAL FILE PATHS * |
24 | * GLOBAL FILE PATHS * |
25 | *****************************************************************/ |
25 | *****************************************************************/ |
26 | define ("CONF_FILE", "/usr/local/etc/alcasar.conf"); |
26 | define ("CONF_FILE", "/usr/local/etc/alcasar.conf"); |
- | 27 | define ("DOMAIN_ALLOWED_LIST", "/usr/local/etc/alcasar-uamdomain"); |
|
27 | 28 | ||
28 | /**************************************************************** |
29 | /**************************************************************** |
29 | * FILE TEST * |
30 | * FILE TEST * |
30 | *****************************************************************/ |
31 | *****************************************************************/ |
31 | //Test de présence et des droits en lecture des fichiers de configuration. |
32 | //Test de présence et des droits en lecture des fichiers de configuration. |
Line 34... | Line 35... | ||
34 | } |
35 | } |
35 | if (!is_readable(CONF_FILE)){ |
36 | if (!is_readable(CONF_FILE)){ |
36 | exit("Vous n'avez pas les droits de lecture sur le fichier ".CONF_FILE); |
37 | exit("Vous n'avez pas les droits de lecture sur le fichier ".CONF_FILE); |
37 | } |
38 | } |
38 | 39 | ||
- | 40 | //Test de présence de domaine ou IP accessibles sans authentificaion |
|
- | 41 | $conf_files=array(DOMAIN_ALLOWED_LIST); |
|
- | 42 | foreach ($conf_files as $file){ |
|
- | 43 | if (!file_exists($file)){ |
|
- | 44 | exit("Fichier ".$file." non présent"); |
|
- | 45 | } |
|
- | 46 | if (!is_readable($file)){ |
|
- | 47 | exit("Vous n'avez pas les droits de lecture sur le fichier ".$file); |
|
- | 48 | } |
|
- | 49 | } |
|
39 | /**************************************************************** |
50 | /**************************************************************** |
40 | * Read CONF_FILE * |
51 | * Read CONF_FILE * |
41 | *****************************************************************/ |
52 | *****************************************************************/ |
42 | $ouvre=fopen(CONF_FILE,"r"); |
53 | $ouvre=fopen(CONF_FILE,"r"); |
43 | if ($ouvre){ |
54 | if ($ouvre){ |
Line 55... | Line 66... | ||
55 | fclose($ouvre); |
66 | fclose($ouvre); |
56 | 67 | ||
57 | $organisme = $conf["ORGANISM"]; |
68 | $organisme = $conf["ORGANISM"]; |
58 | 69 | ||
59 | # Shared secret used to encrypt challenge with radius. |
70 | # Shared secret used to encrypt challenge with radius. |
60 | $uamsecret = ""; |
71 | $uamsecret = "ZHoGm7No"; |
61 | 72 | ||
62 | # URL loaded after success authenticates (let blank for browser defaults) |
73 | # URL loaded after success authenticates (let blank for browser defaults) |
63 | $adminurl = ""; |
74 | $adminurl = ""; |
64 | 75 | ||
65 | # Our own path |
76 | # Our own path |
66 | $loginpath = $_SERVER['PHP_SELF']; |
77 | $loginpath = $_SERVER['PHP_SELF']; |
67 | $alcasarpath = "http://alcasar"; |
78 | $alcasarpath = "http://alcasar"; |
68 | $statuspath = $alcasarpath."/status.php"; |
79 | $statuspath = $alcasarpath."/status.php"; |
69 | $debug = false; |
80 | $debug = false; |
- | 81 | ||
- | 82 | # Domain and url allowed without authentication |
|
- | 83 | $domain_allowed_list="/usr/local/etc/alcasar-uamdomain"; |
|
- | 84 | $url_allowed_list="/usr/local/etc/alcasar-uamallowed"; |
|
70 | 85 | ||
71 | # Choice of language |
86 | # Choice of language |
72 | $Language = 'en'; |
87 | $Language = 'en'; |
73 | if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){ |
88 | if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){ |
74 | $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']); |
89 | $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']); |
Line 102... | Line 117... | ||
102 | $l_reply_4 = "your account expired"; |
117 | $l_reply_4 = "your account expired"; |
103 | $l_reply_5 = "You have reached the maximum number of simultaneous logins"; |
118 | $l_reply_5 = "You have reached the maximum number of simultaneous logins"; |
104 | $l_reply_6 = "Your authorized connexion time has been reached"; |
119 | $l_reply_6 = "Your authorized connexion time has been reached"; |
105 | $l_online_time = "Tiempo en linea"; |
120 | $l_online_time = "Tiempo en linea"; |
106 | $l_remaining_time = "Tiempo restante"; |
121 | $l_remaining_time = "Tiempo restante"; |
- | 122 | $l_uam_domain = "acceso directo : ";} |
|
- | 123 | else if ($Language == 'pt'){ |
|
- | 124 | $l_ChilliError = "A autenticação deve ser bem sucedido através do serviço de portal cativo."; |
|
- | 125 | $l_login = "Sucesso na autenticação.<HR>Não feche essa janela para não interromper a conexão"; |
|
- | 126 | $l_logout = "Fechando a conexão"; |
|
- | 127 | $l_loginfailed = "Falha na autenticação"; |
|
107 | } |
- | |
- | 128 | $l_loggingin = "Identificação do portal cativo"; |
|
- | 129 | $l_loggedcont = "Access Control"; |
|
- | 130 | $l_loggedout = "Sua conexão foi fechada"; |
|
- | 131 | $l_user = "Usuário"; |
|
- | 132 | $l_password = "Senha"; |
|
- | 133 | $l_wait = "Por favor, aguarde um momento ..."; |
|
- | 134 | $l_onlinetime = "Tempo de conexão:"; |
|
- | 135 | $l_remainingtime = "Desconectado em:"; |
|
- | 136 | $l_encrypted = "A conexão com o portal deve ser criptografada"; |
|
- | 137 | $l_boutonO = "Autenticação"; |
|
- | 138 | $l_boutonF = "Fechar"; |
|
- | 139 | $l_loggedin_stringl1 = "Sistema de Segurança da Informação"; |
|
- | 140 | $l_loggedin_stringl2 = "Esse controle foi criado para seguir dentro dos regulamentos vingentes da lei"; |
|
- | 141 | $l_loggedin_stringl3 = "Por isto suas atividades na rede serão registradas de acordo com seus acessos, mas garantindo ainda sua privacidade."; |
|
- | 142 | $l_loggedin_stringl4 = "Os dados gravados só serão capaz de ser operado por uma autoridade judicial no decorrer de uma investigação."; |
|
- | 143 | $l_loggedin_stringl5 = "Esses dados serão automaticamente excluídos depois de um ano."; |
|
- | 144 | $l_loggedin_stringl6 = "Clique <a href='$alcasarpath'>aqui</a> para alterar sua senha Sair do portal cativo."; |
|
- | 145 | $l_loggedout_string = "desconexão do portal cativo fez"; |
|
- | 146 | $l_reply_1 = "Your daily connexion time has been reached"; |
|
- | 147 | $l_reply_2 = "Seu tempo de conexão mensal foi finalizado"; |
|
- | 148 | $l_reply_3 = "Você tenta conectar-se fora do seu período de tempo permitido"; |
|
- | 149 | $l_reply_4 = "Sua conta expirou"; |
|
- | 150 | $l_reply_5 = "Você atingiu o número máximo de logins simultâneos"; |
|
- | 151 | $l_reply_6 = "Seu tempo de conexão autorizada finalizou"; |
|
- | 152 | $l_online_time = "Tempo Online"; |
|
- | 153 | $l_remaining_time = "Tempo restante"; |
|
- | 154 | $l_uam_domain = "acesso directo : ";} |
|
108 | else if($Language == 'de'){ |
155 | else if($Language == 'de'){ |
109 | $l_ChilliError = "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt."; |
156 | $l_ChilliError = "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt."; |
110 | $l_login = "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung"; |
157 | $l_login = "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung"; |
111 | $l_logout = "Beenden der Verbindung"; |
158 | $l_logout = "Beenden der Verbindung"; |
112 | $l_loginfailed = "Authentifizierungsfehler Eigenverbrauch"; |
159 | $l_loginfailed = "Authentifizierungsfehler Eigenverbrauch"; |
Line 134... | Line 181... | ||
134 | $l_reply_4 = "your account expired"; |
181 | $l_reply_4 = "your account expired"; |
135 | $l_reply_5 = "You have reached the maximum number of simultaneous logins"; |
182 | $l_reply_5 = "You have reached the maximum number of simultaneous logins"; |
136 | $l_reply_6 = "Your authorized connexion time has been reached"; |
183 | $l_reply_6 = "Your authorized connexion time has been reached"; |
137 | $l_online_time = "Online-zeit"; |
184 | $l_online_time = "Online-zeit"; |
138 | $l_remaining_time = "Restzeit"; |
185 | $l_remaining_time = "Restzeit"; |
139 | } |
- | |
- | 186 | $l_uam_domain = "accès direkten : ";} |
|
140 | else if($Language == 'nl'){ |
187 | else if($Language == 'nl'){ |
141 | $l_ChilliError = "De authenticatie moet een succes worden via de captive portal dienst."; |
188 | $l_ChilliError = "De authenticatie moet een succes worden via de captive portal dienst."; |
142 | $l_login = "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie."; |
189 | $l_login = "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie."; |
143 | $l_logout = "Slotkoers verbinding"; |
190 | $l_logout = "Slotkoers verbinding"; |
144 | $l_loginfailed = "Authenticatie mislukt"; |
191 | $l_loginfailed = "Authenticatie mislukt"; |
Line 166... | Line 213... | ||
166 | $l_reply_4 = "your account expired"; |
213 | $l_reply_4 = "your account expired"; |
167 | $l_reply_5 = "You have reached the maximum number of simultaneous logins"; |
214 | $l_reply_5 = "You have reached the maximum number of simultaneous logins"; |
168 | $l_reply_6 = "Your authorized connexion time has been reached"; |
215 | $l_reply_6 = "Your authorized connexion time has been reached"; |
169 | $l_online_time = "Online tijd"; |
216 | $l_online_time = "Online tijd"; |
170 | $l_remaining_time = "Reterende tijd"; |
217 | $l_remaining_time = "Reterende tijd"; |
171 | } |
- | |
- | 218 | $l_uam_domain = "Direct access : ";} |
|
172 | else if($Language == 'fr'){ |
219 | else if($Language == 'fr'){ |
173 | $l_ChilliError = "L'authentification doit être réussie au travers du service du portail captif."; |
220 | $l_ChilliError = "L'authentification doit être réussie au travers du service du portail captif."; |
174 | $l_login = "Authentification réussie.<HR>La fermeture de cette fenêtre interrompt votre session."; |
221 | $l_login = "Authentification réussie.<HR>La fermeture de cette fenêtre interrompt votre session."; |
175 | $l_logout = "Fermeture de la session"; |
222 | $l_logout = "Fermeture de la session"; |
176 | $l_loginfailed = "Echec d'authentification"; |
223 | $l_loginfailed = "Echec d'authentification"; |
Line 198... | Line 245... | ||
198 | $l_reply_4 = "Votre compte a expiré"; |
245 | $l_reply_4 = "Votre compte a expiré"; |
199 | $l_reply_5 = "Vous avez atteint le nombre maximum de connexions simultanées"; |
246 | $l_reply_5 = "Vous avez atteint le nombre maximum de connexions simultanées"; |
200 | $l_reply_6 = "Votre durée de connexion autorisée a été atteinte"; |
247 | $l_reply_6 = "Votre durée de connexion autorisée a été atteinte"; |
201 | $l_online_time = "Temps de connexion"; |
248 | $l_online_time = "Temps de connexion"; |
202 | $l_remaining_time = "Temps restant"; |
249 | $l_remaining_time = "Temps restant"; |
203 | } |
- | |
- | 250 | $l_uam_domain = "Accès dirrect : ";} |
|
204 | else{ |
251 | else{ |
205 | $l_ChilliError = "The authentication must be successful through the captive portal service."; |
252 | $l_ChilliError = "The authentication must be successful through the captive portal service."; |
206 | $l_login = "Successful authentication.<HR>Closing this window interrupts your session"; |
253 | $l_login = "Successful authentication.<HR>Closing this window interrupts your session"; |
207 | $l_logout = "Closing connection"; |
254 | $l_logout = "Closing connection"; |
208 | $l_loginfailed = "Authentication Failed"; |
255 | $l_loginfailed = "Authentication Failed"; |
Line 221... | Line 268... | ||
221 | $l_loggedin_stringl2 = "That control was set up regulations to ensure traceability, accountability and non-repudiation of connections."; |
268 | $l_loggedin_stringl2 = "That control was set up regulations to ensure traceability, accountability and non-repudiation of connections."; |
222 | $l_loggedin_stringl3 = "Your activity on the network is registered in accordance with privacy."; |
269 | $l_loggedin_stringl3 = "Your activity on the network is registered in accordance with privacy."; |
223 | $l_loggedin_stringl4 = "The recorded data can be able to be operated by a judicial authority in the course of an investigation."; |
270 | $l_loggedin_stringl4 = "The recorded data can be able to be operated by a judicial authority in the course of an investigation."; |
224 | $l_loggedin_stringl5 = "These data will be automatically deleted after one year."; |
271 | $l_loggedin_stringl5 = "These data will be automatically deleted after one year."; |
225 | $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser"; |
272 | $l_loggedin_stringl6 = "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser"; |
226 | $l_loggedout_string = " |
273 | $l_loggedout_string = "Disconnection of the captive portal made"; |
227 | $l_reply_1 = "Your daily connexion time has been reached"; |
274 | $l_reply_1 = "Your daily connexion time has been reached"; |
228 | $l_reply_2 = "Your monthly connexion time has been reached"; |
275 | $l_reply_2 = "Your monthly connexion time has been reached"; |
229 | $l_reply_3 = "You try to connect outside of your allowed timespan"; |
276 | $l_reply_3 = "You try to connect outside of your allowed timespan"; |
230 | $l_reply_4 = "your account expired"; |
277 | $l_reply_4 = "your account expired"; |
231 | $l_reply_5 = "You have reached the maximum number of simultaneous logins"; |
278 | $l_reply_5 = "You have reached the maximum number of simultaneous logins"; |
232 | $l_reply_6 = "Your authorized connexion time has been reached"; |
279 | $l_reply_6 = "Your authorized connexion time has been reached"; |
233 | $l_online_time = "Online time"; |
280 | $l_online_time = "Online time"; |
234 | $l_remaining_time = "Remaining time"; |
281 | $l_remaining_time = "Remaining time"; |
235 | } |
- | |
- | 282 | $l_uam_domain = "Direct access : ";} |
|
236 | 283 | ||
237 | # If https not use, tell it's wrong |
284 | # If https not use, tell it's wrong |
238 | if (!(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS'] == 'on'))) { |
285 | if (!(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS'] == 'on'))) { |
239 | echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> |
286 | echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> |
240 | <html> |
287 | <html> |
Line 437... | Line 484... | ||
437 | <LI>$l_loggedin_stringl5</LI> |
484 | <LI>$l_loggedin_stringl5</LI> |
438 | <LI>$l_loggedin_stringl6</LI> |
485 | <LI>$l_loggedin_stringl6</LI> |
439 | </ul> |
486 | </ul> |
440 | </td> |
487 | </td> |
441 | </tr> |
488 | </tr> |
442 | </table> |
489 | </table>"; |
- | 490 | ||
- | 491 | ||
- | 492 | // Read the "Domain alowed" file |
|
- | 493 | $tab=file(DOMAIN_ALLOWED_LIST); |
|
- | 494 | if ($tab) # the file isn't empty |
|
- | 495 | { |
|
- | 496 | echo "<div id=\"authorized_domain\"><li>$l_uam_domain</li>"; |
|
- | 497 | foreach ($tab as $line) |
|
- | 498 | { |
|
- | 499 | if (trim($line) != '') # the line isn't empty |
|
- | 500 | { |
|
- | 501 | $domain_allowed=explode("#", $line); |
|
- | 502 | $uamdomain=trim($domain_allowed[0],"#"); |
|
- | 503 | $domain=explode("\"", $uamdomain); |
|
- | 504 | if ((isset($domain_allowed[1])) && (trim($domain_allowed[1]) != '')){ |
|
- | 505 | echo "<li><a href=\"http://".trim($domain[1])."\">".trim($domain_allowed[1])."</a></li>"; |
|
- | 506 | } |
|
- | 507 | else echo"<li><a href=\"http://".trim($domain[1])."\">".trim($domain[1])."</a></li>"; |
|
- | 508 | } |
|
- | 509 | } |
|
- | 510 | echo "</div>"; |
|
- | 511 | } |
|
- | 512 | ||
- | 513 | echo " |
|
443 | </form> |
514 | </form> |
444 | </div> |
515 | </div> |
445 | </center> |
516 | </center> |
446 | </body> |
517 | </body> |
447 | </html>"; |
518 | </html>"; |