Commit 1fcd3fc1 authored by Franco Fichtner's avatar Franco Fichtner

src: whitespace and style sweep

parent f9b697e2
......@@ -74,7 +74,9 @@ class FirmwareController extends ApiControllerBase
$response['status_msg'] = sprintf('There are %s updates available.', $response['updates']);
}
if ($response['upgrade_needs_reboot'] == 1) {
$response['status_msg'] = sprintf('%s %s', $response['status_msg'], 'This update requires a reboot.');
$response['status_msg'] = sprintf(
'%s %s', $response['status_msg'], 'This update requires a reboot.'
);
}
}
} else {
......
......@@ -118,7 +118,7 @@ include("head.inc");
<div class="row">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12">
<? $active_tab = "/diag_ipsec.php";
<? $active_tab = "/diag_ipsec.php";
include('diag_ipsec_tabs.inc');
?>
<div class="tab-content content-box col-xs-12">
......@@ -212,22 +212,22 @@ include("head.inc");
<form method="post">
<input type="hidden" value="<?=$con_id?>" name="ikeid"/>
<input type="hidden" value="<?=isset($ikesa['id']) ? $ikesa['id'] :""?>" name="ikesaid" />
<?php if (!$connected): ?>
<?php if (!$connected): ?>
<button type="submit" class="btn btn-xs" name="action" value="connect" title="<?=gettext("Connect VPN");?>">
<span class="glyphicon glyphicon-play"/>
</button>
<?php else: ?>
<?php else: ?>
<button type="submit" class="btn btn-xs" name="action" value="ikedisconnect" title="<?=gettext("Disconnect VPN");?>">
<span class="glyphicon glyphicon-stop"/>
</button>
<button type="submit" class="btn btn-xs" name="action" value="ikedisconnectconn" title="<?=gettext("Disconnect VPN Connection");?>">
<span class="glyphicon glyphicon-remove"/>
</button>
<?php endif; ?>
<?php endif; ?>
</form>
</td>
</tr>
<?php if (isset($ikesa['childsalist']) && is_array($ikesa['childsalist']) ): ?>
<?php if (isset($ikesa['childsalist']) && is_array($ikesa['childsalist']) ): ?>
<tr>
<td colspan="8">
<div id="btnchildsa-<?=$ikeid;?>">
......@@ -264,8 +264,8 @@ include("head.inc");
foreach ($childsa['local']['networks']['network'] as $lnets):
?>
<?=htmlspecialchars(ipsec_fixup_network($lnets));?> <br/>
<?php endforeach;
else:
<?php endforeach;
else:
?>
Unknown <br/>
<?php endif;
......@@ -275,12 +275,12 @@ include("head.inc");
<?php if (isset($childsa['local']['spi'])):
?>
Local : <?=htmlspecialchars($childsa['local']['spi']);?>
<?php endif;
<?php endif;
?>
<?php if (isset($childsa['remote']['spi'])):
?>
<br/>Remote : <?=htmlspecialchars($childsa['remote']['spi']);?>
<?php endif;
<?php endif;
?>
</td>
<td>
......@@ -288,7 +288,7 @@ include("head.inc");
foreach ($childsa['remote']['networks']['network'] as $rnets):
?>
<?=htmlspecialchars(ipsec_fixup_network($rnets));?> <br/>
<?php endforeach;
<?php endforeach;
else:
?>
Unknown <br/>
......@@ -302,7 +302,7 @@ include("head.inc");
</table>
</td>
</tr>
<?php endif;
<?php endif;
unset($con_id);
// close outer loop {foreach ($status['query']['ikesalist']['ikesa'] as $ikeid => $ikesa)}
endforeach;
......@@ -356,9 +356,9 @@ include("head.inc");
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
</section>
......
......@@ -95,7 +95,7 @@ legacy_html_escape_form_data($spd);
</tr>
<?php endif; ?>
</table>
</div>
</div>
</div>
</section>
</div>
......
......@@ -289,11 +289,11 @@ function show_source_port_range() {
<td width="78%" class="vtable">
<select name="members[]" multiple="multiple" class="selectpicker" size="3" data-live-search="true">
<?php
// let's fix this for now in the template, although it should be fixed at the top of the page
// $pconfig['members'] can be of different type now.
if ( isset($pconfig['members']) && is_array($pconfig['members'])) {
$members_array = $pconfig['members'];
} elseif (!empty($pconfig['members'])) {
// let's fix this for now in the template, although it should be fixed at the top of the page
// $pconfig['members'] can be of different type now.
if ( isset($pconfig['members']) && is_array($pconfig['members'])) {
$members_array = $pconfig['members'];
} elseif (!empty($pconfig['members'])) {
$members_array = explode(',', $pconfig['members']);
} else {
$members_array = array();
......
......@@ -169,9 +169,9 @@ endif; ?>
<td>&nbsp;</td>
<td>
<span class="text-danger">
<strong><?=gettext("Note"); ?>:<br /></strong>
</span>
<?=gettext("PSK for any user can be set by using an identifier of any/ANY");?>
<strong><?=gettext("Note"); ?>:<br /></strong>
</span>
<?=gettext("PSK for any user can be set by using an identifier of any/ANY");?>
</td>
</tr>
</table>
......
......@@ -339,8 +339,8 @@ function login_banner_change() {
?>
<div class="tab-content content-box col-xs-12">
<form action="vpn_ipsec_mobile.php" method="post" name="iform" id="iform">
<div class="table-responsive">
<table class="table table-striped table-sort">
<div class="table-responsive">
<table class="table table-striped table-sort">
<tr>
<td width="22%"><b><?=gettext("IKE Extensions"); ?> </b></td>
<td width="78%" align="right">
......@@ -348,24 +348,24 @@ function login_banner_change() {
<i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_opnvpn_server" type="button"></i></a>
</td>
</tr>
<tr>
<tr>
<td><a id="help_for_enabled" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Enable")?></td>
<td>
<td>
<input name="enable" type="checkbox" id="enable" value="yes" <?= !empty($pconfig['enable']) ? "checked=\"checked\"" : "";?> />
<div class="hidden" for="help_for_enabled">
<?=gettext("Enable IPsec Mobile Client Support"); ?>
</div>
</td>
</tr>
</td>
</tr>
<tr>
<td colspan="2"><b><?=gettext("Extended Authentication (Xauth)"); ?></b></td>
</tr>
<td colspan="2"><b><?=gettext("Extended Authentication (Xauth)"); ?></b></td>
</tr>
<tr>
<tr>
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("User Authentication"); ?></td>
<td>
<?=gettext("Source"); ?>:
<select name="user_source[]" class="form-control" id="user_source" multiple="multiple" size="3">
<tr>
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("User Authentication"); ?></td>
<td>
<?=gettext("Source"); ?>:
<select name="user_source[]" class="form-control" id="user_source" multiple="multiple" size="3">
<?php
$authmodes = explode(",", $pconfig['user_source']);
$auth_servers = auth_get_authserver_list();
......@@ -374,83 +374,83 @@ function login_banner_change() {
<option value="<?=htmlspecialchars($auth_server['name'])?>" <?=in_array($auth_server['name'], $authmodes) ? "selected=\"selected\"" : ""?> ><?=$auth_server['name']?></option>
<?php endforeach;
?>
</select>
</td>
</tr>
<tr>
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Group Authentication"); ?></td>
<td>
<select name="group_source" class="form-control" id="group_source">
<option value="none"><?=gettext("none"); ?></option>
<option value="system" <?= $pconfig['group_source'] == "system" ? "selected=\"selected\"" : "";?>><?=gettext("system"); ?></option>
</select>
</td>
</tr>
</select>
</td>
</tr>
<tr>
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Group Authentication"); ?></td>
<td>
<select name="group_source" class="form-control" id="group_source">
<option value="none"><?=gettext("none"); ?></option>
<option value="system" <?= $pconfig['group_source'] == "system" ? "selected=\"selected\"" : "";?>><?=gettext("system"); ?></option>
</select>
</td>
</tr>
<tr>
<td colspan="2"><b><?=gettext("Client Configuration (mode-cfg)"); ?> </b></td>
</tr>
<tr>
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Virtual Address Pool"); ?></td>
<td>
<tr>
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Virtual Address Pool"); ?></td>
<td>
<input name="pool_enable" type="checkbox" id="pool_enable" value="yes" <?= !empty($pconfig['pool_address'])&&!empty($pconfig['pool_netbits']) ? "checked=\"checked\"" : "";?> onclick="pool_change()" />
<?=gettext("Provide a virtual IP address to clients"); ?><br />
<?=gettext("Network"); ?>:&nbsp;
<input name="pool_address" type="text" class="form-control unknown" id="pool_address" size="20" value="<?=$pconfig['pool_address'];?>" />
/
<select name="pool_netbits" class="form-control" id="pool_netbits">
<?php for ($i = 32; $i >= 0; $i--) :
<?=gettext("Network"); ?>:&nbsp;
<input name="pool_address" type="text" class="form-control unknown" id="pool_address" size="20" value="<?=$pconfig['pool_address'];?>" />
/
<select name="pool_netbits" class="form-control" id="pool_netbits">
<?php for ($i = 32; $i >= 0; $i--) :
?>
<option value="<?=$i;?>" <?= ($i == $pconfig['pool_netbits']) ? "selected=\"selected\"" : "";?>>
<?=$i;?>
</option>
<?php
<option value="<?=$i;?>" <?= ($i == $pconfig['pool_netbits']) ? "selected=\"selected\"" : "";?>>
<?=$i;?>
</option>
<?php
endfor; ?>
</select>
</td>
</tr>
<tr>
<td><a id="help_for_net_list" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Network List"); ?></td>
<td>
</select>
</td>
</tr>
<tr>
<td><a id="help_for_net_list" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Network List"); ?></td>
<td>
<input name="net_list" type="checkbox" id="net_list_enable" value="yes" <?= !empty($pconfig['net_list']) ? "checked=\"checked\"" : "";?> />
<div class="hidden" for="help_for_net_list">
<?=gettext("Provide a list of accessible networks to clients"); ?><br />
</div>
</td>
</tr>
<tr>
<td><a id="help_for_save_passwd" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Save Xauth Password"); ?></td>
<td>
</td>
</tr>
<tr>
<td><a id="help_for_save_passwd" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Save Xauth Password"); ?></td>
<td>
<input name="save_passwd" type="checkbox" id="save_passwd_enable" value="yes" <?= !empty($pconfig['save_passwd']) ? "checked=\"checked\"" : "";?> />
<div class="hidden" for="help_for_save_passwd">
<?=gettext("Allow clients to save Xauth passwords (Cisco VPN client only)."); ?><br />
<?=gettext("NOTE: With iPhone clients, this does not work when deployed via the iPhone configuration utility, only by manual entry."); ?><br />
</div>
</td>
</tr>
<tr>
<td><a id="help_for_dns_domain_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("DNS Default Domain"); ?></td>
<td>
</td>
</tr>
<tr>
<td><a id="help_for_dns_domain_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("DNS Default Domain"); ?></td>
<td>
<input name="dns_domain_enable" type="checkbox" id="dns_domain_enable" value="yes" <?= !empty($pconfig['dns_domain']) ? "checked=\"checked\"" : "";?> onclick="dns_domain_change()" />
<input name="dns_domain" type="text" id="dns_domain" size="30" value="<?=$pconfig['dns_domain'];?>" />
<div class="hidden" for="help_for_dns_domain_enable">
<?=gettext("Provide a default domain name to clients"); ?>
</div>
</td>
</tr>
<tr>
<td><a id="help_for_dns_split_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Split DNS"); ?></td>
<td>
</td>
</tr>
<tr>
<td><a id="help_for_dns_split_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Split DNS"); ?></td>
<td>
<input name="dns_split_enable" type="checkbox" id="dns_split_enable" value="yes" <?= !empty($pconfig['dns_split']) ? "checked=\"checked\"" : "";?> onclick="dns_split_change()" />
<input name="dns_split" type="text" class="form-control unknown" id="dns_split" size="30" value="<?=$pconfig['dns_split'];?>" />
<div class="hidden" for="help_for_dns_split_enable">
<?=gettext("Provide a list of split DNS domain names to clients. Enter a comma separated list."); ?><br />
<?=gettext("NOTE: If left blank, and a default domain is set, it will be used for this value."); ?>
</div>
</td>
</tr>
<tr>
<td><a id="help_for_dns_server_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("DNS Servers"); ?></td>
<td>
</td>
</tr>
<tr>
<td><a id="help_for_dns_server_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("DNS Servers"); ?></td>
<td>
<input name="dns_server_enable" type="checkbox" id="dns_server_enable" value="yes" <?= !empty($pconfig['dns_server1']) || !empty($pconfig['dns_server2']) || !empty($pconfig['dns_server3']) || !empty($pconfig['dns_server4']) ? "checked=\"checked\"" : "";?> onclick="dns_server_change()" />
<div id="dns_server_enable_inputs">
<?=gettext("Server"); ?> #1:
......@@ -465,11 +465,11 @@ function login_banner_change() {
<div class="hidden" for="help_for_dns_server_enable">
<?=gettext("Provide a DNS server list to clients"); ?>
</div>
</td>
</tr>
<tr>
<td><a id="help_for_wins_server_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("WINS Servers"); ?></td>
<td>
</td>
</tr>
<tr>
<td><a id="help_for_wins_server_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("WINS Servers"); ?></td>
<td>
<input name="wins_server_enable" type="checkbox" id="wins_server_enable" value="yes" <?= !empty($pconfig['wins_server1']) || !empty($pconfig['wins_server2']) ? "checked=\"checked\"" : "";?> onclick="wins_server_change()" />
<div id="wins_server_enable_inputs">
<?=gettext("Server"); ?> #1:
......@@ -480,11 +480,11 @@ function login_banner_change() {
<div class="hidden" for="help_for_wins_server_enable">
<?=gettext("Provide a WINS server list to clients"); ?>
</div>
</td>
</tr>
<tr>
<td><a id="help_for_pfs_group_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Phase2 PFS Group"); ?></td>
<td>
</td>
</tr>
<tr>
<td><a id="help_for_pfs_group_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Phase2 PFS Group"); ?></td>
<td>
<input name="pfs_group_enable" type="checkbox" id="pfs_group_enable" value="yes" <?= !empty($pconfig['pfs_group']) ? "checked=\"checked\"" : "";?> onclick="pfs_group_change()" />
<select name="pfs_group" class="form-control" id="pfs_group">
......@@ -500,26 +500,26 @@ function login_banner_change() {
<div class="hidden" for="help_for_pfs_group_enable">
<?=gettext("Provide the Phase2 PFS group to clients ( overrides all mobile phase2 settings )"); ?>
</div>
</td>
</tr>
<tr>
<td><a id="help_for_login_banner_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Login Banner"); ?></td>
<td>
</td>
</tr>
<tr>
<td><a id="help_for_login_banner_enable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Login Banner"); ?></td>
<td>
<input name="login_banner_enable" type="checkbox" id="login_banner_enable" value="yes" <?= !empty($pconfig['login_banner']) ? "checked=\"checked\"" : "";?> onclick="login_banner_change()" />
<textarea name="login_banner" cols="65" rows="7" id="login_banner" class="formpre"><?=$pconfig['login_banner'];?></textarea>
<div class="hidden" for="help_for_login_banner_enable">
<?=gettext("Provide a login banner to clients"); ?><br />
</div>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input name="submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input name="submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
</td>
</tr>
</table>
</div>
</form>
</div>
</section>
......
......@@ -711,7 +711,7 @@ if (isset($input_errors) && count($input_errors) > 0) {
<input name="localid_address" type="text" id="localid_address" size="28" value="<?=$pconfig['localid_address'];?>" />
/
<select name="localid_netbits" id="localid_netbits">
<?php for ($i = 128; $i >= 0; $i--) :
<?php for ($i = 128; $i >= 0; $i--) :
?>
<option value="<?=$i;?>" <?= isset($pconfig['localid_netbits']) && $i == $pconfig['localid_netbits'] ? "selected=\"selected\"" : "";?>>
<?=$i;?>
......@@ -762,7 +762,7 @@ if (isset($input_errors) && count($input_errors) > 0) {
</td>
</tr>
<?php if (!isset($pconfig['mobile'])) :
<?php if (!isset($pconfig['mobile'])) :
?>
<tr id="opt_remoteid">
<td colspan="2"><b><?=gettext("Remote Network");?></b></td>
......@@ -786,12 +786,12 @@ if (isset($input_errors) && count($input_errors) > 0) {
<input name="remoteid_address" type="text" class="formfld unknown ipv4v6" id="remoteid_address" size="28" value="<?=$pconfig['remoteid_address'];?>" />
/
<select name="remoteid_netbits" class="formselect ipv4v6" id="remoteid_netbits">
<?php for ($i = 128; $i >= 0; $i--) :
<?php for ($i = 128; $i >= 0; $i--) :
?>
<option value="<?=$i;?>" <?= isset($pconfig['remoteid_netbits']) && $i == $pconfig['remoteid_netbits'] ? "selected=\"selected\"" : "";?> >
<?=$i;?>
</option>
<?php endfor;
<?php endfor;
?>
</select>
</td>
......@@ -831,18 +831,18 @@ if (isset($input_errors) && count($input_errors) > 0) {
?>
<input type="checkbox" name="ealgos[]" value="<?=$algo;?>" <?=isset($pconfig['ealgos']) && in_array($algo, $pconfig['ealgos']) ? "checked=\"checked\"" : ""; ?> />
<?=$algodata['name'];?>
<?php if (isset($algodata['keysel'])) :
<?php if (isset($algodata['keysel'])) :
?>
<select name="keylen_<?=$algo;?>" class="formselect">
<option value="auto"><?=gettext("auto"); ?></option>
<?php
for ($keylen = $algodata['keysel']['hi']; $keylen >= $algodata['keysel']['lo']; $keylen -= $algodata['keysel']['step']) :
for ($keylen = $algodata['keysel']['hi']; $keylen >= $algodata['keysel']['lo']; $keylen -= $algodata['keysel']['step']) :
?>
<option value="<?=$keylen;?>" <?=$keylen == $pconfig["keylen_".$algo] ? "selected=\"selected\"" : "";?>><?=$keylen;?> <?=gettext("bits"); ?></option>
<?php
endfor; ?>
</select>
<?php else :?>
<?php else :?>
<br/>
<?php
endif; ?>
......@@ -860,7 +860,7 @@ if (isset($input_errors) && count($input_errors) > 0) {
<tr>
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Hash algorithms"); ?></td>
<td width="78%" class="vtable">
<?php foreach ($p2_halgos as $algo => $algoname) :
<?php foreach ($p2_halgos as $algo => $algoname) :
?>
<input type="checkbox" name="hash-algorithm-option[]" value="<?=$algo;?>" <?=in_array($algo, $pconfig['hash-algorithm-option']) ? "checked=\"checked\"" : "";?>/>
<?=$algoname;?>
......@@ -872,10 +872,10 @@ if (isset($input_errors) && count($input_errors) > 0) {
<tr>
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("PFS key group"); ?></td>
<td>
<?php if (!isset($pconfig['mobile']) || !isset($config['ipsec']['client']['pfs_group'])) :
<?php if (!isset($pconfig['mobile']) || !isset($config['ipsec']['client']['pfs_group'])) :
?>
<select name="pfsgroup">
<?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname) :
<?php foreach ($p2_pfskeygroups as $keygroup => $keygroupname) :
?>
<option value="<?=$keygroup;?>" <?= $keygroup == $pconfig['pfsgroup'] ? "selected=\"selected\"" : "";?>>
<?=$keygroupname;?>
......@@ -920,7 +920,7 @@ if (isset($input_errors) && count($input_errors) > 0) {
<tr>
<td>&nbsp;</td>
<td width="78%">
<?php if (isset($pconfig['mobile'])) :
<?php if (isset($pconfig['mobile'])) :
?>
<input name="mobile" type="hidden" value="true" />
<input name="remoteid_type" type="hidden" value="mobile" />
......
......@@ -209,7 +209,7 @@ function maxmss_checked(obj) {
<?php
endforeach; ?>
<div class="hidden" for="help_for_ipsec_debug">
<?=gettext("Launches IPSec in debug mode so that more verbose logs " .
<?=gettext("Launches IPSec in debug mode so that more verbose logs " .
"will be generated to aid in troubleshooting."); ?>
</div>
</td>
......@@ -234,7 +234,7 @@ function maxmss_checked(obj) {
<strong><?=gettext("Enable MSS clamping on VPN traffic"); ?></strong>
<input name="maxmss" id="maxmss" type="text" value="<?= !empty($pconfig['maxmss']) ? $pconfig['maxmss'] : "1400";?>" <?= !empty($pconfig['maxmss_enable']) ? "disabled=\"disabled\"" : "" ;?> />
<div class="hidden" for="help_for_maxmss_enable">
<?=gettext("Enable MSS clamping on TCP flows over VPN. " .
<?=gettext("Enable MSS clamping on TCP flows over VPN. " .
"This helps overcome problems with PMTUD on IPsec VPN links. If left blank, the default value is 1400 bytes. "); ?>
</div>
</td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment