Commit 4b4e32b7 authored by Ad Schellevis's avatar Ad Schellevis

(legacy, ipsec) fix spacing

parent 9b5aa653
...@@ -322,301 +322,287 @@ $( document ).ready(function() { ...@@ -322,301 +322,287 @@ $( document ).ready(function() {
</thead> </thead>
<tbody> <tbody>
<?php <?php
$i = 0; $i = 0;
foreach ($pconfig['phase1'] as $ph1ent) : foreach ($pconfig['phase1'] as $ph1ent) :?>
?> <tr>
<tr> <td>
<td> <input type="checkbox" name="p1entry[]" value="<?=$i;?>"/>
<input type="checkbox" name="p1entry[]" value="<?=$i;?>"/> </td>
</td> <td>
<td> <button name="toggle_<?=$i; ?>_x" type="submit" class="btn btn-<?= isset($ph1ent['disabled'])? "default":"success"?> btn-xs"
<button name="toggle_<?=$i; ?>_x" type="submit" class="btn btn-<?= isset($ph1ent['disabled'])? "default":"success"?> btn-xs" title="<?=(isset($ph1ent['disabled'])) ? gettext("enable phase 1 entry") : gettext("disable phase 1 entry");?>" data-toggle="tooltip">
title="<?=(isset($ph1ent['disabled'])) ? gettext("enable phase 1 entry") : gettext("disable phase 1 entry");?>" data-toggle="tooltip"> <span class="glyphicon glyphicon-play"></span>
<span class="glyphicon glyphicon-play"></span> </button>
</button> </td>
</td> <td>
<td> <?=empty($ph1ent['iketype']) || $ph1ent['iketype'] == "ikev1"?"V1":"V2";?>
<?=empty($ph1ent['iketype']) || $ph1ent['iketype'] == "ikev1"?"V1":"V2";?> </td>
</td> <td>
<td>
<?php <?php
if (!empty($ph1ent['interface'])) { if (!empty($ph1ent['interface'])) {
$iflabels = get_configured_interface_with_descr(); $iflabels = get_configured_interface_with_descr();
$carplist = get_configured_carp_interface_list(); $carplist = get_configured_carp_interface_list();
foreach ($carplist as $cif => $carpip) { foreach ($carplist as $cif => $carpip) {
$iflabels[$cif] = $carpip." (".get_vip_descr($carpip).")"; $iflabels[$cif] = $carpip." (".get_vip_descr($carpip).")";
} }
$aliaslist = get_configured_ip_aliases_list(); $aliaslist = get_configured_ip_aliases_list();
foreach ($aliaslist as $aliasip => $aliasif) { foreach ($aliaslist as $aliasip => $aliasif) {
$iflabels[$aliasip] = $aliasip." (".get_vip_descr($aliasip).")"; $iflabels[$aliasip] = $aliasip." (".get_vip_descr($aliasip).")";
} }
$grouplist = return_gateway_groups_array(); $grouplist = return_gateway_groups_array();
foreach ($grouplist as $name => $group) { foreach ($grouplist as $name => $group) {
if ($group[0]['vip'] <> "") { if ($group[0]['vip'] <> "") {
$vipif = $group[0]['vip']; $vipif = $group[0]['vip'];
} else { } else {
$vipif = $group[0]['int']; $vipif = $group[0]['int'];
} }
$iflabels[$name] = "GW Group {$name}"; $iflabels[$name] = "GW Group {$name}";
} }
$if = $iflabels[$ph1ent['interface']]; $if = $iflabels[$ph1ent['interface']];
} else { } else {
$if = "WAN"; $if = "WAN";
} }?>
?> <?=htmlspecialchars($if);?>
<?=htmlspecialchars($if);?> <?=!isset($ph1ent['mobile'])?
<?=!isset($ph1ent['mobile'])? $ph1ent['remote-gateway']
$ph1ent['remote-gateway'] :
: "<strong>" . gettext("Mobile Client") . "</strong>";
"<strong>" . gettext("Mobile Client") . "</strong>"; ?>
?> </td>
</td> <td>
<td><?=$ph1ent['mode'];?></td> <?=htmlspecialchars($ph1ent['mode']);?>
<td> </td>
<td>
<?=$p1_ealgos[$ph1ent['encryption-algorithm']['name']]['name'];?> <?=$p1_ealgos[$ph1ent['encryption-algorithm']['name']]['name'];?>
<?php <?php
if (!empty($ph1ent['encryption-algorithm']['keylen'])) { if (!empty($ph1ent['encryption-algorithm']['keylen'])) {
if ($ph1ent['encryption-algorithm']['keylen']=="auto") { if ($ph1ent['encryption-algorithm']['keylen']=="auto") {
echo " (" . gettext("auto") . ")"; echo " (" . gettext("auto") . ")";
} else { } else {
echo " ({$ph1ent['encryption-algorithm']['keylen']} " . gettext("bits") . ")"; echo " ({$ph1ent['encryption-algorithm']['keylen']} " . gettext("bits") . ")";
} }
} }?>
?> </td>
</td> <td>
<td> <?=strtoupper($ph1ent['hash-algorithm']);?>
<?=strtoupper($ph1ent['hash-algorithm']);?> </td>
</td> <td>
<td> <?=$ph1ent['descr'];?>&nbsp;
<?=$ph1ent['descr'];?>&nbsp; </td>
</td> <td>
<td> <button data-id="<?=$i; ?>" data-act="movep1" type="submit" class="act_move btn btn-default btn-xs"
<button data-id="<?=$i; ?>" data-act="movep1" type="submit" class="act_move btn btn-default btn-xs" title="<?=gettext("move selected entries before this");?>" data-toggle="tooltip" data-placement="left">
title="<?=gettext("move selected entries before this");?>" data-toggle="tooltip" data-placement="left"> <span class="glyphicon glyphicon-arrow-left"></span>
<span class="glyphicon glyphicon-arrow-left"></span> </button>
</button> <a href="vpn_ipsec_phase1.php?p1index=<?=$i; ?>" class="btn btn-default btn-xs" alt="edit"
<a href="vpn_ipsec_phase1.php?p1index=<?=$i; ?>" class="btn btn-default btn-xs" alt="edit" title="<?=gettext("edit phase1 entry"); ?>" data-toggle="tooltip" data-placement="left">
title="<?=gettext("edit phase1 entry"); ?>" data-toggle="tooltip" data-placement="left"> <span class="glyphicon glyphicon-pencil"></span>
<span class="glyphicon glyphicon-pencil"></span> </a><br/>
</a><br/> <button data-id="<?=$i; ?>"
<button data-id="<?=$i; ?>" title="<?=gettext("delete phase1 entry");?>" data-toggle="tooltip" data-placement="left"
title="<?=gettext("delete phase1 entry");?>" data-toggle="tooltip" data-placement="left" type="submit"
type="submit" class="act_delete_p1 btn btn-default btn-xs">
class="act_delete_p1 btn btn-default btn-xs"> <span class="glyphicon glyphicon-remove"></span>
<span class="glyphicon glyphicon-remove"></span> </button>
</button> <?php if (!isset($ph1ent['mobile'])) :
<?php if (!isset($ph1ent['mobile'])) :
?>
<a href="vpn_ipsec_phase1.php?dup=<?=$i; ?>" class="btn btn-default btn-xs" alt="add"
title="<?=gettext("clone phase1 entry"); ?>" data-toggle="tooltip" data-placement="left">
<span class="fa fa-clone text-muted"></span>
</a>
<?php endif;
?> ?>
</td> <a href="vpn_ipsec_phase1.php?dup=<?=$i; ?>" class="btn btn-default btn-xs" alt="add"
</tr> title="<?=gettext("clone phase1 entry"); ?>" data-toggle="tooltip" data-placement="left">
<tr> <span class="fa fa-clone text-muted"></span>
<td colspan="9"> </a>
<?php <?php
$phase2count=0; endif;?>
foreach ($pconfig['phase2'] as $ph2ent) { </td>
if ($ph2ent['ikeid'] != $ph1ent['ikeid']) { </tr>
continue; <tr>
} <td colspan="9">
$phase2count++;
}
$fr_prefix = "frp2{$i}";
?>
<div id="shph2but-<?=$i?>">
<button class="act_show_p2 btn btn-xs" type="button" data-id="<?=$i?>">
<i class="fa fa-plus"></i> <?php printf(gettext("Show %s Phase-2 entries"), $phase2count); ?>
</button>
</div>
<div id="tdph2-<?=$i?>" style="display:none">
<table class="table table-striped table-condensed">
<thead>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><?=gettext("Mode"); ?></td>
<td><?=gettext("Local Subnet"); ?></td>
<td><?=gettext("Remote Subnet"); ?></td>
<td><?=gettext("P2 Protocol"); ?></td>
<td><?=gettext("P2 Transforms"); ?></td>
<td><?=gettext("P2 Auth Methods"); ?></td>
<td class ="list">&nbsp;</td>
</tr>
</thead>
<tbody>
<?php <?php
$j = 0; $phase2count=0;
foreach ($pconfig['phase2'] as $ph2index => $ph2ent) : foreach ($pconfig['phase2'] as $ph2ent) {
if ($ph2ent['ikeid'] != $ph1ent['ikeid']) { if ($ph2ent['ikeid'] != $ph1ent['ikeid']) {
continue; continue;
} }
$phase2count++;
?> }?>
<tr> <div id="shph2but-<?=$i?>">
<td> <button class="act_show_p2 btn btn-xs" type="button" data-id="<?=$i?>">
<input type="checkbox" name="p2entry[]" value="<?=$ph2index;?>"/> <i class="fa fa-plus"></i> <?php printf(gettext("Show %s Phase-2 entries"), $phase2count); ?>
</td> </button>
<td> </div>
<button name="togglep2_<?=$ph2index; ?>_x" <div id="tdph2-<?=$i?>" style="display:none">
title="<?=(isset($ph2ent['disabled'])) ? gettext("enable phase 2 entry") : gettext("disable phase 2 entry"); ?>" data-toggle="tooltip" <table class="table table-striped table-condensed">
type="submit" class="btn btn-<?= isset($ph2ent['disabled'])?"default":"success";?> btn-xs"> <thead>
<span class="glyphicon glyphicon-play"></span> <tr>
</button> <td>&nbsp;</td>
</td> <td>&nbsp;</td>
<td> <?=$ph2ent['mode'];?> </td> <td><?=gettext("Mode"); ?></td>
<td><?=gettext("Local Subnet"); ?></td>
<td><?=gettext("Remote Subnet"); ?></td>
<td><?=gettext("P2 Protocol"); ?></td>
<td><?=gettext("P2 Transforms"); ?></td>
<td><?=gettext("P2 Auth Methods"); ?></td>
<td class ="list">&nbsp;</td>
</tr>
</thead>
<tbody>
<?php <?php
if (($ph2ent['mode'] == "tunnel") || ($ph2ent['mode'] == "tunnel6")) : $j = 0;
?> foreach ($pconfig['phase2'] as $ph2index => $ph2ent) :
<td> if ($ph2ent['ikeid'] != $ph1ent['ikeid']) {
<?=ipsec_idinfo_to_text($ph2ent['localid']); ?> continue;
</td> }?>
<td> <tr>
<?=ipsec_idinfo_to_text($ph2ent['remoteid']); ?> <td>
</td> <input type="checkbox" name="p2entry[]" value="<?=$ph2index;?>"/>
<?php else : </td>
?> <td>&nbsp;</td> <td>
<td>&nbsp;</td> <button name="togglep2_<?=$ph2index; ?>_x"
title="<?=(isset($ph2ent['disabled'])) ? gettext("enable phase 2 entry") : gettext("disable phase 2 entry"); ?>" data-toggle="tooltip"
type="submit" class="btn btn-<?= isset($ph2ent['disabled'])?"default":"success";?> btn-xs">
<span class="glyphicon glyphicon-play"></span>
</button>
</td>
<td> <?=$ph2ent['mode'];?> </td>
<?php <?php
endif; if (($ph2ent['mode'] == "tunnel") || ($ph2ent['mode'] == "tunnel6")) :?>
?> <td>
<td><?=$p2_protos[$ph2ent['protocol']];?> </td> <?=ipsec_idinfo_to_text($ph2ent['localid']); ?>
<td> </td>
<td>
<?=ipsec_idinfo_to_text($ph2ent['remoteid']); ?>
</td>
<?php <?php
foreach ($ph2ent['encryption-algorithm-option'] as $k => $ph2ea) { else :?>
if ($k > 0) { <td>&nbsp;</td>
echo ", "; <td>&nbsp;</td>
}
echo $p2_ealgos[$ph2ea['name']]['name'];
if (!empty($ph2ea['keylen'])) {
if ($ph2ea['keylen']=="auto") {
echo " (" . gettext("auto") . ")";
} else {
echo " ({$ph2ea['keylen']} " . gettext("bits") . ")";
}
}
}
?>
</td>
<td>
<?php <?php
if (!empty($ph2ent['hash-algorithm-option']) && is_array($ph2ent['hash-algorithm-option'])) { endif;?>
foreach ($ph2ent['hash-algorithm-option'] as $k => $ph2ha) { <td><?=$p2_protos[$ph2ent['protocol']];?> </td>
if ($k) { <td>
echo ", ";
}
echo $p2_halgos[$ph2ha];
}
}
?>
</td>
<td>
<button data-id="<?=$j; ?>" data-act="movep2"
title="<?=gettext("move selected entries before this");?>" data-toggle="tooltip" data-placement="left"
type="submit"
class="act_move btn btn-default btn-xs">
<span class="glyphicon glyphicon-arrow-left"></span>
</button>
<a href="vpn_ipsec_phase2.php?p2index=<?=$ph2ent['uniqid']; ?>"
title="<?=gettext("edit phase 2 entry"); ?>" data-toggle="tooltip" data-placement="left"
alt="edit" class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-pencil"></span>
</a>
<button data-id="<?=$ph2index; ?>"
title="<?=gettext("delete phase 2 entry");?>" data-toggle="tooltip" data-placement="left"
type="submit"
class="act_delete_p2 btn btn-default btn-xs">
<span class="glyphicon glyphicon-remove"></span>
</button>
<a href="vpn_ipsec_phase2.php?dup=<?=$ph2ent['uniqid']; ?>"
title="<?=gettext("clone phase 2 entry"); ?>" data-toggle="tooltip" data-placement="left"
alt="add" class="btn btn-default btn-xs">
<span class="fa fa-clone text-muted"></span>
</a>
</td>
</tr>
<?php <?php
$j++; foreach ($ph2ent['encryption-algorithm-option'] as $k => $ph2ea) {
endforeach; if ($k > 0) {
?> echo ", ";
<tr> }
<td colspan="8"></td> echo $p2_ealgos[$ph2ea['name']]['name'];
<td> if (!empty($ph2ea['keylen'])) {
<?php if ($j > 0) : if ($ph2ea['keylen']=="auto") {
?> echo " (" . gettext("auto") . ")";
} else {
echo " ({$ph2ea['keylen']} " . gettext("bits") . ")";
}
}
}?>
</td>
<td>
<?php
if (!empty($ph2ent['hash-algorithm-option']) && is_array($ph2ent['hash-algorithm-option'])) {
foreach ($ph2ent['hash-algorithm-option'] as $k => $ph2ha) {
if ($k) {
echo ", ";
}
echo $p2_halgos[$ph2ha];
}
}?>
</td>
<td>
<button data-id="<?=$j; ?>" data-act="movep2"
title="<?=gettext("move selected entries before this");?>" data-toggle="tooltip" data-placement="left"
type="submit"
class="act_move btn btn-default btn-xs">
<span class="glyphicon glyphicon-arrow-left"></span>
</button>
<a href="vpn_ipsec_phase2.php?p2index=<?=$ph2ent['uniqid']; ?>"
title="<?=gettext("edit phase 2 entry"); ?>" data-toggle="tooltip" data-placement="left"
alt="edit" class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-pencil"></span>
</a>
<button data-id="<?=$ph2index; ?>"
title="<?=gettext("delete phase 2 entry");?>" data-toggle="tooltip" data-placement="left"
type="submit"
class="act_delete_p2 btn btn-default btn-xs">
<span class="glyphicon glyphicon-remove"></span>
</button>
<a href="vpn_ipsec_phase2.php?dup=<?=$ph2ent['uniqid']; ?>"
title="<?=gettext("clone phase 2 entry"); ?>" data-toggle="tooltip" data-placement="left"
alt="add" class="btn btn-default btn-xs">
<span class="fa fa-clone text-muted"></span>
</a>
</td>
</tr>
<?php
$j++;
endforeach;?>
<tr>
<td colspan="8"></td>
<td>
<?php
if ($j > 0) :?>
<button data-id="<?=$j+1; ?>" data-act="movep2" type="submit" <button data-id="<?=$j+1; ?>" data-act="movep2" type="submit"
title="<?=gettext("move selected phase 2 entries to end");?>" data-toggle="tooltip" data-placement="left" title="<?=gettext("move selected phase 2 entries to end");?>" data-toggle="tooltip" data-placement="left"
class="act_move btn btn-default btn-xs"> class="act_move btn btn-default btn-xs">
<span class="glyphicon glyphicon-arrow-down"></span> <span class="glyphicon glyphicon-arrow-down"></span>
</button> </button>
<?php endif; <button data-id="x" type="submit" title="<?=gettext("delete selected phase 2 entries");?>" data-toggle="tooltip" data-placement="left"
?> class="act_delete_p2 btn btn-default btn-xs">
<?php if ($j > 0) : <span class="glyphicon glyphicon-remove"></span>
?> </button>
<button data-id="x" type="submit" title="<?=gettext("delete selected phase 2 entries");?>" data-toggle="tooltip" data-placement="left"
class="act_delete_p2 btn btn-default btn-xs">
<span class="glyphicon glyphicon-remove"></span>
</button>
<?php endif;
?>
<a href="vpn_ipsec_phase2.php?ikeid=<?=$ph1ent['ikeid']; ?><?= isset($ph1ent['mobile'])?"&amp;mobile=true":"";?>" class="btn btn-default btn-xs"
title="<?=gettext("add phase 2 entry"); ?>" data-toggle="tooltip" data-placement="left">
<span alt="add" class="glyphicon glyphicon-plus"></span>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
<?php <?php
$i++; endif;?>
endforeach; // $a_phase1 as $ph1ent <a href="vpn_ipsec_phase2.php?ikeid=<?=$ph1ent['ikeid']; ?><?= isset($ph1ent['mobile'])?"&amp;mobile=true":"";?>" class="btn btn-default btn-xs"
?> title="<?=gettext("add phase 2 entry"); ?>" data-toggle="tooltip" data-placement="left">
<tr> <span alt="add" class="glyphicon glyphicon-plus"></span>
<td colspan="8"> </td> </a>
<td> </td>
<button </tr>
type="submit" </tbody>
data-id="<?=$i;?>" </table>
data-act="movep1" </div>
title="<?=gettext("move selected phase 1 entries to end");?>" </td>
data-toggle="tooltip" data-placement="left" </tr>
class="act_move btn btn-default btn-xs"> <?php
<span class="glyphicon glyphicon-arrow-down"></span> $i++;
</button> endforeach;?>
<button data-id="" <tr>
type="submit" <td colspan="8"> </td>
title="<?=gettext("delete selected phase 1 entries");?>" <td>
data-toggle="tooltip" data-placement="left" <button
class="act_delete_p1 btn btn-default btn-xs"> type="submit"
<span class="glyphicon glyphicon-remove"></span> data-id="<?=$i;?>"
</button> data-act="movep1"
<a href="vpn_ipsec_phase1.php" title="<?=gettext("add new phase 1 entry");?>" data-toggle="tooltip" data-placement="left" title="<?=gettext("move selected phase 1 entries to end");?>"
alt="add" class="btn btn-default btn-xs"> data-toggle="tooltip" data-placement="left"
<span class="glyphicon glyphicon-plus"></span> class="act_move btn btn-default btn-xs">
</a> <span class="glyphicon glyphicon-arrow-down"></span>
</td> </button>
</tr> <button data-id=""
<tr> type="submit"
<td colspan=9> title="<?=gettext("delete selected phase 1 entries");?>"
<input name="enable" type="checkbox" id="enable" value="yes" <?=!empty($pconfig['enable']) ? "checked=\"checked\"":"";?>/> data-toggle="tooltip" data-placement="left"
<strong><?=gettext("Enable IPsec"); ?></strong> class="act_delete_p1 btn btn-default btn-xs">
</td> <span class="glyphicon glyphicon-remove"></span>
</tr> </button>
<tr> <a href="vpn_ipsec_phase1.php" title="<?=gettext("add new phase 1 entry");?>" data-toggle="tooltip" data-placement="left"
<td colspan=9> alt="add" class="btn btn-default btn-xs">
<input type="submit" name="save" class="btn btn-primary" value="<?=gettext("Save"); ?>" /> <span class="glyphicon glyphicon-plus"></span>
</td> </a>
</tr> </td>
</tr>
<tr>
<td colspan=9>
<input name="enable" type="checkbox" id="enable" value="yes" <?=!empty($pconfig['enable']) ? "checked=\"checked\"":"";?>/>
<strong><?=gettext("Enable IPsec"); ?></strong>
</td>
</tr>
<tr>
<td colspan=9>
<input type="submit" name="save" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
...@@ -626,5 +612,4 @@ endforeach; // $a_phase1 as $ph1ent ...@@ -626,5 +612,4 @@ endforeach; // $a_phase1 as $ph1ent
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); <?php include("foot.inc");
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