示例#1
0
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//
/* 
 * console.php is updated by Jai Dhar, FPS-Tech, for use with eyeZm
 * iPhone application. This is not intended for use with any other applications,
 * although source-code is provided under GPL.
 *
 * For questions, please email support@eyezm.com (http://www.eyezm.com)
 *
 */
$eventCounts = array(array("title" => $SLANG['Events'], "filter" => array("terms" => array())), array("title" => $SLANG['Hour'], "filter" => array("terms" => array(array("attr" => "Archived", "op" => "=", "val" => "0"), array("cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 hour")))), array("title" => $SLANG['Day'], "filter" => array("terms" => array(array("attr" => "Archived", "op" => "=", "val" => "0"), array("cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 day")))), array("title" => $SLANG['Week'], "filter" => array("terms" => array(array("attr" => "Archived", "op" => "=", "val" => "0"), array("cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-7 day")))), array("title" => $SLANG['Month'], "filter" => array("terms" => array(array("attr" => "Archived", "op" => "=", "val" => "0"), array("cnj" => "and", "attr" => "DateTime", "op" => ">=", "val" => "-1 month")))), array("title" => $SLANG['Archived'], "filter" => array("terms" => array(array("attr" => "Archived", "op" => "=", "val" => "1")))));
$running = daemonCheck();
$status = $running ? $SLANG['Running'] : $SLANG['Stopped'];
if ($group = dbFetchOne("select * from Groups where Id = '" . (empty($_COOKIE['zmGroup']) ? 0 : dbEscape($_COOKIE['zmGroup'])) . "'")) {
    $groupIds = array_flip(split(',', $group['MonitorIds']));
}
$maxWidth = 0;
$maxHeight = 0;
$cycleCount = 0;
$minSequence = 0;
$maxSequence = 1;
$seqIdList = array();
$monitors = dbFetchAll("select * from Monitors order by Sequence asc");
$displayMonitors = array();
for ($i = 0; $i < count($monitors); $i++) {
    if (!visibleMonitor($monitors[$i]['Id'])) {
        continue;
示例#2
0
function zmaCheck($monitor)
{
    if (is_array($monitor)) {
        $monitor = $monitor['Id'];
    }
    return daemonCheck("zma", "-m {$monitor}");
}
示例#3
0
         }
         if ($monitor['Controllable']) {
             require_once 'control_functions.php';
             sendControlCommand($mid, 'quit');
         }
         //daemonControl( 'restart', 'zmwatch.pl' );
         $refreshParent = true;
     }
     $view = 'none';
 }
 if ($action == "delete") {
     if (isset($_REQUEST['markMids']) && !$user['MonitorIds']) {
         foreach ($_REQUEST['markMids'] as $markMid) {
             if (canEdit('Monitors', $markMid)) {
                 if ($monitor = dbFetchOne("select * from Monitors where Id = ?", NULL, array($markMid))) {
                     if (daemonCheck()) {
                         zmaControl($monitor, "stop");
                         zmcControl($monitor, "stop");
                     }
                     // This is the important stuff
                     dbQuery("delete from Monitors where Id = ?", array($markMid));
                     dbQuery("delete from Zones where MonitorId = ?", array($markMid));
                     if (ZM_OPT_X10) {
                         dbQuery("delete from TriggersX10 where MonitorId=?", array($markMid));
                     }
                     fixSequences();
                     // If fast deletes are on, then zmaudit will clean everything else up later
                     // If fast deletes are off and there are lots of events then this step may
                     // well time out before completing, in which case zmaudit will still tidy up
                     if (!ZM_OPT_FAST_DELETE) {
                         // Slight hack, we maybe should load *, but we happen to know that the deleteEvent function uses Id and StartTime.
示例#4
0
<?php

//
// Copyright (C) 2013 Kevin Varley at Emergent Ltd
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//
if (!isset($_SESSION['user']['Username']) || !canEdit('System')) {
    die("Access denied. <a href=\"?view=login\">Login</a>");
}
echo daemonCheck();