Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. public function UpdatePassword(){
  2.  
  3. $tok = $_SESSION['token'];
  4. $newpass = md5($this->security->xss_clean($this->input-
  5. >post('newpass')));
  6. $confpass = md5($this->security->xss_clean($this->input-
  7. >post('confpass')));
  8.  
  9.  
  10.  
  11. if($newpass == $confpass){
  12.  
  13. $this->db->where('password', $tok);
  14. $this->db->update('user', array('password' =>
  15. $confpass));
  16. if($this->db->affected_rows() > 0){
  17. return true;
  18.  
  19. }else{
  20. return false;
  21. }
  22.  
  23. }
  24. else{
  25. $this->session->set_flashdata('error_submit',
  26. 'new and conf does not match');
  27. redirect(base_url('Login/resetpassword'));
  28.  
  29. }
  30.  
  31. //redirect(base_url('Login/Login'));
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement