exit; } if (isset($_GET["details-tablerows"])) { details_tablerows(); exit; } if (isset($_POST["nameserver"])) { dns_add(); exit; } if (isset($_POST["DnsDelete"])) { dns_del(); exit; } if (isset($_POST["SquidDNSUpDown"])) { SquidDNSUpDown(); exit; } table(); function dns_add() { $_POST["nameserver"] = trim($_POST["nameserver"]); $IPClass = new IP(); if (!$IPClass->isValid($_POST["nameserver"])) { echo "{$_POST["nameserver"]} invalid\n"; return; } $nameserver[$_POST["nameserver"]] = true; $q = new mysql_squid_builder(); $q->QUERY_SQL("INSERT INTO dns_servers (dnsserver,zOrder) VALUES ('{$_POST["nameserver"]}','1')"); if (!$q->ok) {
include_once('ressources/class.squid.inc'); include_once('ressources/class.tcpip.inc'); include_once('ressources/class.mysql.squid.builder.php'); $user=new usersMenus(); if($user->AsSquidAdministrator==false){ $tpl=new templates(); echo "<p class=text-error>". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."</p>"; die();exit(); } if(isset($_GET["details-tablerows"])){details_tablerows();exit;} if(isset($_POST["nameserver"])){dns_add();exit;} if(isset($_POST["DnsDelete"])){dns_del();exit;} if(isset($_POST["SquidDNSUpDown"])){SquidDNSUpDown();exit;} table(); function dns_add(){ $_POST["nameserver"]=trim($_POST["nameserver"]); $IPClass=new IP(); if(!$IPClass->isValid($_POST["nameserver"])){ echo "{$_POST["nameserver"]} invalid\n"; return; } $nameserver[$_POST["nameserver"]]=true; $q=new mysql_squid_builder(); $q->QUERY_SQL("INSERT INTO dns_servers (dnsserver,zOrder) VALUES ('{$_POST["nameserver"]}','1')"); if(!$q->ok){echo $q->mysql_error;}