示例#1
0
 public function __construct($registry)
 {
     parent::__construct($registry);
     // Set current time
     self::$time = time();
     // Setting
     $config_settings = $this->config->get('kbm_settings');
     // Does not initialize if the module not installed
     if (!$config_settings) {
         return;
     }
     $this->settings = self::mapMerge($this->getDefaultSettings(), $config_settings ? $config_settings : array());
     $this->settings = $this->prepareSettings($this->settings);
     // Cache permissions
     $user_id = intval($this->user->getId());
     $query = $this->db->query("SELECT * FROM `" . BLOG_TABLE_PREFIX . "author` WHERE user_id = {$user_id} LIMIT 0,1");
     if ($query->row) {
         $this->author = $query->row;
         $role_id = $query->row['role_id'];
         $permissions = $this->getPermissionsByRole($role_id);
         if ($permissions) {
             $this->permissions = $permissions;
         }
     }
 }
示例#2
0
文件: kbm.php 项目: chowy1026/shop1
 public function __construct($registry)
 {
     parent::__construct($registry);
     self::$time = time();
     $this->settings = $this->prepareSettings($this->mapMerge($this->getDefaultSettings(), $this->getSettings()));
 }