X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fopenid%2Fopenid.inc.php;h=c8c5bf7fe47876c25d17c9715153c7d2ac368363;hb=f7644ca9771d1a9dd59a761f4e00144eb5e46c5e;hp=455e9df2525c48d8c60a1b6f3aecc67868afadee;hpb=c3c43c0ebe734e2b43b5d5fdb6010d08358bc34b;p=platal.git diff --git a/modules/openid/openid.inc.php b/modules/openid/openid.inc.php index 455e9df..c8c5bf7 100644 --- a/modules/openid/openid.inc.php +++ b/modules/openid/openid.inc.php @@ -106,10 +106,11 @@ class OpenId // Answers the current request, and renders the response. Appends the |sreg| // data when not null. - public function AnswerRequest($is_authorized, $user = null, $sreg_data = null) + public function AnswerRequest($is_authorized, $sreg_data = null) { // Creates the response. - if ($is_authorized && $this->request->idSelect() && $user) { + if ($is_authorized && $this->request->idSelect()) { + $user = S::user(); $response = $this->request->answer( $is_authorized, null, $user->login(), $this->GetUserUrl($user)); } else { @@ -203,12 +204,16 @@ class OpenId 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)); - } + if (is_a($response, 'Auth_OpenID_ServerError')) { + print "Erreur lors de l'authentification OpenId: " . $response->toString(); + } else { + foreach ($web_response->headers as $key => $value) { + header(sprintf('%s: %s', $key, $value)); + } - header('Connection: close'); - print $web_response->body; + header('Connection: close'); + print $web_response->body; + } } exit; }