[wp-hackers] Site login/register --> wp login/register

Brian Layman Brian at thecodecave.com
Sun Jul 22 00:16:42 GMT 2007

> I would like to arrange things so that there is just one
> registration/login for the whole site-i.e.

There are a number of ways that you can do this.  How you implement your
solution really depends upon how many different systems (blog, forum,
support system etc) you are implementing.  In any case, you probably want to
take a look at the wp-includes\pluggable.php file.

Overloading functions like wp_get_cookie_login(), get_cookie_username(),
auth_redirect() will get you a long way to your goal if you want WP to use
an existing cookie.  If you are feeding logins the other direction, you
might need to look at other functions like wp_login().  That might help feed
the information to the cookie the other system is using.

In any case, take a look at what they do and you can create a file that goes
into your plugin directory with replacement functions with the same name
doing things the way you want to do them.

BTW There is a good chance this line will confuse you:
      if ( ($already_md5 && md5($login->user_pass) == $password) ||
($login->user_login ==$username && $login->user_pass == md5($password)) ) {
         return true;

The "already_md5" doesn't apply to $login->user_pass.  It applies to
$password.  YMMV, but I had to twist that line to do what I needed to do.
BTW WPMU is missing the comment explaining this line.  :) Enjoy!

Brian Layman
b5media Inc.
www.b5Media.com / www.TheCodeCave.com

More information about the wp-hackers mailing list