Commit 279fa9bd authored by Alan Garcia's avatar Alan Garcia
Browse files

Register globals

parent 43ce9c41
......@@ -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());
......
......@@ -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
?>
......@@ -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();
......
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment