2002-10-11 17:45:06 +08:00
|
|
|
<?php
|
|
|
|
//
|
2002-12-10 21:23:22 +08:00
|
|
|
// ZoneMinder HTML interface file, $Date$, $Revision$
|
2006-01-17 19:32:47 +08:00
|
|
|
// Copyright (C) 2003, 2004, 2005, 2006 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-07-04 04:39:02 +08:00
|
|
|
//ini_set( "magic_quotes_gpc", "Off" );
|
2003-06-26 19:12:00 +08:00
|
|
|
|
2006-05-05 18:55:18 +08:00
|
|
|
require_once( 'zm_html_config.php' );
|
2003-06-30 06:12:50 +08:00
|
|
|
|
2003-06-26 19:12:00 +08:00
|
|
|
if ( ZM_OPT_USE_AUTH )
|
|
|
|
{
|
2003-10-08 21:01:49 +08:00
|
|
|
session_start();
|
2005-01-17 00:08:35 +08:00
|
|
|
if ( isset( $_SESSION['user'] ) )
|
2004-01-08 18:09:35 +08:00
|
|
|
{
|
2005-01-17 00:08:35 +08:00
|
|
|
$user = $_SESSION['user'];
|
2004-01-08 18:09:35 +08:00
|
|
|
}
|
2004-01-21 22:20:33 +08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
unset( $user );
|
|
|
|
}
|
2003-06-26 19:12:00 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-05-05 18:55:18 +08:00
|
|
|
$user = $default_user;
|
2003-06-26 19:12:00 +08:00
|
|
|
}
|
|
|
|
|
2006-05-05 18:55:18 +08:00
|
|
|
require_once( 'zm_funcs.php' );
|
2004-01-07 20:57:07 +08:00
|
|
|
|
2005-11-05 01:04:14 +08:00
|
|
|
if ( !isset($user) && ZM_OPT_USE_AUTH )
|
2003-06-26 19:12:00 +08:00
|
|
|
{
|
2005-11-05 01:04:14 +08:00
|
|
|
if ( ZM_AUTH_TYPE == "remote" && !empty( $_SERVER['REMOTE_USER'] ) )
|
2005-10-20 23:42:41 +08:00
|
|
|
{
|
2005-11-05 01:04:14 +08:00
|
|
|
$view = "postlogin";
|
|
|
|
$action = "login";
|
|
|
|
$username = $_SERVER['REMOTE_USER'];
|
2005-10-20 23:42:41 +08:00
|
|
|
}
|
2003-06-26 19:12:00 +08:00
|
|
|
}
|
2005-11-05 01:04:14 +08:00
|
|
|
|
|
|
|
require_once( 'zm_actions.php' );
|
|
|
|
|
|
|
|
if ( !isset($user) )
|
|
|
|
{
|
|
|
|
$view = "login";
|
|
|
|
}
|
2005-10-21 01:02:45 +08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// Bandwidth Limiter
|
|
|
|
if ( !empty($user['MaxBandwidth']) )
|
|
|
|
{
|
|
|
|
if ( $user['MaxBandwidth'] == "low" )
|
|
|
|
{
|
|
|
|
$bandwidth = "low";
|
|
|
|
}
|
2005-11-10 20:04:14 +08:00
|
|
|
elseif ( $user['MaxBandwidth'] == "medium" && $bandwidth == "high" )
|
2005-10-21 01:02:45 +08:00
|
|
|
{
|
|
|
|
$bandwidth = "medium";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-10-20 23:42:41 +08:00
|
|
|
if ( !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-30 04:53:55 +08:00
|
|
|
case "bandwidth" :
|
2006-01-23 20:11:13 +08:00
|
|
|
case "console" :
|
|
|
|
case "control" :
|
|
|
|
case "controlcap" :
|
|
|
|
case "controlcaps" :
|
|
|
|
case "controlmenu" :
|
|
|
|
case "controlpanel" :
|
|
|
|
case "controlpreset" :
|
2002-10-28 04:25:27 +08:00
|
|
|
case "cycle" :
|
2006-01-23 20:11:13 +08:00
|
|
|
case "donate" :
|
2003-06-27 20:10:10 +08:00
|
|
|
case "event" :
|
2005-05-16 20:03:28 +08:00
|
|
|
case "eventdetail" :
|
2006-01-23 20:11:13 +08:00
|
|
|
case "events" :
|
2005-05-18 05:51:39 +08:00
|
|
|
case "export" :
|
2006-01-23 20:11:13 +08:00
|
|
|
case "filter" :
|
|
|
|
case "filtersave" :
|
2004-01-07 21:00:37 +08:00
|
|
|
case "frame" :
|
2003-11-05 23:52:22 +08:00
|
|
|
case "frames" :
|
2006-01-23 20:11:13 +08:00
|
|
|
case "function" :
|
2006-01-24 00:25:01 +08:00
|
|
|
case "group" :
|
2006-01-23 20:11:13 +08:00
|
|
|
case "groups" :
|
|
|
|
case "login" :
|
|
|
|
case "logout" :
|
2002-10-28 04:25:27 +08:00
|
|
|
case "monitor" :
|
2006-01-01 02:08:07 +08:00
|
|
|
case "monitorpreset" :
|
2006-01-23 20:11:13 +08:00
|
|
|
case "monitorselect" :
|
|
|
|
case "montage" :
|
|
|
|
case "montagefeed" :
|
|
|
|
case "montageframe" :
|
|
|
|
case "montagemenu" :
|
|
|
|
case "montagestatus" :
|
|
|
|
case "optionhelp" :
|
|
|
|
case "options" :
|
|
|
|
case "postlogin" :
|
|
|
|
case "restarting" :
|
|
|
|
case "settings" :
|
|
|
|
case "siren" :
|
|
|
|
case "state" :
|
|
|
|
case "stats" :
|
2006-05-19 21:28:30 +08:00
|
|
|
case "status" :
|
2006-01-23 20:11:13 +08:00
|
|
|
case "timeline" :
|
|
|
|
case "user" :
|
|
|
|
case "version" :
|
2002-10-28 04:25:27 +08:00
|
|
|
case "video" :
|
2006-01-23 20:11:13 +08:00
|
|
|
case "watch" :
|
|
|
|
case "watchevents" :
|
|
|
|
case "watchfeed" :
|
|
|
|
case "watchmenu" :
|
|
|
|
case "watchstatus" :
|
|
|
|
case "zone" :
|
|
|
|
case "zones" :
|
2005-02-24 18:43:29 +08:00
|
|
|
case "blank" :
|
2003-07-11 17:27:56 +08:00
|
|
|
case "none" :
|
2003-04-14 23:24:19 +08:00
|
|
|
{
|
2004-12-29 02:20:11 +08:00
|
|
|
require_once( "zm_".$format."_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
|
|
|
{
|
2004-12-29 02:20:11 +08:00
|
|
|
require_once( "zm_".$format."_view_".$view.".php" );
|
2002-10-22 21:56:37 +08:00
|
|
|
}
|
|
|
|
?>
|