summaryrefslogtreecommitdiff
path: root/src/controllers/Config.class.php
blob: 37d1f09f47ea08c735923ffe1131ac0c02cad412 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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() {
		
	}
}