Commit d03721da authored by Franco Fichtner's avatar Franco Fichtner

captiveportal: apply PSR2 style

parent 87387963
...@@ -30,14 +30,16 @@ ...@@ -30,14 +30,16 @@
$captiveportal_element_sizelimit = 1048576; $captiveportal_element_sizelimit = 1048576;
function cpelementscmp($a, $b) { function cpelementscmp($a, $b)
{
return strcasecmp($a['name'], $b['name']); return strcasecmp($a['name'], $b['name']);
} }
function cpelements_sort() { function cpelements_sort()
{
global $config, $cpzone; global $config, $cpzone;
usort($config['captiveportal'][$cpzone]['element'],"cpelementscmp"); usort($config['captiveportal'][$cpzone]['element'], "cpelementscmp");
} }
require_once("guiconfig.inc"); require_once("guiconfig.inc");
...@@ -47,23 +49,26 @@ require_once("shaper.inc"); ...@@ -47,23 +49,26 @@ require_once("shaper.inc");
require_once("captiveportal.inc"); require_once("captiveportal.inc");
$cpzone = $_GET['zone']; $cpzone = $_GET['zone'];
if (isset($_POST['zone'])) if (isset($_POST['zone'])) {
$cpzone = $_POST['zone']; $cpzone = $_POST['zone'];
}
if (empty($cpzone)) { if (empty($cpzone)) {
header("Location: services_captiveportal_zones.php"); header("Location: services_captiveportal_zones.php");
exit; exit;
} }
if (!is_array($config['captiveportal'])) if (!is_array($config['captiveportal'])) {
$config['captiveportal'] = array(); $config['captiveportal'] = array();
}
$a_cp =& $config['captiveportal']; $a_cp =& $config['captiveportal'];
$pgtitle = array(gettext("Services"),gettext("Captive portal"), $a_cp[$cpzone]['zone']); $pgtitle = array(gettext("Services"),gettext("Captive portal"), $a_cp[$cpzone]['zone']);
$shortcut_section = "captiveportal"; $shortcut_section = "captiveportal";
if (!is_array($a_cp[$cpzone]['element'])) if (!is_array($a_cp[$cpzone]['element'])) {
$a_cp[$cpzone]['element'] = array(); $a_cp[$cpzone]['element'] = array();
}
$a_element =& $a_cp[$cpzone]['element']; $a_element =& $a_cp[$cpzone]['element'];
// Calculate total size of all files // Calculate total size of all files
...@@ -76,11 +81,11 @@ if ($_POST) { ...@@ -76,11 +81,11 @@ if ($_POST) {
unset($input_errors); unset($input_errors);
if (is_uploaded_file($_FILES['new']['tmp_name'])) { if (is_uploaded_file($_FILES['new']['tmp_name'])) {
if (!stristr($_FILES['new']['name'], "captiveportal-")) {
if(!stristr($_FILES['new']['name'], "captiveportal-"))
$name = "captiveportal-" . $_FILES['new']['name']; $name = "captiveportal-" . $_FILES['new']['name'];
else } else {
$name = $_FILES['new']['name']; $name = $_FILES['new']['name'];
}
$size = filesize($_FILES['new']['tmp_name']); $size = filesize($_FILES['new']['tmp_name']);
// is there already a file with that name? // is there already a file with that name?
...@@ -112,7 +117,7 @@ if ($_POST) { ...@@ -112,7 +117,7 @@ if ($_POST) {
exit; exit;
} }
} }
} else if (($_GET['act'] == "del") && !empty($cpzone) && $a_element[$_GET['id']]) { } elseif (($_GET['act'] == "del") && !empty($cpzone) && $a_element[$_GET['id']]) {
@unlink("/var/db/cpelements/" . $a_element[$_GET['id']]['name']); @unlink("/var/db/cpelements/" . $a_element[$_GET['id']]['name']);
@unlink("/usr/local/captiveportal/" . $a_element[$_GET['id']]['name']); @unlink("/usr/local/captiveportal/" . $a_element[$_GET['id']]['name']);
unset($a_element[$_GET['id']]); unset($a_element[$_GET['id']]);
...@@ -138,7 +143,9 @@ $main_buttons = array( ...@@ -138,7 +143,9 @@ $main_buttons = array(
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) {
print_input_errors($input_errors);
} ?>
<section class="col-xs-12"> <section class="col-xs-12">
...@@ -162,7 +169,8 @@ $main_buttons = array( ...@@ -162,7 +169,8 @@ $main_buttons = array(
<input type="hidden" name="zone" id="zone" value="<?=htmlspecialchars($cpzone);?>" /> <input type="hidden" name="zone" id="zone" value="<?=htmlspecialchars($cpzone);?>" />
<?php if ($_GET['act'] == 'add'): ?> <?php if ($_GET['act'] == 'add') :
?>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr> <tr>
...@@ -180,7 +188,8 @@ $main_buttons = array( ...@@ -180,7 +188,8 @@ $main_buttons = array(
</div> </div>
<br/> <br/>
<?php endif; ?> <?php
endif; ?>
...@@ -193,25 +202,34 @@ $main_buttons = array( ...@@ -193,25 +202,34 @@ $main_buttons = array(
</td> </td>
</tr> </tr>
<?php if (is_array($a_cp[$cpzone]['element'])): <?php if (is_array($a_cp[$cpzone]['element'])) :
$i = 0; foreach ($a_cp[$cpzone]['element'] as $element): ?> $i = 0; foreach ($a_cp[$cpzone]['element'] as $element) :
?>
<tr> <tr>
<td class="listlr"><?=htmlspecialchars($element['name']);?></td> <td class="listlr"><?=htmlspecialchars($element['name']);?></td>
<td class="listr" align="right"><?=format_bytes($element['size']);?></td> <td class="listr" align="right"><?=format_bytes($element['size']);?></td>
<td valign="middle" class="list nowrap"> <td valign="middle" class="list nowrap">
<a href="services_captiveportal_filemanager.php?zone=<?=$cpzone;?>&amp;act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this file?"); ?>')"> <a href="services_captiveportal_filemanager.php?zone=<?=$cpzone;
?>&amp;act=del&amp;id=<?=$i;
?>" onclick="return confirm('<?=gettext("Do you really want to delete this file?"); ?>')">
<span class="glyphicon glyphicon-remove" title="<?=gettext("delete file"); ?>"></span></a> <span class="glyphicon glyphicon-remove" title="<?=gettext("delete file"); ?>"></span></a>
</td> </td>
</tr> </tr>
<?php $i++; endforeach; endif; ?> <?php $i++;
endforeach;
<?php if ($total_size > 0): ?> endif; ?>
<?php if ($total_size > 0) :
?>
<tr> <tr>
<td class="listlr" style="background-color: #eee"><strong><?=gettext("TOTAL"); ?></strong></td> <td class="listlr" style="background-color: #eee"><strong><?=gettext("TOTAL"); ?></strong></td>
<td class="listr" style="background-color: #eee" align="right"><strong><?=format_bytes($total_size);?></strong></td> <td class="listr" style="background-color: #eee" align="right"><strong><?=format_bytes($total_size);?></strong></td>
<td valign="middle" style="background-color: #eee" class="list nowrap"></td> <td valign="middle" style="background-color: #eee" class="list nowrap"></td>
</tr> </tr>
<?php endif; ?> <?php
endif; ?>
</table> </table>
</div> </div>
...@@ -241,4 +259,4 @@ $main_buttons = array( ...@@ -241,4 +259,4 @@ $main_buttons = array(
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc");
...@@ -33,16 +33,18 @@ require_once("shaper.inc"); ...@@ -33,16 +33,18 @@ require_once("shaper.inc");
require_once("captiveportal.inc"); require_once("captiveportal.inc");
$cpzone = $_GET['zone']; $cpzone = $_GET['zone'];
if (isset($_POST['zone'])) if (isset($_POST['zone'])) {
$cpzone = $_POST['zone']; $cpzone = $_POST['zone'];
}
if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) { if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
header("Location: services_captiveportal_zones.php"); header("Location: services_captiveportal_zones.php");
exit; exit;
} }
if (!is_array($config['captiveportal'])) if (!is_array($config['captiveportal'])) {
$config['captiveportal'] = array(); $config['captiveportal'] = array();
}
$a_cp =& $config['captiveportal']; $a_cp =& $config['captiveportal'];
$pgtitle = array(gettext("Services"),gettext("Captive portal"), $a_cp[$cpzone]['zone']); $pgtitle = array(gettext("Services"),gettext("Captive portal"), $a_cp[$cpzone]['zone']);
...@@ -77,7 +79,9 @@ $main_buttons = array( ...@@ -77,7 +79,9 @@ $main_buttons = array(
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if ($savemsg) print_info_box($savemsg); ?> <?php if ($savemsg) {
print_info_box($savemsg);
} ?>
<section class="col-xs-12"> <section class="col-xs-12">
...@@ -109,23 +113,25 @@ $main_buttons = array( ...@@ -109,23 +113,25 @@ $main_buttons = array(
</td> </td>
</tr> </tr>
<?php if (is_array($a_cp[$cpzone]['allowedip'])): <?php if (is_array($a_cp[$cpzone]['allowedip'])) :
$i = 0; foreach ($a_cp[$cpzone]['allowedip'] as $ip): ?> $i = 0; foreach ($a_cp[$cpzone]['allowedip'] as $ip) :
<tr ondblclick="document.location='services_captiveportal_ip_edit.php?zone=<?=$cpzone;?>&amp;id=<?=$i;?>'"> ?>
<tr ondblclick="document.location='services_captiveportal_ip_edit.php?zone=<?=$cpzone;
?>&amp;id=<?=$i;?>'">
<td class="listlr"> <td class="listlr">
<?php <?php
if($ip['dir'] == "to") { if ($ip['dir'] == "to") {
echo "any <span class=\"glyphicon glyphicon-arrow-right\" aria-hidden=\"true\" alt=\"in\"></span> "; echo "any <span class=\"glyphicon glyphicon-arrow-right\" aria-hidden=\"true\" alt=\"in\"></span> ";
} }
if($ip['dir'] == "both") { if ($ip['dir'] == "both") {
echo "<span class=\"glyphicon glyphicon-resize-horizontal\" aria-hidden=\"true\" alt=\"pass\"></span> "; echo "<span class=\"glyphicon glyphicon-resize-horizontal\" aria-hidden=\"true\" alt=\"pass\"></span> ";
} }
echo strtolower($ip['ip']); echo strtolower($ip['ip']);
if($ip['sn'] != "32" && is_numeric($ip['sn'])) { if ($ip['sn'] != "32" && is_numeric($ip['sn'])) {
$sn = $ip['sn']; $sn = $ip['sn'];
echo "/$sn"; echo "/$sn";
} }
if($ip['dir'] == "from") { if ($ip['dir'] == "from") {
echo "<span class=\"glyphicon glyphicon-arrow-right\" aria-hidden=\"true\" alt=\"any\"></span> any"; echo "<span class=\"glyphicon glyphicon-arrow-right\" aria-hidden=\"true\" alt=\"any\"></span> any";
} }
...@@ -134,10 +140,17 @@ $main_buttons = array( ...@@ -134,10 +140,17 @@ $main_buttons = array(
<td class="listbg"> <td class="listbg">
<?=htmlspecialchars($ip['descr']);?>&nbsp; <?=htmlspecialchars($ip['descr']);?>&nbsp;
</td> </td>
<td valign="middle" class="list nowrap"><a href="services_captiveportal_ip_edit.php?zone=<?=$cpzone;?>&amp;id=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a> <td valign="middle" class="list nowrap"><a href="services_captiveportal_ip_edit.php?zone=<?=$cpzone;
<a href="services_captiveportal_ip.php?zone=<?=$cpzone;?>&amp;act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this address?"); ?>')" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a></td> ?>&amp;id=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="services_captiveportal_ip.php?zone=<?=$cpzone;
?>&amp;act=del&amp;id=<?=$i;
?>" onclick="return confirm('<?=gettext("Do you really want to delete this address?"); ?>')" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a></td>
</tr> </tr>
<?php $i++; endforeach; endif; ?> <?php $i++;
endforeach;
endif; ?>
<tr> <tr>
<td colspan="2" class="list"><p class="vexpl"><span class="red"><strong> <td colspan="2" class="list"><p class="vexpl"><span class="red"><strong>
...@@ -157,4 +170,4 @@ $main_buttons = array( ...@@ -157,4 +170,4 @@ $main_buttons = array(
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc");
...@@ -28,14 +28,16 @@ ...@@ -28,14 +28,16 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
function allowedipscmp($a, $b) { function allowedipscmp($a, $b)
{
return strcmp($a['ip'], $b['ip']); return strcmp($a['ip'], $b['ip']);
} }
function allowedips_sort() { function allowedips_sort()
{
global $g, $config, $cpzone; global $g, $config, $cpzone;
usort($config['captiveportal'][$cpzone]['allowedip'],"allowedipscmp"); usort($config['captiveportal'][$cpzone]['allowedip'], "allowedipscmp");
} }
require_once("guiconfig.inc"); require_once("guiconfig.inc");
...@@ -48,25 +50,30 @@ $pgtitle = array(gettext("Services"),gettext("Captive portal"),gettext("Edit all ...@@ -48,25 +50,30 @@ $pgtitle = array(gettext("Services"),gettext("Captive portal"),gettext("Edit all
$shortcut_section = "captiveportal"; $shortcut_section = "captiveportal";
$cpzone = $_GET['zone']; $cpzone = $_GET['zone'];
if (isset($_POST['zone'])) if (isset($_POST['zone'])) {
$cpzone = $_POST['zone']; $cpzone = $_POST['zone'];
}
if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) { if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
header("Location: services_captiveportal_zones.php"); header("Location: services_captiveportal_zones.php");
exit; exit;
} }
if (!is_array($config['captiveportal'])) if (!is_array($config['captiveportal'])) {
$config['captiveportal'] = array(); $config['captiveportal'] = array();
}
$a_cp =& $config['captiveportal']; $a_cp =& $config['captiveportal'];
if (is_numericint($_GET['id'])) if (is_numericint($_GET['id'])) {
$id = $_GET['id']; $id = $_GET['id'];
if (isset($_POST['id']) && is_numericint($_POST['id'])) }
if (isset($_POST['id']) && is_numericint($_POST['id'])) {
$id = $_POST['id']; $id = $_POST['id'];
}
if (!is_array($config['captiveportal'][$cpzone]['allowedip'])) if (!is_array($config['captiveportal'][$cpzone]['allowedip'])) {
$config['captiveportal'][$cpzone]['allowedip'] = array(); $config['captiveportal'][$cpzone]['allowedip'] = array();
}
$a_allowedips =& $config['captiveportal'][$cpzone]['allowedip']; $a_allowedips =& $config['captiveportal'][$cpzone]['allowedip'];
if (isset($id) && $a_allowedips[$id]) { if (isset($id) && $a_allowedips[$id]) {
...@@ -78,7 +85,6 @@ if (isset($id) && $a_allowedips[$id]) { ...@@ -78,7 +85,6 @@ if (isset($id) && $a_allowedips[$id]) {
} }
if ($_POST) { if ($_POST) {
unset($input_errors); unset($input_errors);
$pconfig = $_POST; $pconfig = $_POST;
...@@ -88,23 +94,28 @@ if ($_POST) { ...@@ -88,23 +94,28 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
if ($_POST['ip'] && !is_ipaddr($_POST['ip'])) if ($_POST['ip'] && !is_ipaddr($_POST['ip'])) {
$input_errors[] = sprintf(gettext("A valid IP address must be specified. [%s]"), $_POST['ip']); $input_errors[] = sprintf(gettext("A valid IP address must be specified. [%s]"), $_POST['ip']);
}
if ($_POST['sn'] && (!is_numeric($_POST['sn']) || ($_POST['sn'] < 1) || ($_POST['sn'] > 32))) if ($_POST['sn'] && (!is_numeric($_POST['sn']) || ($_POST['sn'] < 1) || ($_POST['sn'] > 32))) {
$input_errors[] = gettext("A valid subnet mask must be specified"); $input_errors[] = gettext("A valid subnet mask must be specified");
}
if ($_POST['bw_up'] && !is_numeric($_POST['bw_up'])) if ($_POST['bw_up'] && !is_numeric($_POST['bw_up'])) {
$input_errors[] = gettext("Upload speed needs to be an integer"); $input_errors[] = gettext("Upload speed needs to be an integer");
}
if ($_POST['bw_down'] && !is_numeric($_POST['bw_down'])) if ($_POST['bw_down'] && !is_numeric($_POST['bw_down'])) {
$input_errors[] = gettext("Download speed needs to be an integer"); $input_errors[] = gettext("Download speed needs to be an integer");
}
foreach ($a_allowedips as $ipent) { foreach ($a_allowedips as $ipent) {
if (isset($id) && ($a_allowedips[$id]) && ($a_allowedips[$id] === $ipent)) if (isset($id) && ($a_allowedips[$id]) && ($a_allowedips[$id] === $ipent)) {
continue; continue;
}
if ($ipent['ip'] == $_POST['ip']){ if ($ipent['ip'] == $_POST['ip']) {
$input_errors[] = sprintf("[%s] %s.", $_POST['ip'], gettext("already allowed")) ; $input_errors[] = sprintf("[%s] %s.", $_POST['ip'], gettext("already allowed")) ;
break ; break ;
} }
...@@ -115,16 +126,19 @@ if ($_POST) { ...@@ -115,16 +126,19 @@ if ($_POST) {
$ip['ip'] = $_POST['ip']; $ip['ip'] = $_POST['ip'];
$ip['sn'] = $_POST['sn']; $ip['sn'] = $_POST['sn'];
$ip['descr'] = $_POST['descr']; $ip['descr'] = $_POST['descr'];
if ($_POST['bw_up']) if ($_POST['bw_up']) {
$ip['bw_up'] = $_POST['bw_up']; $ip['bw_up'] = $_POST['bw_up'];
if ($_POST['bw_down']) }
if ($_POST['bw_down']) {
$ip['bw_down'] = $_POST['bw_down']; $ip['bw_down'] = $_POST['bw_down'];
}
if (isset($id) && $a_allowedips[$id]) { if (isset($id) && $a_allowedips[$id]) {
$oldip = $a_allowedips[$id]['ip']; $oldip = $a_allowedips[$id]['ip'];
if (!empty($a_allowedips[$id]['sn'])) if (!empty($a_allowedips[$id]['sn'])) {
$oldmask = $a_allowedips[$id]['sn']; $oldmask = $a_allowedips[$id]['sn'];
else } else {
$oldmask = 32; $oldmask = 32;
}
$a_allowedips[$id] = $ip; $a_allowedips[$id] = $ip;
} else { } else {
$a_allowedips[] = $ip; $a_allowedips[] = $ip;
...@@ -160,7 +174,9 @@ include("head.inc"); ...@@ -160,7 +174,9 @@ include("head.inc");
<div class="row"> <div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) {
print_input_errors($input_errors);
} ?>
<section class="col-xs-12"> <section class="col-xs-12">
...@@ -176,11 +192,17 @@ include("head.inc"); ...@@ -176,11 +192,17 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("IP address"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("IP address"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="ip" type="text" class="formfld unknown" id="ip" size="17" value="<?=htmlspecialchars($pconfig['ip']);?>" /> <?=$mandfldhtml;
?><input name="ip" type="text" class="formfld unknown" id="ip" size="17" value="<?=htmlspecialchars($pconfig['ip']);?>" />
/<select name='sn' class="formselect" id='sn'> /<select name='sn' class="formselect" id='sn'>
<?php for ($i = 32; $i >= 1; $i--): ?> <?php for ($i = 32; $i >= 1; $i--) :
<option value="<?=$i;?>" <?php if ($i == $pconfig['sn']) echo "selected=\"selected\""; ?>><?=$i;?></option> ?>
<?php endfor; ?> <option value="<?=$i;?>" <?php if ($i == $pconfig['sn']) {
echo "selected=\"selected\"";
} ?>><?=$i;?></option>
<?php
endfor; ?>
</select> </select>
<br /> <br />
<span class="vexpl"><?=gettext("IP address and subnet mask. Use /32 for a single IP");?>.</span> <span class="vexpl"><?=gettext("IP address and subnet mask. Use /32 for a single IP");?>.</span>
...@@ -214,9 +236,11 @@ include("head.inc"); ...@@ -214,9 +236,11 @@ include("head.inc");
<td width="78%"> <td width="78%">
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" /> <input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
<input name="zone" type="hidden" value="<?=htmlspecialchars($cpzone);?>" /> <input name="zone" type="hidden" value="<?=htmlspecialchars($cpzone);?>" />
<?php if (isset($id) && $a_allowedips[$id]): ?> <?php if (isset($id) && $a_allowedips[$id]) :
?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" /> <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?> <?php
endif; ?>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -228,4 +252,4 @@ include("head.inc"); ...@@ -228,4 +252,4 @@ include("head.inc");
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc");
...@@ -37,23 +37,24 @@ global $cpzone; ...@@ -37,23 +37,24 @@ global $cpzone;
global $cpzoneid; global $cpzoneid;
$cpzone = $_GET['zone']; $cpzone = $_GET['zone'];
if (isset($_POST['zone'])) if (isset($_POST['zone'])) {
$cpzone = $_POST['zone']; $cpzone = $_POST['zone'];
}
if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) { if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
header("Location: services_captiveportal_zones.php"); header("Location: services_captiveportal_zones.php");
exit; exit;
} }
if (!is_array($config['captiveportal'])) if (!is_array($config['captiveportal'])) {
$config['captiveportal'] = array(); $config['captiveportal'] = array();
}
$a_cp =& $config['captiveportal']; $a_cp =& $config['captiveportal'];
$pgtitle = array(gettext("Services"),gettext("Captive portal"), $a_cp[$cpzone]['zone']); $pgtitle = array(gettext("Services"),gettext("Captive portal"), $a_cp[$cpzone]['zone']);
$shortcut_section = "captiveportal"; $shortcut_section = "captiveportal";
if ($_POST) { if ($_POST) {
$pconfig = $_POST; $pconfig = $_POST;
if ($_POST['apply']) { if ($_POST['apply']) {
...@@ -61,9 +62,10 @@ if ($_POST) { ...@@ -61,9 +62,10 @@ if ($_POST) {
$rules = captiveportal_passthrumac_configure(); $rules = captiveportal_passthrumac_configure();
$savemsg = get_std_save_message($retval); $savemsg = get_std_save_message($retval);
if ($retval == 0) if ($retval == 0) {
clear_subsystem_dirty('passthrumac'); clear_subsystem_dirty('passthrumac');
} }
}
if ($_POST['postafterlogin']) { if ($_POST['postafterlogin']) {
if (!is_array($a_passthrumacs)) { if (!is_array($a_passthrumacs)) {
...@@ -74,17 +76,19 @@ if ($_POST) { ...@@ -74,17 +76,19 @@ if ($_POST) {
echo gettext("Please set the zone on which the operation should be allowed"); echo gettext("Please set the zone on which the operation should be allowed");
exit; exit;
} }
if (!is_array($a_cp[$cpzone]['passthrumac'])) if (!is_array($a_cp[$cpzone]['passthrumac'])) {
$a_cp[$cpzone]['passthrumac'] = array(); $a_cp[$cpzone]['passthrumac'] = array();
}
$a_passthrumacs =& $a_cp[$cpzone]['passthrumac']; $a_passthrumacs =& $a_cp[$cpzone]['passthrumac'];
if ($_POST['username']) { if ($_POST['username']) {
$mac = captiveportal_passthrumac_findbyname($_POST['username']); $mac = captiveportal_passthrumac_findbyname($_POST['username']);
if (!empty($mac)) if (!empty($mac)) {
$_POST['delmac'] = $mac['mac']; $_POST['delmac'] = $mac['mac'];
else } else {
echo gettext("No entry exists for this username:") . " " . $_POST['username'] . "\n"; echo gettext("No entry exists for this username:") . " " . $_POST['username'] . "\n";
} }
}
if ($_POST['delmac']) { if ($_POST['delmac']) {
$found = false; $found = false;
foreach ($a_passthrumacs as $idx => $macent) { foreach ($a_passthrumacs as $idx => $macent) {
...@@ -99,9 +103,10 @@ if ($_POST) { ...@@ -99,9 +103,10 @@ if ($_POST) {
unset($a_passthrumacs[$idx]); unset($a_passthrumacs[$idx]);
write_config(); write_config();
echo gettext("The entry was sucessfully deleted") . "\n"; echo gettext("The entry was sucessfully deleted") . "\n";
} else } else {
echo gettext("No entry exists for this mac address:") . " " . $_POST['delmac'] . "\n"; echo gettext("No entry exists for this mac address:") . " " . $_POST['delmac'] . "\n";
} }
}
exit; exit;
} }
} }
...@@ -132,10 +137,14 @@ $main_buttons = array( ...@@ -132,10 +137,14 @@ $main_buttons = array(
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if ($savemsg) print_info_box($savemsg); ?> <?php if ($savemsg) {
<?php if (is_subsystem_dirty('passthrumac')): ?><p> print_info_box($savemsg);
} ?>
<?php if (is_subsystem_dirty('passthrumac')) :
?><p>
<?php print_info_box_np(gettext("The captive portal MAC address configuration has been changed.<br />You must apply the changes in order for them to take effect."));?><br /> <?php print_info_box_np(gettext("The captive portal MAC address configuration has been changed.<br />You must apply the changes in order for them to take effect."));?><br />
<?php endif; ?> <?php
endif; ?>
<section class="col-xs-12"> <section class="col-xs-12">
...@@ -167,13 +176,15 @@ $main_buttons = array( ...@@ -167,13 +176,15 @@ $main_buttons = array(
<td width="10%" class="list"></td> <td width="10%" class="list"></td>
</tr> </tr>
<?php <?php
if (is_array($a_cp[$cpzone]['passthrumac'])): if (is_array($a_cp[$cpzone]['passthrumac'])) :
$i = 0; $i = 0;
foreach ($a_cp[$cpzone]['passthrumac'] as $mac): foreach ($a_cp[$cpzone]['passthrumac'] as $mac) :
?> ?>
<tr ondblclick="document.location='services_captiveportal_mac_edit.php?zone=<?=$cpzone;?>&amp;id=<?=$i;?>'"> <tr ondblclick="document.location='services_captiveportal_mac_edit.php?zone=<?=$cpzone;
?>&amp;id=<?=$i;?>'">
<td valign="middle" class="list nowrap"> <td valign="middle" class="list nowrap">
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_<?=$mac['action'];?>.gif" width="11" height="11" border="0" alt="icon" /> <img src="./themes/<?= $g['theme'];
?>/images/icons/icon_<?=$mac['action'];?>.gif" width="11" height="11" border="0" alt="icon" />
</td> </td>
<td class="listlr"> <td class="listlr">
<?=$mac['mac'];?> <?=$mac['mac'];?>
...@@ -182,9 +193,12 @@ $main_buttons = array( ...@@ -182,9 +193,12 @@ $main_buttons = array(
<?=htmlspecialchars($mac['descr']);?>&nbsp; <?=htmlspecialchars($mac['descr']);?>&nbsp;
</td> </td>
<td valign="middle" class="list nowrap"> <td valign="middle" class="list nowrap">
<a href="services_captiveportal_mac_edit.php?zone=<?=$cpzone;?>&amp;id=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a> <a href="services_captiveportal_mac_edit.php?zone=<?=$cpzone;
?>&amp;id=<?=$i;?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
&nbsp; &nbsp;
<a href="services_captiveportal_mac.php?zone=<?=$cpzone;?>&amp;act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this host?"); ?>')" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a> <a href="services_captiveportal_mac.php?zone=<?=$cpzone;
?>&amp;act=del&amp;id=<?=$i;
?>" onclick="return confirm('<?=gettext("Do you really want to delete this host?"); ?>')" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a>
</td> </td>
</tr> </tr>
<?php <?php
...@@ -213,4 +227,4 @@ $main_buttons = array( ...@@ -213,4 +227,4 @@ $main_buttons = array(
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc");
...@@ -27,14 +27,16 @@ ...@@ -27,14 +27,16 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
function passthrumacscmp($a, $b) { function passthrumacscmp($a, $b)
{
return strcmp($a['mac'], $b['mac']); return strcmp($a['mac'], $b['mac']);
} }
function passthrumacs_sort() { function passthrumacs_sort()
{
global $config, $cpzone; global $config, $cpzone;
usort($config['captiveportal'][$cpzone]['passthrumac'],"passthrumacscmp"); usort($config['captiveportal'][$cpzone]['passthrumac'], "passthrumacscmp");
} }
require_once("guiconfig.inc"); require_once("guiconfig.inc");
...@@ -50,25 +52,30 @@ $pgtitle = array(gettext("Services"),gettext("Captive portal"),gettext("Edit MAC ...@@ -50,25 +52,30 @@ $pgtitle = array(gettext("Services"),gettext("Captive portal"),gettext("Edit MAC
$shortcut_section = "captiveportal"; $shortcut_section = "captiveportal";
$cpzone = $_GET['zone']; $cpzone = $_GET['zone'];
if (isset($_POST['zone'])) if (isset($_POST['zone'])) {
$cpzone = $_POST['zone']; $cpzone = $_POST['zone'];
}
if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) { if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
header("Location: services_captiveportal_zones.php"); header("Location: services_captiveportal_zones.php");
exit; exit;
} }
if (!is_array($config['captiveportal'])) if (!is_array($config['captiveportal'])) {
$config['captiveportal'] = array(); $config['captiveportal'] = array();
}
$a_cp =& $config['captiveportal']; $a_cp =& $config['captiveportal'];
if (is_numericint($_GET['id'])) if (is_numericint($_GET['id'])) {
$id = $_GET['id']; $id = $_GET['id'];
if (isset($_POST['id']) && is_numericint($_POST['id'])) }
if (isset($_POST['id']) && is_numericint($_POST['id'])) {
$id = $_POST['id']; $id = $_POST['id'];
}
if (!is_array($a_cp[$cpzone]['passthrumac'])) if (!is_array($a_cp[$cpzone]['passthrumac'])) {
$a_cp[$cpzone]['passthrumac'] = array(); $a_cp[$cpzone]['passthrumac'] = array();
}
$a_passthrumacs = &$a_cp[$cpzone]['passthrumac']; $a_passthrumacs = &$a_cp[$cpzone]['passthrumac'];
if (isset($id) && $a_passthrumacs[$id]) { if (isset($id) && $a_passthrumacs[$id]) {
...@@ -81,7 +88,6 @@ if (isset($id) && $a_passthrumacs[$id]) { ...@@ -81,7 +88,6 @@ if (isset($id) && $a_passthrumacs[$id]) {
} }
if ($_POST) { if ($_POST) {
unset($input_errors); unset($input_errors);
$pconfig = $_POST; $pconfig = $_POST;
...@@ -106,16 +112,19 @@ if ($_POST) { ...@@ -106,16 +112,19 @@ if ($_POST) {
$input_errors[] = sprintf("%s. [%s]", gettext("A valid MAC address must be specified"), $_POST['mac']); $input_errors[] = sprintf("%s. [%s]", gettext("A valid MAC address must be specified"), $_POST['mac']);
} }
} }
if ($_POST['bw_up'] && !is_numeric($_POST['bw_up'])) if ($_POST['bw_up'] && !is_numeric($_POST['bw_up'])) {
$input_errors[] = gettext("Upload speed needs to be an integer"); $input_errors[] = gettext("Upload speed needs to be an integer");
if ($_POST['bw_down'] && !is_numeric($_POST['bw_down'])) }
if ($_POST['bw_down'] && !is_numeric($_POST['bw_down'])) {
$input_errors[] = gettext("Download speed needs to be an integer"); $input_errors[] = gettext("Download speed needs to be an integer");
}
foreach ($a_passthrumacs as $macent) { foreach ($a_passthrumacs as $macent) {
if (isset($id) && ($a_passthrumacs[$id]) && ($a_passthrumacs[$id] === $macent)) if (isset($id) && ($a_passthrumacs[$id]) && ($a_passthrumacs[$id] === $macent)) {
continue; continue;
}
if ($macent['mac'] == $_POST['mac']){ if ($macent['mac'] == $_POST['mac']) {
$input_errors[] = sprintf("[%s] %s.", $_POST['mac'], gettext("already exists")); $input_errors[] = sprintf("[%s] %s.", $_POST['mac'], gettext("already exists"));
break; break;
} }
...@@ -125,12 +134,15 @@ if ($_POST) { ...@@ -125,12 +134,15 @@ if ($_POST) {
$mac = array(); $mac = array();
$mac['action'] = $_POST['action']; $mac['action'] = $_POST['action'];
$mac['mac'] = $_POST['mac']; $mac['mac'] = $_POST['mac'];
if ($_POST['bw_up']) if ($_POST['bw_up']) {
$mac['bw_up'] = $_POST['bw_up']; $mac['bw_up'] = $_POST['bw_up'];
if ($_POST['bw_down']) }
if ($_POST['bw_down']) {
$mac['bw_down'] = $_POST['bw_down']; $mac['bw_down'] = $_POST['bw_down'];
if ($_POST['username']) }
if ($_POST['username']) {
$mac['username'] = $_POST['username']; $mac['username'] = $_POST['username'];
}
$mac['descr'] = $_POST['descr']; $mac['descr'] = $_POST['descr'];
...@@ -168,7 +180,9 @@ include("head.inc"); ...@@ -168,7 +180,9 @@ include("head.inc");
<div class="row"> <div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) {
print_input_errors($input_errors);
} ?>
<section class="col-xs-12"> <section class="col-xs-12">
...@@ -187,9 +201,11 @@ include("head.inc"); ...@@ -187,9 +201,11 @@ include("head.inc");
<select name="action" class="formselect"> <select name="action" class="formselect">
<?php <?php
$actions = explode(" ", "Pass Block"); $actions = explode(" ", "Pass Block");
foreach ($actions as $action): foreach ($actions as $action) :
?> ?>
<option value="<?=strtolower($action);?>"<?php if (strtolower($action) == strtolower($pconfig['action'])) echo "selected=\"selected\""; ?>> <option value="<?=strtolower($action);?>"<?php if (strtolower($action) == strtolower($pconfig['action'])) {
echo "selected=\"selected\"";
} ?>>
<?=htmlspecialchars($action);?> <?=htmlspecialchars($action);?>
</option> </option>
<?php <?php
...@@ -203,11 +219,12 @@ include("head.inc"); ...@@ -203,11 +219,12 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("MAC address"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("MAC address"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="mac" type="text" class="formfld unknown" id="mac" size="17" value="<?=htmlspecialchars($pconfig['mac']);?>" /> <?=$mandfldhtml;
?><input name="mac" type="text" class="formfld unknown" id="mac" size="17" value="<?=htmlspecialchars($pconfig['mac']);?>" />
<?php <?php
$ip = getenv('REMOTE_ADDR'); $ip = getenv('REMOTE_ADDR');
$mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`; $mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`;
$mac = str_replace("\n","",$mac); $mac = str_replace("\n", "", $mac);
?> ?>
<a onclick="document.forms[0].mac.value='<?=$mac?>';" href="#"><?=gettext("Copy my MAC address");?></a> <a onclick="document.forms[0].mac.value='<?=$mac?>';" href="#"><?=gettext("Copy my MAC address");?></a>
<br /> <br />
...@@ -244,12 +261,16 @@ include("head.inc"); ...@@ -244,12 +261,16 @@ include("head.inc");
<td width="78%"> <td width="78%">
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" /> <input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
<input name="zone" type="hidden" value="<?=htmlspecialchars($cpzone);?>" /> <input name="zone" type="hidden" value="<?=htmlspecialchars($cpzone);?>" />
<?php if (isset($id) && $a_passthrumacs[$id]): ?> <?php if (isset($id) && $a_passthrumacs[$id]) :
?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" /> <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?> <?php
<?php if (isset($pconfig['username']) && $pconfig['username']): ?> endif; ?>
<?php if (isset($pconfig['username']) && $pconfig['username']) :
?>
<input name="username" type="hidden" value="<?=htmlspecialchars($pconfig['username']);?>" /> <input name="username" type="hidden" value="<?=htmlspecialchars($pconfig['username']);?>" />
<?php endif; ?> <?php
endif; ?>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -261,4 +282,4 @@ include("head.inc"); ...@@ -261,4 +282,4 @@ include("head.inc");
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc");
This diff is collapsed.
...@@ -37,16 +37,18 @@ $pgtitle = array(gettext("Services"), gettext("Captive portal"), gettext("Edit V ...@@ -37,16 +37,18 @@ $pgtitle = array(gettext("Services"), gettext("Captive portal"), gettext("Edit V
$shortcut_section = "captiveportal-vouchers"; $shortcut_section = "captiveportal-vouchers";
$cpzone = $_GET['zone']; $cpzone = $_GET['zone'];
if (isset($_POST['zone'])) if (isset($_POST['zone'])) {
$cpzone = $_POST['zone']; $cpzone = $_POST['zone'];
}
if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) { if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) {
header("Location: services_captiveportal_zones.php"); header("Location: services_captiveportal_zones.php");
exit; exit;
} }
if (!is_array($config['captiveportal'])) if (!is_array($config['captiveportal'])) {
$config['captiveportal'] = array(); $config['captiveportal'] = array();
}
$a_cp =& $config['captiveportal']; $a_cp =& $config['captiveportal'];
if (!is_array($config['voucher'])) { if (!is_array($config['voucher'])) {
...@@ -58,10 +60,12 @@ if (!is_array($config['voucher'][$cpzone]['roll'])) { ...@@ -58,10 +60,12 @@ if (!is_array($config['voucher'][$cpzone]['roll'])) {
} }
$a_roll = &$config['voucher'][$cpzone]['roll']; $a_roll = &$config['voucher'][$cpzone]['roll'];
if (is_numericint($_GET['id'])) if (is_numericint($_GET['id'])) {
$id = $_GET['id']; $id = $_GET['id'];
if (isset($_POST['id']) && is_numericint($_POST['id'])) }
if (isset($_POST['id']) && is_numericint($_POST['id'])) {
$id = $_POST['id']; $id = $_POST['id'];
}
if (isset($id) && $a_roll[$id]) { if (isset($id) && $a_roll[$id]) {
$pconfig['zone'] = $a_roll[$id]['zone']; $pconfig['zone'] = $a_roll[$id]['zone'];
...@@ -75,7 +79,6 @@ $maxnumber = (1<<$config['voucher'][$cpzone]['rollbits']) -1; // Highest Roll ...@@ -75,7 +79,6 @@ $maxnumber = (1<<$config['voucher'][$cpzone]['rollbits']) -1; // Highest Roll
$maxcount = (1<<$config['voucher'][$cpzone]['ticketbits']) -1; // Highest Ticket# $maxcount = (1<<$config['voucher'][$cpzone]['ticketbits']) -1; // Highest Ticket#
if ($_POST) { if ($_POST) {
unset($input_errors); unset($input_errors);
$pconfig = $_POST; $pconfig = $_POST;
...@@ -86,26 +89,29 @@ if ($_POST) { ...@@ -86,26 +89,29 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
// Look for duplicate roll # // Look for duplicate roll #
foreach($a_roll as $re) { foreach ($a_roll as $re) {
if($re['number'] == $_POST['number']) { if ($re['number'] == $_POST['number']) {
$input_errors[] = sprintf(gettext("Roll number %s already exists."), $_POST['number']); $input_errors[] = sprintf(gettext("Roll number %s already exists."), $_POST['number']);
break; break;
} }
} }
if (!is_numeric($_POST['number']) || $_POST['number'] >= $maxnumber) if (!is_numeric($_POST['number']) || $_POST['number'] >= $maxnumber) {
$input_errors[] = sprintf(gettext("Roll number must be numeric and less than %s"), $maxnumber); $input_errors[] = sprintf(gettext("Roll number must be numeric and less than %s"), $maxnumber);
}
if (!is_numeric($_POST['count']) || $_POST['count'] < 1 || $_POST['count'] > $maxcount) if (!is_numeric($_POST['count']) || $_POST['count'] < 1 || $_POST['count'] > $maxcount) {
$input_errors[] = sprintf(gettext("A roll has at least one voucher and less than %s."), $maxcount); $input_errors[] = sprintf(gettext("A roll has at least one voucher and less than %s."), $maxcount);
}
if (!is_numeric($_POST['minutes']) || $_POST['minutes'] < 1) if (!is_numeric($_POST['minutes']) || $_POST['minutes'] < 1) {
$input_errors[] = gettext("Each voucher must be good for at least 1 minute."); $input_errors[] = gettext("Each voucher must be good for at least 1 minute.");
}
if (!$input_errors) { if (!$input_errors) {
if (isset($id) && $a_roll[$id]) {
if (isset($id) && $a_roll[$id])
$rollent = $a_roll[$id]; $rollent = $a_roll[$id];
}
$rollent['zone'] = $_POST['zone']; $rollent['zone'] = $_POST['zone'];
$rollent['number'] = $_POST['number']; $rollent['number'] = $_POST['number'];
...@@ -117,11 +123,11 @@ if ($_POST) { ...@@ -117,11 +123,11 @@ if ($_POST) {
if ($_POST['count'] != $rollent['count']) { if ($_POST['count'] != $rollent['count']) {
$rollent['count'] = $_POST['count']; $rollent['count'] = $_POST['count'];
$len = ($rollent['count']>>3) + 1; // count / 8 +1 $len = ($rollent['count']>>3) + 1; // count / 8 +1
$rollent['used'] = base64_encode(str_repeat("\000",$len)); // 4 bitmask $rollent['used'] = base64_encode(str_repeat("\000", $len)); // 4 bitmask
$rollent['active'] = array(); $rollent['active'] = array();
voucher_write_used_db($rollent['number'], $rollent['used']); voucher_write_used_db($rollent['number'], $rollent['used']);
voucher_write_active_db($rollent['number'], array()); // create empty DB voucher_write_active_db($rollent['number'], array()); // create empty DB
voucher_log(LOG_INFO,sprintf(gettext('All %1$s vouchers from Roll %2$s marked unused'), $rollent['count'], $rollent['number'])); voucher_log(LOG_INFO, sprintf(gettext('All %1$s vouchers from Roll %2$s marked unused'), $rollent['count'], $rollent['number']));
} else { } else {
// existing roll has been modified but without changing the count // existing roll has been modified but without changing the count
// read active and used DB from ramdisk and store it in XML config // read active and used DB from ramdisk and store it in XML config
...@@ -129,7 +135,7 @@ if ($_POST) { ...@@ -129,7 +135,7 @@ if ($_POST) {
$activent = array(); $activent = array();
$db = array(); $db = array();
$active_vouchers = voucher_read_active_db($rollent['number'], $rollent['minutes']); $active_vouchers = voucher_read_active_db($rollent['number'], $rollent['minutes']);
foreach($active_vouchers as $voucher => $line) { foreach ($active_vouchers as $voucher => $line) {
list($timestamp, $minutes) = explode(",", $line); list($timestamp, $minutes) = explode(",", $line);
$activent['voucher'] = $voucher; $activent['voucher'] = $voucher;
$activent['timestamp'] = $timestamp; $activent['timestamp'] = $timestamp;
...@@ -140,10 +146,11 @@ if ($_POST) { ...@@ -140,10 +146,11 @@ if ($_POST) {
} }
unlock($voucherlck); unlock($voucherlck);
if (isset($id) && $a_roll[$id]) if (isset($id) && $a_roll[$id]) {
$a_roll[$id] = $rollent; $a_roll[$id] = $rollent;
else } else {
$a_roll[] = $rollent; $a_roll[] = $rollent;
}
write_config(); write_config();
...@@ -165,8 +172,12 @@ include("head.inc"); ...@@ -165,8 +172,12 @@ include("head.inc");
<div class="row"> <div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) {
<?php if ($savemsg) print_info_box($savemsg); ?> print_input_errors($input_errors);
} ?>
<?php if ($savemsg) {
print_info_box($savemsg);
} ?>
<section class="col-xs-12"> <section class="col-xs-12">
...@@ -180,15 +191,19 @@ include("head.inc"); ...@@ -180,15 +191,19 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Roll"); ?>#</td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Roll"); ?>#</td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="number" type="text" class="formfld" id="number" size="10" value="<?=htmlspecialchars($pconfig['number']);?>" /> <?=$mandfldhtml;
?><input name="number" type="text" class="formfld" id="number" size="10" value="<?=htmlspecialchars($pconfig['number']);?>" />
<br /> <br />
<span class="vexpl"><?=gettext("Enter the Roll"); ?># (0..<?=htmlspecialchars($maxnumber);?>) <?=gettext("found on top of the generated/printed vouchers"); ?>.</span> <span class="vexpl"><?=gettext("Enter the Roll");
?># (0..<?=htmlspecialchars($maxnumber);
?>) <?=gettext("found on top of the generated/printed vouchers"); ?>.</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Minutes per Ticket"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Minutes per Ticket"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="minutes" type="text" class="formfld" id="minutes" size="10" value="<?=htmlspecialchars($pconfig['minutes']);?>" /> <?=$mandfldhtml;
?><input name="minutes" type="text" class="formfld" id="minutes" size="10" value="<?=htmlspecialchars($pconfig['minutes']);?>" />
<br /> <br />
<span class="vexpl"><?=gettext("Defines the time in minutes that a user is allowed access. The clock starts ticking the first time a voucher is used for authentication"); ?>.</span> <span class="vexpl"><?=gettext("Defines the time in minutes that a user is allowed access. The clock starts ticking the first time a voucher is used for authentication"); ?>.</span>
</td> </td>
...@@ -196,15 +211,19 @@ include("head.inc"); ...@@ -196,15 +211,19 @@ include("head.inc");
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Count"); ?></td> <td width="22%" valign="top" class="vncellreq"><?=gettext("Count"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="count" type="text" class="formfld" id="count" size="10" value="<?=htmlspecialchars($pconfig['count']);?>" /> <?=$mandfldhtml;
?><input name="count" type="text" class="formfld" id="count" size="10" value="<?=htmlspecialchars($pconfig['count']);?>" />
<br /> <br />
<span class="vexpl"><?=gettext("Enter the number of vouchers"); ?> (1..<?=htmlspecialchars($maxcount);?>) <?=gettext("found on top of the generated/printed vouchers. WARNING: Changing this number for an existing Roll will mark all vouchers as unused again"); ?>.</span> <span class="vexpl"><?=gettext("Enter the number of vouchers");
?> (1..<?=htmlspecialchars($maxcount);
?>) <?=gettext("found on top of the generated/printed vouchers. WARNING: Changing this number for an existing Roll will mark all vouchers as unused again"); ?>.</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Comment"); ?></td> <td width="22%" valign="top" class="vncell"><?=gettext("Comment"); ?></td>
<td width="78%" class="vtable"> <td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="descr" type="text" class="formfld" id="descr" size="60" value="<?=htmlspecialchars($pconfig['descr']);?>" /> <?=$mandfldhtml;
?><input name="descr" type="text" class="formfld" id="descr" size="60" value="<?=htmlspecialchars($pconfig['descr']);?>" />
<br /> <br />
<span class="vexpl"><?=gettext("Can be used to further identify this roll. Ignored by the system"); ?>.</span> <span class="vexpl"><?=gettext("Can be used to further identify this roll. Ignored by the system"); ?>.</span>
</td> </td>
...@@ -214,9 +233,11 @@ include("head.inc"); ...@@ -214,9 +233,11 @@ include("head.inc");
<td width="78%"> <td width="78%">
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" /> <input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save"); ?>" />
<input name="zone" type="hidden" value="<?=htmlspecialchars($cpzone);?>" /> <input name="zone" type="hidden" value="<?=htmlspecialchars($cpzone);?>" />
<?php if (isset($id) && $a_roll[$id]): ?> <?php if (isset($id) && $a_roll[$id]) :
?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" /> <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?> <?php
endif; ?>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -228,4 +249,4 @@ include("head.inc"); ...@@ -228,4 +249,4 @@ include("head.inc");
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc");
...@@ -34,8 +34,9 @@ require_once("captiveportal.inc"); ...@@ -34,8 +34,9 @@ require_once("captiveportal.inc");
global $cpzone; global $cpzone;
global $cpzoneid; global $cpzoneid;
if (!is_array($config['captiveportal'])) if (!is_array($config['captiveportal'])) {
$config['captiveportal'] = array(); $config['captiveportal'] = array();
}
$a_cp = &$config['captiveportal']; $a_cp = &$config['captiveportal'];
if ($_GET['act'] == "del" && !empty($_GET['zone'])) { if ($_GET['act'] == "del" && !empty($_GET['zone'])) {
...@@ -45,8 +46,9 @@ if ($_GET['act'] == "del" && !empty($_GET['zone'])) { ...@@ -45,8 +46,9 @@ if ($_GET['act'] == "del" && !empty($_GET['zone'])) {
unset($a_cp[$cpzone]['enable']); unset($a_cp[$cpzone]['enable']);
captiveportal_configure(); captiveportal_configure();
unset($a_cp[$cpzone]); unset($a_cp[$cpzone]);
if (isset($config['voucher'][$cpzone])) if (isset($config['voucher'][$cpzone])) {
unset($config['voucher'][$cpzone]); unset($config['voucher'][$cpzone]);
}
write_config(); write_config();
header("Location: services_captiveportal_zones.php"); header("Location: services_captiveportal_zones.php");
exit; exit;
...@@ -70,10 +72,14 @@ $main_buttons = array( ...@@ -70,10 +72,14 @@ $main_buttons = array(
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if ($savemsg) print_info_box($savemsg); ?> <?php if ($savemsg) {
<?php if (is_subsystem_dirty('captiveportal')): ?><p> print_info_box($savemsg);
} ?>
<?php if (is_subsystem_dirty('captiveportal')) :
?><p>
<?php print_info_box_np(gettext("The CaptivePortal entry list has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?> <?php print_info_box_np(gettext("The CaptivePortal entry list has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?>
<?php endif; ?> <?php
endif; ?>
<section class="col-xs-12"> <section class="col-xs-12">
...@@ -93,9 +99,10 @@ $main_buttons = array( ...@@ -93,9 +99,10 @@ $main_buttons = array(
</td> </td>
</tr> </tr>
<?php foreach ($a_cp as $cpzone => $cpitem): <?php foreach ($a_cp as $cpzone => $cpitem) :
if (!is_array($cpitem)) if (!is_array($cpitem)) {
continue; continue;
}
?> ?>
<tr> <tr>
<td class="listlr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';"> <td class="listlr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';">
...@@ -103,8 +110,9 @@ $main_buttons = array( ...@@ -103,8 +110,9 @@ $main_buttons = array(
</td> </td>
<td class="listlr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';"> <td class="listlr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';">
<?php $cpifaces = explode(",", $cpitem['interface']); <?php $cpifaces = explode(",", $cpitem['interface']);
foreach ($cpifaces as $cpiface) foreach ($cpifaces as $cpiface) {
echo convert_friendly_interface_to_friendly_descr($cpiface) . " "; echo convert_friendly_interface_to_friendly_descr($cpiface) . " ";
}
?> ?>
</td> </td>
<td class="listr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';"> <td class="listr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';">
...@@ -118,10 +126,13 @@ $main_buttons = array( ...@@ -118,10 +126,13 @@ $main_buttons = array(
</td> </td>
<td valign="middle" class="list nowrap"> <td valign="middle" class="list nowrap">
<a href="services_captiveportal.php?zone=<?=$cpzone?>" title="<?=gettext("edit captiveportal instance"); ?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a> <a href="services_captiveportal.php?zone=<?=$cpzone?>" title="<?=gettext("edit captiveportal instance"); ?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>
<a href="services_captiveportal_zones.php?act=del&amp;zone=<?=$cpzone;?>" onclick="return confirm('<?=gettext("Do you really want to delete this entry?");?>')" title="<?=gettext("delete captiveportal instance");?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a> <a href="services_captiveportal_zones.php?act=del&amp;zone=<?=$cpzone;
?>" onclick="return confirm('<?=gettext("Do you really want to delete this entry?");
?>')" title="<?=gettext("delete captiveportal instance");?>" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></a>
</td> </td>
</tr> </tr>
<?php endforeach; ?> <?php
endforeach; ?>
</table> </table>
</div> </div>
</form> </form>
...@@ -130,4 +141,4 @@ $main_buttons = array( ...@@ -130,4 +141,4 @@ $main_buttons = array(
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc");
...@@ -35,12 +35,12 @@ require_once("captiveportal.inc"); ...@@ -35,12 +35,12 @@ require_once("captiveportal.inc");
$pgtitle = array(gettext("Services"),gettext("Captive portal"),gettext("Edit Zones")); $pgtitle = array(gettext("Services"),gettext("Captive portal"),gettext("Edit Zones"));
$shortcut_section = "captiveportal"; $shortcut_section = "captiveportal";
if (!is_array($config['captiveportal'])) if (!is_array($config['captiveportal'])) {
$config['captiveportal'] = array(); $config['captiveportal'] = array();
}
$a_cp =& $config['captiveportal']; $a_cp =& $config['captiveportal'];
if ($_POST) { if ($_POST) {
unset($input_errors); unset($input_errors);
$pconfig = $_POST; $pconfig = $_POST;
...@@ -84,7 +84,9 @@ include("head.inc"); ...@@ -84,7 +84,9 @@ include("head.inc");
<div class="row"> <div class="row">
<?php if ($input_errors) print_input_errors($input_errors); ?> <?php if ($input_errors) {
print_input_errors($input_errors);
} ?>
<section class="col-xs-12"> <section class="col-xs-12">
...@@ -131,4 +133,4 @@ include("head.inc"); ...@@ -131,4 +133,4 @@ include("head.inc");
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc");
...@@ -35,16 +35,18 @@ require_once("captiveportal.inc"); ...@@ -35,16 +35,18 @@ require_once("captiveportal.inc");
require_once("voucher.inc"); require_once("voucher.inc");
$cpzone = $_GET['zone']; $cpzone = $_GET['zone'];
if (isset($_POST['zone'])) if (isset($_POST['zone'])) {
$cpzone = $_POST['zone']; $cpzone = $_POST['zone'];
}
if (empty($cpzone)) { if (empty($cpzone)) {
header("Location: status_captiveportal.php"); header("Location: status_captiveportal.php");
exit; exit;
} }
if (!is_array($config['captiveportal'])) if (!is_array($config['captiveportal'])) {
$config['captiveportal'] = array(); $config['captiveportal'] = array();
}
$a_cp =& $config['captiveportal']; $a_cp =& $config['captiveportal'];
$pgtitle = array(gettext("Status"), gettext("Captive portal"), gettext("Expire Vouchers"), $a_cp[$cpzone]['zone']); $pgtitle = array(gettext("Status"), gettext("Captive portal"), gettext("Expire Vouchers"), $a_cp[$cpzone]['zone']);
...@@ -99,11 +101,11 @@ include("head.inc"); ...@@ -99,11 +101,11 @@ include("head.inc");
</table> </table>
<?php <?php
if ($_POST) { if ($_POST) {
if ($_POST['vouchers']) { if ($_POST['vouchers']) {
$result = voucher_expire($_POST['vouchers']); $result = voucher_expire($_POST['vouchers']);
echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"4\" width=\"100%\" summary=\"results\">\n"; echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"4\" width=\"100%\" summary=\"results\">\n";
if ( $result) { if ($result) {
echo "<tr><td bgcolor=\"#D9DEE8\"><img src=\"/themes/{$g['theme']}/images/icons/icon_pass.gif\" alt=\"pass\" /></td>"; echo "<tr><td bgcolor=\"#D9DEE8\"><img src=\"/themes/{$g['theme']}/images/icons/icon_pass.gif\" alt=\"pass\" /></td>";
echo "<td bgcolor=\"#D9DEE8\">Success</td></tr>"; echo "<td bgcolor=\"#D9DEE8\">Success</td></tr>";
} else { } else {
...@@ -112,7 +114,7 @@ if ($_POST) { ...@@ -112,7 +114,7 @@ if ($_POST) {
} }
echo "</table>"; echo "</table>";
} }
} }
?> ?>
</div> </div>
...@@ -125,4 +127,4 @@ if ($_POST) { ...@@ -125,4 +127,4 @@ if ($_POST) {
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc");
...@@ -35,16 +35,18 @@ require_once("captiveportal.inc"); ...@@ -35,16 +35,18 @@ require_once("captiveportal.inc");
require_once("voucher.inc"); require_once("voucher.inc");
$cpzone = $_GET['zone']; $cpzone = $_GET['zone'];
if (isset($_POST['zone'])) if (isset($_POST['zone'])) {
$cpzone = $_POST['zone']; $cpzone = $_POST['zone'];
}
if (empty($cpzone)) { if (empty($cpzone)) {
header("Location: status_captiveportal.php"); header("Location: status_captiveportal.php");
exit; exit;
} }
if (!is_array($config['captiveportal'])) if (!is_array($config['captiveportal'])) {
$config['captiveportal'] = array(); $config['captiveportal'] = array();
}
$a_cp =& $config['captiveportal']; $a_cp =& $config['captiveportal'];
$pgtitle = array(gettext("Status"), gettext("Captive portal"), gettext("Test Vouchers"), $a_cp[$cpzone]['zone']); $pgtitle = array(gettext("Status"), gettext("Captive portal"), gettext("Test Vouchers"), $a_cp[$cpzone]['zone']);
...@@ -128,4 +130,4 @@ if ($_POST) { ...@@ -128,4 +130,4 @@ if ($_POST) {
<? include("foot.inc"); ?> <? include("foot.inc");
...@@ -35,16 +35,18 @@ require_once("captiveportal.inc"); ...@@ -35,16 +35,18 @@ require_once("captiveportal.inc");
require_once("voucher.inc"); require_once("voucher.inc");
$cpzone = $_GET['zone']; $cpzone = $_GET['zone'];
if (isset($_POST['zone'])) if (isset($_POST['zone'])) {
$cpzone = $_POST['zone']; $cpzone = $_POST['zone'];
}
if (empty($cpzone)) { if (empty($cpzone)) {
header("Location: status_captiveportal.php"); header("Location: status_captiveportal.php");
exit; exit;
} }
if (!is_array($config['captiveportal'])) if (!is_array($config['captiveportal'])) {
$config['captiveportal'] = array(); $config['captiveportal'] = array();
}
$a_cp =& $config['captiveportal']; $a_cp =& $config['captiveportal'];
$pgtitle = array(gettext("Status"), gettext("Captive portal"), gettext("Voucher Rolls"), $a_cp[$cpzone]['zone']); $pgtitle = array(gettext("Status"), gettext("Captive portal"), gettext("Voucher Rolls"), $a_cp[$cpzone]['zone']);
$shortcut_section = "captiveportal-vouchers"; $shortcut_section = "captiveportal-vouchers";
...@@ -97,9 +99,9 @@ include("head.inc"); ...@@ -97,9 +99,9 @@ include("head.inc");
</tr> </tr>
<?php <?php
$voucherlck = lock("vouche{$cpzone}r"); $voucherlck = lock("vouche{$cpzone}r");
$i = 0; foreach($a_roll as $rollent): $i = 0; foreach ($a_roll as $rollent) :
$used = voucher_used_count($rollent['number']); $used = voucher_used_count($rollent['number']);
$active = count(voucher_read_active_db($rollent['number']),$rollent['minutes']); $active = count(voucher_read_active_db($rollent['number']), $rollent['minutes']);
$ready = $rollent['count'] - $used; $ready = $rollent['count'] - $used;
/* used also count active vouchers, remove them */ /* used also count active vouchers, remove them */
$used = $used - $active; $used = $used - $active;
...@@ -127,7 +129,10 @@ include("head.inc"); ...@@ -127,7 +129,10 @@ include("head.inc");
<?=htmlspecialchars($ready); ?>&nbsp; <?=htmlspecialchars($ready); ?>&nbsp;
</td> </td>
</tr> </tr>
<?php $i++; endforeach; unlock($voucherlck); ?> <?php $i++;
endforeach;
unlock($voucherlck); ?>
</table> </table>
</div> </div>
</form> </form>
...@@ -138,4 +143,4 @@ include("head.inc"); ...@@ -138,4 +143,4 @@ include("head.inc");
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc");
...@@ -35,21 +35,24 @@ require_once("captiveportal.inc"); ...@@ -35,21 +35,24 @@ require_once("captiveportal.inc");
require_once("voucher.inc"); require_once("voucher.inc");
$cpzone = $_GET['zone']; $cpzone = $_GET['zone'];
if (isset($_POST['zone'])) if (isset($_POST['zone'])) {
$cpzone = $_POST['zone']; $cpzone = $_POST['zone'];
}
if (empty($cpzone)) { if (empty($cpzone)) {
header("Location: status_captiveportal.php"); header("Location: status_captiveportal.php");
exit; exit;
} }
if (!is_array($config['captiveportal'])) if (!is_array($config['captiveportal'])) {
$config['captiveportal'] = array(); $config['captiveportal'] = array();
}
$a_cp =& $config['captiveportal']; $a_cp =& $config['captiveportal'];
$pgtitle = array(gettext("Status"), gettext("Captive portal"), gettext("Vouchers"), $a_cp[$cpzone]['zone']); $pgtitle = array(gettext("Status"), gettext("Captive portal"), gettext("Vouchers"), $a_cp[$cpzone]['zone']);
$shortcut_section = "captiveportal-vouchers"; $shortcut_section = "captiveportal-vouchers";
function clientcmp($a, $b) { function clientcmp($a, $b)
{
global $order; global $order;
return strcmp($a[$order], $b[$order]); return strcmp($a[$order], $b[$order]);
} }
...@@ -61,7 +64,7 @@ $a_roll = $config['voucher'][$cpzone]['roll']; ...@@ -61,7 +64,7 @@ $a_roll = $config['voucher'][$cpzone]['roll'];
$db = array(); $db = array();
foreach($a_roll as $rollent) { foreach ($a_roll as $rollent) {
$roll = $rollent['number']; $roll = $rollent['number'];
$minutes = $rollent['minutes']; $minutes = $rollent['minutes'];
...@@ -70,7 +73,7 @@ foreach($a_roll as $rollent) { ...@@ -70,7 +73,7 @@ foreach($a_roll as $rollent) {
} }
$active_vouchers = file("/var/db/voucher_{$cpzone}_active_{$roll}.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $active_vouchers = file("/var/db/voucher_{$cpzone}_active_{$roll}.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach($active_vouchers as $voucher => $line) { foreach ($active_vouchers as $voucher => $line) {
list($voucher,$timestamp, $minutes) = explode(",", $line); list($voucher,$timestamp, $minutes) = explode(",", $line);
$remaining = (($timestamp + 60*$minutes) - time()); $remaining = (($timestamp + 60*$minutes) - time());
if ($remaining > 0) { if ($remaining > 0) {
...@@ -122,23 +125,31 @@ include("head.inc"); ...@@ -122,23 +125,31 @@ include("head.inc");
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped table-sort">
<tr> <tr>
<td class="listhdrr"><a href="?order=0&amp;showact=<?=htmlspecialchars($_GET['showact']);?>"><?=gettext("Voucher"); ?></a></td> <td class="listhdrr"><a href="?order=0&amp;showact=<?=htmlspecialchars($_GET['showact']);
<td class="listhdrr"><a href="?order=1&amp;showact=<?=htmlspecialchars($_GET['showact']);?>"><?=gettext("Roll"); ?></a></td> ?>"><?=gettext("Voucher"); ?></a></td>
<td class="listhdrr"><a href="?order=2&amp;showact=<?=htmlspecialchars($_GET['showact']);?>"><?=gettext("Activated at"); ?></a></td> <td class="listhdrr"><a href="?order=1&amp;showact=<?=htmlspecialchars($_GET['showact']);
<td class="listhdrr"><a href="?order=3&amp;showact=<?=htmlspecialchars($_GET['showact']);?>"><?=gettext("Expires in"); ?></a></td> ?>"><?=gettext("Roll"); ?></a></td>
<td class="listhdr"><a href="?order=4&amp;showact=<?=htmlspecialchars($_GET['showact']);?>"><?=gettext("Expires at"); ?></a></td> <td class="listhdrr"><a href="?order=2&amp;showact=<?=htmlspecialchars($_GET['showact']);
?>"><?=gettext("Activated at"); ?></a></td>
<td class="listhdrr"><a href="?order=3&amp;showact=<?=htmlspecialchars($_GET['showact']);
?>"><?=gettext("Expires in"); ?></a></td>
<td class="listhdr"><a href="?order=4&amp;showact=<?=htmlspecialchars($_GET['showact']);
?>"><?=gettext("Expires at"); ?></a></td>
<td class="list"></td> <td class="list"></td>
</tr> </tr>
<?php foreach ($db as $dbent): ?> <?php foreach ($db as $dbent) :
?>
<tr> <tr>
<td class="listlr"><?=$dbent[0];?></td> <td class="listlr"><?=$dbent[0];?></td>
<td class="listr"><?=$dbent[1];?></td> <td class="listr"><?=$dbent[1];?></td>
<td class="listr"><?=htmlspecialchars(date("m/d/Y H:i:s", $dbent[2]));?></td> <td class="listr"><?=htmlspecialchars(date("m/d/Y H:i:s", $dbent[2]));?></td>
<td class="listr"><?=$dbent[3];?> <?=gettext("min"); ?></td> <td class="listr"><?=$dbent[3];
?> <?=gettext("min"); ?></td>
<td class="listr"><?=htmlspecialchars(date("m/d/Y H:i:s", $dbent[4]));?></td> <td class="listr"><?=htmlspecialchars(date("m/d/Y H:i:s", $dbent[4]));?></td>
<td class="list"></td> <td class="list"></td>
</tr> </tr>
<?php endforeach; ?> <?php
endforeach; ?>
</table> </table>
</div> </div>
</form> </form>
...@@ -149,4 +160,4 @@ include("head.inc"); ...@@ -149,4 +160,4 @@ include("head.inc");
</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