Skip to content

Commit

Permalink
Implements x00's proposed fix for OpenID using Session->Stash. closes v…
Browse files Browse the repository at this point in the history
  • Loading branch information
linc committed Sep 16, 2011
1 parent 200768f commit ff6510b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions plugins/OpenID/class.openid.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,14 @@ public function Base_ConnectData_Handler($Sender, $Args) {
return; // this will error out

$this->EventArguments = $Args;
$OpenID = $this->GetOpenID();
if ($OpenID->validate()) {

// Check session before retrieving
$Session = Gdn::Session();
$OpenID = $Session->Stash('OpenID', '', FALSE);
if (!$OpenID)
$OpenID = $this->GetOpenID();

if ($Session->Stash('OpenID', '', FALSE) || $OpenID->validate()) {
$Attr = $OpenID->getAttributes();

$Form = $Sender->Form; //new Gdn_Form();
Expand All @@ -129,6 +135,7 @@ public function Base_ConnectData_Handler($Sender, $Args) {
$Form->SetFormValue('FullName', GetValue('namePerson/first', $Attr).' '.GetValue('namePerson/last', $Attr));
$Form->SetFormValue('Email', GetValue('contact/email', $Attr));
$Sender->SetData('Verified', TRUE);
$Session->Stash('OpenID', $OpenID);
}
}

Expand Down

0 comments on commit ff6510b

Please sign in to comment.