I have my Wordpress site at xroads.com
Inside, there is a folder called "_warehouse" which contains a php CRUD app
Is it possible to require the same login page I use for the Wordpress site to view the _warehouse directory?
Thanks in advance!
I have my Wordpress site at xroads.com
Inside, there is a folder called "_warehouse" which contains a php CRUD app
Is it possible to require the same login page I use for the Wordpress site to view the _warehouse directory?
Thanks in advance!
If the user already has an account in WordPress:
Redirect the user to the login form. Use wp_login_url
with the $redirect
parameter to set where they go after logging in:
$loginUrl = wp_login_url( home_url('_warehouse') );
https://codex.wordpress.org/Function_Reference/wp_login_url
Then use the wp_login
action to manually authenticate the user in your application:
add_action('wp_login', function($username, $user) {
// Log user into external application
}, 10, 2);
https://codex.wordpress.org/Plugin_API/Action_Reference/wp_login
Actually setting the user as "logged in" is going to depend on how your external application is setup. It could be as simple as setting a session variable and then checking if that is set in your warehouse app.