개발 Q&A

제목 비밀번호 변경 질문입니다
글쓴이 소연신 작성시각 2016/08/31 17:01:55
댓글 : 1 추천 : 0 스크랩 : 0 조회수 : 12212   RSS

if($this->form_validation->run() == false) {           

$this->load->view('auth/password');     

} else {       

$user = $this->auth_m->get(array('user_id'=>$this->session->userdata('user_id')));

        if ($this->session->userdata('user_id') == $user->user_id &&         

password_verify($this->input->post('password'), $user->password)) {

            if(function_exists('password_hash')) {             

$hash1 = password_hash($this-> input->post('new_password'), PASSWORD_BCRYPT);             

$hash2 = password_hash($this-> input->post('new_password_re'), PASSWORD_BCRYPT);           

}

if( $this->input->post($hash1) == $this->input->post($hash2) ) {

              $this->auth_m->password_modify($this->input->post($hash1));             

alert('정상적으로 변경되었습니다.', '/portFolio/main');             

exit;           

} else {             

alert('새로 입력한 비밀번호가 같지 않습니다.', '/portFolio/auth/password');           

}

} else {           

alert('현재 비밀번호가 잘못되었습니다.', '/portFolio/auth/password');           

exit;          }      }

 

컨트롤러 부분인데요. 암호화 하지 않고 바꾸면 잘 바뀝니다. 모델 부분 문제는 아닌거 같고.. 암호화 하고 바꾸면 아예 아무것도 입력 되지 않게 업데이트가 되네요. 

현재 비밀번호를 확인하고 새로 입력한 비밀번호를 두 번 입력하고 그게 같으면 바뀌는 부분인데...바뀌긴 하는데 이상하게 바뀌는 게..하ㅜ

 다음글 hosts.txt 로컬 도메인 변경 (1)
 이전글 JSON 구조로 통신할때 속도에 대한 질문입니다. (2)

댓글

변종원(웅파) / 2016/08/31 17:44:17 / 추천 0
암호화된 비밀번호 출력해보세요.