Installer/Updater
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

100 lines
3.2 KiB

<?php
require_once('../../scripts/sys_utils.php');
if( isset( $_GET['MID'] ) || isset( $_POST['MID'] ) ){
$COP = 0;
if( isset( $_GET['MID'] ) ){
$MID = intval( $_GET['MID'] );
} else {
$MID = intval( $_POST['MID'] );
};
if( isset( $_GET['OP'] ) ){
$COP = intval( $_GET['OP'] );
} elseif( isset( $_POST['OP'] ) ){
$COP = intval( $_POST['OP'] );
};
if( $COP ){
switch( $COP ){
case 1:{
//Enable Modem
$CMD = "echo \"{$WEB_USER_SUDO_PWD}\" | sudo -S mmcli -m {$MID} --enable";
$LL = `$CMD`;
$MANU = json_decode( `mmcli -m $MID --output-json`, true );
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem'];
save_system_config();
header( 'location: /wan_cp.php' );
break;
};
case 2:{
//Disable Modem
$CMD = "echo \"{$WEB_USER_SUDO_PWD}\" | sudo -S mmcli -m {$MID} --disable";
$LL = `$CMD`;
$MANU = json_decode( `mmcli -m $MID --output-json`, true );
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem'];
save_system_config();
header( 'location: /wan_cp.php' );
break;
};
case 3:{
//Enable Location Engine
$ENG = '';
switch( $_GET['PARAM'] ){
case '3gpp-lac-ci': $ENG = '3gpp'; break;
case 'gps-raw': $ENG = 'gps-raw'; break;
case 'gps-unmanaged': $ENG = 'gps'; break;
case 'gps-nmea': $ENG = 'gps-nmea'; break;
case 'agps-msa': $ENG = 'agps-msa'; break;
case 'agps-msb': $ENG = 'agps-msb'; break;
};
if( $ENG != '' ){
//$CMD = "echo \"terrarium\" | sudo -S mmcli -m {$MID} --location-enable-{$ENG}";
//$LL = `$CMD`;
require_once('../../scripts/sys_utils.php');
run_root_command( "mmcli -m {$MID} --location-enable-{$ENG}" );
$MANU = json_decode( `mmcli -m $MID -J`, true );
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem'];
save_system_config();
};
header( 'location: /wan_location_cp.php?MID='.$MID );
break;
};
case 4:{
//Disable Location Engine
$ENG = '';
switch( $_GET['PARAM'] ){
case '3gpp-lac-ci': $ENG = '3gpp'; break;
case 'gps-raw': $ENG = 'gps-raw'; break;
case 'gps-unmanaged': $ENG = 'gps'; break;
case 'gps-nmea': $ENG = 'gps-nmea'; break;
case 'agps-msa': $ENG = 'agps-msa'; break;
case 'agps-msb': $ENG = 'agps-msb'; break;
};
if( $ENG != '' ){
//$CMD = "echo \"terrarium\" | sudo -S mmcli -m {$MID} --location-disable-{$ENG}";
//$LL = `$CMD`;
require_once('../../scripts/sys_utils.php');
run_root_command( "mmcli -m {$MID} --location-disable-{$ENG}" );
$MANU = json_decode( `mmcli -m $MID -J`, true );
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem'];
save_system_config();
};
header( 'location: /wan_location_cp.php?MID='.$MID );
break;
};
case 5:{
//Create SMS
header( 'location: /wan_location_cp.php?MID='.$MID );
break;
};
case 6:{
// Delete SMS
header( 'location: /wan_location_cp.php?MID='.$MID );
break;
};
};
} else {
};
} else {
header( 'location: /wan_cp.php' );
};
?>