API/Authentication

Discussion in 'aMember Pro v.4' started by fmagusto, Jul 18, 2012.

  1. fmagusto

    fmagusto Guest

    Hi, I test
    API/Authentication

    http://www.amember.com/docs/API/Authentication with :

    <?php
    require_once '/home/infoconc/www/amember/library/Am/Di.php';
    Am_Di::getInstance()->authUser->getUser(); // returns User object or null
    Am_Di::getInstance()->authUser->getUserId() // returns user_id or null
    $result = Am_Di::getInstance()->authUser->login('xxxx', 'xxxxx', '11.22.33.44');
    echo $result->isValid() ? "OK" : ("failed: " . $result->getMessage());
    Am_Di::getInstance()->authUser->logout();
    ?>

    and i receive : Parse error: syntax error, unexpected T_VARIABLE in /home/infoconc/www/MyWebserviceProject/admin/main/verifmembre.php on line 5
  2. fmagusto

    fmagusto Guest

    I am four for the bug in tuto,
    Am_Di::getInstance()->authUser->getUserId() // returns user_id or null

    and is
    Am_Di::getInstance()->authUser->getUserId(); // returns user_id or null
  3. fmagusto

    fmagusto Guest

    but now i have this error :
    Fatal error: Class 'sfServiceContainerBuilder' not found in /home/infoconc/www/amember/library/Am/Di.php on line 162
  4. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
    Look I updated samples on http://www.amember.com/docs/API/Authentication

    And, all code pieces are no supposed to be running in one session. There are samples for getting currently logged-in user info, login customer, and logout customer.
  5. fmagusto

    fmagusto Guest

    Thx is work! I have dev à script for login in m'y App iPhone.
  6. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    fmagusto: what is your iPhone app?
  7. fmagusto

    fmagusto Guest

    hi a app dev for my subscriber. And i utilsie amember for connect. and is good job :)

Share This Page