27 require_once(
"../class/config.php");
28 include_once(
"head.php");
42 $sd=
$dom->get_sub_domain_all($sub_domain_id);
51 <form action=
"dom_subdoedit.php" method=
"post" name=
"main" id=
"main">
53 <table
class=
"dom-edit-table">
56 <input type=
"hidden" name=
"domain" value=
"<?php ehe($domain) ?>" />
57 <input type=
"hidden" name=
"sub_domain_id" value=
"<?php echo intval($sub_domain_id); ?>" />
58 <input type=
"hidden" name=
"action" value=
"add" />
61 __(
"Edit a subdomain:");
63 __(
"Create a subdomain:");
66 <input type=
"text" class=
"int" name=
"sub" style=
"text-align:right" value=
"<?php ehe($sub); ?>" size=
"22" id=
"sub" /><span
class=
"int" id=
"newsubname">.<?php
ehe(
$domain); ?></span></td>
71 $lst_advanced=array();
72 foreach(
$dom->domains_type_lst() as
$dt) {
74 if (
$dt[
'enable'] ==
'NONE' && strtoupper($type)!=strtoupper(
$dt[
'name'])) continue ;
76 if ((
$dt[
'enable'] ==
'ADMIN') && (! $admin->enabled and ! intval(
$oldid)))
continue;
78 if ( (!
$r[
'dns'] ) and (
$dt[
'need_dns']) )
continue;
79 $targval=(strtoupper($type)==strtoupper(
$dt[
'name']))?$sd[
'dest']:
'';
81 if (
$dt[
'advanced']) {
82 $lst_advanced[]=
$dt[
'name'];
83 if ($first_advanced) {
84 $first_advanced=
false;
85 echo
"<tr id='domtype_show' onClick=\"domtype_advanced_show();\"><td colspan='2'><a href=\"javascript:domtype_advanced_show();\"><b>+ ";
__(
"Show advanced options"); echo
"</b></a></td></tr>";
86 echo
"<tr id='domtype_hide' onClick=\"domtype_advanced_hide();\" style='display:none'><td colspan='2'><a href=\"javascript:domtype_advanced_hide();\"><b>- ";
__(
"Hide advanced options"); echo
"</b></a></td></tr>";
90 <tr
id=
"tr_<?php echo $dt['name']; ?>">
92 <input type=
"radio" id=
"r_<?php ehe($dt['name']); ?>" class=
"inc" name=
"type" value=
"<?php ehe($dt['name']); ?>" <?php
cbox(strtoupper($type)==strtoupper(
$dt[
'name'])); ?> OnClick=
"getElementById('t_<?php ehe($dt['name']); ?>').focus();"/>
93 <label
for=
"r_<?php ehe($dt['name']); ?>"><?php
__(
$dt[
'description']); ?></label>
98 switch (
$dt[
'target']) {
100 <input type=
"text" class=
"int" name=
"t_<?php ehe($dt['name']); ?>" id=
"t_<?php ehe($dt['name']); ?>" value=
"<?php ehe($targval); ?>" size=
"28" onKeyPress=
"getElementById('r_<?php ehe($dt['name']); ?>').checked=true;" />
104 <input type=
"text" class=
"int" name=
"t_<?php ehe($dt['name']); ?>" id=
"t_<?php ehe($dt['name']); ?>" value=
"<?php ehe( (empty($targval)?'http://':$targval) ); ?>" size=
"50" onKeyPress=
"getElementById('r_<?php ehe($dt['name']); ?>').checked=true;" />
105 <small><?php
__(
"(enter an URL here)"); ?></small><?php
108 <input type=
"text" class=
"int" name=
"t_<?php ehe($dt['name']); ?>" id=
"t_<?php ehe($dt['name']); ?>" value=
"<?php ehe($targval); ?>" size=
"16" onKeyPress=
"getElementById('r_<?php ehe($dt['name']); ?>').checked=true;" />
109 <small><?php
__(
"(enter an IPv4 address, for example 192.168.1.2)"); ?></small><?php
112 <input type=
"text" class=
"int" name=
"t_<?php ehe($dt['name']); ?>" id=
"t_<?php ehe($dt['name']); ?>" value=
"<?php ehe($targval); ?>" size=
"32" onKeyPress=
"getElementById('r_<?php ehe($dt['name']); ?>').checked=true;" />
113 <small><?php
__(
"(enter an IPv6 address, for example 2001:0910::0)"); ?></small><?php
116 <input type=
"text" class=
"int" name=
"t_<?php ehe($dt['name']); ?>" id=
"t_<?php ehe($dt['name']); ?>" value=
"<?php ehe($targval);?>" size=
"32" onKeyPress=
"getElementById('r_<?php ehe($dt['name']); ?>').checked=true;" />
117 <small><?php
__(
"(enter a TXT content for this domain)"); ?></small><?php
120 <input type=
"text" class=
"int" name=
"t_<?php ehe($dt['name']); ?>" id=
"t_<?php ehe($dt['name']); ?>" value=
"<?php ehe($targval);?>" size=
"32" onKeyPress=
"getElementById('r_<?php ehe($dt['name']); ?>').checked=true;" />
121 <small><?php
__(
"(enter a domain name or subdomain)"); ?></small><?php
129 <?php
if (
$dt[
'has_https_option']) { ?>
131 <select
class=
"inl" name=
"https_<?php ehe($dt['name']); ?>" id=
"https_<?php ehe($dt['name']); ?>">
132 <option value=
"http"<?php
selected((strtoupper($type)==strtoupper(
$dt[
'name']) && $sd[
"https"]==
"http") ||
false); ?>><?php
__(
"HTTP Only (redirect HTTPS to HTTP)"); ?></option>
133 <option value=
"https"<?php
selected((strtoupper($type)==strtoupper(
$dt[
'name']) && $sd[
"https"]==
"https") ||
true); ?>><?php
__(
"HTTPS Only (redirect HTTP to HTTPS)"); ?></option>
134 <option value=
"both"<?php
selected((strtoupper($type)==strtoupper(
$dt[
'name']) && $sd[
"https"]==
"both") ||
false); ?>><?php
__(
"Both HTTP and HTTPS hosted at the same place"); ?></option>
142 <td colspan=
"2"><button type=
"submit" class=
"inb ok" name=
"add" onclick=
'return check_type_selected();'><?php
144 __(
"Edit this subdomain");
146 __(
"Add this subdomain");
150 <button
class=
"inb cancel" type=
"button" name=
"cancel" onclick=
"document.location = 'dom_edit.php?domain=<?php echo $domain; ?>'"><?php
__(
"Cancel"); ?></button>
157 <script type=
"text/javascript">
159 function check_type_selected() {
160 if ( $(
'input[name=type]:radio:checked').val() ) {
162 var ll = $(
'input[name=type]:radio:checked').val();
163 var tt = $(
'#t_'+ll);
164 if ( tt.length == 0 ) {
168 if ( tt.val() ==
'' ) {
169 alert(
"<?php __("Missing value
for this sub-domain
"); ?>");
175 alert(
"<?php __("Please select a type
for this sub-domain
"); ?>");
179 function domtype_advanced_hide() {
180 <?php
foreach ($lst_advanced as $adv) echo
"$(\"#tr_$adv\").hide();\n"?>
181 $(
"#domtype_show").show();
182 $(
"#domtype_hide").hide();
184 function domtype_advanced_show() {
185 <?php
foreach ($lst_advanced as $adv) echo
"$(\"#tr_$adv\").show();\n"?>
186 $(
"#domtype_show").hide();
187 $(
"#domtype_hide").show();
190 <?php
if (isset($type) && in_array($type, $lst_advanced) ) {
191 domtype_advanced_show();
193 domtype_advanced_hide();
Classe de gestion des domaines de l'hébergé.
if(count($_POST) &&!defined("NOCSRF")) if(!defined('NOCHECK')) for($i=0; $i< count($classes); $i++) $oldid
sub_domains_edit($domain, $sub_domain_id=false)
Form to edit / add subdomains, using domaine_type table to show a synamic form.
ehe($str, $display=TRUE)
Echo the HTMLSpecialChars version of a value.
selected($bool, $echo=TRUE)
ECHOes selected="selected" only if the parameter is true useful for checkboxes and radio buttons.
display_browser($dir="", $caller="main.dir", $width=350, $height=450)
Show a button to select a folder on the server.
cbox($test, $echo=true)
ECHOes checked="checked" only if the parameter is true useful for checkboxes and radio buttons.
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 ...