| | |
| | | 'web_folder_user_delete', |
| | | 'web_backup_insert', |
| | | 'web_backup_update', |
| | | 'web_backup_delete'); |
| | | 'web_backup_delete', |
| | | 'aps_instance_insert', |
| | | 'aps_instance_update', |
| | | 'aps_instance_delete', |
| | | 'aps_instance_setting_insert', |
| | | 'aps_instance_setting_update', |
| | | 'aps_instance_setting_delete', |
| | | 'aps_package_insert', |
| | | 'aps_package_update', |
| | | 'aps_package_delete', |
| | | 'aps_setting_insert', |
| | | 'aps_setting_update', |
| | | 'aps_setting_delete'); |
| | | |
| | | //* This function is called during ispconfig installation to determine |
| | | // if a symlink shall be created for this plugin. |
| | |
| | | $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'); |
| | | $app->modules->registerTableHook('aps_instances','web_module','process'); |
| | | $app->modules->registerTableHook('aps_instances_settings','web_module','process'); |
| | | $app->modules->registerTableHook('aps_packages','web_module','process'); |
| | | $app->modules->registerTableHook('aps_settings','web_module','process'); |
| | | |
| | | // Register service |
| | | $app->services->registerService('httpd','web_module','restartHttpd'); |
| | |
| | | if($action == 'u') $app->plugins->raiseEvent('web_backup_update',$data); |
| | | if($action == 'd') $app->plugins->raiseEvent('web_backup_delete',$data); |
| | | break; |
| | | case 'aps_instances': |
| | | if($action == 'i') $app->plugins->raiseEvent('aps_instance_insert',$data); |
| | | if($action == 'u') $app->plugins->raiseEvent('aps_instance_update',$data); |
| | | if($action == 'd') $app->plugins->raiseEvent('aps_instance_delete',$data); |
| | | break; |
| | | case 'aps_instances_settings': |
| | | if($action == 'i') $app->plugins->raiseEvent('aps_instance_setting_insert',$data); |
| | | if($action == 'u') $app->plugins->raiseEvent('aps_instance_setting_update',$data); |
| | | if($action == 'd') $app->plugins->raiseEvent('aps_instance_setting_delete',$data); |
| | | break; |
| | | case 'aps_packages': |
| | | if($action == 'i') $app->plugins->raiseEvent('aps_package_insert',$data); |
| | | if($action == 'u') $app->plugins->raiseEvent('aps_package_update',$data); |
| | | if($action == 'd') $app->plugins->raiseEvent('aps_package_delete',$data); |
| | | break; |
| | | case 'aps_settings': |
| | | if($action == 'i') $app->plugins->raiseEvent('aps_setting_insert',$data); |
| | | if($action == 'u') $app->plugins->raiseEvent('aps_setting_update',$data); |
| | | if($action == 'd') $app->plugins->raiseEvent('aps_setting_delete',$data); |
| | | break; |
| | | } // end switch |
| | | } // end function |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | $retval = array('output' => '', 'retval' => 0); |
| | | if($action == 'restart') { |
| | | exec($conf['init_scripts'] . '/' . $daemon . ' restart'); |
| | | exec($conf['init_scripts'] . '/' . $daemon . ' restart 2>&1', $retval['output'], $retval['retval']); |
| | | } else { |
| | | exec($conf['init_scripts'] . '/' . $daemon . ' reload'); |
| | | exec($conf['init_scripts'] . '/' . $daemon . ' reload 2>&1', $retval['output'], $retval['retval']); |
| | | } |
| | | |
| | | return $retval; |
| | | } |
| | | |
| | | function restartPHP_FPM($action = 'restart') { |
| | |
| | | |
| | | if(!$init_script) $init_script = $conf['init_scripts'].'/'.$web_config['php_fpm_init_script']; |
| | | |
| | | exec($init_script.' '.$action); |
| | | $retval = array('output' => '', 'retval' => 0); |
| | | exec($init_script.' '.$action.' 2>&1', $retval['output'], $retval['retval']); |
| | | return $retval; |
| | | } |
| | | |
| | | } // end class |