You can use this method I wrote, just place it in your app controller.

/**
 * Refreshes the Auth to get new data
 * @param string $field
 * @param string $value
 * @return void
 */
function _refreshAuth($field = '', $value = '') {
        if (!empty($field) && !empty($value)) {
                $this->Session->write($this->Auth->sessionKey .'.'. $field, 
$value);
        } else {
                if (isset($this->User)) {
                        $this->Auth->login($this->User->read(false, 
$this->Auth->user
('id')));
                } else {
                        
$this->Auth->login(ClassRegistry::init('User')->findById($this-
>Auth->user('id')));
                }
        }
}

Just use it like so in the controller:

$this->_refreshAuth('email', '[email protected]');

Or the whole thing:

$this->_refreshAuth();
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to