Jump to content

How to hook to every page and check login?


kingpinzs

Recommended Posts

I hooked to the header but I get to many redirects is there a safe way to check if customer is logged into the storefront? I am trying to use CAS to login and override the prestashop login but so far no luck.

 

this is what I tried so far

 

 

public function hookHeader( $params )

{

// if loged in from another site but not on this site check go set up this sites logged in

// if logged into this site from this sit do the same thing

// if logged out and try top get to this site check the cas server then destory the cookie

if ($_SERVER["REQUEST_URI"] != "/index.php?controller=authentication&back=my-account" and empty($_SESSION['email_address']))

{

header('Location: index.php?controller=authentication&back=my-account');

}

 

}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...