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

dyndns: give Ad a hand with this :)

parent 53df54fc
...@@ -50,10 +50,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { ...@@ -50,10 +50,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
exit; exit;
} elseif (isset($_POST['act']) && $_POST['act'] == "toggle" && isset($_POST['id'])) { } elseif (isset($_POST['act']) && $_POST['act'] == "toggle" && isset($_POST['id'])) {
if (!empty($a_dyndns[$_POST['id']])) { if (!empty($a_dyndns[$_POST['id']])) {
if (!empty($a_dyndns[$_POST['id']]['enabled'])) { if (!empty($a_dyndns[$_POST['id']]['enable'])) {
$a_dyndns[$_POST['id']]['enabled'] = false; $a_dyndns[$_POST['id']]['enable'] = false;
} else { } else {
$a_dyndns[$_POST['id']]['enabled'] = true; $a_dyndns[$_POST['id']]['enable'] = true;
} }
write_config(); write_config();
configd_run('dyndns reload', true); configd_run('dyndns reload', true);
...@@ -129,8 +129,8 @@ $main_buttons = array( ...@@ -129,8 +129,8 @@ $main_buttons = array(
foreach ($a_dyndns as $dyndns): ?> foreach ($a_dyndns as $dyndns): ?>
<tr> <tr>
<td> <td>
<a href="#" class="act_toggle" data-id="<?=$i;?>" data-toggle="tooltip" title="<?=(!empty($server['enable'])) ? gettext("disable") : gettext("enable");?>"> <a href="#" class="act_toggle" data-id="<?=$i;?>" data-toggle="tooltip" title="<?=(!empty($dyndns['enable'])) ? gettext("disable") : gettext("enable");?>">
<span class="glyphicon glyphicon-play <?=(!empty($dyndns['enabled'])) ? "text-success" : "text-muted";?>"></span> <span class="glyphicon glyphicon-play <?=(!empty($dyndns['enable'])) ? "text-success" : "text-muted";?>"></span>
</a> </a>
<?=!empty($config['interfaces'][$dyndns['interface']]['descr']) ? $config['interfaces'][$dyndns['interface']]['descr'] : strtoupper($dyndns['interface']);?> <?=!empty($config['interfaces'][$dyndns['interface']]['descr']) ? $config['interfaces'][$dyndns['interface']]['descr'] : strtoupper($dyndns['interface']);?>
</td> </td>
...@@ -140,7 +140,7 @@ $main_buttons = array( ...@@ -140,7 +140,7 @@ $main_buttons = array(
<?php <?php
$filename = "/conf/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}.cache"; $filename = "/conf/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}.cache";
$filename_v6 = "/conf/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}_v6.cache"; $filename_v6 = "/conf/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}_v6.cache";
if (file_exists($filename) && !empty($dyndns['enabled'])) { if (file_exists($filename) && !empty($dyndns['enable'])) {
$ipaddr = dyndnsCheckIP($dyndns['interface']); $ipaddr = dyndnsCheckIP($dyndns['interface']);
$cached_ip_s = explode(":", file_get_contents($filename)); $cached_ip_s = explode(":", file_get_contents($filename));
$cached_ip = $cached_ip_s[0]; $cached_ip = $cached_ip_s[0];
......
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