Subversion Repositories ALCASAR

Rev

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

Rev 2299 Rev 2300
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: autoregistration.php 2299 2017-06-22 08:45:24Z tom.houdayer $
2
# $Id: autoregistration.php 2300 2017-06-22 09:00:27Z 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 303... Line 303...
303
{
303
{
304
	if ($gammu_pid!="")
304
	if ($gammu_pid!="")
305
	{
305
	{
306
		exec("sudo $script stop");
306
		exec("sudo $script stop");
307
		sleep(8);
307
		sleep(8);
308
		header('Location: autoregistration.php');	
308
		header('Location: autoregistration.php');
-
 
309
		exit();
309
	}
310
	}
310
}
311
}
311
 
312
 
312
if ($status_key=="true")
313
if ($status_key=="true")
313
{
314
{
Line 460... Line 461...
460
		}
461
		}
461
		
462
		
462
		
463
		
463
		
464
		
464
		header('Location: autoregistration.php');
465
		header('Location: autoregistration.php');
-
 
466
		exit();
465
	}
467
	}
466
 
468
 
467
	if(isset($_GET["stop"])){
469
	if(isset($_GET["stop"])){
468
		exec("sudo $script --stop");
470
		exec("sudo $script --stop");
469
		sleep(8);
471
		sleep(8);
470
		header('Location: autoregistration.php');
472
		header('Location: autoregistration.php');
-
 
473
		exit();
471
	}
474
	}
472
 
475
 
473
 
476
 
474
	#Edition du NUMERO de telephone
477
	#Edition du NUMERO de telephone
475
	if(isset($_GET["b_num_alcasar"])){
478
	if(isset($_GET["b_num_alcasar"])){
Line 479... Line 482...
479
		{
482
		{
480
			if(preg_match('#^\+#',$num))
483
			if(preg_match('#^\+#',$num))
481
			{
484
			{
482
				exec("sudo $script --replace_numero_alcasar ".escapeshellarg($num));
485
				exec("sudo $script --replace_numero_alcasar ".escapeshellarg($num));
483
				header('Location: autoregistration.php');
486
				header('Location: autoregistration.php');
-
 
487
				exit();
484
			}
488
			}
485
			else
489
			else
486
			{
490
			{
487
				$error_num_alcasar=$l_error_label_num3;
491
				$error_num_alcasar=$l_error_label_num3;
488
			}
492
			}
Line 501... Line 505...
501
		{
505
		{
502
			if(is_numeric($pin))
506
			if(is_numeric($pin))
503
			{
507
			{
504
				exec("sudo $script --replace_pin ".escapeshellarg($pin));
508
				exec("sudo $script --replace_pin ".escapeshellarg($pin));
505
				header('Location: autoregistration.php');
509
				header('Location: autoregistration.php');
-
 
510
				exit();
506
			}
511
			}
507
			else
512
			else
508
			{
513
			{
509
				$error_pin=$l_error_label_num;			
514
				$error_pin=$l_error_label_num;			
510
			}
515
			}
Line 524... Line 529...
524
		{
529
		{
525
			if(is_numeric($nb_ban_temp))
530
			if(is_numeric($nb_ban_temp))
526
			{
531
			{
527
				exec("sudo $script --replace_try_ban ".escapeshellarg($nb_ban_temp));
532
				exec("sudo $script --replace_try_ban ".escapeshellarg($nb_ban_temp));
528
				header('Location: autoregistration.php');
533
				header('Location: autoregistration.php');
-
 
534
				exit();
529
			}
535
			}
530
			else
536
			else
531
			{
537
			{
532
				$error_nb_essais=$l_error_label_num2;			
538
				$error_nb_essais=$l_error_label_num2;			
533
			}
539
			}
Line 547... Line 553...
547
		{
553
		{
548
			if(is_numeric($time_account))
554
			if(is_numeric($time_account))
549
			{
555
			{
550
				exec("sudo $script --replace_time_account ".escapeshellarg($time_account));
556
				exec("sudo $script --replace_time_account ".escapeshellarg($time_account));
551
				header('Location: autoregistration.php');
557
				header('Location: autoregistration.php');
-
 
558
				exit();
552
			}
559
			}
553
			else
560
			else
554
			{
561
			{
555
				$error_time_account=$l_error_label_num2;
562
				$error_time_account=$l_error_label_num2;
556
			}
563
			}
Line 569... Line 576...
569
		{
576
		{
570
			if(is_numeric($time_perm))
577
			if(is_numeric($time_perm))
571
			{
578
			{
572
				exec("sudo $script --replace_time_perm ".escapeshellarg($time_perm));
579
				exec("sudo $script --replace_time_perm ".escapeshellarg($time_perm));
573
				header('Location: autoregistration.php');
580
				header('Location: autoregistration.php');
-
 
581
				exit();
574
			}
582
			}
575
			else
583
			else
576
			{
584
			{
577
				$error_time_perm=$l_error_label_num2;
585
				$error_time_perm=$l_error_label_num2;
578
			}
586
			}
Line 590... Line 598...
590
		$add_mac=exec("sudo /usr/sbin/chilli_query list | grep ".escapeshellarg($numero)." | cut -d ' ' -f1");
598
		$add_mac=exec("sudo /usr/sbin/chilli_query list | grep ".escapeshellarg($numero)." | cut -d ' ' -f1");
591
		exec("sudo /usr/sbin/chilli_query logout ".escapeshellarg($add_mac));
599
		exec("sudo /usr/sbin/chilli_query logout ".escapeshellarg($add_mac));
592
 
600
 
593
		exec("sudo $script --unlock_num $numero");
601
		exec("sudo $script --unlock_num $numero");
594
		header('Location: autoregistration.php');
602
		header('Location: autoregistration.php');
-
 
603
		exit();
595
	}
604
	}
596
 
605
 
597
	# Edition etat pays
606
	# Edition etat pays
598
	if(isset($_GET['country_select'])){
607
	if(isset($_GET['country_select'])){
599
		$country=utf8_decode($_GET['country_select']);
608
		$country=utf8_decode($_GET['country_select']);
600
		exec("sudo $script --change_country ".escapeshellarg($country));
609
		exec("sudo $script --change_country ".escapeshellarg($country));
601
		exec("sudo $script --change_country_filter advance");
610
		exec("sudo $script --change_country_filter advance");
602
		header('Location: autoregistration.php');
611
		header('Location: autoregistration.php');
-
 
612
		exit();
603
	}
613
	}
604
 
614
 
605
	if(isset($_GET['b_france_enable'])){
615
	if(isset($_GET['b_france_enable'])){
606
		exec("sudo $script --change_country_dis_all");
616
		exec("sudo $script --change_country_dis_all");
607
		exec("sudo $script --change_country France");
617
		exec("sudo $script --change_country France");
608
		exec("sudo $script --change_country_filter fr");
618
		exec("sudo $script --change_country_filter fr");
609
		header('Location: autoregistration.php');
619
		header('Location: autoregistration.php');
-
 
620
		exit();
610
	}
621
	}
611
 
622
 
612
	if(isset($_GET['b_ue_enable'])){
623
	if(isset($_GET['b_ue_enable'])){
613
		exec("sudo $script --change_country_dis_all");
624
		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");
625
		$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");
Line 616... Line 627...
616
			exec("sudo $script --change_country ".escapeshellarg($pays));
627
			exec("sudo $script --change_country ".escapeshellarg($pays));
617
		}
628
		}
618
		
629
		
619
		exec("sudo $script --change_country_filter ue");
630
		exec("sudo $script --change_country_filter ue");
620
		header('Location: autoregistration.php');
631
		header('Location: autoregistration.php');
-
 
632
		exit();
621
	}
633
	}
622
 
634
 
623
	if(isset($_GET["b_country_enable"])){
635
	if(isset($_GET["b_country_enable"])){
624
		exec("sudo $script --change_country_ena_all");		
636
		exec("sudo $script --change_country_ena_all");		
625
		exec("sudo $script --change_country_filter all");
637
		exec("sudo $script --change_country_filter all");
626
		header('Location: autoregistration.php');
638
		header('Location: autoregistration.php');
-
 
639
		exit();
627
	}
640
	}
628
 
641
 
629
	if(isset($_GET["b_country_disable"])){
642
	if(isset($_GET["b_country_disable"])){
630
		exec("sudo $script --change_country_dis_all");
643
		exec("sudo $script --change_country_dis_all");
631
		header('Location: autoregistration.php');
644
		header('Location: autoregistration.php');
-
 
645
		exit();
632
	}
646
	}
633
 
647
 
634
 
648
 
635
	#Si une clé 3g est plugué
649
	#Si une clé 3g est plugué
636
	echo "<form action=\"autoregistration.php\" methode=\"GET\">
650
	echo "<form action=\"autoregistration.php\" methode=\"GET\">