Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
dom_import.php
Go to the documentation of this file.
1 <?php
2 /*
3  $Id: ftp_list.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: List ftp accounts of the user.
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31 include_once("head.php");
32 
33 $fields = array (
34  "domain" => array ("post", "string", ""),
35  "zone" => array ("post", "string", ""),
36  "save" => array ("post", "integer", "0"),
37  "detect_redirect" => array ("post", "integer", "0"),
38 );
41 
42 ?>
43 <h3><?php __("Import a DNS zone"); ?></h3>
44 <hr id="topbar"/>
45 <br />
46 
47 <?php
48 if (!empty($error)) {
49  echo '<p class="alert alert-danger">'.$error.'</p>';
50 }
51 ?>
52 
53 <?php if ( !empty($zone) ) {
54 if ( empty($domain) ) {
55  echo '<p class="alert alert-danger">'._("The domain field seems to be empty").'</p>';
56 } else { ?>
57  <?php __("Here is my proposition. Modify your zone until my proposition seems good to you"); ?>
58  <table class="tlist">
59  <tr><th colspan=3><h2><?php printf(_("Working on %s"),$domain); ?></h2></th></tr>
60  <tr>
61  <th width="50%"><?php __("Zone"); ?></th><th width="50%"><?php __("Generated entry"); ?></th><?php if ($save) {echo "<th>"._("Result")."</th>"; } ?>
62  </tr>
63  <tbody>
64  <?php foreach ($dom->import_manual_dns_zone($zone, $domain, $detect_redirect, $save) as $val) {
65  if (empty($val)) continue;
66  //echo "<tr><td>"; print_r($val);
67  echo "<tr class='";
68  if ($save) {
69  echo "tab-".($val['did_it']==1?'ok':'err');
70  } else {
71  echo "tab-".$val['status'];
72  }
73  echo "'><td>".$val['entry_old']."</td><td>".$val['comment']."</td>";
74  if ($save) { echo "<td>".($val['did_it']==1?_("OK"):_("ERROR"))."</td>"; }
75  echo "</tr>\n";
76  } // foreach
77  ?>
78  </tbody>
79  </table>
80 <?php
81 } // empty domain
82 echo "<hr/>";
83 } // empty $zone
84 
85 
86 if ($save) {
87  echo '<span class="inb"><a href="dom_edit.php?domain='.urlencode($domain).'" >'._("Click here to continue").'</a></span>';
88 } else {
89 ?>
90 
91 
92 <form method="post" action="dom_import.php">
93  <table>
94  <tr>
95  <td>
96  <label for="domain"><?php __("Enter the domain name you want to import") ; ?></label>
97  </td>
98  <td>
99  <input type="text" size="40" name="domain" value="<?php echo $domain; ?>" />
100  </td>
101  </tr>
102  <tr>
103  <td>
104  <label for="detect_redirect"><?php __("Do you want to detect the redirection?"); ?></label>
105  </td>
106  <td>
107  <input name="detect_redirect" type="checkbox" value="1" <?php cbox($detect_redirect); ?> />
108  </td>
109  </tr>
110  <tr>
111  <td colspan="2">
112 
113  <p>
114  <label for="zone"><?php
115  __("Paste your existing DNS zone here.");
116  echo '<br/>';
117  __("If you don't know what it is, don't submit this form.");?></label>
118  <textarea cols=100 rows=20 name="zone"><?php echo $zone; ?></textarea>
119  </p>
120 
121  <?php if ( ! empty($zone) && ! empty($domain) ) { // only if you reviewed ?>
122  <label><?php __("Do you want to import the zone as it?"); ?></label>
123  <input name="save" type="checkbox" value="1" />
124  <?php } ?>
125 
126  <p><input type="submit" name="submit" class="inb ok" value="<?php __("Submit"); ?>" /></p>
127  </td>
128  </tr>
129  </table>
130 </form>
131 
132 <?php
133 } // $save
134 
135 include_once("foot.php");
136 
137 ?>