From ec3d9abb92487aab666cab95d6f5b3d4e9d23dbb Mon Sep 17 00:00:00 2001
From: cfoe <cfoe@ispconfig3>
Date: Thu, 24 May 2012 03:00:18 -0400
Subject: [PATCH] added missing lang-string top_menu_mailuser + changed umlaut code to utf8 chars
---
server/mods-available/web_module.inc.php | 93 ++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 88 insertions(+), 5 deletions(-)
diff --git a/server/mods-available/web_module.inc.php b/server/mods-available/web_module.inc.php
index 7ebed3a..8d5681a 100644
--- a/server/mods-available/web_module.inc.php
+++ b/server/mods-available/web_module.inc.php
@@ -40,7 +40,32 @@
'ftp_user_delete',
'shell_user_insert',
'shell_user_update',
- 'shell_user_delete');
+ 'shell_user_delete',
+ 'webdav_user_insert',
+ 'webdav_user_update',
+ 'webdav_user_delete',
+ 'web_folder_insert',
+ 'web_folder_update',
+ 'web_folder_delete',
+ 'web_folder_user_insert',
+ 'web_folder_user_update',
+ 'web_folder_user_delete',
+ 'web_backup_insert',
+ 'web_backup_update',
+ 'web_backup_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,10 +92,16 @@
*/
$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');
+ $app->modules->registerTableHook('web_folder','web_module','process');
+ $app->modules->registerTableHook('web_folder_user','web_module','process');
+ $app->modules->registerTableHook('web_backup','web_module','process');
// Register service
$app->services->registerService('httpd','web_module','restartHttpd');
+ $app->services->registerService('php-fpm','web_module','restartPHP_FPM');
}
@@ -98,21 +129,73 @@
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;
+ case 'web_folder':
+ if($action == 'i') $app->plugins->raiseEvent('web_folder_insert',$data);
+ if($action == 'u') $app->plugins->raiseEvent('web_folder_update',$data);
+ if($action == 'd') $app->plugins->raiseEvent('web_folder_delete',$data);
+ break;
+ case 'web_folder_user':
+ if($action == 'i') $app->plugins->raiseEvent('web_folder_user_insert',$data);
+ if($action == 'u') $app->plugins->raiseEvent('web_folder_user_update',$data);
+ if($action == 'd') $app->plugins->raiseEvent('web_folder_user_delete',$data);
+ break;
+ case 'web_backup':
+ if($action == 'i') $app->plugins->raiseEvent('web_backup_insert',$data);
+ if($action == 'u') $app->plugins->raiseEvent('web_backup_update',$data);
+ if($action == 'd') $app->plugins->raiseEvent('web_backup_delete',$data);
+ break;
} // end switch
} // end function
// This function is used
function restartHttpd($action = 'restart') {
- global $app;
+ global $app,$conf;
+
+ // load the server configuration options
+ $app->uses('getconf');
+ $web_config = $app->getconf->get_server_config($conf['server_id'], 'web');
+
+ $daemon = '';
+ switch ($web_config['server_type']) {
+ case 'nginx':
+ $daemon = $web_config['server_type'];
+ break;
+ default:
+ if(is_file($conf['init_scripts'] . '/' . 'httpd')) {
+ $daemon = 'httpd';
+ } else {
+ $daemon = 'apache2';
+ }
+ }
+
if($action == 'restart') {
- exec('/etc/init.d/apache2 restart');
+ exec($conf['init_scripts'] . '/' . $daemon . ' restart');
} else {
- exec('/etc/init.d/apache2 reload');
+ exec($conf['init_scripts'] . '/' . $daemon . ' reload');
}
+ }
+
+ function restartPHP_FPM($action = 'restart') {
+ global $app,$conf;
+
+ // load the server configuration options
+ $app->uses('getconf');
+ $web_config = $app->getconf->get_server_config($conf['server_id'], 'web');
+
+ list($action, $init_script) = explode(':', $action);
+
+ if(!$init_script) $init_script = $conf['init_scripts'].'/'.$web_config['php_fpm_init_script'];
+
+ exec($init_script.' '.$action);
}
} // end class
-?>
\ No newline at end of file
+?>
--
Gitblit v1.9.1