Implemented FS#2382 - automatically add alias domain when creating a domain
| | |
| | | 'default' => 'n', |
| | | 'value' => array(0 => 'n',1 => 'y') |
| | | ), |
| | | 'website_autoalias' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'default' => '', |
| | | 'value' => '', |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'vhost_conf_dir' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | |
| | | $wb['nameservers_txt'] = 'Nameserver'; |
| | | $wb['auto_network_configuration_txt'] = 'Netzwerkkonfiguration'; |
| | | $wb['website_basedir_txt'] = 'Website basedir'; |
| | | $wb["website_autoalias_txt"] = 'Website Autoalias'; |
| | | $wb["website_autoalias_note_txt"] = 'Platzhalter: [client_id], [client_username], [website_id], [website_domain]'; |
| | | $wb['ip_address_error_wrong'] = 'Ungültiges IP-Adressen-Format.'; |
| | | $wb['netmask_error_wrong'] = 'Ungültiges Netzmasken-Format.'; |
| | | $wb['gateway_error_wrong'] = 'Ungültiges Gateway-Format.'; |
| | |
| | | $wb["website_symlinks_txt"] = 'Website symlinks'; |
| | | $wb['website_symlinks_rel_txt'] = 'Make relative symlinks'; |
| | | $wb["website_basedir_txt"] = 'Website basedir'; |
| | | $wb["website_autoalias_txt"] = 'Website auto alias'; |
| | | $wb["website_autoalias_note_txt"] = 'Placeholders: [client_id], [client_username], [website_id], [website_domain]'; |
| | | $wb["vhost_conf_dir_txt"] = 'Vhost config dir'; |
| | | $wb["vhost_conf_enabled_dir_txt"] = 'Vhost config enabled dir'; |
| | | $wb["getmail_config_dir_txt"] = 'Getmail config dir'; |
| | |
| | | {tmpl_var name='website_symlinks_rel'} |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <label for="website_autoalias">{tmpl_var name='website_autoalias_txt'}</label> |
| | | <input name="website_autoalias" id="website_autoalias" value="{tmpl_var name='website_autoalias'}" size="40" maxlength="255" type="text" class="textInput" /> {tmpl_var name='website_autoalias_note_txt'} |
| | | </div> |
| | | <div class="ctrlHolder apache"> |
| | | <label for="vhost_conf_dir">{tmpl_var name='vhost_conf_dir_txt'}</label> |
| | | <input name="vhost_conf_dir" id="vhost_conf_dir" value="{tmpl_var name='vhost_conf_dir'}" size="40" maxlength="255" type="text" class="textInput" /> |
| | |
| | | 'rewrite_target_ssl' => $rewrite_target_ssl); |
| | | } |
| | | } |
| | | |
| | | |
| | | $server_alias = array(); |
| | | |
| | | // get autoalias |
| | | $auto_alias = $web_config['website_autoalias']; |
| | | if($auto_alias != '') { |
| | | // get the client username |
| | | $client = $app->db->queryOneRecord("SELECT `username` FROM `client` WHERE `client_id` = '" . intval($client_id) . "'"); |
| | | $aa_search = array('[client_id]', '[website_id]', '[client_username]', '[website_domain]'); |
| | | $aa_replace = array($client_id, $data['new']['domain_id'], $client['username'], $data['new']['domain']); |
| | | $auto_alias = str_replace($aa_search, $aa_replace, $auto_alias); |
| | | unset($client); |
| | | unset($aa_search); |
| | | unset($aa_replace); |
| | | $server_alias[] .= $auto_alias; |
| | | } |
| | | |
| | | // get alias domains (co-domains and subdomains) |
| | | $aliases = $app->db->queryAllRecords('SELECT * FROM web_domain WHERE parent_domain_id = '.$data['new']['domain_id']." AND active = 'y'"); |
| | | $server_alias = array(); |
| | | switch($data['new']['subdomain']) { |
| | | case 'www': |
| | | $server_alias[] .= 'www.'.$data['new']['domain'].' '; |
| | |
| | | 'rewrite_exclude' => $rewrite_exclude); |
| | | } |
| | | } |
| | | |
| | | |
| | | $server_alias = array(); |
| | | |
| | | // get autoalias |
| | | $auto_alias = $web_config['website_autoalias']; |
| | | if($auto_alias != '') { |
| | | // get the client username |
| | | $client = $app->db->queryOneRecord("SELECT `username` FROM `client` WHERE `client_id` = '" . intval($client_id) . "'"); |
| | | $aa_search = array('[client_id]', '[website_id]', '[client_username]', '[website_domain]'); |
| | | $aa_replace = array($client_id, $data['new']['domain_id'], $client['username'], $data['new']['domain']); |
| | | $auto_alias = str_replace($aa_search, $aa_replace, $auto_alias); |
| | | unset($client); |
| | | unset($aa_search); |
| | | unset($aa_replace); |
| | | $server_alias[] .= $auto_alias; |
| | | } |
| | | |
| | | // get alias domains (co-domains and subdomains) |
| | | $aliases = $app->db->queryAllRecords('SELECT * FROM web_domain WHERE parent_domain_id = '.$data['new']['domain_id']." AND active = 'y'"); |
| | | $server_alias = array(); |
| | | switch($data['new']['subdomain']) { |
| | | case 'www': |
| | | $server_alias[] = 'www.'.$data['new']['domain'].' '; |