Ticket #732 (new enhancement)

Opened 6 months ago

Last modified 1 month ago

WPMU support for WP-OpenID

Reported by: jdub Assigned to: wnorris
Priority: normal Component: openid
Severity: normal Keywords:
Cc:

Description

Here's a fairly polished first run at WPMU support for WP-OpenID. I've been doing this for blogs.gnome.org, although it has only been running on my test server so far. Once this bug is written, I'll be deploying it to blogs.gnome.org. :-)

core.php:

  • Local add/update/get functions that switch between the appropriate WPMU and WPSO functions (get_option vs. get_site_option) and handle semantic differences.
  • Don't late_bind() in core.php.
  • Use local add/update/get functions.
  • Switch add_option to get_option at end of startup(), to avoid overwriting settings in the database (particularly with WPMU).
  • Handle WPMU plugin paths in set_path().
  • Log to blogs.dir in WPMU, upload_path in WPSO.

interface.php:

  • When running in WPMU, only allow admin to access options page (and shift it under 'Site Admin').
  • Use local add/update/get functions.

logic.php:

  • Use local add/update/get functions.
  • Failover to dynamically create comments/openid field in set_comment_openid().
  • late_bind() in comments_awaiting_moderation().

store.php:

  • comments should be $wpdb->prefix (local), usermeta should be $this->table_prefix (global). Switch these around.
  • New function, create_comment_field() to separately and dynamically add openid field to comments table.

Attachments

wp-openid-wpmu.diff (12.3 kB) - added by jdub on 01/10/08 06:50:53.
Updated to fix some mildly annoying bugs

Change History

01/10/08 05:36:52 changed by jdub

Some notes:

  • Amusingly, this depends on WPMU bug #540 due to the use of 'files' as a directory in the plugin. :-)
  • uptodate() and late_bind() are a bit query hoggish, and have too much love for each other. I've dodged most of the late_bind() bullet by not calling it in startup() (which saves some queries on pages that do not require OpenID functionality), but these could probably do with some attention.
  • I didn't look too hard at the usermeta side of the table rebuild feature. It might need a bit of love.

01/10/08 06:50:53 changed by jdub

  • attachment wp-openid-wpmu.diff added.

Updated to fix some mildly annoying bugs

01/10/08 07:01:11 changed by jdub

To test:

  • cd wp-content/mu-plugins
  • Unpack the WP-OpenID 2.1.2 tarball.
  • patch -p0 < wp-openid-wpmu.diff
  • ln -s openid/core.php openid.php

You should immediately see OpenID fields on your login pages and comment forms. :-)

01/16/08 13:17:55 changed by jdub

Looks like this has some 'interesting' and difficult to track down authentication problems when used with WPSO, so I'm going to have to look carefully at that.

05/28/08 00:00:47 changed by RavanH

jdub, thanks for developing this.

testing on a clean 1.3.3 install, i see no openID field on comment forms, although the javascript and css is in the page source. only every login screen has that extra field.

any thoughts?

p.s. any outlook on a patch for later versions of openid and whether this might work on mu 1.5.1 ?