2006-04-26 12:28:53 +00:00
< ? php
/*
$Id : dom_subedit . php , v 1.3 2003 / 08 / 13 23 : 01 : 45 root Exp $
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright ( C ) 2002 by the AlternC Development Team .
http :// alternc . org /
----------------------------------------------------------------------
Based on :
Valentin Lacambre ' s web hosting softwares : http :// altern . org /
----------------------------------------------------------------------
LICENSE
This program is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public License ( GPL )
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
To read the license please visit http :// www . gnu . org / copyleft / gpl . html
----------------------------------------------------------------------
Original Author of file :
Purpose of file :
----------------------------------------------------------------------
*/
require_once ( " ../class/config.php " );
2009-09-08 05:29:38 +00:00
include_once ( " head.php " );
$fields = array (
" domain " => array ( " request " , " string " , " " ),
" sub " => array ( " request " , " string " , " " ),
2010-04-29 08:31:15 +00:00
" type " => array ( " request " , " integer " , $dom -> type_local ),
" sub_local " => array ( " request " , " string " , " / " ),
" sub_url " => array ( " request " , " string " , " http:// " ),
" sub_ip " => array ( " request " , " string " , " " ),
2010-11-14 16:54:27 +00:00
" sub_ipv6 " => array ( " request " , " string " , " " ),
2010-11-16 17:11:06 +00:00
" sub_cname " => array ( " request " , " string " , " " ),
" sub_txt " => array ( " request " , " string " , " " ),
2010-04-29 08:31:15 +00:00
" action " => array ( " request " , " string " , " add " ),
2009-09-08 05:29:38 +00:00
);
getFields ( $fields );
2006-04-26 12:28:53 +00:00
$dom -> lock ();
2010-04-29 08:31:15 +00:00
if ( ! $noread ) {
2010-11-16 17:11:06 +00:00
if ( ! $r = $dom -> get_sub_domain_all ( $domain , $sub , $type )) {
2010-04-29 08:31:15 +00:00
$error = $err -> errstr ();
?>
< h3 >< ? php __ ( " Editing subdomain " ); ?> http://<?php ecif($sub,$sub."."); echo $domain; ?></h3>
< ? php
echo " <p class= \" error \" > $error </p> " ;
include_once ( " foot.php " );
exit ();
}
$sub = $r [ " name " ];
$type = $r [ " type " ];
switch ( $type ) {
case $dom -> type_local :
$sub_local = $r [ " dest " ];
break ;
case $dom -> type_url :
$sub_url = $r [ " dest " ];
break ;
2010-11-16 17:11:06 +00:00
case $dom -> type_cname :
$sub_cname = $r [ " dest " ];
break ;
case $dom -> type_txt :
$sub_txt = $r [ " dest " ];
break ;
2010-11-14 16:54:27 +00:00
case $dom -> type_ipv6 :
$sub_ipv6 = $r [ " dest " ];
break ;
2010-04-29 08:31:15 +00:00
case $dom -> type_ip :
$sub_ip = $r [ " dest " ];
break ;
case $dom -> type_webmail :
break ;
}
}
2006-04-26 12:28:53 +00:00
$dom -> unlock ();
?>
2010-03-04 16:16:13 +00:00
< h3 >< ? php __ ( " Editing subdomain " ); ?> http://<?php ecif($sub,$sub."."); echo $domain; ?></h3>
2006-04-26 12:28:53 +00:00
< ? php
if ( $error ) {
2010-04-29 08:31:15 +00:00
echo " <p class= \" error \" > $error </p> " ;
2006-04-26 12:28:53 +00:00
}
?>
2010-04-29 14:29:27 +00:00
< hr id = " topbar " />
2010-03-04 16:16:13 +00:00
< br />
2006-04-26 12:28:53 +00:00
<!-- *****************************************
gestion du sous - domaine
-->
< form action = " dom_subdoedit.php " method = " post " id = " main " name = " main " >
< table border = " 0 " >
2009-09-08 05:29:38 +00:00
< tr >
2010-04-29 08:31:15 +00:00
< td > < input type = " hidden " name = " domain " value = " <?php ehe( $domain ); ?> " />
< input type = " hidden " name = " sub " value = " <?php echo ehe( $sub ); ?> " />
2010-11-16 17:11:06 +00:00
< input type = " hidden " name = " type_old " value = " <?php echo ehe( $type ); ?> " />
2006-04-26 12:28:53 +00:00
< input type = " hidden " name = " action " value = " edit " />
< input type = " radio " id = " local " class = " inc " name = " type " value = " <?php echo $dom->type_local ; ?> " < ? php cbox ( $r [ " type " ] == $dom -> type_local ); ?> onclick="document.main.sub_local.focus();" />
< label for = " local " >< ? php __ ( " Locally managed " ); ?> </label></td>
2010-04-29 08:31:15 +00:00
< td >< input type = " text " class = " int " name = " sub_local " id = " sub_local " value = " <?php ehe( $sub_local ); ?> " size = " 40 " />
2006-04-26 12:28:53 +00:00
< script type = " text/javascript " >
<!--
2010-03-04 16:16:13 +00:00
document . write ( " <input type= \" button \" name= \" bff \" onclick= \" browseforfolder('main.sub_local'); \" value= \" <?php __( " Choose a folder ... " ); ?> \" class= \" bff \" > " );
2006-04-26 12:28:53 +00:00
// -->
</ script >
</ td >
</ tr >
< tr >
2010-04-29 08:31:15 +00:00
< td >< input type = " radio " id = " url " class = " inc " name = " type " value = " <?php echo $dom->type_url ; ?> " < ? php cbox ( $type == $dom -> type_url ); ?> onclick="document.main.sub_url.focus();" />
2006-04-26 12:28:53 +00:00
< label for = " url " >< ? php __ ( " URL redirection " ); ?> </label></td>
2010-04-29 08:31:15 +00:00
< td >< input type = " text " class = " int " name = " sub_url " id = " sub_url " value = " <?php ehe( $sub_url ); ?> " size = " 50 " /></ td >
2006-04-26 12:28:53 +00:00
</ tr >
2010-11-14 16:54:27 +00:00
2006-04-26 12:28:53 +00:00
< tr >
2010-04-29 08:31:15 +00:00
< td >< input type = " radio " id = " ip " class = " inc " name = " type " value = " <?php echo $dom->type_ip ; ?> " < ? php cbox ( $type == $dom -> type_ip ); ?> onclick="document.main.sub_ip.focus();" />
2006-04-26 12:28:53 +00:00
< label for = " ip " >< ? php __ ( " IP redirection " ); ?> </label></td>
2010-04-29 08:31:15 +00:00
< td >< input type = " text " class = " int " name = " sub_ip " id = " sub_ip " value = " <?php ehe( $sub_ip ); ?> " size = " 16 " /> < small >< ? php __ ( " (enter an IPv4 address, for example 192.168.1.2) " ); ?> </small></td>
2010-11-14 16:54:27 +00:00
< tr >
2010-11-16 17:11:06 +00:00
< td >< input type = " radio " id = " webmail " class = " inc " name = " type " value = " <?php echo $dom->type_webmail ; ?> " < ? php cbox ( $r [ " type " ] == $dom -> type_webmail ); ?> />
< label for = " webmail " >< ? php __ ( " Webmail access " ); ?> </label></td>
< td >& nbsp ; </ td >
</ tr >
< tr >< td colspan = 2 style = " background-color: #CFE3F1;color: #007777;font-weight:bold; " > Advanced options </ td ></ tr >
< tr id = " advopt1 " >
2010-11-14 16:54:27 +00:00
< td >< input type = " radio " id = " ipv6 " class = " inc " name = " type " value = " <?php echo $dom->type_ipv6 ; ?> " < ? php cbox ( $type == $dom -> type_ipv6 ); ?> onclick="document.main.sub_ipv6.focus();" />
< label for = " ipv6 " >< ? php __ ( " IPv6 redirection " ); ?> </label></td>
2010-11-16 17:11:06 +00:00
< td >< input type = " text " class = " int " name = " sub_ipv6 " id = " sub_ipv6 " value = " <?php ehe( $sub_ipv6 ); ?> " size = " 32 " /> < small >< ? php __ ( " (enter an IPv6 address, for example 2001:0910::0) " ); ?> </small></td>
</ tr >
2010-11-14 16:54:27 +00:00
2010-11-16 17:11:06 +00:00
< tr id = " advopt2 " >
< td >< input type = " radio " id = " cname " class = " inc " name = " type " value = " <?php echo $dom->type_cname ; ?> " < ? php cbox ( $type == $dom -> type_cname ); ?> onclick="document.main.sub_cname.focus();" />
< label for = " cname " >< ? php __ ( " CNAME redirection " ); ?> </label></td>
< td >< input type = " text " class = " int " name = " sub_cname " id = " sub_cname " value = " <?php ehe( $sub_cname ); ?> " size = " 32 " /> < small >< ? php __ ( " (enter a server address or a subdomain) " ); ?> </small></td>
2006-04-26 12:28:53 +00:00
</ tr >
2010-11-16 17:11:06 +00:00
< tr id = " advopt3 " >
< td >< input type = " radio " id = " txt " class = " inc " name = " type " value = " <?php echo $dom->type_txt ; ?> " < ? php cbox ( $type == $dom -> type_txt ); ?> onclick="document.main.sub_txt.focus();" />
< label for = " txt " >< ? php __ ( " TXT information " ); ?> </label></td>
< td >< input type = " text " class = " int " name = " sub_txt " id = " sub_txt " value = " <?php ehe( $sub_txt ); ?> " size = " 32 " /> < small >< ? php __ ( " (enter a TXT informations for this domain) " ); ?> </small></td>
2006-04-26 12:28:53 +00:00
</ tr >
2010-11-16 17:11:06 +00:00
2010-04-28 23:58:29 +00:00
< tr class = " trbtn " >
< td colspan = " 2 " >
< input type = " submit " class = " inb " name = " submit " value = " <?php __( " Validate this change " ); ?> " />
2010-04-29 08:31:15 +00:00
< input type = " button " class = " inb " name = " back " value = " <?php __( " Cancel " ); ?> " onclick = " document.location='dom_edit.php?domain=<?php ehe( $domain ); ?>' " />
2010-04-28 23:58:29 +00:00
</ td >
</ tr >
2006-04-26 12:28:53 +00:00
</ table >
2010-04-28 23:58:29 +00:00
2006-04-26 12:28:53 +00:00
</ form >
2009-09-08 05:29:38 +00:00
< ? php include_once ( " foot.php " ); ?>