From aMember Pro Documentation
Revision as of 16:12, 9 November 2011 by Alex (talk | contribs)
Jump to: navigation, search

There are 2 classes available to handle user and admin authentication: Am_Auth_User and Am_Auth_Admin Usage is the same:

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('login', 'password', '');
echo $result->isValid() ? "OK" : ("failed: " . $result->getMessage());