Cliquodrome pour faciliter la regeneration de type

This commit is contained in:
Alan Garcia 2011-01-30 13:18:14 +00:00
parent 0e81e371ce
commit ac18350d57
4 changed files with 36 additions and 2 deletions

1
.gitattributes vendored
View File

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

View File

@ -61,6 +61,7 @@ include_once("head.php");
<th><?php __("Only DNS ?");?></th>
<th><?php __("Need to be DNS ?");?></th>
<th><?php __("Edit");?></th>
<th/>
</tr>
<?php
$pair=0;
@ -77,8 +78,7 @@ foreach($dom->domains_type_lst() as $d) {
<td><?php echo $d['only_dns']?__("Yes"):__("No");?></td>
<td><?php echo $d['need_dns']?__("Yes"):__("No");?></td>
<td><div class="ina"><a href="adm_domstypeedit.php?name=<?php echo urlencode($d['name']); ?>"><img style="padding-bottom: 5px" src="images/edit.png" alt="<?php __("Edit"); ?>" /><?php __("Edit"); ?></a></div></td>
<td><a href='adm_domstyperegenerate.php?name=<?php echo urlencode($d['name']);?>'><?php __("Regenerate");?></a></td>
</tr>
<?php } // end foreach ?>

View File

@ -0,0 +1,25 @@
<?php
require_once("../class/config.php");
if (!$admin->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");
}
?>

View File

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