From 392450ffb412d5fb81ebab0c1e50ac8ea421080a Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 10 Dec 2008 11:42:03 -0500
Subject: [PATCH] - Improved installer and updater for multiserver mode. Modules and plugins were only configured if the selected service is available on the server.
---
server/mods-available/client_module.inc.php | 9 +
install/dist/lib/fedora.lib.php | 53 ++++-
server/plugins-available/shelluser_jailkit_plugin.inc.php | 13 +
install/dist/lib/opensuse.lib.php | 53 ++++-
server/plugins-available/network_settings_plugin.inc.php | 9 +
server/plugins-available/postfix_filter_plugin.inc.php | 13 +
install/update.php | 143 +++++++++------
server/mods-available/monitor_core_module.inc.php | 11 +
server/plugins-available/postfix_server_plugin.inc.php | 13 +
server/plugins-available/software_update_plugin.inc.php | 9 +
server/mods-available/mail_module.inc.php | 13 +
server/plugins-available/mysql_clientdb_plugin.inc.php | 13 +
server/plugins-available/shelluser_base_plugin.inc.php | 13 +
install/lib/installer_base.lib.php | 54 ++++-
server/mods-available/database_module.inc.php | 13 +
server/plugins-available/apache2_plugin.inc.php | 13 +
server/mods-available/server_module.inc.php | 9 +
server/plugins-available/maildrop_plugin.inc.php | 13 +
server/mods-available/web_module.inc.php | 13 +
server/plugins-available/mail_plugin.inc.php | 13 +
server/plugins-available/getmail_plugin.inc.php | 14 +
server/plugins-available/firewall_plugin.inc.php | 9 +
install/uninstall.php | 2
23 files changed, 419 insertions(+), 99 deletions(-)
diff --git a/install/dist/lib/fedora.lib.php b/install/dist/lib/fedora.lib.php
index 44059a6..026720d 100644
--- a/install/dist/lib/fedora.lib.php
+++ b/install/dist/lib/fedora.lib.php
@@ -75,10 +75,10 @@
//* Creating virtual mail user and group
$command = 'groupadd -g '.$cf['vmail_groupid'].' '.$cf['vmail_groupname'];
- caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_group($cf['vmail_groupname'])) caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
$command = 'useradd -g '.$cf['vmail_groupname'].' -u '.$cf['vmail_userid'].' '.$cf['vmail_username'].' -d '.$cf['vmail_mailbox_base'].' -m';
- caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_user($cf['vmail_username'])) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
$postconf_commands = array (
'myhostname = '.$conf['hostname'],
@@ -335,7 +335,7 @@
if(!is_dir($config_dir)) exec("mkdir -p ".escapeshellcmd($config_dir));
$command = "useradd -d $config_dir getmail";
- caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_user('getmail')) caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
$command = "chown -R getmail $config_dir";
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
@@ -483,10 +483,10 @@
//* Create a ISPConfig user and group
$command = 'groupadd ispconfig';
- if(!is_group('vacp')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_group('ispconfig')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
$command = "useradd -g ispconfig -d $install_dir ispconfig";
- if(!is_user('vacp')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_user('ispconfig')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
//* copy the ISPConfig interface part
$command = "cp -rf ../interface $install_dir";
@@ -547,11 +547,17 @@
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
- if($file != '.' && $file != '..') {
- if(!@is_link($install_dir.'/server/mods-enabled/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-enabled/'.$file);
- if (strpos($file, '_core_module') !== false) {
- if(!@is_link($install_dir.'/server/mods-core/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-core/'.$file);
+ if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') {
+ include_once($install_dir.'/server/mods-available/'.$file);
+ $module_name = substr($file,0,-8);
+ $tmp = new $module_name;
+ if($tmp->onInstall()) {
+ if(!@is_link($install_dir.'/server/mods-enabled/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-enabled/'.$file);
+ if (strpos($file, '_core_module') !== false) {
+ if(!@is_link($install_dir.'/server/mods-core/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-core/'.$file);
+ }
}
+ unset($tmp);
}
}
closedir($dh);
@@ -562,17 +568,38 @@
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
- if($file != '.' && $file != '..') {
- if(!@is_link($install_dir.'/server/plugins-enabled/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-enabled/'.$file);
- if (strpos($file, '_core_plugin') !== false) {
- if(!@is_link($install_dir.'/server/plugins-core/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-core/'.$file);
+ if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') {
+ include_once($install_dir.'/server/plugins-available/'.$file);
+ $plugin_name = substr($file,0,-8);
+ $tmp = new $plugin_name;
+ if($tmp->onInstall()) {
+ if(!@is_link($install_dir.'/server/plugins-enabled/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-enabled/'.$file);
+ if (strpos($file, '_core_plugin') !== false) {
+ if(!@is_link($install_dir.'/server/plugins-core/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-core/'.$file);
+ }
}
+ unset($tmp);
}
}
closedir($dh);
}
}
+ // Update the server config
+ $mail_server_enabled = ($conf['services']['mail'])?1:0;
+ $web_server_enabled = ($conf['services']['web'])?1:0;
+ $dns_server_enabled = ($conf['services']['dns'])?1:0;
+ $file_server_enabled = ($conf['services']['file'])?1:0;
+ $db_server_enabled = ($conf['services']['db'])?1:0;
+ $vserver_server_enabled = ($conf['services']['vserver'])?1:0;
+ $sql = "UPDATE `server` SET mail_server = '$mail_server_enabled', web_server = '$web_server_enabled', dns_server = '$dns_server_enabled', file_server = '$file_server_enabled', db_server = '$db_server_enabled', vserver_server = '$vserver_server_enabled' WHERE server_id = ".intval($conf['server_id']);
+
+ if($conf['mysql']['master_slave_setup'] == 'y') {
+ $this->dbmaster->query($sql);
+ } else {
+ $this->db->query($sql);
+ }
+
//* Chmod the files
$command = "chmod -R 750 $install_dir";
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
diff --git a/install/dist/lib/opensuse.lib.php b/install/dist/lib/opensuse.lib.php
index a425921..827dd83 100644
--- a/install/dist/lib/opensuse.lib.php
+++ b/install/dist/lib/opensuse.lib.php
@@ -75,10 +75,10 @@
//* Creating virtual mail user and group
$command = 'groupadd -g '.$cf['vmail_groupid'].' '.$cf['vmail_groupname'];
- caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_group($cf['vmail_groupname'])) caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
$command = 'useradd -g '.$cf['vmail_groupname'].' -u '.$cf['vmail_userid'].' '.$cf['vmail_username'].' -d '.$cf['vmail_mailbox_base'].' -m';
- caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_user($cf['vmail_username'])) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
$postconf_commands = array (
'myhostname = '.$conf['hostname'],
@@ -353,7 +353,7 @@
if(!is_dir($config_dir)) exec("mkdir -p ".escapeshellcmd($config_dir));
$command = "useradd -d $config_dir getmail";
- caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_user('getmail')) caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
$command = "chown -R getmail $config_dir";
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
@@ -501,10 +501,10 @@
//* Create a ISPConfig user and group
$command = 'groupadd ispconfig';
- if(!is_group('vacp')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_group('ispconfig')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
$command = "useradd -g ispconfig -d $install_dir ispconfig";
- if(!is_user('vacp')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_user('ispconfig')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
//* copy the ISPConfig interface part
$command = "cp -rf ../interface $install_dir";
@@ -565,11 +565,17 @@
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
- if($file != '.' && $file != '..') {
- if(!@is_link($install_dir.'/server/mods-enabled/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-enabled/'.$file);
- if (strpos($file, '_core_module') !== false) {
- if(!@is_link($install_dir.'/server/mods-core/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-core/'.$file);
+ if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') {
+ include_once($install_dir.'/server/mods-available/'.$file);
+ $module_name = substr($file,0,-8);
+ $tmp = new $module_name;
+ if($tmp->onInstall()) {
+ if(!@is_link($install_dir.'/server/mods-enabled/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-enabled/'.$file);
+ if (strpos($file, '_core_module') !== false) {
+ if(!@is_link($install_dir.'/server/mods-core/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-core/'.$file);
+ }
}
+ unset($tmp);
}
}
closedir($dh);
@@ -580,17 +586,38 @@
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
- if($file != '.' && $file != '..') {
- if(!@is_link($install_dir.'/server/plugins-enabled/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-enabled/'.$file);
- if (strpos($file, '_core_plugin') !== false) {
- if(!@is_link($install_dir.'/server/plugins-core/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-core/'.$file);
+ if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') {
+ include_once($install_dir.'/server/plugins-available/'.$file);
+ $plugin_name = substr($file,0,-8);
+ $tmp = new $plugin_name;
+ if($tmp->onInstall()) {
+ if(!@is_link($install_dir.'/server/plugins-enabled/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-enabled/'.$file);
+ if (strpos($file, '_core_plugin') !== false) {
+ if(!@is_link($install_dir.'/server/plugins-core/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-core/'.$file);
+ }
}
+ unset($tmp);
}
}
closedir($dh);
}
}
+ // Update the server config
+ $mail_server_enabled = ($conf['services']['mail'])?1:0;
+ $web_server_enabled = ($conf['services']['web'])?1:0;
+ $dns_server_enabled = ($conf['services']['dns'])?1:0;
+ $file_server_enabled = ($conf['services']['file'])?1:0;
+ $db_server_enabled = ($conf['services']['db'])?1:0;
+ $vserver_server_enabled = ($conf['services']['vserver'])?1:0;
+ $sql = "UPDATE `server` SET mail_server = '$mail_server_enabled', web_server = '$web_server_enabled', dns_server = '$dns_server_enabled', file_server = '$file_server_enabled', db_server = '$db_server_enabled', vserver_server = '$vserver_server_enabled' WHERE server_id = ".intval($conf['server_id']);
+
+ if($conf['mysql']['master_slave_setup'] == 'y') {
+ $this->dbmaster->query($sql);
+ } else {
+ $this->db->query($sql);
+ }
+
//* Chmod the files
$command = "chmod -R 750 $install_dir";
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 705d729..09086b1 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -336,10 +336,10 @@
//* Creating virtual mail user and group
$command = 'groupadd -g '.$cf['vmail_groupid'].' '.$cf['vmail_groupname'];
- caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_group($cf['vmail_groupname'])) caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
$command = 'useradd -g '.$cf['vmail_groupname'].' -u '.$cf['vmail_userid'].' '.$cf['vmail_username'].' -d '.$cf['vmail_mailbox_base'].' -m';
- caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_user($cf['vmail_username'])) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
$postconf_commands = array (
'myhostname = '.$conf['hostname'],
@@ -618,7 +618,7 @@
if(!is_dir($config_dir)) exec("mkdir -p ".escapeshellcmd($config_dir));
$command = "useradd -d $config_dir getmail";
- caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_user('getmail')) caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
$command = "chown -R getmail $config_dir";
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
@@ -760,10 +760,10 @@
//* Create a ISPConfig user and group
$command = 'groupadd ispconfig';
- if(!is_group('vacp')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_group('ispconfig')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
$command = "useradd -g ispconfig -d $install_dir ispconfig";
- if(!is_user('vacp')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+ if(!is_user('ispconfig')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
//* copy the ISPConfig interface part
$command = "cp -rf ../interface $install_dir";
@@ -824,11 +824,17 @@
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
- if($file != '.' && $file != '..') {
- if(!@is_link($install_dir.'/server/mods-enabled/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-enabled/'.$file);
- if (strpos($file, '_core_module') !== false) {
- if(!@is_link($install_dir.'/server/mods-core/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-core/'.$file);
+ if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') {
+ include_once($install_dir.'/server/mods-available/'.$file);
+ $module_name = substr($file,0,-8);
+ $tmp = new $module_name;
+ if($tmp->onInstall()) {
+ if(!@is_link($install_dir.'/server/mods-enabled/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-enabled/'.$file);
+ if (strpos($file, '_core_module') !== false) {
+ if(!@is_link($install_dir.'/server/mods-core/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-core/'.$file);
+ }
}
+ unset($tmp);
}
}
closedir($dh);
@@ -839,17 +845,39 @@
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
- if($file != '.' && $file != '..') {
- if(!@is_link($install_dir.'/server/plugins-enabled/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-enabled/'.$file);
- if (strpos($file, '_core_plugin') !== false) {
- if(!@is_link($install_dir.'/server/plugins-core/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-core/'.$file);
+ if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') {
+ include_once($install_dir.'/server/plugins-available/'.$file);
+ $plugin_name = substr($file,0,-8);
+ $tmp = new $plugin_name;
+ if($tmp->onInstall()) {
+ if(!@is_link($install_dir.'/server/plugins-enabled/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-enabled/'.$file);
+ if (strpos($file, '_core_plugin') !== false) {
+ if(!@is_link($install_dir.'/server/plugins-core/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-core/'.$file);
+ }
}
+ unset($tmp);
}
}
closedir($dh);
}
}
+ // Update the server config
+ $mail_server_enabled = ($conf['services']['mail'])?1:0;
+ $web_server_enabled = ($conf['services']['web'])?1:0;
+ $dns_server_enabled = ($conf['services']['dns'])?1:0;
+ $file_server_enabled = ($conf['services']['file'])?1:0;
+ $db_server_enabled = ($conf['services']['db'])?1:0;
+ $vserver_server_enabled = ($conf['services']['vserver'])?1:0;
+ $sql = "UPDATE `server` SET mail_server = '$mail_server_enabled', web_server = '$web_server_enabled', dns_server = '$dns_server_enabled', file_server = '$file_server_enabled', db_server = '$db_server_enabled', vserver_server = '$vserver_server_enabled' WHERE server_id = ".intval($conf['server_id']);
+
+ if($conf['mysql']['master_slave_setup'] == 'y') {
+ $this->dbmaster->query($sql);
+ } else {
+ $this->db->query($sql);
+ }
+
+
//* Chmod the files
$command = "chmod -R 750 $install_dir";
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
diff --git a/install/uninstall.php b/install/uninstall.php
index 000c6c2..43b8ded 100644
--- a/install/uninstall.php
+++ b/install/uninstall.php
@@ -60,7 +60,7 @@
exec("/etc/init.d/mysql start");
// Deleting the symlink in /var/www
-unlink("/etc/apache2/sites-enabled/ispconfig.vhost");
+unlink("/etc/apache2/sites-enabled/000-ispconfig.vhost");
unlink("/etc/apache2/sites-available/ispconfig.vhost");
// Delete the ispconfig files
diff --git a/install/update.php b/install/update.php
index ac32b1d..8ce3b4b 100644
--- a/install/update.php
+++ b/install/update.php
@@ -97,7 +97,7 @@
// Resolve the IP address of the mysql hostname.
if(!$conf['mysql']['ip'] = gethostbyname($conf['mysql']['host'])) die('Unable to resolve hostname'.$conf['mysql']['host']);
-$conf['server_id'] = $conf_old["server_id"];
+$conf['server_id'] = intval($conf_old["server_id"]);
$conf['ispconfig_log_priority'] = $conf_old["log_priority"];
$inst = new installer();
@@ -128,9 +128,21 @@
system("mysqldump -h ".$conf['mysql']['host']." -u ".$conf['mysql']['admin_user']." -c -t --add-drop-table --all --quick ".$conf['mysql']['database']." > existing_db.sql");
}
-//** Delete the old database
+
+//* initialize the database
$inst->db = new db();
+//* Update $conf array with values from the server.ini that shall be preserved
+$tmp = $inst->db->queryOneRecord("SELECT * FROM ".$conf["mysql"]["database"].".server WHERE server_id = ".$conf['server_id']);
+
+$conf['services']['mail'] = ($tmp['mail_server'] == 1)?true:false;
+$conf['services']['web'] = ($tmp['web_server'] == 1)?true:false;
+$conf['services']['dns'] = ($tmp['dns_server'] == 1)?true:false;
+$conf['services']['file'] = ($tmp['file_server'] == 1)?true:false;
+$conf['services']['db'] = ($tmp['db_server'] == 1)?true:false;
+$conf['services']['vserver'] = ($tmp['vserver_server'] == 1)?true:false;
+
+//** Delete the old database
if( !$inst->db->query('DROP DATABASE IF EXISTS '.$conf['mysql']['database']) ) {
$inst->error('Unable to drop MySQL database: '.$conf['mysql']['database'].'.');
@@ -189,57 +201,68 @@
$reconfigure_services_answer = $inst->simple_query('Reconfigure Services?', array('yes','no'),'yes');
if($reconfigure_services_answer == 'yes') {
- //** Configure postfix
- $inst->configure_postfix('dont-create-certs');
- //* Configure postfix
- swriteln('Configuring Jailkit');
- $inst->configure_jailkit();
+ if($conf['services']['mail']) {
+ //** Configure postfix
+ $inst->configure_postfix('dont-create-certs');
- //** Configure saslauthd
- swriteln('Configuring SASL');
- $inst->configure_saslauthd();
+ //* Configure postfix
+ swriteln('Configuring Jailkit');
+ $inst->configure_jailkit();
- //** Configure PAM
- swriteln('Configuring PAM');
- $inst->configure_pam();
-
- //** Configure courier
- swriteln('Configuring Courier');
- $inst->configure_courier();
-
- //** Configure Spamasassin
- swriteln('Configuring Spamassassin');
- $inst->configure_spamassassin();
-
- //** Configure Amavis
- swriteln('Configuring Amavisd');
- $inst->configure_amavis();
-
- //** Configure Getmail
- swriteln('Configuring Getmail');
- $inst->configure_getmail();
-
- //** Configure Pureftpd
- swriteln('Configuring Pureftpd');
- $inst->configure_pureftpd();
-
- //** Configure MyDNS
- swriteln('Configuring MyDNS');
- $inst->configure_mydns();
-
- //** Configure Apache
- swriteln('Configuring Apache');
- $inst->configure_apache();
+ //** Configure saslauthd
+ swriteln('Configuring SASL');
+ $inst->configure_saslauthd();
+ //** Configure PAM
+ swriteln('Configuring PAM');
+ $inst->configure_pam();
+
+ //** Configure courier
+ swriteln('Configuring Courier');
+ $inst->configure_courier();
+
+ //** Configure Spamasassin
+ swriteln('Configuring Spamassassin');
+ $inst->configure_spamassassin();
+
+ //** Configure Amavis
+ swriteln('Configuring Amavisd');
+ $inst->configure_amavis();
+
+ //** Configure Getmail
+ swriteln('Configuring Getmail');
+ $inst->configure_getmail();
+ }
+
+ if($conf['services']['web']) {
+ //** Configure Pureftpd
+ swriteln('Configuring Pureftpd');
+ $inst->configure_pureftpd();
+ }
+
+ if($conf['services']['dns']) {
+ //** Configure MyDNS
+ swriteln('Configuring MyDNS');
+ $inst->configure_mydns();
+ }
+
+ if($conf['services']['web']) {
+ //** Configure Apache
+ swriteln('Configuring Apache');
+ $inst->configure_apache();
+ }
+
+
//* Configure DBServer
- swriteln('Configuring DBServer');
+ swriteln('Configuring Database');
$inst->configure_dbserver();
+
//if(@is_dir('/etc/Bastille')) {
- //* Configure Firewall
- swriteln('Configuring Firewall');
- $inst->configure_firewall();
+ //* Configure Firewall
+ swriteln('Configuring Firewall');
+ $inst->configure_firewall();
//}
}
@@ -263,18 +286,24 @@
if($reconfigure_services_answer == 'yes') {
swriteln('Restarting services ...');
if($conf['mysql']['init_script'] != '' && is_file($conf['mysql']['init_script'])) system($conf['init_scripts'].'/'.$conf['mysql']['init_script'].' restart');
- if($conf['postfix']['init_script'] != '' && is_file($conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart');
- if($conf['saslauthd']['init_script'] != '' && is_file($conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart');
- if($conf['amavis']['init_script'] != '' && is_file($conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart');
- if($conf['clamav']['init_script'] != '' && is_file($conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart');
- if($conf['courier']['courier-authdaemon'] != '' && is_file($conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart');
- if($conf['courier']['courier-imap'] != '' && is_file($conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart');
- if($conf['courier']['courier-imap-ssl'] != '' && is_file($conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart');
- if($conf['courier']['courier-pop'] != '' && is_file($conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart');
- if($conf['courier']['courier-pop-ssl'] != '' && is_file($conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart');
- if($conf['apache']['init_script'] != '' && is_file($conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart');
- if($conf['pureftpd']['init_script'] != '' && is_file($conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart');
- if($conf['mydns']['init_script'] != '' && is_file($conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null');
+ if($conf['services']['mail']) {
+ if($conf['postfix']['init_script'] != '' && is_file($conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart');
+ if($conf['saslauthd']['init_script'] != '' && is_file($conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart');
+ if($conf['amavis']['init_script'] != '' && is_file($conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart');
+ if($conf['clamav']['init_script'] != '' && is_file($conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart');
+ if($conf['courier']['courier-authdaemon'] != '' && is_file($conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart');
+ if($conf['courier']['courier-imap'] != '' && is_file($conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart');
+ if($conf['courier']['courier-imap-ssl'] != '' && is_file($conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart');
+ if($conf['courier']['courier-pop'] != '' && is_file($conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart');
+ if($conf['courier']['courier-pop-ssl'] != '' && is_file($conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart');
+ }
+ if($conf['services']['web']) {
+ if($conf['apache']['init_script'] != '' && is_file($conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart');
+ if($conf['pureftpd']['init_script'] != '' && is_file($conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart');
+ }
+ if($conf['services']['dns']) {
+ if($conf['mydns']['init_script'] != '' && is_file($conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null');
+ }
}
echo "Update finished.\n";
diff --git a/server/mods-available/client_module.inc.php b/server/mods-available/client_module.inc.php
index 4fdcd4e..4aaccf9 100644
--- a/server/mods-available/client_module.inc.php
+++ b/server/mods-available/client_module.inc.php
@@ -36,6 +36,15 @@
'client_update',
'client_delete');
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ return true;
+
+ }
+
/*
This function is called when the module is loaded
*/
diff --git a/server/mods-available/database_module.inc.php b/server/mods-available/database_module.inc.php
index 0d6be2a..73aad2b 100644
--- a/server/mods-available/database_module.inc.php
+++ b/server/mods-available/database_module.inc.php
@@ -37,6 +37,19 @@
'database_delete'
);
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ if($conf['services']['db'] == true) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
/*
This function is called when the module is loaded
*/
diff --git a/server/mods-available/mail_module.inc.php b/server/mods-available/mail_module.inc.php
index 1697f73..2d9df3a 100644
--- a/server/mods-available/mail_module.inc.php
+++ b/server/mods-available/mail_module.inc.php
@@ -54,6 +54,19 @@
'mail_content_filter_update',
'mail_content_filter_delete');
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ if($conf['services']['mail'] == true) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
/*
This function is called when the module is loaded
*/
diff --git a/server/mods-available/monitor_core_module.inc.php b/server/mods-available/monitor_core_module.inc.php
index 70cba8a..1ff82b1 100644
--- a/server/mods-available/monitor_core_module.inc.php
+++ b/server/mods-available/monitor_core_module.inc.php
@@ -36,7 +36,16 @@
/* No actions at this time. maybe later... */
var $actions_available = array();
- /*
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ return true;
+
+ }
+
+ /*
This function is called when the module is loaded
*/
function onLoad() {
diff --git a/server/mods-available/server_module.inc.php b/server/mods-available/server_module.inc.php
index a01e4c4..fb7042f 100644
--- a/server/mods-available/server_module.inc.php
+++ b/server/mods-available/server_module.inc.php
@@ -45,6 +45,15 @@
'software_update_inst_update',
'software_update_inst_delete');
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ return true;
+
+ }
+
/*
This function is called when the module is loaded
*/
diff --git a/server/mods-available/web_module.inc.php b/server/mods-available/web_module.inc.php
index d7617c6..9a3f85e 100644
--- a/server/mods-available/web_module.inc.php
+++ b/server/mods-available/web_module.inc.php
@@ -42,6 +42,19 @@
'shell_user_update',
'shell_user_delete');
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ if($conf['services']['web'] == true) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
/*
This function is called when the module is loaded
*/
diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index 7ebeedb..b822f7c 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -36,6 +36,19 @@
// private variables
var $action = '';
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ if($conf['services']['web'] == true) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
/*
This function is called when the plugin is loaded
diff --git a/server/plugins-available/firewall_plugin.inc.php b/server/plugins-available/firewall_plugin.inc.php
index 697b937..e46d0ca 100644
--- a/server/plugins-available/firewall_plugin.inc.php
+++ b/server/plugins-available/firewall_plugin.inc.php
@@ -33,6 +33,15 @@
var $plugin_name = 'firewall_plugin';
var $class_name = 'firewall_plugin';
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ return true;
+
+ }
+
/*
This function is called when the plugin is loaded
diff --git a/server/plugins-available/getmail_plugin.inc.php b/server/plugins-available/getmail_plugin.inc.php
index 0e4d279..c6daf42 100644
--- a/server/plugins-available/getmail_plugin.inc.php
+++ b/server/plugins-available/getmail_plugin.inc.php
@@ -33,9 +33,21 @@
var $plugin_name = 'getmail_plugin';
var $class_name = 'getmail_plugin';
-
var $getmail_config_dir = '';
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ if($conf['services']['mail'] == true) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
/*
This function is called when the plugin is loaded
*/
diff --git a/server/plugins-available/mail_plugin.inc.php b/server/plugins-available/mail_plugin.inc.php
index 524c059..ffb896a 100644
--- a/server/plugins-available/mail_plugin.inc.php
+++ b/server/plugins-available/mail_plugin.inc.php
@@ -33,6 +33,19 @@
var $plugin_name = 'mail_plugin';
var $class_name = 'mail_plugin';
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ if($conf['services']['mail'] == true) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
/*
This function is called when the plugin is loaded
diff --git a/server/plugins-available/maildrop_plugin.inc.php b/server/plugins-available/maildrop_plugin.inc.php
index 9216b1f..5cd98d7 100644
--- a/server/plugins-available/maildrop_plugin.inc.php
+++ b/server/plugins-available/maildrop_plugin.inc.php
@@ -36,6 +36,19 @@
var $mailfilter_config_dir = '';
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ if($conf['services']['mail'] == true) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
/*
This function is called when the plugin is loaded
*/
diff --git a/server/plugins-available/mysql_clientdb_plugin.inc.php b/server/plugins-available/mysql_clientdb_plugin.inc.php
index ca3651a..8e0f15b 100644
--- a/server/plugins-available/mysql_clientdb_plugin.inc.php
+++ b/server/plugins-available/mysql_clientdb_plugin.inc.php
@@ -33,6 +33,19 @@
var $plugin_name = 'mysql_clientdb_plugin';
var $class_name = 'mysql_clientdb_plugin';
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ if($conf['services']['db'] == true) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
/*
This function is called when the plugin is loaded
diff --git a/server/plugins-available/network_settings_plugin.inc.php b/server/plugins-available/network_settings_plugin.inc.php
index 277d474..866e37c 100644
--- a/server/plugins-available/network_settings_plugin.inc.php
+++ b/server/plugins-available/network_settings_plugin.inc.php
@@ -34,6 +34,15 @@
var $class_name = 'network_settings_plugin';
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ return true;
+
+ }
+
/*
This function is called when the plugin is loaded
*/
diff --git a/server/plugins-available/postfix_filter_plugin.inc.php b/server/plugins-available/postfix_filter_plugin.inc.php
index dcdbe9b..1888a9b 100644
--- a/server/plugins-available/postfix_filter_plugin.inc.php
+++ b/server/plugins-available/postfix_filter_plugin.inc.php
@@ -36,6 +36,19 @@
var $postfix_config_dir = '/etc/postfix';
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ if($conf['services']['mail'] == true) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
/*
This function is called when the plugin is loaded
*/
diff --git a/server/plugins-available/postfix_server_plugin.inc.php b/server/plugins-available/postfix_server_plugin.inc.php
index a63eb95..b9018de 100644
--- a/server/plugins-available/postfix_server_plugin.inc.php
+++ b/server/plugins-available/postfix_server_plugin.inc.php
@@ -36,6 +36,19 @@
var $postfix_config_dir = '/etc/postfix';
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ if($conf['services']['mail'] == true) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
/*
This function is called when the plugin is loaded
*/
diff --git a/server/plugins-available/shelluser_base_plugin.inc.php b/server/plugins-available/shelluser_base_plugin.inc.php
index 3ae2ef2..e3fd690 100755
--- a/server/plugins-available/shelluser_base_plugin.inc.php
+++ b/server/plugins-available/shelluser_base_plugin.inc.php
@@ -33,6 +33,19 @@
var $plugin_name = 'shelluser_base_plugin';
var $class_name = 'shelluser_base_plugin';
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ if($conf['services']['web'] == true) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
/*
This function is called when the plugin is loaded
diff --git a/server/plugins-available/shelluser_jailkit_plugin.inc.php b/server/plugins-available/shelluser_jailkit_plugin.inc.php
index adba029..db98da9 100755
--- a/server/plugins-available/shelluser_jailkit_plugin.inc.php
+++ b/server/plugins-available/shelluser_jailkit_plugin.inc.php
@@ -34,6 +34,19 @@
var $plugin_name = 'shelluser_jailkit_plugin';
var $class_name = 'shelluser_jailkit_plugin';
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ if($conf['services']['web'] == true) {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
/*
This function is called when the plugin is loaded
diff --git a/server/plugins-available/software_update_plugin.inc.php b/server/plugins-available/software_update_plugin.inc.php
index cc10859..bf6aa56 100644
--- a/server/plugins-available/software_update_plugin.inc.php
+++ b/server/plugins-available/software_update_plugin.inc.php
@@ -33,6 +33,15 @@
var $plugin_name = 'software_update_plugin';
var $class_name = 'software_update_plugin';
+ //* This function is called during ispconfig installation to determine
+ // if a symlink shall be created for this plugin.
+ function onInstall() {
+ global $conf;
+
+ return true;
+
+ }
+
/*
This function is called when the plugin is loaded
--
Gitblit v1.9.1