2006-04-26 12:28:53 +00:00
< ? php
/*
$Id : dom_edit . php , v 1.8 2006 / 02 / 17 18 : 20 : 08 olivier 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 : Benjamin Sonntag
Purpose of file : Edit a domain parameters
----------------------------------------------------------------------
*/
require_once ( " ../class/config.php " );
2009-09-08 05:29:38 +00:00
include_once ( " head.php " );
$fields = array (
" domain " => array ( " request " , " string " , " " ),
2010-04-29 08:31:15 +00:00
" sub " => array ( " request " , " string " , " " ),
2009-09-08 05:29:38 +00:00
);
getFields ( $fields );
2006-04-26 12:28:53 +00:00
$dom -> lock ();
if ( ! $r = $dom -> get_domain_all ( $domain )) {
$error = $err -> errstr ();
}
2012-11-08 19:43:24 +00:00
if ( isset ( $error ) && $error ) {
// if there is an errpr error, means problems with the domain. We stop
echo " <p class= \" error \" > $error </p> " ;
include_once ( " foot.php " );
die ();
}
2006-04-26 12:28:53 +00:00
$dom -> unlock ();
?>
< script type = " text/javascript " >
function dnson () {
2012-08-27 13:37:37 +00:00
alert ( 'This function seems unused. If you see this message, please let us know.' );
2006-04-26 12:28:53 +00:00
// Active les composants DNS :
2010-04-29 08:31:15 +00:00
if ( document . forms [ " fdns " ] . mx . disabled != null )
document . forms [ " fdns " ] . mx . disabled = false ;
if ( document . forms [ " fdns " ] . emailon . disabled != null )
document . forms [ " fdns " ] . emailon . disabled = true ;
if ( document . forms [ " fdns " ] . emailoff . disabled != null )
document . forms [ " fdns " ] . emailoff . disabled = true ;
2006-04-26 12:28:53 +00:00
}
function dnsoff () {
2012-08-27 13:37:37 +00:00
alert ( 'This function seems unused. If you see this message, please let us know.' );
2006-04-26 12:28:53 +00:00
// Active les composants DNS :
2010-04-29 08:31:15 +00:00
if ( document . forms [ " fdns " ] . mx . disabled != null )
document . forms [ " fdns " ] . mx . disabled = true ;
if ( document . forms [ " fdns " ] . emailon . disabled != null )
document . forms [ " fdns " ] . emailon . disabled = false ;
if ( document . forms [ " fdns " ] . emailoff . disabled != null )
document . forms [ " fdns " ] . emailoff . disabled = false ;
2006-04-26 12:28:53 +00:00
}
</ script >
2010-03-04 13:51:32 +00:00
< h3 >< ? php printf ( _ ( " Editing subdomains of %s " ), $domain ); ?> </h3>
2010-04-29 14:29:27 +00:00
< hr id = " topbar " />
2011-01-29 10:35:12 +00:00
< ? php
if ( $r [ 'dns_action' ] == 'UPDATE' ) { ?>
< p class = " error " >< ? php __ ( " This domain have some DNS change pending. Please wait. " ); ?> </p>
< ? php
} elseif ( $r [ 'dns_action' ] == 'DELETE' ) { ?>
2012-09-02 20:18:22 +00:00
< p class = " error " >< ? php printf ( _ ( " You requested deletion of domain %s. " ), $domain ); ?> </p>
2011-01-29 10:35:12 +00:00
< ? php
/*
// Link hidden as long as the del_domain_cancel function is not complete
< a href = " dom_dodel.php?domain=<?php echo urlencode( $domain );?>&del_cancel=true " >< ? php __ ( " Clic here to cancel deletion " ); ?> </a>
*/
?>
< ? php
include_once ( " foot.php " );
die ();
}
?>
2010-03-04 13:51:32 +00:00
< br />
2006-04-26 12:28:53 +00:00
<!-- *****************************************
gestion des sous - domaines
-->
2010-04-06 20:29:08 +00:00
< table class = " tlist " >
2011-03-27 15:03:42 +00:00
< tr >< th colspan = " 2 " > </ th >< th >< ? php __ ( " Subdomain " ); ?> </th><th><?php __("Type");?></th><th><?php __("Status")?></th></tr>
2006-04-26 12:28:53 +00:00
< ? php
$col = 1 ;
2011-06-04 14:28:57 +00:00
$dt = $dom -> domains_type_lst ();
2006-04-26 12:28:53 +00:00
for ( $i = 0 ; $i < $r [ " nsub " ]; $i ++ ) {
$col = 3 - $col ;
2011-06-04 14:28:57 +00:00
2006-04-26 12:28:53 +00:00
?>
< tr class = " lst<?php echo $col ; ?> " >
2011-02-01 18:03:29 +00:00
< ? php if ( $r [ 'sub' ][ $i ][ 'web_action' ] == 'DELETE' ) { echo " <td colspan=2 /> " ; } else { ?>
2009-09-08 05:29:38 +00:00
< td class = " center " >
2011-06-04 14:28:57 +00:00
< ? php if ( ! ( ! $isinvited && $dt [ strtolower ( $r [ " sub " ][ $i ][ " type " ])][ " enable " ] != " ALL " )) { ?>
2011-01-28 15:55:26 +00:00
< div class = " ina " >< a href = " dom_subedit.php?domain=<?php echo urlencode( $r["name"] ) ?>&sub=<?php echo urlencode( $r["sub"] [ $i ][ " name " ]) ?>&type=<?php echo urlencode( $r["sub"] [ $i ][ " type " ]) ?>&value=<?php echo urlencode( $r["sub"] [ $i ]['dest'])?> " >< img src = " images/edit.png " alt = " <?php __( " Edit " ); ?> " />< ? php __ ( " Edit " ); ?> </a></div>
2011-06-04 14:28:57 +00:00
< ? php } ?>
2010-04-06 20:29:08 +00:00
2010-03-04 13:51:32 +00:00
</ td >< td class = " center " >
2011-06-04 14:28:57 +00:00
< ? php if ( ! ( ! $isinvited && $dt [ strtolower ( $r [ " sub " ][ $i ][ " type " ])][ " enable " ] != " ALL " )) { ?>
2011-01-28 15:55:26 +00:00
< div class = " ina " >< a href = " dom_subdel.php?domain=<?php echo urlencode( $r["name"] ) ?>&sub=<?php echo urlencode( $r["sub"] [ $i ][ " name " ]) ?>&type=<?php echo urlencode( $r["sub"] [ $i ][ " type " ]) ?>&value=<?php echo urlencode( $r["sub"] [ $i ]['dest'])?> " >< img src = " images/delete.png " alt = " <?php __( " Delete " ); ?> " />< ? php __ ( " Delete " ); ?> </a></div>
2011-06-04 14:28:57 +00:00
< ? php } ?>
2006-04-26 12:28:53 +00:00
</ td >
2011-02-01 18:03:29 +00:00
< ? php } // end IF ==DELETE ?>
2006-04-26 12:28:53 +00:00
< td >< a href = " http://<?php ecif( $r["sub"] [ $i ][ " name " ], $r["sub"] [ $i ][ " name " ]. " . " ); echo $r["name"] ?> " target = " _blank " >< ? php ecif ( $r [ " sub " ][ $i ][ " name " ], $r [ " sub " ][ $i ][ " name " ] . " . " ); echo $r [ " name " ] ?> </a></td>
2011-03-27 13:21:09 +00:00
< td >< ? php __ ( $r [ 'sub' ][ $i ][ 'type_desc' ]); ?>
< ? php
if ( $r [ " sub " ][ $i ][ 'type' ] === 'VHOST' ) {
echo '<br /><a href="bro_main.php?R=' . urlencode ( $r [ " sub " ][ $i ][ " dest " ]) . '">' . htmlspecialchars ( $r [ " sub " ][ $i ][ " dest " ]) . '</a>' ;
} else {
if ( $r [ " sub " ][ $i ][ 'type' ]) echo " <br /> " . htmlspecialchars ( $r [ " sub " ][ $i ][ " dest " ]);
}
?> </td>
2011-01-29 17:58:19 +00:00
< td >< ? php
2011-06-06 13:12:11 +00:00
if ( ! ( ! $isinvited && $dt [ strtolower ( $r [ " sub " ][ $i ][ " type " ])][ " enable " ] != " ALL " )) {
if ( $r [ 'sub' ][ $i ][ 'web_action' ] != 'DELETE' ) {
switch ( $r [ 'sub' ][ $i ][ 'enable' ]) {
case 'ENABLED' :
__ ( " Enabled " );
2012-04-06 10:10:36 +00:00
echo " <br/><a href='dom_substatus.php?domain= " . urlencode ( $r [ " name " ]) . " &sub= " . urlencode ( $r [ " sub " ][ $i ][ " name " ]) . " &type= " . urlencode ( $r [ " sub " ][ $i ][ " type " ]) . " &value= " . urlencode ( $r [ " sub " ][ $i ][ 'dest' ]) . " &status=disable'> " ; __ ( " Disable " ); echo " </a> " ;
2011-06-06 13:12:11 +00:00
break ;
case 'ENABLE' :
__ ( " Activation pending " );
break ;
case 'DISABLED' :
__ ( " Disabled " );
echo " <br/><a href='dom_substatus.php?domain= " . urlencode ( $r [ " name " ]) . " &sub= " . urlencode ( $r [ " sub " ][ $i ][ " name " ]) . " &type= " . urlencode ( $r [ " sub " ][ $i ][ " type " ]) . " &value= " . urlencode ( $r [ " sub " ][ $i ][ 'dest' ]) . " &status=enable'> " ; __ ( " Enable " ); echo " </a> " ;
break ;
case 'DISABLE' :
__ ( " Desactivation pending " );
break ;
}
}
2011-01-29 17:58:19 +00:00
} ?> </td>
< td >< ? php
switch ( $r [ 'sub' ][ $i ][ 'web_action' ]) {
case 'UPDATE' :
__ ( " Update pending " );
break ;
case 'DELETE' :
__ ( " Deletion pending " );
break ;
case 'OK' :
default :
break ;
} ?> </td>
2006-04-26 12:28:53 +00:00
</ tr >
< ? php } ?>
</ table >
< br />
2010-03-04 13:51:32 +00:00
< hr />
2011-01-28 15:55:26 +00:00
< ? php
2011-03-27 13:21:09 +00:00
$isedit = false ;
2011-01-28 15:55:26 +00:00
require_once ( 'dom_edit.inc.php' );
sub_domains_edit ( $domain );
?>
2010-03-04 13:51:32 +00:00
< br />
2006-04-26 12:28:53 +00:00
< ? php $mem -> show_help ( " edit_domain " ); ?>
< p >& nbsp ; </ p >
<!-- *****************************************
modification des parametres dns
-->
< ? php
2011-03-06 21:28:14 +00:00
if ( ! $r [ 'noerase' ]) {
2006-04-26 12:28:53 +00:00
?>
< hr />
2011-06-04 14:28:57 +00:00
< h3 >< ? php __ ( " DNS & Email parameters " ); ?> </h3>
2010-04-29 08:31:15 +00:00
< form action = " dom_editdns.php?domain=<?php echo urlencode( $r["name"] ) ?> " method = " post " id = " fdns " name = " fdns " >
2011-06-04 14:28:57 +00:00
< table class = " tlist " >
2006-04-26 12:28:53 +00:00
< tr >
2011-06-04 14:28:57 +00:00
< td >< ? php __ ( " Manage the DNS on the server ? " ); ?> </td>
< td >
< input type = " radio " id = " yesdns " class = " inc " name = " dns " value = " 1 " < ? php cbox ( $r [ " dns " ]); ?> /> <label for="yesdns"><?php __("Yes"); ?></label>
</ td >< td >< input type = " radio " id = " nodns " class = " inc " name = " dns " value = " 0 " < ? php cbox ( ! $r [ " dns " ]); ?> /> <label for="nodns"><?php __("No"); ?></label>
</ td >
2006-04-26 12:28:53 +00:00
</ tr >
2011-06-04 14:28:57 +00:00
</ table >
2010-06-23 23:26:10 +00:00
2011-06-04 14:28:57 +00:00
< table class = " tlist " >
< tr >
< td >
< ? php __ ( " Manage the Emails Addresses of this domain on the server? " ); ?>
</ td >
< td >
< input type = " radio " id = " yesemail " class = " inc " name = " email " value = " 1 " < ? php cbox ( $r [ " mail " ]); ?> /> <label for="yesemail"><?php __("Yes"); ?></label>
</ td >< td >< input type = " radio " id = " noemail " class = " inc " name = " email " value = " 0 " < ? php cbox ( ! $r [ " mail " ]); ?> /> <label for="noemail"><?php __("No"); ?></label>
</ td >
2006-04-26 12:28:53 +00:00
</ table >
2011-06-04 14:28:57 +00:00
< div style = " padding-left: 30px; padding-bottom: 20px " class = " error " > < ? php __ ( " Warning: If you set this to 'no', all your email accounts and aliases on this domain will be immediately deleted. " ); ?> </div>
< input type = " submit " class = " inb " name = " submit " value = " <?php __( " Submit the changes " ); ?> " />
2006-04-26 12:28:53 +00:00
</ form >
2012-04-06 10:10:36 +00:00
< p >& nbsp ; </ p >
2011-06-04 14:28:57 +00:00
< hr />
< h3 >< ? php __ ( " Domain removal " ); ?> </h3>
2006-04-26 12:28:53 +00:00
< br />
< ? php printf ( _ ( " help_domain_del %s " ), $domain ); ?> <br />
< form action = " dom_dodel.php?domain=<?php echo urlencode( $domain ) ?> " method = " post " >
< p >
2010-03-04 13:51:32 +00:00
< input type = " submit " class = " inb " name = " detruire " value = " <?php printf(_( " Delete % s from this server " ), $domain ); ?> " />
2006-04-26 12:28:53 +00:00
</ p >
</ form >
2011-06-04 14:28:57 +00:00
< br />
2006-04-26 12:28:53 +00:00
< hr />
2009-09-08 05:29:38 +00:00
< ? php } // noerase ?>
< script type = " text/javascript " >
document . forms [ 'main' ] . sub . focus ();
</ script >
< ? php include_once ( " foot.php " ); ?>