thanks for the link.
by the way I did it with reference to code. It works now. Its a simple
password changing option: code is as below.
controller:
function changePassword($id=null) {
if (empty($this->data)) {
$this->data = $this->User->findById($id);
}
else {
$this->User->id = $this->Session->read('user_id');
$uid = $this->User->findById($this->User->id);
if($this->data['User']['old_password']!=
$uid['User']['password'])
{
$this->Session->setFlash("Your old Password
field didn't match");
}
else if($this->data['User']['new_password'] !=
$this->data['User']
['confirm_password'] ) {
$this->Session_setFlash("New password and
Confirm password field
do not match");
}
else {
$this->data['User']['password'] =
$this->data['User']
['new_password'];
$this->data['User']['id'] = $this->User->id;
if($this->User->save($this->data)) {
$this->Session->setFlash("Password
updated");
$this->redirect('/admin/users');
}
}
}
}
view : change_password.ctp
<?php echo $form->create('User',array('action'=>'changePassword'));?>
<?php
echo $form->input('id');
echo $form->input("old_password", array('size' => 20,
'type'=>'password'));
echo $form->input('new_password', array('size' =>
20,'type'=>'password'));
echo $form->input('confirm_password', array('size' =>
20,'type'=>'password'));
echo $form->submit('Change');?>
</form>
On Sep 4, 7:35 am, powtac <[EMAIL PROTECTED]> wrote:
> Perhaps this
> helps:http://groups.google.com/group/cake-php/browse_thread/thread/f3653bac...
> ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---