Customer Center - prevent access and get info about the user

Am trying some stuff within the customer portal and have a custom page added in which a script is called to generate the content.

  1. The page is reachable even if not logged in. How can I prevent this?
  2.  How can I get info about the logged in user? So that I can display only info that user should have access to.

Thanks!

RE: Customer Center - prevent access and get info about the user

Hi Patrik, not sure how your code is, but if you use customer.fcgi you can use getParserVariable("authenticated") to check if the user is authenticated or not.

Something like this:

String authenticated = getParserVariable("authenticated");
if(authenticated == "true")
{
  // Do Code
}

Also, you have the possibility to add %PARSER_TREE% to your code in the customer center to see all available information.

What kind of information are you interested in fetching?

Av: Simen Mostuen Iversen 21. nov 2019

RE: Customer Center - prevent access and get info about the user

Great, thanks for the tip!

I just wanted to make sure the custom added page was not accessible unless you were logged in. 

Av: Patrik Larsson 22. nov 2019