Fixed OpenID support - refs #5500

skala
Yannick Warnier 12 years ago
parent 053bf1db16
commit c0584dd992
  1. 12
      main/auth/openid/login.php
  2. 6
      main/auth/openid/openid.lib.php

@ -44,7 +44,7 @@ function openid_form() {
*/
function openid_begin($claimed_id, $return_to = '', $form_values = array()) {
$claimed_id = _openid_normalize($claimed_id);
$claimed_id = _openid_normalize($claimed_id);
$services = openid_discovery($claimed_id);
if (count($services) == 0) {
echo 'Sorry, that is not a valid OpenID. Please ensure you have spelled your ID correctly.';
@ -61,8 +61,8 @@ function openid_begin($claimed_id, $return_to = '', $form_values = array()) {
// If bcmath is present, then create an association
$assoc_handle = '';
if (function_exists('bcadd')) {
$assoc_handle = openid_association($op_endpoint);
if (function_exists('bcadd')) {
$assoc_handle = openid_association($op_endpoint);
}
// Now that there is an association created, move on
// to request authentication from the IdP
@ -71,10 +71,10 @@ function openid_begin($claimed_id, $return_to = '', $form_values = array()) {
$identity = 'http://openid.net/identifier_select/2.0';
}
$authn_request = openid_authentication_request($claimed_id, $identity, $return_to, $assoc_handle, $services[0]['version']);
if ($services[0]['version'] == 2) {
openid_redirect($op_endpoint, $authn_request);
if ($services[0]['version'] == 2) {
echo openid_redirect($op_endpoint, $authn_request);
} else {
openid_redirect_http($op_endpoint, $authn_request);
echo openid_redirect_http($op_endpoint, $authn_request);
}
}

@ -43,7 +43,7 @@ function openid_redirect_http($url, $message) {
* Creates a js auto-submit redirect for (for the 2.x protocol)
* This function should be deprecated for 1.8.6.2 needs documentation
*/
function openid_redirect($url, $message) {
function openid_redirect($url, $message) {
$output = '<html><head><title>' . get_lang('OpenIDRedirect') . "</title></head>\n<body>";
$output .= '<form method="post" action="' . $url . '" id="openid-redirect-form">';
foreach ($message as $key => $value) {
@ -52,8 +52,8 @@ function openid_redirect($url, $message) {
$output .= '<noscript><input type="submit" name="submit" value="' . get_lang('Send') . '"/></noscript>';
$output .= '</form>';
$output .= '<script type="text/javascript">document.getElementById("openid-redirect-form").submit();</script>';
$output .= "</body></html>";
return $output;
$output .= "</body></html>";
return $output;
}
/**

Loading…
Cancel
Save