0

On my website WordPress is located in http://www.mywebsite/blog and is simply another section of the website.

I would like to integrate my own authentication system, which uses php sessions, into WordPress so that a user that registers and logs in my website has access to every sections, without having to register/login a second time when they enter the WordPress section.

In other words I am looking to completly get rid off WordPress's login and register pages, and make it so my regular users conserve their account when they go to the WordPress section and have the same privileges/functionnalities as if they were authentified into WordPress itself. As I would not be using WordPress's wp_users database.

As of now, on my website, I simply start the session, and check the user's privileges before calling functions to grant them permissions/functionnalities access.

I'm currently at step 0 of this project as I found very little useful informations on the topic (related questions like here, here, and here haven't helped me much and are 2/3+ years old). I tried http://wordpress.stackexchange.com but haven't found answers.

Has anyone ever done that ? How can I achieve this (if it is possible) ?

Any suggestions/thoughts on this would be really helpful to me. Thanks

Community
  • 1
  • 1
apatik
  • 383
  • 4
  • 17
  • 1
    [here](http://www.daggerhart.com/how-to-disable-the-wordpress-login-form/) is a way to stop login form from displaying. You may use something like that to fit your needs ? – Random May 04 '16 at 15:46
  • thanks for your link, indeed that will be useful to remove login/register forms, but the big part is still to replace WP's user system by php sessions – apatik May 04 '16 at 16:27
  • 1
    This is nothing but a form. You may add a script that fills user/password into the form and submit it right after displaying it... The only thing you have to do is find out what data are sent on form submit... – Random May 04 '16 at 16:30
  • So when a user registers in my website it registers him in WP's database at the same time, and similar with a login form ? – apatik May 04 '16 at 17:12
  • Or maybe you meant using my won user table instead of WP's one and log on both WP/rest of the website when the users enters his informations ? That seems possible, however I would have to delete/replace/modify some of the columns, I don't know if there is any WP plugin that allow to add/remove user fields properly so it doesn't break anything. – apatik May 04 '16 at 17:21
  • I don't know if it fits what you want, but what I mean is to make a single admin user in WP db, and when someone is logged in (thanks to your own login system), and then go to /wp-admin, you automatically submit the form with the only user known by wordpress... – Random May 04 '16 at 17:26
  • Then, it depends your need. If you need people to write posts etc.. and use their username inside wp-admin, that's something else – Random May 04 '16 at 17:27
  • Yes I actually had something similar in thought, but it seems hard to implement since I don't know how WP would react if several users simultaneously log into one single-shared account, plus users can post comments :/ I will keep that in mind tho. thanks – apatik May 04 '16 at 17:33
  • So I think the best practice for you is to insert data in wp_users inside your own log-in system. After that, when a use logs in (via your system), there may be a way to force WP to simultaneously log-in this user with the same data... – Random May 04 '16 at 17:54

0 Answers0