[Solar-talk] Verifying Login Status

Antti Holvikari anttih at gmail.com
Thu Feb 7 16:19:32 CST 2008


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().


-- 
Antti Holvikari <http://anttih.com>


More information about the Solar-talk mailing list