Thank You!
As with everything, this all seems impossible (at least daunting),
until you know how.
Of course, once you know how you slap your forehead and say: "Duh.".
Now on to figuring out the ACL!
Thanks again,
B.
On Aug 17, 3:36 am, francky06l <[EMAIL PROTECTED]> wrote:
> TheAuthloginstores the user information in the Session (withAuth
> key).
> TheAuth->user() is actually a wrapper function to the sessionAuth.User key.
> TheAuthlogout function delete the informations from the session.
>
> Knowing this, you can use the Session component in controllers and the
> session helper in views to detect theloginstatus.
>
> in controllers:
>
> $this->Session->check('Auth.User.id') will return true if the user is
> logged, you can also use $this->Auth->user('id').
>
> in views
>
> $session->check('Auth.User.id') will tell you if a user is logged, and
> you can user $session->read('Auth.User') to retrieve the user's
> information.
>
> hth
>
> On Aug 17, 2:31 am, "Bill Brisky" <[EMAIL PROTECTED]> wrote:
>
> > I'm starting off with Cake and enjoying it. As confusing as the entire ACL
> > world seems, I think I'm getting a grip on it.
>
> > One small current problem: How do you determine if someone is currently
> > logged in?
>
> > Here is the situation: I have a simple home page (pages/home.ctp) that
> > simply that should display a "login" link (users/login) and if no one is
> > currently logged in, a "logout" link (users/logout). It seems simple enough
> > however, I can't seem to find a way to determine whether or not someone is
> > logged in.
>
> > $loggedIn (Authpublic variable as stated in docs) seems to always be false
> > outside of actualAuthcode.
>
> > $this->Auth->user() : After an initiallogin, this always seems to return a
> > User object properly filled out, with the exception that person had actually
> > logged out.
>
> > So between an always false condition, and an always true condition, what
> > does one do? I have a feeling I'm missing something fundamental and will be
> > smacking my head on my desk after reading the solution.
>
> > More detail:
>
> > App_controller.php
>
> > Acl &Authcomponents in $components
>
> >Authvariables set in beforeFilter
>
> > Pages/Home.ctp
>
> > Typical Cake home page
>
> > Due to the lack of a controller (and thus a lack of access to data), I made
> > a copy of the cake core pages_controller.php and moved it into my
> > app/controllers directory.
>
> > Controllers/pages_controller.php
>
> > This is where I hope to set a variable (inside of display()) withlogin
> > status and pass it to home.ctp.
>
> > Changes to this file are minimal: AddedAuth& Session to $components.
>
> > Users_controller.php
>
> > TypicalAuthlogin(no code) and logout (taken from examples).
>
> > Versions:
>
> > - Windows XP
>
> > - Xampp v1.6.7
>
> > - PHP v.5.2.6
>
> > - Cake v1.2.0.7296rc2
>
> > Any and all help will be greatly appreciated.
>
> > B.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---