1
|
<?php
|
2
|
/*
|
3
|
LICENSE
|
4
|
*/
|
5
|
|
6
|
##|+PRIV
|
7
|
##|*IDENT=page-services-captiveportal-zones
|
8
|
##|*NAME=Services: Captiveprotal Zones page
|
9
|
##|*DESCR=Allow access to the 'Services: CaptivePortal Zones' page.
|
10
|
##|*MATCH=services_captiveportal_zones.php*
|
11
|
##|-PRIV
|
12
|
|
13
|
require("guiconfig.inc");
|
14
|
require("functions.inc");
|
15
|
require_once("filter.inc");
|
16
|
require("shaper.inc");
|
17
|
require("captiveportal.inc");
|
18
|
|
19
|
global $cpzone;
|
20
|
global $cpzoneid;
|
21
|
|
22
|
if (!is_array($config['captiveportal']))
|
23
|
$config['captiveportal'] = array();
|
24
|
$a_cp = &$config['captiveportal'];
|
25
|
|
26
|
if ($_GET['act'] == "del" && !empty($_GET['zone'])) {
|
27
|
$cpzone = $_GET['zone'];
|
28
|
if ($a_cp[$cpzone]) {
|
29
|
$cpzoneid = $a_cp[$cpzone]['zoneid'];
|
30
|
unset($a_cp[$cpzone]['enable']);
|
31
|
captiveportal_configure_zone($a_cp[$cpzone]);
|
32
|
unset($a_cp[$cpzone]);
|
33
|
if (isset($config['voucher'][$cpzone]))
|
34
|
unset($config['voucher'][$cpzone]);
|
35
|
write_config();
|
36
|
header("Location: services_captiveportal_zones.php");
|
37
|
exit;
|
38
|
}
|
39
|
}
|
40
|
|
41
|
$pgtitle = array(gettext("Captive Portal"),gettext("Zones"));
|
42
|
$shortcut_section = "captiveportal";
|
43
|
include("head.inc");
|
44
|
|
45
|
?>
|
46
|
|
47
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
48
|
<?php include("fbegin.inc"); ?>
|
49
|
<form action="services_captiveportal_zones.php" method="post">
|
50
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
51
|
<?php if (is_subsystem_dirty('captiveportal')): ?><p>
|
52
|
<?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."));?>
|
53
|
<?php endif; ?>
|
54
|
|
55
|
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="captive portal">
|
56
|
<tr>
|
57
|
<td width="15%" class="listhdrr"><?=gettext("Zone");?></td>
|
58
|
<td width="30%" class="listhdrr"><?=gettext("Interfaces");?></td>
|
59
|
<td width="10%" class="listhdrr"><?=gettext("Number of users");?></td>
|
60
|
<td width="40%" class="listhdrr"><?=gettext("Description");?></td>
|
61
|
<td width="5%" class="list">
|
62
|
<table border="0" cellspacing="0" cellpadding="1" summary="icons">
|
63
|
<tr>
|
64
|
<td valign="middle" width="17"> </td>
|
65
|
<td valign="middle"><a href="services_captiveportal_zones_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add a new captiveportal instance");?>" alt="add" /></a></td>
|
66
|
</tr>
|
67
|
</table>
|
68
|
</td>
|
69
|
</tr>
|
70
|
<?php foreach ($a_cp as $cpzone => $cpitem):
|
71
|
if (!is_array($cpitem))
|
72
|
continue;
|
73
|
?>
|
74
|
<tr>
|
75
|
<td class="listlr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';">
|
76
|
<?=htmlspecialchars($cpitem['zone']);?>
|
77
|
</td>
|
78
|
<td class="listlr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';">
|
79
|
<?php $cpifaces = explode(",", $cpitem['interface']);
|
80
|
foreach ($cpifaces as $cpiface)
|
81
|
echo convert_friendly_interface_to_friendly_descr($cpiface) . " ";
|
82
|
?>
|
83
|
</td>
|
84
|
<td class="listr" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';">
|
85
|
<?=count(captiveportal_read_db());?>
|
86
|
</td>
|
87
|
<td class="listbg" ondblclick="document.location='services_captiveportal.php?zone=<?=$cpzone;?>';">
|
88
|
<?=htmlspecialchars($cpitem['descr']);?>
|
89
|
</td>
|
90
|
<td valign="middle" class="list nowrap">
|
91
|
<table border="0" cellspacing="0" cellpadding="1" summary="icons">
|
92
|
<tr>
|
93
|
<td valign="middle"><a href="services_captiveportal.php?zone=<?=$cpzone?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit captiveportal instance"); ?>" alt="edit" /></a></td>
|
94
|
<td><a href="services_captiveportal_zones.php?act=del&zone=<?=$cpzone;?>" onclick="return confirm('<?=gettext("Do you really want to delete this entry?");?>')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete captiveportal instance");?>" alt="delete" /></a></td>
|
95
|
</tr>
|
96
|
</table>
|
97
|
</td>
|
98
|
</tr>
|
99
|
<?php endforeach; ?>
|
100
|
<tr>
|
101
|
<td class="list" colspan="4"></td>
|
102
|
<td class="list">
|
103
|
<table border="0" cellspacing="0" cellpadding="1" summary="add">
|
104
|
<tr>
|
105
|
<td valign="middle" width="17"> </td>
|
106
|
<td valign="middle"><a href="services_captiveportal_zones_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add a new captiveportal instance");?>" alt="add" /></a></td>
|
107
|
</tr>
|
108
|
</table>
|
109
|
</td>
|
110
|
</tr>
|
111
|
</table>
|
112
|
</form>
|
113
|
<?php include("fend.inc"); ?>
|
114
|
</body>
|
115
|
</html>
|