Commit 0d0cd9b8 authored by vogelor's avatar vogelor

Added support for core-modules. Core modules are modules without DB-trigger

Added new table monitor_data for the core-module monitor.
parent 51a91337
......@@ -530,6 +530,9 @@ class installer_dist extends installer_base {
while (($file = readdir($dh)) !== false) {
if($file != '.' && $file != '..') {
if(!@is_link($install_dir.'/server/mods-enabled/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-enabled/'.$file);
if (strpos($file, '_core_module') !== false) {
if(!@is_link($install_dir.'/server/mods-core/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-core/'.$file);
}
}
}
closedir($dh);
......@@ -542,6 +545,9 @@ class installer_dist extends installer_base {
while (($file = readdir($dh)) !== false) {
if($file != '.' && $file != '..') {
if(!@is_link($install_dir.'/server/plugins-enabled/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-enabled/'.$file);
if (strpos($file, '_core_plugin') !== false) {
if(!@is_link($install_dir.'/server/plugins-core/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-core/'.$file);
}
}
}
closedir($dh);
......
......@@ -555,6 +555,9 @@ class installer_dist extends installer_base {
while (($file = readdir($dh)) !== false) {
if($file != '.' && $file != '..') {
if(!@is_link($install_dir.'/server/mods-enabled/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-enabled/'.$file);
if (strpos($file, '_core_module') !== false) {
if(!@is_link($install_dir.'/server/mods-core/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-core/'.$file);
}
}
}
closedir($dh);
......@@ -567,6 +570,9 @@ class installer_dist extends installer_base {
while (($file = readdir($dh)) !== false) {
if($file != '.' && $file != '..') {
if(!@is_link($install_dir.'/server/plugins-enabled/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-enabled/'.$file);
if (strpos($file, '_core_plugin') !== false) {
if(!@is_link($install_dir.'/server/plugins-core/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-core/'.$file);
}
}
}
closedir($dh);
......
......@@ -35,6 +35,7 @@ class installer_base {
var $db;
public $conf;
public $install_ispconfig_interface = true;
public function __construct()
......@@ -749,6 +750,9 @@ class installer_base {
while (($file = readdir($dh)) !== false) {
if($file != '.' && $file != '..') {
if(!@is_link($install_dir.'/server/mods-enabled/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-enabled/'.$file);
if (strpos($file, '_core_module') !== false) {
if(!@is_link($install_dir.'/server/mods-core/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-core/'.$file);
}
}
}
closedir($dh);
......@@ -761,6 +765,9 @@ class installer_base {
while (($file = readdir($dh)) !== false) {
if($file != '.' && $file != '..') {
if(!@is_link($install_dir.'/server/plugins-enabled/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-enabled/'.$file);
if (strpos($file, '_core_plugin') !== false) {
if(!@is_link($install_dir.'/server/plugins-core/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-core/'.$file);
}
}
}
closedir($dh);
......
......@@ -1062,6 +1062,21 @@ CREATE TABLE `attempts_login` (
`ip` varchar(12) NOT NULL,
`times` tinyint(1) NOT NULL default '1',
`login_time` timestamp NOT NULL default '0000-00-00 00:00:00'
);
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Tabellenstruktur fr Tabelle `monitor_data`
--
CREATE TABLE `monitor_data` (
`server_id` int(11) NOT NULL,
`type` varchar(255) NOT NULL,
`created` int(11) NOT NULL,
`data` mediumtext NOT NULL,
`state` enum('unknown','ok','warning','error') NOT NULL default 'unknown',
PRIMARY KEY (`server_id`,`type`,`created`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
SET FOREIGN_KEY_CHECKS = 1;
......@@ -33,15 +33,15 @@ class modules {
var $notification_hooks = array();
/*
This function is called to load the modules from the mods-available folder
This function is called to load the modules from the mods-enabled or the mods-core folder
*/
function loadModules() {
function loadModules($type) {
global $app, $conf;
$modules_dir = $conf["rootpath"].$conf["fs_div"]."mods-enabled".$conf["fs_div"];
$subPath = 'mods-enabled';
if ($type == 'core') $subPath = 'mods-core';
$modules_dir = $conf["rootpath"].$conf["fs_div"].$subPath.$conf["fs_div"];
if (is_dir($modules_dir)) {
if ($dh = opendir($modules_dir)) {
while (($file = readdir($dh)) !== false) {
......
......@@ -34,13 +34,16 @@ class plugins {
var $subscribed_events = array();
/*
This function is called to load the plugins from the plugins-available folder
This function is called to load the plugins from the plugins-enabled or the plugins-core folder
*/
function loadPlugins() {
function loadPlugins($type) {
global $app,$conf;
$subPath = 'plugins-enabled';
if ($type == 'core') $subPath = 'plugins-core';
$plugins_dir = $conf["rootpath"].$conf["fs_div"]."plugins-enabled".$conf["fs_div"];
$plugins_dir = $conf["rootpath"].$conf["fs_div"].$subPath.$conf["fs_div"];
$tmp_plugins = array();
if (is_dir($plugins_dir)) {
......
This diff is collapsed.
......@@ -72,42 +72,38 @@ $tmp_num_records = $tmp_rec["number"];
unset($tmp_rec);
if($tmp_num_records > 0) {
$app->log("Found $tmp_num_records changes, starting update process.",LOGLEVEL_DEBUG);
/*
There is something to do, triggert by the database -> do it!
*/
// Write the Log
$app->log("Found $tmp_num_records changes, starting update process.", LOGLEVEL_DEBUG);
// Load required base-classes
$app->uses('ini_parser,modules,plugins,file,services');
// Get server configuration
$conf["serverconfig"] = $app->ini_parser->parse_ini_string(stripslashes($server_db_record["config"]));
/*
Load the modules that are im the mods-enabled folder
*/
$app->modules->loadModules();
/*
Load the plugins that are in the plugins-enabled folder
*/
$app->plugins->loadPlugins();
/*
Go trough the sys_datalog table and call the processing functions
in the modules that are hooked on to the table actions
*/
// Load the modules that are im the mods-enabled folder
$app->modules->loadModules('all');
// Load the plugins that are in the plugins-enabled folder
$app->plugins->loadPlugins('all');
// Go trough the sys_datalog table and call the processing functions
// in the modules that are hooked on to the table actions
$app->modules->processDatalog();
/*
Restart services that need to be restarted after configuration
*/
// Restart services that need to be restarted after configuration
$app->services->processDelayedActions();
} else {
$app->log('No Updated records found.',LOGLEVEL_DEBUG);
/*
There is no trigger inside the database -> load only the core, maybe they have to do something
*/
// Write the log
$app->log('No Updated records found, starting only the core.', LOGLEVEL_DEBUG);
// Load required base-classes
$app->uses('ini_parser,modules,plugins,file,services');
// Get server configuration
$conf["serverconfig"] = $app->ini_parser->parse_ini_string(stripslashes($server_db_record["config"]));
// Load the modules that are im the mods-core folder
$app->modules->loadModules('core');
// Load the plugins that are in the plugins-core folder
$app->plugins->loadPlugins('core');
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment