Revision 13541a81
Added by Steve Beaver over 8 years ago
src/usr/local/www/services_dyndns.php | ||
---|---|---|
35 | 35 |
$a_dyndns = &$config['dyndnses']['dyndns']; |
36 | 36 |
global $dyndns_split_domain_types; |
37 | 37 |
|
38 |
if ($_GET['act'] == "del") {
|
|
39 |
$conf = $a_dyndns[$_GET['id']];
|
|
38 |
if ($_POST['act'] == "del") {
|
|
39 |
$conf = $a_dyndns[$_POST['id']];
|
|
40 | 40 |
if (in_array($conf['type'], $dyndns_split_domain_types)) { |
41 | 41 |
$hostname = $conf['host'] . "." . $conf['domainname']; |
42 | 42 |
} else { |
43 | 43 |
$hostname = $conf['host']; |
44 | 44 |
} |
45 | 45 |
@unlink("{$g['conf_path']}/dyndns_{$conf['interface']}{$conf['type']}" . escapeshellarg($hostname) . "{$conf['id']}.cache"); |
46 |
unset($a_dyndns[$_GET['id']]);
|
|
46 |
unset($a_dyndns[$_POST['id']]);
|
|
47 | 47 |
|
48 | 48 |
write_config(); |
49 | 49 |
services_dyndns_configure(); |
50 | 50 |
|
51 | 51 |
header("Location: services_dyndns.php"); |
52 | 52 |
exit; |
53 |
} else if ($_GET['act'] == "toggle") {
|
|
54 |
if ($a_dyndns[$_GET['id']]) {
|
|
55 |
if (isset($a_dyndns[$_GET['id']]['enable'])) {
|
|
56 |
unset($a_dyndns[$_GET['id']]['enable']);
|
|
53 |
} else if ($_POST['act'] == "toggle") {
|
|
54 |
if ($a_dyndns[$_POST['id']]) {
|
|
55 |
if (isset($a_dyndns[$_POST['id']]['enable'])) {
|
|
56 |
unset($a_dyndns[$_POST['id']]['enable']);
|
|
57 | 57 |
} else { |
58 |
$a_dyndns[$_GET['id']]['enable'] = true;
|
|
58 |
$a_dyndns[$_POST['id']]['enable'] = true;
|
|
59 | 59 |
} |
60 | 60 |
write_config(); |
61 | 61 |
services_dyndns_configure(); |
... | ... | |
64 | 64 |
exit; |
65 | 65 |
} |
66 | 66 |
} |
67 |
|
|
67 | 68 |
$pgtitle = array(gettext("Services"), gettext("Dynamic DNS"), gettext("Dynamic DNS Clients")); |
68 | 69 |
$pglinks = array("", "@self", "@self"); |
69 | 70 |
include("head.inc"); |
... | ... | |
188 | 189 |
<a class="fa fa-pencil" title="<?=gettext('Edit service')?>" href="services_dyndns_edit.php?id=<?=$i?>"></a> |
189 | 190 |
<?php if (isset($dyndns['enable'])) { |
190 | 191 |
?> |
191 |
<a class="fa fa-ban" title="<?=gettext('Disable service')?>" href="?act=toggle&id=<?=$i?>"></a> |
|
192 |
<a class="fa fa-ban" title="<?=gettext('Disable service')?>" href="?act=toggle&id=<?=$i?>" usepost></a>
|
|
192 | 193 |
<?php } else { |
193 | 194 |
?> |
194 |
<a class="fa fa-check-square-o" title="<?=gettext('Enable service')?>" href="?act=toggle&id=<?=$i?>"></a> |
|
195 |
<a class="fa fa-check-square-o" title="<?=gettext('Enable service')?>" href="?act=toggle&id=<?=$i?>" usepost></a>
|
|
195 | 196 |
<?php } |
196 | 197 |
?> |
197 |
<a class="fa fa-trash" title="<?=gettext('Delete service')?>" href="services_dyndns.php?act=del&id=<?=$i?>"></a> |
|
198 |
<a class="fa fa-trash" title="<?=gettext('Delete service')?>" href="services_dyndns.php?act=del&id=<?=$i?>" usepost></a>
|
|
198 | 199 |
</td> |
199 | 200 |
</tr> |
200 | 201 |
<?php |
Also available in: Unified diff
GET/POST conversions