Adaptations in the dashboard for the LF server
[pharos.git] / tools / infra-dashboard / utils / database.php
index bacf363..b72c3d1 100644 (file)
@@ -1,13 +1,15 @@
 <?php
-
+    include '../../../../auth-db.php';
     date_default_timezone_set('UTC');
     function connectDB() {
-        $username = "root";
-        $password = "opnfv";
-        $hostname = "localhost";
+        global $username;
+        global $password;
+        global $hostname;
+        global $dbname;
+
         $dbhandle = mysql_connect($hostname, $username, $password)
-            or die("Unable to connect to MySQL.");
-        $selected = mysql_select_db("opnfv_pharos",$dbhandle)
+            or die("Unable to connect to MySQL.".mysql_error());
+        $selected = mysql_select_db($dbname,$dbhandle)
             or die("Could not select opnfv_pharos DB.");
     }