cakephp 2.1을 사용하고 있는데 암호 기억 요청을 잊었을 때 사용자가받을 링크를 통해 사용자의 암호를 변경하려고합니다.Cakephp 암호 변경이 작동하지 않습니다.
링크는이
../myApp/users/change_password/1
내가 링크에 사용자 ID를 전달하는 것 같은 뭔가를 보인다. 즉, 상기와 같이 1이다.
뷰 즉은, change_password.ctp는
<?php echo $this->Form->create('User', array('controller' => 'users', 'action' => 'change_password', 'class' => 'well')); ?>
<?php echo $this->Form->input('User.id',array('value' => $this->params['pass'][0],'type'=>'hidden')); ?>
<?php echo $this->Form->label('password', 'Password', array('class' => 'control-label')); ?>
<?php echo $this->Form->password('password', array('class' => 'span3', 'type' => 'password')); ?>
<?php echo $this->Form->error('password', null , array('wrap' => 'span', 'class' => 'help-inline')); ?>
<?php echo $this->Form->submit('Change Password', array('class' => 'btn')); ?>
<?php echo $this->Form->end(); ?>
다음과 같습니다 그리고
public function change_password() {
if($this->request->is('post')) {
if ($this->User->save($this->request->data)) {
$this->Session->setFlash('Password has been changed.', 'default/flash_success');
$this->redirect(array('controller' => 'movies', 'action' => 'index'));
} else {
$this->Session->setFlash('Password could not be changed.', 'default/flash_error');
$this->redirect(array('controller' => 'movies', 'action' => 'index'));
}
}
}
을 다음하지만 암호를 저장할 수 아니에요으로 컨트롤러입니다.