Commit 511ba5d0 authored by Dominik's avatar Dominik

New Feature VHost-Alias (FS#3296)

Completly same functionality as VHost-Subdomain, not to disable if already existing vhostalias-somains in system.
parent 681d3f59
......@@ -450,6 +450,75 @@ class remoting_sites extends remoting {
// ----------------------------------------------------------------------------------------------------------
//* Get record details
public function sites_web_vhost_aliasdomain_get($session_id, $primary_id)
{
global $app;
if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_get')) {
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$app->uses('remoting_lib');
$app->remoting_lib->loadFormDef('../sites/form/web_vhost_aliasdomain.tform.php');
return $app->remoting_lib->getDataRecord($primary_id);
}
//* Add a record
public function sites_web_vhost_aliasdomain_add($session_id, $client_id, $params)
{
global $app;
if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_add')) {
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
//* Set a few params to "not empty" values which get overwritten by the sites_web_domain_plugin
if($params['document_root'] == '') $params['document_root'] = '-';
if($params['system_user'] == '') $params['system_user'] = '-';
if($params['system_group'] == '') $params['system_group'] = '-';
//* Set a few defaults for nginx servers
if($params['pm_max_children'] == '') $params['pm_max_children'] = 1;
if($params['pm_start_servers'] == '') $params['pm_start_servers'] = 1;
if($params['pm_min_spare_servers'] == '') $params['pm_min_spare_servers'] = 1;
if($params['pm_max_spare_servers'] == '') $params['pm_max_spare_servers'] = 1;
$domain_id = $this->insertQuery('../sites/form/web_vhost_aliasdomain.tform.php', $client_id, $params, 'sites:web_vhost_aliasdomain:on_after_insert');
return $domain_id;
}
//* Update a record
public function sites_web_vhost_aliasdomain_update($session_id, $client_id, $primary_id, $params)
{
if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_update')) {
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
//* Set a few defaults for nginx servers
if($params['pm_max_children'] == '') $params['pm_max_children'] = 1;
if($params['pm_start_servers'] == '') $params['pm_start_servers'] = 1;
if($params['pm_min_spare_servers'] == '') $params['pm_min_spare_servers'] = 1;
if($params['pm_max_spare_servers'] == '') $params['pm_max_spare_servers'] = 1;
$affected_rows = $this->updateQuery('../sites/form/web_vhost_aliasdomain.tform.php', $client_id, $primary_id, $params, 'sites:web_vhost_aliasdomain:on_after_insert');
return $affected_rows;
}
//* Delete a record
public function sites_web_vhost_aliasdomain_delete($session_id, $primary_id)
{
if(!$this->checkPerm($session_id, 'sites_web_aliasdomain_delete')) {
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$affected_rows = $this->deleteQuery('../sites/form/web_vhost_aliasdomain.tform.php', $primary_id);
return $affected_rows;
}
// ----------------------------------------------------------------------------------------------------------
//* Get record details
public function sites_web_vhost_subdomain_get($session_id, $primary_id)
{
......
<?php
/**
* sites_web_vhost_aliasdomain_plugin plugin
*
* @author Marius Cramer <m.cramer@pixcept.de> pixcept KG 2012, copied and adapted from web_domain plugin by:
* @author Julio Montoya <gugli100@gmail.com> BeezNest 2010
*/
class sites_web_vhost_aliasdomain_plugin {
var $plugin_name = 'sites_web_vhost_aliasdomain_plugin';
var $class_name = 'sites_web_vhost_aliasdomain_plugin';
// TODO: This function is a duplicate from the one in interface/web/sites/web_vhost_aliasdomain_edit.php
// There should be a single "token replacement" function to be called from modules and
// from the main code.
// Returna a "3/2/1" path hash from a numeric id '123'
function id_hash($id, $levels) {
$hash = "" . $id % 10 ;
$id /= 10 ;
$levels -- ;
while ( $levels > 0 ) {
$hash .= "/" . $id % 10 ;
$id /= 10 ;
$levels-- ;
}
return $hash;
}
/*
This function is called when the plugin is loaded
*/
function onLoad() {
global $app;
//Register for the events
// both event call the same function as the things to do do not differ here
$app->plugin->registerEvent('sites:web_vhost_aliasdomain:on_after_insert', 'sites_web_vhost_aliasdomain_plugin', 'sites_web_vhost_aliasdomain_edit');
$app->plugin->registerEvent('sites:web_vhost_aliasdomain:on_after_update', 'sites_web_vhost_aliasdomain_plugin', 'sites_web_vhost_aliasdomain_edit');
}
/*
Function to create the sites_web_vhost_aliasdomain rule and insert it into the custom rules
*/
function sites_web_vhost_aliasdomain_edit($event_name, $page_form) {
global $app, $conf;
// Get configuration for the web system
$app->uses("getconf");
$web_config = $app->getconf->get_server_config($app->functions->intval($page_form->dataRecord['server_id']), 'web');
$parent_domain = $app->db->queryOneRecord("SELECT * FROM `web_domain` WHERE `domain_id` = '" . $app->functions->intval($page_form->dataRecord['parent_domain_id']) . "'");
// Set the values for document_root, system_user and system_group
$system_user = $app->db->quote($parent_domain['system_user']);
$system_group = $app->db->quote($parent_domain['system_group']);
$document_root = $app->db->quote($parent_domain['document_root']);
$php_open_basedir = str_replace("[website_path]/web", $document_root.'/'.$page_form->dataRecord['web_folder'], $web_config["php_open_basedir"]);
$php_open_basedir = str_replace("[website_domain]/web", $page_form->dataRecord['domain'].'/'.$page_form->dataRecord['web_folder'], $php_open_basedir);
$php_open_basedir = str_replace("[website_path]", $document_root, $php_open_basedir);
$php_open_basedir = $app->db->quote(str_replace("[website_domain]", $page_form->dataRecord['domain'], $php_open_basedir));
$htaccess_allow_override = $app->db->quote($parent_domain['allow_override']);
$sql = "UPDATE web_domain SET sys_groupid = ".$app->functions->intval($parent_domain['sys_groupid']).",system_user = '$system_user', system_group = '$system_group', document_root = '$document_root', allow_override = '$htaccess_allow_override', php_open_basedir = '$php_open_basedir' WHERE domain_id = ".$page_form->id;
$app->db->query($sql);
}
}
......@@ -154,6 +154,12 @@ $form["tabs"]['sites'] = array (
'default' => 'n',
'value' => array(0 => 'n', 1 => 'y')
),
'vhost_aliasdomains' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(0 => 'n', 1 => 'y')
),
'client_username_web_check_disabled' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -41,6 +41,8 @@ $wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create Aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -41,6 +41,8 @@ $wb['tab_change_warning_txt'] = 'Záložka změna varování';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Vytvořit subdomény jako webové stránky';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasbdomains_txt'] = 'Vytvořit aliasdomény jako webové stránky';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'phpmyadmin neplatné URL';
$wb['use_combobox_txt'] = 'Použití jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Použití indikátoru zatížení';
......
......@@ -11,6 +11,8 @@ $wb['shelluser_prefix_txt'] = 'Shell Benutzer Präfix';
$wb['ftpuser_prefix_txt'] = 'FTP Benutzer Präfix';
$wb['vhost_subdomains_txt'] = 'Subdomains als Webseite anlegen';
$wb['vhost_subdomains_note_txt'] = 'Diese Einstellung kann nicht wieder deaktiviert werden, wenn Vhost Subdomains im System vorhanden sind!';
$wb['vhost_aliasbdomains_txt'] = 'Subdomains als Webseite anlegen';
$wb['vhost_aliasdomains_note_txt'] = 'Diese Einstellung kann nicht wieder deaktiviert werden, wenn Vhost Aliasdomains im System vorhanden sind!';
$wb['dbname_prefix_error_regex'] = 'Zeichen nicht erlaubt in Datenbank Namen Präfix.';
$wb['dbuser_prefix_error_regex'] = 'Zeichen nicht erlaubt in Datenbank Benutzer Präfix.';
$wb['ftpuser_prefix_error_regex'] = 'Zeichen nicht erlaubt in FTP Benutzer Präfix.';
......
......@@ -41,6 +41,8 @@ $wb['tab_change_warning_txt'] = 'Προειδοποίηση αλλαγής κα
$wb['tab_change_warning_note_txt'] = 'Εμφάνιση μιας προειδοποίησης κατα την αλλαγή καρτέλας σε φόρμες επεξεργασίας που έχουν τροποποιηθεί από τον χρήστη.';
$wb['vhost_subdomains_txt'] = 'Δημιουργία Subdomains ως web site';
$wb['vhost_subdomains_note_txt'] = 'Δεν μπορεί να γίνει απενεργοποίηση όσο υπάρχουν vhost subdomains στο σύστημα!';
$wb['vhost_aliasdomains_txt'] = 'Δημιουργία aliasdomains ως web site';
$wb['vhost_aliasdomains_note_txt'] = 'Δεν μπορεί να γίνει απενεργοποίηση όσο υπάρχουν vhost aliasdomains στο σύστημα!';
$wb['phpmyadmin_url_error_regex'] = 'Μη έγκυρο URL phpmyadmin';
$wb['use_combobox_txt'] = 'Χρήση jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Χρήση Load Indicator (ενδεικτή φόρτωσης)';
......
......@@ -13,8 +13,10 @@ $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_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains 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.';
......
......@@ -32,8 +32,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['maintenance_mode_txt'] = 'Maintenance Mode';
$wb['smtp_enabled_txt'] = 'Use SMTP to send system mails';
$wb['smtp_host_txt'] = 'SMTP host';
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -42,8 +42,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -34,6 +34,8 @@ $wb['tab_change_warning_txt'] = 'Ostrzegaj przy zmianie zakładki';
$wb['tab_change_warning_note_txt'] = 'Pokaż ostrzeżenie przy zmianie zakładki jeżeli zostały zmienione dane przez użytkownika.';
$wb['vhost_subdomains_txt'] = 'Twórz subdomeny jako strony web';
$wb['vhost_subdomains_note_txt'] = 'Nie możesz wyłączyć tego tak długo jak istnieją w systemie vhosty subdomen.';
$wb['vhost_aliasdomains_txt'] = 'Twórz aliasdomeny jako strony web';
$wb['vhost_aliasdomains_note_txt'] = 'Nie możesz wyłączyć tego tak długo jak istnieją w systemie vhosty aliasdomen.';
$wb['maintenance_mode_txt'] = 'Tryb serwisowy';
$wb['smtp_enabled_txt'] = 'Używaj SMTP do wysyłania powiadomień systemowych';
$wb['smtp_host_txt'] = 'Host SMTP';
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -39,8 +39,10 @@ $wb['smtp_missing_admin_mail_txt'] = 'Please enter the admin name and admin mail
$wb['tab_change_discard_txt'] = 'Discard changes on tab change';
$wb['tab_change_warning_txt'] = 'Tab change warning';
$wb['tab_change_warning_note_txt'] = 'Show a warning on tab change in edit forms if any data has been altered by the user.';
$wb['vhost_subdomains_txt'] = 'Create Subdomains as web site';
$wb['vhost_subdomains_txt'] = 'Create subdomains as web site';
$wb['vhost_subdomains_note_txt'] = 'You cannot disable this as long as vhost subdomains exist in the system!';
$wb['vhost_aliasdomains_txt'] = 'Create aliasdomains as web site';
$wb['vhost_aliasdomains_note_txt'] = 'You cannot disable this as long as vhost aliasdomains exist in the system!';
$wb['phpmyadmin_url_error_regex'] = 'Invalid phpmyadmin URL';
$wb['use_combobox_txt'] = 'Use jQuery UI Combobox';
$wb['use_loadindicator_txt'] = 'Use Load Indicator';
......
......@@ -147,6 +147,12 @@ class page_action extends tform_actions {
if($check['cnt'] > 0) {
$new_config['vhost_subdomains'] = 'y';
}
} elseif($section == 'sites' && $new_config['vhost_aliasdomains'] != 'y' && $server_config_array['vhost_aliasdomains'] == 'y') {
// check for existing vhost aliasdomains, if found the mode cannot be disabled
$check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_domain` WHERE `type` = 'vhostalias'");
if($check['cnt'] > 0) {
$new_config['vhost_aliasdomains'] = 'y';
}
} elseif($section == 'mail') {
if($new_config['smtp_pass'] == '') $new_config['smtp_pass'] = $server_config_array['mail']['smtp_pass'];
} elseif($section == 'misc' && $new_config['session_timeout'] != $server_config_array['misc']['session_timeout']) {
......
<?php
/*
Copyright (c) 2008-2010, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/******************************************
* Begin Form configuration
******************************************/
$tform_def_file = "form/system_config.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once '../../lib/config.inc.php';
require_once '../../lib/app.inc.php';
//* Check permissions for module
$app->auth->check_module_permissions('admin');
// Loading classes
$app->uses('tpl,tform,tform_actions');
$app->load('tform_actions');
class page_action extends tform_actions {
//var $_js_changed = false;
function onShowEdit() {
global $app, $conf;
if($_SESSION["s"]["user"]["typ"] != 'admin') die('This function needs admin priveliges');
if($app->tform->errorMessage == '') {
$app->uses('ini_parser,getconf');
$section = $this->active_tab;
$server_id = $this->id;
$this->dataRecord = $app->getconf->get_global_config($section);
if ($section == 'domains'){
if (isset($this->dataRecord['use_domain_module'])){
$_SESSION['use_domain_module_old_value'] = $this->dataRecord['use_domain_module'];
}
}
}
$record = $app->tform->getHTML($this->dataRecord, $this->active_tab, 'EDIT');
$record['warning'] = $app->tform->lng('warning');
$record['id'] = $this->id;
$app->tpl->setVar($record);
}
function onShowEnd() {
global $app, $conf;
// available dashlets
$available_dashlets_txt = '';
$handle = @opendir(ISPC_WEB_PATH.'/dashboard/dashlets');
while ($file = @readdir($handle)) {
if ($file != '.' && $file != '..' && !is_dir($file)) {
$available_dashlets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.substr($file, 0, -4).']<pre class="addPlaceholderContent" style="display:none;">['.substr($file, 0, -4).'],</pre></a> ';
}
}
if($available_dashlets_txt == '') $available_dashlets_txt = '------';
$app->tpl->setVar("available_dashlets_txt", $available_dashlets_txt);
parent::onShowEnd();
}
function onSubmit() {
global $app;
$app->uses('ini_parser,getconf');
$section = $app->tform->getCurrentTab();
$server_config_array = $app->getconf->get_global_config();
$new_config = $app->tform->encode($this->dataRecord, $section);
if($section == 'mail') {
if($new_config['smtp_pass'] == '') $new_config['smtp_pass'] = $server_config_array['smtp_pass'];
if($new_config['smtp_enabled'] == 'y' && ($new_config['admin_mail'] == '' || $new_config['admin_name'] == '')) {
$app->tform->errorMessage .= $app->tform->lng("smtp_missing_admin_mail_txt");
}
}
parent::onSubmit();
}
function onUpdateSave($sql) {
global $app, $conf;
if($_SESSION["s"]["user"]["typ"] != 'admin') die('This function needs admin priveliges');
$app->uses('ini_parser,getconf');
$section = $app->tform->getCurrentTab();
$server_config_array = $app->getconf->get_global_config();
foreach($app->tform->formDef['tabs'][$section]['fields'] as $key => $field) {
if ($field['formtype'] == 'CHECKBOX') {
if($this->dataRecord[$key] == '') {
// if a checkbox is not set, we set it to the unchecked value
$this->dataRecord[$key] = $field['value'][0];
}