integration CGI-BIN

Discussion in 'Integration' started by fmagusto, Dec 10, 2011.

  1. fmagusto

    fmagusto Guest

    I have a script in perl, with protect en htacess for take a login of the user, and take information in BD (name, Fnam, adresse, etc). but how make this with amember and reruiteURL
    Thank
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Sorry, not sure I understand what you mean. Please explain how this integration should work.
  3. fmagusto

    fmagusto Guest

    I have a script protect with a htacess methode (scirpt in perl Cgi-bin) the subscribers must connect two times, once for amember, then for htacess. Can be recovered the session from the cgi scriptand stop using the htaccess
  4. fmagusto

    fmagusto Guest

    in fact, what I need is to retrieve the user's login with themod-rewite. because with this function, I can not retrieve this information with the environment variables.
  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    You can get access to aMember's session from perl script, but you need to rewrite the same functionality that is implemented ion Am_Lite script. By default amember store sessions in database, so from your perl script you need to get session cookie, then get session from MySQL database and parse it.
  6. fmagusto

    fmagusto Guest

    how to interpret the session cookie and retrieve the user's login?
  7. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    1. aMember Cp -> Setup -> Advanced : use PHP sessions (instead of default database sessions)
    2. Use something like http://search.cpan.org/~miyagawa/PHP-Session-0.27/lib/PHP/Session.pm
    to read PHP session. It is out of scope of aMember support
    3. In the PHP session, look at "amember_auth" namespace, there is "user" variable. Take id and load corresponding record from MySQL table am_user in amember database.

Share This Page