Subversion Repositories ALCASAR

Rev

Rev 2294 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2294 Rev 2299
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: autoregistration.php 2294 2017-06-20 16:45:48Z richard $
2
# $Id: autoregistration.php 2299 2017-06-22 08:45:24Z tom.houdayer $
3
 
3
 
4
# Test if 3G/4G key is plugged 
4
# Test if 3G/4G key is plugged 
5
$exec_com=exec("lsusb | grep -i 067b: | cut -d ' ' -f6"); // converter "USB to UART" PL2303 (several USB-serial cables, Wavecom GSM Modem)
5
$exec_com=exec("lsusb | grep -i 067b: | cut -d ' ' -f6"); // converter "USB to UART" PL2303 (several USB-serial cables, Wavecom GSM Modem)
6
$exec_com2=exec("lsusb | grep -i 12d1: | cut -d ' ' -f6"); // Huawei Technologies (E220/E230/E270/E870
6
$exec_com2=exec("lsusb | grep -i 12d1: | cut -d ' ' -f6"); // Huawei Technologies (E220/E230/E270/E870
7
//$exec_com2=exec("lsusb | grep -i 2001: | cut -d ' ' -f6"); // Dlink (to test)
7
//$exec_com2=exec("lsusb | grep -i 2001: | cut -d ' ' -f6"); // Dlink (to test)
Line 477... Line 477...
477
		$error_num_alcasar = "";
477
		$error_num_alcasar = "";
478
		if($num !="")
478
		if($num !="")
479
		{
479
		{
480
			if(preg_match('#^\+#',$num))
480
			if(preg_match('#^\+#',$num))
481
			{
481
			{
482
				exec("sudo $script --replace_numero_alcasar  $num");
482
				exec("sudo $script --replace_numero_alcasar ".escapeshellarg($num));
483
				header('Location: autoregistration.php');
483
				header('Location: autoregistration.php');
484
			}
484
			}
485
			else
485
			else
486
			{
486
			{
487
				$error_num_alcasar=$l_error_label_num3;
487
				$error_num_alcasar=$l_error_label_num3;
Line 499... Line 499...
499
		$error_pin = "";
499
		$error_pin = "";
500
		if($pin !="")
500
		if($pin !="")
501
		{
501
		{
502
			if(is_numeric($pin))
502
			if(is_numeric($pin))
503
			{
503
			{
504
				exec("sudo $script --replace_pin  $pin");
504
				exec("sudo $script --replace_pin ".escapeshellarg($pin));
505
				header('Location: autoregistration.php');
505
				header('Location: autoregistration.php');
506
			}
506
			}
507
			else
507
			else
508
			{
508
			{
509
				$error_pin=$l_error_label_num;			
509
				$error_pin=$l_error_label_num;			
Line 522... Line 522...
522
		$error_nb_essais = "";
522
		$error_nb_essais = "";
523
		if($nb_ban_temp !="")
523
		if($nb_ban_temp !="")
524
		{
524
		{
525
			if(is_numeric($nb_ban_temp))
525
			if(is_numeric($nb_ban_temp))
526
			{
526
			{
527
				exec("sudo $script --replace_try_ban  $nb_ban_temp");
527
				exec("sudo $script --replace_try_ban ".escapeshellarg($nb_ban_temp));
528
				header('Location: autoregistration.php');
528
				header('Location: autoregistration.php');
529
			}
529
			}
530
			else
530
			else
531
			{
531
			{
532
				$error_nb_essais=$l_error_label_num2;			
532
				$error_nb_essais=$l_error_label_num2;			
Line 545... Line 545...
545
		$error_time_account = "";
545
		$error_time_account = "";
546
		if($time_account !="")
546
		if($time_account !="")
547
		{
547
		{
548
			if(is_numeric($time_account))
548
			if(is_numeric($time_account))
549
			{
549
			{
550
				exec("sudo $script --replace_time_account  $time_account");
550
				exec("sudo $script --replace_time_account ".escapeshellarg($time_account));
551
				header('Location: autoregistration.php');
551
				header('Location: autoregistration.php');
552
			}
552
			}
553
			else
553
			else
554
			{
554
			{
555
				$error_time_account=$l_error_label_num2;
555
				$error_time_account=$l_error_label_num2;
Line 567... Line 567...
567
		$error_time_perm = "";
567
		$error_time_perm = "";
568
		if($time_perm !="")
568
		if($time_perm !="")
569
		{
569
		{
570
			if(is_numeric($time_perm))
570
			if(is_numeric($time_perm))
571
			{
571
			{
572
				exec("sudo $script --replace_time_perm  $time_perm");
572
				exec("sudo $script --replace_time_perm ".escapeshellarg($time_perm));
573
				header('Location: autoregistration.php');
573
				header('Location: autoregistration.php');
574
			}
574
			}
575
			else
575
			else
576
			{
576
			{
577
				$error_time_perm=$l_error_label_num2;
577
				$error_time_perm=$l_error_label_num2;
Line 585... Line 585...
585
 
585
 
586
	# Suppression d'un numero bloqué
586
	# Suppression d'un numero bloqué
587
	if(isset($_GET['num_select'])){
587
	if(isset($_GET['num_select'])){
588
		$numero=$_GET['num_select'];
588
		$numero=$_GET['num_select'];
589
 
589
 
590
		$add_mac=exec("sudo /usr/sbin/chilli_query list | grep $numero | cut -d ' ' -f1");
590
		$add_mac=exec("sudo /usr/sbin/chilli_query list | grep ".escapeshellarg($numero)." | cut -d ' ' -f1");
591
		exec("sudo /usr/sbin/chilli_query logout $add_mac");
591
		exec("sudo /usr/sbin/chilli_query logout ".escapeshellarg($add_mac));
592
 
592
 
593
		exec("sudo $script --unlock_num $numero");
593
		exec("sudo $script --unlock_num $numero");
594
		header('Location: autoregistration.php');
594
		header('Location: autoregistration.php');
595
	}
595
	}
596
 
596
 
597
	# Edition etat pays
597
	# Edition etat pays
598
	if(isset($_GET['country_select'])){
598
	if(isset($_GET['country_select'])){
599
		$country=utf8_decode($_GET['country_select']);
599
		$country=utf8_decode($_GET['country_select']);
600
		exec("sudo $script --change_country $country");
600
		exec("sudo $script --change_country ".escapeshellarg($country));
601
		exec("sudo $script --change_country_filter advance");
601
		exec("sudo $script --change_country_filter advance");
602
		header('Location: autoregistration.php');
602
		header('Location: autoregistration.php');
603
	}
603
	}
604
 
604
 
605
	if(isset($_GET['b_france_enable'])){
605
	if(isset($_GET['b_france_enable'])){
Line 611... Line 611...
611
 
611
 
612
	if(isset($_GET['b_ue_enable'])){
612
	if(isset($_GET['b_ue_enable'])){
613
		exec("sudo $script --change_country_dis_all");
613
		exec("sudo $script --change_country_dis_all");
614
		$array_ue = array("Allemagne","Autriche","Belgique","Bulgarie","Chypre","Croatie","Danemark","Espagne","Estonie","Finlande","France","Grece","Hongrie","Irlande","Italie","Lettonie","Lituanie","Luxembourg","Malte","Pays-Bas"," Pologne","Portugal","Republique Tcheque","Roumanie","Angleterre","Slovaquie","Slovenie","Suede");
614
		$array_ue = array("Allemagne","Autriche","Belgique","Bulgarie","Chypre","Croatie","Danemark","Espagne","Estonie","Finlande","France","Grece","Hongrie","Irlande","Italie","Lettonie","Lituanie","Luxembourg","Malte","Pays-Bas"," Pologne","Portugal","Republique Tcheque","Roumanie","Angleterre","Slovaquie","Slovenie","Suede");
615
		foreach ($array_ue as $pays){
615
		foreach ($array_ue as $pays){
616
			exec("sudo $script --change_country $pays");
616
			exec("sudo $script --change_country ".escapeshellarg($pays));
617
		}
617
		}
618
		
618
		
619
		exec("sudo $script --change_country_filter ue");
619
		exec("sudo $script --change_country_filter ue");
620
		header('Location: autoregistration.php');
620
		header('Location: autoregistration.php');
621
	}
621
	}