Subversion Repositories ALCASAR

Rev

Rev 2167 | Rev 2184 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2167 Rev 2182
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: intercept.php 2167 2017-04-08 15:54:53Z tom.houdayer $
2
# $Id: intercept.php 2182 2017-04-25 22:10:46Z tom.houdayer $
3
#
3
#
4
# intercept.php for ALCASAR captive portal
4
# intercept.php for ALCASAR captive portal
5
# Copyright (C) 2003, 2004 Mondru AB.
5
# Copyright (C) 2003, 2004 Mondru AB.
6
# Modify by REXY & steweb57
6
# Modify by REXY & steweb57
7
# UI & css style by stephane ERARD
7
# UI & css style by stephane ERARD
Line 28... Line 28...
28
define ("DOMAIN_ALLOWED_LIST", "/usr/local/etc/alcasar-uamdomain");
28
define ("DOMAIN_ALLOWED_LIST", "/usr/local/etc/alcasar-uamdomain");
29
 
29
 
30
/****************************************************************
30
/****************************************************************
31
*			FILE reading test			*
31
*			FILE reading test			*
32
*****************************************************************/
32
*****************************************************************/
33
$conf_files=array(CONF_FILE,DOMAIN_ALLOWED_LIST);
33
$conf_files = array(CONF_FILE,DOMAIN_ALLOWED_LIST);
34
foreach ($conf_files as $file){
34
foreach ($conf_files as $file) {
35
	if (!file_exists($file)){
35
	if (!file_exists($file)) {
36
		exit("Fichier ".$file." non présent");
36
		exit("Fichier ".$file." non présent");
37
	}
37
	}
38
	if (!is_readable($file)){
38
	if (!is_readable($file)) {
39
		exit("Vous n'avez pas les droits de lecture sur le fichier ".$file);
39
		exit("Vous n'avez pas les droits de lecture sur le fichier ".$file);
40
	}
40
	}
41
}
41
}
42
/****************************************************************
42
/****************************************************************
43
*			Read CONF_FILE				*
43
*			Read CONF_FILE				*
44
*****************************************************************/
44
*****************************************************************/
45
$ouvre=fopen(CONF_FILE,"r");
45
$file_conf = fopen(CONF_FILE, 'r');
46
if ($ouvre){
46
if (!$file_conf) {
47
	while (!feof ($ouvre))
47
	exit('Error opening the file '.CONF_FILE);
48
	{
48
}
-
 
49
while (!feof($file_conf)) {
49
		$tampon = fgets($ouvre, 4096);
50
	$tampon = fgets($file_conf, 4096);
50
		if (strpos($tampon,"=")!==false){
51
	if ((strpos($tampon, '=') !== false) && (substr($tampon, 0, 1) !== '#')) {
51
			$tmp = explode("=",$tampon);
52
		$tmp = explode('=', $tampon);
52
			$conf[$tmp[0]] = $tmp[1];
53
		$conf[$tmp[0]] = trim($tmp[1]);
53
		}
-
 
54
	}
54
	}
55
}else{
-
 
56
	exit("Erreur d'ouverture du fichier ".CONF_FILE);
-
 
57
}
55
}
58
fclose($ouvre);
56
fclose($file_conf);
-
 
57
 
59
$organisme = trim($conf["ORGANISM"]);
58
$organisme = trim($conf["ORGANISM"]);
60
 
59
 
61
# Shared secret used to encrypt password with coova.
60
# Shared secret used to encrypt password with coova.
62
$uamsecret = "";
61
$uamsecret = "";
63
 
62
 
64
# URL loaded after success authenticates (let blank for browser defaults)
63
# URL loaded after success authenticates (let blank for browser defaults)
65
$adminurl = "";
64
$adminurl = "";
66
 
65
 
67
# Our own path
66
# Our own path
68
$loginpath	= htmlspecialchars($_SERVER['PHP_SELF']);
67
$loginpath   = htmlspecialchars($_SERVER['PHP_SELF']);
69
$alcasarpath	= "http://alcasar.".trim($conf["DOMAIN"]);
68
$alcasarpath = 'http://'.trim($conf['HOSTNAME']).'.'.trim($conf['DOMAIN']);
70
$statuspath	= $alcasarpath."/status.php";
69
$statuspath  = $alcasarpath.'/status.php';
71
$debug		= false;
-
 
72
 
70
 
73
# Choice of language
71
# Choice of language
74
$Language = 'en';
72
$Language = 'en';
75
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
73
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
76
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
74
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
77
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
75
	$Language = strtolower(substr(chop($Langue[0]),0,2));
78
if($Language == 'es'){
76
}
79
  $l_ChilliError	= "La autenticación debe ser un éxito a través del servicio de portal cautivo.";
77
if ($Language === 'es') {
80
  $l_login		= "El éxito de la autenticación.<HR>Cierre esta ventana interrumpte la sesion.";
78
	$l_ChilliError		= "La autenticación debe ser un éxito a través del servicio de portal cautivo.";
81
  $l_logout		= "Conexión de cierre";
79
	$l_login		= "El éxito de la autenticación.<HR>Cierre esta ventana interrumpte la sesion.";
82
  $l_loginfailed	= "Error de autenticación";
80
	$l_logout		= "Conexión de cierre";
83
  $l_loggingin		= "Identificación en el portal cautivo";
81
	$l_loginfailed		= "Error de autenticación";
84
  $l_loggedcont		= "Control de Acceso";
82
	$l_loggingin		= "Identificación en el portal cautivo";
85
  $l_loggedout		= "Su sesión se cierra";
83
	$l_loggedcont		= "Control de Acceso";
86
  $l_user		= "Usuario";
84
	$l_loggedout		= "Su sesión se cierra";
87
  $l_password		= "Contraseña";
85
	$l_user			= "Usuario";
88
  $l_wait		= "Por favor, espere un momento ...";
86
	$l_password		= "Contraseña";
89
  $l_onlinetime		= "Tiempo de conexión:";
87
	$l_wait			= "Por favor, espere un momento ...";
90
  $l_remainingtime	= "Desconexión en:";
88
	$l_onlinetime		= "Tiempo de conexión:";
91
  $l_encrypted		= "La apertura debe usar conexión cifrada";
89
	$l_remainingtime	= "Desconexión en:";
92
  $l_boutonO		= "Autenticación";
90
	$l_encrypted		= "La apertura debe usar conexión cifrada";
93
  $l_boutonF		= "Cerrar";
91
	$l_boutonO		= "Autenticación";
94
  $l_loggedin_stringl1	= "Information System Security";
92
	$l_boutonF		= "Cerrar";
95
  $l_loggedin_stringl2	= "El portal fue creado reglamentos para garantizar la trazabilidad, la rendición de cuentas y el no repudio de las conexiones.";
93
	$l_loggedin_stringl1	= "Information System Security";
96
  $l_loggedin_stringl3	= "Su actividad en la red es registrada, de conformidad con la privacidad.";
94
	$l_loggedin_stringl2	= "El portal fue creado reglamentos para garantizar la trazabilidad, la rendición de cuentas y el no repudio de las conexiones.";
97
  $l_loggedin_stringl4	= "Los datos registrados pueden ser capaces de ser operado por una autoridad judicial en el curso de una investigación.";
95
	$l_loggedin_stringl3	= "Su actividad en la red es registrada, de conformidad con la privacidad.";
98
  $l_loggedin_stringl5	= "Estos datos se eliminan automáticamente después de un año.";
96
	$l_loggedin_stringl4	= "Los datos registrados pueden ser capaces de ser operado por una autoridad judicial en el curso de una investigación.";
99
  $l_loggedin_stringl6	= "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
97
	$l_loggedin_stringl5	= "Estos datos se eliminan automáticamente después de un año.";
100
  $l_loggedout_string	= "Cerrar sesión hizo portal cautivo!";
98
	$l_loggedin_stringl6	= "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
101
  $l_reply_1		= "Your daily connexion time has been reached";
99
	$l_loggedout_string	= "Cerrar sesión hizo portal cautivo!";
102
  $l_reply_2		= "Your monthly connexion time has been reached";
100
	$l_reply_1		= "Your daily connexion time has been reached";
103
  $l_reply_3		= "You try to connect outside of your allowed timespan";
101
	$l_reply_2		= "Your monthly connexion time has been reached";
104
  $l_reply_4		= "your account expired";
102
	$l_reply_3		= "You try to connect outside of your allowed timespan";
105
  $l_reply_5		= "You have reached the maximum number of simultaneous logins";
103
	$l_reply_4		= "your account expired";
106
  $l_reply_6		= "Your authorized connexion time has been reached";
104
	$l_reply_5		= "You have reached the maximum number of simultaneous logins";
107
  $l_online_time	= "Tiempo en linea";
105
	$l_reply_6		= "Your authorized connexion time has been reached";
108
  $l_remaining_time	= "Tiempo restante";
106
	$l_online_time		= "Tiempo en linea";
109
  $l_uam_domain		= "Sitios web autorizados : ";
107
	$l_remaining_time	= "Tiempo restante";
110
  $l_autoregistration   = "Registo autom&aacute;tico";}
108
	$l_uam_domain		= "Sitios web autorizados : ";
111
else if ($Language == 'pt'){
109
	$l_autoregistration 	= "Registo autom&aacute;tico";
112
  $l_ChilliError	= "A autenticação precisa ser bem sucedida através do portal.";
110
} else if ($Language === 'pt') {
113
  $l_login		= "Sucesso na autenticação.<HR>Matenha esse pop-up apenas minimizado para não interromper a conexão";
111
	$l_ChilliError		= "A autenticação precisa ser bem sucedida através do portal.";
114
  $l_logout		= "Encerrar conexão";
112
	$l_login		= "Sucesso na autenticação.<HR>Matenha esse pop-up apenas minimizado para não interromper a conexão";
115
  $l_loginfailed	= "Falha na autenticação";
113
	$l_logout		= "Encerrar conexão";
116
  $l_loggingin		= "Identificação do portal cativo";
114
	$l_loginfailed		= "Falha na autenticação";
117
  $l_loggedcont		= "Controle de acesso";
115
	$l_loggingin		= "Identificação do portal cativo";
118
  $l_loggedout		= "Sua sessão foi fechada";
116
	$l_loggedcont		= "Controle de acesso";
119
  $l_user		= "Usuário";
117
	$l_loggedout		= "Sua sessão foi fechada";
120
  $l_password		= "Senha";
118
	$l_user			= "Usuário";
121
  $l_wait		= "Por favor, aguarde um momento ...";
119
	$l_password		= "Senha";
122
  $l_onlinetime		= "Tempo de conexão:";
120
	$l_wait			= "Por favor, aguarde um momento ...";
123
  $l_remainingtime	= "Desconectado em:";
121
	$l_onlinetime		= "Tempo de conexão:";
124
  $l_encrypted		= "A conexão com o portal deve ser criptografada";
122
	$l_remainingtime	= "Desconectado em:";
125
  $l_boutonO		= "Autenticação";
123
	$l_encrypted		= "A conexão com o portal deve ser criptografada";
126
  $l_boutonF		= "Fechar";
124
	$l_boutonO		= "Autenticação";
127
  $l_loggedin_stringl1	= "Sistema de Informação e segurança";
125
	$l_boutonF		= "Fechar";
128
  $l_loggedin_stringl2	= "Este controle foi criado para garantir acesso seguro.";
126
	$l_loggedin_stringl1	= "Sistema de Informação e segurança";
129
  $l_loggedin_stringl3	= "A autenticação será criptografada em 256 bits, impedindo captura por escâner de rede.";
127
	$l_loggedin_stringl2	= "Este controle foi criado para garantir acesso seguro.";
130
  $l_loggedin_stringl4	= "Sua atividade na Internet será resguardada de acordo com os regulamentos da lei.";
128
	$l_loggedin_stringl3	= "A autenticação será criptografada em 256 bits, impedindo captura por escâner de rede.";
131
  $l_loggedin_stringl5	= "Mantenha o popup da conexão minimizado para não interromper a cessão.";
129
	$l_loggedin_stringl4	= "Sua atividade na Internet será resguardada de acordo com os regulamentos da lei.";
132
  $l_loggedin_stringl6	= "Clique <a href='$alcasarpath'>aqui</a> para alterar sua senha, instalar certificado ou sair do portal.";
130
	$l_loggedin_stringl5	= "Mantenha o popup da conexão minimizado para não interromper a cessão.";
133
  $l_loggedout_string	= "desconexão do portal cativo";
131
	$l_loggedin_stringl6	= "Clique <a href='$alcasarpath'>aqui</a> para alterar sua senha, instalar certificado ou sair do portal.";
134
  $l_reply_1		= "Seu tempo de conexão diária foi finalizado";
132
	$l_loggedout_string	= "desconexão do portal cativo";
135
  $l_reply_2		= "Seu tempo de conexão mensal foi finalizado";
133
	$l_reply_1		= "Seu tempo de conexão diária foi finalizado";
136
  $l_reply_3		= "Você tenta conectar-se fora do seu período de tempo permitido";
134
	$l_reply_2		= "Seu tempo de conexão mensal foi finalizado";
137
  $l_reply_4		= "Sua conta expirou";
135
	$l_reply_3		= "Você tenta conectar-se fora do seu período de tempo permitido";
138
  $l_reply_5		= "Você atingiu o número máximo de logins simultâneos";
136
	$l_reply_4		= "Sua conta expirou";
139
  $l_reply_6		= "Seu tempo de conexão autorizada finalizou";
137
	$l_reply_5		= "Você atingiu o número máximo de logins simultâneos";
140
  $l_online_time	= "Tempo Online";
138
	$l_reply_6		= "Seu tempo de conexão autorizada finalizou";
141
  $l_remaining_time	= "Tempo restante";
139
	$l_online_time		= "Tempo Online";
142
  $l_uam_domain		= "Sites autorizados : ";
140
	$l_remaining_time	= "Tempo restante";
143
  $l_autoregistration   = "Registo autom&aacute;tico";}
141
	$l_uam_domain		= "Sites autorizados : ";
144
else if ($Language == 'zh'){
142
	$l_autoregistration 	= "Registo autom&aacute;tico";
145
  $l_ChilliError	= "验证必须通过强制门户服务";
143
} else if ($Language === 'zh') {
146
  $l_login		= "验证成功<HR>关闭此窗口中断连接";
144
	$l_ChilliError		= "验证必须通过强制门户服务";
147
  $l_logout		= "关闭连接";
145
	$l_login		= "验证成功<HR>关闭此窗口中断连接";
148
  $l_loginfailed	= "验证失败";
146
	$l_logout		= "关闭连接";
149
  $l_loggingin		= "强制门户身份识别";
147
	$l_loginfailed		= "验证失败";
150
  $l_loggedcont		= "访问控制";
148
	$l_loggingin		= "强制门户身份识别";
151
  $l_loggedout		= "您的连接已关闭";
149
	$l_loggedcont		= "访问控制";
152
  $l_user		= "用户名";
150
	$l_loggedout		= "您的连接已关闭";
153
  $l_password		= "密码";
151
	$l_user			= "用户名";
154
  $l_wait		= "请等待 ...";
152
	$l_password		= "密码";
155
  $l_onlinetime		= "连接时间";
153
	$l_wait			= "请等待 ...";
156
  $l_remainingtime	= "断开连接于";
154
	$l_onlinetime		= "连接时间";
157
  $l_encrypted		= "与门户的连接必须加密";
155
	$l_remainingtime	= "断开连接于";
158
  $l_boutonO		= "验证";
156
	$l_encrypted		= "与门户的连接必须加密";
159
  $l_boutonF		= "关闭";
157
	$l_boutonO		= "验证";
160
  $l_loggedin_stringl1	= "信息系统安全";
158
	$l_boutonF		= "关闭";
161
  $l_loggedin_stringl2	= "这种控制实施以法定保证可追溯性,可归罪性和连接的不否认性.";
159
	$l_loggedin_stringl1	= "信息系统安全";
162
  $l_loggedin_stringl3	= "您的网络活动是私密登记的.";
160
	$l_loggedin_stringl2	= "这种控制实施以法定保证可追溯性,可归罪性和连接的不否认性.";
163
  $l_loggedin_stringl4	= "记录的数据能被司法机关在调查中操作使用.";
161
	$l_loggedin_stringl3	= "您的网络活动是私密登记的.";
164
  $l_loggedin_stringl5	= "这些数据将在一年后自动删除.";
162
	$l_loggedin_stringl4	= "记录的数据能被司法机关在调查中操作使用.";
165
  $l_loggedin_stringl6	= "点击 <a href='$alcasarpath'> 这里 </a> 修改密码或安装浏览器安全证书";
163
	$l_loggedin_stringl5	= "这些数据将在一年后自动删除.";
166
  $l_loggedout_string	= "强制网络门户连接已断开";
164
	$l_loggedin_stringl6	= "点击 <a href='$alcasarpath'> 这里 </a> 修改密码或安装浏览器安全证书";
167
  $l_reply_1		= "您已经达到每日连接时间";
165
	$l_loggedout_string	= "强制网络门户连接已断开";
168
  $l_reply_2		= "您已经达到每月连接时间";
166
	$l_reply_1		= "您已经达到每日连接时间";
169
  $l_reply_3		= "您尝试在授权时间以外连接";
167
	$l_reply_2		= "您已经达到每月连接时间";
170
  $l_reply_4		= "您的账号已过期";
168
	$l_reply_3		= "您尝试在授权时间以外连接";
171
  $l_reply_5		= "您已经达到同时连接的最大数量";
169
	$l_reply_4		= "您的账号已过期";
172
  $l_reply_6		= "已经到达您的允许连接时间";
170
	$l_reply_5		= "您已经达到同时连接的最大数量";
173
  $l_online_time	= "在线时间";
171
	$l_reply_6		= "已经到达您的允许连接时间";
174
  $l_remaining_time	= "剩余时间";
172
	$l_online_time		= "在线时间";
175
  $l_uam_domain		= "授权网站 : ";
173
	$l_remaining_time	= "剩余时间";
176
  $l_autoregistration   = "短信注册";}
174
	$l_uam_domain		= "授权网站 : ";
177
else if($Language == 'ar'){
175
	$l_autoregistration	= "短信注册";
178
 $l_ChilliError    = "يجب نجاح المصادقة على البوابة الأسيرة";
176
} else if($Language === 'ar') {
179
  $l_login    = "إغلاق هذه النافذة يقطع دورة عملك";
177
	$l_ChilliError		= "يجب نجاح المصادقة على البوابة الأسيرة";
180
  $l_logout   = "إغلاق الدورة";
178
	$l_login		= "إغلاق هذه النافذة يقطع دورة عملك";
181
  $l_loginfailed    = "فشل المصادقة";
179
	$l_logout		= "إغلاق الدورة";
182
  $l_loggingin    = "التعريف على البوابة الأسيرة";
180
	$l_loginfailed		= "فشل المصادقة";
183
  $l_loggedcont   = "مراقبة الدخول";
181
	$l_loggingin		= "التعريف على البوابة الأسيرة";
184
  $l_loggedout    = "دورتكَ مغلقة";
182
	$l_loggedcont		= "مراقبة الدخول";
185
  $l_user     = "التعريف";
183
	$l_loggedout		= "دورتكَ مغلقة";
186
  $l_password   = "كلمة السر";
184
	$l_user			= "التعريف";
187
  $l_wait   = "...إنتظر بعض اللحظات";
185
	$l_password		= "كلمة السر";
188
  $l_onlinetime   = ":مدة الإتصال";
186
	$l_wait			= "...إنتظر بعض اللحظات";
189
  $l_remainingtime  = ":انقطاع الإتصال في";
187
	$l_onlinetime		= ":مدة الإتصال";
190
  $l_encrypted    = "يجب تشفير الإتصال بالبوابة";
188
	$l_remainingtime	= ":انقطاع الإتصال في";
191
  $l_boutonO    = "مصادقة";
189
	$l_encrypted		= "يجب تشفير الإتصال بالبوابة";
192
  $l_boutonF    = "أغلق";
190
	$l_boutonO		= "مصادقة";
193
  $l_loggedin_stringl1  = "سلامة نظم المعلومات";
191
	$l_boutonF		= "أغلق";
194
  $l_loggedin_stringl2  = "وُضعت هذه المراقبة للضمان القانوني لتتبع ومساءلة وعدم تنصل الإتصالات";
192
	$l_loggedin_stringl1	= "سلامة نظم المعلومات";
195
  $l_loggedin_stringl3  = "نشاطك على الشبكة مسجل وفقاً لاحترام الحريات الشخصية";
193
	$l_loggedin_stringl2	= "وُضعت هذه المراقبة للضمان القانوني لتتبع ومساءلة وعدم تنصل الإتصالات";
196
  $l_loggedin_stringl4  = "لا يمكن استغلال البيانات المسجلة إلاّ من قِبل سلطات التحقيق القضائ";
194
	$l_loggedin_stringl3	= "نشاطك على الشبكة مسجل وفقاً لاحترام الحريات الشخصية";
197
  $l_loggedin_stringl5  = "سيتم حدف هذه البيانات تلقائياً بعد سنة من الْيَوْمَ";
195
	$l_loggedin_stringl4	= "لا يمكن استغلال البيانات المسجلة إلاّ من قِبل سلطات التحقيق القضائ";
198
  $l_loggedin_stringl6  = "لتغيير كلمة السر أو شهادة الأمان <a href='$alcasarpath'>هنا</a> اضغط ";
196
	$l_loggedin_stringl5	= "سيتم حدف هذه البيانات تلقائياً بعد سنة من الْيَوْمَ";
199
  $l_loggedout_string = "تَمّ قطع الإتصال بالبوابة الأسيرة";
197
	$l_loggedin_stringl6	= "لتغيير كلمة السر أو شهادة الأمان <a href='$alcasarpath'>هنا</a> اضغط ";
200
  $l_reply_1    = "انتهى وقتك اليومي للإتصال";
198
	$l_loggedout_string	= "تَمّ قطع الإتصال بالبوابة الأسيرة";
201
  $l_reply_2    = "انتهى وقتك الشهري للإتصال";
199
	$l_reply_1		= "انتهى وقتك اليومي للإتصال";
202
  $l_reply_3    = "محاولة اتصال خارج فترتك المأذونة";
200
	$l_reply_2		= "انتهى وقتك الشهري للإتصال";
203
  $l_reply_4    = "انتهت مدة صلاحية حسابك";
201
	$l_reply_3		= "محاولة اتصال خارج فترتك المأذونة";
204
  $l_reply_5    = "لقد استكملت العدد الأقصى للإتصالات المتزامنة";
202
	$l_reply_4		= "انتهت مدة صلاحية حسابك";
205
  $l_reply_6    = "استكملت مذة الإتصال المسموحة";
203
	$l_reply_5		= "لقد استكملت العدد الأقصى للإتصالات المتزامنة";
206
  $l_online_time  = "مذة الإتصال";
204
	$l_reply_6		= "استكملت مذة الإتصال المسموحة";
207
  $l_remaining_time = "الوقت المتبق";
205
	$l_online_time		= "مذة الإتصال";
208
  $l_uam_domain = ":المواقع المسموحة ";
206
	$l_remaining_time	= "الوقت المتبق";
209
  $l_autoregistration = "تسجيل ذاتي (SMS)";}
207
	$l_uam_domain		= ":المواقع المسموحة ";
210
else if($Language == 'de'){
208
	$l_autoregistration	= "تسجيل ذاتي (SMS)";
211
  $l_ChilliError	= "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt.";
209
} else if($Language === 'de') {
212
  $l_login		= "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung";
210
	$l_ChilliError		= "Die Authentifizierung ist erfolgreich durch die Nutzung des Portals erfolgt.";
213
  $l_logout		= "Beenden der Verbindung";
211
	$l_login		= "Erfolgreiche Authentifizierung.<HR>Schlißen dieses fensters unterbricht die sitzung";
214
  $l_loginfailed	= "Authentifizierungsfehler Eigenverbrauch";
212
	$l_logout		= "Beenden der Verbindung";
215
  $l_loggingin		= "Kennzeichnung auf dem Eigenverbrauch";
213
	$l_loginfailed		= "Authentifizierungsfehler Eigenverbrauch";
216
  $l_loggedcont		= "Zutrittskontrolle";
214
	$l_loggingin		= "Kennzeichnung auf dem Eigenverbrauch";
217
  $l_loggedout		= "Ihre Sitzung ist geschlossen";
215
	$l_loggedcont		= "Zutrittskontrolle";
218
  $l_user		= "Benutzer";
216
	$l_loggedout		= "Ihre Sitzung ist geschlossen";
219
  $l_password		= "Passwort";
217
	$l_user			= "Benutzer";
220
  $l_wait		= "Bitte warten Sie einen Moment ...";
218
	$l_password		= "Passwort";
221
  $l_onlinetime		= "Online-Zeit:";
219
	$l_wait			= "Bitte warten Sie einen Moment ...";
222
  $l_remainingtime	= "Abmelden:";
220
	$l_onlinetime		= "Online-Zeit:";
223
  $l_encrypted		= "Die Öffnung muß der Anschluß Zahlen";
221
	$l_remainingtime	= "Abmelden:";
224
  $l_boutonO		= "Authentifizierung";
222
	$l_encrypted		= "Die Öffnung muß der Anschluß Zahlen";
225
  $l_boutonF		= "Schließen";
223
	$l_boutonO		= "Authentifizierung";
226
  $l_loggedin_stringl1	= "Information System Security";
224
	$l_boutonF		= "Schließen";
227
  $l_loggedin_stringl2	= "Dieses Portal wurde eingerichtet, um ordnungsgemäß die Rückverfolgbarkeit, der Zurechenbarkeit und der Nicht-Anerkennung der Verbindungen.";
225
	$l_loggedin_stringl1	= "Information System Security";
228
  $l_loggedin_stringl3	= "Ihre Tätigkeit im Netzwerk registriert ist nach Schutz der Privatsphäre.";
226
	$l_loggedin_stringl2	= "Dieses Portal wurde eingerichtet, um ordnungsgemäß die Rückverfolgbarkeit, der Zurechenbarkeit und der Nicht-Anerkennung der Verbindungen.";
229
  $l_loggedin_stringl4	= "Die gespeicherten Daten nicht pouront genutzt werden, dass von einer Justizbehörde im Rahmen einer Untersuchung.";
227
	$l_loggedin_stringl3	= "Ihre Tätigkeit im Netzwerk registriert ist nach Schutz der Privatsphäre.";
230
  $l_loggedin_stringl5	= "Diese Daten werden automatisch gelöscht nach einem Jahr.";
228
	$l_loggedin_stringl4	= "Die gespeicherten Daten nicht pouront genutzt werden, dass von einer Justizbehörde im Rahmen einer Untersuchung.";
231
  $l_loggedin_stringl6	= "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
229
	$l_loggedin_stringl5	= "Diese Daten werden automatisch gelöscht nach einem Jahr.";
232
  $l_loggedout_string	= "Trennung des Portals erfolgt Gefangener!";
230
	$l_loggedin_stringl6	= "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
233
  $l_reply_1		= "Your daily connexion time has been reached";
231
	$l_loggedout_string	= "Trennung des Portals erfolgt Gefangener!";
234
  $l_reply_2		= "Your monthly connexion time has been reached";
232
	$l_reply_1		= "Your daily connexion time has been reached";
235
  $l_reply_3		= "You try to connect outside of your allowed timespan";
233
	$l_reply_2		= "Your monthly connexion time has been reached";
236
  $l_reply_4		= "your account expired";
234
	$l_reply_3		= "You try to connect outside of your allowed timespan";
237
  $l_reply_5		= "You have reached the maximum number of simultaneous logins";
235
	$l_reply_4		= "your account expired";
238
  $l_reply_6		= "Your authorized connexion time has been reached";
236
	$l_reply_5		= "You have reached the maximum number of simultaneous logins";
239
  $l_online_time	= "Online-zeit";
237
	$l_reply_6		= "Your authorized connexion time has been reached";
240
  $l_remaining_time	= "Restzeit";
238
	$l_online_time		= "Online-zeit";
241
  $l_uam_domain		= "Autorisierten websites : ";
239
	$l_remaining_time	= "Restzeit";
242
  $l_autoregistration   = "Automatische registrierung";}
240
	$l_uam_domain		= "Autorisierten websites : ";
243
else if($Language == 'nl'){
241
	$l_autoregistration	= "Automatische registrierung";
244
  $l_ChilliError	= "De authenticatie moet een succes worden via de captive portal dienst.";
242
} else if($Language === 'nl') {
245
  $l_login		= "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie.";
243
	$l_ChilliError		= "De authenticatie moet een succes worden via de captive portal dienst.";
246
  $l_logout		= "Slotkoers verbinding";
244
	$l_login		= "Succesvolle authenticatie.<HR>Dit venster te sluiten onderbreekt uw sessie.";
247
  $l_loginfailed	= "Authenticatie mislukt";
245
	$l_logout		= "Slotkoers verbinding";
248
  $l_loggingin		= "Identificatie van de captive-portaal";
246
	$l_loginfailed		= "Authenticatie mislukt";
249
  $l_loggedcont		= "toegangscontrole";
247
	$l_loggingin		= "Identificatie van de captive-portaal";
250
  $l_loggedout		= "Uw sessie is gesloten";
248
	$l_loggedcont		= "toegangscontrole";
251
  $l_user		= "Gebruiker";
249
	$l_loggedout		= "Uw sessie is gesloten";
252
  $l_password		= "Wachtwoord";
250
	$l_user			= "Gebruiker";
253
  $l_wait		= "Wacht een moment ...";
251
	$l_password		= "Wachtwoord";
254
  $l_onlinetime		= "Sluit tijd:";
252
	$l_wait			= "Wacht een moment ...";
255
  $l_remainingtime	= "Verbreking in:";
253
	$l_onlinetime		= "Sluit tijd:";
256
  $l_encrypted		= "De opening moet gebruiken gecodeerde verbinding";
254
	$l_remainingtime	= "Verbreking in:";
257
  $l_boutonO		= "Authenticatie";
255
	$l_encrypted		= "De opening moet gebruiken gecodeerde verbinding";
258
  $l_boutonF		= "Sluiten";
256
	$l_boutonO		= "Authenticatie";
259
  $l_loggedin_stringl1	= "Information System Security";
257
	$l_boutonF		= "Sluiten";
260
  $l_loggedin_stringl2	= "Het portaal werd opgericht verordeningen om de traceerbaarheid, verantwoordelijkheid en onloochenbaarheid van de verbindingen.";
258
	$l_loggedin_stringl1	= "Information System Security";
261
  $l_loggedin_stringl3	= "Uw activiteit op het netwerk is geregistreerd in overeenstemming met de persoonlijke levenssfeer.";
259
	$l_loggedin_stringl2	= "Het portaal werd opgericht verordeningen om de traceerbaarheid, verantwoordelijkheid en onloochenbaarheid van de verbindingen.";
262
  $l_loggedin_stringl4	= "De geregistreerde gegevens kunnen worden kunnen worden bediend door een rechterlijke instantie in de loop van een onderzoek.";
260
	$l_loggedin_stringl3	= "Uw activiteit op het netwerk is geregistreerd in overeenstemming met de persoonlijke levenssfeer.";
263
  $l_loggedin_stringl5	= "Deze gegevens worden automatisch verwijderd na een jaar.";
261
	$l_loggedin_stringl4	= "De geregistreerde gegevens kunnen worden kunnen worden bediend door een rechterlijke instantie in de loop van een onderzoek.";
264
  $l_loggedin_stringl6	= "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
262
	$l_loggedin_stringl5	= "Deze gegevens worden automatisch verwijderd na een jaar.";
265
  $l_loggedout_string	= "Logout gemaakt intern portaal!";
263
	$l_loggedin_stringl6	= "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
266
  $l_reply_1 		= "Your daily connexion time has been reached";
264
	$l_loggedout_string	= "Logout gemaakt intern portaal!";
267
  $l_reply_2		= "Your monthly connexion time has been reached";
265
	$l_reply_1 		= "Your daily connexion time has been reached";
268
  $l_reply_3		= "You try to connect outside of your allowed timespan";
266
	$l_reply_2		= "Your monthly connexion time has been reached";
269
  $l_reply_4		= "your account expired";
267
	$l_reply_3		= "You try to connect outside of your allowed timespan";
270
  $l_reply_5		= "You have reached the maximum number of simultaneous logins";
268
	$l_reply_4		= "your account expired";
271
  $l_reply_6		= "Your authorized connexion time has been reached";
269
	$l_reply_5		= "You have reached the maximum number of simultaneous logins";
272
  $l_online_time	= "Online tijd";
270
	$l_reply_6		= "Your authorized connexion time has been reached";
273
  $l_remaining_time	= "Reterende tijd";
271
	$l_online_time		= "Online tijd";
274
  $l_uam_domain		= "Geautoriseerde website : ";
272
	$l_remaining_time	= "Reterende tijd";
275
  $l_autoregistration   = "Automatische registratie";}
273
	$l_uam_domain		= "Geautoriseerde website : ";
276
else if($Language == 'fr'){
274
	$l_autoregistration	= "Automatische registratie";
277
  $l_ChilliError	= "L'authentification doit être réussie sur le portail captif.";
275
} else if($Language === 'fr') {
278
  $l_login		= "Authentification réussie.<HR>La fermeture de cette fenêtre interrompt votre session.";
276
	$l_ChilliError		= "L'authentification doit être réussie sur le portail captif.";
279
  $l_logout		= "Fermeture de la session";
277
	$l_login		= "Authentification réussie.<HR>La fermeture de cette fenêtre interrompt votre session.";
280
  $l_loginfailed	= "Echec d'authentification";
278
	$l_logout		= "Fermeture de la session";
281
  $l_loggingin		= "Identification sur le portail captif";
279
	$l_loginfailed		= "Echec d'authentification";
282
  $l_loggedcont		= "Contrôle d'accès";
280
	$l_loggingin		= "Identification sur le portail captif";
283
  $l_loggedout		= "Votre session est fermée";
281
	$l_loggedcont		= "Contrôle d'accès";
284
  $l_user		= "Identifiant";
282
	$l_loggedout		= "Votre session est fermée";
285
  $l_password		= "Mot de passe";
283
	$l_user			= "Identifiant";
286
  $l_wait		= "Patientez un instant ...";
284
	$l_password		= "Mot de passe";
287
  $l_onlinetime		= "Temps de connexion:";
285
	$l_wait			= "Patientez un instant ...";
288
  $l_remainingtime	= "Deconnexion dans :";
286
	$l_onlinetime		= "Temps de connexion:";
289
  $l_encrypted		= "La connexion avec le portail doit être chiffrée";
287
	$l_remainingtime	= "Deconnexion dans :";
290
  $l_boutonO		= "Authentification";
288
	$l_encrypted		= "La connexion avec le portail doit être chiffrée";
291
  $l_boutonF		= "Fermer";
289
	$l_boutonO		= "Authentification";
292
  $l_loggedin_stringl1	= "Sécurité des Systèmes d'Information";
290
	$l_boutonF		= "Fermer";
293
  $l_loggedin_stringl2	= "Ce contrôle a été mis en place pour assurer réglementairement la traçabilité, l'imputabilité et la non-répudiation des connexions.";
291
	$l_loggedin_stringl1	= "Sécurité des Systèmes d'Information";
294
  $l_loggedin_stringl3	= "Votre activité sur le réseau est enregistrée conformément au respect de la vie privée.";
292
	$l_loggedin_stringl2	= "Ce contrôle a été mis en place pour assurer réglementairement la traçabilité, l'imputabilité et la non-répudiation des connexions.";
295
  $l_loggedin_stringl4	= "Les données enregistrées ne pourront être exploitées que par une autorité judiciaire dans le cadre d'une enquête.";
293
	$l_loggedin_stringl3	= "Votre activité sur le réseau est enregistrée conformément au respect de la vie privée.";
296
  $l_loggedin_stringl5	= "Ces données seront automatiquement supprimées au bout d'un an.";
294
	$l_loggedin_stringl4	= "Les données enregistrées ne pourront être exploitées que par une autorité judiciaire dans le cadre d'une enquête.";
297
  $l_loggedin_stringl6	= "Cliquez <a href='$alcasarpath'>ici</a> pour changer votre mot de passe ou pour intégrer le certificat de sécurité à votre navigateur";
295
	$l_loggedin_stringl5	= "Ces données seront automatiquement supprimées au bout d'un an.";
298
  $l_loggedout_string	= "Déconnexion du portail captif effectuée !";
296
	$l_loggedin_stringl6	= "Cliquez <a href='$alcasarpath'>ici</a> pour changer votre mot de passe ou pour intégrer le certificat de sécurité à votre navigateur";
299
  $l_reply_1		= "Votre durée de connexion journalière a été atteinte";
297
	$l_loggedout_string	= "Déconnexion du portail captif effectuée !";
300
  $l_reply_2		= "Votre durée de connexion mensuelle a été atteinte";
298
	$l_reply_1		= "Votre durée de connexion journalière a été atteinte";
301
  $l_reply_3		= "Vous tentez de vous connecter en dehors de votre période autorisée";
299
	$l_reply_2		= "Votre durée de connexion mensuelle a été atteinte";
302
  $l_reply_4		= "Votre compte a expiré";
300
	$l_reply_3		= "Vous tentez de vous connecter en dehors de votre période autorisée";
303
  $l_reply_5		= "Vous avez atteint le nombre maximum de connexions simultanées";
301
	$l_reply_4		= "Votre compte a expiré";
304
  $l_reply_6		= "Votre durée de connexion autorisée a été atteinte";
302
	$l_reply_5		= "Vous avez atteint le nombre maximum de connexions simultanées";
305
  $l_online_time	= "Temps de connexion";
303
	$l_reply_6		= "Votre durée de connexion autorisée a été atteinte";
306
  $l_remaining_time	= "Temps restant";
304
	$l_online_time		= "Temps de connexion";
307
  $l_uam_domain		= "Sites autorisés : ";
305
	$l_remaining_time	= "Temps restant";
308
  $l_autoregistration	= "Auto enregistrement (sms)";}
306
	$l_uam_domain		= "Sites autorisés : ";
309
else{
307
	$l_autoregistration	= "Auto enregistrement (sms)";
310
  $l_ChilliError	= "The authentication must be successful through the captive portal service.";
308
} else {
311
  $l_login		= "Successful authentication.<HR>Closing this window interrupts your session";
309
	$l_ChilliError		= "The authentication must be successful through the captive portal service.";
312
  $l_logout		= "Closing connection";
310
	$l_login		= "Successful authentication.<HR>Closing this window interrupts your session";
313
  $l_loginfailed	= "Authentication Failed";
311
	$l_logout		= "Closing connection";
314
  $l_loggingin		= "Identification on the captive portal";
312
	$l_loginfailed		= "Authentication Failed";
315
  $l_loggedcont		= "Access Control";
313
	$l_loggingin		= "Identification on the captive portal";
316
  $l_loggedout		= "Your session is closed";
314
	$l_loggedcont		= "Access Control";
317
  $l_user		= "User";
315
	$l_loggedout		= "Your session is closed";
318
  $l_password		= "Password";
316
	$l_user			= "User";
319
  $l_wait		= "Please wait a moment ...";
317
	$l_password		= "Password";
320
  $l_onlinetime		= "Connect time:";
318
	$l_wait			= "Please wait a moment ...";
321
  $l_remainingtime	= "Disconnection in:";
319
	$l_onlinetime		= "Connect time:";
322
  $l_encrypted		= "The connection with the portal must be encrypted";
320
	$l_remainingtime	= "Disconnection in:";
323
  $l_boutonO		= "Authentication";
321
	$l_encrypted		= "The connection with the portal must be encrypted";
324
  $l_boutonF		= "Close";
322
	$l_boutonO		= "Authentication";
325
  $l_loggedin_stringl1	= "Information System Security";
323
	$l_boutonF		= "Close";
326
  $l_loggedin_stringl2	= "That control was set up regulations to ensure traceability, accountability and non-repudiation of connections.";
324
	$l_loggedin_stringl1	= "Information System Security";
327
  $l_loggedin_stringl3	= "Your activity on the network is registered in accordance with privacy.";
325
	$l_loggedin_stringl2	= "That control was set up regulations to ensure traceability, accountability and non-repudiation of connections.";
328
  $l_loggedin_stringl4	= "The recorded data can be able to be operated by a judicial authority in the course of an investigation.";
326
	$l_loggedin_stringl3	= "Your activity on the network is registered in accordance with privacy.";
329
  $l_loggedin_stringl5	= "These data will be automatically deleted after one year.";
327
	$l_loggedin_stringl4	= "The recorded data can be able to be operated by a judicial authority in the course of an investigation.";
330
  $l_loggedin_stringl6	= "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
328
	$l_loggedin_stringl5	= "These data will be automatically deleted after one year.";
331
  $l_loggedout_string	= "Disconnection of the captive portal made";
329
	$l_loggedin_stringl6	= "Click <a href='$alcasarpath'>here</a> to change your password or to integrate the security certificate in your browser";
332
  $l_reply_1		= "Your daily connexion time has been reached";
330
	$l_loggedout_string	= "Disconnection of the captive portal made";
333
  $l_reply_2		= "Your monthly connexion time has been reached";
331
	$l_reply_1		= "Your daily connexion time has been reached";
334
  $l_reply_3		= "You try to connect outside of your allowed timespan";
332
	$l_reply_2		= "Your monthly connexion time has been reached";
335
  $l_reply_4		= "your account expired";
333
	$l_reply_3		= "You try to connect outside of your allowed timespan";
336
  $l_reply_5		= "You have reached the maximum number of simultaneous logins";
334
	$l_reply_4		= "your account expired";
337
  $l_reply_6		= "Your authorized connexion time has been reached";
335
	$l_reply_5		= "You have reached the maximum number of simultaneous logins";
338
  $l_online_time	= "Online time";
336
	$l_reply_6		= "Your authorized connexion time has been reached";
339
  $l_remaining_time	= "Remaining time";
337
	$l_online_time		= "Online time";
340
  $l_uam_domain		= "Authorized websites : ";
338
	$l_remaining_time	= "Remaining time";
341
  $l_autoregistration	= "Auto registration (sms)";
339
	$l_uam_domain		= "Authorized websites : ";
-
 
340
	$l_autoregistration	= "Auto registration (sms)";
342
}
341
}
343
 
342
 
344
# If https not use, tell it's wrong
343
# If https not use, tell it's wrong
345
if (!(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS'] == 'on'))) {
344
if ((!isset($_SERVER['HTTPS'])) || (empty($_SERVER['HTTPS'])) || ($_SERVER['HTTPS'] === 'off')) {
-
 
345
	?>
346
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
346
	<!doctype html>
347
<html>
347
	<html>
348
<head>
348
	<head>
349
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
349
		<meta charset="utf-8">
350
  <title>$l_loggedcont</title>
350
		<title><?= $l_loggedcont ?></title>
351
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
351
		<meta http-equiv="Cache-control" content="no-cache">
352
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
352
		<meta http-equiv="Pragma" content="no-cache">
353
</head>
353
	</head>
354
<body bgColor = 'white'>
354
	<body style="background-color: white;">
355
  <h1 style=\"text-align: center;\">$l_loginfailed</h1>
355
		<h1 style="text-align: center;"><?= $l_loginfailed ?></h1>
356
  <center>$l_encrypted</center>
356
		<center><?= $l_encrypted ?></center> 
357
</body>
357
	</body>
358
</html>";
358
	</html>
-
 
359
	<?php
359
    exit(0);
360
	exit();
360
}
361
}
361
 
362
 
362
# Read form parameters which we care about
363
# Read form parameters which we care about
363
# avoid the "user as a MAC address" attempts
364
# avoid the "user as a MAC address" attempts
364
if ((isset($_POST['UserName'])) && (preg_match('/^([0-9A-F]{2}-){5}[0-9A-F]{2}$/',$_POST['UserName'])!=1)){
365
if ((isset($_POST['UserName'])) && (preg_match('/^([0-9A-F]{2}-){5}[0-9A-F]{2}$/', $_POST['UserName']) !== 1)) {
365
				$username	= $_POST['UserName'];} else {$username="";}
366
				$username	= $_POST['UserName'];}	else {$username="";}
366
if (isset($_POST['Password'])){	$password	= $_POST['Password'];} else {$password="";}
367
if (isset($_POST['Password'])){	$password	= $_POST['Password'];}	else {$password="";}
367
if (isset($_POST['challenge'])){$challenge	= $_POST['challenge'];} else {$challenge="";}
368
if (isset($_POST['challenge'])){$challenge	= $_POST['challenge'];}	else {$challenge="";}
368
if (isset($_POST['button'])){	$button		= $_POST['button'];} else { $button="";}
369
if (isset($_POST['button'])){	$button		= $_POST['button'];}	else {$button="";}
369
//if (isset($_POST['logout'])){	$logout		= $_POST['logout'];} else {$logout="";}
370
// if (isset($_POST['logout'])){	$logout		= $_POST['logout'];}	else {$logout="";}
370
//if (isset($_POST['prelogin'])){	$prelogin	= $_POST['prelogin'];} else {$prelogin="";}
371
// if (isset($_POST['prelogin'])){	$prelogin	= $_POST['prelogin'];}	else {$prelogin="";}
371
if (isset($_POST['res'])){		$res		= $_POST['res'];} else {$res="";}
372
if (isset($_POST['res'])){	$res		= $_POST['res'];}	else {$res="";}
372
if (isset($_POST['uamip'])){	$uamip		= $_POST['uamip'];} else {$uamip="";}
373
if (isset($_POST['uamip'])){	$uamip		= $_POST['uamip'];}	else {$uamip="";}
373
if (isset($_POST['uamport'])){	$uamport	= $_POST['uamport'];} else {$uamport="";}
374
if (isset($_POST['uamport'])){	$uamport	= $_POST['uamport'];}	else {$uamport="";}
374
if (isset($_POST['userurl'])){	$userurl	= $_POST['userurl'];} else {$userurl="";}
375
if (isset($_POST['userurl'])){	$userurl	= $_POST['userurl'];}	else {$userurl="";}
375
if (isset($_POST['timeleft'])){	$timeleft	= $_POST['timeleft'];} else {$timeleft="";}
376
if (isset($_POST['timeleft'])){	$timeleft	= $_POST['timeleft'];}	else {$timeleft="";}
376
if (isset($_POST['redirurl'])){	$redirurl	= $_POST['redirurl'];} else {$redirurl="";}
377
if (isset($_POST['redirurl'])){	$redirurl	= $_POST['redirurl'];}	else {$redirurl="";}
377
 
378
 
378
# Read query parameters which we care about
379
# Read query parameters which we care about
379
if (isset($_GET['res']))		$res		= $_GET['res'];
380
if (isset($_GET['res']))	$res		= $_GET['res'];
380
if (isset($_GET['challenge']))	$challenge	= $_GET['challenge'];
381
if (isset($_GET['challenge']))	$challenge	= $_GET['challenge'];
381
if (isset($_GET['uamip']))		$uamip		= $_GET['uamip'];
382
if (isset($_GET['uamip']))	$uamip		= $_GET['uamip'];
382
if (isset($_GET['uamport']))	$uamport	= $_GET['uamport'];
383
if (isset($_GET['uamport']))	$uamport	= $_GET['uamport'];
383
if (isset($_GET['reply'])){		$reply		= $_GET['reply'];} else {$reply="";}
384
if (isset($_GET['reply'])){	$reply		= $_GET['reply'];}	else {$reply="";}
384
if (isset($_GET['userurl']))	$userurl	= $_GET['userurl'];
385
if (isset($_GET['userurl']))	$userurl	= $_GET['userurl'];
385
if (isset($_GET['timeleft']))	$timeleft	= $_GET['timeleft'];
386
if (isset($_GET['timeleft']))	$timeleft	= $_GET['timeleft'];
386
if (isset($_GET['redirurl']))	$redirurl	= $_GET['redirurl'];
387
if (isset($_GET['redirurl']))	$redirurl	= $_GET['redirurl'];
387
 
388
 
388
# translation of radius replies
389
# translation of radius replies
389
if (isset($reply)){
390
if (isset($reply)) {
390
	switch(trim ($reply)) {
391
	switch (trim ($reply)) {
391
  case 'Your maximum daily usage time has been reached' : $reply = $l_reply_1 ; break;
392
		case 'Your maximum daily usage time has been reached'	: $reply = $l_reply_1 ; break;
392
  case 'Your maximum monthly usage time has been reached' : $reply = $l_reply_2 ; break;
393
		case 'Your maximum monthly usage time has been reached'	: $reply = $l_reply_2 ; break;
393
  case 'You are calling outside your allowed timespan' : $reply = $l_reply_3 ; break;
394
		case 'You are calling outside your allowed timespan'	: $reply = $l_reply_3 ; break;
394
  case 'Password Has Expired' : $reply =  $l_reply_4 ; break;
395
		case 'Password Has Expired'				: $reply = $l_reply_4 ; break;
395
  case 'You are already logged in - access denied' : $reply = $l_reply_5 ; break;
396
		case 'You are already logged in - access denied'	: $reply = $l_reply_5 ; break;
396
  case 'Your maximum never usage time has been reached' : $reply = $l_reply_6 ; break;
397
		case 'Your maximum never usage time has been reached'	: $reply = $l_reply_6 ; break;
397
  }}
398
	}
-
 
399
}
398
 
400
 
399
# If attempt to login
401
// If attempt to login
400
if ("$button" == "$l_boutonO") {
402
if ($button === $l_boutonO) {
401
  #correction password length in coova-chilli
403
	//correction password length in coova-chilli
402
  #thanks to http://www.stochasticgeometry.ie/2009/09/09/maximum-password-length-in-coova-chilli/
404
	//thanks to http://www.stochasticgeometry.ie/2009/09/09/maximum-password-length-in-coova-chilli/
403
  $hexchal = pack ("H*", $challenge);
405
	$hexchal = pack('H*', $challenge);
404
  $newchal = pack ("H*", md5($hexchal . $uamsecret));
406
	$newchal = pack('H*', md5($hexchal . $uamsecret));
405
 
407
 
406
  # If challenge isn't long enough, repeat it until it is
408
	// If challenge isn't long enough, repeat it until it is
407
  while (strlen($newchal) < strlen($password)){
409
	while (strlen($newchal) < strlen($password)){
408
                       $newchal .= $newchal;
410
		$newchal .= $newchal;
409
  }
411
	}
410
 
412
 
411
  $response = md5("\0" . $password . $newchal);
-
 
412
  $newpwd = pack("a*", $password);
413
	$newpwd   = pack('a*', $password);
413
  # Encode plain text password with challenge
414
	// Encode plain text password with challenge
414
  $pappassword = implode ("", unpack("H*", ($newpwd ^ $newchal)));
415
	$pappassword = implode('', unpack('H*', ($newpwd ^ $newchal)));
-
 
416
	?>
415
  echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
417
	<!doctype html>
416
<html>
418
	<html>
417
<head>
419
	<head>
418
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
420
		<meta charset="utf-8">
419
  <title>$l_loggingin</title>
421
		<title><?= $l_loggingin ?></title>
420
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
422
		<meta http-equiv="Cache-control" content="no-cache">
421
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
423
		<meta http-equiv="Pragma" content="no-cache">
422
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl\">
424
		<meta http-equiv="refresh" content="0;url=<?= "http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl" ?>">
423
  </head>
425
	</head>
424
<body bgColor = 'white'>
426
	<body style="background-color: white;">
425
<h1 style=\"text-align: center;\">$l_loggingin</h1>
427
		<h1 style="text-align: center;"><?= $l_loggingin ?></h1>
426
  <center>
-
 
427
    $l_wait
-
 
428
  </center>
428
		<center><?= $l_wait ?></center> 
429
</body>
429
	</body>
430
</html>";
430
	</html>
-
 
431
	<?php
431
exit(0);
432
	exit();
432
}
433
}
433
 
434
 
434
switch($res) {
435
switch($res) {
435
  case 'success':     $result =  1; break; // If login successful
436
	case 'success':	$result = 1; break; // If login successful
436
  case 'failed':      $result =  2; break; // If login failed
437
	case 'failed':	$result = 2; break; // If login failed
437
  case 'logoff':      $result =  3; break; // If logout successful
438
	case 'logoff':	$result = 3; break; // If logout successful
438
  case 'already':     $result =  4; break; // If tried to login while already logged in
439
	case 'already':	$result = 4; break; // If tried to login while already logged in
439
  case 'notyet':      $result =  5; break; // If not logged in yet
440
	case 'notyet':	$result = 5; break; // If not logged in yet
440
  default: $result = 0; // Default: It was not a form request -> client go to login form
441
	default:	$result = 0; // Default: It was not a form request -> client go to login form
441
}
442
}
442
 
443
 
443
//check if we need to warn user about the imputability logs.
444
//check if we need to warn user about the imputability logs.
444
if($result == 1)
445
if($result === 1) {
445
{
-
 
446
        if ((is_file("./acc/manager/lib/sql/drivers/mysql/functions.php"))&&(is_file("/etc/freeradius-web/config.php"))){
446
	if ((is_file('./acc/manager/lib/sql/drivers/mysql/functions.php')) && (is_file('/etc/freeradius-web/config.php'))) {
447
        include_once("/etc/freeradius-web/config.php");
447
		include_once('/etc/freeradius-web/config.php');
448
        include_once("./acc/manager/lib/sql/drivers/mysql/functions.php");
448
		include_once('./acc/manager/lib/sql/drivers/mysql/functions.php');
449
        $link = @da_sql_pconnect($config); // on affiche pas les erreurs
449
		$link = @da_sql_pconnect($config); // on affiche pas les erreurs
-
 
450
		if ($link) {
450
        $user_uid=da_sql_escape_string($link, $_GET['uid']);
451
			$user_uid = da_sql_escape_string($link, $_GET['uid']);
451
        $sql = "SELECT attribute, value FROM radreply WHERE username='$user_uid'";
452
			$sql = "SELECT attribute, value FROM radreply WHERE username='$user_uid' AND attribute='Filter-Id'";
452
        if ($link){
-
 
453
                $res = @da_sql_query($link,$config,$sql); // on affiche pas les erreurs
453
			$res = @da_sql_query($link, $config, $sql); // on affiche pas les erreurs
454
                if ($res){
454
			if ($res) {
455
                        while(($row = @da_sql_fetch_array($res,$config))){
455
				$row = @da_sql_fetch_array($res, $config);
456
                                if ($row['attribute'] == "Filter-Id") $filter_id = $row['value']; // on obtient le Filter-Id de l'utilisateur
456
				$filter_id = $row['value']; // on obtient le Filter-Id de l'utilisateur
457
                        }
-
 
458
                        if($filter_id[3] == '1')
457
				if($filter_id[3] === '1') {
459
                        {
-
 
460
                                #set the fourth bit of filter-id to '0'
458
					//set the fourth bit of filter-id to '0'
461
                                $sql = "set @CurrentFilter=(SELECT value from radreply where username='$user_uid');set @CurrentFilterLeft=(SELECT LEFT(@CurrentFilter,3));set @CurrentFilterRight=(SELECT RIGHT(@CurrentFilter,4));UPDATE radreply SET value = CONCAT((@CurrentFilterLeft),'0', (@CurrentFilterRight)) WHERE username='$user_uid'";
459
					$sql = "set @CurrentFilter=(SELECT value from radreply where username='$user_uid');set @CurrentFilterLeft=(SELECT LEFT(@CurrentFilter,3));set @CurrentFilterRight=(SELECT RIGHT(@CurrentFilter,4));UPDATE radreply SET value = CONCAT((@CurrentFilterLeft),'0', (@CurrentFilterRight)) WHERE username='$user_uid'";
462
                                $res = mysqli_multi_query($link,$sql);
460
					$res = mysqli_multi_query($link,$sql);
463
                                $user_url = urlencode($_GET['userurl']);
-
 
464
                                header("Location: http://alcasar/index.php?warn=1&url=$user_url");   //we present to user information about imputability logs 
461
					header('Location: https://'.trim($conf['HOSTNAME']).'.'.trim($conf['DOMAIN']).'/index.php?warn=1&url='.urlencode($_GET['userurl']));   //we present to user information about imputability logs 
465
                                exit;
-
 
466
                        }
-
 
467
                }
462
					exit();
468
        }
463
				}
469
        }
464
			}
470
        
465
		}
-
 
466
	}
471
}
467
}
472
 
468
 
473
 
469
 
474
# Otherwise it was not a form request
470
// Otherwise it was not a form request
475
# Send out an error message
471
// Send out an error message
476
if ($result == 0) {	//erreur
472
if ($result === 0) {	//erreur
-
 
473
	?>
477
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
474
	<!doctype html>
478
<html>
475
	<html>
479
<head>
476
	<head>
480
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
477
		<meta charset="utf-8">
481
  <title>$l_loggingin</title>
478
		<title><?= $l_loggingin ?></title>
482
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
479
		<meta http-equiv="Cache-control" content="no-cache">
483
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
480
		<meta http-equiv="Pragma" content="no-cache">
484
  <meta http-equiv=\"refresh\" content=\"0;url=http://$uamip:$uamport/prelogin\">
481
		<meta http-equiv="refresh" content="0;url=<?= "http://$uamip:$uamport/prelogin" ?>">
485
  </head>
482
	</head>
486
<body bgColor = 'white'>
483
	<body style="background-color: white;">
487
<h1 style=\"text-align: center;\">$l_loggingin</h1>
484
		<h1 style="text-align: center;"><?= $l_loggingin ?></h1>
488
  <center>
-
 
489
    $l_wait
-
 
490
  </center>
485
		<center><?= $l_wait ?></center> 
491
</body>
486
	</body>
492
</html>";
487
	</html>
-
 
488
	<?php
493
    exit(0);
489
	exit();
494
}
490
}
495
# Generate the output
491
?>
496
echo "<!DOCTYPE html>
492
<!doctype html>
497
<html>
493
<html>
498
<head>
494
<head>
499
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
495
	<meta charset="utf-8">
500
  <title>$l_loggingin</title>
496
	<title><?= $l_loggingin ?></title>
501
  <meta http-equiv=\"Cache-control\" content=\"no-cache\">
497
	<meta http-equiv="Cache-control" content="no-cache">
502
  <meta http-equiv=\"Pragma\" content=\"no-cache\">
498
	<meta http-equiv="Pragma" content="no-cache">
503
  <script type=\"text/javascript\" language=\"JavaScript\">
499
	<script type="text/javascript">
504
	alcasar_popup = null;
500
	var alcasar_popup = null;
505
	function popUp(URL) {
501
	function popUp(URL) {
506
		if (self.name != \"alcasar_popup\") {
502
		if (self.name !== "alcasar_popup") {
507
			alcasar_popup = window.open(URL, 'alcasar_popup', 'width=500,height=460,directories=no,resizable=no,scrollbars=yes,location=no,toolbar=no,statusbar=no,menubar=no');
503
			alcasar_popup = window.open(URL, 'alcasar_popup', 'width=500,height=460,directories=no,resizable=no,scrollbars=yes,location=no,toolbar=no,statusbar=no,menubar=no');
508
		}
504
		}
509
	}
505
	}
510
	function doOnLoad(result, userurl, redirurl, adminurl, timeleft) {
506
	function doOnLoad(result, userurl, redirurl, adminurl, timeleft) {
511
		if ((result == 1)||(result == 4)) {	//success or already
507
		if ((result === 1) || (result === 4)) {	//success or already
512
			//window.location = userurl;
508
			//window.location = userurl;
513
			if (alcasar_popup != null) alcasar_popup.focus();
509
			if (alcasar_popup !== null) alcasar_popup.focus();
514
			if (adminurl != ''){
510
			if (adminurl !== '') {
515
				window.location = adminurl;
511
				window.location = adminurl;
516
			} else if (redirurl != '') {
512
			} else if (redirurl !== '') {
517
				window.location = redirurl;
513
				window.location = redirurl;
518
				} else if (userurl != '') {
514
				} else if (userurl !== '') {
519
					window.location = userurl;
515
					window.location = userurl;
520
				} else {
516
				} else {
521
				window.home();
517
				window.home();
522
			}
518
			}
523
		}
519
		}
524
		if ((result == 2) || (result == 3) || result == 5) { //failed or logoff or notyet
520
		if ((result === 2) || (result === 3) || result === 5) { //failed or logoff or notyet
525
			if (alcasar_popup != null) alcasar_popup.close();
521
			if (alcasar_popup !== null) alcasar_popup.close();
526
			document.form1.UserName.focus();
522
			document.form1.UserName.focus();
527
		}
523
		}
528
	}
524
	}
529
</script>
525
	</script>
530
<link rel=\"stylesheet\" href=\"/css/style_intercept.css\" type=\"text/css\">
526
	<link rel="stylesheet" href="/css/style_intercept.css" type="text/css">
531
</head>
527
</head>
532
<body onLoad=\"javascript:doOnLoad($result,'$userurl','$redirurl','$adminurl','$timeleft')\">
528
<body onLoad="javascript:doOnLoad(<?= $result ?>,'<?= $userurl ?>','<?= $redirurl ?>','<?= $adminurl ?>','<?= $timeleft ?>')">
533
  <center>";
529
	<center>
534
if ($result == 2 || $result == 3 || $result == 5) { //failed or logoff or notyet
-
 
535
  echo "
-
 
536
	<div id=\"logon\">
-
 
537
	<h1>$organisme</h1>
-
 
538
	<h2>$l_loggedcont</h2>";
-
 
539
	if ($result == 2) { //failed
-
 
540
		echo "	
-
 
541
		<h3>$l_loginfailed</h3>";
-
 
542
		if ($reply) {
-
 
543
		#traitement du reply ...
-
 
544
		echo "<center> $reply <br /><br /></center>";
-
 
545
		}
-
 
546
	}
-
 
547
	if ($userurl == "http://logout/") $userurl="http://www.google.com"; //avoid cyclic logout
-
 
548
	echo "
-
 
549
	<img id=\"logo-alcasar\" src=\"/images/logo-alcasar.png\">
-
 
550
	<form name=\"form1\" method=\"post\" action=\"$loginpath\">
-
 
551
	<input type=\"hidden\" name=\"challenge\" value=\"$challenge\">
-
 
552
	<input type=\"hidden\" name=\"uamip\" value=\"$uamip\">
-
 
553
	<input type=\"hidden\" name=\"uamport\" value=\"$uamport\">
-
 
554
	<input type=\"hidden\" name=\"userurl\" value=\"$userurl\">
-
 
555
	<table id=\"boite-logon\">
-
 
556
		<tr>
-
 
557
			<td width=\"20%\" rowspan=\"4\"><img id=\"logo-organ\" src=\"/images/organisme.png\"></td>
-
 
558
			<td width=\"30%\" align=\"right\">$l_user</td>
-
 
559
			<td width=\"50%\" align=\"left\"><INPUT type=\"text\" maxLength=\"32\" name=\"UserName\" autocomplete=\"off\"></td>
-
 
560
		</tr>
-
 
561
		<tr>
-
 
562
			<td align=\"right\">$l_password</td>
-
 
563
			<td align=\"left\"><INPUT maxLength=\"32\" type=\"password\" name=\"Password\" autocomplete=\"off\"></td>
-
 
564
		</tr>
-
 
565
		";
-
 
566
 
-
 
567
	echo "	</tr>
-
 
568
			<td height=\"23\"  align=\"left\"><INPUT value=\"$l_boutonO\" type=\"submit\" name=\"button\" onclick=\"window.open('$statuspath', '_blank');\"></td>
-
 
569
		";
-
 
570
 
-
 
571
 
-
 
572
	$service_SMS_status=false;
-
 
573
	if($service_SMS_status){
-
 
574
		echo "	<td><a href=\"./autoregistrationinfo.php\">".$l_autoregistration."</a></td>";
-
 
575
	}
-
 
576
 
530
 
-
 
531
	<?php if ($result === 2 || $result === 3 || $result === 5): //failed or logoff or notyet ?>
-
 
532
	<div id="logon">
-
 
533
		<h1><?= $organisme ?></h1>
-
 
534
		<h2><?= $l_loggedcont ?></h2>
-
 
535
		<?php if ($result === 2): //failed ?>
-
 
536
			<h3><?= $l_loginfailed ?></h3>
-
 
537
			<?php if ($reply): //traitement du reply ... ?>
-
 
538
				<center><?= $reply ?><br><br></center>
-
 
539
			<?php endif; ?>
-
 
540
		<?php endif;
-
 
541
		if ($userurl === 'http://logout/') $userurl = 'http://www.google.com'; // Avoid cyclic logout
-
 
542
		?>
-
 
543
		<img id="logo-alcasar" src="/images/logo-alcasar.png">
-
 
544
		<form name="form1" method="post" action="<?= $loginpath ?>">
-
 
545
			<input type="hidden" name="challenge" value="<?= $challenge ?>">
-
 
546
			<input type="hidden" name="uamip" value="<?= $uamip ?>">
-
 
547
			<input type="hidden" name="uamport" value="<?= $uamport ?>">
-
 
548
			<input type="hidden" name="userurl" value="<?= $userurl ?>">
-
 
549
			<table id="boite-logon">
-
 
550
				<tr>
-
 
551
					<td width="20%" rowspan="4"><img id="logo-organ" src="/images/organisme.png"></td>
-
 
552
					<td width="30%" align="right"><?= $l_user ?></td>
-
 
553
					<td width="50%" align="left"><input type="text" maxLength="32" name="UserName" autocomplete="off"></td>
-
 
554
				</tr>
-
 
555
				<tr>
-
 
556
					<td align="right"><?= $l_password ?></td>
-
 
557
					<td align="left"><input maxLength="32" type="password" name="Password" autocomplete="off"></td>
-
 
558
				</tr>
-
 
559
				<tr>
-
 
560
					<td height="23" align="left"><input value="<?= $l_boutonO ?>" type="submit" name="button" onclick="window.open('<?= $statuspath ?>', '_blank');"></td>
-
 
561
					<?php
-
 
562
					$service_SMS_status = false;
-
 
563
					if ($service_SMS_status): ?>
-
 
564
						<td><a href="./autoregistrationinfo.php"><?= $l_autoregistration ?></a></td>
-
 
565
					<?php endif; ?>
577
	echo "	</tr>
566
				</tr>
578
	</table>
567
			</table>
579
 
-
 
580
	</form>
568
		</form>
581
	<table id=\"boite-info\" cellSpacing=\"0\" cellPadding=\"0\" width=\"80%\">
569
		<table id="boite-info" cellSpacing="0" cellPadding="0" width="80%">
582
		<tr>
570
			<tr>
583
			<td align=\"center\"><FONT color=\"red\"><B>$l_loggedin_stringl1</B></FONT></td>
571
				<td align="center"><font color="red"><b><?= $l_loggedin_stringl1 ?></b></font></td>
584
		</tr>
572
			</tr>
585
		<tr>
573
			<tr>
586
			<td align=\"left\">
574
				<td align="left">
587
				<ul>
575
					<ul>
588
					<LI>$l_loggedin_stringl2</LI>
576
						<li><?= $l_loggedin_stringl2 ?></li>
589
					<LI>$l_loggedin_stringl4</LI>
577
						<li><?= $l_loggedin_stringl4 ?></li>
590
					<LI>$l_loggedin_stringl3</LI>
578
						<li><?= $l_loggedin_stringl3 ?></li>
591
					<LI>$l_loggedin_stringl5</LI>
579
						<li><?= $l_loggedin_stringl5 ?></li>
592
					<LI>$l_loggedin_stringl6</LI>
580
						<li><?= $l_loggedin_stringl6 ?></li>
593
				</ul>
581
					</ul>
594
			</td>
582
				</td>
595
		</tr>
583
			</tr>
596
	</table>";
584
		</table>
597
 
585
		<?php
598
// Read the "Domain allowed" file
586
		// Read the "Domain allowed" file
599
$tab=file(DOMAIN_ALLOWED_LIST);
587
		$tab = file(DOMAIN_ALLOWED_LIST);
600
if ($tab)  # the file isn't empty
588
		if ($tab) { // the file isn't empty
601
	{
-
 
602
	echo "<div id=\"authorized_domain\">$l_uam_domain";
589
			echo '<div id="authorized_domain">'.$l_uam_domain;
603
	foreach ($tab as $line)
590
			foreach ($tab as $line) {
604
		{
-
 
605
		if (trim($line) != '') # the line isn't empty
591
				if (trim($line) !== '') { // the line isn't empty
606
			{
-
 
607
			$domain_allowed=explode("#", $line);
592
					$domain_allowed = explode("#", $line);
608
			if (trim($domain_allowed[1]) != ''){
593
					if (trim($domain_allowed[1]) !== '') {
609
				$domain=explode("\"", $domain_allowed[0]);
594
						$domain = explode('"', $domain_allowed[0]);
610
				#remove every '.' from the beginning of domain
595
						// remove every '.' from the beginning of domain
611
                                $domain[1] = ltrim($domain[1], '.');
596
						$domain[1] = ltrim($domain[1], '.');
612
				echo "<a href=\"http://".trim($domain[1])."\">".trim($domain_allowed[1])."</a> ";}
597
						echo '<a href="http://'.trim($domain[1]).'">'.trim($domain_allowed[1]).'</a>';
-
 
598
					}
-
 
599
				}
613
			}	
600
			}
614
		}
601
		}
615
	}
602
		?>
616
echo "	
603
	</div>
617
</div>
604
	<?php endif; ?>
-
 
605
 
618
</center>
606
	</center>
619
</body>
607
</body>
620
</html>";
608
</html>
621
}
-
 
622
exit(0);
-
 
623
?>
-