Issue 3: Cannot get attributes, undefined variable
Status:  Fixed
Owner: ----
Closed:  Aug 2010
Reported by artefa...@gmail.com, Aug 27, 2010
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.
Aug 27, 2010
#1 artefa...@gmail.com
I found a trivial fix and it solved the issue here.

You can pull from git://gitorious.org/~artefact2/lightopenid/bugfix-notice.git :)
Aug 31, 2010
Project Member #2 mewp...@gmail.com
Thanks for reporting it. It's fixed and commited now.
Status: Fixed