]> jfr.im git - z_archive/KronOS.git/blob - application/controllers/account.php
330df6b471b7f40ac08f84cd997f9e70093fa21b
[z_archive/KronOS.git] / application / controllers / account.php
1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
3 class Account extends CI_Controller {
4
5 public function __construct() {
6 # Required
7 parent::__construct();
8 $this->load->model('user');
9 }
10
11 public function index(){
12 }
13
14 public function login() {
15 if ($this->user->logged_in)
16 redirect('account/');
17
18 # Login stuff
19 if (count($this->input->post()) == 2) {
20 $user = $this->input->post('username');
21 $pass = $this->input->post('password');
22
23 if ($user == 'test' && $pass == 'test') {
24 $this->user->logged_in = True;
25 $response = array(
26 'loggedIn' => True,
27 );
28 print json_encode($response);
29 }
30 }
31 }
32 }