當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Hash::CheckPassword方法代碼示例

本文整理匯總了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;
     }
 }
開發者ID:ryanhollister,項目名稱:klect.com,代碼行數:35,代碼來源:person_model.php

示例2: check_password

 function check_password($provided_password)
 {
     return Hash::CheckPassword($provided_password, $this->password);
 }
開發者ID:Atomox,項目名稱:benhelmerphotography,代碼行數:4,代碼來源:user.php


注:本文中的Hash::CheckPassword方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。