summaryrefslogtreecommitdiff
path: root/modules/user/controllers/login.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-11-13 05:17:58 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-11-13 05:17:58 +0000
commit6d7130bffc2e124c9eed9fca3f772dcbd620fd12 (patch)
treed0458157c3105a163d5a876516556ebf1da35652 /modules/user/controllers/login.php
parentf62719ba61e755cf40b178f6a3c940833df650e1 (diff)
Progress is being made... you can now logout
Diffstat (limited to 'modules/user/controllers/login.php')
-rw-r--r--modules/user/controllers/login.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/user/controllers/login.php b/modules/user/controllers/login.php
index 991fa73b..2debf6d3 100644
--- a/modules/user/controllers/login.php
+++ b/modules/user/controllers/login.php
@@ -19,7 +19,6 @@
*/
class Login_Controller extends Controller {
public function index() {
- Kohana::log("debug", "Login_Controller/index");
$form = new Forge();
$form->input("username")->rules("required|length[4,32]");
$form->password("password")->rules("required|length[5,40]");
@@ -28,9 +27,6 @@ class Login_Controller extends Controller {
}
public function process() {
- Kohana::log("debug", "Login_Controller/process");
-
- Kohana::log("debug", print_r($_POST, true));
$form = new Forge("login.html", true);
$form->input("username")->rules("required|length[4,32]");
$form->password("password")->rules("required|length[5,40]");
@@ -56,4 +52,13 @@ class Login_Controller extends Controller {
print json_encode($response);
}
+
+ public function logout() {
+ try {
+ Session::instance()->destroy();
+ } catch (Exception $e) {
+ Kohana::log("error", $e);
+ }
+ print json_encode(array("logout" => true));
+ }
} \ No newline at end of file