summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2014-03-19 22:45:31 +0100
committerKevin Chabowski <kevin@kch42.de>2014-03-19 22:45:31 +0100
commitefbdc3bbd6cba8691391ec2192ea96adbfb8c029 (patch)
treebe6a69fab84d15d9fc1f8a50a02e8d57e9388c3b /index.php
downloadtodo-efbdc3bbd6cba8691391ec2192ea96adbfb8c029.tar.gz
todo-efbdc3bbd6cba8691391ec2192ea96adbfb8c029.tar.bz2
todo-efbdc3bbd6cba8691391ec2192ea96adbfb8c029.zip
Initial commit
Diffstat (limited to 'index.php')
-rwxr-xr-xindex.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/index.php b/index.php
new file mode 100755
index 0000000..fc9e213
--- /dev/null
+++ b/index.php
@@ -0,0 +1,41 @@
+<?php
+
+$f3 = require('lib/base.php');
+
+$f3->set('AUTOLOAD','autoload/');
+$f3->set('UI', 'ui/');
+
+$f3->config('config.ini');
+
+# Init DB
+$db = new DB\SQL($f3->get('sql_dsn'), $f3->get('sql_user'), $f3->get('sql_pass'));
+$f3->set("DB", $db);
+
+# Init Sessions
+new Db\SQL\Session($db);
+
+# Homepage
+$f3->route('GET @root: /', 'Todo\Lists->home');
+
+# User management stuff
+$f3->route('GET|POST @login: /login', 'Todo\UserManager->login');
+$f3->route('GET @logout: /logout', 'Todo\UserManager->logout');
+$f3->route('GET|POST @register: /register', 'Todo\UserManager->register');
+$f3->route('GET|POST @delete_acc: /delete_acc', 'Todo\UserManager->delete');
+$f3->route('GET /activate/@user/@code', 'Todo\UserManager->activate');
+$f3->route('GET|POST @resetpw: /resetpw', 'Todo\UserManager->initResetpw');
+$f3->route('GET|POST /resetpw/@user/@code', 'Todo\UserManager->resetpw');
+$f3->route('GET|POST @settings: /settings', 'Todo\UserManager->settings');
+
+# List stuff
+$f3->route('POST @newlist: /newlist', 'Todo\Lists->newList');
+$f3->route('GET|POST /list/@list', 'Todo\Lists->showList');
+$f3->route('GET|POST /list/@list/delete', 'Todo\Lists->deleteList');
+
+$f3->route('GET /foo', function($f3) {
+ $f3->set('content', 'blank.html');
+ $f3->set('info', 'http://'.$f3->get('HOST').$f3->get('BASE'));
+});
+
+$f3->run();
+echo Template::instance()->render('master.html');