IPs and Ports: Only show attributes used by the current webserver
This commit is contained in:
@@ -29,6 +29,10 @@ if (isset($_POST['id'])) {
|
||||
if ($page == 'ipsandports'
|
||||
|| $page == 'overview'
|
||||
) {
|
||||
// Do not display attributes that are not used by the current webserver
|
||||
$websrv = Settings::Get('system.webserver');
|
||||
$is_nginx = ($websrv == 'nginx');
|
||||
$is_apache = ($websrv == 'apache2');
|
||||
|
||||
if ($action == '') {
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ return array(
|
||||
'image' => 'icons/ipsports_add.png',
|
||||
'fields' => array(
|
||||
'listen_statement' => array(
|
||||
'visible' => !$is_nginx,
|
||||
'label' => $lng['admin']['ipsandports']['create_listen_statement'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
@@ -48,6 +49,7 @@ return array(
|
||||
'value' => array('1')
|
||||
),
|
||||
'namevirtualhost_statement' => array(
|
||||
'visible' => $is_apache,
|
||||
'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
@@ -77,6 +79,7 @@ return array(
|
||||
'rows' => 12
|
||||
),
|
||||
'vhostcontainer_servername_statement' => array(
|
||||
'visible' => $is_apache,
|
||||
'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
|
||||
@@ -42,6 +42,7 @@ return array(
|
||||
'image' => 'icons/ipsports_edit.png',
|
||||
'fields' => array(
|
||||
'listen_statement' => array(
|
||||
'visible' => !$is_nginx,
|
||||
'label' => $lng['admin']['ipsandports']['create_listen_statement'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
@@ -50,6 +51,7 @@ return array(
|
||||
'value' => array($result['listen_statement'])
|
||||
),
|
||||
'namevirtualhost_statement' => array(
|
||||
'visible' => $is_apache,
|
||||
'label' => $lng['admin']['ipsandports']['create_namevirtualhost_statement'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
@@ -81,6 +83,7 @@ return array(
|
||||
'value' => $result['specialsettings']
|
||||
),
|
||||
'vhostcontainer_servername_statement' => array(
|
||||
'visible' => $is_apache,
|
||||
'label' => $lng['admin']['ipsandports']['create_vhostcontainer_servername_statement'],
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
|
||||
@@ -8,29 +8,29 @@ $header
|
||||
</header>
|
||||
|
||||
<section>
|
||||
|
||||
|
||||
<form action="{$linker->getLink(array('section' => 'ipsandports'))}" method="post" enctype="application/x-www-form-urlencoded">
|
||||
<input type="hidden" name="s" value="$s"/>
|
||||
<input type="hidden" name="page" value="$page"/>
|
||||
<div class="overviewsearch">
|
||||
{$searchcode}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="overviewadd">
|
||||
<img src="templates/{$theme}/assets/img/icons/add.png" alt="" />
|
||||
<a href="{$linker->getLink(array('section' => 'ipsandports', 'page' => $page, 'action' => 'add'))}">{$lng['admin']['ipsandports']['add']}</a>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="full hl">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{$lng['admin']['ipsandports']['ip']} {$arrowcode['ip']}</th>
|
||||
<th>{$lng['admin']['ipsandports']['port']} {$arrowcode['port']}</th>
|
||||
<th>Listen</th>
|
||||
<th>NameVirtualHost</th>
|
||||
<if !$is_nginx><th>Listen</th></if>
|
||||
<if $is_apache><th>NameVirtualHost</th></if>
|
||||
<th>vHost-Container</th>
|
||||
<th>Specialsettings</th>
|
||||
<th>ServerName</th>
|
||||
<if $is_apache><th>ServerName</th></if>
|
||||
<th>SSL</th>
|
||||
<th>{$lng['panel']['options']}</th>
|
||||
</tr>
|
||||
@@ -39,7 +39,7 @@ $header
|
||||
<if $pagingcode != ''>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="8">{$pagingcode}</td>
|
||||
<td colspan="<if $is_apache>8<else>6</if>">{$pagingcode}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</if>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<tr>
|
||||
<td>{$row['ip']}</td>
|
||||
<td>{$row['port']}</td>
|
||||
<td><if $row['listen_statement']=='1'>{$lng['panel']['yes']}<else>{$lng['panel']['no']}</if></td>
|
||||
<td><if $row['namevirtualhost_statement']=='1'>{$lng['panel']['yes']}<else>{$lng['panel']['no']}</if></td>
|
||||
<if !$is_nginx><td><if $row['listen_statement']=='1'>{$lng['panel']['yes']}<else>{$lng['panel']['no']}</if></td></if>
|
||||
<if $is_apache><td><if $row['namevirtualhost_statement']=='1'>{$lng['panel']['yes']}<else>{$lng['panel']['no']}</if></td></if>
|
||||
<td><if $row['vhostcontainer']=='1'>{$lng['panel']['yes']}<else>{$lng['panel']['no']}</if></td>
|
||||
<td><if $row['specialsettings']!=''>{$lng['panel']['yes']}<else>{$lng['panel']['no']}</if></td>
|
||||
<td><if $row['vhostcontainer_servername_statement']=='1'>{$lng['panel']['yes']}<else>{$lng['panel']['no']}</if></td>
|
||||
<if $is_apache><td><if $row['vhostcontainer_servername_statement']=='1'>{$lng['panel']['yes']}<else>{$lng['panel']['no']}</if></td></if>
|
||||
<td><if $row['ssl']=='1'>{$lng['panel']['yes']}<else>{$lng['panel']['no']}</if></td>
|
||||
<td>
|
||||
<a href="{$linker->getLink(array('section' => 'ipsandports', 'page' => $page, 'action' => 'edit', 'id' => $row['id']))}">
|
||||
|
||||
Reference in New Issue
Block a user