本文整理汇总了PHP中Hash::CheckPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP Hash::CheckPassword方法的具体用法?PHP Hash::CheckPassword怎么用?PHP Hash::CheckPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hash
的用法示例。
在下文中一共展示了Hash::CheckPassword方法的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;
}
}
示例2: check_password
function check_password($provided_password)
{
return Hash::CheckPassword($provided_password, $this->password);
}