\n" . $extra_message . "\n"; die(); } $pin = popen('dig @127.0.0.1 ddns.eckner.net AXFR | sort -k4,4', 'r'); if (!$pin) die_http(500, 'Internal Server Error', 'Failed to get Zone.'); $found = false; $axfr = array(); while (($line = fgets($pin)) !== false) { $line = trim($line); if (substr($line, 0, 1) == ';' || $line == '') continue; $line = preg_split("/[\s]+/", $line); if ($line[0] == 'pool32.ddns.eckner.net.') continue; if ($line[2] != 'IN') continue; if ($line[3] == 'A') $axfr[$line[0]][$line[3]] = '4'; if ($line[3] == 'AAAA') $axfr[$line[0]][$line[3]] = '6'; if ($_SERVER['REMOTE_ADDR'] == $line[4]) $found = true; } pclose($pin); if (! $found) die_http(403, 'Forbidden', 'You are not known to ddns.'); $hosts = explode( "\n", trim( shell_exec( 'cut -d" " -f2 < /srv/http/vhosts/eckner.net/ddns/tokens' ) ) ); $filters = explode( "\n", shell_exec( 'cut -d" " -f1 < /srv/http/vhosts/eckner.net/ddns/ip-filters' ) . "v4\nv6" ); sort($filters); sort($hosts); function print_existence($prefix, $host) { global $axfr; if (!array_key_exists($host . '.ddns.eckner.net.', $axfr)) { print $prefix . "\n"; print $prefix . " Nö\n"; print $prefix . "\n"; return; } print $prefix . "\n"; print $prefix . " IPv" . implode('&', $axfr[$host . '.ddns.eckner.net.']) . "\n"; print $prefix . "\n"; } print "\n"; print " \n"; print " \n"; print " ddns status\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; foreach ($filters as $filter) { print " \n"; } print " \n"; foreach ($hosts as $host) { print " \n"; print " \n"; print " \n"; foreach ($filters as $filter) { print " \n"; } print " \n"; } print "
\n"; print " Host\n"; print " \n"; print "  \n"; print " \n"; print " " . $filter . "\n"; print "
\n"; print " " . $host . "\n"; print " \n"; print_existence(' ', $host); print " \n"; print_existence(' ', $host . '.' . $filter); print "
\n"; print " \n"; print "";