function edit($id)
{
$user = $this->Session->read('User');
$this->set('user',$user);
if($user['username'] = $this->data['User']['username'])
{
if (empty($this->data))
{
$this->Post->id = $id;
$this->data = $this->Post->read();
}
else
{
if ($this->Post->save($this->data['Post']))
{
$this->flash('Your post has been updated.','/posts');
}
}
}
else
{
$this->set('error', true);
}
}
I am trying to compared the username in session and the current post
auth. If it match, then , can do the edit function for current post.
But, I can't work it out.
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Cake PHP" 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
-~----------~----~----~----~------~----~------~--~---