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.

97 lines
3.1 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. if( isset( $_GET['MID'] ) || isset( $_POST['MID'] ) ){
  3. $COP = 0;
  4. if( isset( $_GET['MID'] ) ){
  5. $MID = intval( $_GET['MID'] );
  6. } else {
  7. $MID = intval( $_POST['MID'] );
  8. };
  9. if( isset( $_GET['OP'] ) ){
  10. $COP = intval( $_GET['OP'] );
  11. } elseif( isset( $_POST['OP'] ) ){
  12. $COP = intval( $_POST['OP'] );
  13. };
  14. if( $COP ){
  15. switch( $COP ){
  16. case 1:{
  17. //Enable Modem
  18. $CMD = "echo \"terrarium\" | sudo -S mmcli -m {$MID} --enable";
  19. $LL = `$CMD`;
  20. require_once('../../scripts/sys_utils.php');
  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 \"terrarium\" | sudo -S mmcli -m {$MID} --disable";
  30. $LL = `$CMD`;
  31. require_once('../../scripts/sys_utils.php');
  32. $MANU = json_decode( `mmcli -m $MID --output-json`, true );
  33. $SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem'];
  34. save_system_config();
  35. header( 'location: /wan_cp.php' );
  36. break;
  37. };
  38. case 3:{
  39. //Enable Location Engine
  40. $ENG = '';
  41. switch( $_GET['PARAM'] ){
  42. case '3gpp-lac-ci': $ENG = '3gpp'; break;
  43. case 'gps-raw': $ENG = 'gps-raw'; break;
  44. case 'gps-unmanaged': $ENG = 'gps'; break;
  45. case 'gps-nmea': $ENG = 'gps-nmea'; break;
  46. case 'agps-msa': $ENG = 'agps-msa'; break;
  47. case 'agps-msb': $ENG = 'agps-msb'; break;
  48. };
  49. if( $ENG != '' ){
  50. $CMD = "echo \"terrarium\" | sudo -S mmcli -m {$MID} --location-enable-{$ENG}";
  51. $LL = `$CMD`;
  52. require_once('../../scripts/sys_utils.php');
  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. $MANU = json_decode( `mmcli -m $MID -J`, true );
  76. $SYS_CONFIG['MODEM_CONFIG']['DEVICES'][$MID]=$MANU['modem'];
  77. save_system_config();
  78. };
  79. header( 'location: /wan_location_cp.php?MID='.$MID );
  80. break;
  81. };
  82. case 5:{
  83. //Create SMS
  84. header( 'location: /wan_location_cp.php?MID='.$MID );
  85. break;
  86. };
  87. case 6:{
  88. // Delete SMS
  89. header( 'location: /wan_location_cp.php?MID='.$MID );
  90. break;
  91. };
  92. };
  93. } else {
  94. };
  95. } else {
  96. header( 'location: /wan_cp.php' );
  97. };
  98. ?>