diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9acbda7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +end_of_line = lf +trim_trailing_whitespace = true +charset = utf-8 +indent_style = tab +indent_size = 4 diff --git a/README.md b/README.md new file mode 100644 index 0000000..b1ec959 --- /dev/null +++ b/README.md @@ -0,0 +1,307 @@ +# OpenID # +**Contributors:** willnorris, factoryjoe, pfefferle +**Tags:** openid, authentication, login, comments +**Requires at least:** 2.8 +**Tested up to:** 4.3 +**Stable tag:** 3.4.0 + +Allows WordPress to provide and consumer OpenIDs for authentication of users and comments. + +## Description ## + +OpenID is an [open standard][] that allows users to authenticate to websites +without having to create a new password. This plugin allows users to login to +their local WordPress account using an OpenID, as well as enabling commenters +to leave authenticated comments with OpenID. The plugin also includes an OpenID +provider, enabling users to login to OpenID-enabled sites using their +own personal WordPress account. [XRDS-Simple][] is required for the OpenID +Provider and some features of the OpenID Consumer. + +Developer documentation, which includes all of the public methods and hooks for +integrating with and extending the plugin, can be found [here][dev-doc]. + +[open standard]: http://openid.net/ +[XRDS-Simple]: http://wordpress.org/plugins/xrds-simple/ +[dev-doc]: http://wiki.diso-project.org/wordpress-openid-api + +## Installation ## + +This plugin follows the [standard WordPress installation method][]: + +1. Upload the `openid` folder to the `/wp-content/plugins/` directory +1. Activate the plugin through the 'Plugins' menu in WordPress +1. Configure the plugin through the 'OpenID' section of the 'Options' menu + +[standard WordPress installation method]: http://codex.wordpress.org/Managing_Plugins#Installing_Plugins + + +## Frequently Asked Questions ## + +### Why do I get blank screens when I activate the plugin? ### + +In some cases the plugin may have problems if not enough memory has been +allocated to PHP. Try ensuring that the PHP memory\_limit is at least 8MB +(limits of 64MB are not uncommon). + +### Why don't `https` OpenIDs work? ### + +SSL certificate problems creep up when working with some OpenID providers +(namely MyOpenID). This is typically due to an outdated CA cert bundle being +used by libcurl. An explanation of the problem and a couple of solutions +can be found [here][libcurl]. + +[libcurl]: http://lists.openidenabled.com/pipermail/dev/2007-August/000784.html + +### Why do I get the error "Invalid openid.mode ''"? ### + +There are actually a couple of reasons that can cause this, but it seems one of +the more common causes is a conflict with certain mod_security rules. See +[this blog post][ioni2] for instructions on how to resolve this issue. + +[ioni2]: http://ioni2.com/2009/wordpress-openid-login-failed-invalid-openid-mode-no-mode-set-solved-for-both-wordpress-and-drupal/ + + +### How do I use SSL for OpenID transactions? ### + +First, be aware that this only works in WordPress 2.6 and up. Make sure you've +turned on SSL in WordPress by [defining either of the following][wp-ssl] +globals as "true" in your `wp-config.php` file: + + - FORCE\_SSL\_LOGIN + - FORCE\_SSL\_ADMIN + +Then, also define the following global as "true" in your `wp-config.php` file: + + - OPENID\_SSL + +Be aware that you will almost certainly have trouble with this if you are not +using a certificate purchased from a well-known certificate authority. + +[wp-ssl]: http://codex.wordpress.org/Administration_Over_SSL + +### How do I get help if I have a problem? ### + +Please direct support questions to the "Plugins and Hacks" section of the +[WordPress.org Support Forum][]. Just make sure and include the tag 'openid' +so that I'll see your post. Additionally, you can file a bug +report at . + +[WordPress.org Support Forum]: http://wordpress.org/support/ + + +## Screenshots ## + +### 1. Commentors can use their OpenID when leaving a comment ### +![Commentors can use their OpenID when leaving a comment](http://s.wordpress.org/extend/plugins/openid/screenshot-1.png) + +### 2. Users can login with their OpenID in place of a traditional username and password ### +![Users can login with their OpenID in place of a traditional username and password](http://s.wordpress.org/extend/plugins/openid/screenshot-2.png) + +### 3. Users authorized to use the OpenID Provider can delegate to a different provider ### +![Users authorized to use the OpenID Provider can delegate to a different provider](http://s.wordpress.org/extend/plugins/openid/screenshot-3.png) + +### 4. Users can add additional OpenIDs which they can use to login to WordPress ### +![Users can add additional OpenIDs which they can use to login to WordPress](http://s.wordpress.org/extend/plugins/openid/screenshot-4.png) + +### 5. Users authorized to use the OpenID Provider can monitor which sites they've logged in to ### +![Users authorized to use the OpenID Provider can monitor which sites they've logged in to](http://s.wordpress.org/extend/plugins/openid/screenshot-5.png) + + + +## Changelog ## + +Project maintined on github at +[diso/wordpress-openid](https://github.com/diso/wordpress-openid). + +### version 3.4.0 (Jul XX, 2015) ### + - update to latest OpenID library (includes lots of bug fixes, particularly with PHP 5.3). Full changelog [on github](https://github.com/openid/php-openid). + - fixed various PHP warnings/errors. + - various improvements and bugfixes (props @rodrigoprimo). + - attempt to use email as username before url for open id new user (props @yincrash). + - chinese and german (props Stephan Richter) translations. + - added WebFinger support + +Full changelog on [github](https://github.com/diso/wordpress-openid/compare/v3.3.4...v3.4.0). + +### version 3.3.4 (Nov 16, 2012) ### + - update to latest OpenID library (includes lots of bug fixes, particularly with PHP 5.3). Full changelog [on github](https://github.com/openid/php-openid). + - various bug fixes. Full changelog [on github](https://github.com/diso/wordpress-openid). + +### version 3.3.3 (Aug 24, 2010) ### + - add/update danish, japanese, and spanish translations + - update to latest version of php-openid library + - fix a few PHP and WordPress warnings and notices + +### version 3.3.2 (Nov 06, 2009) ### + - add localizations for czech, danish, french, spanish, and vietnamese. Some are more up to date than others. More are welcome, see http://code.google.com/p/diso/issues/detail?id=26 + - remove stylesheet for recent comments widget, since it breaks the style for OpenID comments + - various fixes with administration panels + +### version 3.3.1 (Sep 28, 2009) ### + - tiny bug in get_user_openids causing it to always return empty array + +### version 3.3 (Sep 28, 2009) ### + - minimum required version has been bumped to WordPress 2.8 + - fix support for WordPress MU + - new, less obtrusive UI for comment form. Should also work with all themes in some form (with or without js). + - many administrative options have been moved to their respective locations on core WordPress Settings pages + - drop support for experimental EAUT and IDIB protocols + - drop support for installing the plugin in mu-plugins folder + - always include 'index.php' on OpenID endpoint URLs. Without that, some deployments were having problems. + - fix bug relating to trackbacks and pingbacks + - fix bug (#121) relating to unregistered options (props tom.tdw for the patch) + - lots of minor bug fixes + +### version 3.2.3 (Jul 20, 2009) ### + - fix XSS vulnerability. (props Stuart Metcalfe) + +### version 3.2.2 (Mar 19, 2009) ### + - fix problems when using non-index.php permalinks with non-apache web servers + - ensure that show\_on\_front option is not empty + - function name typo (props gunemalli) + - fix deprecated pass-by-reference call in php-openid library (props jschuur) + - fix UI bug on registration form with IE browsers (props oledole) + - UI tweaks to better match WP 2.7 + - update a few strings for localization and POT file + +### version 3.2.1 (Feb 13, 2009) ### + - patch php-openid library to fix XRDS handling (thanks Mike Jones for helping find this) + - add default values for some openid vars -- necessary for OP-initiated login + - fix bug with OpenID server where OpenID request was sometimes lost + - add filter for openid\_trust\_root + +### version 3.2 (Jan 20, 2009) ### + - add uninstall hook for WordPress 2.7 -- this will remove all traces of the plugin from the database + - UI fixes for WordPress 2.7 + - add settings link to plugins page + - silence XML parsing errors with PHP4 + - ensure wp\_scripts is set + - ensure openid comment processing occurs after akismet + - add ellipses to truncated OpenIDs (fixes #94) + - fix bug where Yahoo! OpenIDs weren't matching profile URL (fixes #98) + - don't return empty SREG values + - Add support for consuming Attribute Exchange + - use a single return\_to URL for all OpenID actions + - cleaner OpenID service URLs when permalinks configured to do so (all path, no query string) + - fixed issue where OpenID Server would sometimes break depending on a users permalink structure (fixed #101) + - fixed issue where OpenID consumer would sometimes break if mod\_encoding was enabled in Apache (used for WebDAV) (fixed #96) + - don't redirect when performing discovery on OpenID trust root + +### version 3.1.4 (Nov 04, 2008) ### + - allow OP extensions to include XRDS Types in login service + - run OpenID comment processor after Akismet, and skip if Akismet marks comment as spam + +### version 3.1.3 (Oct 27, 2008) ### + - fix error message if /dev/urandom is not readable + +### version 3.1.2 (Oct 26, 2008) ### + - ensure source of randomness is set properly + - prevent duplicate cleanup\_openid cron jobs + - prevent SQL errors on activation + - suppress verbose error logging with XML parsing + +### version 3.1.1 (Oct 20, 2008) ### + - fix bug with OpenID Provider XRDS code that prevents ability to login to some sites (like plaxo.com) + +### version 3.1 (Oct 19, 2008) ### + - added hidden constant to set custom comments post page (OPENID\_COMMENTS\_POST\_PAGE) + - additional option to skip name and email check for OpenID comments + - use preferred username (from SREG) if possible when creating new account + - truncate long URLs when used as display\_name for comments + - numerous bug fixes, including bug with registration form + +### version 3.0 (Oct 02, 2008) ### + - includes OpenID Provider + - supports OpenID delegation + - add experimental support for Email Address to URL Transformation + - many new hooks for extension and integration + - major code refactoring + +### version 2.2.2 (Aug 06, 2008) ### + - fix bug with "unauthorized return\_to URL" (only known problem with [openid.pl][]) + - fix bug with comments containing non-latin characters + - respect CUSTOM\_USER\_META\_TABLE constant if present (also added CUSTOM\_OPENID\_IDENTITY\_TABLE constant) + - add experimental support for Identity in the Browser + +### version 2.2.1 (Jul 25, 2008) ### + - fixed EAUT handling code + - fixed bug that broke comments containing double quotes (") + +### version 2.2.0 (Jul 23, 2008) ### + - use POST replay for comments (fixes compatibility with other comment plugins) + - only build openid object when needed (much better memory usage) + - support for Email Address to URL Transformation (see eaut.org) + - fixed bug when using suhosin (hardened php) + - use hooks for gathering user data (more extensible) + - fixed openid spoofing vulnerability (http://plugins.trac.wordpress.org/ticket/702) + - lots code refactoring and UI cleanup + +### version 2.1.9 (May 20, 2008) ### + - fix javascript loading issues + - fix various bugs when creating new account with OpenID + - fix error message, and add new warning prompt when removing last OpenID for account + +### version 2.1.8 (Apr 02, 2008) ### + - fix UI issue with wp-login.php page in WP2.5 + - fix bug printing supported curl protocols (http://wordpress.org/support/topic/159062) + - fix jquery bug while adding category in WP2.5 (http://wordpress.org/support/topic/164305) + +### version 2.1.7 (Mar 21, 2008) ### + - remove php5 dependency bug... AGAIN! + - also remove some other custom changes to php-openid I forgot were in there. This may actually re-introduce some edge-case + bugs, but I'd rather expose them so that we can get the appropriate patches pushed upstream if they really are necessary. + +### version 2.1.6 (Mar 20, 2008) ### + - update php-openid library to latest. Now properly supports Yahoo's OpenID provider. + +### version 2.1.5 (Mar 20, 2008) ### + - add support for wordpress v2.5 + +### version 2.1.4 (Feb 13, 2008) ### + - fix php5 dependency bug + - improve jQuery code to reduce problems with other js libraries + +### version 2.1.3 (Feb 06, 2008) ### + - address security bug mentioned [here](http://www.gnucitizen.org/blog/hijacking-openid-enabled-accounts). Props Sam Alexander + +### version 2.1.2 ### + - minor typo in profile data code + +### version 2.1.1 ### + - minor bug where profile data is being overwritten + +### version 2.1 ### + - added FAQ items for plugin updater and adding an OpenID field to a comment form + - better tracking of which users have OpenIDs linked to their local WP account + - better automatic username generation + - fixed bug where non-OpenID websites had problems (bug [729]) + - upgrade to version 2.0 of JanRain OpenID library + - admin option to rebuild tables + +### version 2.0 ### + - simplified admin interface by using reasonable defaults. Default behaviors include: + - "unobtrusive mode" + - always add openid to wp-login.php + - always use WP option 'home' for the trust root + - new features + - hook for trust engine, with very simple implementation included + - supports OpenID 2.0 (draft 12) as well as OpenID 1.1 and SReg 1.0 + - normal collection of bug fixes + +### version 1.0.1 ### + - added wordpress.org style readme.txt + +### version 1.0 (also known as r13) ### + +Full SVN logs are available at . + +[729]: http://dev.wp-plugins.org/ticket/729 +[openid.pl]: http://openid.pl/ + +The original OpenID plugin for WordPress was a collaborative effort between Alan Castonguay and Hans Granqvist. + +Will Norris forked the plugin and has since become the maintainer. + +[Alan Castonguay]: http://verselogic.net/ +[Hans Granqvist]: http://commented.org/ +[Will Norris]: http://willnorris.com/ diff --git a/admin_panels.php b/admin_panels.php index d373d5c..d517bc6 100644 --- a/admin_panels.php +++ b/admin_panels.php @@ -1,6 +1,6 @@ ID, 'openid_delegate', true)) { - $hookname = add_submenu_page('profile.php', __('Your Trusted Sites', 'openid'), + $hookname = add_submenu_page('profile.php', __('Your Trusted Sites', 'openid'), __('Your Trusted Sites', 'openid'), 'read', 'openid_trusted_sites', 'openid_manage_trusted_sites' ); add_action("load-$hookname", 'openid_style' ); add_action("load-$hookname", create_function('', 'wp_enqueue_script("admin-forms");')); @@ -57,7 +57,7 @@ function openid_admin_panels() { // 'users_can_register' option, so only add the OpenID Settings if that is set. If additional OpenID settings // are added to the General Settings page, this check may no longer be necessary if ( get_option('users_can_register') ) { - add_settings_field('openid_general_settings', __('OpenID Settings', 'openid'), 'openid_general_settings', + add_settings_field('openid_general_settings', __('OpenID Settings', 'openid'), 'openid_general_settings', 'general', 'default'); } } @@ -83,7 +83,7 @@ function openid_admin_register_settings() { /** - * Intercept the call to set the openid_cap option. Instead of storing + * Intercept the call to set the openid_cap option. Instead of storing * this in the options table, set the capability on the appropriate roles. */ function openid_set_cap($newvalue, $oldvalue) { @@ -147,7 +147,7 @@ function openid_options_page() { screen_icon('openid'); ?>
@@ -159,8 +159,8 @@ function openid_options_page() { . 'General Settings and Discussion Settings pages.', 'openid') ?>

- ID); ?> @@ -176,7 +176,7 @@ function openid_options_page() {

- role_names as $key => $name) { $name = _x($name, null); $role = $wp_roles->get_role($key); @@ -190,8 +190,8 @@ function openid_options_page() { user_id); return $u->has_cap("use_openid_provider");')); + $users = get_users(); + $users = array_filter($users, create_function('$u', '$u = new WP_User($u->ID); return $u->has_cap("use_openid_provider");')); if (!empty($users)): ?> @@ -206,11 +206,11 @@ function openid_options_page() { ); ?>

- ' . __('A Blog Owner cannot be set for this blog. To set a Blog Owner, ' - . 'first remove the following line from your wp-config.php:', 'openid') + . 'first remove the following line from your wp-config.php:', 'openid') . '
define("OPENID_DISALLOW_OWNER", 1);

'; } else { @@ -229,7 +229,7 @@ function openid_options_page() { } else { echo '

' . sprintf(__('Only the current Blog Owner (%s) can change this setting.', 'openid'), $blog_owner) . '

'; } - } + } ?> @@ -261,7 +261,7 @@ function openid_options_page() { * Handle user management of OpenID associations. * * @submenu_page: profile.php - **/ + */ function openid_profile_panel() { global $error; @@ -287,7 +287,7 @@ function openid_profile_panel() { screen_icon('openid'); ?>
@@ -312,10 +312,10 @@ function openid_profile_panel() {
- +
- + @@ -345,7 +345,7 @@ function openid_profile_panel() {
- +
@@ -368,14 +368,14 @@ function openid_manage_trusted_sites() { $trusted_sites = get_user_meta($user->ID, 'openid_trusted_sites', true); if (!is_array($trusted_sites)) $trusted_sites = array(); - $sites = split("\n", $_REQUEST['sites']); + $sites = explode(PHP_EOL, $_REQUEST['sites']); $count = 0; foreach ($sites as $site) { $site = trim($site); if (empty($site)) continue; - if (strpos($site, 'http') === false || strpos($sites, 'http') != 0) { + if (strpos($site, 'http') === false || strpos($site, 'http') != 0) { $site = 'http://' . $site; } @@ -423,7 +423,7 @@ function openid_manage_trusted_sites() { screen_icon('openid'); ?>
@@ -447,10 +447,10 @@ function openid_manage_trusted_sites() {
- +
- + @@ -524,32 +524,32 @@ function openid_printSystemStatus() { global $wp_version, $wpdb; $paths = explode(PATH_SEPARATOR, get_include_path()); - for($i=0; $ibase_prefix) ? $wpdb->base_prefix : $wpdb->prefix ); - - + + if ( extension_loaded('suhosin') ) { $status[] = array( 'Curl', false, 'Hardened php (suhosin) extension active -- curl version checking skipped.' ); } else { $curl_message = ''; if( function_exists('curl_version') ) { $curl_version = curl_version(); - if(isset($curl_version['version'])) + if(isset($curl_version['version'])) $curl_message .= 'Version ' . $curl_version['version'] . '. '; - if(isset($curl_version['ssl_version'])) + if(isset($curl_version['ssl_version'])) $curl_message .= 'SSL: ' . $curl_version['ssl_version'] . '. '; if(isset($curl_message['libz_version'])) $curl_message .= 'zlib: ' . $curl_version['libz_version'] . '. '; @@ -578,7 +578,7 @@ function openid_printSystemStatus() { $status[] = array( 'Big Integer support', false, 'The OpenID Library is operating in Dumb Mode. Recommend installing GMP support.' ); } - + $status[] = array( 'Plugin Revision', 'info', OPENID_PLUGIN_REVISION); $status[] = array( 'Plugin Database Revision', 'info', get_option('openid_db_revision')); @@ -587,16 +587,16 @@ function openid_printSystemStatus() { } else { $status[] = array( 'XRDS-Simple', false, 'XRDS-Simple plugin is not installed. Some features may not work properly (including providing OpenIDs).'); } - + $openid_enabled = openid_enabled(); - $status[] = array( 'Overall Plugin Status', ($openid_enabled), + $status[] = array( 'Overall Plugin Status', ($openid_enabled), ($openid_enabled ? '' : 'There are problems above that must be dealt with before the plugin can be used.') ); if( $openid_enabled ) { // Display status information - echo'

' . __('Status information:', 'openid') . ' ' . __('All Systems Nominal', 'openid') + echo'

' . __('Status information:', 'openid') . ' ' . __('All Systems Nominal', 'openid') . ' (' . __('Toggle More/Less', 'openid') . ')

'; } else { - echo '

' . __('Plugin is currently disabled. Fix the problem, then Deactivate/Reactivate the plugin.', 'openid') + echo '

' . __('Plugin is currently disabled. Fix the problem, then Deactivate/Reactivate the plugin.', 'openid') . '

'; } echo '
'; @@ -626,7 +626,7 @@ function openid_printSystemStatus() { */ function openid_profile_management() { global $action; - + wp_reset_vars( array('action') ); switch( $action ) { @@ -731,7 +731,7 @@ function openid_profile_delete_openids($delete) { foreach ($urls as $url) { if (in_array(md5($url), $_REQUEST['delete'])) { if (openid_drop_identity($user->ID, $url)) { - $count++; + $count++; } } } @@ -753,7 +753,7 @@ function openid_profile_delete_openids($delete) { return; } - + openid_message(__('OpenID association delete failed: Unknown reason.', 'openid')); openid_status('error'); } @@ -778,7 +778,7 @@ function openid_finish_verify($identity_url, $action) { $message = 2; } else { $message = 3; - + // ensure that profile URL is a verified OpenID require_once 'Auth/OpenID.php'; require_once(ABSPATH . 'wp-admin/includes/admin.php'); @@ -829,7 +829,7 @@ function openid_ensure_url_match($user, $url = null) { foreach ($identities as $id) { $id = Auth_OpenID::normalizeUrl($id); - if ($id == $url) return true; + if ($id == $url) return true; } return false; @@ -849,7 +849,7 @@ function openid_extend_profile() {
@@ -911,7 +911,7 @@ function openid_wpmu_options() { $registration = get_site_option('registration'); if ( $registration == 'all' || $registration == 'user' ): ?> -

'.__('OpenID Delegation allows you to use an external OpenID provider of your choice.', 'openid').'

- ' + ' . __('To delegate, enter a valid OpenID. Otherwise leave this blank.', 'openid') . '

+
@@ -957,7 +957,7 @@ function openid_general_settings() { @@ -978,7 +978,7 @@ function openid_general_settings() { function openid_discussion_settings() { ?> @@ -988,7 +988,7 @@ function openid_discussion_settings() { @@ -996,7 +996,7 @@ function openid_discussion_settings() { @@ -1005,5 +1005,3 @@ function openid_discussion_settings() { diff --git a/comments.php b/comments.php index d08f798..35cd134 100644 --- a/comments.php +++ b/comments.php @@ -1,6 +1,6 @@ ID ) { + + if ( get_option('require_name_email') && !$user->ID ) { if ( 6 > strlen($comment_author_email) || '' == $comment_author ) { wp_die( __('Error: please fill the required fields (name, email).', 'openid') ); } elseif ( !is_email($comment_author_email)) { @@ -134,7 +134,7 @@ function openid_comment_approval($approved) { * @see get_user_data */ function openid_option_require_name_email( $value ) { - + $comment_page = (defined('OPENID_COMMENTS_POST_PAGE') ? OPENID_COMMENTS_POST_PAGE : 'wp-comments-post.php'); if ($GLOBALS['pagenow'] != $comment_page) { @@ -144,7 +144,7 @@ function openid_option_require_name_email( $value ) { if (array_key_exists('openid_skip', $_REQUEST) && $_REQUEST['openid_skip']) { return get_option('openid_no_require_name') ? false : $value; } - + // make sure we only process this once per request static $bypass; if ($bypass) { @@ -284,7 +284,7 @@ function openid_repost_comment_anonymously($post) { '; } } - + $html .= ''; openid_page($html, __('OpenID Authentication Error', 'openid')); } @@ -301,9 +301,9 @@ function openid_finish_comment($identity_url, $action) { if (empty($identity_url)) { openid_repost_comment_anonymously($_SESSION['openid_comment_post']); } - + openid_set_current_user($identity_url); - + if (is_user_logged_in()) { // simulate an authenticated comment submission $_SESSION['openid_comment_post']['author'] = null; @@ -321,7 +321,7 @@ function openid_finish_comment($identity_url, $action) { } $_SESSION['openid_comment_post']['url'] = $identity_url; } - + // record that we're about to post an OpenID authenticated comment. // We can't actually record it in the database until after the repost below. $_SESSION['openid_posted_comment'] = true; @@ -414,5 +414,3 @@ function openid_recent_comments() { } } } - -?> diff --git a/common.php b/common.php index b3a4b12..61cf0cc 100644 --- a/common.php +++ b/common.php @@ -8,7 +8,9 @@ add_action( 'init', 'openid_textdomain' ); // load textdomain // include internal stylesheet -add_action( 'wp', 'openid_style'); +if (OPENID_ENABLE_CONSUMER) { + add_action( 'wp', 'openid_style'); +} // parse request add_action('parse_request', 'openid_parse_request'); @@ -39,7 +41,7 @@ * Set the textdomain for this plugin so we can support localizations. */ function openid_textdomain() { - load_plugin_textdomain('openid', null, 'openid/localization'); + load_plugin_textdomain('openid', null, dirname(plugin_basename(__FILE__)) . '/localization/'); } @@ -309,6 +311,7 @@ function openid_set_current_user($identity, $remember = true) { * @param string $identity_url OpenID to associate with the newly * created account * @param array $user_data array of user data + * @uses do_action() Calls 'openid_consumer_new_user_custom_data' hook action after creating user */ function openid_create_new_user($identity_url, &$user_data) { global $wpdb; @@ -322,40 +325,53 @@ function openid_create_new_user($identity_url, &$user_data) { $username = openid_generate_new_username($user_data['nickname'], false); } + // try using email address before resorting to URL + if (empty($username) && array_key_exists('user_email', $user_data)) { + $username = openid_generate_new_username($user_data['user_email'], false); + } + // finally, build username from OpenID URL if (empty($username)) { $username = openid_generate_new_username($identity_url); } $user_data['user_login'] = $username; + $user_data['display_name'] = $username; $user_data['user_pass'] = substr( md5( uniqid( microtime() ) ), 0, 7); $user_id = wp_insert_user( $user_data ); - if( $user_id ) { // created ok + if ($user_id instanceof WP_Error) { + openid_message($user_id->get_error_message()); + openid_status('error'); + return; + } else if ( is_integer($user_id) ) { // created ok $user_data['ID'] = $user_id; // XXX this all looks redundant, see openid_set_current_user $user = new WP_User( $user_id ); + $credentials = array('user_login' => $user->user_login, 'user_password' => $user_data['user_pass'], 'remember' => true); - if( ! wp_login( $user->user_login, $user_data['user_pass'] ) ) { - openid_message(__('User was created fine, but wp_login() for the new user failed. This is probably a bug.', 'openid')); + if( ! wp_signon( $credentials ) ) { + openid_message(__('User was created fine, but wp_signon() for the new user failed. This is probably a bug.', 'openid')); openid_status('error'); openid_error(openid_message()); return; } // notify of user creation - wp_new_user_notification( $user->user_login ); + wp_new_user_notification( $user_id ); - wp_clearcookie(); - wp_setcookie( $user->user_login, md5($user->user_pass), true, '', '', true ); + wp_clear_auth_cookie(); + wp_set_auth_cookie($user_id, true); // Bind the provided identity to the just-created user openid_add_user_identity($user_id, $identity_url); openid_status('redirect'); + do_action('openid_consumer_new_user_custom_data', $user_id, $user_data); + if ( !$user->has_cap('edit_posts') ) $redirect_to = '/wp-admin/profile.php'; } else { @@ -373,9 +389,9 @@ function openid_create_new_user($identity_url, &$user_data) { * ID, user_url, user_nicename, display_name * * Multiple soures of data may be available and are attempted in the following order: - * - OpenID Attribute Exchange !! not yet implemented + * - OpenID Attribute Exchange !! not yet implemented * - OpenID Simple Registration - * - hCard discovery !! not yet implemented + * - hCard discovery !! not yet implemented * - default to identity URL * * @param string $identity_url OpenID to get user data about @@ -532,7 +548,8 @@ function openid_parse_request($wp) { break; case 'server': - openid_server_request($_REQUEST['action']); + $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null; + openid_server_request($action); break; case 'ajax': @@ -561,10 +578,10 @@ function is_url_openid( $url ) { /** * Clean HTTP request parameters for OpenID. * - * Apache's rewrite module is often used to produce "pretty URLs" in WordPress. - * Other webservers, such as lighttpd, nginx, and Microsoft IIS each have ways - * (read: hacks) for simulating this kind of functionality. This function - * reverses the side-effects of these hacks so that the OpenID request + * Apache's rewrite module is often used to produce "pretty URLs" in WordPress. + * Other webservers, such as lighttpd, nginx, and Microsoft IIS each have ways + * (read: hacks) for simulating this kind of functionality. This function + * reverses the side-effects of these hacks so that the OpenID request * variables are in the form that the OpenID library expects. */ function openid_clean_request() { @@ -583,13 +600,13 @@ function openid_clean_request() { $clean[] = $v; } } - + $_SERVER['QUERY_STRING'] = implode('&', $clean); - } else if ($_SERVER['argc'] >= 1 && $_SERVER['argv'][0] == 'error=404') { + } else if (isset($_SERVER['argc']) && $_SERVER['argc'] >= 1 && $_SERVER['argv'][0] == 'error=404') { - // handle lighttpd hack which uses a custom error-handler, passing 404 errors to WordPress. - // This results in the QUERY_STRING not having the correct information, but fortunately we + // handle lighttpd hack which uses a custom error-handler, passing 404 errors to WordPress. + // This results in the QUERY_STRING not having the correct information, but fortunately we // can pull it out of REQUEST_URI list($path, $query) = explode('?', $_SERVER['REQUEST_URI'], 2); @@ -611,13 +628,7 @@ function openid_service_url($service, $scheme = null) { if (!$wp_rewrite) $wp_rewrite = new WP_Rewrite(); if (!defined('OPENID_SSL') || !OPENID_SSL) $scheme = null; - $url = site_url('/', $scheme); - - if ($wp_rewrite->using_permalinks()) { - $url .= 'index.php/openid/' . $service; - } else { - $url .= '?openid=' . $service; - } + $url = site_url('/?openid=' . $service, $scheme); return $url; } @@ -728,21 +739,21 @@ function openid_page($message, $title = '') { * @action: init **/ function openid_js_setup() { - if (have_comments() || comments_open() || is_admin()) { - wp_enqueue_script('openid', plugins_url('openid/f/openid.js'), array('jquery'), OPENID_PLUGIN_REVISION); + if ( ( is_singular() && ( have_comments() || comments_open() ) ) || is_admin() ) { + wp_enqueue_script( 'openid', plugin_dir_url( __FILE__ ) . 'f/openid.js', array( 'jquery' ), OPENID_PLUGIN_REVISION ); } } /** - * Include OpenID stylesheet. + * Include OpenID stylesheet. * - * "Intelligently" decides whether to enqueue or print the CSS file, based on whether * the 'wp_print_styles' + * "Intelligently" decides whether to enqueue or print the CSS file, based on whether * the 'wp_print_styles' * action has been run. (This logic taken from the core wp_admin_css function) **/ function openid_style() { if ( !wp_style_is('openid', 'registered') ) { - wp_register_style('openid', plugins_url('openid/f/openid.css'), array(), OPENID_PLUGIN_REVISION); + wp_register_style('openid', plugin_dir_url(__FILE__) . 'f/openid.css', array(), OPENID_PLUGIN_REVISION); } if ( did_action('wp_print_styles') ) { @@ -840,5 +851,3 @@ function openid_debug($msg) { openid_error($msg); } } - -?> diff --git a/consumer.php b/consumer.php index d12aabd..67b4932 100644 --- a/consumer.php +++ b/consumer.php @@ -186,10 +186,17 @@ function openid_add_ax_extension($extensions, $auth_request) { require_once('Auth/OpenID/AX.php'); if ($auth_request->endpoint->usesExtension(Auth_OpenID_AX_NS_URI)) { + $default_fields = array( + Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson/friendly', 1, true), + Auth_OpenID_AX_AttrInfo::make('http://axschema.org/contact/email', 1, true), + Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson', 1, true) + ); + $fields = apply_filters('openid_consumer_ax_fields', $default_fields); + $ax_request = new Auth_OpenID_AX_FetchRequest(); - $ax_request->add(Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson/friendly', 1, true)); - $ax_request->add(Auth_OpenID_AX_AttrInfo::make('http://axschema.org/contact/email', 1, true)); - $ax_request->add(Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson', 1, true)); + foreach ($fields as $field) { + $ax_request->add($field); + } $extensions[] = $ax_request; } @@ -201,13 +208,18 @@ function openid_add_ax_extension($extensions, $auth_request) { /** * Build an SReg attribute query extension if we've never seen this OpenID before. + * + * @uses apply_filters() Calls 'openid_consumer_sreg_required_fields' and + * 'openid_consumer_sreg_required_fields' to collect sreg fields. */ function openid_add_sreg_extension($extensions, $auth_request) { if(!get_user_by_openid($auth_request->endpoint->claimed_id)) { require_once('Auth/OpenID/SReg.php'); if ($auth_request->endpoint->usesExtension(Auth_OpenID_SREG_NS_URI_1_0) || $auth_request->endpoint->usesExtension(Auth_OpenID_SREG_NS_URI_1_1)) { - $extensions[] = Auth_OpenID_SRegRequest::build(array(),array('nickname','email','fullname')); + $required = apply_filters('openid_consumer_sreg_required_fields', array()); + $optional = apply_filters('openid_consumer_sreg_optional_fields', array('nickname','email','fullname')); + $extensions[] = Auth_OpenID_SRegRequest::build($required, $optional); } } @@ -243,7 +255,3 @@ function openid_consumer_xrds_simple($xrds) { return $xrds; } - - - - diff --git a/f/openid.css b/f/openid.css index b1ce6b8..9553f72 100644 --- a/f/openid.css +++ b/f/openid.css @@ -5,23 +5,14 @@ #openid_enabled_link, .openid_link, #openid_identifier, #commentform #openid_identifier { background-image: url('openid.gif'); background-position: 3px 50%; - background-repeat: no-repeat; - padding-left: 21px !important; + background-repeat: no-repeat; + padding-left: 21px !important; } .openid_loading { background: url('ajax-loader.gif') right center no-repeat; } -body.login #openid_identifier { - width: 92%; - font-size: 20px; - background-color: #FFF; - border: 1px solid #ccc; - padding: 3px 3px 3px 18px; - margin-right: 6px; -} - #openid_comment { margin: 0.8em 1em; } @@ -30,8 +21,7 @@ body.login #openid_identifier { } /* fix link color on wp-login.php */ -body.login form#loginform a.legacy, +body.login form#loginform a.legacy, body.login form#registerform a.legacy { color: #FFF; } - diff --git a/f/register.js b/f/register.js new file mode 100644 index 0000000..075c2a8 --- /dev/null +++ b/f/register.js @@ -0,0 +1,10 @@ +jQuery(document).ready(function() { + jQuery(function() { + jQuery("#registerform > p:first").hide(); + jQuery("#registerform > p:first + p").hide(); + jQuery("#reg_passmail").hide(); + jQuery("p.submit").css("margin", "1em 0"); + var link = jQuery("#nav a:first"); + jQuery("#nav").text("").append(link); + }); +}); diff --git a/lib/Auth/OpenID/Consumer.php b/lib/Auth/OpenID/Consumer.php index d562e33..9ac0c50 100644 --- a/lib/Auth/OpenID/Consumer.php +++ b/lib/Auth/OpenID/Consumer.php @@ -29,7 +29,7 @@ * identity check. * * LIBRARY DESIGN - * + * * This consumer library is designed with that flow in mind. The goal * is to make it as easy as possible to perform the above steps * securely. @@ -427,7 +427,7 @@ function complete($current_url, $query=null) $loader->fromSession($endpoint_data); $message = Auth_OpenID_Message::fromPostArgs($query); - $response = $this->consumer->complete($message, $endpoint, + $response = $this->consumer->complete($message, $endpoint, $current_url); $this->session->del($this->_token_key); @@ -616,6 +616,9 @@ function Auth_OpenID_GenericConsumer($store) $this->store = $store; $this->negotiator = Auth_OpenID_getDefaultNegotiator(); $this->_use_assocs = (is_null($this->store) ? false : true); + if (get_class($this->store) == "Auth_OpenID_DumbStore") { + $this->_use_assocs = false; + } $this->fetcher = Auth_Yadis_Yadis::getHTTPFetcher(); @@ -666,7 +669,7 @@ function complete($message, $endpoint, $return_to) '_completeInvalid'); return call_user_func_array(array($this, $method), - array($message, &$endpoint, $return_to)); + array($message, $endpoint, $return_to)); } /** @@ -1186,7 +1189,7 @@ function _discoverAndVerify($claimed_id, $to_match_endpoints) list($unused, $services) = call_user_func_array($this->discoverMethod, array( $claimed_id, - &$this->fetcher, + $this->fetcher, )); if (!$services) { @@ -1202,7 +1205,7 @@ function _discoverAndVerify($claimed_id, $to_match_endpoints) /** * @access private */ - function _verifyDiscoveryServices($claimed_id, + function _verifyDiscoveryServices($claimed_id, $services, $to_match_endpoints) { // Search the services resulting from discovery to find one @@ -1210,7 +1213,7 @@ function _verifyDiscoveryServices($claimed_id, foreach ($services as $endpoint) { foreach ($to_match_endpoints as $to_match_endpoint) { - $result = $this->_verifyDiscoverySingle($endpoint, + $result = $this->_verifyDiscoverySingle($endpoint, $to_match_endpoint); if (!Auth_OpenID::isFailure($result)) { @@ -1368,7 +1371,7 @@ function _createCheckAuthRequest($message) } } $ca_message = $message->copy(); - $ca_message->setArg(Auth_OpenID_OPENID_NS, 'mode', + $ca_message->setArg(Auth_OpenID_OPENID_NS, 'mode', 'check_authentication'); return $ca_message; } @@ -1606,7 +1609,7 @@ function _extractAssociation($assoc_response, $assoc_session) $expires_in = Auth_OpenID::intval($expires_in_str); if ($expires_in === false) { - + $err = sprintf("Could not parse expires_in from association ". "response %s", print_r($assoc_response, true)); return new Auth_OpenID_FailureResponse(null, $err); @@ -1953,7 +1956,7 @@ function formMarkup($realm, $return_to=null, $immediate=false, function htmlMarkup($realm, $return_to=null, $immediate=false, $form_tag_attrs=null) { - $form = $this->formMarkup($realm, $return_to, $immediate, + $form = $this->formMarkup($realm, $return_to, $immediate, $form_tag_attrs); if (Auth_OpenID::isFailure($form)) { diff --git a/lib/Auth/OpenID/Extension.php b/lib/Auth/OpenID/Extension.php index c4e38c0..542a1da 100644 --- a/lib/Auth/OpenID/Extension.php +++ b/lib/Auth/OpenID/Extension.php @@ -39,7 +39,7 @@ function getExtensionArgs() * * Returns the message with the extension arguments added. */ - function toMessage($message) + function toMessage($message, $request = null) { $implicit = $message->isOpenID1(); $added = $message->namespaces->addAlias($this->ns_uri, @@ -53,8 +53,13 @@ function toMessage($message) } } - $message->updateArgs($this->ns_uri, - $this->getExtensionArgs()); + if ($request !== null) { + $message->updateArgs($this->ns_uri, + $this->getExtensionArgs($request)); + } else { + $message->updateArgs($this->ns_uri, + $this->getExtensionArgs()); + } return $message; } } diff --git a/lib/Auth/OpenID/FileStore.php b/lib/Auth/OpenID/FileStore.php index 074421a..7eec791 100644 --- a/lib/Auth/OpenID/FileStore.php +++ b/lib/Auth/OpenID/FileStore.php @@ -300,13 +300,22 @@ function _getAssociation($filename) return null; } + if (file_exists($filename) !== true) { + return null; + } + $assoc_file = @fopen($filename, 'rb'); if ($assoc_file === false) { return null; } - $assoc_s = fread($assoc_file, filesize($filename)); + $filesize = filesize($filename); + if ($filesize === false || $filesize <= 0) { + return null; + } + + $assoc_s = fread($assoc_file, $filesize); fclose($assoc_file); if (!$assoc_s) { diff --git a/lib/Auth/OpenID/MDB2Store.php b/lib/Auth/OpenID/MDB2Store.php index 80024ba..fb27d5c 100644 --- a/lib/Auth/OpenID/MDB2Store.php +++ b/lib/Auth/OpenID/MDB2Store.php @@ -85,7 +85,7 @@ function Auth_OpenID_MDB2Store($connection, // column name instead of column index. $this->connection->setFetchMode(MDB2_FETCHMODE_ASSOC); - if (PEAR::isError($this->connection->loadModule('Extended'))) { + if (@PEAR::isError($this->connection->loadModule('Extended'))) { trigger_error("Unable to load MDB2_Extended module", E_USER_ERROR); return; } @@ -103,7 +103,7 @@ function Auth_OpenID_MDB2Store($connection, function tableExists($table_name) { - return !PEAR::isError($this->connection->query( + return !@PEAR::isError($this->connection->query( sprintf("SELECT * FROM %s LIMIT 0", $table_name))); } @@ -135,12 +135,12 @@ function create_nonce_table() " UNIQUE (server_url(255), timestamp, salt)\n". ") TYPE=InnoDB", $this->nonces_table_name)); - if (PEAR::isError($r)) { + if (@PEAR::isError($r)) { return false; } break; default: - if (PEAR::isError( + if (@PEAR::isError( $this->connection->loadModule('Manager'))) { return false; } @@ -172,7 +172,7 @@ function create_nonce_table() $r = $this->connection->createTable($this->nonces_table_name, $fields); - if (PEAR::isError($r)) { + if (@PEAR::isError($r)) { return false; } @@ -180,7 +180,7 @@ function create_nonce_table() $this->nonces_table_name, $this->nonces_table_name . "_constraint", $constraint); - if (PEAR::isError($r)) { + if (@PEAR::isError($r)) { return false; } break; @@ -208,12 +208,12 @@ function create_assoc_table() " PRIMARY KEY (server_url(255), handle)\n". ") TYPE=InnoDB", $this->associations_table_name)); - if (PEAR::isError($r)) { + if (@PEAR::isError($r)) { return false; } break; default: - if (PEAR::isError( + if (@PEAR::isError( $this->connection->loadModule('Manager'))) { return false; } @@ -258,7 +258,7 @@ function create_assoc_table() $this->associations_table_name, $fields, $options); - if (PEAR::isError($r)) { + if (@PEAR::isError($r)) { return false; } break; @@ -293,7 +293,7 @@ function storeAssociation($server_url, $association) ) ); - return !PEAR::isError($this->connection->replace( + return !@PEAR::isError($this->connection->replace( $this->associations_table_name, $fields)); } @@ -340,7 +340,7 @@ function getAssociation($server_url, $handle = null) $assoc = $this->connection->getRow($sql, $types, $params); - if (!$assoc || PEAR::isError($assoc)) { + if (!$assoc || @PEAR::isError($assoc)) { return null; } else { $association = new Auth_OpenID_Association($assoc['handle'], @@ -361,7 +361,7 @@ function removeAssociation($server_url, $handle) $this->associations_table_name), array($server_url, $handle)); - if (PEAR::isError($r) || $r == 0) { + if (@PEAR::isError($r) || $r == 0) { return false; } return true; @@ -389,7 +389,7 @@ function useNonce($server_url, $timestamp, $salt) $fields, MDB2_AUTOQUERY_INSERT); - if (PEAR::isError($r)) { + if (@PEAR::isError($r)) { return false; } return true; diff --git a/lib/Auth/OpenID/Message.php b/lib/Auth/OpenID/Message.php index 9a5b20d..16ec1c1 100644 --- a/lib/Auth/OpenID/Message.php +++ b/lib/Auth/OpenID/Message.php @@ -675,7 +675,7 @@ function toFormMarkup($action_url, $form_tag_attrs = null, if ($form_tag_attrs) { foreach ($form_tag_attrs as $name => $attr) { - $form .= sprintf(" %s=\"%s\"", $name, $attr); + $form .= sprintf(" %s=\"%s\"", $name, htmlspecialchars($attr)); } } @@ -684,11 +684,11 @@ function toFormMarkup($action_url, $form_tag_attrs = null, foreach ($this->toPostArgs() as $name => $value) { $form .= sprintf( "\n", - $name, urldecode($value)); + htmlspecialchars($name), htmlspecialchars($value)); } $form .= sprintf("\n", - $submit_text); + htmlspecialchars($submit_text)); $form .= "\n"; diff --git a/lib/Auth/OpenID/PredisStore.php b/lib/Auth/OpenID/PredisStore.php new file mode 100644 index 0000000..7108c2f --- /dev/null +++ b/lib/Auth/OpenID/PredisStore.php @@ -0,0 +1,208 @@ += 5.3. + * + * LICENSE: See the COPYING file included in this distribution. + * + * @package OpenID + * @author Ville Mattila + * @copyright 2008 JanRain Inc., 2013 Eventio Oy / Ville Mattila + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache + * Contributed by Eventio Oy + */ + +/** + * Import the interface for creating a new store class. + */ +require_once 'Auth/OpenID/Interface.php'; + +/** + * Supplies Redis server store backend for OpenID servers and consumers. + * Uses Predis library {@see https://github.com/nrk/predis}. + * Requires PHP >= 5.3. + * + * @package OpenID + */ +class Auth_OpenID_PredisStore extends Auth_OpenID_OpenIDStore { + + /** + * @var \Predis\Client + */ + protected $redis; + + /** + * Prefix for Redis keys + * @var string + */ + protected $prefix; + + /** + * Initializes a new {@link Auth_OpenID_PredisStore} instance. + * + * @param \Predis\Client $redis Predis client object + * @param string $prefix Prefix for all keys stored to the Redis + */ + function Auth_OpenID_PredisStore(\Predis\Client $redis, $prefix = '') + { + $this->prefix = $prefix; + $this->redis = $redis; + } + + /** + * Store association until its expiration time in Redis server. + * Overwrites any existing association with same server_url and + * handle. Handles list of associations for every server. + */ + function storeAssociation($server_url, $association) + { + // create Redis keys for association itself + // and list of associations for this server + $associationKey = $this->associationKey($server_url, + $association->handle); + $serverKey = $this->associationServerKey($server_url); + + // save association to server's associations' keys list + $this->redis->lpush( + $serverKey, + $associationKey + ); + + // Will touch the association list expiration, to avoid filling up + $newExpiration = ($association->issued + $association->lifetime); + + $expirationKey = $serverKey.'_expires_at'; + $expiration = $this->redis->get($expirationKey); + if (!$expiration || $newExpiration > $expiration) { + $this->redis->set($expirationKey, $newExpiration); + $this->redis->expireat($serverKey, $newExpiration); + $this->redis->expireat($expirationKey, $newExpiration); + } + + // save association itself, will automatically expire + $this->redis->setex( + $associationKey, + $newExpiration - time(), + serialize($association) + ); + } + + /** + * Read association from Redis. If no handle given + * and multiple associations found, returns latest issued + */ + function getAssociation($server_url, $handle = null) + { + // simple case: handle given + if ($handle !== null) { + return $this->getAssociationFromServer( + $this->associationKey($server_url, $handle) + ); + } + + // no handle given, receiving the latest issued + $serverKey = $this->associationServerKey($server_url); + $lastKey = $this->redis->lpop($serverKey); + if (!$lastKey) { return null; } + + // get association, return null if failed + return $this->getAssociationFromServer($lastKey); + } + + /** + * Function to actually receive and unserialize the association + * from the server. + */ + private function getAssociationFromServer($associationKey) + { + $association = $this->redis->get($associationKey); + return $association ? unserialize($association) : null; + } + + /** + * Immediately delete association from Redis. + */ + function removeAssociation($server_url, $handle) + { + // create Redis keys + $serverKey = $this->associationServerKey($server_url); + $associationKey = $this->associationKey($server_url, + $handle); + + // Removing the association from the server's association list + $removed = $this->redis->lrem($serverKey, 0, $associationKey); + if ($removed < 1) { + return false; + } + + // Delete the association itself + return $this->redis->del($associationKey); + } + + /** + * Create nonce for server and salt, expiring after + * $Auth_OpenID_SKEW seconds. + */ + function useNonce($server_url, $timestamp, $salt) + { + global $Auth_OpenID_SKEW; + + // save one request to memcache when nonce obviously expired + if (abs($timestamp - time()) > $Auth_OpenID_SKEW) { + return false; + } + + // SETNX will set the value only of the key doesn't exist yet. + $nonceKey = $this->nonceKey($server_url, $salt); + $added = $this->predis->setnx($nonceKey); + if ($added) { + // Will set expiration + $this->predis->expire($nonceKey, $Auth_OpenID_SKEW); + return true; + } else { + return false; + } + } + + /** + * Build up nonce key + */ + private function nonceKey($server_url, $salt) + { + return $this->prefix . + 'openid_nonce_' . + sha1($server_url) . '_' . sha1($salt); + } + + /** + * Key is prefixed with $prefix and 'openid_association_' string + */ + function associationKey($server_url, $handle = null) + { + return $this->prefix . + 'openid_association_' . + sha1($server_url) . '_' . sha1($handle); + } + + /** + * Key is prefixed with $prefix and 'openid_association_server_' string + */ + function associationServerKey($server_url) + { + return $this->prefix . + 'openid_association_server_' . + sha1($server_url); + } + + /** + * Report that this storage doesn't support cleanup + */ + function supportsCleanup() + { + return false; + } + +} + diff --git a/lib/Auth/OpenID/SQLStore.php b/lib/Auth/OpenID/SQLStore.php index c040597..2dc731a 100644 --- a/lib/Auth/OpenID/SQLStore.php +++ b/lib/Auth/OpenID/SQLStore.php @@ -166,7 +166,7 @@ function tableExists($table_name) */ function isError($value) { - return PEAR::isError($value); + return @PEAR::isError($value); } /** diff --git a/lib/Auth/OpenID/TrustRoot.php b/lib/Auth/OpenID/TrustRoot.php index 000440b..5e69490 100644 --- a/lib/Auth/OpenID/TrustRoot.php +++ b/lib/Auth/OpenID/TrustRoot.php @@ -210,7 +210,7 @@ static function isSane($trust_root) if ($parts['host'] == 'localhost') { return true; } - + $host_parts = explode('.', $parts['host']); if ($parts['wildcard']) { // Remove the empty string from the beginning of the array @@ -413,7 +413,7 @@ function Auth_OpenID_getAllowedReturnURLs($relying_party_url, $fetcher, } call_user_func_array($discover_function, - array($relying_party_url, &$fetcher)); + array($relying_party_url, $fetcher)); $return_to_urls = array(); $matching_endpoints = Auth_OpenID_extractReturnURL($endpoints); diff --git a/lib/Auth/Yadis/Manager.php b/lib/Auth/Yadis/Manager.php index 3f54fd0..664521c 100644 --- a/lib/Auth/Yadis/Manager.php +++ b/lib/Auth/Yadis/Manager.php @@ -37,7 +37,7 @@ function set($name, $value) */ function get($name, $default=null) { - if (array_key_exists($name, $_SESSION)) { + if (isset($_SESSION) && array_key_exists($name, $_SESSION)) { return $_SESSION[$name]; } else { return $default; @@ -414,7 +414,7 @@ function getNextService($discover_cb, $fetcher) list($yadis_url, $services) = call_user_func_array($discover_cb, array( $this->url, - &$fetcher, + $fetcher, )); $manager = $this->createManager($services, $yadis_url); diff --git a/lib/Auth/Yadis/ParanoidHTTPFetcher.php b/lib/Auth/Yadis/ParanoidHTTPFetcher.php index 4848a2b..125029c 100644 --- a/lib/Auth/Yadis/ParanoidHTTPFetcher.php +++ b/lib/Auth/Yadis/ParanoidHTTPFetcher.php @@ -179,10 +179,6 @@ function get($url, $extra_headers = null) } } - Auth_OpenID::log( - "Successfully fetched '%s': GET response code %s", - $url, $code); - return new Auth_Yadis_HTTPResponse($url, $code, $new_headers, $body); } @@ -263,9 +259,6 @@ function post($url, $body, $extra_headers = null) } - Auth_OpenID::log("Successfully fetched '%s': POST response code %s", - $url, $code); - return new Auth_Yadis_HTTPResponse($url, $code, $new_headers, $body); } diff --git a/lib/Auth/Yadis/ParseHTML.php b/lib/Auth/Yadis/ParseHTML.php index 6f0f8b7..255d7cd 100644 --- a/lib/Auth/Yadis/ParseHTML.php +++ b/lib/Auth/Yadis/ParseHTML.php @@ -65,29 +65,6 @@ function Auth_Yadis_ParseHTML() $this->_entity_replacements)); } - /** - * Replace HTML entities (amp, lt, gt, and quot) as well as - * numeric entities (e.g. #x9f;) with their actual values and - * return the new string. - * - * @access private - * @param string $str The string in which to look for entities - * @return string $new_str The new string entities decoded - */ - function replaceEntities($str) - { - foreach ($this->_entity_replacements as $old => $new) { - $str = preg_replace(sprintf("/&%s;/", $old), $new, $str); - } - - // Replace numeric entities because html_entity_decode doesn't - // do it for us. - $str = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $str); - $str = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $str); - - return $str; - } - /** * Strip single and double quotes off of a string, if they are * present. @@ -216,7 +193,7 @@ function getMetaTags($html_string) $link_attrs = array(); foreach ($attr_matches[0] as $index => $full_match) { $name = $attr_matches[1][$index]; - $value = $this->replaceEntities( + $value = html_entity_decode( $this->removeQuotes($attr_matches[2][$index])); $link_attrs[strtolower($name)] = $value; diff --git a/lib/Auth/Yadis/XML.php b/lib/Auth/Yadis/XML.php index cf1f5c4..39a9942 100644 --- a/lib/Auth/Yadis/XML.php +++ b/lib/Auth/Yadis/XML.php @@ -234,7 +234,19 @@ function setXML($xml_string) return false; } - if (!@$this->doc->loadXML($xml_string)) { + // libxml_disable_entity_loader (PHP 5 >= 5.2.11) + if (function_exists('libxml_disable_entity_loader') && function_exists('libxml_use_internal_errors')) { + // disable external entities and libxml errors + $loader = libxml_disable_entity_loader(true); + $errors = libxml_use_internal_errors(true); + $parse_result = @$this->doc->loadXML($xml_string); + libxml_disable_entity_loader($loader); + libxml_use_internal_errors($errors); + } else { + $parse_result = @$this->doc->loadXML($xml_string); + } + + if (!$parse_result) { return false; } diff --git a/lib/Auth/Yadis/XRDS.php b/lib/Auth/Yadis/XRDS.php index 1f5af96..044d1e7 100644 --- a/lib/Auth/Yadis/XRDS.php +++ b/lib/Auth/Yadis/XRDS.php @@ -429,7 +429,7 @@ function services($filters = null, foreach ($filters as $filter) { - if (call_user_func_array($filter, array(&$service))) { + if (call_user_func_array($filter, array($service))) { $matches++; if ($filter_mode == SERVICES_YADIS_MATCH_ANY) { diff --git a/lib/Auth/Yadis/Yadis.php b/lib/Auth/Yadis/Yadis.php index 9ea2db7..f885367 100644 --- a/lib/Auth/Yadis/Yadis.php +++ b/lib/Auth/Yadis/Yadis.php @@ -141,7 +141,7 @@ function Auth_Yadis_getServiceEndpoints($input_url, $xrds_parse_func, } $yadis_result = call_user_func_array($discover_func, - array($input_url, &$fetcher)); + array($input_url, $fetcher)); if ($yadis_result === null) { return array($input_url, array()); diff --git a/localization/openid-de_DE.mo b/localization/openid-de_DE.mo new file mode 100644 index 0000000..424d458 Binary files /dev/null and b/localization/openid-de_DE.mo differ diff --git a/localization/openid-de_DE.po b/localization/openid-de_DE.po new file mode 100644 index 0000000..1ad607c --- /dev/null +++ b/localization/openid-de_DE.po @@ -0,0 +1,531 @@ +msgid "" +msgstr "" +"Project-Id-Version: OpenID 3.4-trunk\n" +"Report-Msgid-Bugs-To: http://wordpress.org/tag/openid\n" +"POT-Creation-Date: 2009-10-01 15:34-0700\n" +"PO-Revision-Date: 2015-07-17 18:03+0200\n" +"Last-Translator: Stephan Richter \n" +"Language-Team: GERMAN \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: de_DE\n" +"X-Generator: Poedit 1.8.2\n" + +#: admin_panels.php:25 +msgid "OpenID options" +msgstr "OpenID-Optionen" + +#. Plugin Name of an extension +#: admin_panels.php:25 +msgid "OpenID" +msgstr "OpenID" + +#: admin_panels.php:30 +msgid "Your OpenIDs" +msgstr "Ihre OpenIDs" + +#: admin_panels.php:44 admin_panels.php:45 admin_panels.php:423 +msgid "Your Trusted Sites" +msgstr "Ihre vertrauten Seiten" + +#: admin_panels.php:57 admin_panels.php:61 admin_panels.php:149 +msgid "OpenID Settings" +msgstr "OpenID-Einstellungen" + +#: admin_panels.php:112 +msgid "Settings" +msgstr "Einstellungen" + +#: admin_panels.php:133 +msgid "OpenID cache refreshed." +msgstr "OpenID-Cache wurde erneuert." + +#: admin_panels.php:151 +msgid "" +"Please note that all OpenID Consumer options have been moved to their respective sections of the General Settings and Discussion Settings pages." +msgstr "" +"Bitte beachten Sie, dass alle OpenID-Nutzeroptionen in die entsprechenden Bereiche der allgemeinen Einstellungen und Diskussions-Einstellungen " +"verschoben wurden." + +#: admin_panels.php:160 +msgid "" +"The OpenID Provider allows authorized users to use their author URL as an OpenID, either using their local " +"WordPress username and password, or by delegating to another OpenID Provider." +msgstr "" +"Die OpenID-Provider-Funktion erlaubt es autorisierten Benutzern deren Autoren-URL als OpenID zu nutzen. Das kann " +"entweder über den lokalen WordPress-Login geschehen, oder durch Verweis auf einen anderen OpenID-Anbieter." + +#: admin_panels.php:166 +msgid "Enable OpenID" +msgstr "OpenID aktivieren" + +#: admin_panels.php:169 +msgid "Enable the local OpenID Provider for these roles:" +msgstr "Lokalen OpenID-Provider für die folgenden Rollen aktivieren:" + +#: admin_panels.php:192 +msgid "Blog Owner" +msgstr "Besitzer des Blogs" + +#: admin_panels.php:195 +#, php-format +msgid "" +"Authorized accounts on this blog can use their author URL (i.e. %1$s) as an OpenID. The Blog Owner will " +"be able to use the blog address (%2$s) as their OpenID. If this is a single-user blog, you should set this to " +"your account." +msgstr "" +"Authorisierte Benutzerkonten dieses Blogs können ihre Autoren-URL (i.e. %1$s) als OpenID benutzen. Der " +"Blog-Besitzer ist damit fähig, die Blog-Adresse (%2$s) als dessen OpenID zu nutzen. Wenn dies ein Blog mit nur " +"einem Benutzer ist, sollte dies auf den eigenen Account eingestellt werden." + +#: admin_panels.php:205 +msgid "" +"A Blog Owner cannot be set for this blog. To set a Blog Owner, first remove the following line from your wp-" +"config.php:" +msgstr "" +"Blog-Besitzer kann für diesen Blog nicht gesetzt werden. Um dies zu ermöglichen, entfernen Sie bitte folgende " +"Zeilen aus wp-config.php:" + +#: admin_panels.php:213 +msgid "(none)" +msgstr "(keine)" + +#: admin_panels.php:223 +#, php-format +msgid "Only the current Blog Owner (%s) can change this setting." +msgstr "Nur der momentane Blog-Besitzer (%s) kann diese Einstellung ändern." + +#: admin_panels.php:235 +msgid "Troubleshooting" +msgstr "Problembehebung" + +#: admin_panels.php:239 +#, php-format +msgid "If users are experiencing problems logging in with OpenID, it may help to %1$srefresh the cache%2$s." +msgstr "" +"Wenn Nutzer Probleme haben, sich mit einer OpenID anzumelden, versuchen Sie %1$s den Cache zu aktualisieren%2$s." + +#: admin_panels.php:246 +msgid "Save Changes" +msgstr "Änderungen speichern" + +#: admin_panels.php:266 +msgid "Success:" +msgstr "Erfolgreich:" + +#: admin_panels.php:269 +msgid "Warning:" +msgstr "Warnung:" + +#: admin_panels.php:272 admin_panels.php:276 +msgid "Error:" +msgstr "Fehler:" + +#: admin_panels.php:288 +msgid "Your Verified OpenIDs" +msgstr "Ihre geprüften OpenIDs" + +#: admin_panels.php:290 +msgid "" +"You may associate one or more OpenIDs with your account. This will allow you to login to WordPress with your " +"OpenID instead of a username and password. Learn more..." +msgstr "" +"Sie können eine oder mehrere OpenIDs mit ihrem Account verknüpfen. Das wird Ihnen ermöglichen, sich bei WordPress " +"mit ihrer OpenID einzuloggen anstelle von Nutzername und Passwort. Mehr darüber lernen...\"" + +#: admin_panels.php:297 admin_panels.php:432 +msgid "Bulk Actions" +msgstr "Stapelverarbeitung" + +#: admin_panels.php:298 admin_panels.php:433 +msgid "Delete" +msgstr "Entfernen" + +#: admin_panels.php:300 admin_panels.php:435 +msgid "Apply" +msgstr "Übernehmen" + +#: admin_panels.php:312 +msgid "Account" +msgstr "Account" + +#: admin_panels.php:321 +msgid "No Verified Accounts." +msgstr "Keine bestätigten Accounts" + +#: admin_panels.php:340 admin_panels.php:346 +msgid "Add OpenID" +msgstr "OpenID hinzufügen" + +#: admin_panels.php:387 +#, php-format +msgid "Added %d trusted site." +msgid_plural "Added %d trusted sites." +msgstr[0] "%d vertraute Seite hinzugefügt." +msgstr[1] "%d vertraute Seiten hinzugefügt." + +#: admin_panels.php:410 +#, php-format +msgid "Deleted %d trusted site." +msgid_plural "Deleted %d trusted sites." +msgstr[0] "%d vertraute Seite entfernt." +msgstr[1] "%d vertraute Seiten entfernt." + +#: admin_panels.php:425 +msgid "" +"This is a list of sites that you can automatically login to using your OpenID account. You will not be asked to " +"approve OpenID login requests for your trusted sites." +msgstr "" +"Dis ist eine Liste von Seiten, zu auf denen Sie sich mit ihrer OpenID automatisch einloggen können. Sie werden bei " +"vertrauten Seiten nicht gefragt werden, OpenID-Login-Versuche zu bestätigen." + +#: admin_panels.php:447 +msgid "URL" +msgstr "URL" + +#: admin_panels.php:448 +msgid "Last Login" +msgstr "letzter Login" + +#: admin_panels.php:456 +msgid "No Trusted Sites." +msgstr "Keine vertrauten Seiten." + +#: admin_panels.php:487 +msgid "Import Trusted Sites" +msgstr "Vertraute Seiten importieren." + +#: admin_panels.php:489 +msgid "Enter a list of URLs to be added to your Trusted Sites." +msgstr "Geben Sie eine Liste von URLs ein, die zu ihren vertrauten Seiten hinzugefügt werden sollen." + +#: admin_panels.php:493 admin_panels.php:503 +msgid "Add Sites" +msgstr "Seiten hinzufügen" + +#: admin_panels.php:495 +msgid "(One URL per line)" +msgstr "(Eine URL pro Zeile)" + +#: admin_panels.php:589 +msgid "Status information:" +msgstr "Statusinformation:" + +#: admin_panels.php:589 +msgid "All Systems Nominal" +msgstr "Alle Systeme Normal" + +#: admin_panels.php:590 +msgid "System Status" +msgstr "Systemstatus" + +#: admin_panels.php:590 +msgid "Toggle More/Less" +msgstr "Umschalten Mehr/Weniger" + +#: admin_panels.php:592 +msgid "Plugin is currently disabled. Fix the problem, then Deactivate/Reactivate the plugin." +msgstr "Die Erweiterung ist im Moment inaktiv. Beheben Sie das Problem und Deaktivieren/Reaktivieren Sie das Plugin." + +#: admin_panels.php:600 +msgid "FAIL" +msgstr "FEHLER" + +#: admin_panels.php:602 +msgid "OK" +msgstr "Ok" + +#: admin_panels.php:604 +msgid "INFO" +msgstr "INFO" + +#: admin_panels.php:638 +msgid "You already have this OpenID!" +msgstr "Sie haben bereits diese OpenID!" + +#: admin_panels.php:640 +msgid "This OpenID is already associated with another user." +msgstr "Diese OpenID ist schon mit einem anderen Benutzer verknüpft." + +#: admin_panels.php:661 +msgid "Unable to authenticate OpenID." +msgstr "Konnte OpenID nicht authentifizieren." + +#: admin_panels.php:662 +msgid "OpenID assertion successful, but this URL is already associated with another user on this blog." +msgstr "OpenID-Überprüfung erfolgreich, aber diese URL ist schon mit einem anderen Benutzer dieses Blogs verknüpft." + +#: admin_panels.php:663 +msgid "Added association with OpenID." +msgstr "Verknüpfung mit OpenID hinzugefügt." + +#: admin_panels.php:675 admin_panels.php:745 +msgid "Note: For security reasons, your profile URL has been updated to match your OpenID." +msgstr "" +"Hinweis: Aus Sicherheitsgründen wurde ihre Profil-URL so geändert, dass Sie ihrer OpenID " +"entspricht." + +#: admin_panels.php:701 admin_panels.php:718 +msgid "OpenID Warning" +msgstr "OpenID-Warnung" + +#: admin_panels.php:703 +msgid "Are you sure you want to delete all of your OpenID associations? Doing so may prevent you from logging in." +msgstr "" +"Sind Sie sicher, dass Sie alle Ihre OpenID-Zuordnungen löschen wollen? Diese Aktion kann dazu führen, dass Sie " +"sich nicht mehr einloggen können." + +#: admin_panels.php:705 +msgid "Yes I'm sure. Delete." +msgstr "Ja, das will ich. Löschen." + +#: admin_panels.php:706 +msgid "No, don't delete." +msgstr "Nein, nicht löschen." + +#: admin_panels.php:733 +#, php-format +msgid "Deleted %d OpenID association." +msgid_plural "Deleted %d OpenID associations." +msgstr[0] "%d OpenID-Zuordnung gelöscht" +msgstr[1] "%d OpenID-Zuordnungen gelöscht" + +#: admin_panels.php:751 +msgid "OpenID association delete failed: Unknown reason." +msgstr "Fehler beim Löschen einer OpenID-Zuordnung: Grund unbekannt." + +#: admin_panels.php:807 +#, php-format +msgid "For security reasons, your profile URL must be one of your claimed OpenIDs: %s" +msgstr "Aus Sicherheitsgründen muss ihre Profil-URL einer der vorgegebenen OpenIDs entsprechen: %s" + +#: admin_panels.php:844 +msgid "OpenID Delegation" +msgstr "OpenID Delegation" + +#: admin_panels.php:846 +msgid "OpenID Delegation allows you to use an external OpenID provider of your choice." +msgstr "„OpenID Delegation“ erlaubt ihnen, einen externen OpenID-Anbieter ihrer Wahl zu nutzen." + +#: admin_panels.php:849 +msgid "To delegate, enter a valid OpenID. Otherwise leave this blank." +msgstr "Geben Sie eine gültige OpenID für die Weiterleitung an, oder lassen Sie das Feld leer." + +#: admin_panels.php:886 +#, php-format +msgid "Unable to find any OpenID information for delegate URL %s" +msgstr "Konnte keine OpenID-Information für die Weiterleitungs-URL %s finden." + +#: admin_panels.php:896 +msgid "You cannot delegate to an OpenID provider which uses Identifier Select." +msgstr "Sie können nicht zu einem OpenID-Provider weiterleiten, der \"Identifier Select\" verwendet." + +#: admin_panels.php:917 +msgid "New accounts can only be created with verified OpenIDs." +msgstr "Neue Accounts können nutz mit überprüften OpenIDs erzeugt werden." + +#: admin_panels.php:956 +msgid "New accounts can only be created with verified OpenIDs" +msgstr "Neue Accounts können nutz mit überprüften OpenIDs erzeugt werden." + +#: admin_panels.php:979 +msgid "Enable OpenID for comments" +msgstr "OpenID für Kommentare aktivieren" + +#: admin_panels.php:989 +msgid "Do not require name and e-mail for comments left with a verified OpenID" +msgstr "Keinen Namen/E-Mail für Kommentare verlangen, die mit einer gültigen OpenID abgegeben wurden" + +#: admin_panels.php:997 +msgid "Always approve comments left with a verified OpenID" +msgstr "Kommentare, die mit einer gültigen OpenID abgegeben wurden, stets bestätigen" + +#: comments.php:106 +msgid "Error: please fill the required fields (name, email)." +msgstr "Fehler: Bitte füllen Sie die erforderlichen Felder (Name, E-Mail) aus." + +#: comments.php:108 +msgid "Error: please enter a valid email address." +msgstr "Fehler: Bitte geben Sie eine gültige E-Mail Adresse an." + +#: comments.php:258 +msgid "Authenticate this comment using OpenID." +msgstr "Diesen Kommentar mittel OpenID authentifizieren." + +#: comments.php:271 comments.php:289 +msgid "OpenID Authentication Error" +msgstr "OpenID-Authentifikationsfehler" + +#: comments.php:272 +msgid "" +"We were unable to authenticate your claimed OpenID, however you can continue to post your comment without OpenID:" +msgstr "Wir waren nicht in der Lage Ihre OpenID zu authentifizieren, aber Sie können auch ohne OpenID kommentieren:" + +#: comments.php:280 +msgid "Submit Comment" +msgstr "Kommentar absenden" + +#: common.php:342 +msgid "User was created fine, but wp_login() for the new user failed. This is probably a bug." +msgstr "" +"Benutzer wurde erfolgreich angelegt, aber wp_login() ist für den neuen Benutzer fehlgeschlagen. Dies ist " +"wahrscheinlich ein Bug (Programmfehler)." + +#: common.php:363 +msgid "OpenID authentication successful, but failed to create WordPress user. This is probably a bug." +msgstr "" +"OpenID-Überprüfung war erfolgreich, aber es konnte kein neuer WordPress-Benutzer angelegt werden. Das ist " +"wahrscheinlich ein Bug (Programmfehler)." + +#: common.php:680 +msgid "Since your browser does not support JavaScript, you must press the Continue button once to proceed." +msgstr "Da Ihr Browser kein JavaScript ausführt, müssen Sie manuell den Weiter-Knopf drücken, um fortzufahren." + +#: common.php:688 server.php:236 server.php:480 +msgid "Continue" +msgstr "Weiter" + +#: common.php:692 +msgid "Please Wait..." +msgstr "Bitte warten..." + +#: common.php:696 +msgid "OpenID Authentication Redirect" +msgstr "Weiterleitung zur OpenID-Athentifizierung" + +#: consumer.php:90 +msgid "OpenID login was cancelled." +msgstr "OpenID-Anmeldung wurde abgebrochen." + +#: consumer.php:95 +#, php-format +msgid "OpenID login failed: %s" +msgstr "OpenID-Anmeldung fehlgeschlagen: %s" + +#: consumer.php:100 +msgid "OpenID login successful" +msgstr "OpenID-Anmeldung erfolgreich" + +#: consumer.php:108 +msgid "Unknown Status. Bind not successful. This is probably a bug." +msgstr "" +"Unbekannter Status. Verknüpfung fehlgeschlagen. Sie haben wahrscheinlich soeben einen Programmfehler entdeckt." + +#: consumer.php:155 +#, php-format +msgid "Could not discover an OpenID identity server endpoint at the url: %s" +msgstr "Leider konnte ich keinen OpenID-Identitäts-Server unter der URL %s finden." + +#: login.php:47 +msgid "Your have entered a valid OpenID, but this site is not currently accepting new accounts." +msgstr "Sie haben eine gültige OpenID angegeben, aber diese Seite vergibt im Moment keine neuen Accounts." + +#: login.php:126 +msgid "Or login using an OpenID" +msgstr "Oder mit OpenID einloggen" + +#: login.php:131 login.php:179 +msgid "Learn about OpenID" +msgstr "Mehr über OpenID" + +#: login.php:146 +msgid "Register using an OpenID:" +msgstr "Mit OpenID registrieren:" + +#: login.php:159 +msgid "Or register using an OpenID:" +msgstr "Oder mittels OpenID registrieren:" + +#: login.php:205 login.php:216 +msgid "ERROR: " +msgstr "FEHLER: " + +#: login.php:205 +msgid "New users must register using OpenID." +msgstr "Neue Nutzer müssen sich mit OpenID registrieren." + +#: server.php:227 +msgid "OpenID Login Error" +msgstr "Fehler bei der Anmeldung mit OpenID" + +#: server.php:229 +#, php-format +msgid "" +"Because you have delegated your OpenID, you cannot login with the URL %s. Instead, you must use " +"your full OpenID when logging in." +msgstr "" +"Weil Sie OpenID-Delegation (Weiterleitung) benutzen, können Sie sich nicht mit der URL %s " +"anmelden. Sie müssen dafür ihre vollständige OpenID zur Anmeldung nutzen." + +#: server.php:231 +#, php-format +msgid "Your full OpenID is: %s" +msgstr "Ihre vollständige OpenID ist: %s" + +#: server.php:459 +#, php-format +msgid "Logged in as %1$s (%2$s). Use a different account?" +msgstr "Sie sind als %1$s (%2$s) angemeldet. Mit anderem Account anmelden?" + +#: server.php:466 server.php:500 +msgid "Verify Your Identity" +msgstr "Bestätigen Sie ihre Identität" + +#: server.php:468 +#, php-format +msgid "%s has asked to verify your identity." +msgstr "%s verlangt die Bestätigung ihrer Identität." + +#: server.php:472 +msgid "Click Continue to verify your identity and login without creating a new password." +msgstr "" +"Weiter klicken, um ihre Identität zu bestätigen und ohne Vergabe eines neuen Passwortes " +"anzumelden." + +#: server.php:479 +msgid "Cancel and go back" +msgstr "Abbrechen und Zurück" + +#: server.php:484 +#, php-format +msgid "Manage or remove access on the Trusted Sites page." +msgstr "zugriff auf der Vertraute Seiten-Seite verwalten." + +#: server.php:488 +#, php-format +msgid "" +"Edit your profile to change the information that gets shared with Trusted " +"Sites." +msgstr "" +"Bearbeiten Sie ihr Profil um die Informationen, die mit anderen Seiten " +"geteilt werden, zu ändern." + +#: server_ext.php:63 +#, php-format +msgid "Also grant access to see my %s." +msgstr "Auch den Zugriff auf mein %s erlauben." + +#. Plugin URI of an extension +msgid "http://wordpress.org/extend/plugins/openid" +msgstr "http://wordpress.org/extend/plugins/openid" + +#. Description of an extension +msgid "" +"Allows the use of OpenID for account registration, authentication, and commenting. Also includes an OpenID " +"provider which can turn WordPress author URLs into OpenIDs." +msgstr "" +"Erlaubt die Nutzung von OpenID für Registrierung von Benutzerkonten, Anmeldung und Kommentare. Erlaubt die " +"Nutzung der Seite als OpenID-Provider, um sich an anderen Seiten mit WordPress-Autoren-URLs als OpenID anzumelden." + +#. Author of an extension +msgid "DiSo Development Team" +msgstr "DiSo Entwicklungsteam" + +#. Author URI of an extension +msgid "http://diso-project.org/" +msgstr "http://diso-project.org/" diff --git a/localization/openid-pt_BR.mo b/localization/openid-pt_BR.mo new file mode 100644 index 0000000..d4dffb4 Binary files /dev/null and b/localization/openid-pt_BR.mo differ diff --git a/localization/openid-pt_BR.po b/localization/openid-pt_BR.po new file mode 100644 index 0000000..8e0d3c1 --- /dev/null +++ b/localization/openid-pt_BR.po @@ -0,0 +1,498 @@ +msgid "" +msgstr "" +"Project-Id-Version: OpenID 3.4-trunk\n" +"Report-Msgid-Bugs-To: http://wordpress.org/tag/openid\n" +"POT-Creation-Date: 2009-10-01 15:34-0700\n" +"PO-Revision-Date: 2012-10-11 17:25-0300\n" +"Last-Translator: Rodrigo Primo \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Poedit-Language: Portuguese\n" +"X-Poedit-Country: BRAZIL\n" + +#: admin_panels.php:25 +msgid "OpenID options" +msgstr "OpenID" + +#. #-#-#-#-# openid.pot (OpenID 3.4-trunk) #-#-#-#-# +#. Plugin Name of an extension +#: admin_panels.php:25 +msgid "OpenID" +msgstr "OpenID" + +#: admin_panels.php:30 +msgid "Your OpenIDs" +msgstr "Seus OpenIDs" + +#: admin_panels.php:44 +#: admin_panels.php:45 +#: admin_panels.php:423 +msgid "Your Trusted Sites" +msgstr "Seus sites autorizados" + +#: admin_panels.php:57 +#: admin_panels.php:61 +#: admin_panels.php:149 +msgid "OpenID Settings" +msgstr "Configurações do OpenID" + +#: admin_panels.php:112 +msgid "Settings" +msgstr "Configurações" + +#: admin_panels.php:133 +msgid "OpenID cache refreshed." +msgstr "O cache do OpenID foi limpado." + +#: admin_panels.php:151 +msgid "Please note that all OpenID Consumer options have been moved to their respective sections of the General Settings and Discussion Settings pages." +msgstr "Todas as opções do cliente OpenID foram movidas para as páginas Geral e Discussão." + +#: admin_panels.php:160 +msgid "The OpenID Provider allows authorized users to use their author URL as an OpenID, either using their local WordPress username and password, or by delegating to another OpenID Provider." +msgstr "O provedor de OpenID permite que os usuários autorizados usem a sua URL de autor com a sua OpenID, tanto usando o usuário e senha do Wordpress quanto delegando para um outro provedor de OpenID." + +#: admin_panels.php:166 +msgid "Enable OpenID" +msgstr "Habilitar OpenID" + +#: admin_panels.php:169 +msgid "Enable the local OpenID Provider for these roles:" +msgstr "Habilitar o OpenID provider local para essas funções:" + +#: admin_panels.php:192 +msgid "Blog Owner" +msgstr "Dono do blog" + +#: admin_panels.php:195 +#, php-format +msgid "Authorized accounts on this blog can use their author URL (i.e. %1$s) as an OpenID. The Blog Owner will be able to use the blog address (%2$s) as their OpenID. If this is a single-user blog, you should set this to your account." +msgstr "Contas autorizadas deste blog podem usar sua URL de autor (i.e. %1$s) como sua OpenID. O dono do blog pode usar o endereço do blog (%2$s) como sua OpenID. Se este for o caso, você deve definir está opção." + +#: admin_panels.php:205 +msgid "A Blog Owner cannot be set for this blog. To set a Blog Owner, first remove the following line from your wp-config.php:" +msgstr "Não é possível definir um dono para este blog. Primeiro é necessário remover a seguinte linha do arquivo wp-config.php:" + +#: admin_panels.php:213 +msgid "(none)" +msgstr "(nenhum)" + +#: admin_panels.php:223 +#, php-format +msgid "Only the current Blog Owner (%s) can change this setting." +msgstr "Apenas o proprietário do blog (%s) pode mudar essa opção." + +#: admin_panels.php:235 +msgid "Troubleshooting" +msgstr "Solução de problemas" + +#: admin_panels.php:239 +#, php-format +msgid "If users are experiencing problems logging in with OpenID, it may help to %1$srefresh the cache%2$s." +msgstr "Se os usuários estiverem com problema para acessar o site usando sua identidade OpenID, %1$slimpar o cache%2$s pode ajudar" + +#: admin_panels.php:246 +msgid "Save Changes" +msgstr "Salvar alterações" + +#: admin_panels.php:266 +msgid "Success:" +msgstr "Sucesso:" + +#: admin_panels.php:269 +msgid "Warning:" +msgstr "Aviso:" + +#: admin_panels.php:272 +#: admin_panels.php:276 +msgid "Error:" +msgstr "Erro:" + +#: admin_panels.php:288 +msgid "Your Verified OpenIDs" +msgstr "Suas OpenIDs verificadas" + +#: admin_panels.php:290 +msgid "You may associate one or more OpenIDs with your account. This will allow you to login to WordPress with your OpenID instead of a username and password. Learn more..." +msgstr "Você pode associar uma ou mais identidade OpenID com a sua conta. Isso permite entrar no Wordpress com uma identidade OpenID ao invés de usar o seu nome de usuário e senha. Saiba mais..." + +#: admin_panels.php:297 +#: admin_panels.php:432 +msgid "Bulk Actions" +msgstr "Ações em lote" + +#: admin_panels.php:298 +#: admin_panels.php:433 +msgid "Delete" +msgstr "Remover" + +#: admin_panels.php:300 +#: admin_panels.php:435 +msgid "Apply" +msgstr "Aplicar" + +#: admin_panels.php:312 +msgid "Account" +msgstr "Conta" + +#: admin_panels.php:321 +msgid "No Verified Accounts." +msgstr "Nenhuma conta verificada." + +#: admin_panels.php:340 +#: admin_panels.php:346 +msgid "Add OpenID" +msgstr "Adicionar OpenID" + +#: admin_panels.php:387 +#, php-format +msgid "Added %d trusted site." +msgid_plural "Added %d trusted sites." +msgstr[0] "%d site autorizado adicionado" +msgstr[1] "%d sites autorizados adicionados" + +#: admin_panels.php:410 +#, php-format +msgid "Deleted %d trusted site." +msgid_plural "Deleted %d trusted sites." +msgstr[0] "%d site autorizado removido" +msgstr[1] "%d sites autorizados removidos" + +#: admin_panels.php:425 +msgid "This is a list of sites that you can automatically login to using your OpenID account. You will not be asked to approve OpenID login requests for your trusted sites." +msgstr "Esta é uma lista dos sites nos quais você pode entrar automaticamente usando a sua conta OpenID. Você não terá que autorizar o login para os seus sites autorizados." + +#: admin_panels.php:447 +msgid "URL" +msgstr "URL" + +#: admin_panels.php:448 +msgid "Last Login" +msgstr "Último acesso" + +#: admin_panels.php:456 +msgid "No Trusted Sites." +msgstr "Nenhum site autorizado." + +#: admin_panels.php:487 +msgid "Import Trusted Sites" +msgstr "Importar sites autorizados" + +#: admin_panels.php:489 +msgid "Enter a list of URLs to be added to your Trusted Sites." +msgstr "Digite uma lista de URLs para serem adicionadas a sua lista de sites autorizados" + +#: admin_panels.php:493 +#: admin_panels.php:503 +msgid "Add Sites" +msgstr "Adicionar sites" + +#: admin_panels.php:495 +msgid "(One URL per line)" +msgstr "(uma URL por linha)" + +#: admin_panels.php:589 +msgid "Status information:" +msgstr "" + +#: admin_panels.php:589 +msgid "All Systems Nominal" +msgstr "" + +#: admin_panels.php:590 +msgid "System Status" +msgstr "Informações do sistema" + +#: admin_panels.php:590 +msgid "Toggle More/Less" +msgstr "Alternar mais/menos" + +#: admin_panels.php:592 +msgid "Plugin is currently disabled. Fix the problem, then Deactivate/Reactivate the plugin." +msgstr "O plugin está desabilitado. Corrija o problema e então reative ele." + +#: admin_panels.php:600 +msgid "FAIL" +msgstr "FALHA" + +#: admin_panels.php:602 +msgid "OK" +msgstr "OK" + +#: admin_panels.php:604 +msgid "INFO" +msgstr "INFO" + +#: admin_panels.php:638 +msgid "You already have this OpenID!" +msgstr "Você já tem este OpenID!" + +#: admin_panels.php:640 +msgid "This OpenID is already associated with another user." +msgstr "Este OpenID já está associado a outro usuário." + +#: admin_panels.php:661 +msgid "Unable to authenticate OpenID." +msgstr "Não foi possível autenticar este OpenID" + +#: admin_panels.php:662 +msgid "OpenID assertion successful, but this URL is already associated with another user on this blog." +msgstr "Esta identidade OpenID já está associada a outro usuário neste blog." + +#: admin_panels.php:663 +msgid "Added association with OpenID." +msgstr "Associação com identidade OpenID adicionada." + +#: admin_panels.php:675 +#: admin_panels.php:745 +msgid "Note: For security reasons, your profile URL has been updated to match your OpenID." +msgstr "Nota: por questões de segurança, a URL do seu perfil foi alterada para a sua identidade OpenID." + +#: admin_panels.php:701 +#: admin_panels.php:718 +msgid "OpenID Warning" +msgstr "Aviso do OpenID" + +#: admin_panels.php:703 +msgid "Are you sure you want to delete all of your OpenID associations? Doing so may prevent you from logging in." +msgstr "Você tem certeza que deseja deletar todas as suas associações com OpenIDs? Isso pode impedir você de acessar o site." + +#: admin_panels.php:705 +msgid "Yes I'm sure. Delete." +msgstr "Sim, remover." + +#: admin_panels.php:706 +msgid "No, don't delete." +msgstr "Não, não remova." + +#: admin_panels.php:733 +#, php-format +msgid "Deleted %d OpenID association." +msgid_plural "Deleted %d OpenID associations." +msgstr[0] "%d associação com identidade OpenID removida." +msgstr[1] "%d associações com identidades OpenID removidas." + +#: admin_panels.php:751 +msgid "OpenID association delete failed: Unknown reason." +msgstr "Não foi possível deletar a associação com a conta OpenID por uma razão desconhecida." + +#: admin_panels.php:807 +#, php-format +msgid "For security reasons, your profile URL must be one of your claimed OpenIDs: %s" +msgstr "Por razões de segurança a URL do seu perfil precisa ser a URL de um dos seus OpenIDs associados a esta conta: %s" + +#: admin_panels.php:844 +msgid "OpenID Delegation" +msgstr "Delegação de OpenID" + +#: admin_panels.php:846 +msgid "OpenID Delegation allows you to use an external OpenID provider of your choice." +msgstr "A delegação de OpenID permite que você use um provedor de OpenID externo de sua escolha." + +#: admin_panels.php:849 +msgid "To delegate, enter a valid OpenID. Otherwise leave this blank." +msgstr "Para usar delegação de OpenID, digite uma URL OpenID válida ou então deixe este campo em branco." + +#: admin_panels.php:886 +#, php-format +msgid "Unable to find any OpenID information for delegate URL %s" +msgstr "A URL não parece ser uma identidade OpenID válida %s" + +#: admin_panels.php:896 +msgid "You cannot delegate to an OpenID provider which uses Identifier Select." +msgstr "Você não pode deletar para um provedor OpenID que usa \"Identifier Select\"." + +#: admin_panels.php:917 +msgid "New accounts can only be created with verified OpenIDs." +msgstr "Novas contas podem ser criadas apenas com OpenIDs verificados." + +#: admin_panels.php:956 +msgid "New accounts can only be created with verified OpenIDs" +msgstr "Novas contas podem ser criadas apenas com OpenIDs verificados" + +#: admin_panels.php:979 +msgid "Enable OpenID for comments" +msgstr "Habilitar login com OpenID para comentários" + +#: admin_panels.php:989 +msgid "Do not require name and e-mail for comments left with a verified OpenID" +msgstr "Não solicitar nome e-mail para comentários publicados com uma URL OpenID verificada" + +#: admin_panels.php:997 +msgid "Always approve comments left with a verified OpenID" +msgstr "Sempre aprovar comentários enviados com um OpenID verificado" + +#: comments.php:106 +msgid "Error: please fill the required fields (name, email)." +msgstr "Erro: nome e e-mail são campos obrigatórios." + +#: comments.php:108 +msgid "Error: please enter a valid email address." +msgstr "Erro: um endereço de e-mail válido é necessário." + +#: comments.php:258 +msgid "Authenticate this comment using OpenID." +msgstr "Publicar este comentário usando uma URL OpenID." + +#: comments.php:271 +#: comments.php:289 +msgid "OpenID Authentication Error" +msgstr "Erro de autenticação do OpenID" + +#: comments.php:272 +msgid "We were unable to authenticate your claimed OpenID, however you can continue to post your comment without OpenID:" +msgstr "Não foi possível autenticar a sua URL OpenID, você pode publicar o comentário sem OpenID:" + +#: comments.php:280 +msgid "Submit Comment" +msgstr "Enviar comentário" + +#: common.php:342 +msgid "User was created fine, but wp_login() for the new user failed. This is probably a bug." +msgstr "Foi possível criar o usuário, mas a chamada a função wp_login() para o novo usuário falhou. Isso provavelmente é um bug." + +#: common.php:363 +msgid "OpenID authentication successful, but failed to create WordPress user. This is probably a bug." +msgstr "A autenticação OpenID foi concluída com sucesso, mas não foi possível criar o usuário no Wordpress. Isso provavelmente é um bug." + +#: common.php:680 +msgid "Since your browser does not support JavaScript, you must press the Continue button once to proceed." +msgstr "Como o seu navegador não suporta JavaScript, você precisar clicar no botão \"Continuar\"." + +#: common.php:688 +#: server.php:236 +#: server.php:480 +msgid "Continue" +msgstr "Continuar" + +#: common.php:692 +msgid "Please Wait..." +msgstr "Por favor aguarde..." + +#: common.php:696 +msgid "OpenID Authentication Redirect" +msgstr "Redirecionamento de autenticação OpenID" + +#: consumer.php:90 +msgid "OpenID login was cancelled." +msgstr "Login com o OpenID foi cancelado." + +#: consumer.php:95 +#, php-format +msgid "OpenID login failed: %s" +msgstr "Login com o OpenID falhou: %s" + +#: consumer.php:100 +msgid "OpenID login successful" +msgstr "Login com OpenID efetuado com sucesso" + +#: consumer.php:108 +msgid "Unknown Status. Bind not successful. This is probably a bug." +msgstr "" + +#: consumer.php:155 +#, php-format +msgid "Could not discover an OpenID identity server endpoint at the url: %s" +msgstr "Não foi possível encontrar um provedor OpenID na URL: %s" + +#: login.php:47 +msgid "Your have entered a valid OpenID, but this site is not currently accepting new accounts." +msgstr "Sua identidade OpenID é válida, mas este site não aceita a criação de novas contas." + +#: login.php:126 +msgid "Or login using an OpenID" +msgstr "Ou entre usando sua identidade OpenID" + +#: login.php:131 +#: login.php:179 +msgid "Learn about OpenID" +msgstr "Saiba mais sobre OpenID" + +#: login.php:146 +msgid "Register using an OpenID:" +msgstr "Registre-se usando uma conta OpenID:" + +#: login.php:159 +msgid "Or register using an OpenID:" +msgstr "Ou registre-se usando uma conta OpenID:" + +#: login.php:205 +#: login.php:216 +msgid "ERROR: " +msgstr "ERRO: " + +#: login.php:205 +msgid "New users must register using OpenID." +msgstr "Novos usuário podem se registrar apenas com OpenID." + +#: server.php:227 +msgid "OpenID Login Error" +msgstr "Erro de login com OpenID" + +#: server.php:229 +#, php-format +msgid "Because you have delegated your OpenID, you cannot login with the URL %s. Instead, you must use your full OpenID when logging in." +msgstr "" + +#: server.php:231 +#, php-format +msgid "Your full OpenID is: %s" +msgstr "Sua identidade OpenID é: %s" + +#: server.php:459 +#, php-format +msgid "Logged in as %1$s (%2$s). Use a different account?" +msgstr "Identificado como %1$s (%2$s). Usar outra conta?" + +#: server.php:466 +#: server.php:500 +msgid "Verify Your Identity" +msgstr "Verifique sua identidade" + +#: server.php:468 +#, php-format +msgid "%s has asked to verify your identity." +msgstr "%s solicitou a verificação da sua identidade." + +#: server.php:472 +msgid "Click Continue to verify your identity and login without creating a new password." +msgstr "Clique em Continuar para verificar a sua identidade e entrar sem criar uma senha." + +#: server.php:479 +msgid "Cancel and go back" +msgstr "Cancelar e voltar" + +#: server.php:484 +#, php-format +msgid "Manage or remove access on the Trusted Sites page." +msgstr "Gerencie ou remova o acesso na página de sites autorizados" + +#: server.php:488 +#, php-format +msgid "Edit your profile to change the information that gets shared with Trusted Sites." +msgstr "Edite o seu perfil para mudar as informações que são compartilhadas com os sites autorizados." + +#: server_ext.php:63 +#, php-format +msgid "Also grant access to see my %s." +msgstr "Também permitir acesso ao meu %s." + +#. Plugin URI of an extension +msgid "http://wordpress.org/extend/plugins/openid" +msgstr "http://wordpress.org/extend/plugins/openid" + +#. Description of an extension +msgid "Allows the use of OpenID for account registration, authentication, and commenting. Also includes an OpenID provider which can turn WordPress author URLs into OpenIDs." +msgstr "Permite o uso de uma identidade OpenID para a criação e autenticação de contas bem como para a publicação de comentários. Também inclui um provedor OpenID que transforma as URLs dos autores do Wordpress em URLs OpenID." + +#. Author of an extension +msgid "DiSo Development Team" +msgstr "DiSo Development Team" + +#. Author URI of an extension +msgid "http://diso-project.org/" +msgstr "http://diso-project.org/" + diff --git a/localization/openid-zh_CN.mo b/localization/openid-zh_CN.mo new file mode 100644 index 0000000..fa8e7de Binary files /dev/null and b/localization/openid-zh_CN.mo differ diff --git a/localization/openid-zh_CN.po b/localization/openid-zh_CN.po new file mode 100644 index 0000000..fb4c210 --- /dev/null +++ b/localization/openid-zh_CN.po @@ -0,0 +1,544 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR DiSo Development Team +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: OpenID 3.4-trunk\n" +"Report-Msgid-Bugs-To: http://wordpress.org/tag/openid\n" +"POT-Creation-Date: 2009-10-01 15:34-0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" + +#: admin_panels.php:25 +msgid "OpenID options" +msgstr "OpenID选项" + +#. #-#-#-#-# openid.pot (OpenID 3.4-trunk) #-#-#-#-# +#. Plugin Name of an extension +#: admin_panels.php:25 +msgid "OpenID" +msgstr "OpenID" + +#: admin_panels.php:30 +msgid "Your OpenIDs" +msgstr "你的OpenID" + +#: admin_panels.php:44 admin_panels.php:45 admin_panels.php:423 +msgid "Your Trusted Sites" +msgstr "你的信任站点" + +#: admin_panels.php:57 admin_panels.php:61 admin_panels.php:149 +msgid "OpenID Settings" +msgstr "OpenID设置" + +#: admin_panels.php:112 +msgid "Settings" +msgstr "设置" + +#: admin_panels.php:133 +msgid "OpenID cache refreshed." +msgstr "OpenID缓存已刷新" + +#: admin_panels.php:151 +msgid "" +"Please note that all OpenID Consumer options have been moved to their " +"respective sections of the General Settings and Discussion Settings pages." +msgstr "请注意,所有OpenID消费者选项都已经被移动到他们各自的常规设置部分和讨论设置页面。" + +#: admin_panels.php:160 +msgid "" +"The OpenID Provider allows authorized users to use their author URL as an " +"OpenID, either using their local WordPress username and password, or by " +"delegating to another OpenID Provider." +msgstr "OpenID提供者允许已授权用户使用他们的作者URL作为一个OpenID,或者使用其本地WordPress的用户名和密码,或者通过委托给另一个OpenID提供者。" + +#: admin_panels.php:166 +msgid "Enable OpenID" +msgstr "启用OpenID" + +#: admin_panels.php:169 +msgid "Enable the local OpenID Provider for these roles:" +msgstr "为这些角色启用本地OpenID提供者:" + +#: admin_panels.php:192 +msgid "Blog Owner" +msgstr "博客主人" + +#: admin_panels.php:195 +#, php-format +msgid "" +"Authorized accounts on this blog can use their author URL (i.e. %1$s) as an OpenID. The Blog Owner will be able to use the blog address (%2" +"$s) as their OpenID. If this is a single-user blog, you should set this to " +"your account." +msgstr "这个博客的已认证账号能使用他们的作者URL(例如%1$s)作为一个OpenID。博客主人将能使用这个博客地址(%2$s)作为他们的OpenID。如果这是一个单用户博客,你应该将它设置到你的账号。" + +#: admin_panels.php:205 +msgid "" +"A Blog Owner cannot be set for this blog. To set a Blog Owner, first remove " +"the following line from your wp-config.php:" +msgstr "不能为这个博客设置一个博客主人。要设置一个博客主人,首先要从你的wp-config.php移除以下行:" + +#: admin_panels.php:213 +msgid "(none)" +msgstr "(none)" + +#: admin_panels.php:223 +#, php-format +msgid "Only the current Blog Owner (%s) can change this setting." +msgstr "仅当前博客主人(%s)能改变这个设置。" + +#: admin_panels.php:235 +msgid "Troubleshooting" +msgstr "故障排除" + +#: admin_panels.php:239 +#, php-format +msgid "" +"If users are experiencing problems logging in with OpenID, it may help to %1" +"$srefresh the cache%2$s." +msgstr "如果用户在用OpenID登录时遇到问题,去%1$s刷新缓存%2$s可能会有帮助。" + +#: admin_panels.php:246 +msgid "Save Changes" +msgstr "保存改变" + +#: admin_panels.php:266 +msgid "Success:" +msgstr "成功:" + +#: admin_panels.php:269 +msgid "Warning:" +msgstr "警告:" + +#: admin_panels.php:272 admin_panels.php:276 +msgid "Error:" +msgstr "错误:" + +#: admin_panels.php:288 +msgid "Your Verified OpenIDs" +msgstr "你已验证的OpenID" + +#: admin_panels.php:290 +msgid "" +"You may associate one or more OpenIDs with your account. This will allow " +"you to login to WordPress with your OpenID instead of a username and " +"password. Learn " +"more..." +msgstr "你可以关联一个或多个OpenID到你的账号。这将允许你使用你的OpenID登录到WordPress,而不是一个用户名和密码。学习更多" + +#: admin_panels.php:297 admin_panels.php:432 +msgid "Bulk Actions" +msgstr "批量操作" + +#: admin_panels.php:298 admin_panels.php:433 +msgid "Delete" +msgstr "删除" + +#: admin_panels.php:300 admin_panels.php:435 +msgid "Apply" +msgstr "应用" + +#: admin_panels.php:312 +msgid "Account" +msgstr "账号" + +#: admin_panels.php:321 +msgid "No Verified Accounts." +msgstr "未验证账号" + +#: admin_panels.php:340 admin_panels.php:346 +msgid "Add OpenID" +msgstr "添加OpenID" + +#: admin_panels.php:387 +#, php-format +msgid "Added %d trusted site." +msgid_plural "Added %d trusted sites." +msgstr[0] "已添加%d被信任站点。" +msgstr[1] "已添加%d被信任站点。" +msgstr[2] "已添加%d被信任站点。" + + +#: admin_panels.php:410 +#, php-format +msgid "Deleted %d trusted site." +msgid_plural "Deleted %d trusted sites." +msgstr[0] "已删除%d被信任站点。" +msgstr[1] "已删除%d被信任站点。" +msgstr[2] "已删除%d被信任站点。" + + +#: admin_panels.php:425 +msgid "" +"This is a list of sites that you can automatically login to using your " +"OpenID account. You will not be asked to approve OpenID login requests for " +"your trusted sites." +msgstr "这是一个你能使用你的OpenID账号自动登录的站点列表。你将不会被要求为你的信任站点去批准OpenID登录请求。" + +#: admin_panels.php:447 +msgid "URL" +msgstr "URL" + +#: admin_panels.php:448 +msgid "Last Login" +msgstr "最后登录" + +#: admin_panels.php:456 +msgid "No Trusted Sites." +msgstr "不信任站点" + +#: admin_panels.php:487 +msgid "Import Trusted Sites" +msgstr "导入信任站点" + +#: admin_panels.php:489 +msgid "Enter a list of URLs to be added to your Trusted Sites." +msgstr "输入一个被添加到你的信任站点的URL列表。" + +#: admin_panels.php:493 admin_panels.php:503 +msgid "Add Sites" +msgstr "添加站点" + +#: admin_panels.php:495 +msgid "(One URL per line)" +msgstr "(每行一个URL)" + +#: admin_panels.php:589 +msgid "Status information:" +msgstr "状态信息:" + +#: admin_panels.php:589 +msgid "All Systems Nominal" +msgstr "所有系统标称" + +#: admin_panels.php:590 +msgid "System Status" +msgstr "系统状态" + +#: admin_panels.php:590 +msgid "Toggle More/Less" +msgstr "切换到更多/更少" + +#: admin_panels.php:592 +msgid "" +"Plugin is currently disabled. Fix the problem, then Deactivate/Reactivate " +"the plugin." +msgstr "插件当前未启用。要修复这个问题请停用/重新激活这个插件。" + +#: admin_panels.php:600 +msgid "FAIL" +msgstr "失败" + +#: admin_panels.php:602 +msgid "OK" +msgstr "OK" + +#: admin_panels.php:604 +msgid "INFO" +msgstr "信息" + +#: admin_panels.php:638 +msgid "You already have this OpenID!" +msgstr "你已经拥有这个OpenID了!" + +#: admin_panels.php:640 +msgid "This OpenID is already associated with another user." +msgstr "这个OpenID已经关联到其他用户。" + +#: admin_panels.php:661 +msgid "Unable to authenticate OpenID." +msgstr "不能认证OpenID" + +#: admin_panels.php:662 +msgid "" +"OpenID assertion successful, but this URL is already associated with another " +"user on this blog." +msgstr "OpenID断言(assertion)成功,但这个URL已经关联到这个博客的其他用户了。" + +#: admin_panels.php:663 +msgid "Added association with OpenID." +msgstr "已为OpenID添加关联。" + +#: admin_panels.php:675 admin_panels.php:745 +msgid "" +"Note: For security reasons, your profile URL has been " +"updated to match your OpenID." +msgstr "注意:为了安全起见,你的个人资料URL已被升级来匹配你的OpenID。" + +#: admin_panels.php:701 admin_panels.php:718 +msgid "OpenID Warning" +msgstr "OpenID警告" + +#: admin_panels.php:703 +msgid "" +"Are you sure you want to delete all of your OpenID associations? Doing so " +"may prevent you from logging in." +msgstr "你真的要删除你的所有OpenID关联吗?这样做你的登录可能会被阻止。" + +#: admin_panels.php:705 +msgid "Yes I'm sure. Delete." +msgstr "是的,我确信删除。" + +#: admin_panels.php:706 +msgid "No, don't delete." +msgstr "不,不删除。" + +#: admin_panels.php:733 +#, php-format +msgid "Deleted %d OpenID association." +msgid_plural "Deleted %d OpenID associations." +msgstr[0] "已删除%d OpenID关联。" +msgstr[1] "已删除%d OpenID关联。" +msgstr[2] "已删除%d OpenID关联。" + + +#: admin_panels.php:751 +msgid "OpenID association delete failed: Unknown reason." +msgstr "OpenID关联删除失败。未知原因。" + +#: admin_panels.php:807 +#, php-format +msgid "" +"For security reasons, your profile URL must be one of your claimed OpenIDs: %" +"s" +msgstr "为了安全起见,你的个人资料必需是你已声明的OpenID之一:%s" + +#: admin_panels.php:844 +msgid "OpenID Delegation" +msgstr "OpenID委托代理" + +#: admin_panels.php:846 +msgid "" +"OpenID Delegation allows you to use an external OpenID provider of your " +"choice." +msgstr "OpenID委托代理允许你使用你所选择的一个OpenID提供者。" + +#: admin_panels.php:849 +msgid "To delegate, enter a valid OpenID. Otherwise leave this blank." +msgstr "要委托代理,输入一个有效的OpenID。否则什么都不要填。" + +#: admin_panels.php:886 +#, php-format +msgid "Unable to find any OpenID information for delegate URL %s" +msgstr "不能发现代理URL %s 的任何OpenID信息" + +#: admin_panels.php:896 +msgid "You cannot delegate to an OpenID provider which uses Identifier Select." +msgstr "你不能使用身份选择委托到一个OpenID提供者。" + +#: admin_panels.php:917 +msgid "New accounts can only be created with verified OpenIDs." +msgstr "新账号仅能由已验证的OpenID创建。" + +#: admin_panels.php:956 +msgid "New accounts can only be created with verified OpenIDs" +msgstr "新账号仅能由已验证的OpenID创建。" + +#: admin_panels.php:979 +msgid "Enable OpenID for comments" +msgstr "为评论启用OpenID" + +#: admin_panels.php:989 +msgid "Do not require name and e-mail for comments left with a verified OpenID" +msgstr "评论除了一个已验证的OpenID以外不需要名字和电子邮件" + +#: admin_panels.php:997 +msgid "Always approve comments left with a verified OpenID" +msgstr "始终批准以一个已验证的OpenID发表评论" + +#: comments.php:106 +msgid "Error: please fill the required fields (name, email)." +msgstr "错误:请填写必填字段(名字,电子邮箱)。" + +#: comments.php:108 +msgid "Error: please enter a valid email address." +msgstr "错误:请输入一个有效的电子邮箱地址。" + +#: comments.php:258 +msgid "" +"Authenticate this comment using OpenID." +msgstr "使用OpenID验证这个评论。" + +#: comments.php:271 comments.php:289 +msgid "OpenID Authentication Error" +msgstr "OpenID认验证错误" + +#: comments.php:272 +msgid "" +"We were unable to authenticate your claimed OpenID, however you can continue " +"to post your comment without OpenID:" +msgstr "我们不能验证你声明的OpenID,但你可以继续不用OpenID来发表你的评论:" + +#: comments.php:280 +msgid "Submit Comment" +msgstr "提交评论" + +#: common.php:342 +msgid "" +"User was created fine, but wp_login() for the new user failed. This is " +"probably a bug." +msgstr "用户已经创建好了,但新用户的wp_login()失败了。这可能是一个程序错误。" + +#: common.php:363 +msgid "" +"OpenID authentication successful, but failed to create WordPress user. This " +"is probably a bug." +msgstr "OpenID验证成功,但创建WordPress用户失败。这可能是一个程序错误。" + +#: common.php:680 +msgid "" +"Since your browser does not support JavaScript, you must press the Continue " +"button once to proceed." +msgstr "因为你的浏览器不支持JavaScript,你必需按继续按钮继续。" + +#: common.php:688 server.php:236 server.php:480 +msgid "Continue" +msgstr "继续" + +#: common.php:692 +msgid "Please Wait..." +msgstr "请稍等……" + +#: common.php:696 +msgid "OpenID Authentication Redirect" +msgstr "OpenID验证重定向" + +#: consumer.php:90 +msgid "OpenID login was cancelled." +msgstr "OpenID登录已取消" + +#: consumer.php:95 +#, php-format +msgid "OpenID login failed: %s" +msgstr "OpenID登录失败:%s" + +#: consumer.php:100 +msgid "OpenID login successful" +msgstr "OpenID登录成功" + +#: consumer.php:108 +msgid "Unknown Status. Bind not successful. This is probably a bug." +msgstr "未知状态。绑定不成功。这可能是一个程序错误。" + +#: consumer.php:155 +#, php-format +msgid "Could not discover an OpenID identity server endpoint at the url: %s" +msgstr "不能在url %s 发现一个OpenID身份服务器端点" + +#: login.php:47 +msgid "" +"Your have entered a valid OpenID, but this site is not currently accepting " +"new accounts." +msgstr "你已经输入了一个有效的OpenID,但这个站点当前不接受新账号。" + +#: login.php:126 +msgid "Or login using an OpenID" +msgstr "或使用一个OpenID登录" + +#: login.php:131 login.php:179 +msgid "Learn about OpenID" +msgstr "学习OpenID相关信息" + +#: login.php:146 +msgid "Register using an OpenID:" +msgstr "使用一个OpenID注册:" + +#: login.php:159 +msgid "Or register using an OpenID:" +msgstr "或使用一个OpenID注册:" + +#: login.php:205 login.php:216 +msgid "ERROR: " +msgstr "错误" + +#: login.php:205 +msgid "New users must register using OpenID." +msgstr "新用户必需使用OpenID注册。" + +#: server.php:227 +msgid "OpenID Login Error" +msgstr "OpenID登录错误" + +#: server.php:229 +#, php-format +msgid "" +"Because you have delegated your OpenID, you cannot login with the URL " +"%s. Instead, you must use your full OpenID when logging in." +msgstr "因为你已经委托了你的OpenID,因此不能以URL%s登录。相反,你在登录时必需使用你的完整的OpenID。" + +#: server.php:231 +#, php-format +msgid "Your full OpenID is: %s" +msgstr "你的完整的OpenID是:%s" + +#: server.php:459 +#, php-format +msgid "Logged in as %1$s (%2$s). Use a different account?" +msgstr "已经以%1$s(%2$s)登录。使用一个不同的账号?" + +#: server.php:466 server.php:500 +msgid "Verify Your Identity" +msgstr "验证你的身份" + +#: server.php:468 +#, php-format +msgid "%s has asked to verify your identity." +msgstr "%s 要求验证你的身份。" + +#: server.php:472 +msgid "" +"Click Continue to verify your identity and login without " +"creating a new password." +msgstr "点击继续验证你的身份并登录,不需要创建一个新密码。" + +#: server.php:479 +msgid "Cancel and go back" +msgstr "放弃并返回" + +#: server.php:484 +#, php-format +msgid "" +"Manage or remove access on the Trusted " +"Sites page." +msgstr "管理或移除信任的站点页面访问。" + +#: server.php:488 +#, php-format +msgid "" +"Edit your profile to change the " +"information that gets shared with Trusted Sites." +msgstr "编辑你的个人资料 去更改获取已共享信任站点的信息。" + +#: server_ext.php:63 +#, php-format +msgid "Also grant access to see my %s." +msgstr "同时授权访问查看我的 %s。" + +#. Plugin URI of an extension +msgid "http://wordpress.org/extend/plugins/openid" +msgstr "http://wordpress.org/extend/plugins/openid" + +#. Description of an extension +msgid "" +"Allows the use of OpenID for account registration, authentication, and " +"commenting. Also includes an OpenID provider which can turn WordPress " +"author URLs into OpenIDs." +msgstr "允许使用OpenID进行账号注册、验证和评论。此外包括一个OpenID提供者,可以转换WordPress作者的URL为OpenID。" + +#. Author of an extension +msgid "DiSo Development Team" +msgstr "DiSo开发小组" + +#. Author URI of an extension +msgid "http://diso-project.org/" +msgstr "http://diso-project.org/" diff --git a/login.php b/login.php index b9d6b2f..05d0517 100644 --- a/login.php +++ b/login.php @@ -1,6 +1,6 @@ 1, - 'identity_url' => urlencode($identity_url), + $url = add_query_arg( array( + 'finish_openid' => 1, + 'identity_url' => urlencode($identity_url), 'redirect_to' => $_SESSION['openid_finish_url'], - '_wpnonce' => wp_create_nonce('openid_login_' . md5($identity_url)), + '_wpnonce' => wp_create_nonce('openid_login_' . md5($identity_url)), ), $url); - + wp_safe_redirect($url); exit; } @@ -134,7 +150,7 @@ function openid_wp_login_form() { /** - * Add information about registration to wp-login.php?action=register + * Add information about registration to wp-login.php?action=register * * @action: register_form **/ @@ -143,18 +159,10 @@ function openid_wp_register_form() {
'; //Added to fix IE problem if (get_option('openid_required_for_registration')) { + wp_enqueue_script('jquery'); + wp_enqueue_script('openid-register', plugin_dir_url(__FILE__) . 'f/register.js', array('jquery'), OPENID_PLUGIN_REVISION); + $label = __('Register using an OpenID:', 'openid'); - echo ' - '; } else { $label = __('Or register using an OpenID:', 'openid'); @@ -228,4 +236,3 @@ function openid_register_post($username, $password, $errors) { wp_signon(); } } -?> diff --git a/openid.php b/openid.php index fe7feb4..8832360 100644 --- a/openid.php +++ b/openid.php @@ -5,42 +5,69 @@ Description: Allows the use of OpenID for account registration, authentication, and commenting. Also includes an OpenID provider which can turn WordPress author URLs into OpenIDs. Author: DiSo Development Team Author URI: http://diso-project.org/ - Version: 3.3.4 + Version: 3.4.0 License: Dual GPL (http://www.fsf.org/licensing/licenses/info/GPLv2.html) and Modified BSD (http://www.fsf.org/licensing/licenses/index_html#ModifiedBSD) Text Domain: openid - */ +*/ -define ( 'OPENID_PLUGIN_REVISION', preg_replace( '/\$Rev: (.+) \$/', '\\1', - '$Rev: 519 $') ); // this needs to be on a separate line so that svn:keywords can work its magic +// this needs to be on a separate line so that svn:keywords can work its magic +define( 'OPENID_PLUGIN_REVISION', preg_replace( '/\$Rev: (.+) \$/', '\\1', '$Rev: 519 $' ) ); // last plugin revision that required database schema changes -define ( 'OPENID_DB_REVISION', 24426); +define( 'OPENID_DB_REVISION', 24426 ); + +// default values for which modules to activate +if ( ! defined( 'OPENID_ENABLE_CONSUMER' ) ) { + define( 'OPENID_ENABLE_CONSUMER', true ); +} +if ( ! defined( 'OPENID_ENABLE_COMMENTS' ) ) { + define( 'OPENID_ENABLE_COMMENTS', true ); +} +if ( ! defined( 'OPENID_ENABLE_SERVER' ) ) { + define( 'OPENID_ENABLE_SERVER', true ); +} +if ( ! defined( 'OPENID_ENABLE_ADMIN_PANELS' ) ) { + define( 'OPENID_ENABLE_ADMIN_PANELS', true ); +} + -$openid_include_path = dirname(__FILE__) . '/lib'; +$openid_include_path = dirname( __FILE__ ) . '/lib'; // check source of randomness -if ( !@is_readable('/dev/urandom') ) { - define('Auth_OpenID_RAND_SOURCE', null); +if ( ! @is_readable( '/dev/urandom' ) ) { + define( 'Auth_OpenID_RAND_SOURCE', null ); } set_include_path( $openid_include_path . PATH_SEPARATOR . get_include_path() ); -require_once dirname(__FILE__) . '/common.php'; -require_once dirname(__FILE__) . '/consumer.php'; -require_once dirname(__FILE__) . '/admin_panels.php'; -require_once dirname(__FILE__) . '/comments.php'; -require_once dirname(__FILE__) . '/login.php'; -require_once dirname(__FILE__) . '/server.php'; -require_once dirname(__FILE__) . '/store.php'; +require_once dirname( __FILE__ ) . '/common.php'; +require_once dirname( __FILE__ ) . '/store.php'; + +if ( OPENID_ENABLE_CONSUMER ) { + require_once dirname( __FILE__ ) . '/consumer.php'; + require_once dirname( __FILE__ ) . '/login.php'; +} + +if ( OPENID_ENABLE_ADMIN_PANELS ) { + require_once dirname( __FILE__ ) . '/admin_panels.php'; +} + +if ( OPENID_ENABLE_CONSUMER && OPENID_ENABLE_COMMENTS ) { + require_once dirname( __FILE__ ) . '/comments.php'; +} + +if ( OPENID_ENABLE_SERVER ) { + require_once dirname( __FILE__ ) . '/server.php'; +} // register activation (and similar) hooks -register_activation_hook('openid/openid.php', 'openid_activate_plugin'); -register_deactivation_hook('openid/openid.php', 'openid_deactivate_plugin'); -register_uninstall_hook('openid/openid.php', 'openid_uninstall_plugin'); +register_activation_hook( 'openid/openid.php', 'openid_activate_plugin' ); +register_deactivation_hook( 'openid/openid.php', 'openid_deactivate_plugin' ); +register_uninstall_hook( 'openid/openid.php', 'openid_uninstall_plugin' ); // run activation function if new revision of plugin -if ( get_option('openid_plugin_revision') === false || OPENID_PLUGIN_REVISION != get_option('openid_plugin_revision') ) { - add_action('admin_init', 'openid_activate_plugin'); +if ( get_option( 'openid_plugin_revision' ) === false || OPENID_PLUGIN_REVISION != get_option( 'openid_plugin_revision' ) ) { + add_action( 'admin_init', 'openid_activate_plugin' ); } @@ -55,14 +82,14 @@ * @return bool true if the user has any OpenIDs * @since 1.0 */ -function is_user_openid($user = null) { - $urls = get_user_openids($user); - return ( !empty($urls) ); +function is_user_openid( $user = null ) { + $urls = get_user_openids( $user ); + return ( ! empty( $urls ) ); } /** - * Check if the current comment was submitted using an OpenID. Useful for + * Check if the current comment was submitted using an OpenID. Useful for *
* * @param int $id comment ID to check for. If not provided, the current comment will be used. @@ -71,16 +98,16 @@ function is_user_openid($user = null) { * @since 1.0 */ function is_comment_openid($id = null) { - if ( is_numeric($id) ) { - $comment = get_comment($id); + if ( is_numeric( $id ) ) { + $comment = get_comment( $id ); } else { global $comment; } - $openid_comments = get_post_meta($comment->comment_post_ID, 'openid_comments', true); + $openid_comments = get_post_meta( $comment->comment_post_ID, 'openid_comments', true ); - if ( is_array($openid_comments) ) { - if ( in_array($comment->comment_ID, $openid_comments) ) { + if ( is_array( $openid_comments ) ) { + if ( in_array( $comment->comment_ID, $openid_comments ) ) { return true; } } @@ -97,12 +124,12 @@ function is_comment_openid($id = null) { * @access public * @since 3.0 */ -function get_user_openids($id_or_name = null) { - $user = get_userdata_by_various($id_or_name); +function get_user_openids( $id_or_name = null ) { + $user = get_userdata_by_various( $id_or_name ); if ( $user ) { global $wpdb; - return $wpdb->get_col( $wpdb->prepare('SELECT url FROM '.openid_identity_table().' WHERE user_id = %s', $user->ID) ); + return $wpdb->get_col( $wpdb->prepare( 'SELECT url FROM '.openid_identity_table().' WHERE user_id = %s', $user->ID ) ); } else { return array(); } @@ -119,7 +146,7 @@ function get_user_openids($id_or_name = null) { */ function get_user_by_openid($url) { global $wpdb; - return $wpdb->get_var( $wpdb->prepare('SELECT user_id FROM '.openid_identity_table().' WHERE url = %s', $url) ); + return $wpdb->get_var( $wpdb->prepare( 'SELECT user_id FROM '.openid_identity_table().' WHERE url = %s', $url ) ); } @@ -142,26 +169,31 @@ function openid_input() { * @access public * @since 3.0 */ -if (!function_exists('get_userdata_by_various')) : -function get_userdata_by_various($id_or_name = null) { - if ( $id_or_name === null ) { - $user = wp_get_current_user(); - if ($user == null) return false; - return $user->data; - } else if ( is_numeric($id_or_name) ) { - return get_user_by('id', $id_or_name); - } else { - return get_user_by('login', $id_or_name); +if ( ! function_exists( 'get_userdata_by_various' ) ) : + function get_userdata_by_various($id_or_name = null) { + if ( null === $id_or_name ) { + if ( ! is_user_logged_in() ) { + return false; + } + $user = wp_get_current_user(); + if ( null === $user ) { + return false; + } + return $user->data; + } else if ( is_numeric( $id_or_name ) ) { + return get_user_by( 'id', $id_or_name ); + } else { + return get_user_by( 'login', $id_or_name ); + } } -} endif; // -- end of public functions /** - * Get the file for the plugin, including the path. This method will handle the case where the - * actual plugin files do not reside within the WordPress directory on the filesystem (such as + * Get the file for the plugin, including the path. This method will handle the case where the + * actual plugin files do not reside within the WordPress directory on the filesystem (such as * a symlink). The standard value should be 'openid/openid.php' unless files or folders have * been renamed. * @@ -170,17 +202,16 @@ function get_userdata_by_various($id_or_name = null) { function openid_plugin_file() { static $file; - if ( empty($file) ) { + if ( empty( $file ) ) { $path = 'openid'; - $base = plugin_basename(__FILE__); - if ( $base != __FILE__ ) { - $path = basename(dirname($base)); + $base = plugin_basename( __FILE__ ); + if ( __FILE__ != $base ) { + $path = basename( dirname( $base ) ); } - $file = $path . '/' . basename(__FILE__); + $file = $path . '/' . basename( __FILE__ ); } return $file; } - diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..890022d --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,5 @@ + + + WordPress Coding Standard. + + diff --git a/readme.txt b/readme.txt index abada5c..35f3fe9 100644 --- a/readme.txt +++ b/readme.txt @@ -1,27 +1,27 @@ === OpenID === -Contributors: willnorris, factoryjoe +Contributors: willnorris, factoryjoe, pfefferle Tags: openid, authentication, login, comments Requires at least: 2.8 -Tested up to: 2.8.5 -Stable tag: 3.3.4 +Tested up to: 4.3 +Stable tag: 3.4.0 Allows WordPress to provide and consumer OpenIDs for authentication of users and comments. == Description == OpenID is an [open standard][] that allows users to authenticate to websites -without having to create a new password. This plugin allows users to login to +without having to create a new password. This plugin allows users to login to their local WordPress account using an OpenID, as well as enabling commenters -to leave authenticated comments with OpenID. The plugin also includes an OpenID +to leave authenticated comments with OpenID. The plugin also includes an OpenID provider, enabling users to login to OpenID-enabled sites using their own personal WordPress account. [XRDS-Simple][] is required for the OpenID Provider and some features of the OpenID Consumer. -Developer documention, which includes all of the public methods and hooks for +Developer documentation, which includes all of the public methods and hooks for integrating with and extending the plugin, can be found [here][dev-doc]. [open standard]: http://openid.net/ -[XRDS-Simple]: http://wordpress.org/extend/plugins/xrds-simple/ +[XRDS-Simple]: http://wordpress.org/plugins/xrds-simple/ [dev-doc]: http://wiki.diso-project.org/wordpress-openid-api == Installation == @@ -40,14 +40,14 @@ This plugin follows the [standard WordPress installation method][]: = Why do I get blank screens when I activate the plugin? = In some cases the plugin may have problems if not enough memory has been -allocated to PHP. Try ensuring that the PHP memory\_limit is at least 8MB +allocated to PHP. Try ensuring that the PHP memory\_limit is at least 8MB (limits of 64MB are not uncommon). = Why don't `https` OpenIDs work? = SSL certificate problems creep up when working with some OpenID providers -(namely MyOpenID). This is typically due to an outdated CA cert bundle being -used by libcurl. An explanation of the problem and a couple of solutions +(namely MyOpenID). This is typically due to an outdated CA cert bundle being +used by libcurl. An explanation of the problem and a couple of solutions can be found [here][libcurl]. [libcurl]: http://lists.openidenabled.com/pipermail/dev/2007-August/000784.html @@ -55,7 +55,7 @@ can be found [here][libcurl]. = Why do I get the error "Invalid openid.mode ''"? = There are actually a couple of reasons that can cause this, but it seems one of -the more common causes is a conflict with certain mod_security rules. See +the more common causes is a conflict with certain mod_security rules. See [this blog post][ioni2] for instructions on how to resolve this issue. [ioni2]: http://ioni2.com/2009/wordpress-openid-login-failed-invalid-openid-mode-no-mode-set-solved-for-both-wordpress-and-drupal/ @@ -63,7 +63,7 @@ the more common causes is a conflict with certain mod_security rules. See = How do I use SSL for OpenID transactions? = -First, be aware that this only works in WordPress 2.6 and up. Make sure you've +First, be aware that this only works in WordPress 2.6 and up. Make sure you've turned on SSL in WordPress by [defining either of the following][wp-ssl] globals as "true" in your `wp-config.php` file: @@ -82,9 +82,9 @@ using a certificate purchased from a well-known certificate authority. = How do I get help if I have a problem? = Please direct support questions to the "Plugins and Hacks" section of the -[WordPress.org Support Forum][]. Just make sure and include the tag 'openid' -so that I'll see your post. Additionally, you can file a bug -report at . +[WordPress.org Support Forum][]. Just make sure and include the tag 'openid' +so that I'll see your post. Additionally, you can file a bug +report at . [WordPress.org Support Forum]: http://wordpress.org/support/ @@ -103,6 +103,16 @@ report at . Project maintined on github at [diso/wordpress-openid](https://github.com/diso/wordpress-openid). += version 3.4.0 (Jul XX, 2015) = + - update to latest OpenID library (includes lots of bug fixes, particularly with PHP 5.3). Full changelog [on github](https://github.com/openid/php-openid). + - fixed various PHP warnings/errors. + - various improvements and bugfixes (props @rodrigoprimo). + - attempt to use email as username before url for open id new user (props @yincrash). + - chinese and german (props Stephan Richter) translations. + - added WebFinger support + +Full changelog on [github](https://github.com/diso/wordpress-openid/compare/v3.3.4...v3.4.0). + = version 3.3.4 (Nov 16, 2012) = - update to latest OpenID library (includes lots of bug fixes, particularly with PHP 5.3). Full changelog [on github](https://github.com/openid/php-openid). - various bug fixes. Full changelog [on github](https://github.com/diso/wordpress-openid). @@ -113,7 +123,7 @@ Project maintined on github at - fix a few PHP and WordPress warnings and notices = version 3.3.2 (Nov 06, 2009) = - - add localizations for czech, danish, french, spanish, and vietnamese. Some are more up to date than others. More are welcome, see http://code.google.com/p/diso/issues/detail?id=26 + - add localizations for czech, danish, french, spanish, and vietnamese. Some are more up to date than others. More are welcome, see http://code.google.com/p/diso/issues/detail?id=26 - remove stylesheet for recent comments widget, since it breaks the style for OpenID comments - various fixes with administration panels @@ -123,24 +133,24 @@ Project maintined on github at = version 3.3 (Sep 28, 2009) = - minimum required version has been bumped to WordPress 2.8 - fix support for WordPress MU - - new, less obtrusive UI for comment form. Should also work with all themes in some form (with or without js). + - new, less obtrusive UI for comment form. Should also work with all themes in some form (with or without js). - many administrative options have been moved to their respective locations on core WordPress Settings pages - drop support for experimental EAUT and IDIB protocols - drop support for installing the plugin in mu-plugins folder - - always include 'index.php' on OpenID endpoint URLs. Without that, some deployments were having problems. + - always include 'index.php' on OpenID endpoint URLs. Without that, some deployments were having problems. - fix bug relating to trackbacks and pingbacks - - fix bug (#121) relating to unregistered options (props: tom.tdw for the patch) + - fix bug (#121) relating to unregistered options (props tom.tdw for the patch) - lots of minor bug fixes = version 3.2.3 (Jul 20, 2009) = - - fix XSS vulnerability. (props: Stuart Metcalfe) + - fix XSS vulnerability. (props Stuart Metcalfe) = version 3.2.2 (Mar 19, 2009) = - fix problems when using non-index.php permalinks with non-apache web servers - ensure that show\_on\_front option is not empty - - function name typo (props: gunemalli) - - fix deprecated pass-by-reference call in php-openid library (props: jschuur) - - fix UI bug on registration form with IE browsers (props: oledole) + - function name typo (props gunemalli) + - fix deprecated pass-by-reference call in php-openid library (props jschuur) + - fix UI bug on registration form with IE browsers (props oledole) - UI tweaks to better match WP 2.7 - update a few strings for localization and POT file @@ -224,15 +234,15 @@ Project maintined on github at = version 2.1.8 (Apr 02, 2008) = - fix UI issue with wp-login.php page in WP2.5 - fix bug printing supported curl protocols (http://wordpress.org/support/topic/159062) - - fix jquery bug while adding category in WP2.5 (http://wordpress.org/support/topic/164305) + - fix jquery bug while adding category in WP2.5 (http://wordpress.org/support/topic/164305) = version 2.1.7 (Mar 21, 2008) = - remove php5 dependency bug... AGAIN! - - also remove some other custom changes to php-openid I forgot were in there. This may actually re-introduce some edge-case + - also remove some other custom changes to php-openid I forgot were in there. This may actually re-introduce some edge-case bugs, but I'd rather expose them so that we can get the appropriate patches pushed upstream if they really are necessary. = version 2.1.6 (Mar 20, 2008) = - - update php-openid library to latest. Now properly supports Yahoo's OpenID provider. + - update php-openid library to latest. Now properly supports Yahoo's OpenID provider. = version 2.1.5 (Mar 20, 2008) = - add support for wordpress v2.5 @@ -242,7 +252,7 @@ Project maintined on github at - improve jQuery code to reduce problems with other js libraries = version 2.1.3 (Feb 06, 2008) = - - address security bug mentioned [here](http://www.gnucitizen.org/blog/hijacking-openid-enabled-accounts). Props: Sam Alexander + - address security bug mentioned [here](http://www.gnucitizen.org/blog/hijacking-openid-enabled-accounts). Props Sam Alexander = version 2.1.2 = - minor typo in profile data code @@ -270,7 +280,7 @@ Project maintined on github at = version 1.0.1 = - added wordpress.org style readme.txt - + = version 1.0 (also known as r13) = Full SVN logs are available at . diff --git a/server.php b/server.php index f2ccf5f..2746de4 100644 --- a/server.php +++ b/server.php @@ -1,10 +1,11 @@ has_cap( 'use_openid_provider' ) ) { + return $webfinger; + } + + // use delegation URL if set + if ( get_user_meta( $user->ID, 'openid_delegate', true ) ) { + $webfinger['links'][] = array( + 'href' => get_user_meta( $user->ID, 'openid_delegate', true ), + 'rel' => 'http://specs.openid.net/auth/2.0/provider', + ); + } else { + // check if WebFinger user is "blog-owner" + if ( get_option( 'openid_blog_owner' ) && $user->user_login == get_option( 'openid_blog_owner' ) ) { + $webfinger['links'][] = array( + 'href' => site_url( '/' ), + 'rel' => 'http://specs.openid.net/auth/2.0/provider', + ); + } else { // otherwise use author-url + $webfinger['links'][] = array( + 'href' => get_author_posts_url( $user->ID ), + 'rel' => 'http://specs.openid.net/auth/2.0/provider', + ); + } + } + + return $webfinger; +} + /** * Parse the request URL to determine which author is associated with it. @@ -150,7 +189,7 @@ function openid_server_request() { $request = $server->decodeRequest(); if (!$request || Auth_OpenID_isError($request)) { @session_start(); - if ($_SESSION['openid_server_request']) { + if (isset($_SESSION['openid_server_request']) && $_SESSION['openid_server_request']) { $request = $_SESSION['openid_server_request']; unset($_SESSION['openid_server_request']); } @@ -228,8 +267,8 @@ function openid_server_auth_request($request) { ob_start(); echo '

'.__('OpenID Login Error', 'openid').'

'; - echo '

'; - printf(__('Because you have delegated your OpenID, you cannot login with the URL %s. Instead, you must use your full OpenID when logging in.', 'openid'), trailingslashit(get_option('home'))); + echo '

'; + printf(__('Because you have delegated your OpenID, you cannot login with the URL %s. Instead, you must use your full OpenID when logging in.', 'openid'), trailingslashit(get_option('home'))); echo'

'; echo '

' . sprintf(__('Your full OpenID is: %s', 'openid'), ''.$author_url.'') . '

'; @@ -257,9 +296,9 @@ function openid_server_auth_request($request) { $trusted_sites[$site_hash]['last_login'] = time(); update_user_meta($user->ID, 'openid_trusted_sites', $trusted_sites); - if ($id_select) { + if ($id_select) { return $request->answer(true, null, $author_url); - } else { + } else { return $request->answer(true); } } @@ -268,12 +307,12 @@ function openid_server_auth_request($request) { if ($request->mode == 'checkid_immediate') { return $request->answer(false); } - + // finally, prompt the user to trust this site if (openid_server_user_trust($request)) { - if ($id_select) { + if ($id_select) { return $request->answer(true, null, $author_url); - } else { + } else { return $request->answer(true); } } else { @@ -407,7 +446,7 @@ function openid_server_remove_trust_site() { function openid_server_user_trust($request) { $user = wp_get_current_user(); - if ($_REQUEST['openid_trust']) { + if (isset($_REQUEST['openid_trust']) && $_REQUEST['openid_trust']) { $trust = null; if ($_REQUEST['openid_trust'] == 'cancel') { @@ -470,7 +509,7 @@ function openid_server_user_trust($request) {

' . sprintf(__('%s has asked to verify your identity.', 'openid'), ''.$request->trust_root.'') . '

- +

' . __('Click Continue to verify your identity and login without creating a new password.', 'openid') . '

'; @@ -484,7 +523,7 @@ function openid_server_user_trust($request) {

' - . sprintf(__('Manage or remove access on the Trusted Sites page.', 'openid'), + . sprintf(__('Manage or remove access on the Trusted Sites page.', 'openid'), admin_url((current_user_can('edit_users') ? 'users.php' : 'profile.php') . '?page=openid_trusted_sites')) . '

' @@ -547,6 +586,11 @@ function openid_server_get_delegation_info($userid, $url = null) { if (empty($services)) { // resort to checking for HTML links $response = $fetcher->get($url); + + if ( ! $response ) { + return false; + } + $html_content = $response->body; $p = new Auth_OpenID_Parse(); $link_attrs = $p->parseLinkAttrs($html_content); @@ -583,5 +627,3 @@ function openid_server_get_delegation_info($userid, $url = null) { 'services' => $services ); } - -?> diff --git a/server_ext.php b/server_ext.php index ef86ae7..c494325 100644 --- a/server_ext.php +++ b/server_ext.php @@ -2,8 +2,8 @@ require_once 'Auth/OpenID/SReg.php'; -add_filter('openid_server_xrds_types', 'openid_server_sreg_xrds_types'); -add_action('openid_server_post_auth', 'openid_server_sreg_post_auth'); +add_filter( 'openid_server_xrds_types', 'openid_server_sreg_xrds_types' ); +add_action( 'openid_server_post_auth', 'openid_server_sreg_post_auth' ); function openid_server_sreg_xrds_types($types) { $types[] = 'http://openid.net/extensions/sreg/1.1'; @@ -15,15 +15,15 @@ function openid_server_sreg_xrds_types($types) { /** * See if the OpenID authentication request includes SReg and add additional hooks if so. */ -function openid_server_sreg_post_auth($request) { - $sreg_request = Auth_OpenID_SRegRequest::fromOpenIDRequest($request); - if ($sreg_request) { +function openid_server_sreg_post_auth( $request ) { + $sreg_request = Auth_OpenID_SRegRequest::fromOpenIDRequest( $request ); + if ( $sreg_request ) { $GLOBALS['openid_server_sreg_request'] = $sreg_request; - add_action('openid_server_trust_form', 'openid_server_attributes_trust_form'); - add_filter('openid_server_trust_form_attributes', 'openid_server_sreg_trust_form'); - add_action('openid_server_trust_submit', 'openid_server_sreg_trust_submit', 10, 2); - add_filter('openid_server_store_trusted_site', 'openid_server_sreg_store_trusted_site'); - add_action('openid_server_auth_response', 'openid_server_sreg_auth_response' ); + add_action( 'openid_server_trust_form', 'openid_server_attributes_trust_form' ); + add_filter( 'openid_server_trust_form_attributes', 'openid_server_sreg_trust_form' ); + add_action( 'openid_server_trust_submit', 'openid_server_sreg_trust_submit', 10, 2 ); + add_filter( 'openid_server_store_trusted_site', 'openid_server_sreg_store_trusted_site' ); + add_action( 'openid_server_auth_response', 'openid_server_sreg_auth_response' ); } } @@ -35,11 +35,11 @@ function openid_server_sreg_trust_form( $attributes ) { $sreg_request = $GLOBALS['openid_server_sreg_request']; $sreg_fields = $sreg_request->allRequestedFields(); - if (!empty($sreg_fields)) { - foreach ($sreg_fields as $field) { - $value = openid_server_sreg_from_profile($field); - if (!empty($value)) { - $attributes[] = strtolower($GLOBALS['Auth_OpenID_sreg_data_fields'][$field]); + if ( ! empty( $sreg_fields ) ) { + foreach ( $sreg_fields as $field ) { + $value = openid_server_sreg_from_profile( $field ); + if ( ! empty( $value ) ) { + $attributes[] = strtolower( $GLOBALS['Auth_OpenID_sreg_data_fields'][ $field ] ); } } } @@ -52,15 +52,15 @@ function openid_server_sreg_trust_form( $attributes ) { * Add attribute input fields to the OpenID Trust Form */ function openid_server_attributes_trust_form() { - $attributes = apply_filters('openid_server_trust_form_attributes', array()); + $attributes = apply_filters( 'openid_server_trust_form_attributes', array() ); - if (!empty($attributes)) { - $attr_string = openid_server_attributes_string($attributes); + if ( ! empty( $attributes ) ) { + $attr_string = openid_server_attributes_string( $attributes ); echo '

- +

'; } } @@ -69,28 +69,31 @@ function openid_server_attributes_trust_form() { /** * Convert list of attribute names to human readable string. */ -function openid_server_attributes_string($fields, $string = '') { - if (empty($fields)) return $string; - - if (empty($string)) { - if (sizeof($fields) == 2) - return join(' and ', $fields); - $string = array_shift($fields); - } else if (sizeof($fields) == 1) { - $string .= ', and ' . array_shift($fields); - } else if (sizeof($fields) > 1) { - $string .= ', ' . array_shift($fields); +function openid_server_attributes_string( $fields, $string = '' ) { + if ( empty( $fields ) ) { + return $string; } - return openid_server_attributes_string($fields, $string); + if ( empty( $string ) ) { + if ( sizeof( $fields ) == 2 ) { + return join( ' and ', $fields ); + } + $string = array_shift( $fields ); + } else if ( sizeof( $fields ) == 1 ) { + $string .= ', and ' . array_shift( $fields ); + } else if ( sizeof( $fields ) > 1 ) { + $string .= ', ' . array_shift( $fields ); + } + + return openid_server_attributes_string( $fields, $string ); } /** * Based on input from the OpenID trust form, prep data to be included in the authentication response */ -function openid_server_sreg_trust_submit($trust, $request) { - if ($trust && $_REQUEST['include_sreg'] == 'on') { +function openid_server_sreg_trust_submit( $trust, $request ) { + if ( $trust && isset( $_REQUEST['include_sreg'] ) && 'on' == $_REQUEST['include_sreg'] ) { $GLOBALS['openid_server_sreg_trust'] = true; } else { $GLOBALS['openid_server_sreg_trust'] = false; @@ -101,7 +104,7 @@ function openid_server_sreg_trust_submit($trust, $request) { /** * Store user's decision on whether to release attributes to the site. */ -function openid_server_sreg_store_trusted_site($site) { +function openid_server_sreg_store_trusted_site( $site ) { $site['release_attributes'] = $GLOBALS['openid_server_sreg_trust']; return $site; } @@ -110,34 +113,36 @@ function openid_server_sreg_store_trusted_site($site) { /** * Attach SReg response to authentication response. */ -function openid_server_sreg_auth_response($response) { +function openid_server_sreg_auth_response( $response ) { $user = wp_get_current_user(); // should we include SREG in the response? $include_sreg = false; - if (isset($GLOBALS['openid_server_sreg_trust'])) { + if ( isset( $GLOBALS['openid_server_sreg_trust'] ) ) { $include_sreg = $GLOBALS['openid_server_sreg_trust']; } else { - $trusted_sites = get_user_meta($user->ID, 'openid_trusted_sites', true); + $trusted_sites = get_user_meta( $user->ID, 'openid_trusted_sites', true ); $request = $response->request; - $site_hash = md5($request->trust_root); - if (is_array($trusted_sites) && array_key_exists($site_hash, $trusted_sites)) { - $include_sreg = $trusted_sites[$site_hash]['release_attributes']; + $site_hash = md5( $request->trust_root ); + if ( is_array( $trusted_sites ) && array_key_exists( $site_hash, $trusted_sites ) ) { + $include_sreg = $trusted_sites[ $site_hash ]['release_attributes']; } } - if ($include_sreg) { + if ( $include_sreg ) { $sreg_data = array(); - foreach ($GLOBALS['Auth_OpenID_sreg_data_fields'] as $field => $name) { - $value = openid_server_sreg_from_profile($field); - if (!empty($value)) { - $sreg_data[$field] = $value; + foreach ( $GLOBALS['Auth_OpenID_sreg_data_fields'] as $field => $name ) { + $value = openid_server_sreg_from_profile( $field ); + if ( ! empty( $value ) ) { + $sreg_data[ $field ] = $value; } } - $sreg_response = Auth_OpenID_SRegResponse::extractResponse($GLOBALS['openid_server_sreg_request'], $sreg_data); - if (!empty($sreg_response)) $response->addExtension($sreg_response); + $sreg_response = Auth_OpenID_SRegResponse::extractResponse( $GLOBALS['openid_server_sreg_request'], $sreg_data ); + if ( ! empty( $sreg_response ) ) { + $response->addExtension( $sreg_response ); + } } return $response; @@ -145,21 +150,21 @@ function openid_server_sreg_auth_response($response) { /** - * Try to pre-populate SReg data from user's profile. The following fields + * Try to pre-populate SReg data from user's profile. The following fields * are not handled by the plugin: dob, gender, postcode, country, and language. - * Other plugins may provide this data by implementing the filter + * Other plugins may provide this data by implementing the filter * openid_server_sreg_${fieldname}. * - * @uses apply_filters() Calls 'openid_server_sreg_*' before returning sreg values, + * @uses apply_filters() Calls 'openid_server_sreg_*' before returning sreg values, * where '*' is the name of the sreg attribute. */ function openid_server_sreg_from_profile($field) { $user = wp_get_current_user(); $value = ''; - switch($field) { + switch ( $field ) { case 'nickname': - $value = get_user_meta($user->ID, 'nickname', true); + $value = get_user_meta( $user->ID, 'nickname', true ); break; case 'email': @@ -167,13 +172,11 @@ function openid_server_sreg_from_profile($field) { break; case 'fullname': - $value = get_user_meta($user->ID, 'display_name', true); + $user_data = get_userdata( $user->ID ); + $value = $user_data->display_name; break; } - $value = apply_filters('openid_server_sreg_' . $field, $value, $user->ID); + $value = apply_filters( 'openid_server_sreg_' . $field, $value, $user->ID ); return $value; } - - -?> diff --git a/store.php b/store.php index 0ab2736..838d41a 100644 --- a/store.php +++ b/store.php @@ -11,8 +11,8 @@ if (!class_exists('WordPress_OpenID_OptionStore')): /** - * OpenID store that uses the WordPress options table for storage. Originally - * written by Simon Willison for use in the mu-open-id plugin. Modified a fair + * OpenID store that uses the WordPress options table for storage. Originally + * written by Simon Willison for use in the mu-open-id plugin. Modified a fair * amount for use in WordPress OpenID. */ class WordPress_OpenID_OptionStore extends Auth_OpenID_OpenIDStore { @@ -117,9 +117,9 @@ function removeAssociation($server_url, $handle) { } else { return false; } - } + } } - + function useNonce($server_url, $timestamp, $salt) { global $Auth_OpenID_SKEW; @@ -158,11 +158,11 @@ function _getNonceKey($server_url, $timestamp, $salt) { $url_hash = base64_encode($server_url); $salt_hash = base64_encode($salt); - return sprintf('%08x-%s-%s-%s-%s', $timestamp, $proto, + return sprintf('%08x-%s-%s-%s-%s', $timestamp, $proto, $domain, $url_hash, $salt_hash); } - function cleanupNonces() { + function cleanupNonces() { global $Auth_OpenID_SKEW; $nonces = get_option('openid_nonces'); @@ -176,7 +176,7 @@ function cleanupNonces() { update_option('openid_nonces', $nonces); } - function cleanupAssociations() { + function cleanupAssociations() { $associations = get_option('openid_associations'); foreach ($associations as $key => $assoc_s) { @@ -190,7 +190,7 @@ function cleanupAssociations() { update_option('openid_associations', $associations); } - function reset() { + function reset() { update_option('openid_nonces', array()); update_option('openid_associations', array()); } @@ -220,7 +220,7 @@ function openid_check_tables($retry=true) { $message[] = "Table $t exists."; } } - + if( $retry and !$ok) { openid_create_tables(); $ok = openid_check_tables( false ); @@ -267,7 +267,7 @@ function openid_delete_tables() { global $wpdb; $wpdb->query('DROP TABLE IF EXISTS ' . openid_identity_table()); $wpdb->query( $wpdb->prepare('DELETE FROM ' . $wpdb->postmeta . ' WHERE meta_key=%s', 'openid_comments') ); - + // old database changes... just to make sure $wpdb->query('DROP TABLE IF EXISTS ' . openid_table_prefix(true) . 'openid_nonces'); $wpdb->query('DROP TABLE IF EXISTS ' . openid_table_prefix(true) . 'openid_associations'); @@ -290,10 +290,10 @@ function openid_migrate_old_data() { // remove old nonce and associations tables $wpdb->query('DROP TABLE IF EXISTS ' . openid_table_prefix(true) . 'openid_nonces'); $wpdb->query('DROP TABLE IF EXISTS ' . openid_table_prefix(true) . 'openid_associations'); - + $openid_column = $wpdb->get_row('SHOW COLUMNS FROM ' . openid_table_prefix(true) . 'comments LIKE "openid"'); if ($openid_column) { - // update old style of marking openid comments. For performance reason, we + // update old style of marking openid comments. For performance reason, we // migrate them en masse rather than using set_comment_openid() $comments_table = openid_table_prefix(true) . 'comments'; $comment_data = $wpdb->get_results( $wpdb->prepare('SELECT comment_ID, comment_post_ID from ' . $comments_table . ' WHERE openid=%s OR comment_type=%s', 1, 'openid') ); @@ -319,22 +319,19 @@ function openid_migrate_old_data() { // remove old style of marking openid users - $usermeta_table = defined('CUSTOM_USER_META_TABLE') ? CUSTOM_USER_META_TABLE : openid_table_prefix() . 'usermeta'; + $usermeta_table = defined('CUSTOM_USER_META_TABLE') ? CUSTOM_USER_META_TABLE : openid_table_prefix() . 'usermeta'; $wpdb->query( $wpdb->prepare('DELETE FROM ' . $usermeta_table . ' WHERE meta_key=%s OR meta_key=%s', 'has_openid', 'registered_with_openid') ); } function openid_table_prefix($blog_specific = false) { global $wpdb; - if (isset($wpdb->base_prefix)) { + if (is_multisite() && isset($wpdb->base_prefix)) { return $wpdb->base_prefix . ($blog_specific ? $wpdb->blogid . '_' : ''); } else { return $wpdb->prefix; } } -function openid_identity_table() { - return (defined('CUSTOM_OPENID_IDENTITY_TABLE') ? CUSTOM_OPENID_IDENTITY_TABLE : openid_table_prefix() . 'openid_identities'); +function openid_identity_table() { + return (defined('CUSTOM_OPENID_IDENTITY_TABLE') ? CUSTOM_OPENID_IDENTITY_TABLE : openid_table_prefix() . 'openid_identities'); } - - -?>