Alternc  latest
Alternc logiel libre pour l'hébergement
adm_tld.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  * Manages Allowed TLD's to be installed as domain names on the server
22  * soon deprecated due to all those new TLDs
23  *
24  * @copyright AlternC-Team 2000-2017 https://alternc.com/
25  */
26 
27 require_once("../class/config.php");
28 
29 if (!$admin->enabled) {
30  $msg->raise("ERROR", "admin", _("This page is restricted to authorized staff"));
31  echo $msg->msg_html_all();
32  exit();
33 }
34 
35 $fields = array (
36  "sel" => array ("post", "array", ""),
37 );
39 
40 
41 if (is_array($sel)) {
42  for($i=0;$i<count($sel);$i++) {
43  if (!$admin->deltld($sel[$i])) {
44  $msg->raise("ERROR", "admin", _("Some TLD cannot be deleted...")." : ".$sel[$i]);
45  }
46  }
47  if (!$msg->has_msgs("ERROR"))
48  $msg->raise("INFO", "admin", _("The requested TLD has been deleted"));
49 }
50 
51 include_once("head.php");
52 
53 ?>
54 <h3><?php __("Manage allowed domains (TLD)"); ?></h3>
55 <hr id="topbar" />
56 <br />
57 <?php
58 echo $msg->msg_html_all();
59 
60 $c=$admin->listtld();
61 
62 ?>
63 <p>
64 <?php __("Here is the list of the TLD allowed on this server. Each TLD can be allowed or denied after some checks (whois, ns, domain exists...)"); ?>
65 </p>
66 <p><span class="ina"><a href="adm_tldadd.php"><?php __("Add a new TLD"); ?></a></span></p>
67 <form method="post" action="adm_tld.php" name="main" id="main">
68  <?php csrf_get(); ?>
69 <table class="tlist">
70 <tr><th colspan="2"> </th><th><?php __("TLD"); ?></th><th><?php __("Allowed Mode"); ?></th></tr>
71 <?php
72 for($i=0;$i<count($c);$i++) {
73 ?>
74 
75 <tr class="lst">
76 <td><input id="sel<?php echo $i; ?>" type="checkbox" name="sel[]" class="inc" value="<?php ehe($c[$i]["tld"]); ?>" /></td>
77  <td><div class="ina edit"><a href="adm_tldedit.php?tld=<?php eue($c[$i]["tld"]); ?>"><?php __("Edit"); ?></a></div></td>
78  <td><label for="sel<?php echo $i; ?>"><?php ehe($c[$i]["tld"]); ?></label></td>
79 <td><?php __($admin->tldmode[$c[$i]["mode"]]); ?></td></tr>
80 
81 <?php
82 }
83 ?>
84 <tr class="trbtn"><td colspan="3"><input type="submit" class="inb" value="<?php __("Delete the checked TLD"); ?>" /></td></tr>
85 </table>
86 </form>
87 
88 <p><span class="ina"><a href="adm_tldadd.php"><?php __("Add a new TLD"); ?></a></span></p>
89 <?php include_once("foot.php"); ?>
exit
Definition: adm_doadd.php:70
if(! $admin->enabled) $fields
Manages Allowed TLD's to be installed as domain names on the server soon deprecated due to all those ...
Definition: adm_tld.php:35
$c
Definition: adm_tld.php:60
$msg
Definition: bootstrap.php:75
ehe($str, $display=TRUE)
Echo the HTMLSpecialChars version of a value.
Definition: functions.php:647
__($str)
Definition: functions.php:404
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
$i