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.

99 lines
3.2 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../../scripts/sys_utils.php');
  3. if( isset( $_GET['MID'] ) || isset( $_POST['MID'] ) ){
  4. $COP = 0;
  5. if( isset( $_GET['MID'] ) ){
  6. $MID = intval( $_GET['MID'] );
  7. } else {
  8. $MID = intval( $_POST['MID'] );
  9. };
  10. if( isset( $_GET['OP'] ) ){
  11. $COP = intval( $_GET['OP'] );
  12. } elseif( isset( $_POST['OP'] ) ){
  13. $COP = intval( $_POST['OP'] );
  14. };
  15. if( $COP ){
  16. switch( $COP ){
  17. case 1:{
  18. //Enable Modem
  19. $CMD = "echo \"{$WEB_USER_SUDO_PWD}\" | sudo -S mmcli -m {$MID} --enable";
  20. $LL = `$CMD`;
  21. $MANU = json_decode( `mmcli -m $MID --output-json`, true );
  22. $SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem'];
  23. save_system_config();
  24. header( 'location: /wan_cp.php' );
  25. break;
  26. };
  27. case 2:{
  28. //Disable Modem
  29. $CMD = "echo \"{$WEB_USER_SUDO_PWD}\" | sudo -S mmcli -m {$MID} --disable";
  30. $LL = `$CMD`;
  31. $MANU = json_decode( `mmcli -m $MID --output-json`, true );
  32. $SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem'];
  33. save_system_config();
  34. header( 'location: /wan_cp.php' );
  35. break;
  36. };
  37. case 3:{
  38. //Enable Location Engine
  39. $ENG = '';
  40. switch( $_GET['PARAM'] ){
  41. case '3gpp-lac-ci': $ENG = '3gpp'; break;
  42. case 'gps-raw': $ENG = 'gps-raw'; break;
  43. case 'gps-unmanaged': $ENG = 'gps'; break;
  44. case 'gps-nmea': $ENG = 'gps-nmea'; break;
  45. case 'agps-msa': $ENG = 'agps-msa'; break;
  46. case 'agps-msb': $ENG = 'agps-msb'; break;
  47. };
  48. if( $ENG != '' ){
  49. //$CMD = "echo \"terrarium\" | sudo -S mmcli -m {$MID} --location-enable-{$ENG}";
  50. //$LL = `$CMD`;
  51. require_once('../../scripts/sys_utils.php');
  52. run_root_command( "mmcli -m {$MID} --location-enable-{$ENG}" );
  53. $MANU = json_decode( `mmcli -m $MID -J`, true );
  54. $SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem'];
  55. save_system_config();
  56. };
  57. header( 'location: /wan_location_cp.php?MID='.$MID );
  58. break;
  59. };
  60. case 4:{
  61. //Disable Location Engine
  62. $ENG = '';
  63. switch( $_GET['PARAM'] ){
  64. case '3gpp-lac-ci': $ENG = '3gpp'; break;
  65. case 'gps-raw': $ENG = 'gps-raw'; break;
  66. case 'gps-unmanaged': $ENG = 'gps'; break;
  67. case 'gps-nmea': $ENG = 'gps-nmea'; break;
  68. case 'agps-msa': $ENG = 'agps-msa'; break;
  69. case 'agps-msb': $ENG = 'agps-msb'; break;
  70. };
  71. if( $ENG != '' ){
  72. //$CMD = "echo \"terrarium\" | sudo -S mmcli -m {$MID} --location-disable-{$ENG}";
  73. //$LL = `$CMD`;
  74. require_once('../../scripts/sys_utils.php');
  75. run_root_command( "mmcli -m {$MID} --location-disable-{$ENG}" );
  76. $MANU = json_decode( `mmcli -m $MID -J`, true );
  77. $SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem'];
  78. save_system_config();
  79. };
  80. header( 'location: /wan_location_cp.php?MID='.$MID );
  81. break;
  82. };
  83. case 5:{
  84. //Create SMS
  85. header( 'location: /wan_location_cp.php?MID='.$MID );
  86. break;
  87. };
  88. case 6:{
  89. // Delete SMS
  90. header( 'location: /wan_location_cp.php?MID='.$MID );
  91. break;
  92. };
  93. };
  94. } else {
  95. };
  96. } else {
  97. header( 'location: /wan_cp.php' );
  98. };
  99. ?>