Subversion Repositories ALCASAR

Rev

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

Rev 2317 Rev 2349
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: autoregistration.php 2317 2017-06-30 11:42:44Z tom.houdayer $
2
# $Id: autoregistration.php 2349 2017-07-22 12:20:21Z 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 594... Line 594...
594
	# Suppression d'un numero bloqué
594
	# Suppression d'un numero bloqué
595
	if(isset($_GET['num_select'])){
595
	if(isset($_GET['num_select'])){
596
		$numero=$_GET['num_select'];
596
		$numero=$_GET['num_select'];
597
 
597
 
598
		$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");
-
 
599
		if (!empty($add_mac)) {
599
		exec("sudo /usr/sbin/chilli_query logout ".escapeshellarg($add_mac));
600
			exec("sudo /usr/sbin/chilli_query logout ".escapeshellarg($add_mac));
-
 
601
		}
600
 
602
 
601
		exec("sudo $script --unlock_num $numero");
603
		exec("sudo $script --unlock_num $numero");
602
		header('Location: autoregistration.php');
604
		header('Location: autoregistration.php');
603
		exit();
605
		exit();
604
	}
606
	}