core =& $core; $this->logic =& $core->logic; } /** * Provide more useful OpenID error message to the user. * * @filter: login_errors **/ function login_form_hide_username_password_errors($r) { if( $_POST['openid_url'] or $_GET['action'] == 'loginopenid' or $_GET['action'] == 'commentopenid' ) return $this->logic->error; return $r; } /** * Add OpenID input field to wp-login.php * * @action: login_form **/ function login_form() { ?>

For faster registration, just login with OpenID!

]* class=[^>]+>/', $html)) { return preg_replace( '/(]* class=[\'"]?)/', '\\1openid_link ' , $html ); } else { return preg_replace( '/(]*)/', '\\1 class="openid_link"' , $html ); } } return $html; } /** * Enqueue required javascript libraries. * * @action: init **/ function js_setup() { wp_enqueue_script( 'jquery' ); wp_enqueue_script('jquery.textnode', $this->core->path . '/files/jquery.textnode.js', array('jquery'), WPOPENID_PLUGIN_REVISION); wp_enqueue_script('jquery.xpath', $this->core->path . '/files/jquery.xpath.js', array('jquery'), WPOPENID_PLUGIN_REVISION); wp_enqueue_script('openid', $this->core->path . '/files/openid.js', array('jquery','jquery.textnode'), WPOPENID_PLUGIN_REVISION); } /** * Include internal stylesheet. * * @action: wp_head, login_head **/ function style() { $css_path = $this->core->fullpath . '/files/openid.css?ver='.WPOPENID_PLUGIN_REVISION; echo ' '; } /** * Print jQuery call for slylizing profile link. * * @action: comment_form **/ function comment_profilelink() { if (is_user_openid()) { echo ''; } } /** * Print jQuery call to modify comment form. * * @action: comment_form **/ function comment_form() { global $user_ID; if (!$user_ID) { echo ''; } } /** * Spam up the admin interface with warnings. **/ function admin_notices_plugin_problem_warning() { ?>

The WordPress OpenID plugin is not active. Check OpenID Options for a full diagnositic report.

logic->enabled ) { $hookname = add_submenu_page('profile.php', 'Your Identity URLs', 'Your Identity URLs', 'read', $this->profile_page_name, array($this, 'profile_panel') ); add_action("admin_head-$hookname", array( $this, 'style' )); add_action("load-$hookname", array( $this->logic, 'openid_profile_management' )); } } /* * Display and handle updates from the Admin screen options page. * * @options_page */ function options_page() { $this->logic->late_bind(); $this->core->log->debug("WPOpenID Plugin: " . ($this->logic->enabled? 'Enabled':'Disabled' ) . ' (start of WordPress options page)' ); // if we're posted back an update, let's set the values here if ( isset($_POST['info_update']) ) { check_admin_referer('wp-openid-info_update'); $error = ''; update_option( 'oid_enable_commentform', isset($_POST['enable_commentform']) ? true : false ); update_option( 'oid_enable_approval', isset($_POST['enable_approval']) ? true : false ); if ($error !== '') { echo '

At least one of OpenID options was NOT updated'.$error.'

'; } else { echo '

Open ID options updated

'; } } $this->printSystemStatus(); // Display the options page form $siteurl = get_option('home'); if( substr( $siteurl, -1, 1 ) !== '/' ) $siteurl .= '/'; ?>

WP-OpenID Registration Options

Behavior
Automatic Approval:

/>

For now this option will cause comments made with OpenIDs to be automatically approved. Since most spammers haven't started using OpenID yet, this is probably pretty safe. More importantly however, this could be a foundation on which to build more advanced automatic approval such as whitelists or a third-party trust service.

Look & Feel
Comment Form:

/>

This will work for most themes derived from Kubrick or Sandbox. Template authors can tweak the comment form as described in the readme.


logic->late_bind(); if( 'success' == $this->logic->action ) { echo '

Success: '.$this->logic->error.'

'; } elseif( $this->logic->error ) { echo '

Error: '.$this->logic->error.'

'; } ?>

Your Identity URLs

The following Identity URLs ? are tied to this user account. You can login with equivalent permissions using any of the following identities.

logic->store->get_my_identities(); if( count($urls) ) : ?>

There are identities associated with this WordPress user.

$v ): ?>
ID Identity Url Action
Delete
There are no OpenIDs associated with this WordPress user.

'; endif; ?>

Add identity:

core->setStatus( 'Include Path', 'info', implode('
', $list_of_paths ) ); global $wp_version; $this->core->setStatus( 'WordPress version', 'info', $wp_version ); $this->core->setStatus( 'MySQL version', 'info', function_exists('mysql_get_client_info') ? mysql_get_client_info() : 'Mysql client information not available. Very strange, as WordPress requires MySQL.' ); $this->core->setStatus( 'PHP version', 'info', phpversion() ); $this->core->setStatus( 'PHP memory limit', 'info', ini_get('memory_limit') ); $curl_message = ''; if( function_exists('curl_version') ) { $curl_version = curl_version(); if(isset($curl_version['version'])) $curl_message .= 'Version ' . $curl_version['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'] . '. '; if(isset($curl_version['protocols'])) $curl_message .= 'Supports: ' . implode(', ',$curl_version['protocols']) . '. '; } $this->core->setStatus( 'Curl ' . $curl_message, function_exists('curl_version'), function_exists('curl_version') ? $curl_message : 'This PHP installation does not have support for libcurl. Some functionality, such as fetching https:// URLs, will be missing and performance will slightly impared. See php.net/manual/en/ref.curl.php about enabling libcurl support for PHP.'); /* Check for Long Integer math library */ $this->core->setStatus( 'library: GMP compiled into in PHP', ( extension_loaded('gmp') and @gmp_init(1) ), 'GMP does not appear to be built into PHP. This is highly recommended for performance reasons.' ); $this->core->setStatus( 'library: BCMath compiled into in PHP', ( extension_loaded('bcmath') and @bcadd(1,1)==2 ), 'BCMath does not appear to be built into PHP. GMP is preferred.' ); if( defined( 'Auth_OpenID_NO_MATH_SUPPORT' ) ) { $this->core->setStatus( 'Loaded long integer library', false, 'The OpenID Library is operating Dumb Mode, since it doesn\'t have a big integer library. Recommend installing GMP support.' ); } if( defined( 'Auth_OpenID_RAND_SOURCE' ) ) { $this->core->setStatus( 'Cryptographic Randomness Source', (Auth_OpenID_RAND_SOURCE===null) ? false: 'info' , (Auth_OpenID_RAND_SOURCE===null) ? '/dev/urandom unavailable, using an insecure random number generator. open_basedir is "' . ini_get('open_basedir') . '"' : Auth_OpenID_RAND_SOURCE ); } $this->core->setStatus( 'Plugin Revision', 'info', WPOPENID_PLUGIN_REVISION); $this->core->setStatus( 'Plugin Database Revision', 'info', 'Plugin database is currently at revision ' . get_option('oid_db_revision') . '.' ); $this->core->setStatus( 'Overall Plugin Status', ($this->logic->enabled), 'There are problems above that must be dealt with before the plugin can be used.' ); if( $this->logic->enabled ) { // Display status information ?>

Status information: All Systems Nominal (Toggle More/Less)

Plugin is currently disabled. Fix the problem, then Deactivate/Reactivate the plugin.

core->status as $k=>$v ) { if( $v['state'] === false ) { echo "
[FAIL] $k
"; } elseif( $v['state'] === true ) { echo "
[OK] $k
"; } else { echo "
[INFO] $k
"; } if( $v['state']!==true and $v['message'] ) echo '
' . $v['message'] . '
'; } ?>