From fa9c29e3f808f565cad97f56ba8b576f0a9c35b4 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Sun, 16 Feb 2014 09:33:52 -0500
Subject: [PATCH] Fixed: FS#3205 - add check in mongodb plugin if MongoClient class exists before using it

---
 server/plugins-available/mongo_clientdb_plugin.inc.php |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/server/plugins-available/mongo_clientdb_plugin.inc.php b/server/plugins-available/mongo_clientdb_plugin.inc.php
index cfec931..2f38112 100644
--- a/server/plugins-available/mongo_clientdb_plugin.inc.php
+++ b/server/plugins-available/mongo_clientdb_plugin.inc.php
@@ -51,8 +51,12 @@
 	 */
 	function onInstall() {
 		global $conf;
-
-		return (bool) $conf['services']['db'];
+		
+		if($conf['services']['db'] == true && class_exists('MongoClient')) {
+			return true;
+		} else {
+			return false;
+		}
 	}
 
 

--
Gitblit v1.9.1