From 346caed594c7de29017a96b7d76f35be2539f4e3 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 15 Jul 2013 12:40:42 +0200 Subject: user/test_login: Allow clients to test login credentials Signed-off-by: Florian Pritz --- application/controllers/user.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'application/controllers/user.php') diff --git a/application/controllers/user.php b/application/controllers/user.php index f52e9c0b1..21b58cf93 100644 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -41,6 +41,18 @@ class User extends CI_Controller { $this->load->view('footer', $this->data); } + function test_login() + { + $username = $this->input->post('username'); + $password = $this->input->post('password'); + + if ($this->muser->login($username, $password)) { + $this->output->set_status_header(204); + } else { + $this->output->set_status_header(401); + } + } + function login() { $this->muser->require_session(); -- cgit v1.2.3-24-g4f1b