Ignore:
Timestamp:
Oct 28, 2014 6:37:49 PM (11 years ago)
Author:
namnd
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php

    r314 r326  
    1414        {
    1515                $data = $this->vservices->actionExecute('login', array('src' => $src, 'token' => $token, 'username' => $username, 'password' => $password), 'user');
    16                 return $data;
     16                //return $data;
     17                $arr_users = explode("&", $data);
     18                $str_status = "";
     19                $str_fullname = "";
     20                $str_usid = "";
     21                $usid = "";
     22                $fullname = "";
     23                for ($i=0; $i<count($arr_users); $i++)
     24                {
     25                        if (strpos($arr_users[$i], 'status=') !== false)
     26                        {
     27                                $str_status = $arr_users[$i];
     28                        }
     29                       
     30                        if (strpos($arr_users[$i], 'fullname=') !== false)
     31                        {
     32                                $str_fullname = $arr_users[$i];
     33                        }
     34                       
     35                        if (strpos($arr_users[$i], 'us_id=') !== false)
     36                        {
     37                                $str_usid = $arr_users[$i];
     38                        }
     39                }
     40                $arr_status = explode("=", $str_status);
     41                if ($str_fullname != "")
     42                {
     43                        $arr_fullname = explode("=", $str_fullname);
     44                        $fullname = $arr_fullname[1];
     45                }
     46                if ($str_usid !== "")
     47                {
     48                        $arr_usid = explode("=", $str_usid);
     49                        $usid = $arr_usid[1];
     50                }
     51               
     52                $status = (int)$arr_status[1];
     53                if ($status == 0){
     54                        $us_id = (int)$usid;
     55                        $query = "SELECT * FROM tbluser WHERE us_id = ?";
     56                        $result = $this->db->query($query, array($us_id));
     57                        if($result->num_rows() == 1){
     58                                return $data;
     59                        }else
     60                        {
     61                                return null;
     62                        }
     63                }else
     64                {
     65                        return $data;
     66                }
     67               
     68               
    1769        }
    1870       
Note: See TracChangeset for help on using the changeset viewer.