From 8a05d7625a4e75484abcf5293033a38d1bf7a314 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 04 Jun 2008 15:41:41 -0400
Subject: [PATCH] - Fixed a bug in listview class.

---
 install/lib/install.lib.php |   31 ++++++++++++++++++++++++-------
 1 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php
index 27edb74..b8f40f1 100644
--- a/install/lib/install.lib.php
+++ b/install/lib/install.lib.php
@@ -56,16 +56,34 @@
 
 $FILE = realpath('../install.php');
 
+//** Get distribution identifier
 function get_distname() {
-	global $conf; // TODO wtf ?
-	$distname = $conf['distname'];
+	
+	$distname = '';
+	
+	//** Debian or Ubuntu
+	if(file_exists('/etc/debian_version')) {
+	
+		if(trim(file_get_contents('/etc/debian_version')) == '4.0') {
+			$distname = 'debian40';
+			swriteln("Operating System: Debian 4.0 or compatible\n");
+		}
+		if(trim(file_get_contents('/etc/debian_version')) == 'lenny/sid') {
+			$distname = 'debian40';
+			swriteln("Operating System: Debian Lenny/Sid or compatible\n");
+		}
+	}
+	
+	//** Redhat
+	elseif(file_exists("/etc/redhat_release")) {
+	
+	}
+	
 	return $distname;
 }
 
 function sread() {
-    $f = fopen('/dev/stdin', 'r');
-    $input = fgets($f, 255);
-    fclose($f);
+    $input = fgets(STDIN);
     return rtrim($input);
 }
 
@@ -78,8 +96,7 @@
 }
 
 function ilog($msg){
-	$logfile = '/var/log/ispconfig_install.log';
-  	exec("echo `date` \"- [ISPConfig] - \"".$msg." >> ".$logfile);
+  	exec("echo `date` \"- [ISPConfig] - \"".$msg." >> ".ISPC_LOG_FILE);
 }
 
 function error($msg){

--
Gitblit v1.9.1