From f72b9a7658cea71ee1edf4ae678a2c8043d9e5bf Mon Sep 17 00:00:00 2001
From: Luke Shumaker <LukeShu@sbcglobal.net>
Date: Tue, 4 Oct 2011 22:19:45 -0400
Subject: Begin work on safely allowing concurrent edits on data, giving better
 form interface.

---
 src/controllers/Config.class.php | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 src/controllers/Config.class.php

(limited to 'src/controllers/Config.class.php')

diff --git a/src/controllers/Config.class.php b/src/controllers/Config.class.php
new file mode 100644
index 0000000..37d1f09
--- /dev/null
+++ b/src/controllers/Config.class.php
@@ -0,0 +1,30 @@
+<?php
+require_once('Auth.class.php');
+
+Router::register('config', 'Config', 'index');
+
+class Config extends Controller {
+	public function index($routed, $remainder) {
+		$uid = Login::isLoggedIn();
+		if ($uid===false || !Auth::getObj($uid)->isAdmin()) {
+			$this->http401($routed, $remainder);
+			return;
+		}
+		
+		$method = $_SERVER['REQUEST_METHOD'];
+		switch ($method) {
+		case 'PUT': $_POST = $_PUT;
+		case 'POST':
+			// We're PUTing an updated configuration.
+			$this->update();
+			break;
+		}
+		$this->show_index();
+	}
+	private function show_index() {
+		
+	}
+	private function update() {
+		
+	}
+}
-- 
cgit v1.2.3-2-g168b