From 305dda7079bbf0bc2904ea526aeea22328146423 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 16 Apr 2015 04:52:58 -0400
Subject: [PATCH] - changed some things in mysql lib for installer

---
 install/lib/mysql.lib.php |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/install/lib/mysql.lib.php b/install/lib/mysql.lib.php
index d99793b..3a6d483 100644
--- a/install/lib/mysql.lib.php
+++ b/install/lib/mysql.lib.php
@@ -69,7 +69,7 @@
 		
 		if($this->_iConnId) return true;
 		$this->dbHost = $conf["mysql"]["host"];
-		$this->dbName = $conf["mysql"]["database"];
+		$this->dbName = false;//$conf["mysql"]["database"];
 		$this->dbUser = $conf["mysql"]["admin_user"];
 		$this->dbPass = $conf["mysql"]["admin_password"];
 		$this->dbCharset = $conf["mysql"]["charset"];
@@ -90,13 +90,25 @@
 			$this->_sqlerror('Zugriff auf Datenbankserver fehlgeschlagen! / Database server not accessible!');
 			return false;
 		}
+		
+		if($this->dbName) $this->setDBName($this->dbName);
+
+		$this->_setCharset();
+	}
+	
+	public function setDBData($host, $user, $password) {
+		$this->dbHost = $host;
+		$this->dbUser = $user;
+		$this->dbPass = $password;
+	}
+	
+	public function setDBName($name) {
+		$this->dbName = $name;
 		if(!((bool)mysqli_query( $this->_iConnId, 'USE `' . $this->dbName . '`'))) {
 			$this->close();
 			$this->_sqlerror('Datenbank nicht gefunden / Database not found');
 			return false;
 		}
-
-		$this->_setCharset();
 	}
 	
 	public function close() {

--
Gitblit v1.9.1