Subversion Repositories ALCASAR

Rev

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

Rev 2992 Rev 3002
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: index.php 2992 2022-02-24 23:23:41Z rexy $
2
# $Id: index.php 3002 2022-04-03 21:39:16Z rexy $
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 59... Line 59...
59
$redirect_link = 'www.euronews.com'; // Default redirection for HTTP interception (beware, this website must run in HTTP)
59
$redirect_link = 'www.euronews.com'; // Default redirection for HTTP interception (beware, this website must run in HTTP)
60
$service_wifi4eu_status = ($conf['WIFI4EU'] === 'on');
60
$service_wifi4eu_status = ($conf['WIFI4EU'] === 'on');
61
$service_wifi4eu_code = $conf['WIFI4EU_CODE'];
61
$service_wifi4eu_code = $conf['WIFI4EU_CODE'];
62
$service_wifi4eu_server = 'https://collection.wifi4eu.ec.europa.eu/wifi4eu.min.js';
62
$service_wifi4eu_server = 'https://collection.wifi4eu.ec.europa.eu/wifi4eu.min.js';
63
$service_SMS_status = ($conf['SMS'] === 'on');
63
$service_SMS_status = ($conf['SMS'] === 'on');
-
 
64
$service_Email_status = ($conf['MAIL'] === 'on');
64
 
65
 
65
// Retrieve the user info behind the remote ip
66
// Retrieve the user info behind the remote ip
66
$output = [];
67
$output = [];
67
exec('sudo /usr/sbin/chilli_query list ip '.escapeshellarg($remote_ip), $output);
68
exec('sudo /usr/sbin/chilli_query list ip '.escapeshellarg($remote_ip), $output);
68
if (!empty($output)) {
69
if (!empty($output)) {
Line 151... Line 152...
151
	$l_explain_acc_access = "Le centre de gestion permet d'administrer le portail. Vous devez posséder un compte d'administration ou de gestion pour y accéder.";
152
	$l_explain_acc_access = "Le centre de gestion permet d'administrer le portail. Vous devez posséder un compte d'administration ou de gestion pour y accéder.";
152
	$l_explain_access_deny = "Vous tentez d'accéder à une ressource dont le contenu est réputé contenir des informations inappropriées.";
153
	$l_explain_access_deny = "Vous tentez d'accéder à une ressource dont le contenu est réputé contenir des informations inappropriées.";
153
	$l_explain_net_pb = "Votre portail détecte que l'accès à Internet est indisponible.";
154
	$l_explain_net_pb = "Votre portail détecte que l'accès à Internet est indisponible.";
154
	$l_contact_access_deny = "Contactez le responsable de la séurité (OSSI/RSSI) si vous pensez que ce filtrage est abusif.";
155
	$l_contact_access_deny = "Contactez le responsable de la séurité (OSSI/RSSI) si vous pensez que ce filtrage est abusif.";
155
	$l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information.";
156
	$l_contact_net_pb = "Contactez votre responsable informatique ou votre prestataire Internet pour plus d'information.";
156
	$l_sms_access = "<a href=\"//$hostname/sms_registration.php\">Créer votre compte par SMS</a>";
157
	$l_sms_access = "<a href=\"//$hostname/sms_registration.php\">Inscrivez-vous par SMS</a>";
-
 
158
	$l_email_access = "<a href=\"//$hostname/email_registration_front.php\">Inscrivez-vous par Email</a>";
157
	$l_install_certif = "Installer le certificat racine";
159
	$l_install_certif = "Installer le certificat racine";
158
	$l_category = "catégorie :";
160
	$l_category = "catégorie :";
159
	if (!$user->connected) {
161
	if (!$user->connected) {
160
		$l_logout_explain = "Aucune session n'est actuellement ouverte";
162
		$l_logout_explain = "Aucune session n'est actuellement ouverte";
161
		$l_logout = "<a href=\"//$hostname/index.php?url=$redirect_link\">Ouvrir une session</a>";
163
		$l_logout = "<a href=\"//$hostname/index.php?url=$redirect_link\">Ouvrir une session</a>";
Line 190... Line 192...
190
	$l_explain_acc_access = "Este é o centro de controle do portal para acessar você deve ter uma conta administrativa valida.";
192
	$l_explain_acc_access = "Este é o centro de controle do portal para acessar você deve ter uma conta administrativa valida.";
191
	$l_explain_access_deny = "Você tenta se conectar a um recurso cujo conteúdo é considerado inadequado no conteúdo de informações.";
193
	$l_explain_access_deny = "Você tenta se conectar a um recurso cujo conteúdo é considerado inadequado no conteúdo de informações.";
192
	$l_explain_net_pb = "O sistema detectou que o acesso é de risco, não será permitido o acesso";
194
	$l_explain_net_pb = "O sistema detectou que o acesso é de risco, não será permitido o acesso";
193
	$l_contact_access_deny = "Entre em contato com o administrador do sistema de segurança se acha que essa filtragem é abusiva.";
195
	$l_contact_access_deny = "Entre em contato com o administrador do sistema de segurança se acha que essa filtragem é abusiva.";
194
	$l_contact_net_pb = "Entre em contato com a empresa fornecedora de Internet para mais informações";
196
	$l_contact_net_pb = "Entre em contato com a empresa fornecedora de Internet para mais informações";
195
	$l_sms_access = "<a href=\"//$hostname/sms_registration.php\">Crie a conta por SMS</a>";
197
	$l_sms_access = "<a href=\"//$hostname/sms_registration.php\">Registar por SMS</a>";
-
 
198
	$l_email_access = "<a href=\"//$hostname/email_registration_front.php\">Registar por Email</a>";
196
	$l_install_certif = "Instalar Certificado Alcasar AC";
199
	$l_install_certif = "Instalar Certificado Alcasar AC";
197
	$l_category = "categoria :";
200
	$l_category = "categoria :";
198
	if (!$user->connected) {
201
	if (!$user->connected) {
199
		$l_logout_explain = "Não há conexão de Internet aberta em seu computador, deseja conectar?";
202
		$l_logout_explain = "Não há conexão de Internet aberta em seu computador, deseja conectar?";
200
		$l_logout = "<a href=\"//$hostname/index.php?url=$redirect_link\">Abrir uma conexão de Internet</a>";
203
		$l_logout = "<a href=\"//$hostname/index.php?url=$redirect_link\">Abrir uma conexão de Internet</a>";
Line 229... Line 232...
229
	$l_explain_acc_access = "管理中心能管理门户,您必须通过超级用户或者管理用户来访问。";
232
	$l_explain_acc_access = "管理中心能管理门户,您必须通过超级用户或者管理用户来访问。";
230
	$l_explain_access_deny = "您试图访问一个含有不当信息的资源。";
233
	$l_explain_access_deny = "您试图访问一个含有不当信息的资源。";
231
	$l_explain_net_pb = "您的门户检测因特网不可用。";
234
	$l_explain_net_pb = "您的门户检测因特网不可用。";
232
	$l_contact_access_deny = "如果您认为该过滤不当,请联系安全负责人(OSSI/RSSI)。";
235
	$l_contact_access_deny = "如果您认为该过滤不当,请联系安全负责人(OSSI/RSSI)。";
233
	$l_contact_net_pb = "请联系IT负责人或网络服务商来了解更多信息。";
236
	$l_contact_net_pb = "请联系IT负责人或网络服务商来了解更多信息。";
234
	$l_sms_access = "<a href=\"//$hostname/sms_registration.php\">通過短信創建您的帳戶</a>";
237
	$l_sms_access = "<a href=\"//$hostname/sms_registration.php\">通过短信注册</a>";
-
 
238
	$l_email_access = "<a href=\"//$hostname/email_registration_front.php\">通过电子邮件注册</a>";
235
	$l_install_certif = "安装根证书";
239
	$l_install_certif = "安装根证书";
236
	$l_category = "类别 :";
240
	$l_category = "类别 :";
237
	if (!$user->connected) {
241
	if (!$user->connected) {
238
		$l_logout_explain = "您的系统目前没有打开任何网络咨询进程。";
242
		$l_logout_explain = "您的系统目前没有打开任何网络咨询进程。";
239
		$l_logout = "<a href=\"//$hostname/index.php?url=$redirect_link\">打开一个网络进程</a>";
243
		$l_logout = "<a href=\"//$hostname/index.php?url=$redirect_link\">打开一个网络进程</a>";
Line 269... Line 273...
269
	$l_explain_access_deny = "محاولة لدخول موارد تحتوي على معلومات غير ملائمة المحتوى";
273
	$l_explain_access_deny = "محاولة لدخول موارد تحتوي على معلومات غير ملائمة المحتوى";
270
	$l_explain_net_pb = "بوابتك تكتشف ان الدخول على الانترنت غير متوفر";
274
	$l_explain_net_pb = "بوابتك تكتشف ان الدخول على الانترنت غير متوفر";
271
	$l_contact_access_deny = "المرجو الاتصال بضابط أمن (OSS / RSS) إذا اعتقدت ان هذه التصفية غير قانونية";
275
	$l_contact_access_deny = "المرجو الاتصال بضابط أمن (OSS / RSS) إذا اعتقدت ان هذه التصفية غير قانونية";
272
	$l_contact_net_pb = "المرجو الاتصال بمدير المعلومات أو مورد الأنترنت للمزيد من المعلومات";
276
	$l_contact_net_pb = "المرجو الاتصال بمدير المعلومات أو مورد الأنترنت للمزيد من المعلومات";
273
	$auto_save_sms_text = "تسجيل ذاتي على";
277
	$auto_save_sms_text = "تسجيل ذاتي على";
274
	$l_sms_access = "<a href=\"//$hostname/sms_registration.php\">إنشاء حسابك لا SMS</a>";
278
	$l_sms_access = "<a href=\"//$hostname/sms_registration.php\">اشترك عن طريق الرسائل القصيرة</a>";
-
 
279
	$l_email_access = "<a href=\"//$hostname/email_registration_front.php\">通过电子邮件注册</a>";
275
	$l_install_certif = "ركب جذر الشهادة";
280
	$l_install_certif = "ركب جذر الشهادة";
276
	$l_category = "فئة :";
281
	$l_category = "فئة :";
277
	if (!$user->connected) {
282
	if (!$user->connected) {
278
		$l_logout_explain = "و لا جلسة استفسار للإنترنت مفتوحة حاليا على نظامك";
283
		$l_logout_explain = "و لا جلسة استفسار للإنترنت مفتوحة حاليا على نظامك";
279
		$close_session_text = "فتح جلسة الإنترنت";
284
		$close_session_text = "فتح جلسة الإنترنت";
Line 324... Line 329...
324
	$l_explain_acc_access = "Hier ist das Kontrollcenter. Sie benötigen einen Account mit Administratorrechten.";
329
	$l_explain_acc_access = "Hier ist das Kontrollcenter. Sie benötigen einen Account mit Administratorrechten.";
325
	$l_explain_access_deny = "Sie haben versucht sich mit einer Seite zu verbinden, die möglicherweise unangemessene Inhalte beinhaltet.";
330
	$l_explain_access_deny = "Sie haben versucht sich mit einer Seite zu verbinden, die möglicherweise unangemessene Inhalte beinhaltet.";
326
	$l_explain_net_pb = "Offenbar funktioniert ihr Internetzugriff nicht.";
331
	$l_explain_net_pb = "Offenbar funktioniert ihr Internetzugriff nicht.";
327
	$l_contact_access_deny = "Kontaktieren Sie ihren Sicherheitsbeauftragten wenn Sie denken dass diese Filterung unangemessen ist.";
332
	$l_contact_access_deny = "Kontaktieren Sie ihren Sicherheitsbeauftragten wenn Sie denken dass diese Filterung unangemessen ist.";
328
	$l_contact_net_pb = "Kontaktieren Sie Ihren Netzwerkbeauftragten oder Ihren Internetanbieter für weitere Informationen.";
333
	$l_contact_net_pb = "Kontaktieren Sie Ihren Netzwerkbeauftragten oder Ihren Internetanbieter für weitere Informationen.";
329
	$l_sms_access = "<a href=\"//$hostname/sms_registration.php\">Einen Account per SMS erstellen</a>";
334
	$l_sms_access = "<a href=\"//$hostname/sms_registration.php\">Melden Sie sich per SMS an</a>";
-
 
335
	$l_email_access = "<a href=\"//$hostname/email_registration_front.php\">Melden Sie sich per E-Mail an</a>";
330
	$l_install_certif = "Das ALCASAR AC Zertifikat installieren";
336
	$l_install_certif = "Das ALCASAR AC Zertifikat installieren";
331
	$l_category = "Kategorie:";
337
	$l_category = "Kategorie:";
332
	if (!$user->connected) {
338
	if (!$user->connected) {
333
		$l_logout_explain = "Zurzeit ist keine Internetsitzung auf Ihrem System aktiv";
339
		$l_logout_explain = "Zurzeit ist keine Internetsitzung auf Ihrem System aktiv";
334
		$l_logout = "<a href=\"//$hostname/index.php?url=$redirect_link\">Eine neue Internetzsitzung eröffnen</a>";
340
		$l_logout = "<a href=\"//$hostname/index.php?url=$redirect_link\">Eine neue Internetzsitzung eröffnen</a>";
Line 363... Line 369...
363
	$l_explain_acc_access = "Este acceso gestiona el portal. Tiene que tener una cuenta administrativa.";
369
	$l_explain_acc_access = "Este acceso gestiona el portal. Tiene que tener una cuenta administrativa.";
364
	$l_explain_access_deny = "Intenta conectarse a un recurso cuyo contenido se considera que contiene información inapropiada.";
370
	$l_explain_access_deny = "Intenta conectarse a un recurso cuyo contenido se considera que contiene información inapropiada.";
365
	$l_explain_net_pb = "El sistema informa que el acceso a Internet no esta disponible.";
371
	$l_explain_net_pb = "El sistema informa que el acceso a Internet no esta disponible.";
366
	$l_contact_access_deny = "Por favor póngase en contacto con el administrador de la red si cree que este filtrado es abusivo";
372
	$l_contact_access_deny = "Por favor póngase en contacto con el administrador de la red si cree que este filtrado es abusivo";
367
	$l_contact_net_pb = "Póngase en contacto con el responsable de la red o con su proveedor de Internet para obtener más información.";
373
	$l_contact_net_pb = "Póngase en contacto con el responsable de la red o con su proveedor de Internet para obtener más información.";
368
	$l_sms_access = "<a href=\"//$hostname/sms_registration.php\">Alta de cuenta por SMS</a>";
374
	$l_sms_access = "<a href=\"//$hostname/sms_registration.php\">Registro por SMS</a>";
-
 
375
	$l_email_access = "<a href=\"//$hostname/email_registration_front.php\">Registro por Email</a>";
369
	$l_install_certif = "Instalar certificado ALCASAR AC";
376
	$l_install_certif = "Instalar certificado ALCASAR AC";
370
	$l_category = "categoría:";
377
	$l_category = "categoría:";
371
	if (!$user->connected) {
378
	if (!$user->connected) {
372
		$l_logout_explain = "Actualmente no hay una sesión de acceso a Internet abierta por su sistema";
379
		$l_logout_explain = "Actualmente no hay una sesión de acceso a Internet abierta por su sistema";
373
		$l_logout = "<a href=\"//$hostname/index.php?url=$redirect_link\">Abra una sesión de Internet</a>";
380
		$l_logout = "<a href=\"//$hostname/index.php?url=$redirect_link\">Abra una sesión de Internet</a>";
Line 402... Line 409...
402
	$l_explain_acc_access = "This center control the portal. You must have an administrative account.";
409
	$l_explain_acc_access = "This center control the portal. You must have an administrative account.";
403
	$l_explain_access_deny = "You try to connect to a resource whose content is deemed to contain inappropriate information.";
410
	$l_explain_access_deny = "You try to connect to a resource whose content is deemed to contain inappropriate information.";
404
	$l_explain_net_pb = "Your portal has just detected that the Internet access is down";
411
	$l_explain_net_pb = "Your portal has just detected that the Internet access is down";
405
	$l_contact_access_deny = "Contact your security system manager if you think this filtering is abusive.";
412
	$l_contact_access_deny = "Contact your security system manager if you think this filtering is abusive.";
406
	$l_contact_net_pb = "Contact your network responsive or your Internet provider for further information.";
413
	$l_contact_net_pb = "Contact your network responsive or your Internet provider for further information.";
407
	$l_sms_access = "<a href=\"//$hostname/sms_registration.php\">Create your account by SMS</a>";
414
	$l_sms_access = "<a href=\"//$hostname/sms_registration.php\">Register by SMS</a>";
-
 
415
	$l_email_access = "<a href=\"//$hostname/email_registration_front.php\">Register by Email</a>";
408
	$l_install_certif = "Install ALCASAR AC Certificate";
416
	$l_install_certif = "Install ALCASAR AC Certificate";
409
	$l_category = "category:";
417
	$l_category = "category:";
410
	if (!$user->connected) {
418
	if (!$user->connected) {
411
		$l_logout_explain = "No session is currently open";
419
		$l_logout_explain = "No session is currently open";
412
		$l_logout = "<a href=\"//$hostname/index.php?url=$redirect_link\">Open an Internet session</a>";
420
		$l_logout = "<a href=\"//$hostname/index.php?url=$redirect_link\">Open an Internet session</a>";
Line 437... Line 445...
437
 
445
 
438
$l_title   = ($direct_access ? $l_access_welcome     : ($network_pb ? $l_access_unavailable : $l_access_denied));
446
$l_title   = ($direct_access ? $l_access_welcome     : ($network_pb ? $l_access_unavailable : $l_access_denied));
439
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb     : $l_explain_access_deny));
447
$l_explain = ($direct_access ? $l_explain_acc_access : ($network_pb ? $l_explain_net_pb     : $l_explain_access_deny));
440
 
448
 
441
// Set the icons
449
// Set the icons
442
$img_rep         = '/images/';
450
$img_rep			= '/images/';
443
$img_organisme   = 'organisme.png';
451
$img_organisme		= 'organisme.png';
444
$img_access      = 'globe_acces_70.png';
452
$img_access			= 'globe_acces_70.png';
445
$img_connect     = 'globe_70.png';
453
$img_connect		= 'globe_70.png';
446
$img_warning     = 'globe_warning_70.png';
454
$img_warning		= 'globe_warning_70.png';
447
$img_pwd         = 'cle_ombre.png';
455
$img_pwd			= 'cle_ombre.png';
448
$img_certificate = 'certificat.png';
456
$img_certificate	= 'certificat.png';
449
$img_acc         = 'logo-alcasar_70.png';
457
$img_acc			= 'logo-alcasar_70.png';
450
$img_sms         = 'sms.png';
458
$img_sms			= 'sms.png';
-
 
459
$img_email			= 'email.png';
451
$img_false       = 'interdit.png';
460
$img_false			= 'interdit.png';
452
$img_adm         = 'adm.png';
461
$img_adm			= 'adm.png';
453
 
-
 
454
$img_internet    = (($user->connected) ? $img_connect : ($network_pb ? $img_warning : $img_access));
462
$img_internet		= (($user->connected) ? $img_connect : ($network_pb ? $img_warning : $img_access));
455
 
463
 
456
if ($direct_access) {
464
if ($direct_access) {
457
	// Read the "Domain allowed" file
465
	// Read the "Domain allowed" file
458
	$domainsAllowed = [];
466
	$domainsAllowed = [];
459
	$fileContent = file(DOMAIN_ALLOWED_LIST); if ($fileContent) { // the file isn't empty
467
	$fileContent = file(DOMAIN_ALLOWED_LIST); if ($fileContent) { // the file isn't empty
Line 598... Line 606...
598
				<!-- Menu -->
606
				<!-- Menu -->
599
				<div class="menu-container container col_xs_12 col-sm-7">
607
				<div class="menu-container container col_xs_12 col-sm-7">
600
					<?php if ($direct_access): ?>
608
					<?php if ($direct_access): ?>
601
						<div class="box_menu<?= (!$network_pb) ? '' : ' box-menu-disabled' ?>" id="box_conn" <?= (!$network_pb) ? '' : 'title=\'Not available\'' ?>>
609
						<div class="box_menu<?= (!$network_pb) ? '' : ' box-menu-disabled' ?>" id="box_conn" <?= (!$network_pb) ? '' : 'title=\'Not available\'' ?>>
602
							<span><?= $l_logout ?></span>
610
							<span><?= $l_logout ?></span>
603
							<div class="menu-image">						
611
							<div class="menu-image">
604
								<img class="img-responsive" src="<?= $img_rep.$img_internet ?>">
612
								<img class="img-responsive" src="<?= $img_rep.$img_internet ?>">
605
							</div>
613
							</div>
606
						</div>
614
						</div>
607
					
615
 
608
						<div class="box_menu_right box_menu" id="box_certif">
616
						<div class="box_menu_right box_menu" id="box_certif">
609
							<span><a href="<?= $certCa_link ?>"><?= $l_install_certif ?></a></span>
617
							<span><a href="<?= $certCa_link ?>"><?= $l_install_certif ?></a></span>
610
							<div class="menu-image">
618
							<div class="menu-image">
611
								<img class="img-responsive" src="<?= $img_rep.$img_certificate ?>">
619
								<img class="img-responsive" src="<?= $img_rep.$img_certificate ?>">
612
							</div>
620
							</div>
Line 618... Line 626...
618
							</div>
626
							</div>
619
							<span><?= $l_password_change ?></span>
627
							<span><?= $l_password_change ?></span>
620
						</div>
628
						</div>
621
 
629
 
622
					<?php if ($service_SMS_status === true): ?>
630
					<?php if ($service_SMS_status === true): ?>
623
						<div class="box_menu_right box_menu" id="box_acc">
631
						<div class="box_menu_right box_menu" id="box_sms">
624
							<span><?= $l_sms_access ?></span>
632
							<span><?= $l_sms_access ?></span>
625
							<div class="menu-image">
633
							<div class="menu-image">
626
								<img class="img-responsive menu-image" src="<?= $img_rep.$img_sms ?>">
634
								<img class="img-responsive menu-image" src="<?= $img_rep.$img_sms ?>">
627
							</div>
635
							</div>
628
						</div>
636
						</div>
629
					<?php endif; ?>
637
					<?php endif; ?>
-
 
638
 
-
 
639
					<?php if ($service_Email_status === true): ?>
-
 
640
						<div class="box_menu_right box_menu" id="box_email">
-
 
641
							<span><?= $l_email_access ?></span>
-
 
642
							<div class="menu-image">
-
 
643
								<img class="img-responsive menu-image" src="<?= $img_rep.$img_email ?>">
-
 
644
							</div>
-
 
645
						</div>
-
 
646
					<?php endif; ?>
630
				</div>
647
				</div>
631
 
648
 
632
				<!-- Info Box -->
649
				<!-- Info Box -->
633
				<div class="info-box-container col-sm-5">	
650
				<div class="info-box-container col-sm-5">	
634
					<div id="box_infos">
651
					<div id="box_infos">