当前位置: 首页>>代码示例>>PHP>>正文


PHP Hash::HashPassword方法代码示例

本文整理汇总了PHP中Hash::HashPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP Hash::HashPassword方法的具体用法?PHP Hash::HashPassword怎么用?PHP Hash::HashPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Hash的用法示例。


在下文中一共展示了Hash::HashPassword方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: edit_profile

 function edit_profile()
 {
     $this->load->library('hash');
     $person_id = $this->phpsession->get('personVO')->getPerson_id();
     $data = array('email' => $this->input->post('email'), 'first_name' => $this->input->post('fname'), 'last_name' => $this->input->post('lname'), 'img_size' => $this->input->post('img_size'), 'sort_ord' => $this->input->post('sort_ord'), 'addr1' => $this->input->post('ship_addr1'), 'addr2' => $this->input->post('ship_addr2'), 'city' => $this->input->post('ship_city'), 'state' => $this->input->post('ship_state'), 'zip' => $this->input->post('ship_zip'), 'country' => $this->input->post('ship_country'));
     if ($this->input->post('opassword', TRUE) != "") {
         $this->db->select('person_id, password');
         $this->db->where('person_id', $person_id);
         $query = $this->db->get('person');
         $row = $query->result_array();
         if ($query->num_rows == 1 && Hash::CheckPassword($this->input->post('opassword'), $row[0]['password'])) {
             $data['password'] = Hash::HashPassword($this->input->post('npassword'));
         } else {
             echo "Old password was not correct.";
         }
     }
     $this->db->where('person_id', $person_id);
     $query = $this->db->update('person', $data);
     if ($query) {
         $this->phpsession->get('personVO')->setFname($this->input->post('fname'));
         $this->phpsession->get('personVO')->setLname($this->input->post('lname'));
         $this->phpsession->get('personVO')->setEmail($this->input->post('email'));
         $this->phpsession->get('personVO')->setImg_size($this->input->post('img_size'));
         $this->phpsession->get('personVO')->setSort_ord($this->input->post('sort_ord'));
         $this->phpsession->get('personVO')->setAddr1($this->input->post('ship_addr1'));
         $this->phpsession->get('personVO')->setAddr2($this->input->post('ship_addr2'));
         $this->phpsession->get('personVO')->setCity($this->input->post('ship_city'));
         $this->phpsession->get('personVO')->setState($this->input->post('ship_state'));
         $this->phpsession->get('personVO')->setZip((int) $this->input->post('ship_zip'));
         $this->phpsession->get('personVO')->setCountry($this->input->post('ship_country'));
         echo true;
     } else {
         echo false;
     }
 }
开发者ID:ryanhollister,项目名称:klect.com,代码行数:35,代码来源:person_model.php

示例2: _hash_password

 function _hash_password($field)
 {
     $this->{$field} = Hash::HashPassword($this->{$field});
 }
开发者ID:Atomox,项目名称:benhelmerphotography,代码行数:4,代码来源:user.php


注:本文中的Hash::HashPassword方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。