Register globals

This commit is contained in:
Alan Garcia 2012-08-22 14:20:30 +00:00
parent 43ce9c4138
commit 279fa9bd1e
4 changed files with 30 additions and 13 deletions

View File

@ -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());

View File

@ -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;
}
}
?>
?>

View File

@ -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();

View File

@ -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);