diff --git a/src/www/services_dyndns.php b/src/www/services_dyndns.php index 059904a70..ee65a5c1a 100644 --- a/src/www/services_dyndns.php +++ b/src/www/services_dyndns.php @@ -48,6 +48,17 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { configd_run('dyndns reload', true); } exit; + } elseif (isset($_POST['act']) && $_POST['act'] == "toggle" && isset($_POST['id'])) { + if (!empty($a_dyndns[$_POST['id']])) { + if (!empty($a_dyndns[$_POST['id']]['enabled'])) { + $a_dyndns[$_POST['id']]['enabled'] = false; + } else { + $a_dyndns[$_POST['id']]['enabled'] = true; + } + write_config(); + configd_run('dyndns reload', true); + } + exit; } } @@ -84,6 +95,12 @@ $main_buttons = array( }] }); }); + // link toggle buttons + $(".act_toggle").click(function(){ + $.post(window.location, {act: 'toggle', id:$(this).data("id")}, function(data) { + location.reload(); + }); + }); }); @@ -112,6 +129,9 @@ $main_buttons = array( foreach ($a_dyndns as $dyndns): ?>