Merge branch 'zma_to_thread' of github.com:/ConnorTechnology/ZoneMinder into zma_to_thread
This commit is contained in:
commit
4ab395b83a
|
@ -6,7 +6,6 @@ Uploaders: Vagrant Cascadian <vagrant@debian.org>
|
||||||
Build-Depends: debhelper (>= 9), dh-systemd, python-sphinx | python3-sphinx, apache2-dev, dh-linktree
|
Build-Depends: debhelper (>= 9), dh-systemd, python-sphinx | python3-sphinx, apache2-dev, dh-linktree
|
||||||
,cmake
|
,cmake
|
||||||
,libx264-dev, libmp4v2-dev
|
,libx264-dev, libmp4v2-dev
|
||||||
,libboost-dev
|
|
||||||
,libavdevice-dev (>= 6:10~)
|
,libavdevice-dev (>= 6:10~)
|
||||||
,libavcodec-dev (>= 6:10~)
|
,libavcodec-dev (>= 6:10~)
|
||||||
,libavformat-dev (>= 6:10~)
|
,libavformat-dev (>= 6:10~)
|
||||||
|
|
|
@ -414,11 +414,11 @@ sub MoveTo {
|
||||||
|
|
||||||
$$self{Storage} = $NewStorage;
|
$$self{Storage} = $NewStorage;
|
||||||
|
|
||||||
my ( $NewPath ) = ( $NewStorage->Path(undef) =~ /^(.*)$/ ); # De-taint
|
my ( $NewPath ) = ( $NewStorage->Path() =~ /^(.*)$/ ); # De-taint
|
||||||
if ( ! $$NewStorage{Id} ) {
|
if ( ! $$NewStorage{Id} ) {
|
||||||
return "New storage does not have an id. Moving will not happen.";
|
return "New storage does not have an id. Moving will not happen.";
|
||||||
} elsif ( !$NewPath ) {
|
} elsif ( !$NewPath ) {
|
||||||
return "$NewPath is empty.";
|
return "New path ($NewPath) is empty.";
|
||||||
} elsif ( ! -e $NewPath ) {
|
} elsif ( ! -e $NewPath ) {
|
||||||
return "New path $NewPath does not exist.";
|
return "New path $NewPath does not exist.";
|
||||||
} elsif ( ! -e $OldPath ) {
|
} elsif ( ! -e $OldPath ) {
|
||||||
|
|
|
@ -101,6 +101,9 @@ while( 1 ) {
|
||||||
my $res = $sth->execute( $Config{ZM_SERVER_ID} ? $Config{ZM_SERVER_ID} : () )
|
my $res = $sth->execute( $Config{ZM_SERVER_ID} ? $Config{ZM_SERVER_ID} : () )
|
||||||
or Fatal( "Can't execute: ".$sth->errstr() );
|
or Fatal( "Can't execute: ".$sth->errstr() );
|
||||||
while( my $monitor = $sth->fetchrow_hashref() ) {
|
while( my $monitor = $sth->fetchrow_hashref() ) {
|
||||||
|
|
||||||
|
$eventcounts_sth->execute( $$monitor{Id} ) or Error( "Can't execute: ".$eventcounts_sth->errstr() );
|
||||||
|
|
||||||
my $now = time();
|
my $now = time();
|
||||||
next if $monitor->{Function} eq 'None';
|
next if $monitor->{Function} eq 'None';
|
||||||
my $restart = 0;
|
my $restart = 0;
|
||||||
|
@ -200,8 +203,6 @@ while( 1 ) {
|
||||||
zmMemInvalidate( $monitor ); # Close our file handle to the zmc process we are about to end
|
zmMemInvalidate( $monitor ); # Close our file handle to the zmc process we are about to end
|
||||||
|
|
||||||
|
|
||||||
$eventcounts_sth->execute( $$monitor{Id} ) or Error( "Can't execute: ".$eventcounts_sth->errstr() );
|
|
||||||
|
|
||||||
} # end foreach monitor
|
} # end foreach monitor
|
||||||
$eventcounts_sth->finish();
|
$eventcounts_sth->finish();
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ configure_file(includes/config.php.in "${CMAKE_CURRENT_BINARY_DIR}/includes/conf
|
||||||
|
|
||||||
# Install the web files
|
# Install the web files
|
||||||
install(DIRECTORY api ajax css fonts graphics includes js lang skins tools views DESTINATION "${ZM_WEBDIR}" PATTERN "*.in" EXCLUDE PATTERN "*Make*" EXCLUDE PATTERN "*cmake*" EXCLUDE)
|
install(DIRECTORY api ajax css fonts graphics includes js lang skins tools views DESTINATION "${ZM_WEBDIR}" PATTERN "*.in" EXCLUDE PATTERN "*Make*" EXCLUDE PATTERN "*cmake*" EXCLUDE)
|
||||||
install(FILES index.php DESTINATION "${ZM_WEBDIR}")
|
install(FILES index.php robots.txt DESTINATION "${ZM_WEBDIR}")
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/includes/config.php" DESTINATION "${ZM_WEBDIR}/includes")
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/includes/config.php" DESTINATION "${ZM_WEBDIR}/includes")
|
||||||
|
|
||||||
# Install the api config files (if its not in the source directory)
|
# Install the api config files (if its not in the source directory)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
if ($_REQUEST['entity'] == "navBar") {
|
if ($_REQUEST['entity'] == 'navBar') {
|
||||||
ajaxResponse(getNavBarHtml('reload'));
|
ajaxResponse(getNavBarHtml('reload'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -10,21 +10,21 @@ $statusData = array(
|
||||||
'table' => 'Monitors',
|
'table' => 'Monitors',
|
||||||
'limit' => 1,
|
'limit' => 1,
|
||||||
'elements' => array(
|
'elements' => array(
|
||||||
'MonitorCount' => array( 'sql' => "count(*)" ),
|
'MonitorCount' => array( 'sql' => 'count(*)' ),
|
||||||
'ActiveMonitorCount' => array( 'sql' => "count(if(Function != 'None',1,NULL))" ),
|
'ActiveMonitorCount' => array( 'sql' => "count(if(Function != 'None',1,NULL))" ),
|
||||||
'State' => array( 'func' => "daemonCheck()?".translate('Running').":".translate('Stopped') ),
|
'State' => array( 'func' => 'daemonCheck()?'.translate('Running').':'.translate('Stopped') ),
|
||||||
'Load' => array( 'func' => "getLoad()" ),
|
'Load' => array( 'func' => 'getLoad()' ),
|
||||||
'Disk' => array( 'func' => "getDiskPercent()" ),
|
'Disk' => array( 'func' => 'getDiskPercent()' ),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'monitor' => array(
|
'monitor' => array(
|
||||||
'permission' => 'Monitors',
|
'permission' => 'Monitors',
|
||||||
'table' => 'Monitors',
|
'table' => 'Monitors',
|
||||||
'limit' => 1,
|
'limit' => 1,
|
||||||
'selector' => "Monitors.Id",
|
'selector' => 'Monitors.Id',
|
||||||
'elements' => array(
|
'elements' => array(
|
||||||
'Id' => array( 'sql' => "Monitors.Id" ),
|
'Id' => array( 'sql' => 'Monitors.Id' ),
|
||||||
'Name' => array( 'sql' => "Monitors.Name" ),
|
'Name' => array( 'sql' => 'Monitors.Name' ),
|
||||||
'Type' => true,
|
'Type' => true,
|
||||||
'Function' => true,
|
'Function' => true,
|
||||||
'Enabled' => true,
|
'Enabled' => true,
|
||||||
|
@ -36,8 +36,8 @@ $statusData = array(
|
||||||
'Host' => true,
|
'Host' => true,
|
||||||
'Port' => true,
|
'Port' => true,
|
||||||
'Path' => true,
|
'Path' => true,
|
||||||
'Width' => array( 'sql' => "Monitors.Width" ),
|
'Width' => array( 'sql' => 'Monitors.Width' ),
|
||||||
'Height' => array( 'sql' => "Monitors.Height" ),
|
'Height' => array( 'sql' => 'Monitors.Height' ),
|
||||||
'Palette' => true,
|
'Palette' => true,
|
||||||
'Orientation' => true,
|
'Orientation' => true,
|
||||||
'Brightness' => true,
|
'Brightness' => true,
|
||||||
|
@ -75,17 +75,17 @@ $statusData = array(
|
||||||
'DefaultScale' => true,
|
'DefaultScale' => true,
|
||||||
'WebColour' => true,
|
'WebColour' => true,
|
||||||
'Sequence' => true,
|
'Sequence' => true,
|
||||||
'MinEventId' => array( 'sql' => "(SELECT min(Events.Id) FROM Events WHERE Events.MonitorId = Monitors.Id" ),
|
'MinEventId' => array( 'sql' => '(SELECT min(Events.Id) FROM Events WHERE Events.MonitorId = Monitors.Id' ),
|
||||||
'MaxEventId' => array( 'sql' => "(SELECT max(Events.Id) FROM Events WHERE Events.MonitorId = Monitors.Id" ),
|
'MaxEventId' => array( 'sql' => '(SELECT max(Events.Id) FROM Events WHERE Events.MonitorId = Monitors.Id' ),
|
||||||
'TotalEvents' => array( 'sql' => "(SELECT count(Events.Id) FROM Events WHERE Events.MonitorId = Monitors.Id" ),
|
'TotalEvents' => array( 'sql' => '(SELECT count(Events.Id) FROM Events WHERE Events.MonitorId = Monitors.Id' ),
|
||||||
'Status' => array( 'zmu' => "-m ".escapeshellarg($_REQUEST['id'][0])." -s" ),
|
'Status' => array( 'zmu' => '-m '.escapeshellarg($_REQUEST['id'][0]).' -s' ),
|
||||||
'FrameRate' => array( 'zmu' => "-m ".escapeshellarg($_REQUEST['id'][0])." -f" ),
|
'FrameRate' => array( 'zmu' => '-m '.escapeshellarg($_REQUEST['id'][0]).' -f' ),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'events' => array(
|
'events' => array(
|
||||||
'permission' => 'Events',
|
'permission' => 'Events',
|
||||||
'table' => 'Events',
|
'table' => 'Events',
|
||||||
'selector' => "Events.MonitorId",
|
'selector' => 'Events.MonitorId',
|
||||||
'elements' => array(
|
'elements' => array(
|
||||||
'Id' => true,
|
'Id' => true,
|
||||||
'Name' => true,
|
'Name' => true,
|
||||||
|
@ -108,11 +108,11 @@ $statusData = array(
|
||||||
'permission' => 'Events',
|
'permission' => 'Events',
|
||||||
'table' => 'Events',
|
'table' => 'Events',
|
||||||
'limit' => 1,
|
'limit' => 1,
|
||||||
'selector' => "Events.Id",
|
'selector' => 'Events.Id',
|
||||||
'elements' => array(
|
'elements' => array(
|
||||||
'Id' => array( 'sql' => "Events.Id" ),
|
'Id' => array( 'sql' => 'Events.Id' ),
|
||||||
'MonitorId' => true,
|
'MonitorId' => true,
|
||||||
'MonitorName' => array('sql' => "(SELECT Monitors.Name FROM Monitors WHERE Monitors.Id = Events.MonitorId)"),
|
'MonitorName' => array('sql' => '(SELECT Monitors.Name FROM Monitors WHERE Monitors.Id = Events.MonitorId)'),
|
||||||
'Name' => true,
|
'Name' => true,
|
||||||
'Cause' => true,
|
'Cause' => true,
|
||||||
'StartTime' => true,
|
'StartTime' => true,
|
||||||
|
@ -134,10 +134,10 @@ $statusData = array(
|
||||||
'Messaged' => true,
|
'Messaged' => true,
|
||||||
'Executed' => true,
|
'Executed' => true,
|
||||||
'Notes' => true,
|
'Notes' => true,
|
||||||
'MinFrameId' => array( 'sql' => "(SELECT min(Frames.FrameId) FROM Frames WHERE EventId=Events.Id)" ),
|
'MinFrameId' => array( 'sql' => '(SELECT min(Frames.FrameId) FROM Frames WHERE EventId=Events.Id)' ),
|
||||||
'MaxFrameId' => array( 'sql' => "(SELECT max(Frames.FrameId) FROM Frames WHERE Events.Id = Frames.EventId)" ),
|
'MaxFrameId' => array( 'sql' => '(SELECT max(Frames.FrameId) FROM Frames WHERE Events.Id = Frames.EventId)' ),
|
||||||
'MinFrameDelta' => array( 'sql' => "(SELECT min(Frames.Delta) FROM Frames WHERE Events.Id = Frames.EventId)" ),
|
'MinFrameDelta' => array( 'sql' => '(SELECT min(Frames.Delta) FROM Frames WHERE Events.Id = Frames.EventId)' ),
|
||||||
'MaxFrameDelta' => array( 'sql' => "(SELECT max(Frames.Delta) FROM Frames WHERE Events.Id = Frames.EventId)" ),
|
'MaxFrameDelta' => array( 'sql' => '(SELECT max(Frames.Delta) FROM Frames WHERE Events.Id = Frames.EventId)' ),
|
||||||
//'Path' => array( 'postFunc' => 'getEventPath' ),
|
//'Path' => array( 'postFunc' => 'getEventPath' ),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -156,9 +156,9 @@ $statusData = array(
|
||||||
'permission' => 'Events',
|
'permission' => 'Events',
|
||||||
'table' => 'Frames',
|
'table' => 'Frames',
|
||||||
'limit' => 1,
|
'limit' => 1,
|
||||||
'selector' => array( array( 'table' => 'Events', 'join' => "Events.Id = Frames.EventId", 'selector'=>"Events.Id" ), "Frames.FrameId" ),
|
'selector' => array( array( 'table' => 'Events', 'join' => 'Events.Id = Frames.EventId', 'selector'=>"Events.Id' ), 'Frames.FrameId" ),
|
||||||
'elements' => array(
|
'elements' => array(
|
||||||
//'Id' => array( 'sql' => "Frames.FrameId" ),
|
//'Id' => array( 'sql' => 'Frames.FrameId' ),
|
||||||
'FrameId' => true,
|
'FrameId' => true,
|
||||||
'EventId' => true,
|
'EventId' => true,
|
||||||
'Type' => true,
|
'Type' => true,
|
||||||
|
@ -171,15 +171,15 @@ $statusData = array(
|
||||||
),
|
),
|
||||||
'frameimage' => array(
|
'frameimage' => array(
|
||||||
'permission' => 'Events',
|
'permission' => 'Events',
|
||||||
'func' => "getFrameImage()"
|
'func' => 'getFrameImage()'
|
||||||
),
|
),
|
||||||
'nearframe' => array(
|
'nearframe' => array(
|
||||||
'permission' => 'Events',
|
'permission' => 'Events',
|
||||||
'func' => "getNearFrame()"
|
'func' => 'getNearFrame()'
|
||||||
),
|
),
|
||||||
'nearevents' => array(
|
'nearevents' => array(
|
||||||
'permission' => 'Events',
|
'permission' => 'Events',
|
||||||
'func' => "getNearEvents()"
|
'func' => 'getNearEvents()'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ function collectData() {
|
||||||
ajaxError( 'Unrecognised action or insufficient permissions' );
|
ajaxError( 'Unrecognised action or insufficient permissions' );
|
||||||
|
|
||||||
if ( !empty($entitySpec['func']) ) {
|
if ( !empty($entitySpec['func']) ) {
|
||||||
$data = eval( "return( ".$entitySpec['func']." );" );
|
$data = eval( 'return( '.$entitySpec['func']." );" );
|
||||||
} else {
|
} else {
|
||||||
$data = array();
|
$data = array();
|
||||||
$postFuncs = array();
|
$postFuncs = array();
|
||||||
|
@ -221,25 +221,25 @@ function collectData() {
|
||||||
$entitySpec['selector'] = array( $entitySpec['selector'] );
|
$entitySpec['selector'] = array( $entitySpec['selector'] );
|
||||||
foreach( $entitySpec['selector'] as $selector )
|
foreach( $entitySpec['selector'] as $selector )
|
||||||
if ( is_array( $selector ) && isset($selector['table']) && isset($selector['join']) )
|
if ( is_array( $selector ) && isset($selector['table']) && isset($selector['join']) )
|
||||||
$joinSql[] = "left join ".$selector['table']." on ".$selector['join'];
|
$joinSql[] = 'left join '.$selector['table'].' on '.$selector['join'];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ( $_REQUEST['element'] as $element ) {
|
foreach ( $_REQUEST['element'] as $element ) {
|
||||||
if ( !($elementData = $lc_elements[strtolower($element)]) )
|
if ( !($elementData = $lc_elements[strtolower($element)]) )
|
||||||
ajaxError( "Bad ".validJsStr($_REQUEST['entity'])." element ".$element );
|
ajaxError( 'Bad '.validJsStr($_REQUEST['entity']).' element '.$element );
|
||||||
if ( isset($elementData['func']) )
|
if ( isset($elementData['func']) )
|
||||||
$data[$element] = eval( "return( ".$elementData['func']." );" );
|
$data[$element] = eval( 'return( '.$elementData['func']." );" );
|
||||||
else if ( isset($elementData['postFunc']) )
|
else if ( isset($elementData['postFunc']) )
|
||||||
$postFuncs[$element] = $elementData['postFunc'];
|
$postFuncs[$element] = $elementData['postFunc'];
|
||||||
else if ( isset($elementData['zmu']) )
|
else if ( isset($elementData['zmu']) )
|
||||||
$data[$element] = exec( escapeshellcmd( getZmuCommand( " ".$elementData['zmu'] ) ) );
|
$data[$element] = exec( escapeshellcmd( getZmuCommand( ' '.$elementData['zmu'] ) ) );
|
||||||
else {
|
else {
|
||||||
if ( isset($elementData['sql']) )
|
if ( isset($elementData['sql']) )
|
||||||
$fieldSql[] = $elementData['sql']." as ".$element;
|
$fieldSql[] = $elementData['sql'].' as '.$element;
|
||||||
else
|
else
|
||||||
$fieldSql[] = $element;
|
$fieldSql[] = $element;
|
||||||
if ( isset($elementData['table']) && isset($elementData['join']) ) {
|
if ( isset($elementData['table']) && isset($elementData['join']) ) {
|
||||||
$joinSql[] = "left join ".$elementData['table']." on ".$elementData['join'];
|
$joinSql[] = 'left join '.$elementData['table'].' on '.$elementData['join'];
|
||||||
}
|
}
|
||||||
if ( isset($elementData['group']) ) {
|
if ( isset($elementData['group']) ) {
|
||||||
$groupSql[] = $elementData['group'];
|
$groupSql[] = $elementData['group'];
|
||||||
|
@ -248,9 +248,9 @@ function collectData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( count($fieldSql) ) {
|
if ( count($fieldSql) ) {
|
||||||
$sql = "select ".join( ", ", $fieldSql )." from ".$entitySpec['table'];
|
$sql = 'select '.join( ', ', $fieldSql ).' from '.$entitySpec['table'];
|
||||||
if ( $joinSql )
|
if ( $joinSql )
|
||||||
$sql .= " ".join( " ", array_unique( $joinSql ) );
|
$sql .= ' '.join( ' ', array_unique( $joinSql ) );
|
||||||
if ( $id && !empty($entitySpec['selector']) ) {
|
if ( $id && !empty($entitySpec['selector']) ) {
|
||||||
$index = 0;
|
$index = 0;
|
||||||
$where = array();
|
$where = array();
|
||||||
|
@ -265,21 +265,21 @@ function collectData() {
|
||||||
}
|
}
|
||||||
$index++;
|
$index++;
|
||||||
}
|
}
|
||||||
$sql .= " where ".join( " and ", $where );
|
$sql .= ' where '.join( ' and ', $where );
|
||||||
}
|
}
|
||||||
if ( $groupSql )
|
if ( $groupSql )
|
||||||
$sql .= " GROUP BY ".join( ",", array_unique( $groupSql ) );
|
$sql .= ' GROUP BY '.join( ',', array_unique( $groupSql ) );
|
||||||
if ( !empty($_REQUEST['sort']) )
|
if ( !empty($_REQUEST['sort']) )
|
||||||
$sql .= " order by ".$_REQUEST['sort'];
|
$sql .= ' order by '.$_REQUEST['sort'];
|
||||||
if ( !empty($entitySpec['limit']) )
|
if ( !empty($entitySpec['limit']) )
|
||||||
$limit = $entitySpec['limit'];
|
$limit = $entitySpec['limit'];
|
||||||
elseif ( !empty($_REQUEST['count']) )
|
elseif ( !empty($_REQUEST['count']) )
|
||||||
$limit = validInt($_REQUEST['count']);
|
$limit = validInt($_REQUEST['count']);
|
||||||
$limit_offset="";
|
$limit_offset='';
|
||||||
if ( !empty($_REQUEST['offset']) )
|
if ( !empty($_REQUEST['offset']) )
|
||||||
$limit_offset = validInt($_REQUEST['offset']) . ", ";
|
$limit_offset = validInt($_REQUEST['offset']) . ', ';
|
||||||
if ( !empty( $limit ) )
|
if ( !empty( $limit ) )
|
||||||
$sql .= " limit ".$limit_offset.$limit;
|
$sql .= ' limit '.$limit_offset.$limit;
|
||||||
if ( isset($limit) && $limit == 1 ) {
|
if ( isset($limit) && $limit == 1 ) {
|
||||||
if ( $sqlData = dbFetchOne( $sql, NULL, $values ) ) {
|
if ( $sqlData = dbFetchOne( $sql, NULL, $values ) ) {
|
||||||
foreach ( $postFuncs as $element=>$func )
|
foreach ( $postFuncs as $element=>$func )
|
||||||
|
@ -312,7 +312,7 @@ switch( $_REQUEST['layout'] ) {
|
||||||
case 'xml NOT CURRENTLY SUPPORTED' :
|
case 'xml NOT CURRENTLY SUPPORTED' :
|
||||||
{
|
{
|
||||||
header("Content-type: application/xml" );
|
header("Content-type: application/xml" );
|
||||||
echo( '<?xml version="1.0" encoding="iso-8859-1"?>'."\n" );
|
echo( '<?xml version="1.0' encoding='iso-8859-1"?>'.'\n' );
|
||||||
echo "<".strtolower($_REQUEST['entity']).">\n";
|
echo "<".strtolower($_REQUEST['entity']).">\n";
|
||||||
foreach ( $data as $key=>$value ) {
|
foreach ( $data as $key=>$value ) {
|
||||||
$key = strtolower( $key );
|
$key = strtolower( $key );
|
||||||
|
@ -332,7 +332,7 @@ switch( $_REQUEST['layout'] ) {
|
||||||
case 'text' :
|
case 'text' :
|
||||||
{
|
{
|
||||||
header("Content-type: text/plain" );
|
header("Content-type: text/plain" );
|
||||||
echo join( " ", array_values( $data ) );
|
echo join( ' ', array_values( $data ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -380,7 +380,7 @@ function getNearEvents() {
|
||||||
parseSort();
|
parseSort();
|
||||||
|
|
||||||
if ( $user['MonitorIds'] )
|
if ( $user['MonitorIds'] )
|
||||||
$midSql = " and MonitorId in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
|
$midSql = ' and MonitorId in ('.join( ',', preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).')';
|
||||||
else
|
else
|
||||||
$midSql = '';
|
$midSql = '';
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ if ( $action == 'login' && isset($_REQUEST['username']) && ( ZM_AUTH_TYPE == 're
|
||||||
} else {
|
} else {
|
||||||
//Let them login but show an error
|
//Let them login but show an error
|
||||||
echo '<script type="text/javascript">alert("'.translate('RecaptchaWarning').'"); </script>';
|
echo '<script type="text/javascript">alert("'.translate('RecaptchaWarning').'"); </script>';
|
||||||
Error ("Invalid recaptcha secret detected");
|
Error ('Invalid recaptcha secret detected');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end if success==false
|
} // end if success==false
|
||||||
|
@ -242,11 +242,11 @@ if ( !empty($_REQUEST['mid']) && canView( 'Control', $_REQUEST['mid'] ) ) {
|
||||||
$ctrlCommand = buildControlCommand( $monitor );
|
$ctrlCommand = buildControlCommand( $monitor );
|
||||||
sendControlCommand( $monitor->Id(), $ctrlCommand );
|
sendControlCommand( $monitor->Id(), $ctrlCommand );
|
||||||
} elseif ( $action == 'settings' ) {
|
} elseif ( $action == 'settings' ) {
|
||||||
$args = " -m " . escapeshellarg($mid);
|
$args = ' -m ' . escapeshellarg($mid);
|
||||||
$args .= " -B" . escapeshellarg($_REQUEST['newBrightness']);
|
$args .= ' -B' . escapeshellarg($_REQUEST['newBrightness']);
|
||||||
$args .= " -C" . escapeshellarg($_REQUEST['newContrast']);
|
$args .= ' -C' . escapeshellarg($_REQUEST['newContrast']);
|
||||||
$args .= " -H" . escapeshellarg($_REQUEST['newHue']);
|
$args .= ' -H' . escapeshellarg($_REQUEST['newHue']);
|
||||||
$args .= " -O" . escapeshellarg($_REQUEST['newColour']);
|
$args .= ' -O' . escapeshellarg($_REQUEST['newColour']);
|
||||||
|
|
||||||
$zmuCommand = getZmuCommand( $args );
|
$zmuCommand = getZmuCommand( $args );
|
||||||
|
|
||||||
|
@ -280,9 +280,9 @@ if ( canEdit( 'Control' ) ) {
|
||||||
|
|
||||||
if ( count( $changes ) ) {
|
if ( count( $changes ) ) {
|
||||||
if ( !empty($_REQUEST['cid']) ) {
|
if ( !empty($_REQUEST['cid']) ) {
|
||||||
dbQuery( "update Controls set ".implode( ", ", $changes )." where Id = ?", array($_REQUEST['cid']) );
|
dbQuery( 'update Controls set '.implode( ', ', $changes ).' where Id = ?', array($_REQUEST['cid']) );
|
||||||
} else {
|
} else {
|
||||||
dbQuery( "insert into Controls set ".implode( ", ", $changes ) );
|
dbQuery( 'insert into Controls set '.implode( ', ', $changes ) );
|
||||||
//$_REQUEST['cid'] = dbInsertId();
|
//$_REQUEST['cid'] = dbInsertId();
|
||||||
}
|
}
|
||||||
$refreshParent = true;
|
$refreshParent = true;
|
||||||
|
@ -291,8 +291,8 @@ if ( canEdit( 'Control' ) ) {
|
||||||
} elseif ( $action == 'delete' ) {
|
} elseif ( $action == 'delete' ) {
|
||||||
if ( isset($_REQUEST['markCids']) ) {
|
if ( isset($_REQUEST['markCids']) ) {
|
||||||
foreach( $_REQUEST['markCids'] as $markCid ) {
|
foreach( $_REQUEST['markCids'] as $markCid ) {
|
||||||
dbQuery( "delete from Controls where Id = ?", array($markCid) );
|
dbQuery( 'delete from Controls where Id = ?', array($markCid) );
|
||||||
dbQuery( "update Monitors set Controllable = 0, ControlId = 0 where ControlId = ?", array($markCid) );
|
dbQuery( 'update Monitors set Controllable = 0, ControlId = 0 where ControlId = ?', array($markCid) );
|
||||||
$refreshParent = true;
|
$refreshParent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -376,9 +376,9 @@ if ( !empty($_REQUEST['mid']) && canEdit( 'Monitors', $_REQUEST['mid'] ) ) {
|
||||||
|
|
||||||
if ( count( $changes ) ) {
|
if ( count( $changes ) ) {
|
||||||
if ( $zid > 0 ) {
|
if ( $zid > 0 ) {
|
||||||
dbQuery( "UPDATE Zones SET ".implode( ", ", $changes )." WHERE MonitorId=? AND Id=?", array( $mid, $zid) );
|
dbQuery( 'UPDATE Zones SET '.implode( ', ', $changes ).' WHERE MonitorId=? AND Id=?', array( $mid, $zid) );
|
||||||
} else {
|
} else {
|
||||||
dbQuery( "INSERT INTO Zones SET MonitorId=?, ".implode( ", ", $changes ), array( $mid ) );
|
dbQuery( 'INSERT INTO Zones SET MonitorId=?, '.implode( ', ', $changes ), array( $mid ) );
|
||||||
dbQuery( 'UPDATE Monitors SET ZoneCount=(SELECT COUNT(Id) FROM Zones WHERE MonitorId=Monitors.Id) WHERE Id=?', array($mid));
|
dbQuery( 'UPDATE Monitors SET ZoneCount=(SELECT COUNT(Id) FROM Zones WHERE MonitorId=Monitors.Id) WHERE Id=?', array($mid));
|
||||||
}
|
}
|
||||||
//if ( $cookies ) session_write_close();
|
//if ( $cookies ) session_write_close();
|
||||||
|
@ -405,7 +405,7 @@ if ( !empty($_REQUEST['mid']) && canEdit( 'Monitors', $_REQUEST['mid'] ) ) {
|
||||||
foreach( $pconfs as $pconf ) {
|
foreach( $pconfs as $pconf ) {
|
||||||
$value=$_REQUEST['pluginOpt'][$pconf['Name']];
|
$value=$_REQUEST['pluginOpt'][$pconf['Name']];
|
||||||
if(array_key_exists($pconf['Name'], $_REQUEST['pluginOpt']) && ($pconf['Value']!=$value)) {
|
if(array_key_exists($pconf['Name'], $_REQUEST['pluginOpt']) && ($pconf['Value']!=$value)) {
|
||||||
dbQuery("UPDATE PluginsConfig SET Value=? WHERE id=?", array( $value, $pconf['Id'] ) );
|
dbQuery('UPDATE PluginsConfig SET Value=? WHERE id=?', array( $value, $pconf['Id'] ) );
|
||||||
$changes++;
|
$changes++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -528,7 +528,7 @@ if ( canEdit( 'Monitors' ) ) {
|
||||||
$changes = getFormChanges( $zone, $newZone, $types );
|
$changes = getFormChanges( $zone, $newZone, $types );
|
||||||
|
|
||||||
if ( count( $changes ) ) {
|
if ( count( $changes ) ) {
|
||||||
dbQuery( "update Zones set ".implode( ", ", $changes )." WHERE MonitorId=? AND Id=?", array( $mid, $zone['Id'] ) );
|
dbQuery( 'update Zones set '.implode( ', ', $changes ).' WHERE MonitorId=? AND Id=?', array( $mid, $zone['Id'] ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -559,12 +559,12 @@ if ( canEdit( 'Monitors' ) ) {
|
||||||
|
|
||||||
if ( count( $x10Changes ) ) {
|
if ( count( $x10Changes ) ) {
|
||||||
if ( $x10Monitor && isset($_REQUEST['newX10Monitor']) ) {
|
if ( $x10Monitor && isset($_REQUEST['newX10Monitor']) ) {
|
||||||
dbQuery( "update TriggersX10 set ".implode( ", ", $x10Changes )." where MonitorId=?", array($mid) );
|
dbQuery( 'update TriggersX10 set '.implode( ', ', $x10Changes ).' where MonitorId=?', array($mid) );
|
||||||
} elseif ( !$user['MonitorIds'] ) {
|
} elseif ( !$user['MonitorIds'] ) {
|
||||||
if ( !$x10Monitor ) {
|
if ( !$x10Monitor ) {
|
||||||
dbQuery( "insert into TriggersX10 set MonitorId = ?, ".implode( ", ", $x10Changes ), array( $mid ) );
|
dbQuery( 'insert into TriggersX10 set MonitorId = ?, '.implode( ', ', $x10Changes ), array( $mid ) );
|
||||||
} else {
|
} else {
|
||||||
dbQuery( "delete from TriggersX10 where MonitorId = ?", array($mid) );
|
dbQuery( 'delete from TriggersX10 where MonitorId = ?', array($mid) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$restart = true;
|
$restart = true;
|
||||||
|
@ -633,9 +633,9 @@ if ( canEdit( 'Devices' ) ) {
|
||||||
setDeviceStatusX10( $_REQUEST['key'], $_REQUEST['command'] );
|
setDeviceStatusX10( $_REQUEST['key'], $_REQUEST['command'] );
|
||||||
} elseif ( isset( $_REQUEST['newDevice'] ) ) {
|
} elseif ( isset( $_REQUEST['newDevice'] ) ) {
|
||||||
if ( isset($_REQUEST['did']) ) {
|
if ( isset($_REQUEST['did']) ) {
|
||||||
dbQuery( "update Devices set Name=?, KeyString=? where Id=?", array($_REQUEST['newDevice']['Name'], $_REQUEST['newDevice']['KeyString'], $_REQUEST['did']) );
|
dbQuery( 'update Devices set Name=?, KeyString=? where Id=?', array($_REQUEST['newDevice']['Name'], $_REQUEST['newDevice']['KeyString'], $_REQUEST['did']) );
|
||||||
} else {
|
} else {
|
||||||
dbQuery( "insert into Devices set Name=?, KeyString=?", array( $_REQUEST['newDevice']['Name'], $_REQUEST['newDevice']['KeyString'] ) );
|
dbQuery( 'insert into Devices set Name=?, KeyString=?', array( $_REQUEST['newDevice']['Name'], $_REQUEST['newDevice']['KeyString'] ) );
|
||||||
}
|
}
|
||||||
$refreshParent = true;
|
$refreshParent = true;
|
||||||
$view = 'none';
|
$view = 'none';
|
||||||
|
@ -643,7 +643,7 @@ if ( canEdit( 'Devices' ) ) {
|
||||||
} elseif ( $action == 'delete' ) {
|
} elseif ( $action == 'delete' ) {
|
||||||
if ( isset($_REQUEST['markDids']) ) {
|
if ( isset($_REQUEST['markDids']) ) {
|
||||||
foreach( $_REQUEST['markDids'] as $markDid ) {
|
foreach( $_REQUEST['markDids'] as $markDid ) {
|
||||||
dbQuery( "delete from Devices where Id=?", array($markDid) );
|
dbQuery( 'delete from Devices where Id=?', array($markDid) );
|
||||||
$refreshParent = true;
|
$refreshParent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -734,9 +734,9 @@ if ( canEdit( 'System' ) ) {
|
||||||
|
|
||||||
if ( count( $changes ) ) {
|
if ( count( $changes ) ) {
|
||||||
if ( !empty($_REQUEST['id']) ) {
|
if ( !empty($_REQUEST['id']) ) {
|
||||||
dbQuery( "UPDATE Servers SET ".implode( ", ", $changes )." WHERE Id = ?", array($_REQUEST['id']) );
|
dbQuery( 'UPDATE Servers SET '.implode( ', ', $changes ).' WHERE Id = ?', array($_REQUEST['id']) );
|
||||||
} else {
|
} else {
|
||||||
dbQuery( "INSERT INTO Servers set ".implode( ", ", $changes ) );
|
dbQuery( 'INSERT INTO Servers set '.implode( ', ', $changes ) );
|
||||||
}
|
}
|
||||||
$refreshParent = true;
|
$refreshParent = true;
|
||||||
}
|
}
|
||||||
|
@ -744,7 +744,7 @@ if ( canEdit( 'System' ) ) {
|
||||||
} else if ( $action == 'delete' ) {
|
} else if ( $action == 'delete' ) {
|
||||||
if ( !empty($_REQUEST['markIds']) ) {
|
if ( !empty($_REQUEST['markIds']) ) {
|
||||||
foreach( $_REQUEST['markIds'] as $Id )
|
foreach( $_REQUEST['markIds'] as $Id )
|
||||||
dbQuery( "DELETE FROM Servers WHERE Id=?", array($Id) );
|
dbQuery( 'DELETE FROM Servers WHERE Id=?', array($Id) );
|
||||||
}
|
}
|
||||||
$refreshParent = true;
|
$refreshParent = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -762,9 +762,9 @@ if ( canEdit( 'System' ) ) {
|
||||||
|
|
||||||
if ( count( $changes ) ) {
|
if ( count( $changes ) ) {
|
||||||
if ( !empty($_REQUEST['id']) ) {
|
if ( !empty($_REQUEST['id']) ) {
|
||||||
dbQuery( "UPDATE Storage SET ".implode( ", ", $changes )." WHERE Id = ?", array($_REQUEST['id']) );
|
dbQuery( 'UPDATE Storage SET '.implode( ', ', $changes ).' WHERE Id = ?', array($_REQUEST['id']) );
|
||||||
} else {
|
} else {
|
||||||
dbQuery( "INSERT INTO Storage set ".implode( ", ", $changes ) );
|
dbQuery( 'INSERT INTO Storage set '.implode( ', ', $changes ) );
|
||||||
}
|
}
|
||||||
$refreshParent = true;
|
$refreshParent = true;
|
||||||
}
|
}
|
||||||
|
@ -857,7 +857,7 @@ if ( canEdit( 'System' ) ) {
|
||||||
if ( $value['Type'] == 'boolean' && empty($_REQUEST['newConfig'][$name]) )
|
if ( $value['Type'] == 'boolean' && empty($_REQUEST['newConfig'][$name]) )
|
||||||
$newValue = 0;
|
$newValue = 0;
|
||||||
elseif ( isset($_REQUEST['newConfig'][$name]) )
|
elseif ( isset($_REQUEST['newConfig'][$name]) )
|
||||||
$newValue = preg_replace( "/\r\n/", "\n", stripslashes( $_REQUEST['newConfig'][$name] ) );
|
$newValue = preg_replace( "/\r\n/', '\n", stripslashes( $_REQUEST['newConfig'][$name] ) );
|
||||||
|
|
||||||
if ( isset($newValue) && ($newValue != $value['Value']) ) {
|
if ( isset($newValue) && ($newValue != $value['Value']) ) {
|
||||||
dbQuery( 'UPDATE Config SET Value=? WHERE Name=?', array( $newValue, $name ) );
|
dbQuery( 'UPDATE Config SET Value=? WHERE Name=?', array( $newValue, $name ) );
|
||||||
|
@ -896,18 +896,18 @@ if ( canEdit( 'System' ) ) {
|
||||||
$changes = getFormChanges( $dbUser, $_REQUEST['newUser'], $types );
|
$changes = getFormChanges( $dbUser, $_REQUEST['newUser'], $types );
|
||||||
|
|
||||||
if ( $_REQUEST['newUser']['Password'] )
|
if ( $_REQUEST['newUser']['Password'] )
|
||||||
$changes['Password'] = "Password = password(".dbEscape($_REQUEST['newUser']['Password']).")";
|
$changes['Password'] = 'Password = password('.dbEscape($_REQUEST['newUser']['Password']).')';
|
||||||
else
|
else
|
||||||
unset( $changes['Password'] );
|
unset( $changes['Password'] );
|
||||||
|
|
||||||
if ( count( $changes ) ) {
|
if ( count( $changes ) ) {
|
||||||
if ( !empty($_REQUEST['uid']) ) {
|
if ( !empty($_REQUEST['uid']) ) {
|
||||||
dbQuery( "update Users set ".implode( ", ", $changes )." where Id = ?", array($_REQUEST['uid']) );
|
dbQuery( 'update Users set '.implode( ', ', $changes ).' where Id = ?', array($_REQUEST['uid']) );
|
||||||
# If we are updating the logged in user, then update our session user data.
|
# If we are updating the logged in user, then update our session user data.
|
||||||
if ( $user and ( $dbUser['Username'] == $user['Username'] ) )
|
if ( $user and ( $dbUser['Username'] == $user['Username'] ) )
|
||||||
userLogin( $dbUser['Username'], $dbUser['Password'] );
|
userLogin( $dbUser['Username'], $dbUser['Password'] );
|
||||||
} else {
|
} else {
|
||||||
dbQuery( "insert into Users set ".implode( ", ", $changes ) );
|
dbQuery( 'insert into Users set '.implode( ', ', $changes ) );
|
||||||
}
|
}
|
||||||
$refreshParent = true;
|
$refreshParent = true;
|
||||||
}
|
}
|
||||||
|
@ -924,20 +924,20 @@ if ( canEdit( 'System' ) ) {
|
||||||
$definitions = array();
|
$definitions = array();
|
||||||
foreach( dbFetchAll( $sql ) as $monitor )
|
foreach( dbFetchAll( $sql ) as $monitor )
|
||||||
{
|
{
|
||||||
$definitions[] = $monitor['Id'].":".$monitor['Function'].":".$monitor['Enabled'];
|
$definitions[] = $monitor['Id'].':'.$monitor['Function'].':'.$monitor['Enabled'];
|
||||||
}
|
}
|
||||||
$definition = join( ',', $definitions );
|
$definition = join( ',', $definitions );
|
||||||
if ( $_REQUEST['newState'] )
|
if ( $_REQUEST['newState'] )
|
||||||
$_REQUEST['runState'] = $_REQUEST['newState'];
|
$_REQUEST['runState'] = $_REQUEST['newState'];
|
||||||
dbQuery( "replace into States set Name=?, Definition=?", array( $_REQUEST['runState'],$definition) );
|
dbQuery( 'replace into States set Name=?, Definition=?', array( $_REQUEST['runState'],$definition) );
|
||||||
}
|
}
|
||||||
} elseif ( $action == 'delete' ) {
|
} elseif ( $action == 'delete' ) {
|
||||||
if ( isset($_REQUEST['runState']) )
|
if ( isset($_REQUEST['runState']) )
|
||||||
dbQuery( "delete from States where Name=?", array($_REQUEST['runState']) );
|
dbQuery( 'delete from States where Name=?', array($_REQUEST['runState']) );
|
||||||
|
|
||||||
if ( isset($_REQUEST['markUids']) ) {
|
if ( isset($_REQUEST['markUids']) ) {
|
||||||
foreach( $_REQUEST['markUids'] as $markUid )
|
foreach( $_REQUEST['markUids'] as $markUid )
|
||||||
dbQuery( "delete from Users where Id = ?", array($markUid) );
|
dbQuery( 'delete from Users where Id = ?', array($markUid) );
|
||||||
if ( $markUid == $user['Id'] )
|
if ( $markUid == $user['Id'] )
|
||||||
userLogout();
|
userLogout();
|
||||||
}
|
}
|
||||||
|
@ -952,11 +952,11 @@ if ( canEdit( 'System' ) ) {
|
||||||
$changes = getFormChanges( $dbUser, $_REQUEST['newUser'], $types );
|
$changes = getFormChanges( $dbUser, $_REQUEST['newUser'], $types );
|
||||||
|
|
||||||
if ( !empty($_REQUEST['newUser']['Password']) )
|
if ( !empty($_REQUEST['newUser']['Password']) )
|
||||||
$changes['Password'] = "Password = password(".dbEscape($_REQUEST['newUser']['Password']).")";
|
$changes['Password'] = 'Password = password('.dbEscape($_REQUEST['newUser']['Password']).')';
|
||||||
else
|
else
|
||||||
unset( $changes['Password'] );
|
unset( $changes['Password'] );
|
||||||
if ( count( $changes ) ) {
|
if ( count( $changes ) ) {
|
||||||
dbQuery( "update Users set ".implode( ", ", $changes )." where Id=?", array($uid) );
|
dbQuery( 'update Users set '.implode( ', ', $changes ).' where Id=?', array($uid) );
|
||||||
$refreshParent = true;
|
$refreshParent = true;
|
||||||
}
|
}
|
||||||
$view = 'none';
|
$view = 'none';
|
||||||
|
|
|
@ -475,8 +475,7 @@ function getEventPath( $event ) {
|
||||||
|
|
||||||
function getEventDefaultVideoPath( $event ) {
|
function getEventDefaultVideoPath( $event ) {
|
||||||
$Event = new Event( $event );
|
$Event = new Event( $event );
|
||||||
return $Event->getStreamSrc( array( "mode"=>"mpeg", "format"=>"h264" ) );
|
return $Event->getStreamSrc( array( 'mode'=>'mpeg', 'format'=>'h264' ) );
|
||||||
//$Event->Path().'/'.$event['DefaultVideo'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function deletePath( $path ) {
|
function deletePath( $path ) {
|
||||||
|
|
|
@ -344,6 +344,7 @@ $SLANG = array(
|
||||||
'FilterArchiveEvents' => 'Archive all matches',
|
'FilterArchiveEvents' => 'Archive all matches',
|
||||||
'FilterUpdateDiskSpace' => 'Update used disk space',
|
'FilterUpdateDiskSpace' => 'Update used disk space',
|
||||||
'FilterDeleteEvents' => 'Delete all matches',
|
'FilterDeleteEvents' => 'Delete all matches',
|
||||||
|
'FilterMoveEvents' => 'Move all matches',
|
||||||
'FilterEmailEvents' => 'Email details of all matches',
|
'FilterEmailEvents' => 'Email details of all matches',
|
||||||
'FilterExecuteEvents' => 'Execute command on all matches',
|
'FilterExecuteEvents' => 'Execute command on all matches',
|
||||||
'FilterLog' => 'Filter log',
|
'FilterLog' => 'Filter log',
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
User-agent: *
|
||||||
|
Disallow: /
|
|
@ -29,10 +29,10 @@
|
||||||
|
|
||||||
#monitors .alert {
|
#monitors .alert {
|
||||||
color: #ffa500;
|
color: #ffa500;
|
||||||
border: none;
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#monitors .imageFeed {
|
#monitors .imageFeed {
|
||||||
|
|
|
@ -45,7 +45,8 @@ $scales = array(
|
||||||
'12.5' => '1/8x',
|
'12.5' => '1/8x',
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($_REQUEST['view'])) unset($scales[$_REQUEST['view'] == 'montage' ? 'auto' : '']); //Only use fixed width/Height on montage
|
if (isset($_REQUEST['view']) && ($_REQUEST['view'] == 'montage'))
|
||||||
|
unset($scales['auto']); //Remove auto if we aren't using event view
|
||||||
|
|
||||||
$bandwidth_options = array(
|
$bandwidth_options = array(
|
||||||
'high' => translate('High'),
|
'high' => translate('High'),
|
||||||
|
|
|
@ -44,9 +44,9 @@ if (isset($_REQUEST['rate'])) {
|
||||||
|
|
||||||
if (isset($_REQUEST['scale'])) {
|
if (isset($_REQUEST['scale'])) {
|
||||||
$scale = validInt($_REQUEST['scale']);
|
$scale = validInt($_REQUEST['scale']);
|
||||||
} else if (isset($_COOKIE['zmEventScaleAuto'])) { //If we're using scale to fit use it on all monitors
|
} else if ( isset( $_COOKIE['zmEventScaleAuto'] ) ) { //If we're using scale to fit use it on all monitors
|
||||||
$scale = 'auto';
|
$scale = 'auto';
|
||||||
} else if (isset($_COOKIE['zmEventScale'.$Event->MonitorId()])) {
|
} else if ( isset( $_COOKIE['zmEventScale'.$Event->MonitorId()] ) ) {
|
||||||
$scale = $_COOKIE['zmEventScale'.$Event->MonitorId()];
|
$scale = $_COOKIE['zmEventScale'.$Event->MonitorId()];
|
||||||
} else {
|
} else {
|
||||||
$scale = reScale( SCALE_BASE, $Monitor->DefaultScale(), ZM_WEB_DEFAULT_SCALE );
|
$scale = reScale( SCALE_BASE, $Monitor->DefaultScale(), ZM_WEB_DEFAULT_SCALE );
|
||||||
|
|
|
@ -57,8 +57,10 @@ else
|
||||||
$limit = 0;
|
$limit = 0;
|
||||||
|
|
||||||
$nEvents = dbFetchOne( $countSql, 'EventCount' );
|
$nEvents = dbFetchOne( $countSql, 'EventCount' );
|
||||||
|
Warning("Number of events: $nEvents");
|
||||||
if ( !empty($limit) && $nEvents > $limit ) {
|
if ( !empty($limit) && $nEvents > $limit ) {
|
||||||
$nEvents = $limit;
|
$nEvents = $limit;
|
||||||
|
Logger::Debug("Number of events: $nEvents");
|
||||||
}
|
}
|
||||||
$pages = (int)ceil($nEvents/ZM_WEB_EVENTS_PER_PAGE);
|
$pages = (int)ceil($nEvents/ZM_WEB_EVENTS_PER_PAGE);
|
||||||
if ( !empty($page) ) {
|
if ( !empty($page) ) {
|
||||||
|
|
|
@ -154,6 +154,9 @@ if ( (null !== $filter->Concurrent()) and $filter->Concurrent() )
|
||||||
<input type="hidden" name="object" value="filter"/>
|
<input type="hidden" name="object" value="filter"/>
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
|
<?php if ( $filter->Id() ) { ?>
|
||||||
|
<p class="Id"><label><?php echo translate('Id') ?></label><?php echo $filter->Id() ?></p>
|
||||||
|
<?php } ?>
|
||||||
<p class="Name">
|
<p class="Name">
|
||||||
<label for="filter[Name]"><?php echo translate('Name') ?></label>
|
<label for="filter[Name]"><?php echo translate('Name') ?></label>
|
||||||
<input type="text" id="filter[Name]" name="filter[Name]" value="<?php echo $filter->Name() ?>"/>
|
<input type="text" id="filter[Name]" name="filter[Name]" value="<?php echo $filter->Name() ?>"/>
|
||||||
|
@ -161,7 +164,7 @@ if ( (null !== $filter->Concurrent()) and $filter->Concurrent() )
|
||||||
<table id="fieldsTable" class="filterTable">
|
<table id="fieldsTable" class="filterTable">
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
for ( $i = 0; $i < count($terms); $i++ ) {
|
for ( $i=0; $i < count($terms); $i++ ) {
|
||||||
$term = $terms[$i];
|
$term = $terms[$i];
|
||||||
if ( ! isset( $term['op'] ) )
|
if ( ! isset( $term['op'] ) )
|
||||||
$term['op'] = '=';
|
$term['op'] = '=';
|
||||||
|
@ -249,7 +252,7 @@ for ( $i = 0; $i < count($terms); $i++ ) {
|
||||||
} elseif ( $term['attr'] == 'ServerId' ) {
|
} elseif ( $term['attr'] == 'ServerId' ) {
|
||||||
$servers = array();
|
$servers = array();
|
||||||
$servers['ZM_SERVER_ID'] = 'Current Server';
|
$servers['ZM_SERVER_ID'] = 'Current Server';
|
||||||
foreach ( dbFetchAll( "SELECT Id,Name FROM Servers ORDER BY lower(Name) ASC" ) as $server ) {
|
foreach ( dbFetchAll( 'SELECT Id,Name FROM Servers ORDER BY lower(Name) ASC' ) as $server ) {
|
||||||
$servers[$server['Id']] = $server['Name'];
|
$servers[$server['Id']] = $server['Name'];
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -336,7 +339,6 @@ echo htmlSelect( 'filter[Query][sort_asc]', $sort_dirns, $filter->sort_asc() );
|
||||||
</table>
|
</table>
|
||||||
<hr/>
|
<hr/>
|
||||||
<div id="actionsTable" class="filterTable">
|
<div id="actionsTable" class="filterTable">
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<label><?php echo translate('FilterArchiveEvents') ?></label>
|
<label><?php echo translate('FilterArchiveEvents') ?></label>
|
||||||
<input type="checkbox" name="filter[AutoArchive]" value="1"<?php if ( !empty($filter->AutoArchive()) ) { ?> checked="checked"<?php } ?> onclick="updateButtons( this )"/>
|
<input type="checkbox" name="filter[AutoArchive]" value="1"<?php if ( !empty($filter->AutoArchive()) ) { ?> checked="checked"<?php } ?> onclick="updateButtons( this )"/>
|
||||||
|
|
|
@ -97,7 +97,7 @@ $j( function() {
|
||||||
function applySort(event, ui) {
|
function applySort(event, ui) {
|
||||||
var monitor_ids = $j(this).sortable('toArray');
|
var monitor_ids = $j(this).sortable('toArray');
|
||||||
var ajax = new Request.JSON( {
|
var ajax = new Request.JSON( {
|
||||||
url: '?request=console',
|
url: 'index.php?request=console',
|
||||||
data: { monitor_ids: monitor_ids, action: 'sort' },
|
data: { monitor_ids: monitor_ids, action: 'sort' },
|
||||||
method: 'post',
|
method: 'post',
|
||||||
timeout: AJAX_TIMEOUT
|
timeout: AJAX_TIMEOUT
|
||||||
|
|
|
@ -40,6 +40,8 @@ function vjsReplay() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$j.ajaxSetup ({timeout: AJAX_TIMEOUT }); //sets timeout for all getJSON.
|
||||||
|
|
||||||
var cueFrames = null; //make cueFrames availaible even if we don't send another ajax query
|
var cueFrames = null; //make cueFrames availaible even if we don't send another ajax query
|
||||||
|
|
||||||
function initialAlarmCues (eventId) {
|
function initialAlarmCues (eventId) {
|
||||||
|
|
|
@ -8,10 +8,10 @@ function changeScale() {
|
||||||
last: $j('#lastLink')
|
last: $j('#lastLink')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (img) {
|
if ( img ) {
|
||||||
let baseWidth = $j('#base_width').val();
|
let baseWidth = $j('#base_width').val();
|
||||||
let baseHeight = $j('#base_height').val();
|
let baseHeight = $j('#base_height').val();
|
||||||
if (scale == "auto") {
|
if ( scale == 'auto' ) {
|
||||||
let newSize = scaleToFit(baseWidth, baseHeight, img, $j('#controls'));
|
let newSize = scaleToFit(baseWidth, baseHeight, img, $j('#controls'));
|
||||||
newWidth = newSize.width;
|
newWidth = newSize.width;
|
||||||
newHeight = newSize.height;
|
newHeight = newSize.height;
|
||||||
|
@ -21,8 +21,8 @@ function changeScale() {
|
||||||
newWidth = baseWidth * scale / SCALE_BASE;
|
newWidth = baseWidth * scale / SCALE_BASE;
|
||||||
newHeight = baseHeight * scale / SCALE_BASE;
|
newHeight = baseHeight * scale / SCALE_BASE;
|
||||||
}
|
}
|
||||||
img.css('width', newWidth + "px");
|
img.css('width', newWidth + 'px');
|
||||||
img.css('height', newHeight + "px");
|
img.css('height', newHeight + 'px');
|
||||||
}
|
}
|
||||||
Cookie.write( 'zmWatchScale', scale, { duration: 10*365 } );
|
Cookie.write( 'zmWatchScale', scale, { duration: 10*365 } );
|
||||||
$j.each(controlsLinks, function(k, anchor) { //Make frames respect scale choices
|
$j.each(controlsLinks, function(k, anchor) { //Make frames respect scale choices
|
||||||
|
@ -31,5 +31,4 @@ function changeScale() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scale == "auto") $j(document).ready(changeScale);
|
if (scale == 'auto') $j(document).ready(changeScale);
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
var scale = "<?php echo $scale ?>";
|
var scale = '<?php echo $scale ?>';
|
||||||
|
|
||||||
var SCALE_BASE = <?php echo SCALE_BASE ?>;
|
var SCALE_BASE = <?php echo SCALE_BASE ?>;
|
||||||
|
|
Loading…
Reference in New Issue