2006-04-26 12:28:53 +00:00
< ? php
/*
$Id : dom_add . php , v 1.5 2003 / 06 / 10 13 : 16 : 11 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 : Benjamin Sonntag
Purpose of file : Add a new domain
----------------------------------------------------------------------
*/
require_once ( " ../class/config.php " );
2009-09-08 05:29:38 +00:00
include_once ( " head.php " );
2010-04-28 19:28:36 +00:00
$fields = array (
2016-05-23 13:03:13 +00:00
" newdomain " => array ( " post " , " string " , " " ),
" yndns " => array ( " post " , " integer " , 0 ),
" newisslave " => array ( " post " , " integer " , 0 ),
" slavedom " => array ( " post " , " string " , " " ),
2010-04-28 19:28:36 +00:00
);
getFields ( $fields );
2009-09-08 05:29:38 +00:00
if ( ! isset ( $dns )) $dns = " 1 " ;
2006-04-26 12:28:53 +00:00
?>
< h3 >< ? php __ ( " Domain hosting " ); ?> </h3>
2010-03-04 16:16:13 +00:00
< hr />
2006-04-26 12:28:53 +00:00
< ? php
2017-08-16 00:23:22 +00:00
if ( ! $quota -> cancreate ( " dom " )) {
$msg -> raise ( 'Alert' , " dom " , _ ( " You cannot add any new domain, your quota is over. " ) . " " . _ ( " Contact your administrator for more information. " ));
echo $msg -> msg_html_all ();
exit ();
2006-04-26 12:28:53 +00:00
}
2017-08-16 00:23:22 +00:00
echo $msg -> msg_html_all ();
2006-04-26 12:28:53 +00:00
?>
< form method = " post " action = " dom_doadd.php " id = " main " >
2016-05-20 12:21:47 +00:00
< ? php csrf_get (); ?>
2006-04-26 12:28:53 +00:00
< p >
2013-09-20 15:13:47 +00:00
< label for = " newdomain " >< b >< ? php __ ( " Domain name " ); ?> :</b></label> <span class="int" id="newdomwww">www.</span><input type="text" class="int" id="newdomain" name="newdomain" value="<?php ehe($newdomain); ?>" size="32" maxlength="255" /> <a class="inb configure" href="dom_import.php"><?php __("Advanced import"); ?></a>
2006-04-26 12:28:53 +00:00
</ p >
2010-03-04 16:16:13 +00:00
< p >
2010-04-29 10:07:15 +00:00
< input type = " checkbox " name = " dns " class = " inc " value = " 1 " id = " yndns " < ? php cbox ( $dns == " 1 " ); ?> /> <label for="yndns"><?php __("host my dns here"); ?></label>
2010-03-04 16:16:13 +00:00
</ p >
< ? php
$q = $quota -> getquota ( " dom " );
2016-01-14 17:07:34 +00:00
$dl = $dom -> get_domain_list ( $cuid );
if ( $q [ " u " ] > 0 && count ( $dl )) {
2010-03-04 16:16:13 +00:00
?>
2013-01-23 13:34:01 +00:00
< fieldset >
< legend >
2010-03-04 16:16:13 +00:00
< ? php __ ( " Do you want to point this domain to another domain already installed in your account? " ); ?>
2013-01-23 13:34:01 +00:00
</ legend >
2010-04-29 10:07:15 +00:00
< input type = " radio " id = " newisslave0 " name = " newisslave " value = " 0 " < ? php cbox ( $newisslave == 0 ); ?> /><label for="newisslave0"><?php __("No: This domain will have its own folder."); ?></label>
2010-03-04 16:16:13 +00:00
< br />
2010-04-29 10:07:15 +00:00
< input type = " radio " id = " newisslave1 " name = " newisslave " value = " 1 " < ? php cbox ( $newisslave == 1 ); ?> /><label for="newisslave1"><?php __("Yes, redirect this new domain to this one:"); ?> </label> <select name="slavedom" id="slavedom" class="inl">
2010-03-04 16:16:13 +00:00
< ? php
$ddl = array ();
foreach ( $dl as $d ) {
$ddl [ $d ] = $d ;
}
eoption ( $ddl , " slavedom " );
?> </select>
2013-01-23 13:34:01 +00:00
</ fieldset >
2010-03-04 16:16:13 +00:00
< ? php } ?>
< p >
2013-04-25 16:06:50 +00:00
< input type = " submit " class = " inb ok " name = " submit " value = " <?php __( " Add this domain " ); ?> " />
2010-03-04 16:16:13 +00:00
</ p >
2013-10-18 09:12:41 +00:00
< p class = " alert alert-info " >
2013-02-04 08:16:29 +00:00
< ? php __ ( " If you don't want to host in our server the DNS of your domain, don't check the box 'host my dns here'. If you don't know what it mean, leave it checked. " ); ?> </p>
2006-04-26 12:28:53 +00:00
< ? php $mem -> show_help ( " add_domain " ); ?>
</ form >
< ? php
if ( is_array ( $dom -> dns )) {
echo " <br /> " . _ ( " Whois result on the domain " ) . " : <pre> " ;
reset ( $dom -> dns );
while ( list ( $key , $val ) = each ( $dom -> dns )) {
echo " nameserver: $val\n " ;
}
echo " </pre> " ;
}
?>
2009-09-08 05:29:38 +00:00
< script type = " text/javascript " >
document . forms [ 'main' ] . newdomain . focus ();
</ script >
< ? php include_once ( " foot.php " ); ?>