示例#1
0
 /**
  * Create BookproUser
  * @param $id id of JUser
  */
 public function __construct($id = null)
 {
     $this->customer = new BookproCustomer();
     $config = JbFactory::getConfig();
     if ($id) {
         $this->id = $id;
         $this->user = JFactory::getUser($this->id);
         if ($this->user->id) {
             $this->customer->load(array('user' => $this->user->id));
             if (in_array($config->agent_usergroup, $this->user->groups)) {
                 $this->is_agent = 1;
             } else {
                 $this->is_agent = 0;
             }
             if ($this->customer->id) {
                 $this->authorise = json_decode($this->customer->params);
             }
         }
     }
     $this->_db = JFactory::getDbo();
 }