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 '
- 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() {
); ?>
wp-config.php
:', 'openid')
+ . 'first remove the following line from your wp-config.php
:', 'openid')
. 'define("OPENID_DISALLOW_OWNER", 1);
' . 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'); ?>+ |
---|
- | + |
---|
+ |
'.__('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') . ' |
@@ -911,7 +911,7 @@ function openid_wpmu_options() {
$registration = get_site_option('registration');
if ( $registration == 'all' || $registration == 'user' ):
?>
-
---|
@@ -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 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 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 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 @@
+
+ '.__('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'); } - - -?> |