mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-09-08 11:26:15 -04:00
IN order to allow specifying a monitor Id that has been deleted, use monitor->Id instead of mid to test for monitor existence
This commit is contained in:
1 parent
d145adf9c6
commit
7146bdd59a
1 file changed
+3
-1
@@ -78,7 +78,7 @@ if ( $action == 'monitor' ) {
|
|||||||
$restart = false;
|
$restart = false;
|
||||||
|
|
||||||
if ( count($changes) ) {
|
if ( count($changes) ) {
|
||||||
if ( $mid ) {
|
if ( $monitor->Id() ) {
|
||||||
|
|
||||||
# If we change anything that changes the shared mem size, zma can complain. So let's stop first.
|
# If we change anything that changes the shared mem size, zma can complain. So let's stop first.
|
||||||
if ( $monitor->Type() != 'WebSite' ) {
|
if ( $monitor->Type() != 'WebSite' ) {
|
||||||
@@ -203,6 +203,8 @@ if ( $action == 'monitor' ) {
|
|||||||
dbQuery("INSERT INTO Zones SET MonitorId = ?, Name = 'All', Type = 'Active', Units = 'Percent', NumCoords = 4, Coords = ?, Area=?, AlarmRGB = 0xff0000, CheckMethod = 'Blobs', MinPixelThreshold = 25, MinAlarmPixels=?, MaxAlarmPixels=?, FilterX = 3, FilterY = 3, MinFilterPixels=?, MaxFilterPixels=?, MinBlobPixels=?, MinBlobs = 1", array( $mid, sprintf( "%d,%d %d,%d %d,%d %d,%d", 0, 0, $_REQUEST['newMonitor']['Width']-1, 0, $_REQUEST['newMonitor']['Width']-1, $_REQUEST['newMonitor']['Height']-1, 0, $_REQUEST['newMonitor']['Height']-1 ), $zoneArea, intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*2)/100) ) );
|
dbQuery("INSERT INTO Zones SET MonitorId = ?, Name = 'All', Type = 'Active', Units = 'Percent', NumCoords = 4, Coords = ?, Area=?, AlarmRGB = 0xff0000, CheckMethod = 'Blobs', MinPixelThreshold = 25, MinAlarmPixels=?, MaxAlarmPixels=?, FilterX = 3, FilterY = 3, MinFilterPixels=?, MaxFilterPixels=?, MinBlobPixels=?, MinBlobs = 1", array( $mid, sprintf( "%d,%d %d,%d %d,%d %d,%d", 0, 0, $_REQUEST['newMonitor']['Width']-1, 0, $_REQUEST['newMonitor']['Width']-1, $_REQUEST['newMonitor']['Height']-1, 0, $_REQUEST['newMonitor']['Height']-1 ), $zoneArea, intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*3)/100), intval(($zoneArea*75)/100), intval(($zoneArea*2)/100) ) );
|
||||||
//$view = 'none';
|
//$view = 'none';
|
||||||
$Storage = $monitor->Storage();
|
$Storage = $monitor->Storage();
|
||||||
|
|
||||||
|
error_reporting(0);
|
||||||
mkdir($Storage->Path().'/'.$mid, 0755);
|
mkdir($Storage->Path().'/'.$mid, 0755);
|
||||||
$saferName = basename($_REQUEST['newMonitor']['Name']);
|
$saferName = basename($_REQUEST['newMonitor']['Name']);
|
||||||
symlink($mid, $Storage->Path().'/'.$saferName);
|
symlink($mid, $Storage->Path().'/'.$saferName);
|
||||||
|
|||||||
Reference in new issue
Block a user