Web Interface For Lite Argus Control modules
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.

44 lines
1.6 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. //require_once('../php/onvif/toto.php');
  4. if( $CUser->Data['id'] > 1 ){
  5. if( isset( $_POST['cam_sources'] ) ){
  6. if( $_POST['cam_sources'] == 'ipv' ){
  7. $QS = "SELECT * FROM `cameras` WHERE `node_id`=0";
  8. $Result = $DATABASE->Query($QS,false);
  9. foreach( $Result as $CD ){
  10. $cnode['id'] = $CD['id'];
  11. $cnode['status'] = $CD['status'];
  12. $cnode['login'] = $CD['access_login'];
  13. $cnode['password']= $CD['access_pass'];
  14. $cnode['name'] = urldecode($CD['name']);
  15. $cnode['hardware']= urldecode($CD['hardware']);
  16. $cnode['caps'] = 'IP';
  17. $cnode['ip'] = $CD['ip'];
  18. $cnode['mac'] = $CD['mac'];
  19. $cnode['ena'] = 1;
  20. $Data['nodes'][] = $cnode;
  21. };
  22. } else {
  23. $QS = "SELECT `ms`.* , `re`.`node_id` FROM `media_streams` `ms` LEFT JOIN `resources` `re` ON ( `re`.`aux_id` = `ms`.`id` ) WHERE `ms`.`source_type`='A' AND `ms`.`source_id`=0";
  24. $Result = $DATABASE->Query($QS,false);
  25. foreach( $Result as $CD ){
  26. $cnode['id'] = $CD['id'];
  27. $cnode['server'] = getServerID( $CD['node_id'] );//'local';
  28. $T = getV4L2DeviceName($CD['mrl']);
  29. $cnode['name'] = $T['name'];
  30. $cnode['hardware']= $T['dev'];
  31. $cnode['caps'] = 'Analog';
  32. $cnode['ip'] = '['.$CD['img_width'] .'x' . $CD['img_height'] .']';
  33. $cnode['mac'] = $CD['mrl'];
  34. if( $T['dev']=='unknown') $cnode['ena'] = 0; else $cnode['ena'] = 1;
  35. $Data['nodes'][] = $cnode;
  36. };
  37. };
  38. echo json_encode( $Data );
  39. } else {
  40. header('location: /');
  41. };
  42. } else {
  43. header('location: /');
  44. };
  45. ?>