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.
45 lines
1.6 KiB
45 lines
1.6 KiB
<?php
|
|
require_once('../ajax_asm.php');
|
|
//require_once('../php/onvif/toto.php');
|
|
if( $CUser->Data['id'] > 1 ){
|
|
if( isset( $_POST['cam_sources'] ) ){
|
|
if( $_POST['cam_sources'] == 'ipv' ){
|
|
$QS = "SELECT * FROM `cameras` WHERE `node_id`=0";
|
|
$Result = $DATABASE->Query($QS,false);
|
|
foreach( $Result as $CD ){
|
|
$cnode['id'] = $CD['id'];
|
|
$cnode['status'] = $CD['status'];
|
|
$cnode['login'] = $CD['access_login'];
|
|
$cnode['password']= $CD['access_pass'];
|
|
$cnode['name'] = urldecode($CD['name']);
|
|
$cnode['hardware']= urldecode($CD['hardware']);
|
|
$cnode['caps'] = 'IP';
|
|
$cnode['ip'] = $CD['ip'];
|
|
$cnode['mac'] = $CD['mac'];
|
|
$cnode['ena'] = 1;
|
|
$Data['nodes'][] = $cnode;
|
|
};
|
|
} else {
|
|
$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";
|
|
$Result = $DATABASE->Query($QS,false);
|
|
foreach( $Result as $CD ){
|
|
$cnode['id'] = $CD['id'];
|
|
$cnode['server'] = getServerID( $CD['node_id'] );//'local';
|
|
$T = getV4L2DeviceName($CD['mrl']);
|
|
$cnode['name'] = $T['name'];
|
|
$cnode['hardware']= $T['dev'];
|
|
$cnode['caps'] = 'Analog';
|
|
$cnode['ip'] = '['.$CD['img_width'] .'x' . $CD['img_height'] .']';
|
|
$cnode['mac'] = $CD['mrl'];
|
|
if( $T['dev']=='unknown') $cnode['ena'] = 0; else $cnode['ena'] = 1;
|
|
$Data['nodes'][] = $cnode;
|
|
};
|
|
};
|
|
echo json_encode( $Data );
|
|
} else {
|
|
header('location: /');
|
|
};
|
|
} else {
|
|
header('location: /');
|
|
};
|
|
?>
|