Commit 6fb93dd3 authored by mcramer's avatar mcramer

Implemented (as optional!) FS#1993 - Creating Subdomains as VirtualHost

parent 1429073c
-- --------------------------------------------------------
ALTER TABLE `web_domain` ADD `web_folder` VARCHAR( 100 ) DEFAULT NULL AFTER `document_root` ;
......@@ -1648,6 +1648,7 @@ CREATE TABLE `web_domain` (
`parent_domain_id` int(11) unsigned NOT NULL default '0',
`vhost_type` varchar(32) default NULL,
`document_root` varchar(255) default NULL,
`web_folder` varchar(100) default NULL,
`system_user` varchar(255) default NULL,
`system_group` varchar(255) default NULL,
`hd_quota` bigint(20) NOT NULL default '0',
......
......@@ -148,6 +148,12 @@ $form["tabs"]['sites'] = array (
'width' => '30',
'maxlength' => '255'
),
'vhost_subdomains' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(0 => 'n',1 => 'y')
),
##################################
# ENDE Datatable fields
##################################
......@@ -252,7 +258,7 @@ $form["tabs"]['mail'] = array (
),
'smtp_pass' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'formtype' => 'PASSWORD',
'default' => '',
'value' => '',
'width' => '30',
......
......@@ -5,6 +5,8 @@ $wb['dbname_prefix_txt'] = 'Datenbanknamen Prefix';
$wb['dbuser_prefix_txt'] = 'Datenbankbenutzer Prefix';
$wb['shelluser_prefix_txt'] = 'Shellbenutzer Prefix';
$wb['ftpuser_prefix_txt'] = 'FTP Benutzer Prefix';
$wb['vhost_subdomains_txt'] = 'Subdomains als Website anlegen';
$wb['vhost_subdomains_note_txt'] = 'Diese Einstellung kann nicht geändert werden, wenn Subdomains im System vorhanden sind!';
$wb['dbname_prefix_error_regex'] = 'Zeichen nicht erlaubt in Datenbanknamen Prefix.';
$wb['dbuser_prefix_error_regex'] = 'Zeichen nicht erlaubt in Datenbankbenutzer Prefix.';
$wb['ftpuser_prefix_error_regex'] = 'Zeichen nicht erlaubt in FTP Benutzer Prefix.';
......
......@@ -9,6 +9,8 @@ $wb["dbuser_prefix_txt"] = 'Database user prefix';
$wb["shelluser_prefix_txt"] = 'Shell user prefix';
$wb["webdavuser_prefix_txt"] = 'Webdav user prefix';
$wb["ftpuser_prefix_txt"] = 'FTP user prefix';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot change this as long as subdomains exist in the system!';
$wb["dbname_prefix_error_regex"] = 'Char not allowed in database name prefix.';
$wb["dbuser_prefix_error_regex"] = 'Char not allowed in database user prefix.';
$wb["ftpuser_prefix_error_regex"] = 'Char not allowed in ftp user prefix.';
......
......@@ -85,8 +85,17 @@ class page_action extends tform_actions {
$section = $app->tform->getCurrentTab();
$server_config_array = $app->getconf->get_global_config();
$server_config_array[$section] = $app->tform->encode($this->dataRecord,$section);
$new_config = $app->tform->encode($this->dataRecord,$section);
if($section == 'sites' && $new_config['vhost_subdomains'] != $server_config_array['vhost_subdomains']) {
// check for existing subdomains
$check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_domain` WHERE `type` = 'subdomain' OR `type` = 'vhostsubdomain'");
if($check['cnt'] > 0) {
$new_config['vhost_subdomains'] = $server_config_array['vhost_subdomains'];
}
}
$server_config_array[$section] = $new_config;
$server_config_str = $app->ini_parser->get_ini_string($server_config_array);
$sql = "UPDATE sys_ini SET config = '".$app->db->quote($server_config_str)."' WHERE sysini_id = 1";
......
......@@ -39,6 +39,12 @@
<label for="webftp_url">{tmpl_var name='webftp_url_txt'}</label>
<input name="webftp_url" id="webftp_url" value="{tmpl_var name='webftp_url'}" size="30" maxlength="255" type="text" class="textInput" />
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='vhost_subdomains_txt'}</p>
<div class="multiField">
{tmpl_var name='vhost_subdomains'}&nbsp;{tmpl_var name='vhost_subdomains_note_txt'}
</div>
</div>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
......
......@@ -74,7 +74,7 @@ $form["tabs"]['folder'] = array (
'formtype' => 'SELECT',
'default' => '',
'datasource' => array ( 'type' => 'SQL',
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE (type = 'vhost' OR type = 'vhostsubdomain') AND {AUTHSQL} ORDER BY domain",
'keyfield'=> 'domain_id',
'valuefield'=> 'domain'
),
......
This diff is collapsed.
......@@ -13,6 +13,7 @@ $wb['server_id_txt'] = 'Server';
$wb['domain_txt'] = 'Domain';
$wb['type_txt'] = 'Typ';
$wb['parent_domain_id_txt'] = 'Zugehörige Website';
$wb['web_folder_error_regex'] = 'Ungültige Ordnerangabe, bitte keinen / eingeben.';
$wb['redirect_type_txt'] = 'Redirect Typ';
$wb['redirect_path_txt'] = 'Redirect Pfad';
$wb['active_txt'] = 'Aktiv';
......
<?php
$wb["parent_domain_id_txt"] = 'Website';
$wb["web_folder_txt"] = 'Basisordner';
$wb['ssl_state_txt'] = 'Bundesland';
$wb['ssl_locality_txt'] = 'Ort';
$wb['ssl_organisation_txt'] = 'Firma';
$wb['ssl_organisation_unit_txt'] = 'Abteilung';
$wb['ssl_country_txt'] = 'Land';
$wb["ssl_key_txt"] = 'SSL-Key';
$wb['ssl_request_txt'] = 'SSL-Request';
$wb['ssl_cert_txt'] = 'SSL-Zertifikat';
$wb['ssl_bundle_txt'] = 'SSL-Bundle';
$wb['ssl_action_txt'] = 'SSL-Aktion';
$wb['server_id_txt'] = 'Server';
$wb['domain_txt'] = 'Domain';
$wb['type_txt'] = 'Typ';
$wb['parent_domain_id_txt'] = 'Zugehörige Website';
$wb['web_folder_error_regex'] = 'Ungültige Ordnerangabe, bitte keinen / eingeben.';
$wb['redirect_type_txt'] = 'Redirect Typ';
$wb['redirect_path_txt'] = 'Redirect Pfad';
$wb['active_txt'] = 'Aktiv';
$wb['document_root_txt'] = 'Documentroot';
$wb['system_user_txt'] = 'Linux Benutzer';
$wb['system_group_txt'] = 'Linux Gruppe';
$wb['ip_address_txt'] = 'IP-Adresse';
$wb['vhost_type_txt'] = 'VHost Type';
$wb['hd_quota_txt'] = 'Festplatten Quota';
$wb['traffic_quota_txt'] = 'Traffic Quota';
$wb['cgi_txt'] = 'CGI';
$wb['ssi_txt'] = 'SSI';
$wb['ssl_txt'] = 'SSL';
$wb['suexec_txt'] = 'SuEXEC';
$wb['php_txt'] = 'PHP';
$wb['client_txt'] = 'Kunde';
$wb['limit_web_domain_txt'] = 'Die maximale Anzahl an Webdomains für ihr Konto wurde erreicht.';
$wb['limit_web_aliasdomain_txt'] = 'Die maximale Anzahl an Aliasdomains für ihr Konto wurde erreicht.';
$wb['limit_web_subdomain_txt'] = 'Die maximale Anzahl an Subdomains für ihr Konto wurde erreicht.';
$wb['apache_directives_txt'] = 'Apache Direktiven';
$wb['domain_error_empty'] = 'Domain ist leer.';
$wb['domain_error_unique'] = 'Domain muss eindeutig sein';
$wb['domain_error_regex'] = 'Domainname ungültig.';
$wb['hd_quota_error_empty'] = 'Harddisk Quota ist leer.';
$wb['traffic_quota_error_empty'] = 'Traffic Quota ist leer.';
$wb['errordocs_txt'] = 'Eigene Fehlerseiten';
$wb['error_ssl_state_empty'] = 'SSL-Status ist leer.';
$wb['error_ssl_locality_empty'] = 'Ort (SSL) ist leer.';
$wb['error_ssl_organisation_empty'] = 'Organisation (SSL) ist leer.';
$wb['error_ssl_organisation_unit_empty'] = 'Abteilung (SSL) ist leer.';
$wb['error_ssl_country_empty'] = 'Land (SSL) ist leer.';
$wb['subdomain_txt'] = 'Auto-Subdomain';
$wb['client_group_id_txt'] = 'Kunde';
$wb['stats_password_txt'] = 'Webstatistik Passwort';
$wb['ssl_domain_txt'] = 'SSL Domain';
$wb['allow_override_txt'] = 'Allow Override';
$wb['limit_web_quota_free_txt'] = 'Max. möglicher Festplatten Quota';
$wb['ssl_state_error_regex'] = 'Ungültige SSL State. Gültige Zeichen sind: a-z, 0-9 und .,-_';
$wb['ssl_locality_error_regex'] = 'Ungültige SSL Locality. Gülige Zeichen sind: a-z, 0-9 und .,-_';
$wb['ssl_organisation_error_regex'] = 'Ungültige SSL Organisation. Gültige Zeichen sind: a-z, 0-9 und .,-_';
$wb['ssl_organistaion_unit_error_regex'] = 'Ungültige SSL Organisation Unit. Gültige Zeichen sind: a-z, 0-9 und .,-_';
$wb['ssl_country_error_regex'] = 'Ungültiges SSL Land. Gültige Zeichen sind: A-Z';
$wb['limit_traffic_quota_free_txt'] = 'Max. möglicher Traffic Quota';
$wb['redirect_error_regex'] = 'Ungültiger redirect Pfad. Gültige Angaben sind beispielsweise: /test/ oder http://www.domain.tld/test/';
$wb['php_open_basedir_txt'] = 'PHP open_basedir';
$wb['backup_interval_txt'] = 'Backup-Intervall';
$wb['backup_copies_txt'] = 'Anzahl an Backups';
$wb['traffic_quota_exceeded_txt'] = 'Übertragungs-Volumen verbraucht.';
$wb['ruby_txt'] = 'Ruby';
$wb['stats_user_txt'] = 'Webstatistik-Benutzername';
$wb['stats_type_txt'] = 'Webstatistik-Programm';
$wb['custom_php_ini_txt'] = 'Individuelle php.ini-Einstellungen';
$wb['error_ssl_cert_empty'] = 'SSL-Zertifikat-Fels ist leer.';
$wb['none_txt'] = 'Keine';
$wb['disabled_txt'] = 'Deaktiviert';
$wb['no_redirect_txt'] = 'Kein Redirect';
$wb['no_flag_txt'] = 'Kein Flag';
$wb['save_certificate_txt'] = 'Zertifikat speichern';
$wb['create_certificate_txt'] = 'Zertifikat erstellen';
$wb['delete_certificate_txt'] = 'Zertifikat löschen';
$wb['nginx_directives_txt'] = 'nginx Direktiven';
$wb['seo_redirect_txt'] = 'SEO Redirect';
$wb['non_www_to_www_txt'] = 'Nicht-www -&gt; www';
$wb['www_to_non_www_txt'] = 'www -&gt; Nicht-www';
$wb['php_fpm_use_socket_txt'] = 'Benutze Socket für PHP-FPM';
$wb['ipv6_address_txt'] = 'IPv6-Adresse';
$wb['error_no_sni_txt'] = 'SNI für SSL ist auf diesem Server nicht aktiviert. Sie können daher nur ein SSL Zertifikat pro IP Adresse eintragen.';
$wb['python_txt'] = 'Python';
$wb['perl_txt'] = 'Perl';
$wb['pm_max_children_txt'] = 'PHP-FPM pm.max_children';
$wb['pm_start_servers_txt'] = 'PHP-FPM pm.start_servers';
$wb['pm_min_spare_servers_txt'] = 'PHP-FPM pm.min_spare_servers';
$wb['pm_max_spare_servers_txt'] = 'PHP-FPM pm.max_spare_servers';
$wb['error_php_fpm_pm_settings_txt'] = 'Die Werte der PHP-FPM pm Einstellungen müssen wie folgt sein: pm.max_children &gt;= pm.max_spare_servers &gt;= pm.start_servers &gt;= pm.min_spare_servers &gt; 0';
$wb['pm_max_children_error_regex'] = 'PHP-FPM pm.max_children mu&szlig; eine positive ganze Zahl sein.';
$wb['pm_start_servers_error_regex'] = 'PHP-FPM pm.start_servers mu&szlig; eine positive ganze Zahl sein.';
$wb['pm_min_spare_servers_error_regex'] = 'PHP-FPM pm.min_spare_servers mu&szlig; eine positive ganze Zahl sein.';
$wb['pm_max_spare_servers_error_regex'] = 'PHP-FPM pm.max_spare_servers mu&szlig; eine positive ganze Zahl sein.';
$wb['hd_quota_error_regex'] = 'Harddisk Quota ist ungültig.';
$wb['traffic_quota_error_regex'] = 'Traffic Quota ist ungültig.';
$wb["fastcgi_php_version_txt"] = 'PHP-Version';
$wb["pm_txt"] = 'PHP-FPM Prozess Manager';
$wb["pm_process_idle_timeout_txt"] = 'PHP-FPM pm.process_idle_timeout';
$wb["pm_max_requests_txt"] = 'PHP-FPM pm.max_requests';
$wb["pm_process_idle_timeout_error_regex"] = 'PHP-FPM pm.process_idle_timeout mu&szlig; eine positive ganze Zahl sein.';
$wb["pm_max_requests_error_regex"] = 'PHP-FPM pm.max_requests mu&szlig; eine ganze Zahl >= 0 sein.';
$wb["pm_ondemand_hint_txt"] = 'Bitte beachten Sie, daß Ihre PHP-Version >= 5.3.9 sein muß, wenn Sie den ondemand Process-Manager nutzen möchten. Wenn Sie ondemand für eine ältere PHP-Version auswählen, wird PHP nicht mehr starten!';
$wb['generate_password_txt'] = 'Passwort erzeugen';
$wb['repeat_password_txt'] = 'Passwort wiederholen';
$wb['password_mismatch_txt'] = 'Die Passwörter stimmen nicht überein.';
$wb['password_match_txt'] = 'Die Passwörter stimmen überein.';
?>
<?php
$wb['list_head_txt'] = 'Subdomains';
$wb['active_txt'] = 'Aktiv';
$wb['server_id_txt'] = 'Server';
$wb['parent_domain_id_txt'] = 'Website';
$wb['domain_txt'] = 'Subdomain';
$wb['add_new_record_txt'] = 'Neue Subdomain hinzufügen';
?>
......@@ -14,6 +14,7 @@ $wb["ssl_action_txt"] = 'SSL Action';
$wb["ssl_domain_txt"] = 'SSL Domain';
$wb["server_id_txt"] = 'Server';
$wb["domain_txt"] = 'Domain';
$wb['web_folder_error_regex'] = 'Invalid folder entered. Please do not enter a slash.';
$wb["type_txt"] = 'Type';
$wb["parent_domain_id_txt"] = 'Parent Website';
$wb["redirect_type_txt"] = 'Redirect Type';
......
<?php
$wb["parent_domain_id_txt"] = 'Parent Website';
$wb["web_folder_txt"] = 'Web folder';
$wb["backup_interval_txt"] = 'Backup interval';
$wb["backup_copies_txt"] = 'Number of backup copies';
$wb["ssl_state_txt"] = 'State';
$wb["ssl_locality_txt"] = 'Locality';
$wb["ssl_organisation_txt"] = 'Organisation';
$wb["ssl_organisation_unit_txt"] = 'Organisation Unit';
$wb["ssl_country_txt"] = 'Country';
$wb["ssl_key_txt"] = 'SSL Key';
$wb["ssl_request_txt"] = 'SSL Request';
$wb["ssl_cert_txt"] = 'SSL Certificate';
$wb["ssl_bundle_txt"] = 'SSL Bundle';
$wb["ssl_action_txt"] = 'SSL Action';
$wb["ssl_domain_txt"] = 'SSL Domain';
$wb["server_id_txt"] = 'Server';
$wb["domain_txt"] = 'Domain';
$wb['web_folder_error_regex'] = 'Invalid folder entered. Please do not enter a slash.';
$wb["type_txt"] = 'Type';
$wb["parent_domain_id_txt"] = 'Parent Website';
$wb["redirect_type_txt"] = 'Redirect Type';
$wb["redirect_path_txt"] = 'Redirect Path';
$wb["active_txt"] = 'Active';
$wb["document_root_txt"] = 'Documentroot';
$wb["system_user_txt"] = 'Linux User';
$wb["system_group_txt"] = 'Linux Group';
$wb["ip_address_txt"] = 'IPv4-Address';
$wb["ipv6_address_txt"] = 'IPv6-Address';
$wb["vhost_type_txt"] = 'VHost Type';
$wb["hd_quota_txt"] = 'Harddisk Quota';
$wb["traffic_quota_txt"] = 'Traffic Quota';
$wb["cgi_txt"] = 'CGI';
$wb["ssi_txt"] = 'SSI';
$wb["errordocs_txt"] = 'Own Error-Documents';
$wb["subdomain_txt"] = 'Auto-Subdomain';
$wb["ssl_txt"] = 'SSL';
$wb["suexec_txt"] = 'SuEXEC';
$wb["php_txt"] = 'PHP';
$wb["client_txt"] = 'Client';
$wb["limit_web_domain_txt"] = 'The max. number of web domains for your account is reached.';
$wb["limit_web_aliasdomain_txt"] = 'The max. number of aliasdomains for your account is reached.';
$wb["limit_web_subdomain_txt"] = 'The max. number of web subdomains for your account is reached.';
$wb["apache_directives_txt"] = 'Apache Directives';
$wb["domain_error_empty"] = 'Domain is empty.';
$wb["domain_error_unique"] = 'There is already a website or sub / aliasdomain with this domain name.';
$wb["domain_error_regex"] = 'Domain name invalid.';
$wb["hd_quota_error_empty"] = 'Harddisk quota is 0 or empty.';
$wb["traffic_quota_error_empty"] = 'Traffic quota is empty.';
$wb["error_ssl_state_empty"] = 'SSL State is empty.';
$wb["error_ssl_locality_empty"] = 'SSL Locality is empty.';
$wb["error_ssl_organisation_empty"] = 'SSL Organisation is empty.';
$wb["error_ssl_organisation_unit_empty"] = 'SSL Organisation Unit is empty.';
$wb["error_ssl_country_empty"] = 'SSL Country is empty.';
$wb["error_ssl_cert_empty"] = 'SSL Certificate field is empty';
$wb["client_group_id_txt"] = 'Client';
$wb["stats_password_txt"] = 'Webstatistics password';
$wb["allow_override_txt"] = 'Apache AllowOverride';
$wb["limit_web_quota_free_txt"] = 'Max. available Harddisk Quota';
$wb["ssl_state_error_regex"] = 'Invalid SSL State. Valid characters are: a-z, 0-9 and .,-_';
$wb["ssl_locality_error_regex"] = 'Invalid SSL Locality. Valid characters are: a-z, 0-9 and .,-_';
$wb["ssl_organisation_error_regex"] = 'Invalid SSL Organisation. Valid characters are: a-z, 0-9 and .,-_';
$wb["ssl_organistaion_unit_error_regex"] = 'Invalid SSL Organisation Unit. Valid characters are: a-z, 0-9 and .,-_';
$wb["ssl_country_error_regex"] = 'Invalid SSL Country. Valid characters are: A-Z';
$wb["limit_traffic_quota_free_txt"] = 'Max. available Traffic Quota';
$wb["redirect_error_regex"] = 'Invalid redirect path. Valid redirects are for example: /test/ or http://www.domain.tld/test/';
$wb["php_open_basedir_txt"] = 'PHP open_basedir';
$wb["traffic_quota_exceeded_txt"] = 'Traffic quota exceeded';
$wb["ruby_txt"] = 'Ruby';
$wb["stats_user_txt"] = 'Webstatistics username';
$wb["stats_type_txt"] = 'Webstatistics program';
$wb["custom_php_ini_txt"] = 'Custom php.ini settings';
$wb['none_txt'] = 'None';
$wb['disabled_txt'] = 'Disabled';
$wb['no_redirect_txt'] = 'No redirect';
$wb['no_flag_txt'] = 'No flag';
$wb['save_certificate_txt'] = 'Save certificate';
$wb['create_certificate_txt'] = 'Create certificate';
$wb['delete_certificate_txt'] = 'Delete certificate';
$wb["nginx_directives_txt"] = 'nginx Directives';
$wb["seo_redirect_txt"] = 'SEO Redirect';
$wb["non_www_to_www_txt"] = 'Non-www -&gt; www';
$wb["www_to_non_www_txt"] = 'www -&gt; non-www';
$wb["php_fpm_use_socket_txt"] = 'Use Socket For PHP-FPM';
$wb["error_no_sni_txt"] = 'SNI for SSL is not activated on this server. You can enable only one SSL certificate on each IP address.';
$wb["python_txt"] = 'Python';
$wb["perl_txt"] = 'Perl';
$wb["pm_max_children_txt"] = 'PHP-FPM pm.max_children';
$wb["pm_start_servers_txt"] = 'PHP-FPM pm.start_servers';
$wb["pm_min_spare_servers_txt"] = 'PHP-FPM pm.min_spare_servers';
$wb["pm_max_spare_servers_txt"] = 'PHP-FPM pm.max_spare_servers';
$wb["error_php_fpm_pm_settings_txt"] = 'Values of PHP-FPM pm settings must be as follows: pm.max_children &gt;= pm.max_spare_servers &gt;= pm.start_servers &gt;= pm.min_spare_servers &gt; 0';
$wb["pm_max_children_error_regex"] = 'PHP-FPM pm.max_children must be a positive integer value.';
$wb["pm_start_servers_error_regex"] = 'PHP-FPM pm.start_servers must be a positive integer value.';
$wb["pm_min_spare_servers_error_regex"] = 'PHP-FPM pm.min_spare_servers must be a positive integer value.';
$wb["pm_max_spare_servers_error_regex"] = 'PHP-FPM pm.max_spare_servers must be a positive integer value.';
$wb["hd_quota_error_regex"] = 'Harddisk quota is invalid.';
$wb["traffic_quota_error_regex"] = 'Traffic quota is invalid.';
$wb["fastcgi_php_version_txt"] = 'PHP Version';
$wb["pm_txt"] = 'PHP-FPM Process Manager';
$wb["pm_process_idle_timeout_txt"] = 'PHP-FPM pm.process_idle_timeout';
$wb["pm_max_requests_txt"] = 'PHP-FPM pm.max_requests';
$wb["pm_process_idle_timeout_error_regex"] = 'PHP-FPM pm.process_idle_timeout must be a positive integer value.';
$wb["pm_max_requests_error_regex"] = 'PHP-FPM pm.max_requests must be an integer value >= 0.';
$wb["pm_ondemand_hint_txt"] = 'Please note that you must have PHP version >= 5.3.9 in order to use the ondemand process manager. If you select ondemand for an older PHP version, PHP will not start anymore!';
$wb['generate_password_txt'] = 'Generate Password';
$wb['repeat_password_txt'] = 'Repeat Password';
$wb['password_mismatch_txt'] = 'The passwords do not match.';
$wb['password_match_txt'] = 'The passwords do match.';
?>
\ No newline at end of file
<?php
$wb["list_head_txt"] = 'Subdomains';
$wb["active_txt"] = 'Active';
$wb["server_id_txt"] = 'Server';
$wb["parent_domain_id_txt"] = 'Website';
$wb["domain_txt"] = 'Subdomain';
$wb["add_new_record_txt"] = 'Add new subdomain';
?>
\ No newline at end of file
......@@ -21,9 +21,12 @@ $items[] = array( 'title' => "Website",
if($app->auth->get_client_limit($userid,'web_subdomain') != 0)
{
// read web config
$app->uses('getconf');
$sys_config = $app->getconf->get_global_config('sites');
$items[] = array( 'title' => "Subdomain",
'target' => 'content',
'link' => 'sites/web_subdomain_list.php',
'link' => 'sites/' . ($sys_config['vhost_subdomains'] == 'y' ? 'web_vhost_subdomain_list.php' : 'web_subdomain_list.php'),
'html_id' => 'subdomain_list');
}
......
......@@ -79,7 +79,7 @@ $liste["item"][] = array( 'field' => "parent_domain_id",
'prefix' => "",
'suffix' => "",
'datasource' => array ( 'type' => 'SQL',
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE (type = 'vhost' OR type = 'vhostsubdomain') AND {AUTHSQL} ORDER BY domain",
'keyfield'=> 'domain_id',
'valuefield'=> 'domain'
),
......
<?php
/*
Datatypes:
- INTEGER
- DOUBLE
- CURRENCY
- VARCHAR
- TEXT
- DATE
*/
// Name of the list
$liste["name"] = "web_vhost_subdomain";
// Database table
$liste["table"] = "web_domain";
// Index index field of the database table
$liste["table_idx"] = "domain_id";
// Search Field Prefix
$liste["search_prefix"] = "search_";
// Records per page
$liste["records_per_page"] = "15";
// Script File of the list
$liste["file"] = "web_vhost_subdomain_list.php";
// Script file of the edit form
$liste["edit_file"] = "web_vhost_subdomain_edit.php";
// Script File of the delete script
$liste["delete_file"] = "web_vhost_subdomain_del.php";
// Paging Template
$liste["paging_tpl"] = "templates/paging.tpl.htm";
// Enable auth
$liste["auth"] = "yes";
/*****************************************************
* Suchfelder
*****************************************************/
$liste["item"][] = array( 'field' => "active",
'datatype' => "VARCHAR",
'formtype' => "SELECT",
'op' => "=",
'prefix' => "",
'suffix' => "",
'width' => "",
'value' => array('y' => "<div id=\"ir-Yes\" class=\"swap\"><span>Yes</span></div>",'n' => "<div class=\"swap\" id=\"ir-No\"><span>No</span></div>"));
$liste["item"][] = array( 'field' => "server_id",
'datatype' => "VARCHAR",
'formtype' => "SELECT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'datasource' => array ( 'type' => 'SQL',
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
'keyfield'=> 'server_id',
'valuefield'=> 'server_name'
),
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "parent_domain_id",
'datatype' => "VARCHAR",
'formtype' => "SELECT",
'op' => "=",
'prefix' => "",
'suffix' => "",
'datasource' => array ( 'type' => 'SQL',
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
'keyfield'=> 'domain_id',
'valuefield'=> 'domain'
),
'width' => "",
'value' => "");
$liste["item"][] = array( 'field' => "domain",
'datatype' => "VARCHAR",
'formtype' => "TEXT",
'op' => "like",
'prefix' => "%",
'suffix' => "%",
'width' => "",
'value' => "");
?>
\ No newline at end of file
<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_web_domain">
<div class="pnl_formsarea">
<fieldset class="inlineLabels">
<div class="ctrlHolder">
<label for="domain">{tmpl_var name='host_txt'}</label>
<input name="domain" id="domain" value="{tmpl_var name='domain'}" size="30" maxlength="255" type="text" class="textInput formLengthHalf" />
</div>
<div class="ctrlHolder">
<label for="parent_domain_id">{tmpl_var name='domain_txt'}</label>
<select id="parent_domain_id" name="parent_domain_id" class="selectInput formLengthHalf">{tmpl_var name='parent_domain_id'}</select>
</div>
<div class="ctrlHolder">
<label for="web_folder">{tmpl_var name='web_folder_txt'}</label>
<input name="web_folder" id="web_folder" value="{tmpl_var name='web_folder'}" size="30" maxlength="100" type="text" class="textInput formLengthHalf" />
</div>
<div class="ctrlHolder">
<label for="hd_quota">{tmpl_var name='hd_quota_txt'}</label>
<input name="hd_quota" id="hd_quota" value="{tmpl_var name='hd_quota'}" size="7" maxlength="7" type="text" class="textInput formLengthLimit" />&nbsp;MB
</div>
<div class="ctrlHolder">
<label for="traffic_quota">{tmpl_var name='traffic_quota_txt'}</label>
<input name="traffic_quota" id="traffic_quota" value="{tmpl_var name='traffic_quota'}" size="7" maxlength="7" type="text" class="textInput formLengthLimit" />&nbsp;MB <tmpl_var name='traffic_quota_exceeded_txt'>
</div>
<tmpl_if name="limit_cgi" op="==" value="y"><div class="ctrlHolder">
<p class="label">{tmpl_var name='cgi_txt'}</p>
<div class="multiField">
{tmpl_var name='cgi'}
</div>
</div></tmpl_if>
<tmpl_if name="limit_ssi" op="==" value="y"><div class="ctrlHolder">
<p class="label">{tmpl_var name='ssi_txt'}</p>
<div class="multiField">
{tmpl_var name='ssi'}
</div>
</div></tmpl_if>
<tmpl_if name="limit_perl" op="==" value="y"><div class="ctrlHolder apache">
<p class="label">{tmpl_var name='perl_txt'}</p>
<div class="multiField">
{tmpl_var name='perl'}
</div>
</div></tmpl_if>
<tmpl_if name="limit_ruby" op="==" value="y"><div class="ctrlHolder apache">
<p class="label">{tmpl_var name='ruby_txt'}</p>
<div class="multiField">
{tmpl_var name='ruby'}
</div>
</div></tmpl_if>
<tmpl_if name="limit_python" op="==" value="y"><div class="ctrlHolder apache">
<p class="label">{tmpl_var name='python_txt'}</p>
<div class="multiField">
{tmpl_var name='python'}
</div>
</div></tmpl_if>
<tmpl_if name="force_suexec" op="==" value="n"><div class="ctrlHolder apache">
<p class="label">{tmpl_var name='suexec_txt'}</p>
<div class="multiField">
{tmpl_var name='suexec'}
</div>
</div></tmpl_if>
<tmpl_if name="limit_hterror" op="==" value="y"><div class="ctrlHolder">
<p class="label">{tmpl_var name='errordocs_txt'}</p>
<div class="multiField">
{tmpl_var name='errordocs'}
</div>
</div></tmpl_if>
<div class="ctrlHolder">
<label for="subdomain">{tmpl_var name='subdomain_txt'}</label>
<select name="subdomain" id="subdomain" class="selectInput formLengthHalf">
{tmpl_var name='subdomain'}
</select>
</div>
<tmpl_if name="limit_ssl" op="==" value="y"><div class="ctrlHolder">
<p class="label">{tmpl_var name='ssl_txt'}</p>
<div class="multiField">
{tmpl_var name='ssl'}
</div>
</div></tmpl_if>
<div class="ctrlHolder">
<label for="php">{tmpl_var name='php_txt'}</label>
<select name="php" id="php" class="selectInput formLengthHalf">
{tmpl_var name='php'}
</select>
</div>
<div class="ctrlHolder fastcgi_php_version">
<label for="fastcgi_php_version">{tmpl_var name='fastcgi_php_version_txt'}</label>
<select name="fastcgi_php_version" id="fastcgi_php_version" class="selectInput formLengthHalf">
{tmpl_var name='fastcgi_php_version'}
</select>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='active_txt'}</p>
<div class="multiField">
{tmpl_var name='active'}
</div>
</div>
</fieldset>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="buttonHolder buttons">
<button id="dom-edit-submit" class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}"><span>{tmpl_var name='btn_save_txt'}</span></button>
<button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_vhost_subdomain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
</div>
</div>
</div>
<script language="JavaScript" type="text/javascript">
var serverId;
var clientGroupId = jQuery('#client_group_id').val();
var serverIdDisabled = jQuery('#server_id_disabled').val();
if(serverIdDisabled > 0){
serverId = serverIdDisabled;
} else {
serverId = jQuery('#server_id').val();
jQuery('#server_id').change(function(){
serverId = $(this).val();
adjustForm();
reloadWebIP();
reloadFastcgiPHPVersions();
});
}
adjustForm();
reloadFastcgiPHPVersions();
jQuery('#client_group_id').change(function(){
clientGroupId = $(this).val();
reloadWebIP();
});
if(jQuery('#php').val() == 'fast-cgi' || jQuery('#php').val() == 'php-fpm'){
jQuery('.fastcgi_php_version:hidden').show();
} else {
jQuery('.fastcgi_php_version:visible').hide();
}
jQuery('#php').change(function(){
reloadFastcgiPHPVersions();
if(jQuery(this).val() == 'fast-cgi' || jQuery(this).val() == 'php-fpm'){
jQuery('.fastcgi_php_version:hidden').show();
} else {
jQuery('.fastcgi_php_version:visible').hide();
}