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();
|
2004-01-08 18:09:35 +08:00
|
|
|
if ( isset( $HTTP_SESSION_VARS['user'] ) )
|
|
|
|
{
|
|
|
|
$user = $HTTP_SESSION_VARS['user'];
|
|
|
|
define( "ZMU_COMMAND", ZMU_PATH." -U ".$HTTP_SESSION_VARS['username']." -P ".$HTTP_SESSION_VARS['password'] );
|
|
|
|
}
|
2004-01-21 22:20:33 +08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
unset( $user );
|
|
|
|
}
|
2003-06-26 19:12:00 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$user = array(
|
|
|
|
"Username"=>"admin",
|
|
|
|
"Password"=>"",
|
2004-01-07 22:28:16 +08:00
|
|
|
"Language"=>"",
|
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
|
|
|
}
|
|
|
|
|
2004-01-07 20:57:07 +08:00
|
|
|
require_once( 'zm_lang.php' );
|
2003-06-30 04:53:55 +08:00
|
|
|
require_once( 'zm_funcs.php' );
|
|
|
|
require_once( 'zm_actions.php' );
|
|
|
|
|
2004-01-07 21:39:44 +08:00
|
|
|
$bw_array = array(
|
|
|
|
"high"=>$zmSlangHigh,
|
|
|
|
"medium"=>$zmSlangMedium,
|
|
|
|
"low"=>$zmSlangLow
|
|
|
|
);
|
|
|
|
|
2004-03-15 16:48:52 +08:00
|
|
|
$rates = array(
|
|
|
|
"10000" => "100x",
|
|
|
|
"5000" => "50x",
|
|
|
|
"2500" => "25x",
|
|
|
|
"1000" => "10x",
|
|
|
|
"400" => "4x",
|
|
|
|
"200" => "2x",
|
|
|
|
"100" => $zmSlangReal,
|
|
|
|
"50" => "1/2x",
|
|
|
|
"25" => "1/4x",
|
|
|
|
);
|
2004-01-07 20:57:07 +08:00
|
|
|
|
|
|
|
$scales = array(
|
2004-02-16 03:47:23 +08:00
|
|
|
"400" => "4x",
|
|
|
|
"300" => "3x",
|
|
|
|
"200" => "2x",
|
|
|
|
"150" => "1.5x",
|
|
|
|
"100" => $zmSlangActual,
|
|
|
|
"75" => "3/4x",
|
|
|
|
"50" => "1/2x",
|
|
|
|
"33" => "1/3x",
|
|
|
|
"25" => "1/4x",
|
2004-01-07 20:57:07 +08:00
|
|
|
);
|
|
|
|
|
2004-01-08 18:09:35 +08:00
|
|
|
if ( !isset($user) )
|
2003-06-26 19:12:00 +08:00
|
|
|
{
|
|
|
|
$view = "login";
|
|
|
|
}
|
2004-01-08 18:09:35 +08:00
|
|
|
elseif ( !isset($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-12-08 01:13:19 +08:00
|
|
|
case "state" :
|
2003-06-30 04:53:55 +08:00
|
|
|
case "bandwidth" :
|
2004-01-27 18:17:23 +08:00
|
|
|
case "version" :
|
2003-06-30 04:53:55 +08:00
|
|
|
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" :
|
2004-02-19 21:02:05 +08:00
|
|
|
case "montageframe" :
|
|
|
|
case "montagemenu" :
|
2003-03-21 20:22:56 +08:00
|
|
|
case "montagefeed" :
|
|
|
|
case "montagestatus" :
|
2002-10-28 04:25:27 +08:00
|
|
|
case "watch" :
|
2004-02-19 18:48:33 +08:00
|
|
|
case "watchmenu" :
|
2003-07-11 17:27:56 +08:00
|
|
|
case "watchfeed" :
|
|
|
|
case "watchstatus" :
|
|
|
|
case "watchevents" :
|
2004-02-19 21:02:05 +08:00
|
|
|
case "imagefetch" :
|
2004-02-19 18:48:33 +08:00
|
|
|
case "settings" :
|
2003-07-11 17:27:56 +08:00
|
|
|
case "events" :
|
|
|
|
case "filter" :
|
2002-11-28 00:21:49 +08:00
|
|
|
case "filtersave" :
|
2003-06-27 20:10:10 +08:00
|
|
|
case "event" :
|
2004-01-07 21:00:37 +08:00
|
|
|
case "frame" :
|
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
|
|
|
}
|
|
|
|
?>
|