From 7320a55693796da0e5d3fffac82438baaf384e4e Mon Sep 17 00:00:00 2001
From: vogelor <vogelor@ispconfig3>
Date: Mon, 10 May 2010 14:38:21 -0400
Subject: [PATCH] added the dashboard to the modules enabled by default
---
install/lib/install.lib.php | 26 ++++++++++++++++++++------
1 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php
index 889821c..6e9379f 100644
--- a/install/lib/install.lib.php
+++ b/install/lib/install.lib.php
@@ -56,6 +56,10 @@
$FILE = realpath('../install.php');
//** Get distribution identifier
+//** IMPORTANT!
+// This is the same code as in /server/mods-available/monitor_core_module.inc.php
+// So if you change it here, you also have to change it in
+// /server/mods-available/monitor_core_module.inc.php!
function get_distname() {
$distname = '';
@@ -72,12 +76,18 @@
$distid = 'debian40';
$distbaseid = 'debian';
swriteln("Operating System: Debian 4.0 or compatible\n");
- } elseif(strstr(trim(file_get_contents('/etc/debian_version')),'5.0') || trim(file_get_contents('/etc/debian_version')) == 'lenny/sid') {
+ } elseif(strstr(trim(file_get_contents('/etc/debian_version')),'5.0')) {
$distname = 'Debian';
- $distver = 'Lenny/Sid';
+ $distver = 'Lenny';
$distid = 'debian40';
$distbaseid = 'debian';
- swriteln("Operating System: Debian Lenny/Sid or compatible\n");
+ swriteln("Operating System: Debian Lenny or compatible\n");
+ } elseif(strstr(trim(file_get_contents('/etc/debian_version')),'6.0') || trim(file_get_contents('/etc/debian_version')) == 'squeeze/sid') {
+ $distname = 'Debian';
+ $distver = 'Squeeze/Sid';
+ $distid = 'debian40';
+ $distbaseid = 'debian';
+ swriteln("Operating System: Debian Squeeze/Sid or compatible\n");
} else {
$distname = 'Debian';
$distver = 'Unknown';
@@ -253,10 +263,14 @@
function rf($file){
clearstatcache();
- if(!$fp = fopen ($file, 'rb')){
- ilog('WARNING: could not open file '.$file);
+ if(is_file($file)) {
+ if(!$fp = fopen ($file, 'rb')){
+ ilog('WARNING: could not open file '.$file);
+ }
+ return filesize($file) > 0 ? fread($fp, filesize($file)) : '';
+ } else {
+ return '';
}
- return filesize($file) > 0 ? fread($fp, filesize($file)) : '';
}
function wf($file, $content){
--
Gitblit v1.9.1