Changeset 2665
- Timestamp:
- 03/04/10 17:16:13 (3 years ago)
- Location:
- alternc/trunk/bureau
- Files:
-
- 8 edited
-
admin/dom_add.php (modified) (2 diffs)
-
admin/dom_doadd.php (modified) (2 diffs)
-
admin/dom_edit.php (modified) (2 diffs)
-
admin/dom_subedit.php (modified) (4 diffs)
-
admin/styles/style.css (modified) (4 diffs)
-
class/functions.php (modified) (1 diff)
-
class/m_dom.php (modified) (4 diffs)
-
class/m_mail.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
alternc/trunk/bureau/admin/dom_add.php
r2559 r2665 36 36 ?> 37 37 <h3><?php __("Domain hosting"); ?></h3> 38 <hr /> 38 39 <?php 39 40 if (!$quota->cancreate("dom")) { ?> … … 45 46 ?> 46 47 <form method="post" action="dom_doadd.php" id="main"> 47 <table><tr><td>48 <b><label for="newdomain"><?php __("Domain name"); ?> : www.</label></b></td><td><input type="text" class="int" id="newdomain" name="newdomain" value="<?php echo $newdomain ?>" size="32" maxlength="255" />49 </td></tr><tr><td></td><td><input type="submit" class="inb" name="submit" value="<?php __("Add this domain"); ?>" /></td></tr>50 </table>51 48 <p> 52 <input type="checkbox" name="dns" class="inc" value="1" id="yndns" <?php if ($dns=="1") echo "checked=\"checked\""; ?> /><br /> 53 <label for="yndns"><?php __("host my dns here"); ?></label> 49 <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 echo $newdomain ?>" size="32" maxlength="255" /> 54 50 </p> 51 <p> 52 <input type="checkbox" name="dns" class="inc" value="1" id="yndns" <?php if ($dns=="1") echo "checked=\"checked\""; ?> /> <label for="yndns"><?php __("host my dns here"); ?></label> 53 </p> 54 <?php 55 $q = $quota->getquota("dom"); 56 if ($q["u"]>0) { 57 ?> 58 <p> 59 <?php __("Do you want to point this domain to another domain already installed in your account?"); ?> 60 <br /> 61 <input type="radio" id="newisslave0" name="newisslave" value="0" checked="checked" /><label for="newisslave0"><?php __("No: This domain will have its own folder."); ?></label> 62 <br /> 63 <input type="radio" id="newisslave1" name="newisslave" value="1" /><label for="newisslave1"><?php __("Yes, redirect this new domain to this one: "); ?></label> <select name="slavedom" id="slavedom" class="inl"> 64 <option value=""><?php __("-- Choose a domain --"); ?></option> 65 <?php 66 $dl=$dom->get_domain_list(); 67 $ddl=array(); 68 foreach($dl as $d) { 69 $ddl[$d]=$d; 70 } 71 eoption($ddl,"slavedom"); 72 ?></select> 73 <br /> 74 </p> 75 <?php } ?> 76 77 <p> 78 <input type="submit" class="inb" name="submit" value="<?php __("Add this domain"); ?>" /> 79 </p> 80 55 81 <p class="error"> 56 82 <small> -
alternc/trunk/bureau/admin/dom_doadd.php
r2559 r2665 34 34 "newdomain" => array ("post", "string", ""), 35 35 "dns" => array ("post", "string", ""), 36 "newisslave" => array ("post", "integer" ,0), 37 "slavedom" => array ("post", "string" ,0), 36 38 ); 37 39 getFields($fields); … … 39 41 $dom->lock(); 40 42 41 if (!$dom->add_domain($newdomain,$dns )) {43 if (!$dom->add_domain($newdomain,$dns,0,0,$newisslave,$slavedom)) { 42 44 $error=$err->errstr(); 43 45 include("dom_add.php"); -
alternc/trunk/bureau/admin/dom_edit.php
r2660 r2665 98 98 <input type="hidden" name="action" value="add" /> 99 99 <?php __("Create a subdomain:"); ?> 100 <input type="text" class="int" name="sub" style="text-align:right" value="" size="22" id="sub" />< code>.<?php echo $domain; ?></code></td>100 <input type="text" class="int" name="sub" style="text-align:right" value="" size="22" id="sub" /><span class="int" id="newsubname">.<?php echo $domain; ?></span></td> 101 101 </tr> 102 102 <tr> … … 106 106 <script type="text/javascript"> 107 107 <!-- 108 document.write(" <input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.sub_local');\" value=\" Choisir un répertoire...\" class=\"bff\">");108 document.write(" <input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.sub_local');\" value=\" <?php __("Choose a folder..."); ?> \" class=\"bff\">"); 109 109 // --> 110 110 </script> -
alternc/trunk/bureau/admin/dom_subedit.php
r2559 r2665 44 44 45 45 ?> 46 <h3><?php __("Editing subdomain"); ?> http://<?php ecif($sub,$sub."."); echo $domain; ?> :</h3>46 <h3><?php __("Editing subdomain"); ?> http://<?php ecif($sub,$sub."."); echo $domain; ?></h3> 47 47 <?php 48 48 if ($error) { … … 53 53 ?> 54 54 <hr /> 55 <br /> 55 56 <!-- ***************************************** 56 57 gestion du sous-domaine 57 58 --> 58 <h3><?php __("Sub-domain"); ?> http://<?php ecif($sub,$sub."."); echo $domain; ?></h3>59 59 <form action="dom_subdoedit.php" method="post" id="main" name="main"> 60 60 <table border="0"> … … 69 69 <script type="text/javascript"> 70 70 <!-- 71 document.write(" <input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.sub_local');\" value=\" ... \" class=\"inb\">");71 document.write(" <input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.sub_local');\" value=\" <?php __("Choose a folder..."); ?> \" class=\"bff\">"); 72 72 // --> 73 73 </script> … … 89 89 <td> </td> 90 90 </tr> 91 <tr>92 <td><input type="submit" class="inb" name="submit" value="<?php __("Validate this change"); ?>" /></td>93 <td><input type="button" class="inb" name="back" value="<?php __("Cancel"); ?>" onclick="history.back();" /></td>94 </tr>95 91 </table> 92 <br /> 93 <input type="submit" class="inb" name="submit" value="<?php __("Validate this change"); ?>" /> 94 <input type="button" class="inb" name="back" value="<?php __("Cancel"); ?>" onclick="history.back();" /> 96 95 </form> 97 96 <?php include_once("foot.php"); ?> -
alternc/trunk/bureau/admin/styles/style.css
r2660 r2665 96 96 background-color: #CFE3F1; 97 97 cursor: pointer; 98 margin-right: 4px; 98 99 } 99 100 .inb:hover { … … 145 146 background-color: white; 146 147 font-family: Verdana, Arial, Helvetica, sans-serif; 147 font-size: 10px; 148 padding-left: 2px; 149 padding-right: 2px; 148 font-size: 11px; 149 padding: 2px; 150 150 color: black; 151 151 } … … 214 214 #content { 215 215 display: block; 216 width: 7 40px;216 width: 730px; 217 217 padding-left: 10px; 218 padding-right: 10px; 218 219 vertical-align: top; 219 220 } … … 351 352 352 353 } 354 355 #newdomwww { 356 border-right: 0; 357 padding-right: 0; 358 } 359 #newdomain { 360 border-left: 0; 361 padding-left: 0; 362 } 363 #sub { 364 border-right: 0; 365 padding-right: 0; 366 } 367 #newsubname { 368 border-left: 0; 369 padding-left: 0; 370 } -
alternc/trunk/bureau/class/functions.php
r2623 r2665 399 399 } 400 400 401 /* select_values($arr,$cur) echo des <option> du tableau $values ou de la table sql $values 402 selectionne $current par defaut. Par defaut prends les champs 0 comme id et 1 comme 403 donnees pour la table. sinon utilise $info[0] et $info[1]. 404 */ 405 function eoption($values,$cur,$info="") { 406 if (is_array($values)) { 407 foreach ($values as $k=>$v) { 408 echo "<option value=\"$k\""; 409 if ($k==$cur) echo " selected=\"selected\""; 410 echo ">".$v."</option>"; 411 } 412 } 413 } 414 401 415 402 416 ?> -
alternc/trunk/bureau/class/m_dom.php
r2664 r2665 179 179 $ @return boolean Retourne FALSE si une erreur s'est produite, TRUE sinon. 180 180 */ 181 function add_domain($domain,$dns,$noerase=0,$force=0 ) {181 function add_domain($domain,$dns,$noerase=0,$force=0,$isslave,$slavedom) { 182 182 global $db,$err,$quota,$classes,$L_MX,$L_FQDN,$tld,$cuid,$bro; 183 183 $err->log("dom","add_domain",$domain); … … 258 258 $db->query("insert into domaines_standby (compte,domaine,mx,gesdns,gesmx,action) values ('$cuid','$domain','$L_MX','$dns','$mx',0);"); // INSERT 259 259 260 // Creation du repertoire dans www 261 $dest_root = $bro->get_userid_root($cuid); 262 $domshort=str_replace("-","",str_replace(".","",$domain)); 263 264 if (! is_dir($dest_root . "/". $domshort)) { 265 mkdir($dest_root . "/". $domshort); 266 } 267 268 // Creation des 3 sous-domaines par défaut : Vide, www et mail 269 $this->set_sub_domain($domain, '', $this->type_url, 'add', 'http://www.'.$domain); 270 $this->set_sub_domain($domain, 'www', $this->type_local, 'add', '/'. $domshort); 271 $this->set_sub_domain($domain, 'mail', $this->type_webmail, 'add', ''); 260 if ($isslave) { 261 $isslave=true; 262 $db->query("SELECT domaine FROM domaines WHERE compte='$cuid' AND domaine='$slavedom';"); 263 $db->next_record(); 264 if (!$db->Record["domaine"]) { 265 $err->raise("dom",1,$slavedom); 266 $isslave=false; 267 } 268 // Point to the master domain : 269 $this->set_sub_domain($domain, '', $this->type_url,'add', 'http://www.'.$slavedom); 270 $this->set_sub_domain($domain, 'www', $this->type_url,'add', 'http://www.'.$slavedom); 271 $this->set_sub_domain($domain, 'mail', $this->type_url,'add', 'http://mail.'.$slavedom); 272 } 273 if (!$isslave) { 274 // Creation du repertoire dans www 275 $dest_root = $bro->get_userid_root($cuid); 276 $domshort=str_replace("-","",str_replace(".","",$domain)); 277 278 if (! is_dir($dest_root . "/". $domshort)) { 279 mkdir($dest_root . "/". $domshort); 280 } 281 282 // Creation des 3 sous-domaines par défaut : Vide, www et mail 283 $this->set_sub_domain($domain, '', $this->type_url, 'add', 'http://www.'.$domain); 284 $this->set_sub_domain($domain, 'www', $this->type_local, 'add', '/'. $domshort); 285 $this->set_sub_domain($domain, 'mail', $this->type_webmail, 'add', ''); 286 } 272 287 // DEPENDANCE : 273 288 // Lancement de add_dom sur les classes domain_sensitive : 274 // Declenchons les autres classes.289 // Declenchons les autres classes. 275 290 foreach($classes as $c) { 276 291 if (method_exists($GLOBALS[$c],"alternc_add_domain")) { … … 283 298 } 284 299 } 285 return true; 300 if ($isslave) { 301 foreach($classes as $c) { 302 if (method_exists($GLOBALS[$c],"alternc_add_slave_domain")) { 303 $GLOBALS[$c]->alternc_add_slave_domain($domain,$slavedom); 304 } 305 } 306 } 307 return true; 286 308 } 287 309 … … 949 971 } 950 972 973 974 /* ----------------------------------------------------------------- */ 975 /** 976 * Returns the complete hosted domain list : 977 */ 978 function get_domain_list() { 979 global $db,$err; 980 $res=array(); 981 $db->query("SELECT domaine FROM domaines WHERE gesdns=1 ORDER BY domaine"); 982 while ($db->next_record()) { 983 $res[]=$db->f("domaine"); 984 } 985 return $res; 986 } 987 988 951 989 /* ----------------------------------------------------------------- */ 952 990 /** -
alternc/trunk/bureau/class/m_mail.php
r2621 r2665 692 692 $db->query("INSERT INTO mail_domain (mail,alias,uid) VALUES ('$dom','$dom', '$cuid');"); 693 693 $this->add_mail($dom,"postmaster",0,"",$mem->user["mail"]); 694 return true; 695 } 696 697 698 /* ----------------------------------------------------------------- */ 699 /** hook function called by AlternC when a domain is created for 700 * the current user account using the SLAVE DOMAIN feature 701 * This function create a CATCHALL to the master domain 702 * @param string $dom Domain that has just been created 703 * @param string $master Master domain 704 * @access private 705 */ 706 function alternc_add_slave_domain($dom,$slave) { 707 global $err; 708 $err->log("mail","alternc_add_slave_domain",$dom); 709 $this->add_mail($dom,"",0,"","@".$slave); 694 710 return true; 695 711 }
Note: See TracChangeset
for help on using the changeset viewer.
