I've recently done something in a similar situation. The legacy
application saved a session variable with the userid of the logged in
user. For the integration of the CakePHP portions, I use that session
variable. If the variable is set, the user is logged in and I know
their userid... If it is not set I assume the user is not logged in
and redirect to the legacy application's login page.
All the pages provided by CakePHP require the user to be logged in. I
handle it all in a component, with something along the lines of
<?php
class MyAuthComponent extends Component {
public $loginUrl='http://example.com';
public $sessionKey='session_key';
public function startup(&$controller){
if(empty($_SESSION[$this->sessionKey])) {
$controller->redirect($this->loginUrl);
}
}
}
-teh
On May 28, 3:59 am, Jenski <jenski...@hotmail.co.uk> wrote:
> Hi Guys,
>
> We have an intranet, and I have decided to use CakePHP to build an
> application within it.
>
> We currently authenticate the users and their username/password
> (hashed) is stored in sessions
>
> I've managed to get this info in the bootstrap file of CakePHP
>
> so I now have Configure::read('password') and Configure:read
> ('password') available in the Cake App...
>
> I have a database table with usernames in and related data,
>
> what is the best way of using this information to authenticate the
> user?
>
> Thanks in advance
>
> Jen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment