Mewp / lightopenid

Automatically exported from code.google.com/p/lightopenid
MIT License
4 stars 12 forks source link

Cannot get attributes, undefined variable #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I get an "Undefined variable: attributes" when trying to call the 
getAttributes() method after a successful authentication, and I think the 
problem comes from lightOpenID.

Here is the code I use :
if(#user has provided an identifier#) {
    $lightOpenID = new \LightOpenID();
    $lightOpenID->required = array('namePerson/friendly', 'contact/email');
    $lightOpenID->identity = $provider_given_by_user;
    header('Location: '.$lightOpenID->authUrl());
    die;
}
if(isset($_GET['openid_mode'])) {
    $lightOpenID = new \LightOpenID();
    if($lightOpenID->validate()) {
        header('Content-Type: text/plain');
        print_r($lightOpenID->getAttributes());
        die;
    } else {
        die(_('Authentication failed somehow.'));
    }
}

And here is the full stack trace :
Undefined variable: attributes
#0 /staging/src/3rdparty/lightopenid/openid.php(523): Logger::handleError(8, 
'Undefined varia...', '...
#1 /staging/src/3rdparty/lightopenid/openid.php(559): 
LightOpenID->getAxAttributes()
#2 /staging/src/UI/Base/Register.php(146): LightOpenID->getAttributes()

My provider is myOpenid.com and I used the version in 22bb9a0 (master at the 
moment). If you need more information, please ask.

Original issue reported on code.google.com by artefa...@gmail.com on 27 Aug 2010 at 10:51

GoogleCodeExporter commented 9 years ago
I found a trivial fix and it solved the issue here.

You can pull from git://gitorious.org/~artefact2/lightopenid/bugfix-notice.git 
:)

Original comment by artefa...@gmail.com on 28 Aug 2010 at 12:03

GoogleCodeExporter commented 9 years ago
Thanks for reporting it. It's fixed and commited now.

Original comment by mewp...@gmail.com on 31 Aug 2010 at 4:39