]>
jfr.im git - z_archive/KronOS.git/blob - application/controllers/account.php
1 <?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
3 class Account
extends CI_Controller
{
5 public function __construct() {
8 $this->load
->model('user');
11 public function index(){
14 public function login() {
17 $user = $this->input
->post('username');
18 $pass = $this->input
->post('password');
20 if ($user == FALSE || $pass == FALSE) {
21 $this->json
->error('Username or password was empty');
25 if ($this->user
->try_login($user, $pass)) {
27 'uid' => $this->user
->uid(),
28 'sid' => $this->user
->sid(),
29 'name' => $this->user
->display_name(),
31 $this->json
->reply('Logged in', $data);
33 $this->json
->error('Incorrect credentials');