[Solar-talk] Verifying Login Status
Sean Montague
scene at themountainscene.com
Fri Feb 8 09:58:29 CST 2008
OK, I get the user object bit, that makes sense. I can use $this->user
in my Logout.php. But exactly where am logging out the first time? So
far, I can only get logged out with what I have, which now looks like:
public function actionIndex() {
$this->user->auth->processLogout();
$this->output = "You have successfully signed out!";
}
Thanks!
Sean
Antti Holvikari wrote:
> On Feb 8, 2008 12:14 AM, Antti Holvikari <anttih at gmail.com> wrote:
>
>> On Feb 8, 2008 12:08 AM, Sean Montague <scene at themountainscene.com> wrote:
>>
>>> Thanks, I am now really look forward this. To bring it full circle, and
>>> for any future reference for someone new to this, my logout script looks
>>> like:
>>>
>>> public function actionIndex() {
>>> // Register a Solar_User object if not already.
>>> // This will trigger the authentication process.
>>> if (! Solar_Registry::exists('user')) {
>>> Solar_Registry::set('user', Solar::factory('Solar_User'));
>>> }
>>>
>>> $user = Solar_Registry::get('user');
>>> $user->auth->processLogout();
>>>
>>> // For testing, I check anyway
>>> if ($user->auth->isValid()) {
>>> // user is logged in
>>> } else {
>>> $this->output = "You have successfully signed out!";
>>> }
>>> }
>>>
>> No need to call processLogout(). Solar_Auth_Adapter::start() handles
>> that too. You're now calling processLogout() twice.
>>
>
> In fact, I don't think you need a single line of what you showed. Even
> the status text is set by Solar :-D.
>
> No need to set a user object either since that code is in your _setup().
>
>
>
More information about the Solar-talk
mailing list