hmm, I would advise you that instead of registering a user 'on the
fly', first showed him a registration form if his email does not exist
in the bd and then redirect him to wherever he were once logged in.
Anyway, for login you only must send to users controller a post data
in the conventional format
['UserModel'] => array(
'username' => 'your username', // field names depends on how you
configure the component
'password' => 'your password'
)
and the component will always set the session (if login was
succesfully)
another thing I don't get clear, your are asking how to save the
password via
Auth->login() in the Session or in th DB? in case you are asking about
the
Session, the password is never saved into it
On Feb 9, 6:45 pm, dtirer <[email protected]> wrote:
> So I have a site where there is a formal registration form, whereafter
> the user gets logged in automatically via the Auth->login() method.
> It stores data automatically from $this->data in the Session.
>
> However, I have another part of the site that deals with new users
> searching for something via an 'Items' Controller. When they search
> using a form, they also have to submit an 'email address', along with
> what they're searching for. What happens is, if the email doesn't
> already exist in the DB, the 'email address' gets automatically
> registered, and then the user is automatically logged in. Here's how
> I do
>
> ItemsController extends AppController
> {
> if (!$this->Item->User->is_user($this->data['User']['email']))
> {
> /* do various steps to put email in the Users
> tables ...generate random password, etc
> After all that.... */
>
> $this->Auth->Login();
> }
>
> }
>
> Now my question, $this->data contains a) their search term, and b)
> their email address. When i do $this->Auth->login, will it still
> automatically insert the appropriate data in the Session? What about
> the password, which I generate in the User model? How do I manually
> store that via $this->Auth->login()?
>
> Thanks!
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
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