| | |
| | | var $class_name = 'web_module'; |
| | | var $actions_available = array( 'web_domain_insert', |
| | | 'web_domain_update', |
| | | 'web_domain_delete'); |
| | | 'web_domain_delete', |
| | | 'ftp_user_insert', |
| | | 'ftp_user_update', |
| | | 'ftp_user_delete', |
| | | 'shell_user_insert', |
| | | 'shell_user_update', |
| | | 'shell_user_delete'); |
| | | |
| | | /* |
| | | This function is called when the module is loaded |
| | |
| | | class that contains the function functionname. |
| | | */ |
| | | |
| | | $app->modules->registerTableHook('web_domain','mail_module','process'); |
| | | $app->modules->registerTableHook('web_domain','web_module','process'); |
| | | $app->modules->registerTableHook('shell_user','web_module','process'); |
| | | |
| | | // Register service |
| | | $app->services->registerService('httpd','web_module','restartHttpd'); |
| | | |
| | | } |
| | | |
| | |
| | | if($action == 'u') $app->plugins->raiseEvent('web_domain_update',$data); |
| | | if($action == 'd') $app->plugins->raiseEvent('web_domain_delete',$data); |
| | | break; |
| | | case 'ftp_user': |
| | | if($action == 'i') $app->plugins->raiseEvent('ftp_user_insert',$data); |
| | | if($action == 'u') $app->plugins->raiseEvent('ftp_user_update',$data); |
| | | if($action == 'd') $app->plugins->raiseEvent('ftp_user_delete',$data); |
| | | break; |
| | | case 'shell_user': |
| | | if($action == 'i') $app->plugins->raiseEvent('shell_user_insert',$data); |
| | | if($action == 'u') $app->plugins->raiseEvent('shell_user_update',$data); |
| | | if($action == 'd') $app->plugins->raiseEvent('shell_user_delete',$data); |
| | | break; |
| | | } // end switch |
| | | } // end function |
| | | |
| | | |
| | | // This function is used |
| | | function restartHttpd($action = 'restart') { |
| | | global $app; |
| | | if($action == 'restart') { |
| | | exec('/etc/init.d/apache2 restart'); |
| | | } else { |
| | | exec('/etc/init.d/apache2 reload'); |
| | | } |
| | | |
| | | } |
| | | |
| | | } // end class |
| | | |