php - CakePHP : Updating all tables after user edit? -


i working on cakephp website, of of works trying update users page (which redirect now, once have working planing on making ajax update). code work,

    if ($this->request->is('post')) {         $this->loadmodel('setting');         $this->loadmodel('address');          if ( $this->user->save($this->request->data, $validate = true, $fieldlist = array('firstname','surname','homephone','mobilephone','dob','gender')) ) {              $newuserid = $this->auth->user('id');                $this->session->write('auth', $this->user->read(null,$newuserid));              $this->session->setflash('update done :)', 'goodflashmsg', array(), 'good');             $this->redirect('/user');         } else {             $this->session->setflash('sorry :( there has been error, please try again', 'badflashmsg', array(), 'bad');             $this->redirect('/');         }      } //end of post 

now meant to, save updated user details (address table, of later). when re-load user id refresh auth sesssion information, address table information seems wiped auth session, when re-loads page on redirect address information blank?

i trying update auth information (all of it, address table linked, via id, user table) when user edits of there information, user details or address details.

thanks.

compare array format of user info stored in session before , after $this->session->write('auth', $this->user->read(null,$newuserid)); statement using debug($_session). find array format not same. store info in expected format issue solved.

also should unset password field before setting info session.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -