From 279fa9bd1ed128d53d264c966990ca058239e2d5 Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Wed, 22 Aug 2012 14:20:30 +0000 Subject: [PATCH] Register globals --- bureau/admin/adm_domstypedoedit.php | 12 ++++++++++++ bureau/admin/domlist.php | 24 ++++++++++++------------ bureau/admin/sql_dorestore.php | 6 ++++++ bureau/class/m_dom.php | 1 - 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/bureau/admin/adm_domstypedoedit.php b/bureau/admin/adm_domstypedoedit.php index 2eae6e7c..403614e7 100644 --- a/bureau/admin/adm_domstypedoedit.php +++ b/bureau/admin/adm_domstypedoedit.php @@ -5,6 +5,18 @@ if (!$admin->enabled) { exit(); } +$fields = array ( + "name" => array ("post", "string", ""), + "description" => array ("post", "string", ""), + "target" => array ("post", "string", ""), + "entry" => array ("post", "string", ""), + "compatibility" => array ("post", "string", ""), + "enable" => array ("post", "string", ""), + "only_dns" => array ("post", "string", ""), + "need_dns" => array ("post", "string", ""), + "advanced" => array ("post", "string", ""), +); +getFields($fields); if ( ! $dom->domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns, $advanced) ) { die($err->errstr()); diff --git a/bureau/admin/domlist.php b/bureau/admin/domlist.php index 06e6ae4b..444254e6 100644 --- a/bureau/admin/domlist.php +++ b/bureau/admin/domlist.php @@ -31,17 +31,17 @@ require_once("../class/config_nochk.php"); // Check for the http authentication if (!isset($_SERVER['PHP_AUTH_USER'])) { - header('WWW-Authenticate: Basic realm="Domain List Authentication"'); - header('HTTP/1.0 401 Unauthorized'); - exit; - } else { - if ($dom->check_slave_account($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW'])) { - $dom->echo_domain_list(); - } else { - header('WWW-Authenticate: Basic realm="Domain List Authentication"'); - header('HTTP/1.0 401 Unauthorized'); - exit; - } + header('WWW-Authenticate: Basic realm="Domain List Authentication"'); + header('HTTP/1.0 401 Unauthorized'); + exit; +} else { + if ($dom->check_slave_account($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW'])) { + $dom->echo_domain_list(); + } else { + header('WWW-Authenticate: Basic realm="Domain List Authentication"'); + header('HTTP/1.0 401 Unauthorized'); + exit; } +} -?> \ No newline at end of file +?> diff --git a/bureau/admin/sql_dorestore.php b/bureau/admin/sql_dorestore.php index c1aad8d0..7a6a03a9 100644 --- a/bureau/admin/sql_dorestore.php +++ b/bureau/admin/sql_dorestore.php @@ -30,6 +30,12 @@ require_once("../class/config.php"); include_once("head.php"); +$fields = array ( + "id" => array ("post", "string", ""), + "restfile" => array ("post", "string", ""), +); +getFields($fields); + if (!$r=$mysql->get_mysql_details($id)) { $error=$err->errstr(); diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index 9d52d3a9..b60641de 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -185,7 +185,6 @@ class m_dom { function domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns,$advanced) { global $err,$cuid,$db; - $id=intval($id); // The name MUST contain only letter and digits, it's an identifier after all ... if (!preg_match("#^[a-z0-9]+$#",$name)) { $err->raise("dom", 26);