Wordpress

From Organic Design wiki
Revision as of 21:20, 31 May 2013 by Nad (talk | contribs) (Using MediaWiki accounts on Wordpress: done)

Skinning

Resources

Using MediaWiki accounts on Wordpress

We need to have a wordpress site which is seamlessly connected to a MediaWiki so that users can register and login using the MediaWiki login and registration process only. The Wordpress login/logout links should direct users to the MediaWiki login/logout pages, and if the user is already logged in, then they should already be logged in as the same user on Wordpress.

From the Wordpress perspective this means an auto-login function needs to be created which takes over the login process. It first needs to check if the user is already logged in and if not, redirect the page to the MediaWiki login with the return-to set to the current Wordpress URL. If there is already a MediaWiki user logged in, then the Wordpress needs to automatically log the user in as this user, creating a new user first if necessary.

The MediaWiki check can be done using a local Ajax request which returns all the current user info (for local requests only).

This is done now, it consists of two scripts, Wordpress.php which is a small MediaWiki extension that provides an Ajax callback for getting user info for a passed user ID and token, and Wordpress-wp.php which goes in the Wordpress wp-config.php file and checks if any MediaWiki cookies exists and are valid and creates and/or logs in the equivalent Wordpress user if so.

See also