Rajoute l'option pour avoir un checksum des domaines
(permet un check d'intégrité des data dans alternc-slavedns, cf r4309)
This commit is contained in:
parent
2e8dc80289
commit
93df1709f1
|
@ -29,6 +29,11 @@
|
||||||
*/
|
*/
|
||||||
require_once("../class/config_nochk.php");
|
require_once("../class/config_nochk.php");
|
||||||
|
|
||||||
|
$fields = array (
|
||||||
|
"integrity" => array ("get", "boolean", "0"),
|
||||||
|
);
|
||||||
|
getFields($fields);
|
||||||
|
|
||||||
// Check for the http authentication
|
// Check for the http authentication
|
||||||
if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
||||||
header('WWW-Authenticate: Basic realm="Domain List Authentication"');
|
header('WWW-Authenticate: Basic realm="Domain List Authentication"');
|
||||||
|
@ -36,7 +41,11 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
if ($dom->check_slave_account($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW'])) {
|
if ($dom->check_slave_account($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW'])) {
|
||||||
|
if (!$integrity) {
|
||||||
$dom->echo_domain_list();
|
$dom->echo_domain_list();
|
||||||
|
} else {
|
||||||
|
$dom->echo_domain_list(true);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
header('WWW-Authenticate: Basic realm="Domain List Authentication"');
|
header('WWW-Authenticate: Basic realm="Domain List Authentication"');
|
||||||
header('HTTP/1.0 401 Unauthorized');
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
|
|
|
@ -1210,11 +1210,17 @@ class m_dom {
|
||||||
/* ----------------------------------------------------------------- */
|
/* ----------------------------------------------------------------- */
|
||||||
/** Out (echo) the complete hosted domain list :
|
/** Out (echo) the complete hosted domain list :
|
||||||
*/
|
*/
|
||||||
function echo_domain_list() {
|
function echo_domain_list($integrity=false) {
|
||||||
global $db,$err;
|
global $db,$err;
|
||||||
$db->query("SELECT domaine FROM domaines WHERE gesdns=1 ORDER BY domaine");
|
$db->query("SELECT domaine FROM domaines WHERE gesdns=1 ORDER BY domaine");
|
||||||
|
$tt="";
|
||||||
while ($db->next_record()) {
|
while ($db->next_record()) {
|
||||||
echo $db->f("domaine")."\n";
|
#echo $db->f("domaine")."\n";
|
||||||
|
$tt.=$db->f("domaine")."\n";
|
||||||
|
}
|
||||||
|
echo $tt;
|
||||||
|
if ($integrity) {
|
||||||
|
echo md5($tt)."\n";
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue