www.smartsecsystems.com<\/a>","_SSL_VALID_BUT_":"The Certificate is Valid. However:","_STATIC_CONNECTION_":"Static Connection","_STATUS_":"Status","_STORE_DAYS_":"Keep Report History Days","_STORE_EMPTY_SPACE_":"Preserve Empty Space on System","_STREAMS_":"Streams","_STUDY_BACKGROUND_":"Study Background","_SUCCESS_":"Success","_SWU_DASHBOARD_":"Software Update Management","_SYS_ANCHORT_LBL_":"System Anchor","_SYS_DASHBOARD_":"System Overview","_SYS_GENERAL_":"General","_SYS_MAP_":"System Map","_SYS_SETTINGS_":"System Settings","_TARGET_FILTERS_":"Filters","_TARGETING_TAB_":"Alarm Settings","_TCP_CLIENT_":"TCP Client","_TCP_SERVER_":"TCP Server","_TILE_URL_MAP_":"Tiles URL Pattern","_TIME_":"Time","_TOOLBOX_":"Toolbox","_TOP_PIC_BOUND_":"Top Picture Boundary (pixels)","_TYPE_":"Type","_UART_PORT_":"UART Port","_UDP_CLIENT_":"UDP Client","_UDP_SERVER_":"UDP Server","_UNLOCK_USER_":"Unlock User","_UPDATE_LBL_":"Update","_UPDATING_DATA_":"Updating Data","_UPGRADE_MNGMNT_":"Upgrade\/Backup","_UPLO_DONE_":"Already Uploaded","_UPLO_IN_PROGRESS_":"Uploading","_UPLOA2MODULE_":"Upload to Module","_UPLOAD_PACKAGE_":"Upload Package","_UPPER_SENSOR_":"Upper Sensor","_USER_":"User","_USER_LOGIN_":"User Login","_USERS_MNGMT_":"Users Management","_VERSION_":"Version","_VIDEO_ENCODER_":"Video","_VIDEO_FILE_HAS_DOWNLOADED_":"Video File has been Downloaded","_WDEV_DET_WIZ0_":"Device Type","_WDEV_DET_WIZ1_":"Instalation Type","_WDEV_DET_WIZ2_":"Environment","_WDEV_DET_WIZ3_":"Something Else","_WDEV_DET_WIZT_":"Sensor Setup Detection Wizard","_WDEV_MISTMATCH_":"Device Is Different","_WIDTH_":"Width","_WIDTH_CORRECT_":"Width Correction","_WORKING_MODE_":"Working Mode","_WRO_VAL_MSG_":"You Entered Wrong Values
Please Correct and Continue.","_WRO_VALUES_":"Wrong Values","_ZL_MEDIA_DESC_LOO_":"Support multiple protocols (RTSP\/RTMP\/HLS\/HTTP-FLV\/WebSocket-FLV\/GB28181\/HTTP-TS\/WebSocket-TS\/HTTP-fMP4\/WebSocket-fMP4\/MP4\/WebRTC), support protocol interconversion.","_ZL_MEDIA_DESC_SHO_":"ZLMediaKit Server - Streaming Encoder","05b048d7242cb7b8b57cfa3b1d65ecea":"Gamma","0737d367234baa9eb0d7d93044d4cdcb":"AGC","0e6ebfbce4a1d380a356f7d0ca501db2":"Zoom Frame","1f9d92d5edaba165f934540a3525112a":"Tilt Frame","20e57f32ba12b9cd13ebe9ef5e32d949":"Invert","210ab9e731c9c36c2c38db15c28a8d1c":"Volume","3a5769e56038d8308b08f8741077d943":"Odd Field Offset","3b2d7435a9d67b3630988c398af85da5":"Sharpness","442348a3a2d4dc460bf2e86b1e97bd71":"Power Line","4cf296191801ec357d2aa0ad3a484cba":"Manual WB","5f458c0f2db08c33596b0e7a8dbc0e5b":"Manual Exp.","71a6b6f094346a8832df801c8428ea06":"Hue","885cd2552e1136cfd94ae863668e8942":"Even Field Offset","aa71a2ef3fb13c2642ea72645a698cb8":"Brightness","AUTO_DRAW":"Automatic Draw","b4e67baf7b29f6474d4ac44008dafed4":"BL Compensation","b914f4cdf61e27d144e5ceef61eec7a2":"Automute","bba4e31fa5d5b2fee356b87111a52aa3":"Horizontal Flip","c8fd07f040a8f2dc85f5b2d3804ea3db":"Contrast","cc0d5ee2cdb80bf82426e9def9f9bf7c":"Pan Frame","def9cbe59ce34853e7081f62b095e348":"Mute","ed063c64d46ede5916894e6ac2ab9ce1":"Auto WB","Error_Message":"Error Message","ETHERNET_PROP":"Ethernet","facdbb51cba54d1eccbdd8bd670e7b33":"Auto Exp.","fb520ff39848b91b70496ecf6c67f68e":"Compression Quality","fd71ed58ae07cc75900a5169e6f9c287":"Saturation","FILTER_AFP":"Authorised Persons Filter","FILTER_TRAIN":"Train Target Filter","FRAMEGRAB_PROP":"Analog Video","MOD_TYPE":"Module Type","MODE_ACCESS_POINT":"Access Point","MODE_DISABLED":"Disabled","MODE_ETHDYNAMIC":"Dynamic Address (DHCP)","MODE_ETHROUTER":"Static Address Router","MODE_ETHSTATIC":"Static Address","MODULE_DCBUSB":"USB Dry Contact Control Module","MODULE_EMB_VIDO":"Internal Video Encoder","MODULE_FLYHUNT":"FlyHunter Drone Control","MODULE_GPS":"GPS Time Sync Module","MODULE_KAFKA":"Kafka Data Proxy","MODULE_MODEM_MAN":"Modem Manager","MODULE_NETWORK":"Network Module [TBD]","MODULE_ONVIF_DIS":"OnVif Discovery","MODULE_SSDP":"Network Announcer","MODULE_ZLMEDIA":"ZLMedia Server","SENS_NAME":"Sensor's Name","SENS_RANGE":"Sensor Range","SENS_TYPE":"Sensor's Type","SERV_BLD_TAG":"Build Tag","SERV_NAME":"Server Name","SETIAL_TAG":"Serial Tag","SRV_STATUS_OFF":"Server is Offline","SRV_STATUS_ON":"Server is Online","SYS_MSG_DEVINV":"The Connected Device is Different from","SYS_SERVNAME":"Argus Server","UART_COM_BITS":"Bits","UART_COM_PARITY":"Parity","UART_COM_SBITS":"Stop Bits","UART_COM_SPEED":"Com Speed","UART_LINE_PROP":"UART","VIRTUALIP_PROP":"Virtual IP","VPN_TUN_PROP":"VPN Tunel","WAN_LINE_PROP":"WAN Connection","WIFI_PROP":"WiFi","_EVT_MSG_TF_OM_DIS_":"Disabled by AUX Module","_EVT_MSG_TF_OM_TD_":"AUX Module: Detects Train","_EVT_MSG_TF_OM_TG_":"AUX Module: Train is Gone","_EVT_MSG_TF_OM_EXPIRED_":"AUX Detection Expired","_SENS_DO_FULLDRAW_":"Request Full Draw","_REMOTE_SERVER_ADDRESS_":"Remote Server IPv4","_REMOTE_SERVER_PORT_":"Remote Server Port","_USE_REMOTE_SERVER_":"Use Remote Server","_SKIP_LOCAL_REPORTS_":"Skip Local Reports","_CAM_PTZ_MODE_":"PTZ Mode","_CAM_IR_ECO_":"IR Economode","_CAM_PRES_EDIT_":"Edit Presets","_CAM_PRES_EDITOR_":"Preset Editor","_CAM_PRES_SSELECT_":"Selected Sensor","_CAM_PRES_LOBACK_":"Load Background","_CAM_PRES_DELALL_":"Delete All Presets","_CAM_PRES_COUNT_":"Presets Count","_CAM_PRES_COLS_":"Presets Columns","_CAM_PRES_ROWS_":"Presets Rows","_CAM_PRES_IROFF_":"IR Off Preset","_CAM_PRES_IRON_":"IR ON Preset","_CAM_PRES_IRAUTO_":"IR Auto Preset","_CAM_PRES_IRWIPER_":"Wiper Preset","__SET__":"Set","_CAM_PRES_REMBG_":"Remove Sensor Draw","_CAM_PREF_ONLY_":"Only Targets from Bound Sensor","_SENS_BOCAM_":"Bind to Camera","_CHANGE_CREDENTIALS_":"Change Credebtials","_CONNECTION_":"Connection"}
\ No newline at end of file
diff --git a/lib/controller/addMap.php b/lib/controller/addMap.php
index 3f35504..4553c85 100644
--- a/lib/controller/addMap.php
+++ b/lib/controller/addMap.php
@@ -38,71 +38,75 @@
copy( $_FILES['map_image']['tmp_name'], $filePath . '/' . $FNAME );
@unlink( $_FILES['map_image']['tmp_name'] );
list( $width, $height, $type, $attr ) = getimagesize( $filePath . '/' . $FNAME );
- $ENAME = $DATABASE->escape($_POST['map_name']);
- $EDESC = $DATABASE->escape($_POST['map_desc']);
- $EATTR = $DATABASE->escape($_POST['map_attr']);
- $TB = intval( $_POST['map_tpb'] );
- $LB = intval( $_POST['map_lpb'] );
- $RB = intval( $_POST['map_rpb'] );
- $BB = intval( $_POST['map_bpb'] );
- $CSYS = 2 + intval( $_POST['map_corsys'] );
- if( $CSYS == 2 ){
- $INZOOM = intval( $_POST['map_maxnz'] );
- $IZOOM = intval( $_POST['map_maxz'] );
- $MA_WI = floatval( $_POST['map_width'] );
- $MA_HE = floatval( $_POST['map_height'] );
- $BM = intval( $_POST['bounds_mode'] );
- $K_X = $MA_WI / ( $width - $LB - $RB );
- $K_Y = $MA_HE / ( $height - $TB - $BB );
- if( $BM ){
- $THW = (($width + $RB + $LB) * $K_X ) / 2.0;
- $THH = (($height + $BB + $TB) * $K_Y ) / 2.0;
- $IBLX = -$THW;
- $IBLY = -$THH;
- $IBRX = $THW;
- $IBRY = $THH;
+ if( $width > 1000 && $height > 1000 ){
+ $ENAME = $DATABASE->escape($_POST['map_name']);
+ $EDESC = $DATABASE->escape($_POST['map_desc']);
+ $EATTR = $DATABASE->escape($_POST['map_attr']);
+ $TB = intval( $_POST['map_tpb'] );
+ $LB = intval( $_POST['map_lpb'] );
+ $RB = intval( $_POST['map_rpb'] );
+ $BB = intval( $_POST['map_bpb'] );
+ $CSYS = 2 + intval( $_POST['map_corsys'] );
+ if( $CSYS == 2 ){
+ $INZOOM = intval( $_POST['map_maxnz'] );
+ $IZOOM = intval( $_POST['map_maxz'] );
+ $MA_WI = floatval( $_POST['map_width'] );
+ $MA_HE = floatval( $_POST['map_height'] );
+ $BM = intval( $_POST['bounds_mode'] );
+ $K_X = $MA_WI / ( $width - $LB - $RB );
+ $K_Y = $MA_HE / ( $height - $TB - $BB );
+ if( $BM ){
+ $THW = (($width + $RB + $LB) * $K_X ) / 2.0;
+ $THH = (($height + $BB + $TB) * $K_Y ) / 2.0;
+ $IBLX = -$THW;
+ $IBLY = -$THH;
+ $IBRX = $THW;
+ $IBRY = $THH;
+ } else {
+ $IBLX = (-$LB)*$K_X;
+ $IBLY = (-$TB)*$K_Y;
+ $IBRX = ( $width + $RB ) * $K_X;
+ $IBRY = ( $height + $BB ) * $K_Y;
+ };
} else {
- $IBLX = (-$LB)*$K_X;
- $IBLY = (-$TB)*$K_Y;
- $IBRX = ( $width + $RB ) * $K_X;
- $IBRY = ( $height + $BB ) * $K_Y;
- };
- } else {
- $BM = 0;
- $LTLAT = floatval( $_POST['map_lcclat'] );
- $LTLON = floatval( $_POST['map_lcclon'] );
- $RBLAT = floatval( $_POST['map_rcclat'] );
- $RBLON = floatval( $_POST['map_rcclon'] );
- if( $TB+$LB+$RB+$BB ){
- $KX = ( $RBLON - $LTLON )/( $width - $LB - $RB );
- $KY = ( $RBLAT - $LTLAT )/( $height - $TB - $BB );
- $LTLON = $LTLON - $KX * $LB;
- $LTLAT = $LTLAT + $KY * $TB;
- $RBLON = $RBLON + $KX * $RB;
- $RBLAT = $RBLAT - $KY * $BB;
- };
- $INZOOM = intval( $_POST['map_maxnz'] );
- $IZOOM = intval( $_POST['map_maxz'] );
- $IBLX = $LTLON;
- $IBLY = $LTLAT;
- $IBRX = $RBLON;
- $IBRY = $RBLAT;
- $MA_WI = $IBRX - $IBLX;
- $MA_HE = $IBLY - $IBRY;
- // zoom 180.0 --> 0
- $SANV = 360.0;
- for( $i = 0; $i< 32; $i++ ){
- $CANV = $SANV /(1<< $i);
- if( $CANV < $MA_WI ){
- $INZOOM = $i+5;
- $IZOOM = $INZOOM;
- break;
+ $BM = 0;
+ $LTLAT = floatval( $_POST['map_lcclat'] );
+ $LTLON = floatval( $_POST['map_lcclon'] );
+ $RBLAT = floatval( $_POST['map_rcclat'] );
+ $RBLON = floatval( $_POST['map_rcclon'] );
+ if( $TB+$LB+$RB+$BB ){
+ $KX = ( $RBLON - $LTLON )/( $width - $LB - $RB );
+ $KY = ( $RBLAT - $LTLAT )/( $height - $TB - $BB );
+ $LTLON = $LTLON - $KX * $LB;
+ $LTLAT = $LTLAT + $KY * $TB;
+ $RBLON = $RBLON + $KX * $RB;
+ $RBLAT = $RBLAT - $KY * $BB;
+ };
+ $INZOOM = intval( $_POST['map_maxnz'] );
+ $IZOOM = intval( $_POST['map_maxz'] );
+ $IBLX = $LTLON;
+ $IBLY = $LTLAT;
+ $IBRX = $RBLON;
+ $IBRY = $RBLAT;
+ $MA_WI = $IBRX - $IBLX;
+ $MA_HE = $IBLY - $IBRY;
+ // zoom 180.0 --> 0
+ $SANV = 360.0;
+ for( $i = 0; $i< 32; $i++ ){
+ $CANV = $SANV /(1<< $i);
+ if( $CANV < $MA_WI ){
+ $INZOOM = $i+5;
+ $IZOOM = $INZOOM;
+ break;
+ };
};
};
+ $QS = "INSERT INTO `location_maps`(`type`,`name`,`layer_url`,`desc`,`maxNativeZoom`,`maxZoom`,`attribution`,`bounds_lx`,`bounds_ly`,`bounds_rx`,`bounds_ry`,`bounds_mode`,`img_w`,`img_h`,`img_map_w`,`img_map_h`,`img_lb`,`img_tb`,`img_rb`,`img_bb`) values({$CSYS},'{$ENAME}','{$FNAME}','{$EDESC}',{$INZOOM},{$IZOOM},'{$EATTR}',{$IBLX},{$IBLY},{$IBRX},{$IBRY},{$BM},{$width},{$height},{$MA_WI},{$MA_HE},{$LB},{$TB},{$RB},{$BB})";
+ $DATABASE->Query( $QS );
+ verbose( 1, "ALL IS OK" );
+ } else {
+ verbose( 0, 'Image is too Small!' );
};
- $QS = "INSERT INTO `location_maps`(`type`,`name`,`layer_url`,`desc`,`maxNativeZoom`,`maxZoom`,`attribution`,`bounds_lx`,`bounds_ly`,`bounds_rx`,`bounds_ry`,`bounds_mode`,`img_w`,`img_h`,`img_map_w`,`img_map_h`,`img_lb`,`img_tb`,`img_rb`,`img_bb`) values({$CSYS},'{$ENAME}','{$FNAME}','{$EDESC}',{$INZOOM},{$IZOOM},'{$EATTR}',{$IBLX},{$IBLY},{$IBRX},{$IBRY},{$BM},{$width},{$height},{$MA_WI},{$MA_HE},{$LB},{$TB},{$RB},{$BB})";
- $DATABASE->Query( $QS );
- verbose( 1, "ALL IS OK" );
};
};
} else {
diff --git a/lib/controller/addPhoneBookRecord.php b/lib/controller/addPhoneBookRecord.php
index 8577ac6..54fda5e 100644
--- a/lib/controller/addPhoneBookRecord.php
+++ b/lib/controller/addPhoneBookRecord.php
@@ -23,9 +23,9 @@
$NL = 'New Number';
};
if( $CO ){
- $QS = "INSERT INTO `module_modem_phonebook`(`number`,`call_only`,`label`) VALUES('{$NN}',1,'{$NL}')";
+ $QS = "INSERT INTO `module_modem_phonebook`(`number`,`mode`,`label`) VALUES('{$NN}',1,'{$NL}')";
} else {
- $QS = "INSERT INTO `module_modem_phonebook`(`number`,`call_only`,`label`,`custom_msg`) VALUES('{$NN}', 0,'{$NL}','{$CMS}')";
+ $QS = "INSERT INTO `module_modem_phonebook`(`number`,`mode`,`label`,`custom_msg`) VALUES('{$NN}', 0,'{$NL}','{$CMS}')";
};
$DATABASE->Query( $QS );
$Data['success'] = true;
diff --git a/lib/controller/delPhoneBookRecord.php b/lib/controller/delPhoneBookRecord.php
new file mode 100644
index 0000000..54fda5e
--- /dev/null
+++ b/lib/controller/delPhoneBookRecord.php
@@ -0,0 +1,42 @@
+Data['id'] > 1 ){
+ $Data['success'] = false;
+ if( $CUser->Data['access'] > 5 ){
+ $NL = trim( $_POST['PNAM'] );
+ $NN = str_ireplace('+','',
+ str_ireplace('-','',
+ str_ireplace( ' ', '', $_POST['PNUM']
+ )
+ )
+ );
+ $CO = intval( $_POST['PCAL'] );
+ if( $CO == 0 ){
+ $CMS = $DATABASE->escape( $_POST['PMSG'] );
+ };
+ if( strlen( $NN ) > 7 ) {
+ if( substr( $NN, 1 ) == '0' ){
+ } else {
+ };
+ if( strlen( $NL ) == 0 ){
+ $NL = 'New Number';
+ };
+ if( $CO ){
+ $QS = "INSERT INTO `module_modem_phonebook`(`number`,`mode`,`label`) VALUES('{$NN}',1,'{$NL}')";
+ } else {
+ $QS = "INSERT INTO `module_modem_phonebook`(`number`,`mode`,`label`,`custom_msg`) VALUES('{$NN}', 0,'{$NL}','{$CMS}')";
+ };
+ $DATABASE->Query( $QS );
+ $Data['success'] = true;
+ } else {
+ $Data['msg'] = 'Number is Invalid!';
+ };
+ } else {
+ $Data['msg'] = 'Access Denied!';
+ };
+ echo json_encode( $Data );
+ exit();
+ };
+ header( 'location: /');
+?>
\ No newline at end of file
diff --git a/lib/controller/doCameraOperation.php b/lib/controller/doCameraOperation.php
index cdf63f1..680df66 100644
--- a/lib/controller/doCameraOperation.php
+++ b/lib/controller/doCameraOperation.php
@@ -16,7 +16,8 @@
break;
};
case 1:{
- // List Registered Cameras
+ //
+
break;
};
case 2:{
@@ -104,7 +105,7 @@
if( stripos($TBrr[0],'hardware') !== false ) $CH = $DATABASE->escape(urldecode($TBrr[1]));
if( stripos($TBrr[0],'mac') !== false ) $CM = $DATABASE->escape(urldecode($TBrr[1]));
};
- $QS = "INSERT INTO `cameras`(hardware,name,uuid,mac,ip,status,onvif_ctrl,online,manual) VALUES('{$CH}','{$CN}','{$CA}','{$CM}','{$CI}',0,'{$CP}',1,1) ON CONFLICT( uuid ) DO UPDATE SET ip='{$CI}', online=1";
+ $QS = "INSERT INTO `cameras`(hardware,type,name,uuid,mac,ip,status,onvif_ctrl,online,manual) VALUES('{$CH}',13,'{$CN}','{$CA}','{$CM}','{$CI}',0,'{$CP}',1,1) ON CONFLICT( uuid ) DO UPDATE SET ip='{$CI}', online=1";
$DATABASE->Query($QS,false);
$CameraID = $DATABASE->getLastInsertID();
if( $CameraID == 0 ){
@@ -119,58 +120,76 @@
$onvif->setUsername( $EUser );
$onvif->setPassword( $EPass );
$onvif->setAuthMethod( $AUTH );
+ $CI = $IP;
+ $CameraID = 0;
try {
$onvif->initialize();
- if ( !$onvif->isFault($devices=$onvif->getSources())){
- $Data['ss'] .='No Fault';
- foreach( $devices[0] as $source ) if( is_array( $source ) ){
- //print_r( $source );
- $Ename = $DATABASE->escape( $source['profilename']);
- $Etoken = $DATABASE->escape( $source['profiletoken']);
- $Eencode = $DATABASE->escape( $source['encoding']);
- $Ewidth = intval($source['width']);
- $Eheight = intval($source['height']);
- $Efps = intval($source['fps']);
- $Ebitrate = intval($source['bitrate']);
- if( isset( $source['ptz'] ) ){
- $Eptz = $DATABASE->escape( $source['ptz']['nodetoken'] );
- } else {
- $Eptz='';
- };
- $mrl = $onvif->media_GetStreamUri($source['profiletoken']);
- $pic = $onvif->media_GetSnapshotUri($source['profiletoken']);
- $TPArr = explode(':',$mrl);
- $mrl_proto = $TPArr[0];
- $mrl_port = intval( $TPArr[2] );
- if( $mrl_port == 0 ) {
- switch( $mrl_proto ){
- case 'rtsp': $mrl_port = 554; break;
- case 'http': $mrl_port = 80; break;
- case 'https': $mrl_port = 443; break;
+ if ( !$onvif->isFault($info=$onvif->core_GetDeviceInformation())){
+ //Adding Camera
+ $CH = $info['Manufacturer'].'_'.$info['Model'];
+ $CN = $info['Manufacturer'].'_CAM'.$info['HardwareId'];
+ $CA = $info['SerialNumber'];
+ $CM = $info['SerialNumber'];
+ $CP = $onvif->getDeviceUri();
+ $QS = "INSERT INTO `cameras`(hardware,type,name,uuid,mac,ip,status,onvif_ctrl,online,manual) VALUES('{$CH}',13,'{$CN}','{$CA}','{$CM}','{$CI}',0,'{$CP}',1,1) ON CONFLICT( uuid ) DO UPDATE SET ip='{$CI}', online=1";
+ $DATABASE->Query($QS,false);
+ $CameraID = $DATABASE->getLastInsertID();
+ };
+ if( $CameraID ){
+ if ( !$onvif->isFault($devices=$onvif->getSources()) ){
+ $Data['ss'] .='No Fault';
+ foreach( $devices[0] as $source ) if( is_array( $source ) ){
+ //print_r( $source );
+ $Ename = $DATABASE->escape( $source['profilename']);
+ $Etoken = $DATABASE->escape( $source['profiletoken']);
+ $Eencode = $DATABASE->escape( $source['encoding']);
+ $Ewidth = intval($source['width']);
+ $Eheight = intval($source['height']);
+ $Efps = intval($source['fps']);
+ $Ebitrate = intval($source['bitrate']);
+ if( isset( $source['ptz'] ) ){
+ $Eptz = $DATABASE->escape( $source['ptz']['nodetoken'] );
+ } else {
+ $Eptz='';
+ };
+ $mrl = $onvif->media_GetStreamUri($source['profiletoken']);
+ $pic = $onvif->media_GetSnapshotUri($source['profiletoken']);
+ $TPArr = explode(':',$mrl);
+ $mrl_proto = $TPArr[0];
+ $mrl_port = intval( $TPArr[2] );
+ if( $mrl_port == 0 ) {
+ switch( $mrl_proto ){
+ case 'rtsp': $mrl_port = 554; break;
+ case 'http': $mrl_port = 80; break;
+ case 'https': $mrl_port = 443; break;
+ };
};
+ $Emrl = $DATABASE->escape( $mrl );
+ $Emrl = str_replace( $mrl_proto . '://' . $IP . ':' . $mrl_port, '', $Emrl );
+ $Emrl = str_replace( $mrl_proto . '://' . $IP, '', $Emrl );
+ $TPArr = explode(':',$pic );
+ $pic_proto = $TPArr[0];
+ if( count( $TPArr[0] ) > 2 ){
+ $pic_port = intval( $TPArr[2] );
+ if($pic_port == 0 ) $pic_port = 80;
+ } else $pic_port = 80;
+ $Epic = $DATABASE->escape( $pic );
+ $Epic = str_replace( $pic_proto . '://' . $IP . ':' . $pic_port, '', $Epic );
+ $Epic = str_replace( $pic_proto . '://' . $IP , '', $Epic );
+ $QS = "INSERT INTO `media_streams`(`source_id`,`source_type`,`valid`,`name`,`token`,`img_width`,`img_height`,`compression_type`,`bitrate`,`fps`,`mrl`,`mrl_proto`,`mrl_port`,`picture_proto`,`picture_port`,`picture`) VALUES({$CameraID},'D',1,'{$Ename}','{$Etoken}',{$Ewidth},{$Eheight},'{$Eencode}',{$Ebitrate},{$Efps},'{$Emrl}','{$mrl_proto}','{$mrl_port}','{$pic_proto}','{$pic_port}','{$Epic}') ON CONFLICT(`source_id`,`token`) DO UPDATE SET `source_type`='D', `valid`=1, `mrl`='{$Emrl}', `mrl_proto`='{$mrl_proto}', `mrl_port`='{$mrl_port}', `picture_proto`='{$pic_proto}', `picture_port`='{$pic_port}', `picture`='{$Epic}'";
+ $Data['ss'] .='Added';
+ $Data['QS'] = $QS;
+ $DATABASE->Query( $QS, false );
+ $Data['ss'] .='After DBQ';
};
- $Emrl = $DATABASE->escape( $mrl );
- $Emrl = str_replace( $mrl_proto . '://' . $IP . ':' . $mrl_port, '', $Emrl );
- $Emrl = str_replace( $mrl_proto . '://' . $IP, '', $Emrl );
- $TPArr = explode(':',$pic );
- $pic_proto = $TPArr[0];
- if( count( $TPArr[0] ) > 2 ){
- $pic_port = intval( $TPArr[2] );
- if($pic_port == 0 ) $pic_port = 80;
- } else $pic_port = 80;
- $Epic = $DATABASE->escape( $pic );
- $Epic = str_replace( $pic_proto . '://' . $IP . ':' . $pic_port, '', $Epic );
- $Epic = str_replace( $pic_proto . '://' . $IP , '', $Epic );
- $QS = "INSERT INTO `media_streams`(`source_id`,`source_type`,`valid`,`name`,`token`,`img_width`,`img_height`,`compression_type`,`bitrate`,`fps`,`mrl`,`mrl_proto`,`mrl_port`,`picture_proto`,`picture_port`,`picture`) VALUES({$CameraID},'D',1,'{$Ename}','{$Etoken}',{$Ewidth},{$Eheight},'{$Eencode}',{$Ebitrate},{$Efps},'{$Emrl}','{$mrl_proto}','{$mrl_port}','{$pic_proto}','{$pic_port}','{$Epic}') ON CONFLICT(`source_id`,`token`) DO UPDATE SET `source_type`='D', `valid`=1, `mrl`='{$Emrl}', `mrl_proto`='{$mrl_proto}', `mrl_port`='{$mrl_port}', `picture_proto`='{$pic_proto}', `picture_port`='{$pic_port}', `picture`='{$Epic}'";
- $Data['ss'] .='Added';
- $Data['QS'] = $QS;
+ $QS = "UPDATE cameras SET access_login='$EUser', access_pass='$EPass', auth_mode={$AUTH}, ptz_token='{$Eptz}', `status`=1 WHERE id={$CameraID}";
$DATABASE->Query( $QS, false );
- $Data['ss'] .='After DBQ';
+ $Data['status'] = 'ok';
+ } else {
+ $Data['msg'] = 'Camera was added.
However provided Credentials are Wrong! ['.$EUser.']:['.$EPass.']';
};
- $QS = "UPDATE cameras SET access_login='$EUser', access_pass='$EPass', auth_mode={$AUTH}, ptz_token='{$Eptz}', `status`=1 WHERE id={$CameraID}";
- $DATABASE->Query( $QS, false );
- } else {
- $Data['msg'] = 'Camera was added.
However provided Credentials are Wrong! ['.$EUser.']:['.$EPass.']';
+ } else {
+ $Data['msg'] = 'No Camera was added.
';
};
} catch( Exception $e ){
$Data['msg'] = 'Provided Credentials are Wrong! ['.$EUser.']:['.$EPass.']';
@@ -244,7 +263,35 @@
break;
};
case 4:{
- // Add Onvif Camera Manually (After 2 - checkup )
+ // change IP/Credentials
+ if( $CameraID ){
+ $QS ="SELECT * FROM `cameras` WHERE `id`={$CameraID}";
+ $JJ = $DATABASE->Query( $QS );
+ if( count( $JJ ) ){
+ $CC = $JJ[0];
+ $PA = explode( '/', $CC['onvif_ctrl'] );
+ $EUser = $DATABASE->escape( $_POST['UU'] );
+ $EPass = $DATABASE->escape( $_POST['PP'] );
+ $EIP = $DATABASE->escape( $_POST['UI'] );
+ $PA[2] = $EIP;
+ $OVC = implode('/',$PA);
+ $AUTH = intval( $_POST['AU'] );
+ $TAr = explode( ':', $EIP );
+ if( count( $TAr ) > 1 ){
+ $EIP = $TAr[0];
+ $POR = intval($TAr[1]);
+ $QS = "UPDATE cameras SET access_login='$EUser', access_pass='$EPass', auth_mode={$AUTH},`ip`='{$EIP}',port={$POR}, onvif_ctrl='{$OVC}' WHERE id={$CameraID}";
+ } else {
+ $QS = "UPDATE cameras SET access_login='$EUser', access_pass='$EPass', auth_mode={$AUTH},`ip`='{$EIP}', port=NULL, onvif_ctrl='{$OVC}' WHERE id={$CameraID}";
+ };
+ $DATABASE->Query( $QS, false );
+ $Data['status'] = 'ok';
+ } else {
+ $Data['msg'] = 'Wrong Camera
Please consider run network discovery.
To refresh all aveable cameras.
';
+ };
+ } else {
+ $Data['msg'] = 'Wrong Camera
Please consider run network discovery.
To refresh all aveable cameras.
';
+ };
break;
};
case 5:{
@@ -416,7 +463,7 @@
if( count( $JJ ) ){
$CC = $JJ[0];
if( $CC['status'] == 3 ){
- $QS = "UPDATE `nodes` SET `aux_param`={$Param} WHERE `aux_id`={$CameraID} AND `type` IN(10,11,12,13,14,15)";
+ $QS = "UPDATE `nodes` SET `aux_parameter`={$Param} WHERE `aux_id`={$CameraID} AND `type` IN(10,11,12,13,14,15)";
$DATABASE->Query( $QS );
};
$QS = "UPDATE `cameras` SET `stream_id`={$Param} WHERE `id`={$CameraID}";
diff --git a/lib/controller/doModuleOperation.php b/lib/controller/doModuleOperation.php
index fe53df1..3a4a200 100644
--- a/lib/controller/doModuleOperation.php
+++ b/lib/controller/doModuleOperation.php
@@ -65,6 +65,15 @@
case 2: $QS = "UPDATE `modules` SET `enabled`={$OPCODE} WHERE `id`={$MID}"; break;
case 3: if( $OPCODE ) $QS = "UPDATE `module_eve` SET `output_mode`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break;
case 4: $QS = "UPDATE `module_modem` SET `modem_id`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break;
+ case 5: {
+ if( $OPCODE == 2 ){
+ $QS = "UPDATE `module_modem` SET `call_enabled`=1, `sms_enabled`=0 WHERE `id`={$JJ['aux_id']}";
+ } else {
+ $QS = "UPDATE `module_modem` SET `call_enabled`=0, `sms_enabled`=1 WHERE `id`={$JJ['aux_id']}";
+ };
+ break;
+ };
+ case 6: $QS = "UPDATE `module_modem` SET `call_hangup_wait`={$OPCODE} WHERE `id`={$JJ['aux_id']}"; break;
};
};
if( $QS != '' ) $DATABASE->Query( $QS );
diff --git a/lib/controller/downloadVideo.php b/lib/controller/downloadVideo.php
index 42b5583..f78779a 100644
--- a/lib/controller/downloadVideo.php
+++ b/lib/controller/downloadVideo.php
@@ -18,7 +18,7 @@
$SRC = 'data/reports/' . date("Y/m/d", $DTS ) . '/'. $MD5. '.mjpeg';
$FPS = intval( $_POST['FPS'] );
if( file_exists( $SRC ) ){
- //$DST = '../tmp/' . md5_file( $SRC ) . '.mp4';
+ //$DST = '../tmp/' . $MD5 . '.mp4';
$DST = '../tmp/' . $MD5 . '.avi';
//echo $SRC . "->" . $DST . "\n\n"; exit();
//$COM = "ffmpeg -hide_banner -loglevel error -y -r {$FPS} -i {$SRC} -pix_fmt yuvj420p -b:v 4000k -c:v libx264 {$DST} 2>&1";
@@ -27,7 +27,8 @@
$JUJA = `$COM`;
if( file_exists( $DST ) ){
//header( 'location: /lib/tmp/' . $MD5 . '.mp4' );
- echo '/lib/tmp/' . $MD5 . '.mp4';
+ echo '/lib/tmp/' . $MD5 . '.avi';
+ //echo '/lib/tmp/' . $MD5 . '.mp4';
//output_dummy( $DST );
//unlink( $DST );
} else //output_dummy( '../../style/assets/nosignal.mp4' );
diff --git a/lib/controller/getCameraEditor.php b/lib/controller/getCameraEditor.php
index 08b0847..f9b96ce 100644
--- a/lib/controller/getCameraEditor.php
+++ b/lib/controller/getCameraEditor.php
@@ -35,6 +35,7 @@
$CLS = "camera_generic_set";
};
};
+ if( intval($Cam['port'] ) ) $Cam['ip'] = $Cam['ip'] . ':' . $Cam['port'];
$QS = "SELECT * FROM media_streams WHERE source_id={$CID}";
$Result = $DATABASE->Query($QS,false);
$SELECTED_STREAM = 0;
@@ -90,8 +91,112 @@
,{
xtype: 'button',
width: '100%',
- text: '{$Labels->GetLabel('_RSET_CREDENTIALS_')}',
+ text: '{$Labels->GetLabel('_CHANGE_CREDENTIALS_')}/{$Labels->GetLabel('_CONNECTION_')}',
handler: function(){
+ var RCC_Window = new Ext.Window({
+ title: '{$Labels->GetLabel('_CHANGE_CREDENTIALS_')}/{$Labels->GetLabel('_CONNECTION_')}',
+ width: 500,
+ height: 400,
+ modal: true,
+ layout: 'form',
+ labelWidth: 150,
+ labelAlign: 'right',
+ items:[{
+ xtype: 'textfield',
+ id: 'am_ip_addr',
+ fieldLabel: '{$Labels->GetLabel('_CAM_IP_ADDRESS_')}',
+ width: '100%',
+ value: '{$Cam['ip']}'
+ },{
+ xtype: 'textfield',
+ id: 'am_login',
+ fieldLabel: '{$Labels->GetLabel('_ACCESS_LOGIN_')}',
+ width: '100%',
+ value: '{$Cam['access_login']}'
+ },{
+ xtype: 'textfield',
+ id: 'am_password',
+ fieldLabel: '{$Labels->GetLabel('_ACCESS_PASSWORD_')}',
+ width: '100%',
+ value: '{$Cam['access_pass']}'
+ },{
+ xtype: 'combo',
+ id: 'am_auth_mode',
+ fieldLabel: '{$Labels->GetLabel('_AUTH_MODE_0_')}',
+ lazyRender: true,
+ mode: 'local',
+ forceSelection: true,
+ triggerAction: 'all',
+ editable: false,
+ disableKeyFilter: true,
+ store: new Ext.data.ArrayStore({
+ fields: ['mode','mode_txt'],
+ data: [
+ [0,'BASIC'],
+ [1,'DIGEST'],
+ [2,'DIGEST_IE'],
+ [3,'BEARER'],
+ [4,'NEGOTIATE'],
+ [5,'NTLM'],
+ [6,'NTLM_WB'],
+ [7,'ANY'],
+ [8,'ANYSAFE'],
+ [9,'ONLY'],
+ [10,'AWS_SIGV4']
+ ]
+ }),
+ valueField: 'mode',
+ displayField: 'mode_txt',
+ value: '{$Cam['auth_mode']}',
+ width: 200
+ },{
+ xtype: 'button',
+ text: 'Apply',
+ width: '100%',
+ handler: function(){
+ var NIP = Ext.getCmp('am_ip_addr').getValue();
+ var NUU = Ext.getCmp('am_login').getValue();
+ var NPP = Ext.getCmp('am_password').getValue();
+ var NAM = Ext.getCmp('am_auth_mode').getValue();
+ Ext.Ajax.request({
+ url: '/lib/controller/doCameraOperation.php',
+ params: {
+ UID: {$UserID},
+ SID: '{$Session}',
+ CID: {$CID},
+ UI: NIP,
+ UU: NUU,
+ PP: NPP,
+ AU: NAM,
+ CMD: 4
+ },
+ success: function( response, opts ){
+ RCC_Window.destroy();
+ var data = Ext.decode(response.responseText);
+ if( data.status == 'ok' ){
+ loadDetectedCameras();
+ } else {
+ Ext.Msg.show({
+ title:'Error!',
+ msg: data.msg,
+ buttons: Ext.Msg.OK,
+ icon: Ext.MessageBox.WARNING
+ });
+ };
+ },
+ failure: failureAJAXFunction
+ });
+ }
+ },{
+ xtype: 'button',
+ text: 'Cancel',
+ width: '100%',
+ handler: function(){
+ RCC_Window.destroy();
+ }
+ }]
+ });
+ RCC_Window.show();
}
}
kskjhiiuwye;
@@ -132,7 +237,7 @@ kskjhiiuwye;
}
hzzhoiuyhetrkh;
} else {
- $RESET_CREDENTIALS='';
+ //$RESET_CREDENTIALS='';
$ADD_CAMERA=<<Query( $QS );
if( count( $RV ) ){
- $DATA = $RV;
+ $Data = $RV;
};
echo json_encode( $Data );
exit();
diff --git a/lib/controller/getStatus.php b/lib/controller/getStatus.php
index 34a1fa2..70de8e7 100644
--- a/lib/controller/getStatus.php
+++ b/lib/controller/getStatus.php
@@ -48,7 +48,10 @@
$Data['log'][] = $CR;
};
};
- }
+ } else {
+ echo json_encode( $Data );
+ exit();
+ };
//$QS = "SELECT * FROM nodes ORDER BY `type`";
$QS = "SELECT * FROM nodes WHERE `type` > 0 AND `type` < 16";
$result = $DATABASE->Query( $QS, false );
diff --git a/lib/javascript/jsapi_dynamic/mojo_reports.js b/lib/javascript/jsapi_dynamic/mojo_reports.js
index 96aafc7..3b5dce1 100644
--- a/lib/javascript/jsapi_dynamic/mojo_reports.js
+++ b/lib/javascript/jsapi_dynamic/mojo_reports.js
@@ -1530,7 +1530,7 @@ function showVideos(){
function downloadCurrentVideo( stid ){
var d = new Date( videoNfo[stid][0] * 1000 );
- var videoFileDownloadTarget = d.getFullYear()+'_'+(d.getMonth()+1)+'_'+d.getDate()+'_'+d.getHours()+'-'+d.getMinutes()+'-'+d.getSeconds()+'.mp4';
+ var videoFileDownloadTarget = d.getFullYear()+'_'+(d.getMonth()+1)+'_'+d.getDate()+'_'+d.getHours()+'-'+d.getMinutes()+'-'+d.getSeconds();//+'.mp4';
// TS, MD5, FPS
downloadVideoFile( videoNfo[stid][0], videoNfo[stid][1], videoNfo[stid][2], videoFileDownloadTarget );
};
@@ -1618,7 +1618,7 @@ function downloadVideoFile( a, b, c, d ){
const a = document.createElement('a');
a.style.display = 'none';
a.href = response.responseText;
- a.download = d;
+ a.download = d + response.responseText.substring( response.responseText.lastIndexOf('.'), response.responseText.length );
document.body.appendChild(a);
a.click();
ReportMask.hide();
diff --git a/lib/javascript/jsapi_dynamic/mojo_settings.js b/lib/javascript/jsapi_dynamic/mojo_settings.js
index ef20b2f..c397d47 100644
--- a/lib/javascript/jsapi_dynamic/mojo_settings.js
+++ b/lib/javascript/jsapi_dynamic/mojo_settings.js
@@ -344,7 +344,7 @@ function loadFilters(){
});
};
-var modem_pb_store = new Ext.data.ArrayStore({
+var modem_pb_store = new Ext.data.JsonStore({
autoDestroy: false,
storeId: 'pb_store',
idIndex: 0,
@@ -352,17 +352,17 @@ var modem_pb_store = new Ext.data.ArrayStore({
{name: 'id', type: 'int' },
{name: 'number', type: 'string'},
{name: 'mode', type: 'int'},
- {name: 'trigg', type: 'int'},
+ {name: 'trig_special', type: 'int'},
{name: 'label', type: 'string'},
{name: 'custom_msg', type: 'string'}
]
});
var modem_pb_ColModel_ops = {
columns: [
- {header: "id", width: 60, fixed: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'id' },
- {header: "=$Labels->GetLabel('_SOURCE_');?>", width: 100, renderer: log_sn_Renderer, align: 'left', css: 'vertical-align: middle;', dataIndex: 'number' },
- {header: "=$Labels->GetLabel('_TYPE_');?>", width: 180, renderer: log_et_Renderer, fixed: false, align: 'center', css: 'vertical-align: middle;', dataIndex: 'mode' },
- {header: "=$Labels->GetLabel('_RANGE_');?>", width: 100, dataIndex: 'label', renderer: no_target_filter }
+ {header: "=$Labels->GetLabel('_MODE_');?>", width: 100, dataIndex: 'mode' },
+ {header: "=$Labels->GetLabel('_PHONE_NUM_');?>", width: 200, align: 'left', css: 'vertical-align: middle;', dataIndex: 'number' },
+ {header: "=$Labels->GetLabel('_LABEL_');?>", width: 200, fixed: false, align: 'center', css: 'vertical-align: middle;', dataIndex: 'label' },
+ {header: "=$Labels->GetLabel('_CUSTOM_MSG_');?>", dataIndex: 'custom_msg' }
],
defaults: {
sortable: false,
@@ -379,6 +379,7 @@ var modem_pb_SelModel_ops = {
//alert( rec.data.id );
//loadEventProperties( rec.data );
selected_pb_id = rec.data.id;
+ Ext.getCmp( 'ph_bo_de_bu' ).enable();
//alert( SelectedEvent );
//var CB = Ext.getCmp('con_to_src');
//CB.enable();
@@ -401,7 +402,9 @@ function loadPhoneBook(){
success: function( response, opts ){
var data = Ext.decode(response.responseText);
- modem_pb_store.Load( data );
+ modem_pb_store.loadData( data );
+ Ext.getCmp( 'ph_bo_de_bu' ).disable();
+ selected_pb_id = 0;
//var tPanel = Ext.getCmp('main_portal');
//tPanel.removeAll(true);
//for( i=0; i < data.length; i++) tPanel.add( data[i] );
@@ -482,6 +485,8 @@ function addNewPhoneNumber(){
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.success ){
+ loadPhoneBook();
+ addNPNWindow.hide();
} else {
Ext.Msg.show({
title:'=$Labels->GetLabel('_ERROR_');?>',
@@ -516,6 +521,12 @@ function addNewPhoneNumber(){
addNPNWindow.show();
};
+function deletePhoneNumber(){
+ if( selected_pb_id ){
+
+ };
+};
+
function loadDetectedCameras(){
Ext.Ajax.request({
url: '/lib/controller/getCameras.php',