Alternc  latest
Alternc logiel libre pour l'hébergement
dom_editdns.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * Edit the DNS parameters of a domain
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 include_once("head.php");
28 
29 $fields = array (
30  "domain" => array ("request", "string", ""),
31  "dns" => array ("post", "integer", 1),
32  "email" => array ("post", "integer", 1),
33  "ttl" => array ("post", "integer", 86400),
34 );
36 
37 $dom->lock();
38 
39 $r = $dom->get_domain_all($domain);
40 if ($r["dns"] == $dns && $r["mail"] == $email && $r["zonettl"] == $ttl) {
41  $msg->raise("INFO", "dom", _("No change has been requested..."));
42 } else if ($dom->edit_domain($domain,$dns,$email,0,$ttl)) {
43  $msg->raise("INFO", "dom", _("The domain %s has been changed."),$domain);
44  $t = time();
45 // TODO: we assume the cron job is at every 5 minutes
46  $msg->raise("INFO", "dom", _("The modifications will take effect at %s. Server time is %s."), array(date('H:i:s', ($t-($t%300)+300)), date('H:i:s', $t)));
47 }
48 $dom->unlock();
49 
50 include("dom_edit.php");
51 exit();
52 ?>
exit
Definition: adm_doadd.php:70
$msg
Definition: bootstrap.php:75
$r
Definition: dom_editdns.php:39
$fields
Edit the DNS parameters of a domain.
Definition: dom_editdns.php:29
$domain
Definition: dom_import.php:36
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
Definition: functions.php:688
foreach($domaines_user as $domaine) $t
$dom
Definition: whois_test.php:10