private function authenticate_user_login() { if (is_object($this->password_salt)) { if (verifyPasswordHash($this->input->post('password'), $this->password_salt->sb_hotel_userpasswd) === TRUE) { $this->logged_in_user_meta = $this->User_model->authenticated_hoteleir_records($this->input->post('username'), $this->password_salt->sb_hotel_userpasswd); } else { $this->redirectWithErrMsg(ERR_MSG_LEVEL_1); } } $this->register_user_session(); }
public function change_password() { $old_password = $this->input->post('old_password'); $new_password = $this->input->post('new_password'); $arr = array(); $arr['sb_hotel_user_id'] = $this->session->userdata('logged_in_user')->sb_hotel_user_id; //print_r($arr); $password = $this->changepassword_model->check_user($arr); //print_r($password); if (verifyPasswordHash($old_password, $password[0]['sb_hotel_userpasswd']) == TRUE) { $arr1['sb_hotel_userpasswd'] = createHashAndSalt($new_password); $user_info1 = $this->changepassword_model->update_user($arr1, $arr); $this->session->set_flashdata('change_success', PASSWORD_CHANGE_SUCCESS); } else { $this->session->set_flashdata('change_fail', PASSWORD_CHANGE_FAIL); } redirect('admin/changePassword'); }
/** * This function will change password * return type- * created on - 22th July 2015; * updated on - * created by - Akshay Patil; */ public function change_password() { $sb_hotel_user_id = $this->input->post('sb_hotel_user_id'); $sb_hotel_userpasswd = $this->input->post('old_password'); $newpassword = $this->input->post('new_password'); if ($sb_hotel_user_id == '' || $sb_hotel_userpasswd == '' || $newpassword == '') { response_fail("Input may be empty"); } else { $arr = array(); $arr['sb_hotel_user_id'] = $sb_hotel_user_id; $password = $this->User_model->check_user($arr); if (count($password) <= 0) { response_fail("Email is wrong"); } else { if (verifyPasswordHash($sb_hotel_userpasswd, $password[0]['sb_hotel_userpasswd']) == TRUE) { $arr1['sb_hotel_userpasswd'] = createHashAndSalt($newpassword); $user_info1 = $this->User_model->update_user($arr1, $arr); response_ok(); } else { response_fail("Something is wrong"); } } } }