From c719dc0b1dd696e0cd6b51f09ee13c8263375f7c Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Wed, 07 Sep 2011 05:57:38 -0400 Subject: [PATCH] Fixed a warning in maildrop plugin. --- server/mods-available/web_module.inc.php | 41 ++++++++++++++++++++++++++++++++--------- 1 files changed, 32 insertions(+), 9 deletions(-) diff --git a/server/mods-available/web_module.inc.php b/server/mods-available/web_module.inc.php index d7617c6..01c8b4d 100644 --- a/server/mods-available/web_module.inc.php +++ b/server/mods-available/web_module.inc.php @@ -40,7 +40,23 @@ 'ftp_user_delete', 'shell_user_insert', 'shell_user_update', - 'shell_user_delete'); + 'shell_user_delete', + 'webdav_user_insert', + 'webdav_user_update', + 'webdav_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 +83,9 @@ */ $app->modules->registerTableHook('web_domain','web_module','process'); + $app->modules->registerTableHook('ftp_user','web_module','process'); $app->modules->registerTableHook('shell_user','web_module','process'); + $app->modules->registerTableHook('webdav_user','web_module','process'); // Register service $app->services->registerService('httpd','web_module','restartHttpd'); @@ -98,29 +116,34 @@ if($action == 'u') $app->plugins->raiseEvent('shell_user_update',$data); if($action == 'd') $app->plugins->raiseEvent('shell_user_delete',$data); break; + case 'webdav_user': + if($action == 'i') $app->plugins->raiseEvent('webdav_user_insert',$data); + if($action == 'u') $app->plugins->raiseEvent('webdav_user_update',$data); + if($action == 'd') $app->plugins->raiseEvent('webdav_user_delete',$data); + break; } // end switch } // end function // This function is used function restartHttpd($action = 'restart') { - global $app; + global $app,$conf; - $command = ''; - if(is_file('/etc/init.d/httpd')) { - $command = '/etc/init.d/httpd'; + $daemon = ''; + if(is_file($conf['init_scripts'] . '/' . 'httpd')) { + $daemon = 'httpd'; } else { - $command = '/etc/init.d/apache2'; + $daemon = 'apache2'; } if($action == 'restart') { - exec($command.' restart'); + exec($conf['init_scripts'] . '/' . $daemon . ' restart'); } else { - exec($command.' reload'); + exec($conf['init_scripts'] . '/' . $daemon . ' reload'); } } } // end class -?> \ No newline at end of file +?> -- Gitblit v1.9.1