ergo: on ne cree plus les dossiers stats et backups, inutiles, et on pointe les nouveaux domaines dans <nom court sans - ni . du domaine>

This commit is contained in:
Benjamin Sonntag 2010-03-04 15:10:05 +00:00
parent 20a7bb01c4
commit 929f1808ba
2 changed files with 6 additions and 12 deletions

View File

@ -179,7 +179,7 @@ class m_dom {
$ @return boolean Retourne FALSE si une erreur s'est produite, TRUE sinon.
*/
function add_domain($domain,$dns,$noerase=0,$force=0) {
global $db,$err,$quota,$classes,$L_MX,$L_FQDN,$tld,$cuid;
global $db,$err,$quota,$classes,$L_MX,$L_FQDN,$tld,$cuid,$bro;
$err->log("dom","add_domain",$domain);
$mx="1";
// Locked ?
@ -258,22 +258,16 @@ class m_dom {
$db->query("insert into domaines_standby (compte,domaine,mx,gesdns,gesmx,action) values ('$cuid','$domain','$L_MX','$dns','$mx',0);"); // INSERT
// Creation du repertoire dans www
global $bro;
$dest_root = $bro->get_userid_root($cuid);
$dest_www = $dest_root . '/www';
$dest_www_domain = $dest_www . '/' . $domain;
$domshort=str_replace("-","",str_replace(".","",$domain));
if (! is_dir($dest_www)) {
mkdir($dest_www);
}
if (! is_dir($dest_www_domain)) {
mkdir($dest_www_domain);
if (! is_dir($dest_root . "/". $domshort)) {
mkdir($dest_root . "/". $domshort);
}
// Creation des 3 sous-domaines par défaut : Vide, www et mail
$this->set_sub_domain($domain, '', $this->type_url, 'add', 'http://www.'.$domain);
$this->set_sub_domain($domain, 'www', $this->type_local, 'add', '/www/' . $domain);
$this->set_sub_domain($domain, 'www', $this->type_local, 'add', '/'. $domshort);
$this->set_sub_domain($domain, 'mail', $this->type_webmail, 'add', '');
// DEPENDANCE :
// Lancement de add_dom sur les classes domain_sensitive :

View File

@ -27,7 +27,7 @@ $( = $);
my $PTH="/var/alternc/html/".substr($name,0,1)."/".$name;
my @create_paths = ($PTH, $PTH . '/www', $PTH . '/stats', $PTH . '/backups');
my @create_paths = ($PTH);
for my $p (@create_paths) {
mkdir($p);