コード例 #1
0
ファイル: Install_model.php プロジェクト: Drunkenpilot/No-CMS
 protected function insert_user()
 {
     $this->load->helper('cms');
     if ($this->is_subsite) {
         include APPPATH . 'config/site-' . $this->subsite . '/cms_config.php';
         $chipper = $config['__cms_chipper'];
     } else {
         include APPPATH . 'config/main/cms_config.php';
         $chipper = $config['__cms_chipper'];
     }
     $array = array('user_name' => $this->admin_user_name, 'email' => $this->admin_email, 'password' => cms_md5($this->admin_password, $chipper), 'real_name' => $this->admin_real_name);
     $table_name = 'main_user';
     if (!trim($this->db_table_prefix) == '') {
         $table_name = $this->db_table_prefix . '_' . $table_name;
     }
     $this->db_no_error = $this->db->insert($table_name, $array) && $this->db_no_error;
     return $this->db->last_query();
 }
コード例 #2
0
ファイル: CMS_Model.php プロジェクト: engirocha/No-CMS
 /**
  * @author  go frendi
  *
  * @param   string activation_code
  *
  * @return bool
  * @desc    validate activation_code
  */
 public function cms_valid_activation_code($activation_code)
 {
     $query = $this->db->query('SELECT activation_code FROM ' . $this->cms_user_table_name() . " WHERE\n                    (activation_code = '" . cms_md5($activation_code, $this->cms_chipper()) . "') AND\n                    (activation_code IS NOT NULL)");
     if ($query->num_rows() > 0) {
         return true;
     } else {
         return false;
     }
 }
コード例 #3
0
ファイル: Main.php プロジェクト: engirocha/No-CMS
 public function _before_insert_user($post_array)
 {
     // password
     $post_array['password'] = CMS_SUBSITE == '' ? cms_md5($post_array['password'], $this->cms_chipper()) : cms_md5($post_array['password']);
     // subsite
     $post_array['subsite'] = CMS_SUBSITE == '' ? null : CMS_SUBSITE;
     return $post_array;
 }
コード例 #4
0
ファイル: CMS_Model.php プロジェクト: nonconforme/No-CMS
 /**
  * @author  goFrendiAsgard
  * @param   string activation_code
  * @return  bool
  * @desc    validate activation_code
  */
 public function cms_valid_activation_code($activation_code)
 {
     $query = $this->db->query("SELECT activation_code FROM " . cms_table_name('main_user') . " WHERE\n                    (activation_code = '" . cms_md5($activation_code) . "') AND\n                    (activation_code IS NOT NULL)");
     if ($query->num_rows() > 0) {
         return true;
     } else {
         return false;
     }
 }
コード例 #5
0
ファイル: Main.php プロジェクト: nonconforme/No-CMS
 public function _before_insert_user($post_array)
 {
     $post_array['password'] = cms_md5($post_array['password']);
     return $post_array;
 }