Web UI for ARGUS server
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.

31 lines
854 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $Data = array();
  5. $Data['success'] = false;
  6. if( isset( $_POST['NID'] ) ) {
  7. $NodeID = intval($_POST['NID']);
  8. } else $NodeID = 0;
  9. if( isset( $_POST['CMD'] ) ){
  10. $CMD = intval( $_POST['CMD'] );
  11. } else {
  12. $CMD = 0;
  13. };
  14. if( isset( $_POST['PARAM'] ) ){
  15. $PARAM = $DATABASE->escape( $_POST['PARAM'] );
  16. } else {
  17. $PARAM = '';
  18. };
  19. if( $NodeID > 0 && $CMD > 0 ){
  20. $Data['success'] = true;
  21. $QS = "INSERT INTO `nodes_qcq` SET `node_id`={$NodeID}, `cmd`={$CMD}, `status`=0, `parameter`='{$PARAM}'";
  22. $Data['query'] = $QS;
  23. $DATABASE->Query( $QS, false );
  24. $Data['operation_id'] = intval( $DATABASE->getLastInsertID() );
  25. } else {
  26. $Data['msg']='Wrong Parameters';
  27. };
  28. echo json_encode( $Data );
  29. exit();
  30. };
  31. header('location: /');
  32. ?>