integration CGI-BIN

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

  1. fmagusto

    fmagusto Member

    Joined:
    Nov 30, 2011
    Messages:
    245
    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,274
    Sorry, not sure I understand what you mean. Please explain how this integration should work.
  3. fmagusto

    fmagusto Member

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

    Joined:
    Nov 30, 2011
    Messages:
    245
    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,274
    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 Member

    Joined:
    Nov 30, 2011
    Messages:
    245
    how to interpret the session cookie and retrieve the user's login?
  7. alex

    alex Administrator Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,020
    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