2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
//
|
|
|
|
// ZoneMinder web options view file, $Date$, $Revision$
|
2008-07-25 17:48:16 +08:00
|
|
|
// Copyright (C) 2001-2008 Philip Coombes
|
2008-07-14 21:54:50 +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
|
2016-12-26 23:23:16 +08:00
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2008-07-14 21:54:50 +08:00
|
|
|
//
|
|
|
|
|
2017-09-27 05:14:27 +08:00
|
|
|
if ( !canView( 'System' ) ) {
|
|
|
|
$view = 'error';
|
|
|
|
return;
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
|
2008-10-09 17:15:53 +08:00
|
|
|
$canEdit = canEdit( 'System' );
|
|
|
|
|
2008-07-14 21:54:50 +08:00
|
|
|
$tabs = array();
|
2015-05-22 01:23:31 +08:00
|
|
|
$tabs['skins'] = translate('Display');
|
2015-05-10 21:10:30 +08:00
|
|
|
$tabs['system'] = translate('System');
|
|
|
|
$tabs['config'] = translate('Config');
|
2015-07-09 23:41:46 +08:00
|
|
|
$tabs['servers'] = translate('Servers');
|
2015-12-16 00:13:21 +08:00
|
|
|
$tabs['storage'] = translate('Storage');
|
2015-05-10 21:10:30 +08:00
|
|
|
$tabs['web'] = translate('Web');
|
|
|
|
$tabs['images'] = translate('Images');
|
|
|
|
$tabs['logging'] = translate('Logging');
|
|
|
|
$tabs['network'] = translate('Network');
|
|
|
|
$tabs['mail'] = translate('Email');
|
|
|
|
$tabs['upload'] = translate('Upload');
|
|
|
|
$tabs['x10'] = translate('X10');
|
|
|
|
$tabs['highband'] = translate('HighBW');
|
|
|
|
$tabs['medband'] = translate('MediumBW');
|
|
|
|
$tabs['lowband'] = translate('LowBW');
|
|
|
|
$tabs['users'] = translate('Users');
|
2008-07-14 21:54:50 +08:00
|
|
|
|
2008-09-26 17:47:20 +08:00
|
|
|
if ( isset($_REQUEST['tab']) )
|
2017-09-27 05:14:27 +08:00
|
|
|
$tab = validHtmlStr($_REQUEST['tab']);
|
2008-09-26 17:47:20 +08:00
|
|
|
else
|
2017-09-27 05:14:27 +08:00
|
|
|
$tab = 'system';
|
2008-07-14 21:54:50 +08:00
|
|
|
|
|
|
|
$focusWindow = true;
|
|
|
|
|
2015-05-10 21:10:30 +08:00
|
|
|
xhtmlHeaders( __FILE__, translate('Options') );
|
2016-03-24 04:12:51 +08:00
|
|
|
|
|
|
|
# Have to do this stuff up here before including header.php because fof the cookie setting
|
|
|
|
$skin_options = array_map( 'basename', glob('skins/*',GLOB_ONLYDIR) );
|
2017-09-27 05:14:27 +08:00
|
|
|
if ( $tab == 'skins' ) {
|
|
|
|
$current_skin = $_COOKIE['zmSkin'];
|
|
|
|
$reload = false;
|
|
|
|
if ( isset($_GET['skin-choice']) && ( $_GET['skin-choice'] != $current_skin ) ) {
|
|
|
|
setcookie('zmSkin',$_GET['skin-choice'], time()+3600*24*30*12*10 );
|
|
|
|
//header("Location: index.php?view=options&tab=skins&reset_parent=1");
|
|
|
|
$reload = true;
|
|
|
|
}
|
|
|
|
$current_css = $_COOKIE['zmCSS'];
|
|
|
|
if ( isset($_GET['css-choice']) and ( $_GET['css-choice'] != $current_css ) ) {
|
|
|
|
setcookie('zmCSS',$_GET['css-choice'], time()+3600*24*30*12*10 );
|
2017-11-21 01:27:20 +08:00
|
|
|
array_map('unlink', glob(ZM_PATH_WEB.'/cache/*')); //cleanup symlinks from cache_bust
|
2017-09-27 05:14:27 +08:00
|
|
|
//header("Location: index.php?view=options&tab=skins&reset_parent=1");
|
|
|
|
$reload = true;
|
|
|
|
}
|
|
|
|
if ( $reload )
|
|
|
|
echo "<script type=\"text/javascript\">if(window.opener){window.opener.location.reload();}window.location.href=\"{$_SERVER['PHP_SELF']}?view={$view}&tab={$tab}\"</script>";
|
2016-03-24 04:12:51 +08:00
|
|
|
} # end if tab == skins
|
|
|
|
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
|
|
|
<body>
|
2016-05-07 03:16:48 +08:00
|
|
|
<?php echo getNavBarHTML(); ?>
|
2017-09-27 05:14:27 +08:00
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2 sidebar">
|
|
|
|
<ul class="nav nav-pills nav-stacked">
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-09-27 05:14:27 +08:00
|
|
|
foreach ( $tabs as $name=>$value ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2017-10-01 02:19:32 +08:00
|
|
|
<li<?php echo $tab == $name ? ' class="active"' : '' ?>><a href="?view=<?php echo $view ?>&tab=<?php echo $name ?>"><?php echo $value ?></a></li>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2017-09-27 05:14:27 +08:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-10 col-sm-offset-2">
|
2018-03-26 23:50:14 +08:00
|
|
|
<br/>
|
2017-09-27 05:14:27 +08:00
|
|
|
<div id="options">
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-09-27 05:14:27 +08:00
|
|
|
if ( $tab == 'skins' ) {
|
2010-11-24 09:35:12 +08:00
|
|
|
?>
|
2017-09-27 05:14:27 +08:00
|
|
|
<form name="optionsForm" class="form-horizontal" method="get" action="<?php echo $_SERVER['PHP_SELF'] ?>">
|
|
|
|
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
|
|
|
<input type="hidden" name="tab" value="<?php echo $tab ?>"/>
|
|
|
|
<div class="form-group">
|
2017-10-01 02:19:32 +08:00
|
|
|
<label for="skin-choice" class="col-sm-3 control-label">SKIN</label>
|
2017-09-27 05:14:27 +08:00
|
|
|
<div class="col-sm-6">
|
2018-03-26 23:50:14 +08:00
|
|
|
<select name="skin-choice" class="form-control chosen">
|
2017-10-02 21:11:55 +08:00
|
|
|
<?php
|
|
|
|
foreach($skin_options as $dir) {
|
|
|
|
echo '<option value="'.$dir.'" '.($current_skin==$dir ? 'SELECTED="SELECTED"' : '').'>'.$dir.'</option>';
|
|
|
|
}
|
|
|
|
?>
|
2017-10-01 02:19:32 +08:00
|
|
|
</select>
|
|
|
|
<span class="help-block"><?php echo translate('SkinDescription'); ?></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-10-02 21:11:55 +08:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="css-choice" class="col-sm-3 control-label">CSS</label>
|
|
|
|
<div class="col-sm-6">
|
2018-03-26 23:50:14 +08:00
|
|
|
<select name="css-choice" class="form-control chosen">
|
2017-10-02 21:11:55 +08:00
|
|
|
<?php
|
|
|
|
foreach( array_map( 'basename', glob('skins/'.$current_skin.'/css/*',GLOB_ONLYDIR) ) as $dir) {
|
|
|
|
echo '<option value="'.$dir.'" '.($current_css==$dir ? 'SELECTED="SELECTED"' : '').'>'.$dir.'</option>';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
<span class="help-block"><?php echo translate('CSSDescription'); ?></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="contentButtons">
|
2017-12-13 00:15:53 +08:00
|
|
|
<button value="Save" type="submit"<?php echo $canEdit?'':' disabled="disabled"' ?>><?php echo translate('Save') ?></button>
|
2017-10-02 21:11:55 +08:00
|
|
|
</div>
|
|
|
|
</form>
|
2010-11-24 09:35:12 +08:00
|
|
|
|
|
|
|
<?php
|
2017-09-27 05:14:27 +08:00
|
|
|
} else if ( $tab == 'users' ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<form name="userForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
|
|
|
|
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
|
|
|
<input type="hidden" name="tab" value="<?php echo $tab ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<input type="hidden" name="action" value="delete"/>
|
2016-03-13 11:44:11 +08:00
|
|
|
<table id="contentTable" class="table table-striped" cellspacing="0">
|
2018-03-26 23:50:14 +08:00
|
|
|
<thead class="thead-highlight">
|
2008-07-14 21:54:50 +08:00
|
|
|
<tr>
|
2015-05-10 21:10:30 +08:00
|
|
|
<th class="colUsername"><?php echo translate('Username') ?></th>
|
|
|
|
<th class="colLanguage"><?php echo translate('Language') ?></th>
|
|
|
|
<th class="colEnabled"><?php echo translate('Enabled') ?></th>
|
|
|
|
<th class="colStream"><?php echo translate('Stream') ?></th>
|
|
|
|
<th class="colEvents"><?php echo translate('Events') ?></th>
|
|
|
|
<th class="colControl"><?php echo translate('Control') ?></th>
|
|
|
|
<th class="colMonitors"><?php echo translate('Monitors') ?></th>
|
2015-08-16 01:24:48 +08:00
|
|
|
<th class="colGroups"><?php echo translate('Groups') ?></th>
|
2015-05-10 21:10:30 +08:00
|
|
|
<th class="colSystem"><?php echo translate('System') ?></th>
|
|
|
|
<th class="colBandwidth"><?php echo translate('Bandwidth') ?></th>
|
|
|
|
<th class="colMonitor"><?php echo translate('Monitor') ?></th>
|
|
|
|
<th class="colMark"><?php echo translate('Mark') ?></th>
|
2008-07-14 21:54:50 +08:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php
|
2017-09-27 05:14:27 +08:00
|
|
|
$sql = 'select * from Monitors order by Sequence asc';
|
2008-07-14 21:54:50 +08:00
|
|
|
$monitors = array();
|
2017-09-27 05:14:27 +08:00
|
|
|
foreach( dbFetchAll( $sql ) as $monitor ) {
|
|
|
|
$monitors[$monitor['Id']] = $monitor;
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
|
2017-09-27 05:14:27 +08:00
|
|
|
$sql = 'select * from Users';
|
|
|
|
foreach( dbFetchAll( $sql ) as $row ) {
|
|
|
|
$userMonitors = array();
|
|
|
|
if ( !empty($row['MonitorIds']) ) {
|
|
|
|
foreach ( explode( ',', $row['MonitorIds'] ) as $monitorId ) {
|
|
|
|
$userMonitors[] = $monitors[$monitorId]['Name'];
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
2017-09-27 05:14:27 +08:00
|
|
|
}
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
|
|
|
<tr>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colUsername"><?php echo makePopupLink( '?view=user&uid='.$row['Id'], 'zmUser', 'user', validHtmlStr($row['Username']).($user['Username']==$row['Username']?"*":""), $canEdit ) ?></td>
|
|
|
|
<td class="colLanguage"><?php echo $row['Language']?validHtmlStr($row['Language']):'default' ?></td>
|
2015-05-10 21:10:30 +08:00
|
|
|
<td class="colEnabled"><?php echo $row['Enabled']?translate('Yes'):translate('No') ?></td>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colStream"><?php echo validHtmlStr($row['Stream']) ?></td>
|
|
|
|
<td class="colEvents"><?php echo validHtmlStr($row['Events']) ?></td>
|
|
|
|
<td class="colControl"><?php echo validHtmlStr($row['Control']) ?></td>
|
|
|
|
<td class="colMonitors"><?php echo validHtmlStr($row['Monitors']) ?></td>
|
2015-08-16 01:37:25 +08:00
|
|
|
<td class="colGroups"><?php echo validHtmlStr($row['Groups']) ?></td>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colSystem"><?php echo validHtmlStr($row['System']) ?></td>
|
2017-10-13 00:09:05 +08:00
|
|
|
<td class="colBandwidth"><?php echo $row['MaxBandwidth']?$bandwidth_options[$row['MaxBandwidth']]:' ' ?></td>
|
2014-12-05 07:44:23 +08:00
|
|
|
<td class="colMonitor"><?php echo $row['MonitorIds']?(join( ", ", $userMonitors )):" " ?></td>
|
|
|
|
<td class="colMark"><input type="checkbox" name="markUids[]" value="<?php echo $row['Id'] ?>" onclick="configureDeleteButton( this );"<?php if ( !$canEdit ) { ?> disabled="disabled"<?php } ?>/></td>
|
2008-07-14 21:54:50 +08:00
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<div id="contentButtons">
|
2017-12-13 00:15:53 +08:00
|
|
|
<button type="button" value="Add New User" onclick="createPopup('?view=user&uid=0', 'zmUser', 'user');"<?php if ( !canEdit( 'System' ) ) { ?> disabled="disabled"<?php } ?>><?php echo translate('AddNewUser') ?></button>
|
|
|
|
<button type="submit" class="btn-danger" name="deleteBtn" value="Delete" disabled="disabled"><?php echo translate('Delete') ?></button>
|
2008-07-14 21:54:50 +08:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<?php
|
2017-12-23 03:39:43 +08:00
|
|
|
} else if ( $tab == 'servers' ) { ?>
|
2015-07-09 23:41:46 +08:00
|
|
|
<form name="serversForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
|
|
|
|
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
|
|
|
<input type="hidden" name="tab" value="<?php echo $tab ?>"/>
|
|
|
|
<input type="hidden" name="action" value="delete"/>
|
|
|
|
<input type="hidden" name="object" value="server"/>
|
2017-10-16 23:31:01 +08:00
|
|
|
<table id="contentTable" class="table table-striped">
|
2018-03-26 23:50:14 +08:00
|
|
|
<thead class="thead-highlight">
|
2015-07-09 23:41:46 +08:00
|
|
|
<tr>
|
2017-10-16 23:31:01 +08:00
|
|
|
<th class="colName"><?php echo translate('Name') ?></th>
|
2016-01-08 23:15:06 +08:00
|
|
|
<th class="colHostname"><?php echo translate('Hostname') ?></th>
|
2017-10-25 03:43:32 +08:00
|
|
|
<th class="colStatus"><?php echo translate('Status') ?></th>
|
2017-11-28 03:56:48 +08:00
|
|
|
<th class="colMonitorCount"><?php echo translate('Monitors') ?></th>
|
2017-10-25 07:08:52 +08:00
|
|
|
<th class="colCpuLoad"><?php echo translate('CpuLoad') ?></th>
|
2017-10-25 03:43:32 +08:00
|
|
|
<th class="colMemory"><?php echo translate('Free').'/'.translate('Total') . ' ' . translate('Memory') ?></th>
|
|
|
|
<th class="colSwap"><?php echo translate('Free').'/'.translate('Total') . ' ' . translate('Swap') ?></th>
|
2018-01-11 01:59:27 +08:00
|
|
|
<th class="colStats"><?php echo translate('RunStats') ?></th>
|
|
|
|
<th class="colAudit"><?php echo translate('RunAudit') ?></th>
|
|
|
|
<th class="colTrigger"><?php echo translate('RunTrigger') ?></th>
|
2015-07-09 23:41:46 +08:00
|
|
|
<th class="colMark"><?php echo translate('Mark') ?></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2018-01-11 01:59:27 +08:00
|
|
|
<?php
|
|
|
|
foreach( dbFetchAll( 'SELECT *,(SELECT COUNT(Id) FROM Monitors WHERE ServerId=Servers.Id) AS MonitorCount FROM Servers ORDER BY Id' ) as $row ) {
|
|
|
|
?>
|
2015-07-09 23:41:46 +08:00
|
|
|
<tr>
|
2015-08-17 00:22:31 +08:00
|
|
|
<td class="colName"><?php echo makePopupLink( '?view=server&id='.$row['Id'], 'zmServer', 'server', validHtmlStr($row['Name']), $canEdit ) ?></td>
|
2016-01-08 23:15:06 +08:00
|
|
|
<td class="colHostname"><?php echo makePopupLink( '?view=server&id='.$row['Id'], 'zmServer', 'server', validHtmlStr($row['Hostname']), $canEdit ) ?></td>
|
2018-02-27 02:39:45 +08:00
|
|
|
<td class="colStatus
|
|
|
|
<?php if ( $row['Status'] == 'NotRunning' ) { echo 'danger'; } ?>
|
|
|
|
"><?php echo makePopupLink( '?view=server&id='.$row['Id'], 'zmServer', 'server', validHtmlStr($row['Status']), $canEdit ) ?></td>
|
2017-11-28 03:56:48 +08:00
|
|
|
<td class="colMonitorCount"><?php echo makePopupLink( '?view=server&id='.$row['Id'], 'zmServer', 'server', validHtmlStr($row['MonitorCount']), $canEdit ) ?></td>
|
2018-02-27 02:39:45 +08:00
|
|
|
<td class="colCpuLoad
|
|
|
|
<?php if ( $row['CpuLoad'] > 5 ) { echo 'danger'; } ?>
|
|
|
|
"><?php echo makePopupLink( '?view=server&id='.$row['Id'], 'zmServer', 'server',$row['CpuLoad'], $canEdit ) ?></td>
|
|
|
|
<td class="colMemory
|
|
|
|
<?php if ( $row['FreeMem']/$row['TotalMem'] < .1 ) { echo 'danger'; } ?>"><?php echo makePopupLink( '?view=server&id='.$row['Id'], 'zmServer', 'server', human_filesize($row['FreeMem']) . ' / ' . human_filesize($row['TotalMem']), $canEdit ) ?></td>
|
|
|
|
<td class="colSwap
|
2018-04-26 01:28:19 +08:00
|
|
|
<?php if ( (!$row['TotalSwap']) or ($row['FreeSwap']/$row['TotalSwap'] < .1) ) { echo 'danger'; } ?>"><?php echo makePopupLink( '?view=server&id='.$row['Id'], 'zmServer', 'server', human_filesize($row['FreeSwap']) . ' / ' . human_filesize($row['TotalSwap']) , $canEdit ) ?></td>
|
2018-01-18 03:22:04 +08:00
|
|
|
<td class="colStats"><?php echo makePopupLink( '?view=server&id='.$row['Id'], 'zmServer', 'server', $row['zmstats'] ? 'yes' : 'no', $canEdit ) ?></td>
|
|
|
|
<td class="colAudit"><?php echo makePopupLink( '?view=server&id='.$row['Id'], 'zmServer', 'server', $row['zmaudit'] ? 'yes' : 'no', $canEdit ) ?></td>
|
|
|
|
<td class="colTrigger"><?php echo makePopupLink( '?view=server&id='.$row['Id'], 'zmServer', 'server', $row['zmtrigger'] ? 'yes' : 'no', $canEdit ) ?></td>
|
2017-10-25 03:43:32 +08:00
|
|
|
|
2015-07-09 23:41:46 +08:00
|
|
|
<td class="colMark"><input type="checkbox" name="markIds[]" value="<?php echo $row['Id'] ?>" onclick="configureDeleteButton( this );"<?php if ( !$canEdit ) { ?> disabled="disabled"<?php } ?>/></td>
|
|
|
|
</tr>
|
|
|
|
<?php } #end foreach Server ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<div id="contentButtons">
|
2017-12-13 00:15:53 +08:00
|
|
|
<button type="button" value="Add New Server" onclick="createPopup('?view=server&id=0','zmServer','server');"<?php if ( !canEdit( 'System' ) ) { ?> disabled="disabled"<?php } ?>><?php echo translate('AddNewServer') ?></button>
|
|
|
|
<button type="submit" class="btn-danger" name="deleteBtn" value="Delete" disabled="disabled"><?php echo translate('Delete') ?></button>
|
2015-07-09 23:41:46 +08:00
|
|
|
</div>
|
|
|
|
</form>
|
2015-12-16 00:13:21 +08:00
|
|
|
<?php
|
2017-10-16 23:31:01 +08:00
|
|
|
} else if ( $tab == 'storage' ) { ?>
|
2015-12-16 00:13:21 +08:00
|
|
|
<form name="storageForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
|
|
|
|
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
|
|
|
<input type="hidden" name="tab" value="<?php echo $tab ?>"/>
|
|
|
|
<input type="hidden" name="action" value="delete"/>
|
|
|
|
<input type="hidden" name="object" value="storage"/>
|
2017-01-31 10:16:21 +08:00
|
|
|
<table id="contentTable" class="table table-striped" cellspacing="0">
|
2018-03-26 23:50:14 +08:00
|
|
|
<thead class="thead-highlight">
|
2015-12-16 00:13:21 +08:00
|
|
|
<tr>
|
2016-05-02 22:40:42 +08:00
|
|
|
<th class="colId"><?php echo translate('Id') ?></th>
|
2018-07-25 21:39:08 +08:00
|
|
|
<th class="colName"><?php echo translate('Name') ?></th>
|
|
|
|
<th class="colPath"><?php echo translate('Path') ?></th>
|
2017-10-16 23:31:01 +08:00
|
|
|
<th class="colType"><?php echo translate('Type') ?></th>
|
2017-12-19 02:16:54 +08:00
|
|
|
<th class="colScheme"><?php echo translate('StorageScheme') ?></th>
|
2017-12-23 03:39:43 +08:00
|
|
|
<th class="colServer"><?php echo translate('Server') ?></th>
|
2018-04-29 00:38:10 +08:00
|
|
|
<th class="colDiskSpace"><?php echo translate('DiskSpace') ?></th>
|
2015-12-16 00:13:21 +08:00
|
|
|
<th class="colMark"><?php echo translate('Mark') ?></th>
|
2017-12-12 01:51:38 +08:00
|
|
|
</tr>
|
2015-12-16 00:13:21 +08:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2018-04-29 00:38:10 +08:00
|
|
|
<?php foreach( Storage::find_all( null, array('order'=>'lower(Name)') ) as $Storage ) { ?>
|
2015-12-16 00:13:21 +08:00
|
|
|
<tr>
|
2018-04-29 00:38:10 +08:00
|
|
|
<td class="colId"><?php echo makePopupLink('?view=storage&id='.$Storage->Id(), 'zmStorage', 'storage', validHtmlStr($Storage->Id()), $canEdit ) ?></td>
|
|
|
|
<td class="colName"><?php echo makePopupLink( '?view=storage&id='.$Storage->Id(), 'zmStorage', 'storage', validHtmlStr($Storage->Name()), $canEdit ) ?></td>
|
|
|
|
<td class="colPath"><?php echo makePopupLink( '?view=storage&id='.$Storage->Id(), 'zmStorage', 'storage', validHtmlStr($Storage->Path()), $canEdit ) ?></td>
|
|
|
|
<td class="colType"><?php echo makePopupLink( '?view=storage&id='.$Storage->Id(), 'zmStorage', 'storage', validHtmlStr($Storage->Type()), $canEdit ) ?></td>
|
|
|
|
<td class="colScheme"><?php echo makePopupLink( '?view=storage&id='.$Storage->Id(), 'zmStorage', 'storage', validHtmlStr($Storage->Scheme()), $canEdit ) ?></td>
|
2017-12-23 03:39:43 +08:00
|
|
|
<td class="colServer"><?php
|
2018-04-29 00:38:10 +08:00
|
|
|
echo makePopupLink( '?view=storage&id='.$Storage->Id(), 'zmStorage', 'storage', validHtmlStr($Storage->Name()), $canEdit ) ?></td>
|
2018-06-02 04:18:07 +08:00
|
|
|
<td class="colDiskSpace"><?php echo human_filesize($Storage->disk_used_space()) . ' of ' . human_filesize($Storage->disk_total_space()) ?></td>
|
2018-04-29 00:38:10 +08:00
|
|
|
<td class="colMark"><input type="checkbox" name="markIds[]" value="<?php echo $Storage->Id() ?>" onclick="configureDeleteButton(this);"<?php if ( !$canEdit ) { ?> disabled="disabled"<?php } ?>/></td>
|
2017-12-12 01:51:38 +08:00
|
|
|
</tr>
|
2015-12-16 00:13:21 +08:00
|
|
|
<?php } #end foreach Server ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<div id="contentButtons">
|
2017-12-13 00:15:53 +08:00
|
|
|
<button type="button" value="Add New Storage" onclick="createPopup('?view=storage&id=0','zmStorage','storage');"<?php if ( !canEdit( 'System' ) ) { ?> disabled="disabled"<?php } ?>><?php echo translate('AddNewStorage') ?></button>
|
|
|
|
<button type="submit" class="btn-danger" name="deleteBtn" value="Delete" disabled="disabled"><?php echo translate('Delete') ?></button>
|
2015-12-16 00:13:21 +08:00
|
|
|
</div>
|
|
|
|
</form>
|
2015-07-09 23:41:46 +08:00
|
|
|
<?php
|
2014-12-18 22:34:14 +08:00
|
|
|
} else {
|
2017-10-13 00:09:05 +08:00
|
|
|
if ( $tab == 'system' ) {
|
2008-09-26 17:47:20 +08:00
|
|
|
$configCats[$tab]['ZM_LANG_DEFAULT']['Hint'] = join( '|', getLanguages() );
|
2014-12-18 22:34:14 +08:00
|
|
|
$configCats[$tab]['ZM_SKIN_DEFAULT']['Hint'] = join( '|', $skin_options );
|
2014-12-18 22:44:04 +08:00
|
|
|
$configCats[$tab]['ZM_CSS_DEFAULT']['Hint'] = join( '|', array_map ( 'basename', glob('skins/'.ZM_SKIN_DEFAULT.'/css/*',GLOB_ONLYDIR) ) );
|
2017-10-13 02:43:53 +08:00
|
|
|
$configCats[$tab]['ZM_BANDWIDTH_DEFAULT']['Hint'] = $bandwidth_options;
|
2008-07-14 21:54:50 +08:00
|
|
|
}
|
|
|
|
?>
|
2016-03-16 02:43:22 +08:00
|
|
|
<form name="optionsForm" class="form-horizontal" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
|
2014-12-05 07:44:23 +08:00
|
|
|
<input type="hidden" name="view" value="<?php echo $view ?>"/>
|
|
|
|
<input type="hidden" name="tab" value="<?php echo $tab ?>"/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<input type="hidden" name="action" value="options"/>
|
|
|
|
<?php
|
2008-09-26 17:47:20 +08:00
|
|
|
$configCat = $configCats[$tab];
|
2017-10-13 02:43:53 +08:00
|
|
|
foreach ( $configCat as $name=>$value ) {
|
2009-02-19 22:17:33 +08:00
|
|
|
$shortName = preg_replace( '/^ZM_/', '', $name );
|
2014-05-17 10:33:33 +08:00
|
|
|
$optionPromptText = !empty($OLANG[$shortName])?$OLANG[$shortName]['Prompt']:$value['Prompt'];
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2016-03-16 02:43:22 +08:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="<?php echo $name ?>" class="col-sm-3 control-label"><?php echo $shortName ?></label>
|
|
|
|
<div class="col-sm-6">
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-10-13 02:43:53 +08:00
|
|
|
if ( $value['Type'] == 'boolean' ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2016-03-16 02:43:22 +08:00
|
|
|
<input type="checkbox" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" value="1"<?php if ( $value['Value'] ) { ?> checked="checked"<?php } ?><?php echo $canEdit?'':' disabled="disabled"' ?>/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-10-13 02:43:53 +08:00
|
|
|
} elseif ( is_array( $value['Hint'] ) ) {
|
|
|
|
echo htmlSelect( "newConfig[$name]", $value['Hint'], $value['Value'] );
|
|
|
|
} elseif ( preg_match( '/\|/', $value['Hint'] ) ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2017-10-13 02:43:53 +08:00
|
|
|
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2010-02-16 01:11:37 +08:00
|
|
|
$options = explode( '|', $value['Hint'] );
|
2017-09-27 05:14:27 +08:00
|
|
|
if ( count( $options ) > 3 ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2016-03-16 02:43:22 +08:00
|
|
|
<select class="form-control" name="newConfig[<?php echo $name ?>]"<?php echo $canEdit?'':' disabled="disabled"' ?>>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-09-27 05:14:27 +08:00
|
|
|
foreach ( $options as $option ) {
|
|
|
|
if ( preg_match( '/^([^=]+)=(.+)$/', $option, $matches ) ) {
|
|
|
|
$optionLabel = $matches[1];
|
|
|
|
$optionValue = $matches[2];
|
|
|
|
} else {
|
|
|
|
$optionLabel = $optionValue = $option;
|
|
|
|
}
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2014-12-05 07:44:23 +08:00
|
|
|
<option value="<?php echo $optionValue ?>"<?php if ( $value['Value'] == $optionValue ) { echo ' selected="selected"'; } ?>><?php echo htmlspecialchars($optionLabel) ?></option>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
<?php
|
2017-09-27 05:14:27 +08:00
|
|
|
} else {
|
|
|
|
foreach ( $options as $option ) {
|
2017-10-13 02:43:53 +08:00
|
|
|
if ( preg_match( '/^([^=]+)=(.+)$/', $option ) ) {
|
|
|
|
$optionLabel = $matches[1];
|
|
|
|
$optionValue = $matches[2];
|
|
|
|
} else {
|
|
|
|
$optionLabel = $optionValue = $option;
|
|
|
|
}
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2016-03-16 02:43:22 +08:00
|
|
|
<label>
|
|
|
|
<input type="radio" id="<?php echo $name.'_'.preg_replace( '/[^a-zA-Z0-9]/', '', $optionValue ) ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo $optionValue ?>"<?php if ( $value['Value'] == $optionValue ) { ?> checked="checked"<?php } ?><?php echo $canEdit?'':' disabled="disabled"' ?>/>
|
|
|
|
<?php echo htmlspecialchars($optionLabel) ?>
|
|
|
|
</label>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<?php
|
2017-12-12 01:51:38 +08:00
|
|
|
} else if ( $value['Type'] == 'text' ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2016-03-16 02:43:22 +08:00
|
|
|
<textarea class="form-control" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" rows="5" cols="40"<?php echo $canEdit?'':' disabled="disabled"' ?>><?php echo validHtmlStr($value['Value']) ?></textarea>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-12-12 01:51:38 +08:00
|
|
|
} else if ( $value['Type'] == 'integer' ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2016-03-16 02:43:22 +08:00
|
|
|
<input type="number" class="form-control" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo validHtmlStr($value['Value']) ?>" class="small"<?php echo $canEdit?'':' disabled="disabled"' ?>/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-12-12 01:51:38 +08:00
|
|
|
} else if ( $value['Type'] == 'hexadecimal' ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2016-03-16 02:43:22 +08:00
|
|
|
<input type="text" class="form-control" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo validHtmlStr($value['Value']) ?>" class="medium"<?php echo $canEdit?'':' disabled="disabled"' ?>/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-12-12 01:51:38 +08:00
|
|
|
} else if ( $value['Type'] == 'decimal' ) {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2016-03-16 02:43:22 +08:00
|
|
|
<input type="text" class="form-control" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo validHtmlStr($value['Value']) ?>" class="small"<?php echo $canEdit?'':' disabled="disabled"' ?>/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
2017-12-12 01:51:38 +08:00
|
|
|
} else {
|
2008-07-14 21:54:50 +08:00
|
|
|
?>
|
2016-03-16 02:43:22 +08:00
|
|
|
<input type="text" class="form-control" id="<?php echo $name ?>" name="newConfig[<?php echo $name ?>]" value="<?php echo validHtmlStr($value['Value']) ?>" class="large"<?php echo $canEdit?'':' disabled="disabled"' ?>/>
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2016-03-16 02:43:22 +08:00
|
|
|
<span class="help-block"><?php echo validHtmlStr($optionPromptText) ?> (<?php echo makePopupLink( '?view=optionhelp&option='.$name, 'zmOptionHelp', 'optionhelp', '?' ) ?>)</span>
|
|
|
|
</div><!-- End .col-sm-9 -->
|
|
|
|
</div><!-- End .form-group -->
|
2008-07-14 21:54:50 +08:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<div id="contentButtons">
|
2017-12-13 00:15:53 +08:00
|
|
|
<button type="submit" value="Save"<?php echo $canEdit?'':' disabled="disabled"' ?>><?php echo translate('Save') ?></button>
|
2008-07-14 21:54:50 +08:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2016-03-16 03:21:28 +08:00
|
|
|
|
|
|
|
</div><!-- end #options -->
|
2016-04-02 02:02:19 +08:00
|
|
|
</div>
|
|
|
|
</div> <!-- end row -->
|
2008-07-14 21:54:50 +08:00
|
|
|
</div>
|
2017-12-12 01:51:38 +08:00
|
|
|
<?php include("skins/$skin/views/state.php") ?>
|
2008-07-14 21:54:50 +08:00
|
|
|
</body>
|
|
|
|
</html>
|