summaryrefslogtreecommitdiff
path: root/src/controllers/Config.class.php
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-10-04 22:19:45 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-10-04 22:19:45 -0400
commitf72b9a7658cea71ee1edf4ae678a2c8043d9e5bf (patch)
treead815ede91026d8ed0df23785d4ff3b6170b3de4 /src/controllers/Config.class.php
parent2f1d74bdd48e3beaf6b52cad126de0271875e7ac (diff)
Begin work on safely allowing concurrent edits on data, giving better form interface.
Diffstat (limited to 'src/controllers/Config.class.php')
-rw-r--r--src/controllers/Config.class.php30
1 files changed, 30 insertions, 0 deletions
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() {
+
+ }
+}