summaryrefslogtreecommitdiff
path: root/modules/openid
diff options
context:
space:
mode:
Diffstat (limited to 'modules/openid')
-rw-r--r--modules/openid/openid.inc28
-rw-r--r--modules/openid/openid.module24
-rw-r--r--modules/openid/openid.pages.inc8
-rw-r--r--modules/openid/xrds.inc4
4 files changed, 32 insertions, 32 deletions
diff --git a/modules/openid/openid.inc b/modules/openid/openid.inc
index db979b67e..c39cd8e40 100644
--- a/modules/openid/openid.inc
+++ b/modules/openid/openid.inc
@@ -7,10 +7,10 @@
*/
// Diffie-Hellman Key Exchange Default Value.
-define('OPENID_DH_DEFAULT_MOD', '155172898181473697471232257763715539915724801'.
- '966915404479707795314057629378541917580651227423698188993727816152646631'.
- '438561595825688188889951272158842675419950341258706556549803580104870537'.
- '681476726513255747040765857479291291572334510643245094715007229621094194'.
+define('OPENID_DH_DEFAULT_MOD', '155172898181473697471232257763715539915724801' .
+ '966915404479707795314057629378541917580651227423698188993727816152646631' .
+ '438561595825688188889951272158842675419950341258706556549803580104870537' .
+ '681476726513255747040765857479291291572334510643245094715007229621094194' .
'349783925984760375594985848253359305585439638443');
// Constants for Diffie-Hellman key exchange computations.
@@ -29,11 +29,11 @@ define('OPENID_NS_1_0', 'http://openid.net/signon/1.0');
function openid_redirect_http($url, $message) {
$query = array();
foreach ($message as $key => $val) {
- $query[] = $key .'='. urlencode($val);
+ $query[] = $key . '=' . urlencode($val);
}
$sep = (strpos($url, '?') === FALSE) ? '?' : '&';
- header('Location: '. $url . $sep . implode('&', $query), TRUE, 302);
+ header('Location: ' . $url . $sep . implode('&', $query), TRUE, 302);
exit;
}
@@ -41,7 +41,7 @@ function openid_redirect_http($url, $message) {
* Creates a js auto-submit redirect for (for the 2.x protocol)
*/
function openid_redirect($url, $message) {
- $output = '<html><head><title>'. t('OpenID redirect') ."</title></head>\n<body>";
+ $output = '<html><head><title>' . t('OpenID redirect') . "</title></head>\n<body>";
$output .= drupal_get_form('openid_redirect_form', $url, $message);
$output .= '<script type="text/javascript">document.getElementById("openid-redirect-form").submit();</script>';
$output .= "</body></html>\n";
@@ -109,7 +109,7 @@ function _openid_normalize_url($url) {
$normalized_url = $url;
if (stristr($url, '://') === FALSE) {
- $normalized_url = 'http://'. $url;
+ $normalized_url = 'http://' . $url;
}
if (substr_count($normalized_url, '/') < 3) {
@@ -148,7 +148,7 @@ function _openid_encode_message($message) {
if ($encoded_message != '') {
$encoded_message .= '&';
}
- $encoded_message .= rawurlencode(trim($parts[0])) .'='. rawurlencode(trim($parts[1]));
+ $encoded_message .= rawurlencode(trim($parts[0])) . '=' . rawurlencode(trim($parts[1]));
}
}
@@ -191,7 +191,7 @@ function _openid_nonce() {
*/
function _openid_link_href($rel, $html) {
$rel = preg_quote($rel);
- preg_match('|<link\s+rel=["\'](.*)'. $rel .'(.*)["\'](.*)/?>|iUs', $html, $matches);
+ preg_match('|<link\s+rel=["\'](.*)' . $rel . '(.*)["\'](.*)/?>|iUs', $html, $matches);
if (isset($matches[3])) {
preg_match('|href=["\']([^"]+)["\']|iU', $matches[3], $href);
return trim($href[1]);
@@ -203,7 +203,7 @@ function _openid_link_href($rel, $html) {
* Pull the http-equiv attribute out of an html meta element
*/
function _openid_meta_httpequiv($equiv, $html) {
- preg_match('|<meta\s+http-equiv=["\']'. $equiv .'["\'](.*)/?>|iUs', $html, $matches);
+ preg_match('|<meta\s+http-equiv=["\']' . $equiv . '["\'](.*)/?>|iUs', $html, $matches);
if (isset($matches[1])) {
preg_match('|content=["\']([^"]+)["\']|iUs', $matches[1], $content);
if (isset($content[1])) {
@@ -226,8 +226,8 @@ function _openid_signature($association, $message_array, $keys_to_sign) {
$sign_data = array();
foreach ($keys_to_sign as $key) {
- if (isset($message_array['openid.'. $key])) {
- $sign_data[$key] = $message_array['openid.'. $key];
+ if (isset($message_array['openid.' . $key])) {
+ $sign_data[$key] = $message_array['openid.' . $key];
}
}
@@ -356,7 +356,7 @@ function _openid_dh_rand($stop) {
}
do {
- $bytes = "\x00". _openid_get_bytes($nbytes);
+ $bytes = "\x00" . _openid_get_bytes($nbytes);
$n = _openid_dh_binary_to_long($bytes);
// Keep looping if this value is in the low duplicated range.
} while (bccomp($n, $duplicate) < 0);
diff --git a/modules/openid/openid.module b/modules/openid/openid.module
index 3e456f2b9..80f8ca655 100644
--- a/modules/openid/openid.module
+++ b/modules/openid/openid.module
@@ -43,17 +43,17 @@ function openid_help($path, $arg) {
switch ($path) {
case 'user/%/openid':
- $output = '<p>'. t('This site supports <a href="@openid-net">OpenID</a>, a secure way to log into many websites using a single username and password. OpenID can reduce the necessity of managing many usernames and passwords for many websites.', array('@openid-net' => url('http://openid.net'))) .'</p>';
- $output .= '<p>'. t('To use OpenID you must first establish an identity on a public or private OpenID server. If you do not have an OpenID and would like one, look into one of the <a href="@openid-providers">free public providers</a>. You can find out more about OpenID at <a href="@openid-net">this website</a>.', array('@openid-providers' => url('http://openid.net/wiki/index.php/OpenIDServers'), '@openid-net' => url('http://openid.net'))) .'</p>';
- $output .= '<p>'. t('If you already have an OpenID, enter the URL to your OpenID server below (e.g. myusername.openidprovider.com). Next time you login, you will be able to use this URL instead of a regular username and password. You can have multiple OpenID servers if you like; just keep adding them here.') .'</p>';
+ $output = '<p>' . t('This site supports <a href="@openid-net">OpenID</a>, a secure way to log into many websites using a single username and password. OpenID can reduce the necessity of managing many usernames and passwords for many websites.', array('@openid-net' => url('http://openid.net'))) . '</p>';
+ $output .= '<p>' . t('To use OpenID you must first establish an identity on a public or private OpenID server. If you do not have an OpenID and would like one, look into one of the <a href="@openid-providers">free public providers</a>. You can find out more about OpenID at <a href="@openid-net">this website</a>.', array('@openid-providers' => url('http://openid.net/wiki/index.php/OpenIDServers'), '@openid-net' => url('http://openid.net'))) . '</p>';
+ $output .= '<p>' . t('If you already have an OpenID, enter the URL to your OpenID server below (e.g. myusername.openidprovider.com). Next time you login, you will be able to use this URL instead of a regular username and password. You can have multiple OpenID servers if you like; just keep adding them here.') . '</p>';
return $output;
case 'admin/help#openid':
- $output = '<p>'. t('OpenID is a secure method for logging into many websites with a single username and password. It does not require special software, and it does not share passwords with any site to which it is associated; including your site.') .'</p>';
- $output .= '<p>'. t('Users can create accounts using their OpenID, assign one or more OpenIDs to an existing account, and log in using an OpenID. This lowers the barrier to registration, which is good for the site, and offers convenience and security to the users. OpenID is not a trust system, so email verification is still necessary. The benefit stems from the fact that users can have a single password that they can use on many websites. This means they can easily update their single password from a centralized location, rather than having to change dozens of passwords individually.') .'</p>';
- $output .= '<p>'. t('The basic concept is as follows: A user has an account on an OpenID server. This account provides them with a unique URL (such as myusername.openidprovider.com). When the user comes to your site, they are presented with the option of entering this URL. Your site then communicates with the OpenID server, asking it to verify the identity of the user. If the user is logged into their OpenID server, the server communicates back to your site, verifying the user. If they are not logged in, the OpenID server will ask the user for their password. At no point does your site record, or need to record the user\'s password.') .'</p>';
- $output .= '<p>'. t('More information on OpenID is available at <a href="@openid-net">OpenID.net</a>.', array('@openid-net' => url('http://openid.net'))) .'</p>';
- $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@handbook">OpenID module</a>.', array('@handbook' => 'http://drupal.org/handbook/modules/openid')) .'</p>';
+ $output = '<p>' . t('OpenID is a secure method for logging into many websites with a single username and password. It does not require special software, and it does not share passwords with any site to which it is associated; including your site.') . '</p>';
+ $output .= '<p>' . t('Users can create accounts using their OpenID, assign one or more OpenIDs to an existing account, and log in using an OpenID. This lowers the barrier to registration, which is good for the site, and offers convenience and security to the users. OpenID is not a trust system, so email verification is still necessary. The benefit stems from the fact that users can have a single password that they can use on many websites. This means they can easily update their single password from a centralized location, rather than having to change dozens of passwords individually.') . '</p>';
+ $output .= '<p>' . t('The basic concept is as follows: A user has an account on an OpenID server. This account provides them with a unique URL (such as myusername.openidprovider.com). When the user comes to your site, they are presented with the option of entering this URL. Your site then communicates with the OpenID server, asking it to verify the identity of the user. If the user is logged into their OpenID server, the server communicates back to your site, verifying the user. If they are not logged in, the OpenID server will ask the user for their password. At no point does your site record, or need to record the user\'s password.') . '</p>';
+ $output .= '<p>' . t('More information on OpenID is available at <a href="@openid-net">OpenID.net</a>.', array('@openid-net' => url('http://openid.net'))) . '</p>';
+ $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@handbook">OpenID module</a>.', array('@handbook' => 'http://drupal.org/handbook/modules/openid')) . '</p>';
return $output;
}
}
@@ -76,8 +76,8 @@ function openid_user($op, &$edit, &$account, $category = NULL) {
*/
function openid_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'user_login_block' || $form_id == 'user_login') {
- drupal_add_css(drupal_get_path('module', 'openid') .'/openid.css', 'module');
- drupal_add_js(drupal_get_path('module', 'openid') .'/openid.js');
+ drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css', 'module');
+ drupal_add_js(drupal_get_path('module', 'openid') . '/openid.js');
if (!empty($form_state['post']['openid_identifier'])) {
$form['name']['#required'] = FALSE;
$form['pass']['#required'] = FALSE;
@@ -190,7 +190,7 @@ function openid_begin($claimed_id, $return_to = '', $form_values = array()) {
$identity = $claimed_id;
}
- if (isset($services[0]['types']) && is_array($services[0]['types']) && in_array(OPENID_NS_2_0 .'/server', $services[0]['types'])) {
+ if (isset($services[0]['types']) && is_array($services[0]['types']) && in_array(OPENID_NS_2_0 . '/server', $services[0]['types'])) {
$identity = 'http://specs.openid.net/auth/2.0/identifier_select';
}
$authn_request = openid_authentication_request($claimed_id, $identity, $return_to, $assoc_handle, $services[0]['version']);
@@ -267,7 +267,7 @@ function openid_discovery($claimed_id) {
$xrds_url = $claimed_id;
if (_openid_is_xri($claimed_id)) {
- $xrds_url = 'http://xri.net/'. $claimed_id;
+ $xrds_url = 'http://xri.net/' . $claimed_id;
}
$url = @parse_url($xrds_url);
if ($url['scheme'] == 'http' || $url['scheme'] == 'https') {
diff --git a/modules/openid/openid.pages.inc b/modules/openid/openid.pages.inc
index 981a6d11b..57f2687f2 100644
--- a/modules/openid/openid.pages.inc
+++ b/modules/openid/openid.pages.inc
@@ -29,7 +29,7 @@ function openid_authentication_page() {
*/
function openid_user_identities($account) {
drupal_set_title(check_plain($account->name));
- drupal_add_css(drupal_get_path('module', 'openid') .'/openid.css', 'module');
+ drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css', 'module');
// Check to see if we got a response
$result = openid_complete();
@@ -44,7 +44,7 @@ function openid_user_identities($account) {
$result = db_query("SELECT * FROM {authmap} WHERE module='openid' AND uid=%d", $account->uid);
while ($identity = db_fetch_object($result)) {
- $rows[] = array($identity->authname, l(t('Delete'), 'user/'. $account->uid .'/openid/delete/'. $identity->aid));
+ $rows[] = array($identity->authname, l(t('Delete'), 'user/' . $account->uid . '/openid/delete/' . $identity->aid));
}
$output = theme('table', $header, $rows);
@@ -74,7 +74,7 @@ function openid_user_add_validate($form, &$form_state) {
form_set_error('openid_identifier', t('That OpenID is already in use on this site.'));
}
else {
- $return_to = url('user/'. arg(1) .'/openid', array('absolute' => TRUE));
+ $return_to = url('user/' . arg(1) . '/openid', array('absolute' => TRUE));
openid_begin($form_state['values']['openid_identifier'], $return_to);
}
}
@@ -87,5 +87,5 @@ function openid_user_delete($account, $aid = 0) {
if (db_affected_rows()) {
drupal_set_message(t('OpenID deleted.'));
}
- drupal_goto('user/'. $account->uid .'/openid');
+ drupal_goto('user/' . $account->uid . '/openid');
}
diff --git a/modules/openid/xrds.inc b/modules/openid/xrds.inc
index 955876881..cd862cdec 100644
--- a/modules/openid/xrds.inc
+++ b/modules/openid/xrds.inc
@@ -36,8 +36,8 @@ function _xrds_element_end(&$parser, $name) {
$name = _xrds_strip_namespace($name);
if ($name == 'SERVICE') {
- if (in_array(OPENID_NS_2_0 .'/signon', $xrds_current_service['types']) ||
- in_array(OPENID_NS_2_0 .'/server', $xrds_current_service['types'])) {
+ if (in_array(OPENID_NS_2_0 . '/signon', $xrds_current_service['types']) ||
+ in_array(OPENID_NS_2_0 . '/server', $xrds_current_service['types'])) {
$xrds_current_service['version'] = 2;
}
elseif (in_array(OPENID_NS_1_1, $xrds_current_service['types']) ||