Cheers folks, i added
$this->data['Course']['user_id'] = $this->Session->read('Auth.User.id');
to my controller from euromark's responce and it worked perfectly thanks very
much everyone.
Paul
On 2 Feb 2011, at 18:12, Stephen wrote:
> Definately go with euromark's answer, Ed is correct in hi
Definately go with euromark's answer, Ed is correct in his, but like he says
it can be manipulated (just for emphasis)
On 2 February 2011 18:07, Ed Propsner wrote:
> I'd go with euromark's answer :) He's right about the field being easily
> manipulated.
>
>
> On Wed, Feb 2, 2011 at 1:03 PM, Ed P
I'd go with euromark's answer :) He's right about the field being easily
manipulated.
On Wed, Feb 2, 2011 at 1:03 PM, Ed Propsner wrote:
> A hidden field could accomplish exactly what you are looking to do.
>
> $form->input('User.user_id', array('type' => 'hidden', 'value' =>
> $this->Session->r
A hidden field could accomplish exactly what you are looking to do.
$form->input('User.user_id', array('type' => 'hidden', 'value' =>
$this->Session->read('Auth.User.id'));
The user id will accessible in your controller through $this->data
HTH
On Wed, Feb 2, 2011 at 12:53 PM, Paul Wheatley wrot
dont use a hidden field
it can easily manipulated :)
if (!empty($this->data)) {
$this->Product->create();
$this->data['Product']['user_id'] = $this->Session-
>read('Auth.User.id');
if ($this->Product->save($this->data)) {
...
}
...
}
On 2
Hello,
I have a add view that you have to be logged in to get to.
What i am trying to do is add the UserID of the person creating the record to
the table so that later i can display only posts that relate to him/her. I
have a field called user_id and sort of hoped that Cake would do a similar