Hello, I need to access the username for the logged in user and have tried using the API/Lite functions. If I try this: echo Am_Lite::getInstance()->getUsername(); echo Am_Lite::getInstance()->getEmail(); echo Am_Lite::getInstance()->getLogoutURL(); Then I get the URL back, but the username and email are both blank. I'm definitely logged in, as I can access restricted content and see my user details in the membership area. Is there anything I can do? Thanks
Yes - I've got that at the top of the page: <?php include_once('/home/username/public_html/amember/library/Am/Lite.php'); echo Am_Lite::getInstance()->getName(); echo Am_Lite::getInstance()->getLogoutURL(); ?> Calling this page brings back the URL so I know the path is correct Thanks
Can you contact us in helpdesk and attach phpinfo(); output and also, provide url to the page that contain above code and any login/password to test it.
Thank you for your help. Disabling Suhosin with a custom php.ini file made it work: suhosin.session.encrypt = Off Details are here for anyone else having this problem: http://www.zen-cart.com/forum/showthread.php?t=110204
Now this is working I've noticed that I can still see the protected content after amember has timed out - as this is returning blank: echo Am_Lite::getInstance()->getName(); and if I go to the members page it asks me to log in again. At which point I get the username back from the getName function properly. How does amember handle timeouts? as I need it to redirect users back to the login page if there aren't logged in - something which I assume it would do automatically!
It could be done automatically, but we decided to give more control to developer. PHP: $lite = Am_Lite::getInstance();if (!$lite->isLoggedIn()){ header("Location: " . $lite->getLoginUrl($_SERVER['REQUEST_URI'])); exit();}