Hola
I have a question about a login action.
If i use the default form on the login page everything works fine and
the users are directed to their home pages.
But if i use another form, that i have on another page (that has the
same input names) i get redirected to the regular login form. The
stupid thing is that everything is the same $_SESSION, $GLOBALS in
both ways.
The only different thing is that i get redirected to another page even
if the page that i set is the user's home page.
Oh this is the code
function login()
{
$this->set('error', false);
if (!empty($this->data))
{
$someone = $this->User->findByUsername($this->data['User']
['username']);
if ((!empty($someone['User']['password']) && $someone['User']
['password'] == md5($this->data['User']['password']))
{
$res = $this->Student->findById($someone['User']
['profile_id']);
$someone['User']['Profile'] = $res['Student'];
$this->Session->write('User', $someone['User']);
$this->redirect('/'.$someone['User']['usertype'].'/
welcome');
}
else
{
$this->set('error', true);
}
}
}
Thank you for you help
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---