<?php
Class MyController extends AppController{
function doStuff($newStuff){
$this->User->read(NULL, $this->user_id);
$this->User->set('stuff', $newStuff);
$this->User->save();
}
}
I can't figure out how I'm supposed to prevent the password from getting updated.
Here's AppController in case that helps.
class AppController extends Controller {
public $components = array(
'Session',
'Auth' => array(
'loginRedirect' => array('controller' => 'posts', 'action' => 'index'),
'logoutRedirect' => array('controller' => 'pages', 'action' => 'display', 'home')
)
);
public function beforeFilter(){
parent::beforeFilter();
$this->user_id = $this->Auth->user('user_id');
if($this->user_id){
$username = $this->Auth->user('username');
$this->set('username', $username);
}
}
}
This is very generic code right now, with no extra processing for sanitizing etc, just trying to get the password to stop being overwritten.
Edited by Jessica, 21 January 2013 - 02:30 PM.












