Alternc  latest
Alternc logiel libre pour l'hébergement
adm_domstypeedit.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 update a domain type on the server
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 if (!$admin->enabled) {
28  $msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
29  echo $msg->msg_html_all();
30  exit();
31 }
32 
33 include_once("head.php");
34 
35 $fields = array (
36  "name" => array ("request", "string", ""),
37  "description" => array ("post", "string", ""),
38  "target" => array ("post", "string", ""),
39  "entry" => array ("post", "string", ""),
40  "compatibility" => array ("post", "string", ""),
41  "enable" => array ("post", "string", ""),
42  "only_dns" => array ("post", "boolean", ""),
43  "need_dns" => array ("post", "boolean", ""),
44  "advanced" => array ("post", "boolean", ""),
45  "create_tmpdir" => array ("post", "boolean", ""),
46  "create_targetdir" => array ("post", "boolean", ""),
47 );
49 
50 
51 $d=$dom->domains_type_get($name);
52 ?>
53 
54 <h3><?php __("Edit a domain type"); ?> </h3>
55 <hr id="topbar"/>
56 <br />
57 <?php
58 echo $msg->msg_html_all();
59 
60 if (! $msg->has_msgs("ERROR")) {
61 ?>
62 
63 <form action="adm_domstypedoedit.php" method="post" name="main" id="main">
64  <?php csrf_get(); ?>
65  <input type="hidden" name="name" value="<?php ehe($d['name']); ?>" />
66  <table class="tedit">
67  <tr>
68  <th><?php __("Name");?></th>
69  <td><b><?php echo $d["name"]; ?></b></td>
70  </tr>
71  <tr>
72  <th><?php __("Description");?></th>
73  <td><input name="description" type="text" size="30" value="<?php ehe($d['description']); ?>" /></td>
74  </tr>
75  <tr>
76  <th><?php __("Target type");?></th>
77  <td>
78  <select name="target">
79  <?php foreach ($dom->domains_type_target_values() as $k) { ?>
80  <option value="<?php echo $k ?>" <?php echo ($d['target']==$k)?"selected":"";?> ><?php echo $k;?></option>
81  <?php } ?>
82  </select>
83  </td>
84  </tr>
85  <tr>
86  <th><?php __("Entry");?></th>
87  <td><input name="entry" type="text" size="30" value="<?php ehe($d['entry']); ?>" /></td>
88  </tr>
89  <tr>
90  <th><?php __("Compatibility");?><br /><small><?php __("Enter comma-separated name of other types"); ?></small></th>
91  <td><input name="compatibility" type="text" size="15" value="<?php ehe($d['compatibility']); ?>" /></td>
92  </tr>
93  <tr>
94  <th><?php __("Enabled");?></th>
95  <td>
96  <select name="enable">
97  <?php foreach ($dom->domains_type_enable_values() as $k) { ?>
98  <option value="<?php echo $k ?>" <?php echo ($d['enable']==$k)?"selected":"";?> ><?php __($k);?></option>
99  <?php } ?>
100  </select>
101  </td>
102  </tr>
103  <tr>
104  <th><?php __("Do only a DNS entry");?></th>
105  <td><input name="only_dns" type="checkbox" value="1" <?php cbox($d['only_dns']); ?> /></td>
106  </tr>
107  <tr>
108  <th><?php __("Domain must have our DNS");?></th>
109  <td><input name="need_dns" type="checkbox" value="1" <?php cbox($d['need_dns']); ?> /></td>
110  </tr>
111  <tr>
112  <th><?php __("Is it an advanced option?");?></th>
113  <td><input name="advanced" type="checkbox" value="1" <?php cbox($d['advanced']); ?> /></td>
114  </tr>
115  </tr>
116  <tr>
117  <th><?php __("Create tmp directory ?");?></th>
118  <td><input name="create_tmpdir" type="checkbox" value="1" <?php cbox($d['create_tmpdir']); ?> /></td>
119  </tr>
120  </tr>
121  <tr>
122  <th><?php __("Create target directory ?");?></th>
123  <td><input name="create_targetdir" type="checkbox" value="1" <?php cbox($d['create_targetdir']); ?> /></td>
124  </tr>
125  <tr class="trbtn">
126  <td colspan="2">
127  <input type="submit" class="inb" name="submit" value="<?php __("Change this domain type"); ?>" />
128  <input type="button" class="inb" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='adm_domstype.php'"/>
129  </td>
130  </tr>
131 </table>
132 </form>
133 
134 <?php } ?>
135 
136 <?php include_once("foot.php"); ?>
exit
Definition: adm_doadd.php:70
$msg
Definition: bootstrap.php:75
__($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
$dom
Definition: whois_test.php:10