Line | |
---|
1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
---|
2 |
|
---|
3 | class User extends MX_Controller
|
---|
4 | {
|
---|
5 |
|
---|
6 | const TOKENPW = 'violet';
|
---|
7 |
|
---|
8 | public function __construct() {
|
---|
9 | parent::__construct();
|
---|
10 | }
|
---|
11 |
|
---|
12 | public function login($return_type = 'xml')
|
---|
13 | {
|
---|
14 | $user_info = $this->session->userdata('userInfo');
|
---|
15 | if ($user_info)
|
---|
16 | {
|
---|
17 | $user = $user_info['user'];
|
---|
18 | $data['content'] = $this->get_data($user);
|
---|
19 | if ($return_type == "xml"){
|
---|
20 | $this->load->view('user', $data);
|
---|
21 | }
|
---|
22 | }else
|
---|
23 | {
|
---|
24 | redirect('/frontend/home');
|
---|
25 | }
|
---|
26 | }
|
---|
27 |
|
---|
28 | private function get_data($user)
|
---|
29 | {
|
---|
30 | $this->load->model('us_model');
|
---|
31 | $aryParams = array();
|
---|
32 | parse_str($user, $aryParams);
|
---|
33 | $us = $this->us_model->search_by_id($aryParams['id']);
|
---|
34 | return array("userId" => $aryParams['id'], "userLevel" => 1, "userPhone" => $aryParams['phone'], "userMoney" =>$us['acc_balanced'], "appUserName" => $aryParams['fullname'], "appAddress" => $aryParams['school'], "licType" => "SBG", "licCustomer" => $aryParams['username'], "licCreate" => $us['created_time'], "licExpire" => $us['expire_date']);
|
---|
35 | }
|
---|
36 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.