source: alternc/trunk/bureau/admin/dom_edit.php @ 2821

Revision 2821, 7.8 KB checked in by fufroma, 4 years ago (diff)

Update domains, l'aventure continue

Line 
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*/
30require_once("../class/config.php");
31include_once("head.php");
32
33$fields = array (
34        "domain"    => array ("request", "string", ""),
35        "sub"       => array ("request", "string", ""),
36);
37getFields($fields);
38
39$dom->lock();
40if (!$r=$dom->get_domain_all($domain)) {
41        $error=$err->errstr();
42}
43$dom->unlock();
44
45?>
46<script type="text/javascript">
47function dnson() {
48        // Active les composants DNS :
49        if (document.forms["fdns"].mx.disabled!=null)
50                document.forms["fdns"].mx.disabled=false;
51        if (document.forms["fdns"].emailon.disabled!=null)
52                document.forms["fdns"].emailon.disabled=true;
53        if (document.forms["fdns"].emailoff.disabled!=null)
54                document.forms["fdns"].emailoff.disabled=true;
55}
56function dnsoff() {
57        // Active les composants DNS :
58        if (document.forms["fdns"].mx.disabled!=null)
59                document.forms["fdns"].mx.disabled=true;
60        if (document.forms["fdns"].emailon.disabled!=null)
61                document.forms["fdns"].emailon.disabled=false;
62        if (document.forms["fdns"].emailoff.disabled!=null)
63                document.forms["fdns"].emailoff.disabled=false;
64}
65</script>
66<h3><?php printf(_("Editing subdomains of %s"),$domain); ?></h3>
67<?php
68        if ($error) {
69                echo "<p class=\"error\">$error</p>";
70        }
71?>
72<hr id="topbar"/>
73<?php
74
75if ($r['dns_action']=='UPDATE') {?>
76  <p class="error"><?php __("This domain have some DNS change pending. Please wait."); ?></p>
77<?php
78} elseif ($r['dns_action']=='DELETE') {?>
79  <p class="error"><?php __("You requested deletion of this domain.");?></p>
80<?php
81/*
82  // Link hidden as long as the del_domain_cancel function is not complete
83  <a href="dom_dodel.php?domain=<?php echo urlencode($domain);?>&del_cancel=true"><?php __("Clic here to cancel deletion");?></a>
84*/
85?>
86  <?php
87  include_once("foot.php");
88  die();
89}
90
91?>
92<br />
93<!-- *****************************************
94                 gestion des sous-domaines
95 -->
96<table class="tlist">
97<tr><th colspan="2"><?php __("Actions"); ?></th><th><?php __("Subdomain"); ?></th><th><?php __("Type");?></th><th><?php __("Place"); ?></th><th><?php __("Enable")?></th><th><?php __("Pending");?></tr>
98<?php
99$col=1;
100for($i=0;$i<$r["nsub"];$i++) {
101        $col=3-$col;
102?>
103        <tr class="lst<?php echo $col; ?>">
104                <td class="center">
105                        <div class="ina"><a href="dom_subedit.php?domain=<?php echo urlencode($r["name"]) ?>&amp;sub=<?php  echo urlencode($r["sub"][$i]["name"]) ?>&amp;type=<?php  echo urlencode($r["sub"][$i]["type"]) ?>&amp;value=<?php echo urlencode($r["sub"][$i]['dest'])?>"><img src="images/edit.png" alt="<?php __("Edit"); ?>" /><?php __("Edit"); ?></a></div>
106
107                        </td><td class="center">
108                        <div class="ina"><a href="dom_subdel.php?domain=<?php echo urlencode($r["name"]) ?>&amp;sub=<?php  echo urlencode($r["sub"][$i]["name"]) ?>&amp;type=<?php  echo urlencode($r["sub"][$i]["type"]) ?>&amp;value=<?php echo urlencode($r["sub"][$i]['dest'])?>"><img src="images/delete.png" alt="<?php __("Delete"); ?>" /><?php __("Delete"); ?></a></div>
109                </td>
110                <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>
111                <td><?php __($r['sub'][$i]['type_desc']);?></td>
112                <td><?php echo $r["sub"][$i]['type'] === 'LOCAL' ? '<a href="bro_main.php?R='.urlencode($r["sub"][$i]["dest"]).'">'.htmlspecialchars($r["sub"][$i]["dest"]).'</a>' : htmlspecialchars($r["sub"][$i]["dest"]); ?>&nbsp;</td>
113                <td><?php 
114      switch ($r['sub'][$i]['enable']) {
115        case 'ENABLED':
116          __("Enabled");
117          break;
118        case 'ENABLE':
119          __("Activation pending");
120          break;
121        case 'DISABLED':
122          __("Disabled");
123          break;
124        case 'DISABLE':
125          __("Desactivation pending");
126          break;
127      }?></td>
128                <td><?php 
129      switch ($r['sub'][$i]['web_action']) {
130        case 'UPDATE':
131          __("Update pending");
132          break;
133        case 'DELETE':
134          __("Deletion pending");
135          break;
136        case 'OK':
137        default:
138          __("Up to date");
139          break;
140      }?></td>
141           
142        </tr>
143<?php } ?>
144</table>
145<br />
146<hr/>
147<?php
148require_once('dom_edit.inc.php');
149sub_domains_edit($domain);
150?>
151<br />
152<?php $mem->show_help("edit_domain"); ?>
153<p>&nbsp;</p>
154<p>&nbsp;</p>
155<!-- *****************************************
156                 modification des parametres dns
157 -->
158<?php
159if (!$r[noerase]) {
160?>
161
162<hr />
163<h3><?php __("DNS parameters"); ?></h3>
164<form action="dom_editdns.php?domain=<?php echo urlencode($r["name"]) ?>" method="post" id="fdns" name="fdns">
165<table border="1" cellpadding="6" cellspacing="0">
166<tr><td colspan="2"><?php __("Manage the DNS on the server ?"); ?></td></tr>
167<tr>
168                                                                      <td align="center" width="65%"><input type="radio" id="yesdns" class="inc" name="dns" value="1"<?php cbox($r["dns"]); ?> onclick="dnson();" />&nbsp;<label for="yesdns"><?php __("Yes"); ?></label></td>
169   <td align="center" width="35%"><input type="radio" id="nodns" class="inc" name="dns" value="0"<?php cbox(!$r["dns"]); ?> onclick="dnsoff();" />&nbsp;<label for="nodns"><?php __("No"); ?></label></td>
170</tr>
171<tr>
172        <td width="65%" valign="top">
173        <p>
174<?php printf(_("help_dns_mx %s %s"),$L_MX,$L_HOSTING); ?>
175        </p>
176        <label for="mx"><?php __("MX Field"); ?> : </label><input type="text" class="int" name="mx" id="mx" value="<?php if ($r["dns"]) echo $r["mx"]; else echo $L_MX; ?>" <?php if (!$r["dns"]) echo "disabled=\"disabled\""; ?> />
177        </td>
178        <td width="35%" valign="top">
179        <p>
180        <?php __("help_dns_mail"); ?></p>
181<p>
182         <input type="radio" id="emailon" class="inc" name="email" id="emailon" value="1"<?php cbox($r["mail"]); ?> <?php if ($r["dns"]) echo "disabled=\"disabled\""; ?>/><label for="emailon"><?php __("Yes"); ?></label>
183<br />
184         <input type="radio" id="emailoff" class="inc" name="email" id="emailoff" value="0"<?php cbox(!$r["mail"]); ?> <?php if ($r["dns"]) echo "disabled=\"disabled\""; ?>/><label for="emailoff"><?php __("No"); ?></label>
185</p>
186        <p>                                                                                                                                                                                                               <?php __("Warning: If you set this to 'no', all your email accounts and aliases on this domain will be immediately deleted."); ?>
187</p>
188        </td>
189
190</tr>
191<tr class="trbtn"><td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Submit the changes"); ?>" /></td></tr>
192</table>
193        </form>
194
195<!-- *****************************************
196                 destruction du domaine
197 -->
198<br />
199<?php printf(_("help_domain_del %s"),$domain); ?><br />
200<form action="dom_dodel.php?domain=<?php echo urlencode($domain) ?>" method="post">
201<p>
202<input type="submit" class="inb" name="detruire" value="<?php printf(_("Delete %s from this server"),$domain); ?>" />
203</p>
204</form>
205<hr />
206<?php } // noerase ?>
207<script type="text/javascript">
208document.forms['main'].sub.focus();
209</script>
210<?php include_once("foot.php"); ?>
Note: See TracBrowser for help on using the repository browser.