From d4eae9fd3946d0747a555710f52099221586d538 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 21 Sep 2009 11:46:32 -0400
Subject: [PATCH] Fixed: FS#875 - SRV Records need validation
---
server/mods-available/web_module.inc.php | 30 ++++++++++++++++++++++++++----
1 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/server/mods-available/web_module.inc.php b/server/mods-available/web_module.inc.php
index 7ebed3a..1e7bde7 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
*/
@@ -67,7 +80,8 @@
*/
$app->modules->registerTableHook('web_domain','web_module','process');
- $app->modules->registerTableHook('shell_user','web_module','process');
+ $app->modules->registerTableHook('ftp_user','web_module','process');
+ $app->modules->registerTableHook('shell_user','web_module','process');
// Register service
$app->services->registerService('httpd','web_module','restartHttpd');
@@ -105,10 +119,18 @@
// This function is used
function restartHttpd($action = 'restart') {
global $app;
- if($action == 'restart') {
- exec('/etc/init.d/apache2 restart');
+
+ $command = '';
+ if(is_file('/etc/init.d/httpd')) {
+ $command = '/etc/init.d/httpd';
} else {
- exec('/etc/init.d/apache2 reload');
+ $command = '/etc/init.d/apache2';
+ }
+
+ if($action == 'restart') {
+ exec($command.' restart');
+ } else {
+ exec($command.' reload');
}
}
--
Gitblit v1.9.1