Skip to content

Commit 5fa6803

Browse files
committed
- Changed the plugin loader to load plugins in alphabetical order
- Changed the default settings for websites
1 parent 8d78111 commit 5fa6803

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

interface/web/sites/form/web_domain.tform.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,25 +144,25 @@
144144
'cgi' => array (
145145
'datatype' => 'VARCHAR',
146146
'formtype' => 'CHECKBOX',
147-
'default' => 'y',
147+
'default' => 'n',
148148
'value' => array(0 => 'n',1 => 'y')
149149
),
150150
'ssi' => array (
151151
'datatype' => 'VARCHAR',
152152
'formtype' => 'CHECKBOX',
153-
'default' => 'y',
153+
'default' => 'n',
154154
'value' => array(0 => 'n',1 => 'y')
155155
),
156156
'suexec' => array (
157157
'datatype' => 'VARCHAR',
158158
'formtype' => 'CHECKBOX',
159-
'default' => 'y',
159+
'default' => 'n',
160160
'value' => array(0 => 'n',1 => 'y')
161161
),
162162
'ssl' => array (
163163
'datatype' => 'VARCHAR',
164164
'formtype' => 'CHECKBOX',
165-
'default' => 'y',
165+
'default' => 'n',
166166
'value' => array(0 => 'n',1 => 'y')
167167
),
168168
'php' => array (

server/lib/app.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function log($msg, $priority = 0) {
104104
if (!fwrite($fp, date("d.m.Y-H:i")." - ".$priority_txt." - ". $msg."\r\n")) {
105105
die("Unable to write to logfile.");
106106
}
107-
echo date("d.m.Y-H:i")." - ".$priority_txt." - ". $msg."<br>\n";
107+
echo date("d.m.Y-H:i")." - ".$priority_txt." - ". $msg."\n";
108108
fclose($fp);
109109

110110
//} else {

server/lib/classes/plugins.inc.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,29 @@ function loadPlugins() {
4141
global $app,$conf;
4242

4343
$plugins_dir = $conf["rootpath"].$conf["fs_div"]."plugins-enabled".$conf["fs_div"];
44+
$tmp_plugins = array();
4445

4546
if (is_dir($plugins_dir)) {
4647
if ($dh = opendir($plugins_dir)) {
48+
//** Go trough all files in the plugin dir
4749
while (($file = readdir($dh)) !== false) {
4850
if($file != '.' && $file != '..' && substr($file,-8,8) == '.inc.php') {
4951
$plugin_name = substr($file,0,-8);
50-
include_once($plugins_dir.$file);
51-
$app->log("Loading Plugin: $plugin_name",LOGLEVEL_DEBUG);
52-
$app->loaded_plugins[$plugin_name] = new $plugin_name;
53-
$app->loaded_plugins[$plugin_name]->onLoad();
52+
$tmp_plugins[$plugin_name] = $file;
5453
}
5554
}
55+
//** sort the plugins by name
56+
ksort($tmp_plugins);
57+
58+
//** load the plugins
59+
foreach($tmp_plugins as $plugin_name => $file) {
60+
include_once($plugins_dir.$file);
61+
$app->log("Loading Plugin: $plugin_name",LOGLEVEL_DEBUG);
62+
$app->loaded_plugins[$plugin_name] = new $plugin_name;
63+
$app->loaded_plugins[$plugin_name]->onLoad();
64+
}
65+
} else {
66+
$app->log("Unable to open the plugin directory: $plugins_dir",LOGLEVEL_ERROR);
5667
}
5768
} else {
5869
$app->log("Plugin directory missing: $plugins_dir",LOGLEVEL_ERROR);

0 commit comments

Comments
 (0)