2002-10-11 17:45:06 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
//
|
2002-12-10 21:23:22 +08:00
|
|
|
// ZoneMinder HTML interface file, $Date$, $Revision$
|
2003-01-12 02:22:27 +08:00
|
|
|
// Copyright (C) 2003 Philip Coombes
|
2002-10-11 17:45:06 +08:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 2
|
|
|
|
// 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 ( !$bandwidth )
|
|
|
|
{
|
2003-07-10 18:06:31 +08:00
|
|
|
$bandwidth = "low";
|
2002-10-11 17:45:06 +08:00
|
|
|
}
|
|
|
|
|
2003-06-26 19:12:00 +08:00
|
|
|
ini_set( "session.use_trans_sid", "0" );
|
|
|
|
ini_set( "session.name", "ZMSESSID" );
|
2003-07-04 04:39:02 +08:00
|
|
|
//ini_set( "magic_quotes_gpc", "Off" );
|
2003-06-26 19:12:00 +08:00
|
|
|
|
2003-06-30 06:12:50 +08:00
|
|
|
require_once( 'zm_config.php' );
|
|
|
|
|
2003-06-26 19:12:00 +08:00
|
|
|
if ( ZM_OPT_USE_AUTH )
|
|
|
|
{
|
2003-10-08 21:01:49 +08:00
|
|
|
session_start();
|
2003-06-26 19:12:00 +08:00
|
|
|
$user = $HTTP_SESSION_VARS[user];
|
2003-07-05 19:00:48 +08:00
|
|
|
define( "ZMU_COMMAND", ZMU_PATH." -U $HTTP_SESSION_VARS[username] -P $HTTP_SESSION_VARS[password]" );
|
2003-06-26 19:12:00 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$user = array(
|
|
|
|
"Username"=>"admin",
|
|
|
|
"Password"=>"",
|
2003-06-30 04:53:55 +08:00
|
|
|
"Enabled"=>1,
|
|
|
|
"Stream"=>'View',
|
|
|
|
"Events"=>'Edit',
|
|
|
|
"Monitors"=>'Edit',
|
|
|
|
"System"=>'Edit',
|
2003-06-26 19:12:00 +08:00
|
|
|
);
|
2003-07-04 23:07:52 +08:00
|
|
|
define( "ZMU_COMMAND", ZMU_PATH );
|
2003-06-26 19:12:00 +08:00
|
|
|
}
|
|
|
|
|
2003-06-30 04:53:55 +08:00
|
|
|
require_once( 'zm_funcs.php' );
|
|
|
|
require_once( 'zm_actions.php' );
|
|
|
|
|
2003-06-26 19:12:00 +08:00
|
|
|
if ( !$user )
|
|
|
|
{
|
|
|
|
$view = "login";
|
|
|
|
}
|
|
|
|
elseif ( !$view )
|
2002-10-11 17:45:06 +08:00
|
|
|
{
|
|
|
|
$view = "console";
|
|
|
|
}
|
|
|
|
|
2002-10-28 04:25:27 +08:00
|
|
|
switch( $view )
|
2002-10-11 17:45:06 +08:00
|
|
|
{
|
2003-06-26 19:12:00 +08:00
|
|
|
case "login" :
|
|
|
|
case "postlogin" :
|
2003-06-30 04:53:55 +08:00
|
|
|
case "logout" :
|
2002-10-28 04:25:27 +08:00
|
|
|
case "console" :
|
2003-06-30 04:53:55 +08:00
|
|
|
case "bandwidth" :
|
|
|
|
case "options" :
|
2003-07-04 04:39:02 +08:00
|
|
|
case "optionhelp" :
|
|
|
|
case "restarting" :
|
2003-06-30 04:53:55 +08:00
|
|
|
case "user" :
|
2002-10-28 04:25:27 +08:00
|
|
|
case "cycle" :
|
2003-03-21 20:22:56 +08:00
|
|
|
case "montage" :
|
|
|
|
case "montagefeed" :
|
|
|
|
case "montagestatus" :
|
2002-10-28 04:25:27 +08:00
|
|
|
case "watch" :
|
2003-07-11 17:27:56 +08:00
|
|
|
case "watchfeed" :
|
|
|
|
case "settings" :
|
|
|
|
case "watchstatus" :
|
|
|
|
case "watchevents" :
|
|
|
|
case "events" :
|
|
|
|
case "filter" :
|
2002-11-28 00:21:49 +08:00
|
|
|
case "filtersave" :
|
2003-06-27 20:10:10 +08:00
|
|
|
case "event" :
|
|
|
|
case "image" :
|
2003-11-05 23:52:22 +08:00
|
|
|
case "frames" :
|
2003-06-27 20:10:10 +08:00
|
|
|
case "stats" :
|
2002-10-28 04:25:27 +08:00
|
|
|
case "monitor" :
|
2003-06-27 20:10:10 +08:00
|
|
|
case "zones" :
|
2002-10-28 04:25:27 +08:00
|
|
|
case "zone" :
|
|
|
|
case "video" :
|
2003-04-14 23:24:19 +08:00
|
|
|
case "function" :
|
2003-07-11 17:27:56 +08:00
|
|
|
case "none" :
|
2003-04-14 23:24:19 +08:00
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
require_once( "zm_html_view_$view.php" );
|
2002-10-28 04:25:27 +08:00
|
|
|
break;
|
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
default :
|
2002-10-28 04:25:27 +08:00
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
$view = "error";
|
2002-10-28 04:25:27 +08:00
|
|
|
}
|
2002-10-11 17:45:06 +08:00
|
|
|
}
|
2002-10-22 21:56:37 +08:00
|
|
|
|
2003-06-27 20:10:10 +08:00
|
|
|
if ( $view == "error" )
|
2002-10-22 21:56:37 +08:00
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
require_once( "zm_html_view_$view.php" );
|
2002-10-22 21:56:37 +08:00
|
|
|
}
|
|
|
|
?>
|