Grokbase Groups PHP cake-php May 2013
FAQ

[cake-php] Change password

Igor Borovica
May 27, 2013 at 5:58 pm
Can someone help me with change password function in cakephp?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
reply

Search Discussions

5 responses

  • André Luis at May 27, 2013 at 6:26 pm
    What is your doubt??
    Em sábado, 25 de maio de 2013 14h23min47s UTC-3, Igor Borovica escreveu:

    Can someone help me with change password function in cakephp?
    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups "CakePHP" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
    To post to this group, send email to cake-php@googlegroups.com.
    Visit this group at http://groups.google.com/group/cake-php?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Igor Borovica at May 28, 2013 at 5:26 pm
    Dana ponedjeljak, 27. svibnja 2013. 20:26:09 UTC+2, korisnik André Luis
    napisao je:
    What is your doubt??
    Em sábado, 25 de maio de 2013 14h23min47s UTC-3, Igor Borovica escreveu:

    Can someone help me with change password function in cakephp?
        Can you give me some advice how to create that form?

    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups "CakePHP" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
    To post to this group, send email to cake-php@googlegroups.com.
    Visit this group at http://groups.google.com/group/cake-php?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • André Luis at May 28, 2013 at 5:37 pm
    echo $this->Form->create('User');
    echo $this->Form->input('password');
    echo $this->Form->input('password_retype');
    echo $this->Form->end('Send data');

    And in controller:

    public function change_password(){
             if($this->request->is('post') || $this->request->is('put')){
                 if(!empty($this->request->data['User']['password']) &&
    !empty($this->request->data['User']['password_retype'])){
                     if($this->request->data['User']['password'] ==
    $this->request->data['User']['password_retype']){
                         $this->User->id=$this->Auth->user('id');
                         if($this->User->save($this->request->data)){
                             $this->Session->setFlash('Your password has been
    changed');
                         } else {
                             $this->Session->setFlash('Could not change your
    password due a server problem, try again latter');
                         }
                     } else {
                         $this->Session->setFlash('Your password and your retype
    must match');
                     }
                 } else {
                     $this->Session->setFlash('Password or retype not sent');
                 }
             }
         }


    It´s something like this
    Em sábado, 25 de maio de 2013 14h23min47s UTC-3, Igor Borovica escreveu:

    Can someone help me with change password function in cakephp?
    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups "CakePHP" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
    To post to this group, send email to cake-php@googlegroups.com.
    Visit this group at http://groups.google.com/group/cake-php?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • André Luis at May 28, 2013 at 5:38 pm
    I almost forgot

    In the model User, use a method beforeSave to crypt the password.
    Em terça-feira, 28 de maio de 2013 14h37min41s UTC-3, André Luis escreveu:

    echo $this->Form->create('User');
    echo $this->Form->input('password');
    echo $this->Form->input('password_retype');
    echo $this->Form->end('Send data');

    And in controller:

    public function change_password(){
    if($this->request->is('post') || $this->request->is('put')){
    if(!empty($this->request->data['User']['password']) &&
    !empty($this->request->data['User']['password_retype'])){
    if($this->request->data['User']['password'] ==
    $this->request->data['User']['password_retype']){
    $this->User->id=$this->Auth->user('id');
    if($this->User->save($this->request->data)){
    $this->Session->setFlash('Your password has been
    changed');
    } else {
    $this->Session->setFlash('Could not change your
    password due a server problem, try again latter');
    }
    } else {
    $this->Session->setFlash('Your password and your
    retype must match');
    }
    } else {
    $this->Session->setFlash('Password or retype not sent');
    }
    }
    }


    It´s something like this
    Em sábado, 25 de maio de 2013 14h23min47s UTC-3, Igor Borovica escreveu:

    Can someone help me with change password function in cakephp?
    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups "CakePHP" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
    To post to this group, send email to cake-php@googlegroups.com.
    Visit this group at http://groups.google.com/group/cake-php?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Igor Borovica at May 28, 2013 at 9:18 pm
    Thanks man.


    2013/5/28 André Luis <cav...@...com>
    I almost forgot

    In the model User, use a method beforeSave to crypt the password.
    Em terça-feira, 28 de maio de 2013 14h37min41s UTC-3, André Luis escreveu:

    echo $this->Form->create('User');
    echo $this->Form->input('password')**;
    echo $this->Form->input('password_**retype');
    echo $this->Form->end('Send data');

    And in controller:

    public function change_password(){
    if($this->request->is('post') || $this->request->is('put')){
    if(!empty($this->request->**data['User']['password']) &&
    !empty($this->request->data['**User']['password_retype'])){
    if($this->request->data['User'**]['password'] ==
    $this->request->data['User']['**password_retype']){
    $this->User->id=$this->Auth->**user('id');
    if($this->User->save($this->**request->data)){
    $this->Session->setFlash('Your password has been
    changed');
    } else {
    $this->Session->setFlash('**Could not change
    your password due a server problem, try again latter');
    }
    } else {
    $this->Session->setFlash('Your password and your
    retype must match');
    }
    } else {
    $this->Session->setFlash('**Password or retype not
    sent');
    }
    }
    }


    It´s something like this
    Em sábado, 25 de maio de 2013 14h23min47s UTC-3, Igor Borovica escreveu:

    Can someone help me with change password function in cakephp?
    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to a topic in the
    Google Groups "CakePHP" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/cake-php/HHGK_-w1EBU/unsubscribe?hl=en.
    To unsubscribe from this group and all its topics, send an email to
    cake-php+unsubscribe@googlegroups.com.
    To post to this group, send email to cake-php@googlegroups.com.
    Visit this group at http://groups.google.com/group/cake-php?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups "CakePHP" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
    To post to this group, send email to cake-php@googlegroups.com.
    Visit this group at http://groups.google.com/group/cake-php?hl=en.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post

2 users in discussion

Igor Borovica: 3 posts André Luis: 3 posts