2002-10-11 17:45:06 +08:00
|
|
|
<?php
|
|
|
|
//
|
2004-12-29 02:20:11 +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.
|
|
|
|
//
|
|
|
|
|
2004-12-29 02:20:11 +08:00
|
|
|
$bandwidth = "phone";
|
2003-01-03 23:08:24 +08:00
|
|
|
|
2004-12-29 02:20:11 +08:00
|
|
|
//ini_set( "magic_quotes_gpc", "Off" );
|
2002-10-11 17:45:06 +08:00
|
|
|
|
2004-12-29 02:20:11 +08:00
|
|
|
require_once( 'zm_config.php' );
|
2002-10-11 17:45:06 +08:00
|
|
|
|
2004-12-29 02:20:11 +08:00
|
|
|
if ( ZM_OPT_USE_AUTH )
|
|
|
|
{
|
|
|
|
session_start();
|
2005-01-17 00:08:35 +08:00
|
|
|
if ( isset( $_SESSION['user'] ) )
|
2004-12-29 02:20:11 +08:00
|
|
|
{
|
2005-01-17 00:08:35 +08:00
|
|
|
$user = $_SESSION['user'];
|
2004-12-29 02:20:11 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
unset( $user );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$user = array(
|
|
|
|
"Username"=>"admin",
|
|
|
|
"Password"=>"",
|
|
|
|
"Language"=>"",
|
|
|
|
"Enabled"=>1,
|
|
|
|
"Stream"=>'View',
|
|
|
|
"Events"=>'Edit',
|
|
|
|
"Monitors"=>'Edit',
|
|
|
|
"System"=>'Edit',
|
|
|
|
);
|
|
|
|
}
|
2002-10-11 17:45:06 +08:00
|
|
|
|
2004-01-07 20:57:07 +08:00
|
|
|
require_once( 'zm_lang.php' );
|
2003-03-26 20:40:23 +08:00
|
|
|
require_once( 'zm_funcs.php' );
|
|
|
|
require_once( 'zm_actions.php' );
|
2002-10-11 17:45:06 +08:00
|
|
|
|
2004-12-29 02:20:11 +08:00
|
|
|
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
|
|
|
|
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
|
|
|
|
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
|
|
|
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
|
|
|
header("Pragma: no-cache"); // HTTP/1.0
|
|
|
|
header("Content-type: text/vnd.wap.wml");
|
2002-10-11 17:45:06 +08:00
|
|
|
|
2004-12-29 02:20:11 +08:00
|
|
|
echo( '<?xml version="1.0" encoding="iso-8859-1"?>'."\n" );
|
|
|
|
//echo( '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">'."\n" );
|
|
|
|
echo( '<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">'."\n" );
|
2002-10-11 17:45:06 +08:00
|
|
|
|
2004-12-29 02:20:11 +08:00
|
|
|
ob_start();
|
|
|
|
|
|
|
|
$rates = array(
|
|
|
|
"10000" => "100x",
|
|
|
|
"5000" => "50x",
|
|
|
|
"2500" => "25x",
|
|
|
|
"1000" => "10x",
|
|
|
|
"400" => "4x",
|
|
|
|
"200" => "2x",
|
|
|
|
"100" => $zmSlangReal,
|
|
|
|
"50" => "1/2x",
|
|
|
|
"25" => "1/4x",
|
|
|
|
);
|
|
|
|
|
|
|
|
$scales = array(
|
|
|
|
"400" => "4x",
|
|
|
|
"300" => "3x",
|
|
|
|
"200" => "2x",
|
|
|
|
"150" => "1.5x",
|
|
|
|
"100" => $zmSlangActual,
|
|
|
|
"75" => "3/4x",
|
|
|
|
"50" => "1/2x",
|
|
|
|
"33" => "1/3x",
|
|
|
|
"25" => "1/4x",
|
|
|
|
);
|
|
|
|
|
|
|
|
if ( !isset($user) )
|
|
|
|
{
|
|
|
|
$view = "login";
|
|
|
|
}
|
|
|
|
elseif ( !isset($view) )
|
2002-10-11 17:45:06 +08:00
|
|
|
{
|
|
|
|
$view = "console";
|
|
|
|
}
|
|
|
|
|
2003-07-11 17:27:56 +08:00
|
|
|
switch( $view )
|
2002-10-11 17:45:06 +08:00
|
|
|
{
|
2004-12-29 02:20:11 +08:00
|
|
|
case "login" :
|
|
|
|
case "postlogin" :
|
|
|
|
case "logout" :
|
2003-07-11 17:27:56 +08:00
|
|
|
case "console" :
|
2004-12-29 02:20:11 +08:00
|
|
|
case "state" :
|
|
|
|
case "cycle" :
|
|
|
|
case "watch" :
|
|
|
|
case "watchfeed" :
|
|
|
|
case "watchstatus" :
|
|
|
|
case "imagefetch" :
|
|
|
|
case "settings" :
|
|
|
|
case "events" :
|
|
|
|
case "filter" :
|
|
|
|
case "filtersave" :
|
|
|
|
case "event" :
|
|
|
|
case "frame" :
|
|
|
|
case "frames" :
|
|
|
|
case "monitor" :
|
|
|
|
case "video" :
|
|
|
|
case "function" :
|
|
|
|
case "none" :
|
2002-10-11 17:45:06 +08:00
|
|
|
{
|
2004-12-29 02:20:11 +08:00
|
|
|
require_once( "zm_".$format."_view_".$view.".php" );
|
2003-07-11 17:27:56 +08:00
|
|
|
break;
|
2002-10-11 17:45:06 +08:00
|
|
|
}
|
2004-12-29 02:20:11 +08:00
|
|
|
default :
|
|
|
|
{
|
|
|
|
$view = "error";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $view == "error" )
|
|
|
|
{
|
|
|
|
require_once( "zm_".$format."_view_".$view.".php" );
|
2002-10-11 17:45:06 +08:00
|
|
|
}
|
2004-12-29 02:20:11 +08:00
|
|
|
|
|
|
|
$fp = fopen( "/tmp/output.html", "w" );
|
|
|
|
fwrite( $fp, ob_get_contents() );
|
|
|
|
fclose( $fp );
|
|
|
|
ob_end_flush();
|
|
|
|
|
|
|
|
?>
|