Subversion Repositories ALCASAR

Rev

Rev 2116 | Rev 2134 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 2116 Rev 2127
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: index.php 2116 2017-01-18 12:20:32Z franck $
2
# $Id: index.php 2127 2017-02-26 23:20:08Z richard $
3
#
3
#
4
# index.php for ALCASAR by Rexy
4
# index.php for ALCASAR by Rexy
5
# UI & css style by stephane ERARD
5
# UI & css style by stephane ERARD
6
# The contents of this file may be used under the terms of the GNU
6
# The contents of this file may be used under the terms of the GNU
7
# General Public License Version 2, provided that the above copyright
7
# General Public License Version 2, provided that the above copyright
Line 27... Line 27...
27
/****************************************************************
27
/****************************************************************
28
*			Read CONF_FILE				*
28
*			Read CONF_FILE				*
29
*****************************************************************/
29
*****************************************************************/
30
$ouvre=fopen(CONF_FILE,"r");
30
$ouvre=fopen(CONF_FILE,"r");
31
if ($ouvre){
31
if ($ouvre){
32
	while (!feof ($ouvre))
32
	while (!feof ($ouvre)){
33
	{
-
 
34
		$tampon = fgets($ouvre, 4096);
33
		$tampon = fgets($ouvre, 4096);
35
		if (strpos($tampon,"=")!==false){
34
		if (strpos($tampon,"=")!==false){
36
			$tmp = explode("=",$tampon);
35
			$tmp = explode("=",$tampon);
37
			$conf[$tmp[0]] = $tmp[1];
36
			$conf[$tmp[0]] = $tmp[1];
38
		}
37
		}
Line 42... Line 41...
42
}
41
}
43
fclose($ouvre);
42
fclose($ouvre);
44
$organisme = trim($conf["ORGANISM"]);
43
$organisme = trim($conf["ORGANISM"]);
45
$domainname = trim($conf["DOMAIN"]);
44
$domainname = trim($conf["DOMAIN"]);
46
$hostname = "alcasar.".$domainname;
45
$hostname = "alcasar.".$domainname;
47
$network_pb = False;
46
$network_pb = False; # "alcasar-watchdog.sh" changes this value if a network issue is detected
48
$cert_add = "http://$hostname/certs";
47
$cert_add = "http://$hostname/certs";
49
$direct_access = False;
48
$direct_access = False;
50
$display_menu=False;
49
$display_menu=False;
51
$diagnostic = "can't contact the default router";
50
$diagnostic = "can't contact the default router";
52
$remote_ip = preg_match('#^([0-9]{1,3}\.){3}[0-9]{1,3}$#', $_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : "";
51
$remote_ip = preg_match('#^([0-9]{1,3}\.){3}[0-9]{1,3}$#', $_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : "";
Line 54... Line 53...
54
$connection_history =  "";
53
$connection_history =  "";
55
$nb_connection_history = 3;
54
$nb_connection_history = 3;
56
$Language = 'en';
55
$Language = 'en';
57
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
56
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
58
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
57
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
59
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
58
	$Language = strtolower(substr(chop($Langue[0]),0,2));
-
 
59
}
60
$redirect_link = "www.euronews.com"; # Default redirection for HTTPS interception (beware, this website must run in HTTP)
60
$redirect_link = "www.euronews.com"; # Default redirection for HTTPS interception (beware, this website must run in HTTP)
61
 
61
 
62
# Retrieve the user info behind the remote ip
62
# Retrieve the user info behind the remote ip
63
exec ("sudo /usr/sbin/chilli_query list | grep -Ew $remote_ip" , $tab);
63
exec ("sudo /usr/sbin/chilli_query list | grep -Ew $remote_ip" , $tab);
64
$user = explode (" ", $tab[0]);
64
$user = explode (" ", $tab[0]);
65
 
65
 
66
 
-
 
67
# Test if it's a direct connexion to ALCASAR
66
# Test if it's a direct connexion to ALCASAR
68
if (isset($_SERVER['HTTP_HOST']))
67
if (isset($_SERVER['HTTP_HOST'])){
69
{
-
 
70
	if (($_SERVER['HTTP_HOST'] == $_SERVER['SERVER_ADDR']) || (preg_match ("/^alcasar$/", $_SERVER['HTTP_HOST'])) || (preg_match ("/^$hostname$/", $_SERVER['HTTP_HOST'])) || (preg_match ("/^$organisme$/", $_SERVER['HTTP_HOST'])))
68
	if (($_SERVER['HTTP_HOST'] == $_SERVER['SERVER_ADDR']) || (preg_match ("/^alcasar$/", $_SERVER['HTTP_HOST'])) || (preg_match ("/^$hostname$/", $_SERVER['HTTP_HOST'])) || (preg_match ("/^$organisme$/", $_SERVER['HTTP_HOST']))){
71
	{	
-
 
72
	$direct_access=True;
69
		$direct_access=True;
73
	exec("sudo /usr/sbin/ipset del not_auth_yet $remote_ip"); # del user of the ipset "not_auth_yet" to not loop
70
		exec("sudo /usr/sbin/ipset del not_auth_yet $remote_ip"); # del user of the ipset "not_auth_yet" to not loop
74
	}
71
	}
75
}
72
}
76
# Function to adapt time connexion in seconds to H,M,S
73
# Function to adapt time connexion in seconds to H,M,S
Line 81... Line 78...
81
	$time[2] = $temp % 60 ;				// seconds
78
	$time[2] = $temp % 60 ;				// seconds
82
	$time[1] = ( $temp - $time[2] ) / 60;		// minutes
79
	$time[1] = ( $temp - $time[2] ) / 60;		// minutes
83
	return $time[0]." h ".$time[1]." m ".$time[2]." s";
80
	return $time[0]." h ".$time[1]." m ".$time[2]." s";
84
}
81
}
85
 
82
 
86
//if user need to be warn
83
# if user need to be warned
87
if(isset($_GET['warn']) && isset($_GET['url']))
84
if(isset($_GET['warn']) && isset($_GET['url']))
88
{
85
{
89
	$direct_access = False;
86
	$direct_access = False;
90
}
87
}
91
 
88
 
Line 94... Line 91...
94
	{
91
	{
95
		$redir = "http://".$_GET['url'];  
92
		$redir = "http://".$_GET['url'];  
96
		header("Location: $_GET[url]",TRUE,307);
93
		header("Location: $_GET[url]",TRUE,307);
97
		exit; 
94
		exit; 
98
	}
95
	}
99
	// we retrieve his three last connections
96
	# we retrieve his three last connections
100
	if ((is_file("./acc/manager/lib/sql/drivers/mysql/functions.php"))&&(is_file("/etc/freeradius-web/config.php"))){
97
	if ((is_file("./acc/manager/lib/sql/drivers/mysql/functions.php"))&&(is_file("/etc/freeradius-web/config.php"))){
101
		include_once("/etc/freeradius-web/config.php");
98
		include_once("/etc/freeradius-web/config.php");
102
		include_once("./acc/manager/lib/sql/drivers/mysql/functions.php");
99
		include_once("./acc/manager/lib/sql/drivers/mysql/functions.php");
103
		
-
 
104
		$sql = "SELECT UserName, AcctStartTime, AcctStopTime, acctsessiontime FROM radacct WHERE UserName='$user[5]' ORDER BY AcctStartTime DESC LIMIT 0 , $nb_connection_history";
100
		$sql = "SELECT UserName, AcctStartTime, AcctStopTime, acctsessiontime FROM radacct WHERE UserName='$user[5]' ORDER BY AcctStartTime DESC LIMIT 0 , $nb_connection_history";
105
		$link = @da_sql_pconnect($config);
101
		$link = @da_sql_pconnect($config);
106
		if ($link){
102
		if ($link){
107
			$res = @da_sql_query($link,$config,$sql);
103
			$res = @da_sql_query($link,$config,$sql);
108
			if ($res){
104
			if ($res){
Line 118... Line 114...
118
	}
114
	}
119
}
115
}
120
else # the user isn't authenticated
116
else # the user isn't authenticated
121
{
117
{
122
	exec("sudo /usr/sbin/ipset list not_auth_yet | grep $remote_ip | wc -l 2>&1", $ipset_not_auth_yet);
118
	exec("sudo /usr/sbin/ipset list not_auth_yet | grep $remote_ip | wc -l 2>&1", $ipset_not_auth_yet);
123
	if(!$direct_access && $ipset_not_auth_yet[0] == '0') # it's the first stage of the interception 
119
	if(!$direct_access && $ipset_not_auth_yet[0] == '0'){ # it's the first stage of the interception
124
	{
-
 
125
		$display_menu = True; # Display menu for user not_auth_yet
120
		$display_menu = True; # Display menu for user not_auth_yet
126
		if (!isset($_SERVER['HTTPS'])) # In HTTP, the user is redirected on it's home page. In HTTPS, it's on the default page
121
		if (!isset($_SERVER['HTTPS'])){ # In HTTP, the user is redirected on it's home page. In HTTPS, it's on the default page (see $redirect_link)
127
		{
-
 
128
			$redirect_link = $_SERVER['HTTP_HOST']; # to keep the user URL
122
			$redirect_link = $_SERVER['HTTP_HOST'];
129
		}
123
		}
130
 
-
 
131
	}
124
	}
132
	if(isset($_GET['url'])) # it's the second stage (when user has clicked to open a connection ...)
125
	if(isset($_GET['url'])){ # it's the second stage (when user has clicked on the button "open a connection")
133
	{
-
 
134
		exec("sudo /usr/sbin/ipset add not_auth_yet $remote_ip"); # Add user in the ipset "not_auth_yet" (DNS requests not intercepted)
126
		exec("sudo /usr/sbin/ipset add not_auth_yet $remote_ip"); # Add user in the ipset "not_auth_yet" (DNS requests not intercepted)
135
		$redir = "http://".$_GET['url'];  
127
		$redir = "http://".$_GET['url'];
136
		header("Location: $redir",TRUE,307);
128
		header("Location: $redir",TRUE,307);
137
		exit; 
129
		exit; 
138
	}
130
	}
139
	if ($ipset_not_auth_yet[0] == '1'){ #if user not_auth_yet still here (index.php), we force DNS resquest.
131
	if ($ipset_not_auth_yet[0] == '1'){ # if user not_auth_yet still here (index.php), we force DNS resquest.
140
		 echo "<script>window.location.reload(true)</script>"; # force DNS request
132
		 echo "<script>window.location.reload(true)</script>"; # force DNS request
141
	}	
133
	}
142
	
-
 
143
	
-
 
144
}
134
}
145
# Choice of language
135
# Choice of language
146
if($Language == 'fr'){
136
if($Language == 'fr'){
147
	$l_access_denied = "Contrôle d'accès";
137
	$l_access_denied = "Contrôle d'accès";
148
	$l_access_welcome = "Bienvenue sur ALCASAR";
138
	$l_access_welcome = "Bienvenue sur ALCASAR";
Line 163... Line 153...
163
	if ((isset ($user[4])) && ($user[4] == "0")) {
153
	if ((isset ($user[4])) && ($user[4] == "0")){
164
		$l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre système.";
154
		$l_logout_explain = "Aucune session de consultation Internet n'est actuellement ouverte sur votre système.";
165
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Ouvrir une session Internet</a>";
155
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Ouvrir une session Internet</a>";
166
	}
156
	}
167
	else {
157
	else{
168
		if ($user[5] != $user[0]) // authentication exception or not
158
		if ($user[5] != $user[0]){ # authentication exception or not
169
		{
-
 
170
			$l_logout_explain = "Ferme la session de l'usager actuellement connecté. <br><br>Utilisateur connecté : <a href=\"http://$hostname:3990/logoff\" title=\"Deconnecter l'utilisateur $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history dernières connexions :$connection_history";
159
			$l_logout_explain = "Ferme la session de l'usager actuellement connecté. <br><br>Utilisateur connecté : <a href=\"http://$hostname:3990/logoff\" title=\"Deconnecter l'utilisateur $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history dernières connexions :$connection_history";
171
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">Se déconnecter d'internet</a>";
160
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">Se déconnecter d'internet</a>";
172
		}
161
		}
173
		else
162
		else{
174
		{
-
 
175
			$l_logout_explain = "Votre système ($user[5]) est en exception d'authentication.<br><br>$nb_connection_history last connections :$connection_history";
163
			$l_logout_explain = "Votre système ($user[5]) est en exception d'authentication.<br><br>$nb_connection_history last connections :$connection_history";
176
			$l_logout = "Information des connexions";
164
			$l_logout = "Information des connexions";
177
		}
165
		}
178
	}
166
	}
179
	$l_password_change = "<a href=\"https://$hostname/pass\">Changer votre mot de passe</a>";
167
	$l_password_change = "<a href=\"https://$hostname/pass\">Changer votre mot de passe</a>";
Line 182... Line 170...
182
	$l_back_page = "<a href=\"javascript:history.back()\">Page précédente</a>";
170
	$l_back_page = "<a href=\"javascript:history.back()\">Page précédente</a>";
183
	$l_service_sms = "Service SMS actif";
171
	$l_service_sms = "Service SMS actif";
184
	$l_service_sms_n = "Service SMS non actif";
172
	$l_service_sms_n = "Service SMS non actif";
185
	$l_acc_sms = "Auto enregistrement par SMS";
173
	$l_acc_sms = "Auto enregistrement par SMS";
186
	$l_explain_warn = "L'administrateur a créé une archive contenant vos journaux de connexion dans le cadre d'une affaire judiciaire.";
174
	$l_explain_warn = "L'administrateur a créé une archive contenant vos journaux de connexion dans le cadre d'une affaire judiciaire.";
187
	if(isset($_GET['url']))
175
	if(isset($_GET['url'])){
188
		$l_continue_link = "<a href='index.php?redirect=1&url=$_GET[url]' class='button'>Je comprends et je souhaite continuer ma navigation.</a>";
176
		$l_continue_link = "<a href='index.php?redirect=1&url=$_GET[url]' class='button'>Je comprends et je souhaite continuer ma navigation.</a>";
-
 
177
	}
189
	else
178
	else{
190
		$l_continue_link = "<a href='index.php' class='button'>Je comprends et je souhaite continuer ma navigation.</a>";
179
		$l_continue_link = "<a href='index.php' class='button'>Je comprends et je souhaite continuer ma navigation.</a>";
-
 
180
	}
191
	$l_title_warn="Cher utilisateur, ";
181
	$l_title_warn="Cher utilisateur, ";
192
	$l_explain_warn_name="Une personne sous le nom de ";
182
	$l_explain_warn_name="Une personne sous le nom de ";
193
	$l_explain_warn_ip="sous cette IP : ";
183
	$l_explain_warn_ip="sous cette IP : ";
194
	$l_explain_warn_date="a consulté vos journaux de connexion le ";
184
	$l_explain_warn_date="a consulté vos journaux de connexion le ";
195
	$l_explain_warn_reason="Raison invoquée : ";
185
	$l_explain_warn_reason="Raison invoquée : ";
Line 214... Line 204...
214
	if ((isset ($user[4])) && ($user[4] == "0")) {
204
	if ((isset ($user[4])) && ($user[4] == "0")){
215
		$l_logout_explain = "Não há conexão de Internet aberta em seu computador, deseja conectar?";
205
		$l_logout_explain = "Não há conexão de Internet aberta em seu computador, deseja conectar?";
216
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Abrir uma conexão de Internet</a>";
206
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Abrir uma conexão de Internet</a>";
217
	}
207
	}
218
      else {
208
	else{
219
		if ($user[5] != $user[0]) // authentication exception or not
209
		if ($user[5] != $user[0]){ # authentication exception or not
220
		{
-
 
221
			$l_logout_explain = "Se desejar, feche a conexão do usuário atual conectado.<br> Usuário conectado : <a href=\"http://$hostname:3990/logoff\" title=\"Disconnect user $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history last connections :$connection_history";
210
			$l_logout_explain = "Se desejar, feche a conexão do usuário atual conectado.<br> Usuário conectado : <a href=\"http://$hostname:3990/logoff\" title=\"Disconnect user $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history last connections :$connection_history";
222
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">Sair da Internet</a>";
211
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">Sair da Internet</a>";
223
		}
212
		}
224
		else
213
		else{
225
		{
-
 
226
			$l_logout_explain = "O sistema ($user[5]) detctou exesso de autenticação.<br><br>$nb_connection_history logins últimos :$connection_history";
214
			$l_logout_explain = "O sistema ($user[5]) detctou exesso de autenticação.<br><br>$nb_connection_history logins últimos :$connection_history";
227
			$l_logout = "Informações de conexões";
215
			$l_logout = "Informações de conexões";
228
		}
216
		}
229
	}
217
	}
230
	$l_password_change = "<a href=\"https://$hostname/pass\">Mudar sua senha</a>";
218
	$l_password_change = "<a href=\"https://$hostname/pass\">Mudar sua senha</a>";
Line 233... Line 221...
233
	$l_back_page = "<a href=\"javascript:history.back()\">Página anterior</a>";
221
	$l_back_page = "<a href=\"javascript:history.back()\">Página anterior</a>";
234
	$l_service_sms = "SMS service enable";
222
	$l_service_sms = "SMS service enable";
235
	$l_service_sms_n = "SMS service disable";
223
	$l_service_sms_n = "SMS service disable";
236
	$l_acc_sms = "Auto registration by SMS";
224
	$l_acc_sms = "Auto registration by SMS";
237
	$l_explain_warn = "El administrador ha creado un archivo que contiene los periódicos de inicio de sesión como parte de un proceso judicial."; 
225
	$l_explain_warn = "El administrador ha creado un archivo que contiene los periódicos de inicio de sesión como parte de un proceso judicial."; 
238
	if(isset($_GET['url']))
226
	if(isset($_GET['url'])){
239
		$l_continue_link = "<a href='index.php?redirect=1&url=$_GET[url]' class='button'>Lo comprendo y deseo continuar mi navegación.</a>";
227
		$l_continue_link = "<a href='index.php?redirect=1&url=$_GET[url]' class='button'>Lo comprendo y deseo continuar mi navegación.</a>";
-
 
228
	}
240
	else
229
	else{
241
		$l_continue_link = "<a href='index.php' class='button'>Lo comprendo y deseo continuar mi navegación.</a>";
230
		$l_continue_link = "<a href='index.php' class='button'>Lo comprendo y deseo continuar mi navegación.</a>";
-
 
231
	}
242
	$l_title_warn="Estimado usuario,";
232
	$l_title_warn="Estimado usuario,";
243
	$l_explain_warn_name="El usario ";
233
	$l_explain_warn_name="El usario ";
244
	$l_explain_warn_ip="con este IP : ";
234
	$l_explain_warn_ip="con este IP : ";
245
	$l_explain_warn_date="consultó a sus registros de conexión el ";
235
	$l_explain_warn_date="consultó a sus registros de conexión el ";
246
	$l_explain_warn_reason="con la siguiente razón : ";
236
	$l_explain_warn_reason="con la siguiente razón : ";
Line 265... Line 255...
265
	if ((isset ($user[4])) && ($user[4] == "0")) {
255
	if ((isset ($user[4])) && ($user[4] == "0")){
266
		$l_logout_explain = "您的系统目前没有打开任何网络咨询进程。";
256
		$l_logout_explain = "您的系统目前没有打开任何网络咨询进程。";
267
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">打开一个网络进程</a>";
257
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">打开一个网络进程</a>";
268
	}
258
	}
269
	else {
259
	else{
270
		if ($user[5] != $user[0]) // authentication exception or not
260
		if ($user[5] != $user[0]){ # authentication exception or not
271
		{
-
 
272
			$l_logout_explain = "关闭当前连接进程。<br> 已连接用户:<a href=\"http://$hostname:3990/logoff\" title=\" $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history 最后连接 :$connection_history";
261
			$l_logout_explain = "关闭当前连接进程。<br> 已连接用户:<a href=\"http://$hostname:3990/logoff\" title=\" $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history 最后连接 :$connection_history";
273
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">断开网络</a>";
262
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">断开网络</a>";
274
		}
263
		}
275
		else
264
		else{
276
		{
-
 
277
			$l_logout_explain = "您的系统($user[5])验证例外<br><br>$nb_connection_history 最后连接: $connection_history";
265
			$l_logout_explain = "您的系统($user[5])验证例外<br><br>$nb_connection_history 最后连接: $connection_history";
278
			$l_logout = "连接信息";
266
			$l_logout = "连接信息";
279
		}
267
		}
280
	}
268
	}
281
	$l_password_change = "<a href=\"https://$hostname/pass\">更改您的密码</a>";
269
	$l_password_change = "<a href=\"https://$hostname/pass\">更改您的密码</a>";
Line 284... Line 272...
284
	$l_back_page = "<a href=\"javascript:history.back()\">上一页</a>";
272
	$l_back_page = "<a href=\"javascript:history.back()\">上一页</a>";
285
	$l_service_sms = "短信服务可用";
273
	$l_service_sms = "短信服务可用";
286
	$l_service_sms_n = "短信服务禁用";
274
	$l_service_sms_n = "短信服务禁用";
287
	$l_acc_sms = "短信自动注册";
275
	$l_acc_sms = "短信自动注册";
288
	$l_explain_warn = "管理员创建了一份可用于司法调查的连接日志文档。";
276
	$l_explain_warn = "管理员创建了一份可用于司法调查的连接日志文档。";
289
	if(isset($_GET['url']))
277
	if(isset($_GET['url'])){
290
		$l_continue_link = "<a href='index.php?redirect=1&url=$_GET[url]' class='button'>我明白并希望继续浏览。</a>";
278
		$l_continue_link = "<a href='index.php?redirect=1&url=$_GET[url]' class='button'>我明白并希望继续浏览。</a>";
-
 
279
	}
291
	else
280
	else{
292
		$l_continue_link = "<a href='index.php' class='button'>我明白并希望继续浏览。</a>";
281
		$l_continue_link = "<a href='index.php' class='button'>我明白并希望继续浏览。</a>";
-
 
282
	}
293
	$l_title_warn="亲爱的用户,";
283
	$l_title_warn="亲爱的用户,";
294
	$l_explain_warn_name="一人名为";
284
	$l_explain_warn_name="一人名为";
295
	$l_explain_warn_ip="在此IP:";
285
	$l_explain_warn_ip="在此IP:";
296
	$l_explain_warn_date="查看您的连接日志于";
286
	$l_explain_warn_date="查看您的连接日志于";
297
	$l_explain_warn_reason=" 如下原因:";
287
	$l_explain_warn_reason=" 如下原因:";
Line 319... Line 309...
319
	$l_category = "فئة :";
309
	$l_category = "فئة :";
320
	if ((isset ($user[4])) && ($user[4] == "0")) {
310
	if ((isset ($user[4])) && ($user[4] == "0")){
321
		$l_logout_explain = "و لا جلسة استفسار للإنترنت مفتوحة حاليا على نظامك";
311
		$l_logout_explain = "و لا جلسة استفسار للإنترنت مفتوحة حاليا على نظامك";
322
		$close_session_text = "فتح جلسة الإنترنت";
312
		$close_session_text = "فتح جلسة الإنترنت";
323
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">$close_session_text</a>";
313
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">$close_session_text</a>";
-
 
314
	}
324
	} else {
315
	else{
325
		if ($user[5] != $user[0]) { // authentication exception or not
316
		if ($user[5] != $user[0]){ # authentication exception or not
326
			$close_session_text = "إقفال جلسة المستخدم المتصل حاليا";
317
			$close_session_text = "إقفال جلسة المستخدم المتصل حاليا";
327
			$user_logged_text = "المستخدم متصل";
318
			$user_logged_text = "المستخدم متصل";
328
			$disconnect_user_text = "قطع الاتصال على المستخدم";
319
			$disconnect_user_text = "قطع الاتصال على المستخدم";
329
			$l_logout_explain = "Ferme la session de l'usager actuellement connecté. <br><br>Utilisateur connecté : <a href=\"http://$hostname:3990/logoff\" title=\"Deconnecter l'utilisateur $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history dernières connexions :$connection_history";
320
			$l_logout_explain = "Ferme la session de l'usager actuellement connecté. <br><br>Utilisateur connecté : <a href=\"http://$hostname:3990/logoff\" title=\"Deconnecter l'utilisateur $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history dernières connexions :$connection_history";
330
			$logout_internet_text = "قطع الاتصال على الإنترنت";
321
			$logout_internet_text = "قطع الاتصال على الإنترنت";
Line 388... Line 379...
388
	if ((isset ($user[4])) && ($user[4] == "0")) {
379
	if ((isset ($user[4])) && ($user[4] == "0")){
389
		$l_logout_explain = "No Internet consultation session is actualy open on your system";
380
		$l_logout_explain = "No Internet consultation session is actualy open on your system";
390
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Open an Internet session</a>";
381
		$l_logout = "<a href=\"http://$hostname/index.php?url=$redirect_link\">Open an Internet session</a>";
391
	}
382
	}
392
	else {
383
	else{
393
		if ($user[5] != $user[0]) // authentication exception or not
384
		if ($user[5] != $user[0]){ # authentication exception or not
394
		{
-
 
395
			$l_logout_explain = "Close the session of the user currently connected.<br> User logged-on : <a href=\"http://$hostname:3990/logoff\" title=\"Disconnect user $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history last connections :$connection_history";
385
			$l_logout_explain = "Close the session of the user currently connected.<br> User logged-on : <a href=\"http://$hostname:3990/logoff\" title=\"Disconnect user $user[5]\"><b>$user[5]</b></a><br><br>$nb_connection_history last connections :$connection_history";
396
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">Logoff from internet</a>";
386
			$l_logout = "<a href=\"http://$hostname:3990/logoff\">Logoff from internet</a>";
397
		}
387
		}
398
		else
388
		else{
399
		{
-
 
400
			$l_logout_explain = "Your system ($user[5]) is in exception of authentication.<br><br>$nb_connection_history Last logins :$connection_history";
389
			$l_logout_explain = "Your system ($user[5]) is in exception of authentication.<br><br>$nb_connection_history Last logins :$connection_history";
401
			$l_logout = "Connections information";
390
			$l_logout = "Connections information";
402
		}
391
		}
403
	}
392
	}
404
	$l_password_change = "<a href=\"https://$hostname/pass\">Change your password</a>";
393
	$l_password_change = "<a href=\"https://$hostname/pass\">Change your password</a>";
Line 407... Line 396...
407
	$l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
396
	$l_back_page = "<a href=\"javascript:history.back()\">Previous page</a>";
408
	$l_service_sms = "SMS service enable";
397
	$l_service_sms = "SMS service enable";
409
	$l_service_sms_n = "SMS service disable";
398
	$l_service_sms_n = "SMS service disable";
410
	$l_acc_sms = "Auto registration by SMS";
399
	$l_acc_sms = "Auto registration by SMS";
411
	$l_explain_warn = "The administrator created an archive which contains your imputabilities logs for a judicial investigation.";
400
	$l_explain_warn = "The administrator created an archive which contains your imputabilities logs for a judicial investigation.";
412
	if(isset($_GET['url']))
401
	if(isset($_GET['url'])){
413
		$l_continue_link = "<a href='index.php?redirect=1&url=$_GET[url]' class='button'>I understand and I wish to continue.</a>";
402
		$l_continue_link = "<a href='index.php?redirect=1&url=$_GET[url]' class='button'>I understand and I wish to continue.</a>";
-
 
403
	}
414
	else
404
	else{
415
		$l_continue_link = "<a href='index.php' class='button'>I understand and I wish to continue.</a>";
405
		$l_continue_link = "<a href='index.php' class='button'>I understand and I wish to continue.</a>";
-
 
406
	}
416
	$l_title_warn="Dear user,";
407
	$l_title_warn="Dear user,";
417
	$l_explain_warn_name="Someone called ";
408
	$l_explain_warn_name="Someone called ";
418
	$l_explain_warn_ip="with this IP : ";
409
	$l_explain_warn_ip="with this IP : ";
419
	$l_explain_warn_date="has read your connexion logs at ";
410
	$l_explain_warn_date="has read your connexion logs at ";
420
	$l_explain_warn_reason="For this reason : ";
411
	$l_explain_warn_reason="For this reason : ";
Line 466... Line 457...
466
<?php
457
<?php
467
	echo "<style>";
458
	echo "<style>";
468
	include("css/style_intercept.css");
459
	include("css/style_intercept.css");
469
	echo "</style>";
460
	echo "</style>";
470
?>
461
?>
-
 
462
 
471
<script type="text/javascript">
463
<script type="text/javascript">
472
	function valoriserDiv5(param){
464
	function valoriserDiv5(param){
473
		document.getElementById("box_info").innerHTML = param.innerHTML;
465
		document.getElementById("box_info").innerHTML = param.innerHTML;
474
	}
466
	}
475
</script>
467
</script>
Line 483... Line 475...
483
	if ($network_pb) {
475
	if ($network_pb) {
484
		echo "	<span>$l_explain_net_pb</span>";
476
		echo "	<span>$l_explain_net_pb</span>";
485
		}
477
	}
486
	}
478
}
487
	else {
479
else{
488
		#if user need to be warn about that someone who read his logs
480
	# if user need to be warned that someone reads his logs
489
		if(isset($_GET['warn']) && isset($_GET['url']) && $_GET['warn'] == '1')
481
	if(isset($_GET['warn']) && isset($_GET['url']) && $_GET['warn'] == '1'){
490
		{
-
 
491
		echo"
482
		echo "
492
			<div id=\"cadre_titre\" class=\"titre_refus\">
483
		<div id=\"cadre_titre\" class=\"titre_refus\">
493
			<p id=\"acces_controle\" class=\"titre_refus\">$l_title_warn</p>";
484
		<p id=\"acces_controle\" class=\"titre_refus\">$l_title_warn</p>";
494
		}
485
	}
495
		else
486
	else{
496
		{
-
 
497
		echo"
487
		echo "
498
			<div id=\"cadre_titre\" class=\"titre_refus\">
488
		<div id=\"cadre_titre\" class=\"titre_refus\">
499
			<p id=\"acces_controle\" class=\"titre_refus\">$l_title</p>";
489
		<p id=\"acces_controle\" class=\"titre_refus\">$l_title</p>";
500
		}
490
	}
501
	}
491
}
502
?>
492
?>
-
 
493
 
503
			<div id="boite_logo">
494
		<div id="boite_logo">
504
				<img src="<?php echo "$img_rep$img_organisme"; ?>">
495
			<img src="<?php echo "$img_rep$img_organisme"; ?>">
505
			</div>
496
		</div>
506
		</div>
497
	</div>
507
		<div id="contenu_acces">
498
		<div id="contenu_acces">
Line 533... Line 524...
533
else {
524
else {
534
$sms_div='';
525
	$sms_div='';
535
$sms_div_over='';
526
	$sms_div_over='';
536
}
527
}
537
if ($direct_access || $display_menu){
528
if ($direct_access || $display_menu){
-
 
529
	echo "
538
	echo "	<div id=\"box_bienvenue\">
530
		<div id=\"box_bienvenue\">
539
				$l_welcome
531
				$l_welcome
540
			</div>
532
		</div>
541
			<div class=\"box_menu\" id=\"box_conn\" onmouseover=\"valoriserDiv5(text_conn);\">
533
		<div class=\"box_menu\" id=\"box_conn\" onmouseover=\"valoriserDiv5(text_conn);\">
542
				<span>$l_logout</span>
534
			<span>$l_logout</span>
543
				<img src=\"$img_rep$img_internet\">
535
			<img src=\"$img_rep$img_internet\">
Line 569... Line 561...
569
			$sms_div_over
561
		$sms_div_over
570
			<div id=\"box_info\">
562
		<div id=\"box_info\">
571
			</div>";
563
		</div>";
572
	}
564
}
573
else {
565
else {
574
	#if user need to be warn about that someone who read his logs
566
	# user need to be warned that someone reads his logs
575
	if(isset($_GET['warn']) && isset($_GET['url']) && $_GET['warn'] == '1')
567
	if(isset($_GET['warn']) && isset($_GET['url']) && $_GET['warn'] == '1'){
576
	{
-
 
577
		
-
 
578
		
-
 
579
	$filename="/var/www/html/acc/backup/log_info.txt";
568
		$filename="/var/www/html/acc/backup/log_info.txt";
580
	$l_explain_warn="";
569
		$l_explain_warn="";
581
	if(file_exists($filename)){
570
		if(file_exists($filename)){
582
		$fichier = fopen($filename, "r");
571
			$fichier = fopen($filename, "r");
583
		$content = file($filename);
572
			$content = file($filename);
Line 586... Line 575...
586
			$log_date=$infos[0];	
575
				$log_date=$infos[0];	
587
			$log_user=$infos[1];	
576
				$log_user=$infos[1];	
588
			$log_reason=$infos[2];	
577
				$log_reason=$infos[2];	
589
			$log_ip=$infos[3];	
578
				$log_ip=$infos[3];	
590
		}
579
			}
591
 
-
 
592
		$l_explain_warn="$l_explain_warn_name$log_user ( $l_explain_warn_ip$log_ip ) $l_explain_warn_date$log_date $l_explain_warn_reason$log_reason";
580
			$l_explain_warn="$l_explain_warn_name$log_user ( $l_explain_warn_ip$log_ip ) $l_explain_warn_date$log_date $l_explain_warn_reason$log_reason";
593
	}
581
		}
594
	else
582
		else{
595
	{
-
 
596
		echo "Log error!";
583
			echo "Log error!";
597
	}
584
		}
598
	
-
 
599
	
-
 
600
	echo "
585
		echo "
601
		<div id=\"box_refuse\">
586
			<div id=\"box_refuse\">
602
			<img src=\"$img_rep$img_warning\">
587
				<img src=\"$img_rep$img_warning\">
603
			<p>$l_explain_warn</p>
588
				<p>$l_explain_warn</p>
604
 
-
 
605
		</div>
589
			</div>
606
		<div id=\"liens_redir\">
590
			<div id=\"liens_redir\">
607
			<p>$l_continue_link</p>
591
				<p>$l_continue_link</p>
608
		</div>";
592
			</div>";
609
 
-
 
610
	}
593
	}
611
	else
594
	else{
612
	{
-
 
613
		echo "
595
		echo "
614
			<div id=\"box_refuse\">
596
			<div id=\"box_refuse\">
615
				<img src=\"$img_rep$img_false\">
597
				<img src=\"$img_rep$img_false\">
616
				<p>$l_explain</p>
598
				<p>$l_explain</p>
617
			</div>
599
			</div>
Line 630... Line 612...
630
				<a href="https://<?php echo $hostname; ?>/acc/"><img src=<?php echo $img_rep.''.$img_adm; ?>></a>
612
				<a href="https://<?php echo $hostname; ?>/acc/"><img src=<?php echo $img_rep.''.$img_adm; ?>></a>
631
			</div>
613
			</div>
632
		</div>
614
		</div>
633
	</body>
615
	</body>
634
</html>
616
</html>
635
 
-
 
636
 
-