Ignore:
Timestamp:
Nov 11, 2014 11:21:47 PM (11 years ago)
Author:
dungnv
Message:
 
File:
1 edited

Legend:

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

    r469 r472  
    1414        function checkLogin ($src, $token, $username, $password)
    1515        {
    16                 $data = $this->vservices->actionExecute('login', array('src' => $src, 'token' => $token, 'username' => $username, 'password' => $password), 'user');           
     16                $data = $this->vservices->actionExecute('login', array('src' => $src, 'token' => $token, 'username' => $username, 'password' => $password), 'user');
     17                               
    1718                $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++)
     19                $str_status = '';
     20                $str_fullname = '';
     21                $str_usid = '';
     22                $usid = '';
     23                $fullname = '';
     24                for ($i=0; $i < count($arr_users); $i++)
    2425                {
    2526                        if (strpos($arr_users[$i], 'status=') !== false)
     
    3940                }
    4041                $arr_status = explode("=", $str_status);
    41                 if ($str_fullname != "")
     42                if ($str_fullname != '')
    4243                {
    4344                        $arr_fullname = explode("=", $str_fullname);
    4445                        $fullname = $arr_fullname[1];
    4546                }
    46                 if ($str_usid !== "")
     47                if ($str_usid !== '')
    4748                {
    4849                        $arr_usid = explode("=", $str_usid);
     
    5051                }
    5152                $status = (int)$arr_status[1];
    52                 if ($status == 0 || $status = 4){
     53               
     54                if ($status == 0 || $status == 4){
    5355                        $us_id = (int)$usid;
    5456                        $query = "SELECT * FROM tbluser WHERE us_id = ?";
     
    8385                $errMsg = '';
    8486                parse_str($data);
    85                 $sms = "";
     87                $sms = '';
    8688               
    8789                switch((int)$status)
     
    166168                $us_id = 0;
    167169                $errMsg = '';
    168                 $sms = "";
     170                $sms = '';
    169171                $this->db->select('*')->from('tbluser')->where('cellphone', $receiverID);
    170172                $query = $this->db->get();
     
    218220                $us_id = 0;
    219221                $errMsg = '';
    220                 $sms = "";
     222                $sms = '';
    221223                $flag = false;
    222224                $pass = $password;
    223                 if (is_null($password) || $password = "")
     225                if (is_null($password) || $password == '')
    224226                {
    225227                        $pass = $this->create_random_password();
     
    271273        }
    272274       
     275       
     276        function checkLicense ($userId)
     277        {
     278                $isNotExpired = false;
     279                $userInfo = $this->get_user_by_id($userId);             
     280                $expireDate = $userInfo['expire_date'];
     281               
     282                if ((trim($expireDate) == '')) return $isNotExpired;
     283               
     284                $today = mktime();
     285                $expireTime = strtotime($expireDate.' 23:59:59');
     286                $isNotExpired = ($today < $expireTime);
     287                return $isNotExpired;
     288        }
     289       
    273290        function insert_smslog($sentNumber, $userID, $serviceID, $commandcode, $info, $receiveTime)
    274291        {
Note: See TracChangeset for help on using the changeset viewer.