From ac18350d57f21985807251fdbd51b462a089b30d Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Sun, 30 Jan 2011 13:18:14 +0000 Subject: [PATCH] Cliquodrome pour faciliter la regeneration de type --- .gitattributes | 1 + bureau/admin/adm_domstype.php | 4 ++-- bureau/admin/adm_domstyperegenerate.php | 25 +++++++++++++++++++++++++ bureau/class/m_dom.php | 8 ++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 bureau/admin/adm_domstyperegenerate.php diff --git a/.gitattributes b/.gitattributes index e6daa364..ffb3082e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -26,6 +26,7 @@ bureau/admin/adm_doms.php -text bureau/admin/adm_domstype.php -text bureau/admin/adm_domstypedoedit.php -text bureau/admin/adm_domstypeedit.php -text +bureau/admin/adm_domstyperegenerate.php -text bureau/admin/adm_donosu.php -text bureau/admin/adm_dorenew.php -text bureau/admin/adm_dosu.php -text diff --git a/bureau/admin/adm_domstype.php b/bureau/admin/adm_domstype.php index 599f97ec..297bf477 100644 --- a/bureau/admin/adm_domstype.php +++ b/bureau/admin/adm_domstype.php @@ -61,6 +61,7 @@ include_once("head.php"); + domains_type_lst() as $d) {
<?php __(" />
- - + '> diff --git a/bureau/admin/adm_domstyperegenerate.php b/bureau/admin/adm_domstyperegenerate.php new file mode 100644 index 00000000..659f1a1f --- /dev/null +++ b/bureau/admin/adm_domstyperegenerate.php @@ -0,0 +1,25 @@ +enabled) { + __("This page is restricted to authorized staff"); + exit(); +} + +$fields = array ( + "name" => array ("request", "string", ""), +); +getFields($fields); + + +if (empty($name) || (! $dom->domains_type_regenerate($name)) ) { + die($err->errstr()); +} else { + +$error="Regenerate pending"; + +include("adm_domstype.php"); +} + +?> + + diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index ffec6d86..827d82ee 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -130,6 +130,14 @@ class m_dom { } } + function domains_type_regenerate($name) { + global $db,$err,$cuid; + $name=mysql_real_escape_string($name); + $db->query("update sub_domaines set web_action='UPDATE' where lower(type) = lower('$name') ;"); + $db->query("update domaines d, sub_domaines sd set d.dns_action = 'UPDATE' where lower(sd.type)=lower('$name');"); + return true; + } + function domains_type_get($name) { global $db,$err,$cuid; $name=mysql_real_escape_string($name);