]> jfr.im git - z_archive/KronOS.git/blob - application/controllers/account.php
211c9b8be09c3065ee4efe763631b4d8122046dc
[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 pass;
13 }
14
15 public function login() {
16 if ($this->user->logged_in)
17 redirect('account/');
18
19 # Login stuff
20 if (count($this->input->post()) == 2) {
21 $user = $this->input->post('username');
22 $pass = $this->input->post('password');
23
24 if ($user == 'test' && $pass == 'test') {
25 $this->user->logged_in = True;
26 $response = array(
27 'loggedIn' => True,
28 );
29 print json_encode($response);
30 }
31 }
32 }
33 }