| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | $Id: dom_edit.php,v 1.8 2006/02/17 18:20:08 olivier 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: Edit a domain parameters |
|---|
| 28 | ---------------------------------------------------------------------- |
|---|
| 29 | */ |
|---|
| 30 | require_once("../class/config.php"); |
|---|
| 31 | |
|---|
| 32 | $dom->lock(); |
|---|
| 33 | if (!$r=$dom->get_domain_all($domain)) { |
|---|
| 34 | $error=$err->errstr(); |
|---|
| 35 | } |
|---|
| 36 | $dom->unlock(); |
|---|
| 37 | |
|---|
| 38 | include("head.php"); |
|---|
| 39 | ?> |
|---|
| 40 | <script type="text/javascript"> |
|---|
| 41 | function dnson() { |
|---|
| 42 | // Active les composants DNS : |
|---|
| 43 | if (document.forms["dns"].mx.disabled!=null) |
|---|
| 44 | document.forms["dns"].mx.disabled=false; |
|---|
| 45 | if (document.forms["dns"].mail.disabled!=null) |
|---|
| 46 | document.forms["dns"].mail.disabled=true; |
|---|
| 47 | } |
|---|
| 48 | function dnsoff() { |
|---|
| 49 | // Active les composants DNS : |
|---|
| 50 | if (document.forms["dns"].mx.disabled!=null) |
|---|
| 51 | document.forms["dns"].mx.disabled=true; |
|---|
| 52 | if (document.forms["dns"].mail.disabled!=null) |
|---|
| 53 | document.forms["dns"].mail.disabled=false; |
|---|
| 54 | } |
|---|
| 55 | </script> |
|---|
| 56 | </head> |
|---|
| 57 | <body> |
|---|
| 58 | <h3><?php printf(_("Editing domain %s"),$domain); ?> : </h3> |
|---|
| 59 | <?php |
|---|
| 60 | if ($error) { |
|---|
| 61 | echo "<p class=\"error\">$error</p>"; |
|---|
| 62 | } |
|---|
| 63 | ?> |
|---|
| 64 | <hr /> |
|---|
| 65 | <!-- ***************************************** |
|---|
| 66 | gestion des sous-domaines |
|---|
| 67 | --> |
|---|
| 68 | <h3><?php __("Subdomains"); ?></h3> |
|---|
| 69 | <table cellspacing="0" cellpadding="3"> |
|---|
| 70 | <?php |
|---|
| 71 | $col=1; |
|---|
| 72 | for($i=0;$i<$r["nsub"];$i++) { |
|---|
| 73 | $col=3-$col; |
|---|
| 74 | ?> |
|---|
| 75 | <tr class="lst<?php echo $col; ?>"> |
|---|
| 76 | <td align="center"> |
|---|
| 77 | <a href="dom_subedit.php?domain=<?php echo urlencode($r["name"]) ?>&sub=<?php echo urlencode($r["sub"][$i]["name"]) ?>"><?php __("Edit"); ?></a> |
|---|
| 78 | |
|---|
| 79 | </td> |
|---|
| 80 | <td align="center"><a href="dom_subdel.php?domain=<?php echo urlencode($r["name"]) ?>&sub=<?php echo urlencode($r["sub"][$i]["name"]) ?>"><?php __("Delete"); ?></a></td> |
|---|
| 81 | <td><a href="http://<?php ecif($r["sub"][$i]["name"],$r["sub"][$i]["name"]."."); echo $r["name"] ?>" target="_blank"><?php ecif($r["sub"][$i]["name"],$r["sub"][$i]["name"]."."); echo $r["name"] ?></a></td> |
|---|
| 82 | <td><?php echo $r["sub"][$i]['type'] === '0' ? '<a href="bro_main.php?R='.urlencode($r["sub"][$i]["dest"]).'">'.htmlspecialchars($r["sub"][$i]["dest"]).'</a>' : htmlspecialchars($r["sub"][$i]["dest"]); ?> </td> |
|---|
| 83 | </tr> |
|---|
| 84 | <?php } ?> |
|---|
| 85 | </table> |
|---|
| 86 | <br /> |
|---|
| 87 | <form action="dom_subdoedit.php?" method="post" name="main"> |
|---|
| 88 | <table border="0"> |
|---|
| 89 | <tr> |
|---|
| 90 | <td> |
|---|
| 91 | <input type="hidden" name="domain" value="<?php echo $r["name"]; ?>" /> |
|---|
| 92 | <input type="hidden" name="action" value="add" /> |
|---|
| 93 | <?php __("Create a subdomain:"); ?> |
|---|
| 94 | <input type="text" class="int" name="sub" style="text-align:right" value="" size="22" id="sub" /><code>.<?php echo $domain; ?></code></td> |
|---|
| 95 | <td><input type="submit" class="inb" name="add" value="<?php __("Add a subdomain"); ?>" /></td> |
|---|
| 96 | </tr> |
|---|
| 97 | <tr> |
|---|
| 98 | <td><input type="radio" id="local" class="inc" name="type" value="<?php echo $dom->type_local; ?>" checked="checked" onclick="document.main.sub_local.focus();" /> |
|---|
| 99 | <label for="local"><?php __("Locally managed"); ?></label></td> |
|---|
| 100 | <td><input type="text" class="int" name="sub_local" id="sub_local" value="/" size="40" /> |
|---|
| 101 | <script type="text/javascript"> |
|---|
| 102 | <!-- |
|---|
| 103 | document.write(" <input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.sub_local');\" value=\" ... \" class=\"inb\">"); |
|---|
| 104 | // --> |
|---|
| 105 | </script> |
|---|
| 106 | </td> |
|---|
| 107 | </tr> |
|---|
| 108 | <tr> |
|---|
| 109 | <td><input type="radio" id="url" class="inc" name="type" value="<?php echo $dom->type_url; ?>" onclick="document.main.sub_url.focus();" /> |
|---|
| 110 | <label for="url" ><?php __("URL redirection"); ?></label></td> |
|---|
| 111 | <td><input type="text" class="int" name="sub_url" id="sub_url" value="http://" size="50" /></td> |
|---|
| 112 | </tr> |
|---|
| 113 | <?php if ($r["dns"]) { // show only if dns is enabled ?> |
|---|
| 114 | <tr> |
|---|
| 115 | <td><input type="radio" id="ip" class="inc" name="type" value="<?php echo $dom->type_ip; ?>" onclick="document.main.sub_ip.focus();" /> |
|---|
| 116 | <label for="ip"><?php __("IP redirection"); ?></label></td> |
|---|
| 117 | <td><input type="text" class="int" name="sub_ip" id="sub_ip" value="xxx.xxx.xxx.xxx" size="16" /></td> |
|---|
| 118 | </tr> |
|---|
| 119 | <? } ?> |
|---|
| 120 | <tr> |
|---|
| 121 | <td><input type="radio" id="webmail" class="inc" name="type" value="<?php echo $dom->type_webmail; ?>" /> |
|---|
| 122 | <label for="webmail"><?php __("Webmail access"); ?></label></td> |
|---|
| 123 | <td> </td> |
|---|
| 124 | </tr> |
|---|
| 125 | </table> |
|---|
| 126 | </form> |
|---|
| 127 | <?php $mem->show_help("edit_domain"); ?> |
|---|
| 128 | <p> </p> |
|---|
| 129 | <p> </p> |
|---|
| 130 | <!-- ***************************************** |
|---|
| 131 | modification des parametres dns |
|---|
| 132 | --> |
|---|
| 133 | <?php |
|---|
| 134 | if (!$r[noerase]) { |
|---|
| 135 | ?> |
|---|
| 136 | |
|---|
| 137 | <hr /> |
|---|
| 138 | <h3><?php __("DNS parameters"); ?></h3> |
|---|
| 139 | <form action="dom_editdns.php?domain=<?php echo urlencode($r["name"]) ?>" method="post" id="dns"> |
|---|
| 140 | <table border="1" cellpadding="6" cellspacing="0"> |
|---|
| 141 | <tr><td colspan="2"><?php __("Manage the DNS on the server ?"); ?></td></tr> |
|---|
| 142 | <tr> |
|---|
| 143 | <td align="center" width="65%"><label for="yesdns"><?php __("Yes"); ?></label><input type="radio" id="yesdns" class="inc" name="dns" value="1"<?php if ($r["dns"]) echo " checked=\"checked\"" ?> onclick="dnson();" /></td> |
|---|
| 144 | <td align="center" width="35%"><label for="nodns"><?php __("No"); ?></label><input type="radio" id="nodns" class="inc" name="dns" value="0"<?php if (!$r["dns"]) echo " checked=\"checked\"" ?> onclick="dnsoff();" /></td> |
|---|
| 145 | </tr> |
|---|
| 146 | <tr> |
|---|
| 147 | <td width="65%" valign="top"> |
|---|
| 148 | <p> |
|---|
| 149 | <?php printf(_("help_dns_mx %s %s"),$L_MX,$L_HOSTING); ?> |
|---|
| 150 | </p> |
|---|
| 151 | <label for="mx"><?php __("MX Field"); ?> : </label><input type="text" class="int" name="mx" id="mx" value="<?php echo $r["mx"] ?>" <?php if (!$r["dns"]) echo "disabled=\"disabled\""; ?> /> |
|---|
| 152 | </td> |
|---|
| 153 | <td width="35%" valign="top"> |
|---|
| 154 | <p> |
|---|
| 155 | <?php __("help_dns_mail"); ?></p> |
|---|
| 156 | <select class="inl" id="email" name="email" <?php if ($r["dns"]) echo "disabled=\"disabled\""; ?>><option value="1"<?php if ($r["mail"]) echo " selected=\"selected\"";?>><?php __("Yes"); ?></option><option value="0"<?php if (!$r["mail"]) echo " selected=\"selected\"";?>><?php __("No"); ?></option></select> |
|---|
| 157 | </td> |
|---|
| 158 | </tr> |
|---|
| 159 | <tr><td colspan="2" align="center"><input type="submit" class="inb" name="submit" value="<?php __("Submit the changes"); ?>" /></td></tr> |
|---|
| 160 | </table> |
|---|
| 161 | </form> |
|---|
| 162 | |
|---|
| 163 | <!-- ***************************************** |
|---|
| 164 | destruction du domaine |
|---|
| 165 | --> |
|---|
| 166 | <br /> |
|---|
| 167 | <?php printf(_("help_domain_del %s"),$domain); ?><br /> |
|---|
| 168 | <form action="dom_dodel.php?domain=<?php echo urlencode($domain) ?>" method="post"> |
|---|
| 169 | <p> |
|---|
| 170 | <input type="submit" class="inb" name="detruire" value="<?php printf(_("Delete %s"),$domain); ?>" /> |
|---|
| 171 | </p> |
|---|
| 172 | </form> |
|---|
| 173 | <hr /> |
|---|
| 174 | <?php } // noerase ?> |
|---|
| 175 | </body> |
|---|
| 176 | </html> |
|---|