Skip to content

Commit 0d0cd9b

Browse files
author
vogelor
committed
Added support for core-modules. Core modules are modules without DB-trigger
Added new table monitor_data for the core-module monitor.
1 parent 51a9133 commit 0d0cd9b

File tree

8 files changed

+493
-39
lines changed

8 files changed

+493
-39
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,9 @@ public function install_ispconfig()
530530
while (($file = readdir($dh)) !== false) {
531531
if($file != '.' && $file != '..') {
532532
if(!@is_link($install_dir.'/server/mods-enabled/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-enabled/'.$file);
533+
if (strpos($file, '_core_module') !== false) {
534+
if(!@is_link($install_dir.'/server/mods-core/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-core/'.$file);
535+
}
533536
}
534537
}
535538
closedir($dh);
@@ -542,6 +545,9 @@ public function install_ispconfig()
542545
while (($file = readdir($dh)) !== false) {
543546
if($file != '.' && $file != '..') {
544547
if(!@is_link($install_dir.'/server/plugins-enabled/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-enabled/'.$file);
548+
if (strpos($file, '_core_plugin') !== false) {
549+
if(!@is_link($install_dir.'/server/plugins-core/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-core/'.$file);
550+
}
545551
}
546552
}
547553
closedir($dh);

install/dist/lib/opensuse.lib.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,9 @@ public function install_ispconfig()
555555
while (($file = readdir($dh)) !== false) {
556556
if($file != '.' && $file != '..') {
557557
if(!@is_link($install_dir.'/server/mods-enabled/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-enabled/'.$file);
558+
if (strpos($file, '_core_module') !== false) {
559+
if(!@is_link($install_dir.'/server/mods-core/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-core/'.$file);
560+
}
558561
}
559562
}
560563
closedir($dh);
@@ -567,6 +570,9 @@ public function install_ispconfig()
567570
while (($file = readdir($dh)) !== false) {
568571
if($file != '.' && $file != '..') {
569572
if(!@is_link($install_dir.'/server/plugins-enabled/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-enabled/'.$file);
573+
if (strpos($file, '_core_plugin') !== false) {
574+
if(!@is_link($install_dir.'/server/plugins-core/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-core/'.$file);
575+
}
570576
}
571577
}
572578
closedir($dh);

install/lib/installer_base.lib.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class installer_base {
3535
var $db;
3636
public $conf;
3737
public $install_ispconfig_interface = true;
38+
3839

3940

4041
public function __construct()
@@ -749,6 +750,9 @@ public function install_ispconfig()
749750
while (($file = readdir($dh)) !== false) {
750751
if($file != '.' && $file != '..') {
751752
if(!@is_link($install_dir.'/server/mods-enabled/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-enabled/'.$file);
753+
if (strpos($file, '_core_module') !== false) {
754+
if(!@is_link($install_dir.'/server/mods-core/'.$file)) @symlink($install_dir.'/server/mods-available/'.$file, $install_dir.'/server/mods-core/'.$file);
755+
}
752756
}
753757
}
754758
closedir($dh);
@@ -761,6 +765,9 @@ public function install_ispconfig()
761765
while (($file = readdir($dh)) !== false) {
762766
if($file != '.' && $file != '..') {
763767
if(!@is_link($install_dir.'/server/plugins-enabled/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-enabled/'.$file);
768+
if (strpos($file, '_core_plugin') !== false) {
769+
if(!@is_link($install_dir.'/server/plugins-core/'.$file)) @symlink($install_dir.'/server/plugins-available/'.$file, $install_dir.'/server/plugins-core/'.$file);
770+
}
764771
}
765772
}
766773
closedir($dh);

install/sql/ispconfig3.sql

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,21 @@ CREATE TABLE `attempts_login` (
10621062
`ip` varchar(12) NOT NULL,
10631063
`times` tinyint(1) NOT NULL default '1',
10641064
`login_time` timestamp NOT NULL default '0000-00-00 00:00:00'
1065-
);
1065+
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
1066+
1067+
1068+
--
1069+
-- Tabellenstruktur für Tabelle `monitor_data`
1070+
--
1071+
1072+
CREATE TABLE `monitor_data` (
1073+
`server_id` int(11) NOT NULL,
1074+
`type` varchar(255) NOT NULL,
1075+
`created` int(11) NOT NULL,
1076+
`data` mediumtext NOT NULL,
1077+
`state` enum('unknown','ok','warning','error') NOT NULL default 'unknown',
1078+
PRIMARY KEY (`server_id`,`type`,`created`)
1079+
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
1080+
10661081

10671082
SET FOREIGN_KEY_CHECKS = 1;

server/lib/classes/modules.inc.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ class modules {
3333
var $notification_hooks = array();
3434

3535
/*
36-
This function is called to load the modules from the mods-available folder
36+
This function is called to load the modules from the mods-enabled or the mods-core folder
3737
*/
38-
39-
function loadModules() {
38+
function loadModules($type) {
4039
global $app, $conf;
4140

42-
43-
44-
$modules_dir = $conf["rootpath"].$conf["fs_div"]."mods-enabled".$conf["fs_div"];
41+
$subPath = 'mods-enabled';
42+
if ($type == 'core') $subPath = 'mods-core';
43+
44+
$modules_dir = $conf["rootpath"].$conf["fs_div"].$subPath.$conf["fs_div"];
4545
if (is_dir($modules_dir)) {
4646
if ($dh = opendir($modules_dir)) {
4747
while (($file = readdir($dh)) !== false) {

server/lib/classes/plugins.inc.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ class plugins {
3434
var $subscribed_events = array();
3535

3636
/*
37-
This function is called to load the plugins from the plugins-available folder
37+
This function is called to load the plugins from the plugins-enabled or the plugins-core folder
3838
*/
3939

40-
function loadPlugins() {
40+
function loadPlugins($type) {
4141
global $app,$conf;
42+
43+
$subPath = 'plugins-enabled';
44+
if ($type == 'core') $subPath = 'plugins-core';
4245

43-
$plugins_dir = $conf["rootpath"].$conf["fs_div"]."plugins-enabled".$conf["fs_div"];
46+
$plugins_dir = $conf["rootpath"].$conf["fs_div"].$subPath.$conf["fs_div"];
4447
$tmp_plugins = array();
4548

4649
if (is_dir($plugins_dir)) {

0 commit comments

Comments
 (0)