NDE Designs


A Task I’ve set myself with WordPress


The Task is:

I want to login to WordPress at the same time as I login to my own custom built admin section (i.e. using the same login form). I want it to then display a page saying something along the lines of “Which CMS did you want to view? WordPress or Custom” (with links obviously – this will just be a redirect after login, so shouldn’t be hard to implement). I don’t mind so much about logging out, but might look into it if logging in becomes a success.

I looked for a solution to this problem about a year ago whenever it was I re-designed this portfolio site, but never found an answer. Then recently, at work I had to hook up a login script of VBulletin to a custom admin area (no simple task as I soon found out) which got me thinking about this again, and how to get round it.

I plan to start looking through WordPress’ code to see how they deal with the login whenever I get the time (either this week or next week), but thought I may as well post it on here to see if anyone who reads this blog knows of any solution.

The only thing I really need to find is the login function (or what I assume would be a function), so I can then include the correct files and call the function. I might go on to then look at how WordPress authenticates if the user is logged in or not, and possibly try to use that as my own authentication (as no doubt it’d be more secure that way – it would also mean I didn’t have to set my own session variables that are used to authenticate my own login).

A few problems I face:

  1. My site and my WordPress use different databases – they may need to be combined.
  2. Depending how WP is set up I may need to include a fair bit of unnecessary code.
  3. If WordPress updates then it might screw with where certain files are located and require me re-do the login script slightly (but that can be dealt with when it happens).

But other than that I don’t think it should be that hard to do (but we’ll see).

Anyone done this (or similar) before that could point me in the right direction?

Posts You Might Also Like

7 Responses to “A Task I’ve set myself with WordPress”

  1. Man, that is some harcore WordPress stuff (by my standards anyway lol).

    Good luck! I’m sure you’re the man to pull it off!!

    ReplyReply

     

  2. Yeah, I’ve been meaning to look at how wordpress works for a while now, just not got round to it.
    I’m sure it won’t be that hard to do, just take a bit to time figuring out what WP files I need to include.

    Thanks :)

    ReplyReply

     

  3. Hi nick, the best way to impliment this would probably be to write a wordpress plugin. Reason being that when you update wordpress ur custom code will not be overwritten. It will simple be deactivated, the update will occur, and then it will be reactivated. Like this you wont have to worry about making edits to wordpress every time you update it.

    Info here:
    http://codex.wordpress.org/Writing_a_Plugin

    ReplyReply

     

  4. @Frank: Cheers Frank :)

    I don’t think it will need to come to having to write a plugin for it. It should just need me to include a few files from wordpress and call the login function at the same point as I do my own login – thats how I managed it with VBulletin.

    Only way that would break is if WordPress change the login function’s location or name in an update (which is unlikely).

    ReplyReply

     

  5. Here’s the fuction ur looking for I think.

    http://codex.wordpress.org/Function_Reference/wp_signon

    ReplyReply

     

  6. @Frank: Awesome, thanks :)

    Going to have to read about using it a bit :)

    ReplyReply

     

  7. This site is really a stroll-by means of for all of the information you needed about this and didn’t know who to ask. Glimpse here, and also you’ll definitely discover it.

    ReplyReply

     

Leave a Reply

Comment Live Preview:

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WP Hashcash

Nick Edwards

Web Developer


Web Designer



My Twitter

This time next week, I'll be in Dubai en route to Aus! Can't wait!


My Web Presence

My Facebook ProfileMy Linkedin Profile

My Myspace ProfileMy Twitter Profile

Subscribe to my blog feed