2003-07-11 17:27:56 +08:00
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
//
|
|
|
|
// ZoneMinder web options view file, $Date$, $Revision$
|
|
|
|
// Copyright (C) 2003 Philip Coombes
|
|
|
|
//
|
|
|
|
// 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;
|
|
|
|
$tabs['paths'] = $zmSlangPaths;
|
|
|
|
$tabs['video'] = $zmSlangVideo;
|
|
|
|
$tabs['network'] = $zmSlangNetwork;
|
|
|
|
$tabs['web'] = $zmSlangWeb;
|
|
|
|
$tabs['mail'] = $zmSlangEmail;
|
|
|
|
$tabs['ftp'] = $zmSlangFTP;
|
|
|
|
$tabs['x10'] = $zmSlangX10;
|
|
|
|
$tabs['tools'] = $zmSlangTools;
|
|
|
|
$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
|
|
|
|
|
|
|
?>
|
|
|
|
<html>
|
|
|
|
<head>
|
2004-01-07 20:57:07 +08:00
|
|
|
<title>ZM - <?= $zmSlangOptions ?></title>
|
2003-07-11 17:27:56 +08:00
|
|
|
<link rel="stylesheet" href="zm_styles.css" type="text/css">
|
|
|
|
<script language="JavaScript">
|
|
|
|
<?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
|
|
|
?>
|
|
|
|
<td width="10" class="passivetab"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&tab=<?= $name ?>"?><?= $value ?></a></td>
|
|
|
|
<?php
|
|
|
|
}
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
<td class="nontab"> </td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<?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>
|
|
|
|
<td align="left" class="smallhead"><?= $zmSlangMonitors ?></td>
|
|
|
|
<td align="left" class="smallhead"><?= $zmSlangSystem ?></td>
|
|
|
|
<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>
|
|
|
|
<td align="left" class="ruled"><?= $row['Monitors'] ?></td>
|
|
|
|
<td align="left" class="ruled"><?= $row['System'] ?></td>
|
|
|
|
<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
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
<tr><td colspan="10" class="ruled"> </td></tr>
|
2004-01-07 20:57:07 +08:00
|
|
|
<tr><td colspan="10" 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
|
|
|
|
{
|
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 )
|
|
|
|
{
|
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>
|
|
|
|
<td align="left" class="text"><?= $value['Prompt'] ?> (<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
|
|
|
?>
|
|
|
|
<td align="left" class="text">
|
|
|
|
<?php
|
2004-01-08 19:45:57 +08:00
|
|
|
foreach ( split( "\|", $value['Hint'] ) as $option )
|
|
|
|
{
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
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
|
2004-01-08 19:45:57 +08:00
|
|
|
}
|
2003-07-11 17:27:56 +08:00
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
<?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>
|
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
|
|
|
?>
|
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="40"></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
|
|
|
?>
|
|
|
|
<script language="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>
|