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