2015-08-16 22:52:47 +08:00
|
|
|
<?php
|
|
|
|
//
|
|
|
|
// ZoneMinder web user view file, $Date$, $Revision$
|
|
|
|
// Copyright (C) 2001-2008 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
|
2016-12-26 23:23:16 +08:00
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2015-08-16 22:52:47 +08:00
|
|
|
//
|
|
|
|
|
2017-10-16 23:31:35 +08:00
|
|
|
if ( !canEdit( 'System' ) ) {
|
|
|
|
$view = 'error';
|
|
|
|
return;
|
2015-08-16 22:52:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( $_REQUEST['id'] ) {
|
2018-07-10 00:10:29 +08:00
|
|
|
if ( !($newServer = dbFetchOne('SELECT * FROM Servers WHERE Id = ?', NULL, ARRAY($_REQUEST['id']))) ) {
|
2017-10-16 23:31:35 +08:00
|
|
|
$view = 'error';
|
2015-08-16 22:52:47 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$newServer = array();
|
|
|
|
$newServer['Name'] = translate('NewServer');
|
2015-11-12 05:43:23 +08:00
|
|
|
$newServer['Hostname'] = '';
|
2018-07-10 00:10:29 +08:00
|
|
|
$newServer['PathPrefix'] = '/zm';
|
2018-01-30 02:41:43 +08:00
|
|
|
$newServer['zmstats'] = '';
|
|
|
|
$newServer['zmaudit'] = '';
|
|
|
|
$newServer['zmtrigger'] = '';
|
2015-08-16 22:52:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
$focusWindow = true;
|
|
|
|
|
2018-07-10 00:10:29 +08:00
|
|
|
xhtmlHeaders(__FILE__, translate('Server').' - '.$newServer['Name']);
|
2015-08-16 22:52:47 +08:00
|
|
|
?>
|
|
|
|
<body>
|
|
|
|
<div id="page">
|
|
|
|
<div id="header">
|
2017-10-16 23:31:35 +08:00
|
|
|
<h2><?php echo translate('Server').' - '.$newServer['Name'] ?></h2>
|
2015-08-16 22:52:47 +08:00
|
|
|
</div>
|
|
|
|
<div id="content">
|
2018-07-10 00:10:29 +08:00
|
|
|
<form name="contentForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" onsubmit="return validateForm(this, <?php echo empty($newServer['Name'])?'true':'false' ?>)">
|
2015-08-16 22:52:47 +08:00
|
|
|
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
|
|
|
<input type="hidden" name="object" value="server"/>
|
|
|
|
<input type="hidden" name="id" value="<?php echo validHtmlStr($_REQUEST['id']) ?>"/>
|
2017-10-16 23:31:35 +08:00
|
|
|
<table id="contentTable" class="major">
|
2015-08-16 22:52:47 +08:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2016-01-08 23:15:21 +08:00
|
|
|
<th scope="row"><?php echo translate('Name') ?></th>
|
2015-08-16 22:52:47 +08:00
|
|
|
<td><input type="text" name="newServer[Name]" value="<?php echo $newServer['Name'] ?>"/></td>
|
|
|
|
</tr>
|
2015-09-18 03:35:27 +08:00
|
|
|
<tr>
|
2016-01-08 23:15:21 +08:00
|
|
|
<th scope="row"><?php echo translate('Hostname') ?></th>
|
2015-09-18 03:35:27 +08:00
|
|
|
<td><input type="text" name="newServer[Hostname]" value="<?php echo $newServer['Hostname'] ?>"/></td>
|
|
|
|
</tr>
|
2018-07-10 00:10:29 +08:00
|
|
|
<tr>
|
|
|
|
<th scope="row"><?php echo translate('PathPrefix') ?></th>
|
|
|
|
<td><input type="text" name="newServer[PathPrefix]" value="<?php echo $newServer['PathPrefix'] ?>"/></td>
|
|
|
|
</tr>
|
2018-01-11 01:59:27 +08:00
|
|
|
<tr>
|
|
|
|
<th scope="row"><?php echo translate('RunStats') ?></th>
|
|
|
|
<td>
|
2018-01-18 03:22:04 +08:00
|
|
|
<input type="radio" name="newServer[zmstats]" value="1"<?php echo $newServer['zmstats'] ? ' checked="checked"' : '' ?>/> Yes
|
|
|
|
<input type="radio" name="newServer[zmstats]" value="0"<?php echo $newServer['zmstats'] ? '' : ' checked="checked"' ?>/> No
|
2018-01-11 01:59:27 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row"><?php echo translate('RunAudit') ?></th>
|
|
|
|
<td>
|
2018-01-18 03:22:04 +08:00
|
|
|
<input type="radio" name="newServer[zmaudit]" value="1"<?php echo $newServer['zmaudit'] ? ' checked="checked"' : '' ?>/> Yes
|
|
|
|
<input type="radio" name="newServer[zmaudit]" value="0"<?php echo $newServer['zmaudit'] ? '' : ' checked="checked"' ?>/> No
|
2018-01-11 01:59:27 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row"><?php echo translate('RunTrigger') ?></th>
|
|
|
|
<td>
|
2018-01-18 03:22:04 +08:00
|
|
|
<input type="radio" name="newServer[zmtrigger]" value="1"<?php echo $newServer['zmtrigger'] ? ' checked="checked"' : '' ?>/> Yes
|
|
|
|
<input type="radio" name="newServer[zmtrigger]" value="0"<?php echo $newServer['zmtrigger'] ? '' : ' checked="checked"' ?>/> No
|
2018-01-11 01:59:27 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
2015-08-16 22:52:47 +08:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<div id="contentButtons">
|
2017-10-16 23:31:35 +08:00
|
|
|
<input type="hidden" name="action" value="Save"/>
|
2015-11-12 05:43:23 +08:00
|
|
|
<input type="submit" value="<?php echo translate('Save') ?>"/>
|
|
|
|
<input type="button" value="<?php echo translate('Cancel') ?>" onclick="closeWindow();"/>
|
2015-08-16 22:52:47 +08:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|