Redirect to subdomain

Discussion in 'Integration' started by cleerclouds, Jan 10, 2012.

  1. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    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
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
  3. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    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
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    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?
  5. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    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
  6. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    Hi Alexander,

    where can I enable suhosin.session.encrypt?
    I can not find it.

    Many thanks
    Andy
  7. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    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.
  8. microvb

    microvb Member

    Joined:
    Nov 23, 2007
    Messages:
    62
    @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.)
  9. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    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?
  10. microvb

    microvb Member

    Joined:
    Nov 23, 2007
    Messages:
    62
    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/
  11. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    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.
  12. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    Hi Alexander,

    on the server is suhosin not installed. So it should run or?

    Many thanks
    Andy

  13. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    This is no longer required.
    aMember will work in both cases(when suhosin installed and not)
  14. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    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

  15. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    You can get it from user record actually.
    PHP:
    $user Am_Lite::getInstance()->getUser();
    print 
    $user[user_id]
  16. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
    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

  17. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42
  18. cleerclouds

    cleerclouds Member

    Joined:
    Nov 30, 2011
    Messages:
    42

Share This Page