2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
//
|
|
|
|
// ZoneMinder web options view file, $Date$, $Revision$
|
2006-01-17 19:32:47 +08:00
|
|
|
// Copyright (C) 2003, 2004, 2005, 2006 Philip Coombes
|
2004-01-08 19:45:57 +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 ( !canView( 'System' ) )
|
|
|
|
{
|
|
|
|
$view = "error";
|
|
|
|
return;
|
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
|
2004-01-08 19:45:57 +08:00
|
|
|
$tabs = array();
|
|
|
|
$tabs['system'] = $zmSlangSystem;
|
2004-03-15 07:27:36 +08:00
|
|
|
$tabs['config'] = $zmSlangConfig;
|
2005-10-20 23:42:41 +08:00
|
|
|
$tabs['paths'] = $zmSlangPaths;
|
2004-01-08 19:45:57 +08:00
|
|
|
$tabs['web'] = $zmSlangWeb;
|
2006-01-15 06:48:32 +08:00
|
|
|
$tabs['tools'] = $zmSlangTools;
|
|
|
|
$tabs['debug'] = $zmSlangDebug;
|
|
|
|
$tabs['network'] = $zmSlangNetwork;
|
2004-01-08 19:45:57 +08:00
|
|
|
$tabs['mail'] = $zmSlangEmail;
|
|
|
|
$tabs['ftp'] = $zmSlangFTP;
|
|
|
|
$tabs['x10'] = $zmSlangX10;
|
|
|
|
$tabs['highband'] = $zmSlangHighBW;
|
|
|
|
$tabs['medband'] = $zmSlangMediumBW;
|
|
|
|
$tabs['lowband'] = $zmSlangLowBW;
|
|
|
|
$tabs['phoneband'] = $zmSlangPhoneBW;
|
|
|
|
if ( ZM_OPT_USE_AUTH )
|
|
|
|
$tabs['users'] = $zmSlangUsers;
|
|
|
|
|
|
|
|
if ( !isset($tab) )
|
|
|
|
$tab = "system";
|
2003-07-11 17:27:56 +08:00
|
|
|
|
|
|
|
?>
|
2004-12-29 03:22:23 +08:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2003-07-11 17:27:56 +08:00
|
|
|
<html>
|
|
|
|
<head>
|
2005-05-06 20:24:57 +08:00
|
|
|
<title><?= ZM_WEB_TITLE_PREFIX ?> - <?= $zmSlangOptions ?></title>
|
2004-12-29 02:20:11 +08:00
|
|
|
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
|
2004-12-29 03:29:43 +08:00
|
|
|
<script type="text/javascript">
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
if ( !empty($refresh_parent) )
|
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
opener.location.reload(true);
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
window.focus();
|
|
|
|
|
|
|
|
function configureButton(form,name)
|
|
|
|
{
|
|
|
|
var checked = false;
|
|
|
|
for (var i = 0; i < form.elements.length; i++)
|
|
|
|
{
|
|
|
|
if ( form.elements[i].name.indexOf(name) == 0)
|
|
|
|
{
|
|
|
|
if ( form.elements[i].checked )
|
|
|
|
{
|
|
|
|
checked = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
form.delete_btn.disabled = !checked;
|
|
|
|
}
|
|
|
|
|
|
|
|
function newWindow(Url,Name,Width,Height)
|
|
|
|
{
|
|
|
|
window.open(Url,Name,"resizable,width="+Width+",height="+Height);
|
|
|
|
}
|
|
|
|
|
|
|
|
function closeWindow()
|
|
|
|
{
|
|
|
|
window.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
if ( $tab == 'users' )
|
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
function validateForm( form )
|
|
|
|
{
|
|
|
|
return( true );
|
|
|
|
}
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
|
|
|
|
function validateForm( form )
|
|
|
|
{
|
|
|
|
var errors = Array();
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
$config_cat = $config_cats[$tab];
|
2003-07-11 17:27:56 +08:00
|
|
|
|
2004-01-08 19:45:57 +08:00
|
|
|
foreach ( $config_cat as $name=>$value )
|
|
|
|
{
|
|
|
|
if ( 0 && $value['Type'] == "boolean" )
|
2003-07-11 17:27:56 +08:00
|
|
|
{
|
|
|
|
?>
|
|
|
|
if ( !form.<?= $name ?>.value )
|
|
|
|
{
|
|
|
|
form.<?= $name ?>.value = 0;
|
|
|
|
}
|
|
|
|
<?php
|
|
|
|
}
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
return( true );
|
|
|
|
}
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="4" width="100%">
|
|
|
|
<tr>
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
foreach ( $tabs as $name=>$value )
|
|
|
|
{
|
|
|
|
if ( $tab == $name )
|
2003-07-11 17:27:56 +08:00
|
|
|
{
|
|
|
|
?>
|
|
|
|
<td width="10" class="activetab"><?= $value ?></td>
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
2005-10-21 01:02:45 +08:00
|
|
|
<td width="10" class="passivetab"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&tab=<?= $name ?>"><?= $value ?></a></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
|
|
|
}
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
<td class="nontab"> </td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2005-11-20 20:16:02 +08:00
|
|
|
<table border="0" cellspacing="1" cellpadding="1" width="100%">
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
if ( $tab == "users" )
|
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
2003-12-16 22:30:23 +08:00
|
|
|
<form name="user_form" method="post" action="<?= $PHP_SELF ?>" onSubmit="validateForm( this )">
|
2003-07-11 17:27:56 +08:00
|
|
|
<input type="hidden" name="view" value="<?= $view ?>">
|
|
|
|
<input type="hidden" name="tab" value="<?= $tab ?>">
|
|
|
|
<input type="hidden" name="action" value="delete">
|
|
|
|
<tr>
|
2004-01-07 20:57:07 +08:00
|
|
|
<td align="left" class="smallhead"><?= $zmSlangId ?></td>
|
|
|
|
<td align="left" class="smallhead"><?= $zmSlangUsername ?></td>
|
2004-01-07 21:24:44 +08:00
|
|
|
<td align="left" class="smallhead"><?= $zmSlangLanguage ?></td>
|
2004-01-07 20:57:07 +08:00
|
|
|
<td align="left" class="smallhead"><?= $zmSlangEnabled ?></td>
|
|
|
|
<td align="left" class="smallhead"><?= $zmSlangStream ?></td>
|
|
|
|
<td align="left" class="smallhead"><?= $zmSlangEvents ?></td>
|
2005-10-17 05:11:44 +08:00
|
|
|
<td align="left" class="smallhead"><?= $zmSlangControl ?></td>
|
2004-01-07 20:57:07 +08:00
|
|
|
<td align="left" class="smallhead"><?= $zmSlangMonitors ?></td>
|
|
|
|
<td align="left" class="smallhead"><?= $zmSlangSystem ?></td>
|
2005-10-21 01:02:45 +08:00
|
|
|
<td align="left" class="smallhead"><?= $zmSlangBandwidth ?></td>
|
2004-01-07 20:57:07 +08:00
|
|
|
<td align="left" class="smallhead"><?= $zmSlangMonitor ?></td>
|
|
|
|
<td align="left" class="smallhead"><?= $zmSlangMark ?></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
</tr>
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
$result = mysql_query( "select * from Users" );
|
|
|
|
if ( !$result )
|
|
|
|
die( mysql_error() );
|
|
|
|
while( $row = mysql_fetch_assoc( $result ) )
|
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
<tr onMouseOver="this.className='over'" onMouseOut="this.className='out'">
|
2004-01-08 18:09:35 +08:00
|
|
|
<td align="left" class="ruled"><?= $row['Id'] ?></td>
|
|
|
|
<td align="left" class="ruled"><?= makeLink( "javascript: newWindow( '$PHP_SELF?view=user&uid=".$row['Id']."', 'zmUser', ".$jws['user']['w'].", ".$jws['user']['h']." );", $row['Username'].($user['Username']==$row['Username']?"*":""), canEdit( 'System' ) ) ?></td>
|
|
|
|
<td align="left" class="ruled"><?= $row['Language']?$row['Language']:'default' ?></td>
|
|
|
|
<td align="left" class="ruled"><?= $row['Enabled']?$zmSlangYes:$zmSlangNo ?></td>
|
|
|
|
<td align="left" class="ruled"><?= $row['Stream'] ?></td>
|
|
|
|
<td align="left" class="ruled"><?= $row['Events'] ?></td>
|
2005-10-17 05:11:44 +08:00
|
|
|
<td align="left" class="ruled"><?= $row['Control'] ?></td>
|
2004-01-08 18:09:35 +08:00
|
|
|
<td align="left" class="ruled"><?= $row['Monitors'] ?></td>
|
|
|
|
<td align="left" class="ruled"><?= $row['System'] ?></td>
|
2005-10-21 01:02:45 +08:00
|
|
|
<td align="left" class="ruled"><?= $row['MaxBandwidth']?$bw_array[$row['MaxBandwidth']]:' ' ?></td>
|
2004-01-08 18:09:35 +08:00
|
|
|
<td align="left" class="ruled"><?= $row['MonitorIds']?$row['MonitorIds']:" " ?></td>
|
|
|
|
<td align="center" class="ruled"><input type="checkbox" name="mark_uids[]" value="<?= $row['Id'] ?>" onClick="configureButton( document.user_form, 'mark_uids' );"<?php if ( !canEdit( 'System' ) ) { ?> disabled<?php } ?>></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
</tr>
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
2006-01-15 21:09:30 +08:00
|
|
|
mysql_free_result( $result );
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
2005-10-21 01:02:45 +08:00
|
|
|
<tr><td colspan="12" class="ruled"> </td></tr>
|
|
|
|
<tr><td colspan="12" align="right"><input type="button" value="<?= $zmSlangAddNewUser ?>" class="form" onClick="javascript: newWindow( '<?= $PHP_SELF ?>?view=user&uid=-1', 'zmUser', <?= $jws['user']['w'] ?>, <?= $jws['user']['h'] ?> );"<?php if ( !canEdit( 'System' ) ) { ?> disabled<?php } ?>> <input type="submit" name="delete_btn" value="<?= $zmSlangDelete ?>" class="form" disabled> <input type="button" value="<?= $zmSlangCancel ?>" class="form" onClick="closeWindow();"></td></tr>
|
2003-07-11 17:27:56 +08:00
|
|
|
</form>
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-01-05 19:11:38 +08:00
|
|
|
if ( $tab == "system" )
|
|
|
|
{
|
|
|
|
$config_cats[$tab]['ZM_LANG_DEFAULT']['Hint'] = join( '|', getLanguages() );
|
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
<form name="options_form" method="post" action="<?= $PHP_SELF ?>" onSubmit="return( validateForm( document.options_form ) );">
|
|
|
|
<input type="hidden" name="view" value="<?= $view ?>">
|
|
|
|
<input type="hidden" name="tab" value="<?= $tab ?>">
|
|
|
|
<input type="hidden" name="action" value="options">
|
|
|
|
<tr>
|
2004-01-07 20:57:07 +08:00
|
|
|
<td align="left" class="smallhead"><?= $zmSlangName ?></td>
|
|
|
|
<td align="left" class="smallhead"><?= $zmSlangDescription ?></td>
|
|
|
|
<td align="left" class="smallhead"><?= $zmSlangValue ?></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
</tr>
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
$config_cat = $config_cats[$tab];
|
2003-07-11 17:27:56 +08:00
|
|
|
|
2004-01-08 19:45:57 +08:00
|
|
|
foreach ( $config_cat as $name=>$value )
|
|
|
|
{
|
2004-01-21 18:52:54 +08:00
|
|
|
$option_prompt_var = "zmOlangPrompt".preg_replace( '/^ZM_/', '', $value['Name'] );
|
2006-01-18 05:11:49 +08:00
|
|
|
$option_prompt_text = isset($$option_prompt_var)?$$option_prompt_var:$value['Prompt'];
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
<tr>
|
2004-01-08 18:09:35 +08:00
|
|
|
<td align="left" class="text"><?= $value['Name'] ?></td>
|
2005-11-03 18:48:09 +08:00
|
|
|
<td align="left" class="text"><?= htmlentities($option_prompt_text) ?> (<a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=optionhelp&option=<?= $value['Name'] ?>', 'zmOptionHelp', <?= $jws['optionhelp']['w'] ?>, <?= $jws['optionhelp']['h'] ?>);">?</a>)</td>
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
if ( $value['Type'] == "boolean" )
|
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
2004-01-08 18:09:35 +08:00
|
|
|
<td align="left" class="text"><input type="checkbox" class="text" id="<?= $value['Name'] ?>" name="new_config[<?= $value['Name'] ?>]" value="1"<?php if ( $value['Value'] ) { ?> checked<?php } ?>></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
|
|
|
elseif ( preg_match( "/\|/", $value['Hint'] ) )
|
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
2005-10-17 05:11:44 +08:00
|
|
|
<td align="left" class="text"><nobr>
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
2005-10-20 01:51:34 +08:00
|
|
|
$options = split( "\|", $value['Hint'] );
|
|
|
|
if ( count( $options ) > 3 )
|
2004-01-08 19:45:57 +08:00
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
2005-10-20 01:51:34 +08:00
|
|
|
<select name="new_config[<?= $value['Name'] ?>] ?>" class="form">
|
|
|
|
<?php
|
|
|
|
foreach ( $options as $option )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<option value="<?= $option ?>"<?php if ( $value['Value'] == $option ) { echo " selected"; } ?>><?= htmlentities($option) ?></option>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
foreach ( $options as $option )
|
|
|
|
{
|
|
|
|
?>
|
2004-01-08 18:09:35 +08:00
|
|
|
<input type="radio" class="text" id="<?= $value['Name'] ?>" name="new_config[<?= $value['Name'] ?>]" value="<?= $option ?>"<?php if ( $value['Value'] == $option ) { ?> checked<?php } ?>> <?= $option ?>
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
2005-10-20 01:51:34 +08:00
|
|
|
}
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
2005-10-17 05:11:44 +08:00
|
|
|
</nobr></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
|
|
|
elseif ( $value['Type'] == "text" )
|
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
2004-01-08 18:09:35 +08:00
|
|
|
<td align="left" class="text"><textarea class="form" id="<?= $value['Name'] ?>" name="new_config[<?= $value['Name'] ?>]" rows="5" cols="40"><?= htmlspecialchars($value['Value']) ?></textarea></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
|
|
|
elseif ( $value['Type'] == "integer" )
|
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
2004-01-08 18:09:35 +08:00
|
|
|
<td align="left" class="text"><input type="text" class="form" id="<?= $value['Name'] ?>" name="new_config[<?= $value['Name'] ?>]" value="<?= $value['Value'] ?>" size="8"></td>
|
2005-10-20 23:42:41 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
elseif ( $value['Type'] == "hexadecimal" )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<td align="left" class="text"><input type="text" class="form" id="<?= $value['Name'] ?>" name="new_config[<?= $value['Name'] ?>]" value="<?= $value['Value'] ?>" size="12"></td>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
elseif ( $value['Type'] == "decimal" )
|
|
|
|
{
|
|
|
|
?>
|
|
|
|
<td align="left" class="text"><input type="text" class="form" id="<?= $value['Name'] ?>" name="new_config[<?= $value['Name'] ?>]" value="<?= $value['Value'] ?>" size="8"></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
2005-01-16 02:48:22 +08:00
|
|
|
<td align="left" class="text"><input type="text" class="form" id="<?= $value['Name'] ?>" name="new_config[<?= $value['Name'] ?>]" value="<?= $value['Value'] ?>" size="32"></td>
|
2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
</tr>
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
2004-01-07 20:57:07 +08:00
|
|
|
<tr><td colspan="3" align="right"><input type="submit" value="<?= $zmSlangSave ?>" class="form"> <input type="button" value="<?= $zmSlangCancel ?>" class="form" onClick="closeWindow();"></td></tr>
|
2003-07-11 17:27:56 +08:00
|
|
|
</form>
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
</table>
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
if ( !empty($restart) )
|
|
|
|
{
|
|
|
|
flush();
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
2004-12-29 03:29:43 +08:00
|
|
|
<script type="text/javascript">
|
2004-01-07 20:57:07 +08:00
|
|
|
alert( "<?= $zmSlangOptionRestartWarning ?>" );
|
2003-07-11 17:27:56 +08:00
|
|
|
</script>
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
</body>
|
|
|
|
</html>
|