From 649f447b4f6512803b694437d9b218ca94c54bc1 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 14 Nov 2011 10:28:36 -0500
Subject: [PATCH] - Improved is_installed() function in installer. - Fixed php notices in dashboard.

---
 install/lib/install.lib.php           |    4 ++--
 interface/web/dashboard/dashboard.php |   12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php
index 318cda9..0d8eb40 100644
--- a/install/lib/install.lib.php
+++ b/install/lib/install.lib.php
@@ -582,8 +582,8 @@
 }
 
 function is_installed($appname) {
-	exec('which '.escapeshellcmd($appname).' 2> /dev/null',$out);
-	if(isset($out[0]) && stristr($out[0],$appname)) {
+	exec('which '.escapeshellcmd($appname).' 2> /dev/null',$out,$returncode);
+	if(isset($out[0]) && stristr($out[0],$appname) && $returncode == 0) {
 		return true;
 	} else {
 		return false;
diff --git a/interface/web/dashboard/dashboard.php b/interface/web/dashboard/dashboard.php
index e1828aa..88d459f 100644
--- a/interface/web/dashboard/dashboard.php
+++ b/interface/web/dashboard/dashboard.php
@@ -98,16 +98,16 @@
 	$v2 = $_SESSION['s']['new_ispconfig_version'];
 	$this_version = explode(".",$v1);
 	$this_fullversion = (($this_version[0] < 10) ? '0'.$this_version[0] : $this_version[0]) .
-			    (($this_version[1] < 10) ? '0'.$this_version[1] : $this_version[1]) .
-			    (($this_version[2] < 10) ? '0'.$this_version[2] : $this_version[2]) .
-			    (($this_version[3] < 10) ? (($this_version[3] < 1) ? '00' : '0'.$this_version[3]) : $this_version[3]);
+			    ((isset($this_version[1]) && $this_version[1] < 10) ? '0'.$this_version[1] : $this_version[1]) .
+			    ((isset($this_version[2]) && $this_version[2] < 10) ? '0'.$this_version[2] : $this_version[2]) .
+			    ((isset($this_version[3]) && $this_version[3] < 10) ? (($this_version[3] < 1) ? '00' : '0'.$this_version[3]) : $this_version[3]);
 
 
 	$new_version = explode(".",$v2);
 	$new_fullversion =  (($new_version[0] < 10) ? '0'.$new_version[0] : $new_version[0]) .
-			    (($new_version[1] < 10) ? '0'.$new_version[1] : $new_version[1]) .
-			    (($new_version[2] < 10) ? '0'.$new_version[2] : $new_version[2]) .
-			    (($new_version[3] < 10) ? (($new_version[3] < 1) ? '00' : '0'.$new_version[3]) : $new_version[3]);
+			    ((isset($new_version[1]) && $new_version[1] < 10) ? '0'.$new_version[1] : $new_version[1]) .
+			    ((isset($new_version[2]) && $new_version[2] < 10) ? '0'.$new_version[2] : $new_version[2]) .
+			    ((isset($new_version[3]) && $new_version[3] < 10) ? (($new_version[3] < 1) ? '00' : '0'.$new_version[3]) : $new_version[3]);
 	if($new_fullversion > $this_fullversion) {
 		$info[] = array('info_msg' => 'There is a new Version of ISPConfig 3 available!<br>' . 
 			'This Version: ' . $v1 . '<br>' . 

--
Gitblit v1.9.1