Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
dom_add.php
Go to the documentation of this file.
1 <?php
2 /*
3  $Id: dom_add.php,v 1.5 2003/06/10 13:16:11 root Exp $
4  ----------------------------------------------------------------------
5  AlternC - Web Hosting System
6  Copyright (C) 2002 by the AlternC Development Team.
7  http://alternc.org/
8  ----------------------------------------------------------------------
9  Based on:
10  Valentin Lacambre's web hosting softwares: http://altern.org/
11  ----------------------------------------------------------------------
12  LICENSE
13 
14  This program is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License (GPL)
16  as published by the Free Software Foundation; either version 2
17  of the License, or (at your option) any later version.
18 
19  This program is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  GNU General Public License for more details.
23 
24  To read the license please visit http://www.gnu.org/copyleft/gpl.html
25  ----------------------------------------------------------------------
26  Original Author of file: Benjamin Sonntag
27  Purpose of file: Add a new domain
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31 
32 include_once("head.php");
33 
34 $fields = array (
35  "newdomain" => array ("request", "string", ""),
36  "yndns" => array ("request", "integer", 0),
37  "newisslave" => array ("request", "integer", 0),
38  "slavedom" => array ("request", "string", ""),
39 );
41 
42 if (!isset($dns)) $dns="1";
43 
44 ?>
45 <h3><?php __("Domain hosting"); ?></h3>
46 <hr />
47 <?php
48 if (!$quota->cancreate("dom")) { ?>
49 <p class="alert alert-danger"><?php echo _("You cannot add any new domain, your quota is over.")." "._("Contact your administrator for more information."); ?></p>
50 <?php
51 exit();
52 }
53 if (isset($error) && $error) echo "<p class=\"alert alert-danger\">$error</p>";
54 ?>
55 <form method="post" action="dom_doadd.php" id="main">
56 <p>
57 <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 configure" href="dom_import.php"><?php __("Advanced import"); ?></a>
58 </p>
59 <p>
60  <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>
61 </p>
62 <?php
63  $q = $quota->getquota("dom");
64 if ($q["u"]>0) {
65 ?>
66 <fieldset>
67  <legend>
68  <?php __("Do you want to point this domain to another domain already installed in your account?"); ?>
69  </legend>
70 
71  <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>
72 <br />
73  <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">
74  <option value=""><?php __("-- Choose a domain --"); ?></option>
75 <?php
76 $dl=$dom->get_domain_list($cuid);
77  $ddl=array();
78  foreach($dl as $d) {
79  $ddl[$d]=$d;
80  }
81  eoption($ddl,"slavedom");
82 ?></select>
83 </fieldset>
84  <?php } ?>
85 
86 <p>
87  <input type="submit" class="inb ok" name="submit" value="<?php __("Add this domain"); ?>" />
88 </p>
89 
90 <p class="alert alert-info">
91 <?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>
92 <?php $mem->show_help("add_domain"); ?>
93 </form>
94 <?php
95  if (is_array($dom->dns)) {
96  echo "<br />"._("Whois result on the domain")." : <pre>";
97  reset($dom->dns);
98  while (list($key,$val)=each($dom->dns)) {
99  echo "nameserver: $val\n";
100  }
101  echo "</pre>";
102  }
103 ?>
104 <script type="text/javascript">
105 document.forms['main'].newdomain.focus();
106 </script>
107 <?php include_once("foot.php"); ?>