shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

user.php (1342B)


      1 <?php
      2 /*
      3  *  location: admin/model/extension/d_opencart_patch/user.php
      4  *
      5  */
      6 
      7 class ModelExtensionDOpencartPatchUser extends Model {
      8 
      9     public function getGroupId(){
     10         if(VERSION == '2.0.0.0'){
     11             $user_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "user WHERE user_id = '" . $this->user->getId() . "'");
     12             $user_group_id = (int)$user_query->row['user_group_id'];
     13         }else{
     14             $user_group_id = $this->user->getGroupId();
     15         }
     16 
     17         return $user_group_id;
     18     }
     19 
     20     public function getUrlToken(){
     21         if(VERSION >= '3.0.0.0'){
     22             return 'user_token=' . $this->session->data['user_token'];
     23         }else{
     24             return 'token=' . $this->session->data['token'];
     25         }
     26     }
     27 
     28     public function getToken(){
     29         if(VERSION >= '3.0.0.0'){
     30             return $this->session->data['user_token'];
     31         }else{
     32             return $this->session->data['token'];
     33         }
     34     }
     35     
     36     public function getCustomerGroups(){
     37         if (VERSION >= '2.1.0.1') {
     38             $this->load->model('customer/customer_group');
     39             return $this->model_customer_customer_group->getCustomerGroups();
     40         } else {
     41             $this->load->model('sale/customer_group');
     42             return $this->model_sale_customer_group->getCustomerGroups();
     43         }
     44      }
     45 
     46 
     47 }