Hello, I have a webapplikation which run under a subdomain. Now I try to redirect after login to this subdomain. For my Applikation I need the login data (ID and Name) how I got this Information? Best Regards, Andy
Hi Alexander, thank you for your answer. I try it out, but I got not all values back. Here my debug result after login: Code: Am_Lite::getInstance()->isLoggedIn(): Am_Lite::getInstance()->getUsername(): Am_Lite::getInstance()->getName(): Am_Lite::getInstance()->getEmail(): Am_Lite::getInstance()->getLogoutURL():https://www.domain.com/member/login/logout Am_Lite::getInstance()->getProfileURL():https://www.domain.com/member/profile Am_Lite::getInstance()->getLoginURL():https://www.domain.com/member/login/index Am_Lite::getInstance()->getSignupURL():https://www.domain.com/member/signup Am_Lite::getInstance()->renderLoginForm(): E-Mail Address or UsernamePassword Am_Lite::getInstance()->getRootURL():http://www.domain.com/member Am_Lite::getInstance()->getPayments():Array ( ) Am_Lite::getInstance()->getUserLinks(): Am_Lite::getInstance()->getAccess():Array ( ) Am_Lite::getInstance()->isUserActive(): Am_Lite::getInstance()->getProducts():Array ( [2] => Free Trial [3] => Bronze Start - [6] => SAVE 20% on Bronze Start - [4] => Silver Business (Most Popular) - [7] => SAVE 20% on Silver Business - [5] => Gold Enterprise - [8] => SAVE 20% on Gold Enterprise - ) By the way I find no function which give me the ID of the User. Could you help me? Many thanks, Andy
In regards to ID there is no such function, why you need this? In regards to values, do you have suhosin enabled? If yes check aMember CP -> Version info do you have suhosin.session.encrypt enabled?
Hi Aleander, I will check if suhosin is enabled. In regards to ID, I need the ID because I cominate the ID with the UserName in our Software for more secure. So is it possible to make a new function for it? Many thanks, Andy
I didn't say that suhosin must be installed! If you have suhosin installed in php suhosin.session.encrypt setting must be disabled. There is a problem currently with suhosin.session.encrypt and we are working on a fix. So if you have suhosin installed and suhosin.session.encrypt is set to On, please disable this setting. Edit your php.ini and add line: suhosin.session.encrypt = Off then restart Apache webserver, open phpinfo page again, and make sure "suhosin.session.encrypt" switched off.
@Alexander: *whew*, thank you for clearing that up that we do not need suhosin. I was under the impression from the prior portions of this message that suhosin must be installed. I will remove it (with a great sigh of relief). That still brings the problem that I am having (which brought me to this topic) where several of the API commands which are supposed to return data when a user is logged in return Null and not really sure why as other commands do function. such as the following returns null when logged into amember as a user PHP: $result = Am_Lite::getInstance()->getUsername();var_dump($result); where the following returns data as expected PHP: $result = Am_Lite::getInstance()->getLoginURL();var_dump($result); If you have any advice in this regard it would be appreciated. Thanks again (PS. can you remove my last 3 posts as they tend to give way that would have your customers install that module and thus further complicate things from a support perspective. In this way, they can approach the solution faster without going through the techno-mumbo-jumbo.)
Do you have aMember CP -> Setup -> Advanced -> Session Storage set to "database" ? Also do you have your test code on the same domain as aMember installation?
Alex, aMember CP sessions are set to "database" as per the default. The test code is located on the same domain as the aMember installation. /test.php /amember/
Can you contact me in helpdesk and provide access info? Everything should work right, and I don;t see any reason why it does not work now.
Hi Alexander, is it easy to implement a new function for the ID? When yes where can I find the required information for it? Many thanks Andy
You can get it from user record actually. PHP: $user = Am_Lite::getInstance()->getUser();print $user[user_id]
Hi Alexander, thanks for your help. I add now in my subdomain this sourcecode: require_once '/home/folder/public_html/member/library/Am/Lite.php'; $user = Am_Lite::getInstance()->getUser(); $userid=$user[user_id]; But I got still an empty array. Any ideas? Many thanks Andy