diff ajax.php @ 8:4c5f651aa107

Migrate certain settings to SQL database, cleanups, etc.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 06 Dec 2012 13:30:46 +0200
parents 76c3b89d7b11
children e36c4d2b09c4
line wrap: on
line diff
--- a/ajax.php	Wed Dec 05 09:35:30 2012 +0200
+++ b/ajax.php	Thu Dec 06 13:30:46 2012 +0200
@@ -9,14 +9,15 @@
   exit;
 }
 
-header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
-header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
+stSetupCacheControl();
 
-
-// Open PDO database connection
+// Initiate SQL database connection
 if (!stConnectSQLDB())
   die("Could not connect to SQL database.");
 
+// Fetch non-"hardcoded" settings from SQL database
+stReloadSettings();
+
 
 function setStatus($val, $msg)
 {
@@ -93,6 +94,10 @@
       case "compos":
         $sql = "SELECT * FROM compos ORDER BY id DESC";
         break;
+
+      case "settings":
+        $sql = "SELECT * FROM settings";
+        break;
       
       case "entries":
         stGetCompoList(TRUE);
@@ -222,6 +227,10 @@
         }
         echo "</table>\n";
       }
+      else
+      if ($type == "settings")
+      {
+      }
     }
     break;