summaryrefslogtreecommitdiff
path: root/src/controllers/Config.class.php
blob: dc6a8848627dff3f928407cfe04b638956bcc535 (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::getInstance($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() {
		
	}
}