Fixes two bugs in the new OpenId implementation.
authorVincent Zanotti <vincent.zanotti@m4x.org>
Sat, 6 Jun 2009 00:18:51 +0000 (02:18 +0200)
committerVincent Zanotti <vincent.zanotti@m4x.org>
Sat, 6 Jun 2009 00:18:51 +0000 (02:18 +0200)
Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
modules/openid.php
modules/openid/openid.inc.php

index 5b4eaff..6b8f031 100644 (file)
@@ -118,7 +118,7 @@ class OpenidModule extends PLModule
                 $openid_args = $server->GetQueryStringForRequest();
                 if (S::logged()) {
                     pl_redirect('openid/trust', $openid_args);
-                } else if (count($_POST)) {
+                } else if (Post::has('openid_mode')) {
                     pl_redirect('openid', $openid_args);
                 } else {
                     return PL_DO_AUTH;
index e289339..455e9df 100644 (file)
@@ -200,7 +200,8 @@ class OpenId
     {
         if ($response) {
             $web_response = $this->server->encodeResponse($response);
-            header(sprintf('HTTP/1.1 %d', $web_response->code), true, $web_response->code);
+            header(sprintf('%s %d', $_SERVER['SERVER_PROTOCOL'], $web_response->code),
+                   true, $web_response->code);
 
             foreach ($web_response->headers as $key => $value) {
                 header(sprintf('%s: %s', $key, $value));