Browse Source

Before Geotrip

master
Evgeny Gagua 2 years ago
parent
commit
90c5d018d1
  1. 175
      lib/scripts/distro_web_utils.php
  2. 2
      lib/scripts/sys_utils.php
  3. 45
      lib/sysroot/srv/etc/boot.php
  4. 26
      lib/sysroot/srv/etc/cron.php
  5. 12
      lib/sysroot/srv/etc/pereodical.php
  6. 2
      lib/sysroot/srv/etc/system.json
  7. 35
      style/style.css
  8. 2
      task_wait.php
  9. 14
      wan_cp.php
  10. 22
      wan_location_cp.php
  11. 98
      wan_modem_operation.php
  12. 15
      wan_sms_cp.php

175
lib/scripts/distro_web_utils.php

@ -946,13 +946,9 @@ function print_TASK_PANEL(){
};
?></td><td align="center"><?php
if( $SYS_CONFIG['MODEM_SETUP'] ){
if( $SYS_CONFIG['MODEM_IS_ON'] ){
?><a class="task_panel_btn" id="wan_cp" href="/">Disable WAN</a><?php
} else {
?><a class="task_panel_btn" id="wan_cp" href="/">Enable WAN</a><?php
};
?><a class="task_panel_btn" id="wan_cp" href="/wan_cp.php">WAN</a><?php
} else {
?><div class="task_panel_btn" id="wan_cp" href="/">WAN</div><?php
?><a class="task_panel_btn" id="wan_cp" href="/">WAN NA</a><?php
};
?></td><td align="center">
<a class="task_panel_btn" id="pkg_install" href="/pack_cp.php">Package Installer</a>
@ -961,6 +957,173 @@ function print_TASK_PANEL(){
</table><br/><?php
};
function print_MODEM_INFO(){
global $SYS_CONFIG;
?><table class="w_panel" width="100%" border=0>
<tr><td style="font-size:20px; padding-bottom: 10px;">Modem Info</td></tr>
</table><table class="w_panel" width="100%" border=0>
<tr><?php
if( $SYS_CONFIG['MODEM_SETUP'] ){
foreach($SYS_CONFIG['MODEM_CONFIG']['DEVICES'] as $MID=>$CM ){
//print_r( $CM );
echo "<td>Modem ID:</td><td>{$MID}</td></tr>";
echo "<tr><td>Power state:</td><td><span class=\"smal_patch\" id=\"on\" >{$CM['generic']['power-state']}</span></td></tr>";
if( $CM['generic']['state'] == 'disabled' ){
echo "<tr><td>Modem state:</td><td><span class=\"smal_patch\" id=\"disabled\" >{$CM['generic']['state']}
</span></td><td><a class=\"link_buton\" href=\"/task_wait.php?TID=27&MID={$MID}\">enable</a></td></tr>";
} else {
echo "<tr><td>Modem state:</td><td><span class=\"smal_patch\" id=\"enabled\" >{$CM['generic']['state']}
</span></td><td><a class=\"link_buton\" href=\"/task_wait.php?TID=28&MID={$MID}\">disable</a></td></tr>";
};
if( $CM['generic']['state'] == 'failed' ) {
echo "<tr><td>Failure reason:</td><td>{$CM['generic']['state-failed-reason']}</td></tr>";
};
if( $CM['generic']['access-technologies'][0]!=''){
echo "<tr><td>Current Mode:</td><td><span class=\"smal_patch\" id=\"{$CM['generic']['access-technologies'][0]}\" >{$CM['generic']['access-technologies'][0]}</span></td></tr>";
};
echo "<tr><td>IMEI:</td><td><b>{$CM['generic']['equipment-identifier']}</b></td></tr>";
echo "<tr><td>manufacturer:</td><td><b>{$CM['generic']['manufacturer']}</b></td></tr>";
echo "<tr><td>model:</td><td><b>{$CM['generic']['model']}</b></td></tr>";
echo "<tr><td>revision:</td><td><b>{$CM['generic']['revision']}</b></td></tr>";
if( $CM['generic']['signal-quality']['recent'] =='no' ){
echo "<tr><td>Signal validity:</td><td>No Signal</td></tr>";
} else {
echo "<tr><td>Signal value:</td><td>{$CM['generic']['signal-quality']['value']} %</td></tr>";
};
echo "<tr><td>Modem capabilities:</td><td>";
$ZI = explode( ',', $CM['generic']['current-capabilities'][0] );
foreach( $ZI as $Z ){
$CC = trim( $Z );
echo "<span class=\"smal_patch\" id=\"{$CC}\" >{$CC}</span>&nbsp;";
};
if( isset( $CM['location'] ) ){
echo "<tr><td>Location capabilities:</td><td>";
foreach( $CM['location']['capabilities'] as $CC ){
if( in_array( $CC, $CM['location']['enabled'] ) ){
echo "<span class=\"smal_patch\" id=\"enabled\" >{$CC}</span>&nbsp;";
} else {
echo "<span class=\"smal_patch\" id=\"disabled\" >{$CC}</span>&nbsp;";
};
};
echo "</td><td><a class=\"link_buton\" href=\"/wan_location_cp.php?MID={$MID}\">Manage</a></td></tr>";
};
if( $CM['generic']['state'] != 'disabled' ){
$juja = json_decode( `mmcli -m 0 --messaging-list-sms -J`,true );
echo "<tr><td>SMS Messages:</td><td style=\"font-size:16px;\"><b>".count($juja['modem.messaging.sms'])."</b></td><td><a class=\"link_buton\" href=\"/wan_sms_cp.php?MID={$MID}\">Manage</a></td></tr>";
};
echo "</td></tr>";
};
} else {
echo "<td align=\"center\">No Modem Defined!</td>";
};
?></tr>
<tr><td>&nbsp;</td></tr>
</table><br/><?php
};
function print_MODEM_LOCATION_INFO( $MID ){
global $SYS_CONFIG;
$CM = $SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID];
?><table class="w_panel" width="100%" border=0>
<tr><td style="font-size:20px; padding-bottom: 10px;">Location Info</td></tr>
</table><table class="w_panel" width="100%" border=0>
<tr><?php
echo "<td colspan=2 align=\"center\"><b>Location Engine Settings</b></td></tr>";
//print_r( $CM['location'] );
foreach( $CM['location']['capabilities'] as $CC ){
echo "<tr><td>";
if( in_array( $CC, $CM['location']['enabled'] ) ){
echo "<span class=\"smal_patch\" id=\"enabled\" >{$CC}</span>";
} else {
echo "<span class=\"smal_patch\" id=\"disabled\" >{$CC}</span>";
};
echo "</td><td>";
if( in_array( $CC, $CM['location']['enabled'] ) ){
echo "<a class=\"link_buton\" href=\"/wan_modem_operation.php?MID={$MID}&OP=4&PARAM={$CC}\">disable</a>";
} else {
echo "<a class=\"link_buton\" href=\"/wan_modem_operation.php?MID={$MID}&OP=3&PARAM={$CC}\">enable</a>";
};
echo "</td></tr>";
};
if( $CM['generic']['state']=='registered' ){
$CMD = "echo \"terrarium\" | sudo -S mmcli -m {$MID} --location-get -J";
$LOFO = json_decode( `$CMD`, true );
$LI = $LOFO['modem']['location'];
foreach( $LI as $K=>$I ){
switch( $K ){
case '3gpp':{
echo "<td colspan=2 align=\"center\"><b>3GPP Cellular Network Location Information</b></td></tr>";
echo "<td>Mobile Country Code:</td><td>{$I['mcc']}</td></tr>";
echo "<td>Mobile Network Code:</td><td>{$I['mnc']}</td></tr>";
echo "<td>Cell ID:</td><td>{$I['cid']}</td></tr>";
echo "<td>Location Area Code:</td><td>{$I['lac']}</td></tr>";
echo "<td>Tracking Area Code:</td><td>{$I['tac']}</td></tr>";
echo "<td colspan=2 align=\"center\"><hr></td></tr>";
break;
};
case 'cdma-bs':{
if( $I['latitude'] != '--' ){
echo "<td colspan=2 align=\"center\"><b>CDMA Cellular Network Location Information</b></td></tr>";
echo "<td>Lat:</td><td>{$I['latitude']}</td></tr>";
echo "<td>Lon:</td><td>{$I['longitude']}</td></tr>";
echo "<td colspan=2 align=\"center\"><hr></td></tr>";
};
break;
};
case 'gps':{
if( $I['latitude'] != '--' ){
echo "<td colspan=2 align=\"center\"><b>GPS Location Information</b></td></tr>";
echo "<td>Lat:</td><td>{$I['latitude']}</td></tr>";
echo "<td>Lon:</td><td>{$I['longitude']}</td></tr>";
echo "<td colspan=2 align=\"center\"><hr></td></tr>";
};
print_r( $I );
$GMODE = 'A';
$GFIX = 1;
$SATS = array();
$SATNUM = 0;
foreach( $I['nmea'] as $NL ){
$TAR = explode( ',', $NL );
switch( $TAR[0] ){
case '$GPGSA':{
$GMODE = $TAR[1];
$GFIX = intval( $TAR[2] );
break;
};
case '$GPGSV':{
$SATNUM = intval( $TAR[3] );
for( $i=1; $i < ( count( $TAR ) / 4 - 1); $i++ ){
$SC=array();
$CS['id'] = intval( $TAR[4*$i] );
$CS['el'] = intval( $TAR[4*$i+1] );
$CS['az'] = intval( $TAR[4*$i+2] );
$CS['snr'] = intval( $TAR[4*$i+3] );
$SATS[] = $CS;
};
break;
};
};
};
print_r( $SATS );
break;
};
};
};
//print_r( $LI );
echo "<td colspan=2 align=\"center\"><a class=\"link_buton\" href=\"/wan_cp.php\">Go Back</a></td>";
} else {
echo "<td align=\"center\"><b>Modem is Disabled!</p><br/><a class=\"link_buton\" href=\"/wan_cp.php\">Go Back</a></td>";
};
?></tr>
<tr><td>&nbsp;</td></tr>
</table><br/><?php
};
function print_MODEM_SMS_LIST( $MID ){
$juja = `mmcli -m $MID --messaging-list-sms -J`;
echo $juja;
};
function print_ADD_AUTH_FORM(){
global $SYS_CONFIG;
?><table class="w_panel" width="100%" border=0>

2
lib/scripts/sys_utils.php

@ -462,7 +462,7 @@ function apply_NGINX_AUTH( $ROOTDIR, $AFILE ){
};
function get_SERVICE_STATUS( $ServName ){
$Data = `service {$ServName} status`;
$Data = `systemctl status {$ServName}`;
$TArr = explode( "\n", $Data );
$RD = array();
foreach( $TArr as $T ){

45
lib/sysroot/srv/etc/boot.php

@ -8,6 +8,51 @@
$TD = get_SERVICE_STATUS( 'smbd' );
$SYS_CONFIG['SAMBA_IS_ON'] = $TD['ENA'];
$SYS_CONFIG['ARGUS_CONFIG'] = get_argus_config();
if( !isset( $SYS_CONFIG['MODEM_SETUP'] ) ) $SYS_CONFIG['MODEM_SETUP'] = false;
if( !$SYS_CONFIG['MODEM_SETUP'] ){
$MOMO = `mmcli -L`;
$TAR = explode( "\n", $MOMO );
if( count( $TAR ) > 1 ){
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'] = array();
foreach( $TAR as $T ) {
$CMS = trim( $T );
if( $CMS!= '' ){
$PAPA = explode( ' ', $CMS );
$AMO = explode( '/', $PAPA[0] );
$MID = intval( $AMO[count($AMO)-1] );
$MANU = json_decode( `mmcli -m $MID --output-json`, true );
$LOLO = json_decode( `mmcli -m $MID --location-status --output-json`, true );
$MANU['modem']['location'] = $LOLO['modem']['location'];
$MANU['modem']['CONNECT_AT_BOOT'] = false;
$MANU['modem']['CUSTOM_APN'] = '';
$MANU['modem']['CUSTOM_APN_USER'] = '';
$MANU['modem']['CUSTOM_APN_PASSWORD'] = '';
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem'];
$SYS_CONFIG['MODEM_SETUP'] = true;
};
};
};
} else {
foreach( $SYS_CONFIG['MODEM_CONFIG']['DEVICES'] as $MID=>$CD ){
if( isset( $CD['CONNECT_AT_BOOT'] )){
// Connect Modem
if( $CD['CONNECT_AT_BOOT'] ){
$SIMP_CON_STR = array();
if( $CD['CUSTOM_APN'] != '' ) $SIMP_CON_STR[] = "apn={$CD['CUSTOM_APN']}";
if( $CD['CUSTOM_APN_USER'] != '' ) $SIMP_CON_STR[] = "user={$CD['CUSTOM_APN_USER']}";
if( $CD['CUSTOM_APN_PASSWORD'] !='' ) $SIMP_CON_STR[] = "password={$CD['CUSTOM_APN_PASSWORD']}";
$SIMP_CS = implode( ',', $SIMP_CON_STR );
$CMD = "mmcli -m {$MID} --simple-connect=\"{$SIMP_CS}\"";
$L = `$CMD`;
};
};
//echo "Load Modem {$ID} NFO\n";
$MANU = json_decode( `mmcli -m $MID --output-json`, true );
$LOLO = json_decode( `mmcli -m $MID --location-status --output-json`, true );
$MANU['modem']['location'] = $LOLO['modem']['location'];
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID] = $MANU['modem'];
};
};
save_system_config();
?>

26
lib/sysroot/srv/etc/cron.php

@ -260,6 +260,32 @@
exit();
break;
};
case 27:{
//Enable Modem
out_log("Disabling Modem!");
$CMD = "mmcli -m {$CRON_CONFIG['parameter']} --enable";
out_log( $CMD );
$L=`$CMD`;
$CMD = "mmcli -m {$CRON_CONFIG['parameter']} --output-json";
out_log( $CMD );
$MANU = json_decode( `$CMD`, true );
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$CRON_CONFIG['parameter']]=$MANU['modem'];
save_system_config();
break;
};
case 28:{
//Dieable Modem
out_log("Disabling Modem!");
$CMD = "mmcli -m {$CRON_CONFIG['parameter']} --disable";
out_log( $CMD );
$L=`$CMD`;
$CMD = "mmcli -m {$CRON_CONFIG['parameter']} --output-json";
out_log( $CMD );
$MANU = json_decode( `$CMD`, true );
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$CRON_CONFIG['parameter']]=$MANU['modem'];
save_system_config();
break;
};
};
};
?>

12
lib/sysroot/srv/etc/pereodical.php

@ -1,11 +1,13 @@
<?php
require_once( '/srv/scripts/sys_utils.php' );
$SYS_CONFIG['PERIODIC_JOB_COUNTS']++;
if( $SYS_CONFIG['WIFI_MODE'] == 1 ){
if( $SYS_CONFIG['PERIODIC_JOB_COUNTS'] == 5 ){
$L=`/srv/scripts/wifi_ap_off.sh`;
$SYS_CONFIG['WIFI_IS_ON'] = false;
if( isset( $SYS_CONFIG['WIFI_MODE'] ) ){
if( $SYS_CONFIG['WIFI_MODE'] == 1 ){
if( $SYS_CONFIG['PERIODIC_JOB_COUNTS'] == 5 ){
$L=`/srv/scripts/wifi_ap_off.sh`;
$SYS_CONFIG['WIFI_IS_ON'] = false;
save_system_config();
};
};
};
save_system_config();
?>

2
lib/sysroot/srv/etc/system.json

@ -1 +1 @@
{"SAMBA_IS_ON":true,"ARGUS_CONFIG":{"app_is_running":true,"webui_is_running":true},"PERIODIC_JOB_COUNTS":0,"NET_CONFIG":{"lo":{"flags":{"hotplug":0,"auto":1},"net":[],"fam":"inet","mode":"loopback"},"enp6s0":{"flags":{"hotplug":1,"auto":0},"net":[],"fam":"inet","mode":"dhcp"}}}
{"PERIODIC_JOB_COUNTS":0,"SAMBA_IS_ON":true,"ARGUS_CONFIG":{"app_is_running":true,"webui_is_running":true},"MODEM_SETUP":true,"MODEM_CONFIG":{"DEVICES":[{"3gpp":{"enabled-locks":[],"eps":{"initial-bearer":{"dbus-path":"--","settings":{"apn":"--","ip-type":"--","password":"--","user":"--"}},"ue-mode-operation":"csps-1"},"imei":"860147051348496","operator-code":"42501","operator-name":"Partner","pco":"--","registration-state":"--"},"cdma":{"activation-state":"--","cdma1x-registration-state":"--","esn":"--","evdo-registration-state":"--","meid":"--","nid":"--","sid":"--"},"dbus-path":"\/org\/freedesktop\/ModemManager1\/Modem\/0","generic":{"access-technologies":["lte"],"bearers":[],"carrier-configuration":"ROW_Gen_VoLTE","carrier-configuration-revision":"05010822","current-bands":["egsm","dcs","utran-1","utran-5","utran-8","eutran-1","eutran-3","eutran-5","eutran-7","eutran-8","eutran-20","eutran-38","eutran-40","eutran-41"],"current-capabilities":["gsm-umts, lte"],"current-modes":"allowed: 2g, 3g, 4g; preferred: 4g","device":"\/sys\/devices\/pci0000:00\/0000:00:14.0\/usb1\/1-2","device-identifier":"370583bd437ad3b0629ff381ca0c81fc37647d4a","drivers":["option1","qmi_wwan"],"equipment-identifier":"860147051348496","hardware-revision":"10000","manufacturer":"QUALCOMM INCORPORATED","model":"SIMCOM_SIM7600E-H","own-numbers":[],"plugin":"simtech","ports":["cdc-wdm0 (qmi)","ttyUSB1 (qcdm)","ttyUSB2 (gps)","ttyUSB3 (at)","ttyUSB4 (at)","ttyUSB5 (audio)","wwan0 (net)"],"power-state":"on","primary-port":"cdc-wdm0","revision":"LE20B04SIM7600M22_210318","signal-quality":{"recent":"yes","value":"59"},"sim":"\/org\/freedesktop\/ModemManager1\/SIM\/0","state":"enabled","state-failed-reason":"--","supported-bands":["egsm","dcs","utran-1","utran-5","utran-8","eutran-1","eutran-3","eutran-5","eutran-7","eutran-8","eutran-20","eutran-38","eutran-40","eutran-41"],"supported-capabilities":["gsm-umts, lte"],"supported-ip-families":["ipv4","ipv6","ipv4v6"],"supported-modes":["allowed: 2g; preferred: none","allowed: 3g; preferred: none","allowed: 4g; preferred: none","allowed: 2g, 3g; preferred: 3g","allowed: 2g, 3g; preferred: 2g","allowed: 2g, 4g; preferred: 4g","allowed: 2g, 4g; preferred: 2g","allowed: 3g, 4g; preferred: 4g","allowed: 3g, 4g; preferred: 3g","allowed: 2g, 3g, 4g; preferred: 4g","allowed: 2g, 3g, 4g; preferred: 3g","allowed: 2g, 3g, 4g; preferred: 2g"],"unlock-required":"sim-pin2","unlock-retries":["sim-pin (3)","sim-puk (10)","sim-pin2 (3)","sim-puk2 (10)"]}}]},"NET_CONFIG":{"lo":{"flags":{"hotplug":0,"auto":1},"net":[],"fam":"inet","mode":"loopback"},"enp6s0":{"flags":{"hotplug":1,"auto":0},"net":[],"fam":"inet","mode":"dhcp"}}}

35
style/style.css

@ -53,6 +53,8 @@ body{
}
.link_buton{
/*border: 2px solid white;*/
display: block;
text-align: center;
border-radius: 5px;
color: black;
text-decoration: none;
@ -60,6 +62,7 @@ body{
padding-top: 3px;
padding-right: 10px;
padding-bottom: 3px;
margin: 5px;
font-size: 14px;
font-weight: bold;
background-color: orange;
@ -120,4 +123,36 @@ body{
color: black;
border: black 2px solid;
background-color: white;
}
.smal_patch{
aheight: 30px;
border-radius: 5px;
padding-left: 10px;
padding-top: 3px;
padding-right: 10px;
padding-bottom: 3px;
text-transform: uppercase;
text-decoration: none;
font-family: arial;
font-size: 10px;
font-weight: bold;
color: black;
background-color: orange;
}
.smal_patch#failed,.smal_patch#off{
color: yellow;
background-color: red;
}
.smal_patch#on,.smal_patch#enabled{
color: yellow;
background-color: green;
}
.smal_patch#disabled{
color: black;
background-color: silver;
}
.smal_patch#lte{
color: yellow;
background-color: blue;
}

2
task_wait.php

@ -23,6 +23,8 @@
intval( $_GET['CTSS'] ));
break;
};
case 27: $CPARAM = $_GET['MID']; break;
case 28: $CPARAM = $_GET['MID']; break;
};
if( !create_cron_task( $CTID, $CPARAM ) ){
header('location: /');

14
wan_cp.php

@ -3,16 +3,18 @@
require_once('../../scripts/sys_utils.php');
require_once('../../scripts/distro_web_utils.php');
foreach( $SYS_CONFIG['MODEM_CONFIG']['DEVICES'] as $ID=>$CD ){
$MANU = json_decode( `mmcli -m $ID --output-json`, true );
$LOLO = json_decode( `mmcli -m $ID --location-status --output-json`, true );
$MANU['modem']['location'] = $LOLO['modem']['location'];
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$ID]=$MANU['modem'];
};
print_PAGE_HEADER();
if( $SYS_CONFIG['NGINX_AUTH_IS_SET'] == false ) {
print_AUTH_WARNING();
};
print_CONNECTION_INFO();
print_TASK_PANEL();
print_NET_INFO();
print_CERT_INFO();
print_APPLICATION_INFO();
print_TIME_INFO();
print_MODEM_INFO();
print_PAGE_BOTTOM();
?>

22
wan_location_cp.php

@ -0,0 +1,22 @@
<?php
if( isset( $_GET['MID'] ) ){
$MID = intval( $_GET['MID'] );
require_once('../../scripts/sys_utils.php');
require_once('../../scripts/distro_web_utils.php');
$MANU = json_decode( `mmcli -m $MID --output-json`, true );
$LOLO = json_decode( `mmcli -m $MID --location-status --output-json`, true );
$MANU['modem']['location'] = $LOLO['modem']['location'];
$SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem'];
print_PAGE_HEADER();
if( !isset( $SYS_CONFIG['NGINX_AUTH_IS_SET'] ) ){
print_AUTH_WARNING();
} elseif( $SYS_CONFIG['NGINX_AUTH_IS_SET'] == false ) {
print_AUTH_WARNING();
};
print_MODEM_LOCATION_INFO( $MID );
print_PAGE_BOTTOM();
} else {
header( 'location: /wan_cp.php' );//mmcli -m 0 --messaging-create-sms=“text=‘Hello world’,number=’+1234567890’”
};
?>

98
wan_modem_operation.php

@ -0,0 +1,98 @@
<?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 \"terrarium\" | sudo -S mmcli -m {$MID} --enable";
$LL = `$CMD`;
require_once('../../scripts/sys_utils.php');
$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 \"terrarium\" | sudo -S mmcli -m {$MID} --disable";
$LL = `$CMD`;
require_once('../../scripts/sys_utils.php');
$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');
$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');
$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' );
};
?>

15
wan_sms_cp.php

@ -0,0 +1,15 @@
<?php
if( isset( $_GET['MID'] ) ){
require_once('../../scripts/sys_utils.php');
require_once('../../scripts/distro_web_utils.php');
print_PAGE_HEADER();
if( $SYS_CONFIG['NGINX_AUTH_IS_SET'] == false ) {
print_AUTH_WARNING();
};
print_MODEM_SMS_LIST( 0 );
print_PAGE_BOTTOM();
} else {
header( 'location: /wan_cp.php' );
};
?>
Loading…
Cancel
Save