From 93df1709f1a864eb91e8d4a3c3e47dcefe7a411e Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Wed, 24 Apr 2013 08:07:42 +0000 Subject: [PATCH] =?UTF-8?q?Rajoute=20l'option=20pour=20avoir=20un=20checks?= =?UTF-8?q?um=20des=20domaines=20(permet=20un=20check=20d'int=C3=A9grit?= =?UTF-8?q?=C3=A9=20des=20data=20dans=20alternc-slavedns,=20cf=20r4309)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bureau/admin/domlist.php | 11 ++++++++++- bureau/class/m_dom.php | 10 ++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/bureau/admin/domlist.php b/bureau/admin/domlist.php index 444254e6..56c9153c 100644 --- a/bureau/admin/domlist.php +++ b/bureau/admin/domlist.php @@ -29,6 +29,11 @@ */ require_once("../class/config_nochk.php"); +$fields = array ( + "integrity" => array ("get", "boolean", "0"), +); +getFields($fields); + // Check for the http authentication if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="Domain List Authentication"'); @@ -36,7 +41,11 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) { exit; } else { if ($dom->check_slave_account($_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW'])) { - $dom->echo_domain_list(); + if (!$integrity) { + $dom->echo_domain_list(); + } else { + $dom->echo_domain_list(true); + } } else { header('WWW-Authenticate: Basic realm="Domain List Authentication"'); header('HTTP/1.0 401 Unauthorized'); diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index 5f93301b..9f8731fd 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -1210,11 +1210,17 @@ class m_dom { /* ----------------------------------------------------------------- */ /** Out (echo) the complete hosted domain list : */ - function echo_domain_list() { + function echo_domain_list($integrity=false) { global $db,$err; $db->query("SELECT domaine FROM domaines WHERE gesdns=1 ORDER BY domaine"); + $tt=""; 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; }