Alternc  latest
Alternc logiel libre pour l'hébergement
dom_add.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  * Form to add a new domain to an AlternC's account
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 
28 include_once("head.php");
29 
30 $fields = array (
31  "newdomain" => array ("post", "string", ""),
32  "yndns" => array ("post", "integer", 0),
33  "newisslave" => array ("post", "integer", 0),
34  "slavedom" => array ("post", "string", ""),
35 );
37 
38 if (!isset($dns)) $dns="1";
39 
40 ?>
41 <h3><?php __("Domain hosting"); ?></h3>
42 <hr />
43 <?php
44 if (!$quota->cancreate("dom")) {
45  $msg->raise("ALERT", "dom", _("You cannot add any new domain, your quota is over.")." "._("Contact your administrator for more information."));
46  echo $msg->msg_html_all();
47  exit();
48 }
49 echo $msg->msg_html_all();
50 ?>
51 <form method="post" action="dom_doadd.php" id="main">
52  <?php csrf_get(); ?>
53 <p>
54 <label for="newdomain"><b><?php __("Domain name"); ?> :</b></label> <span class="int" id="newdomwww">www.</span><input type="text" class="int" id="newdomain" name="newdomain" value="<?php ehe($newdomain); ?>" size="32" maxlength="255" /> <a class="inb settings" href="dom_import.php"><?php __("Advanced import"); ?></a>
55 </p>
56 <p>
57  <input type="checkbox" name="dns" class="inc" value="1" id="yndns"<?php cbox($dns=="1"); ?>/>&nbsp;<label for="yndns"><?php __("host my dns here"); ?></label>
58 </p>
59 <?php
60  $q = $quota->getquota("dom");
61 $dl=$dom->get_domain_list($cuid);
62 if ($q["u"]>0 && count($dl)) {
63 ?>
64 <fieldset>
65  <legend>
66  <?php __("Do you want to point this domain to another domain already installed in your account?"); ?>
67  </legend>
68 
69  <input type="radio" id="newisslave0" name="newisslave" value="0"<?php cbox($newisslave==0); ?>/><label for="newisslave0"><?php __("No: This domain will have its own folder."); ?></label>
70 <br />
71  <input type="radio" id="newisslave1" name="newisslave" value="1"<?php cbox($newisslave==1); ?>/><label for="newisslave1"><?php __("Yes, redirect this new domain to this one:"); ?> </label> <select name="slavedom" id="slavedom" class="inl">
72 <?php
73  $ddl=array();
74  foreach($dl as $d) {
75  $ddl[$d]=$d;
76  }
77  eoption($ddl,"slavedom");
78 ?></select>
79 </fieldset>
80  <?php } ?>
81 
82 <p>
83  <input type="submit" class="inb ok" name="submit" value="<?php __("Add this domain"); ?>" />
84 </p>
85 
86 <p class="alert alert-info">
87 <?php __("If you don't want to host in our server the DNS of your domain, don't check the box 'host my dns here'. If you don't know what it mean, leave it checked."); ?></p>
88 <?php $mem->show_help("add_domain"); ?>
89 </form>
90 <?php
91  if (is_array($dom->dns)) {
92  echo "<br />"._("Whois result on the domain")." : <pre>";
93  reset($dom->dns);
94  while (list($key,$val)=each($dom->dns)) {
95  echo "nameserver: $val\n";
96  }
97  echo "</pre>";
98  }
99 ?>
100 <script type="text/javascript">
101 document.forms['main'].newdomain.focus();
102 </script>
103 <?php include_once("foot.php"); ?>
exit
Definition: adm_doadd.php:70
$mem
Definition: bootstrap.php:71
$msg
Definition: bootstrap.php:75
$cuid
Definition: bootstrap.php:43
$d
$fields
Form to add a new domain to an AlternC's account.
Definition: dom_add.php:30
$q
Definition: dom_add.php:60
$dl
Definition: dom_add.php:61
eoption($values, $cur, $onedim=false)
select_values($arr,$cur) echo des <option> du tableau $values ou de la table sql $values selectionne ...
Definition: functions.php:619
__($str)
Definition: functions.php:404
cbox($test, $echo=true)
ECHOes checked="checked" only if the parameter is true useful for checkboxes and radio buttons.
Definition: functions.php:345
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
csrf_get($return=false)
Give a new CSRF uniq token for a form the session must be up since the CSRF is linked to the session ...
Definition: functions.php:1159
$val
Definition: tempovars.php:15
if(empty($_POST['key'])||empty($_POST['val'])) $key
Definition: tempovars.php:14
$dom
Definition: whois_test.php:10