set in config.php
authorDave Raggett <dsr@w3.org>
Sun, 08 May 2011 18:45:20 +0100
changeset 13 dfa8f2a4fa76
parent 12 a767311394c3
child 14 37eeebf97e30
child 15 1ede69b72327
set in config.php
sharing/config.php
sharing/query.php
sharing/share.php
sharing/site.php
--- a/sharing/config.php	Sun May 08 18:28:19 2011 +0100
+++ b/sharing/config.php	Sun May 08 18:45:20 2011 +0100
@@ -1,5 +1,6 @@
 <?php
 // edit these to match your db
-$username = "user";
-$password = "password";
+  $username = "user";
+  $password = "password";
+  $database = "dashboard";
 ?>
--- a/sharing/query.php	Sun May 08 18:28:19 2011 +0100
+++ b/sharing/query.php	Sun May 08 18:45:20 2011 +0100
@@ -137,7 +137,7 @@
 
   header('Content-Type: text/plain');
 
-  $database = "dashboard";
+  // $database, $username and $password set in config.php
   $db = mysql_connect($db_master, $username, $password);
 
   if (!$db)
--- a/sharing/share.php	Sun May 08 18:28:19 2011 +0100
+++ b/sharing/share.php	Sun May 08 18:45:20 2011 +0100
@@ -240,21 +240,7 @@
 
   $data = explode("\n", $body);
 
-  // read credentials from local file
-  $creds = file_get_contents("credentials");
-
-  if (!$creds)
-  {
-    header("HTTP/1.0 500 Internal Error");
-    die("500 Internal Error - Couldn't get credentials for database access");
-  }
-
-  // file content:  userid:password
-  $creds = explode(":", $creds);
-  $username = trim($creds[0]);
-  $password = trim($creds[1]);
-
-  $database = "dashboard";
+  // $database, $username and $password set in config.php
   $db = mysql_connect($db_master, $username, $password);
 
   if (!$db)
--- a/sharing/site.php	Sun May 08 18:28:19 2011 +0100
+++ b/sharing/site.php	Sun May 08 18:45:20 2011 +0100
@@ -53,7 +53,7 @@
     do_query($sql, $names);
   }
 
-  $database = "dashboard";
+  // $database, $username and $password set in config.php
   $db = mysql_connect($db_master, $username, $password);
 
   if (!$db)