Wikinaut has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/78531


Change subject: Bug 44821: OpenID Consumer wiki stalls with blank page
......................................................................

Bug 44821: OpenID Consumer wiki stalls with blank page

As a consumer wiki, the wiki stalled with a blank page for certain
OpenID Provider verification error cases and the consumer wiki failed
to show the provider response message.

This is fixed by this commit.

Change-Id: Ic828dafdc9b2d908f88b1c52fe9c76693886e92f
---
M CHANGES
M OpenID.i18n.php
M OpenID.php
M SpecialOpenID.body.php
4 files changed, 23 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenID 
refs/changes/31/78531/1

diff --git a/CHANGES b/CHANGES
index 70b463e..583460e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
 CHANGES
 =======
 
+3.41  20130810  bug 44821 OpenID Consumer wiki stalls with blank page for
+                certain OpenID Provider verification error cases
+                (consumer fails to show the provider response message)
 3.40  20130731  bug 44819 introduction of array of $wgOpenIDProviders and
                 $wgOpenIDForcedProvider
 3.33  20130703  bug 50430 fixed null array error for fullname/email in AX array
diff --git a/OpenID.i18n.php b/OpenID.i18n.php
index 5710b58..fdadca4 100644
--- a/OpenID.i18n.php
+++ b/OpenID.i18n.php
@@ -45,7 +45,11 @@
        'openidxrds' => 'Yadis file',
        'openidconvert' => 'OpenID converter',
        'openiderror' => 'Verification error',
+       'openid-error-no-auth' => 'An unspecified authentication 
response/request error occurred during the verification of the OpenID URL $1.',
        'openiderrortext' => 'An error occurred during verification of the 
OpenID URL.',
+       'openid-error-server-response' => "An error occurred during the 
verification of the OpenID URL $1.
+
+The server response was: ''$2''",
        'openid-error-request-forgery' => 'An error occurred: an invalid token 
was found.',
        'openid-error-wrong-force-provider-setting' => 'An internal error 
occured: an incorrect URL value has been found for the forced provider "$1".',
        'openidconfigerror' => 'OpenID configuration error',
diff --git a/OpenID.php b/OpenID.php
index fa58055..e07535e 100644
--- a/OpenID.php
+++ b/OpenID.php
@@ -29,7 +29,7 @@
        exit( 1 );
 }
 
-define( 'MEDIAWIKI_OPENID_VERSION', '3.40 20130808' );
+define( 'MEDIAWIKI_OPENID_VERSION', '3.41 20130810' );
 
 $path = dirname( __FILE__ );
 set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . 
get_include_path() );
diff --git a/SpecialOpenID.body.php b/SpecialOpenID.body.php
index 90b8104..3ab236d 100644
--- a/SpecialOpenID.body.php
+++ b/SpecialOpenID.body.php
@@ -266,42 +266,24 @@
 
                // Handle failure status return values.
                if ( !$auth_request ) {
-                       wfDebug( "OpenID: no auth_request\n" );
-                       $wgOut->showErrorPage( 'openiderror', 'openiderrortext' 
);
+                       wfDebug( "OpenID: no auth_request for {$openid_url}\n" 
);
+                       $wgOut->showErrorPage(
+                               'openiderror',
+                               'openid-error-no-auth',
+                               array( $openid_url )
+                       );
                        return;
                }
 
-/*
-               FIXME
-
-               THIS DOES NOT WORK: THE TWO POST ARGUMENTS ARE NOT CHANGED
-               I DO NOT KNOW WHAT I MADE WRONG HERE
-
-               WORKAROUND: SEE BELOW BEFORE FORM SUBMISSION
-
-               // ask the Server to show identifier selection form
-               // https://developers.google.com/accounts/docs/OpenID#Parameters
-
-               $auth_request->message->setArg(
-                       Auth_OpenID_OPENID_NS,
-                       "identity",
-                       "http://specs.openid.net/auth/2.0/identifier_select";
-               );
-
-               $auth_request->message->setArg(
-                       Auth_OpenID_OPENID_NS,
-                       "claimed_id",
-                       "http://specs.openid.net/auth/2.0/identifier_select";
-               );
-
-               $auth_request->message->updateArgs(
-                       Auth_OpenID_OPENID_NS,
-                       array(
-                               "identity" => 
"http://specs.openid.net/auth/2.0/identifier_select";,
-                               "claimed_id" => 
"http://specs.openid.net/auth/2.0/identifier_select";,
-                       )
-               );
-*/
+               if ( Auth_OpenID::isFailure( $auth_request ) ) {
+                       wfDebug( "OpenID: auth_request failure for 
{$openid_url}:\n" . print_r( $auth_request, true ) ."\n" );
+                       $wgOut->showErrorPage(
+                               'openiderror',
+                               'openid-error-server-response',
+                               array( $openid_url, "{$auth_request->message} 
(status: {$auth_request->status})." )
+                       );
+                       return;
+               }
 
                # Check the processed URLs, too
 

-- 
To view, visit https://gerrit.wikimedia.org/r/78531
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic828dafdc9b2d908f88b1c52fe9c76693886e92f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenID
Gerrit-Branch: master
Gerrit-Owner: Wikinaut <m...@tgries.de>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to