password protect site until url variables passed? (4 posts)

  1. andymc82
    Posted 2 years ago #

    Hi, is it possible to do the following?

    1. the site is locked until a url with variables is passed to it.

    2. inside the url variables, it should have new userdata (so wordpress will register the user and the user will not need to login again).

    e.g URL to pass: http://www.myblog.com?username&pass&name&email&keyToAcessSite

    wordpress would then automatically input the data and show the site.

    really hope someone can help.

  2. bcworkz
    Posted 2 years ago #

    Yes! There's even different ways to go about this. One is to create a special page template that basically does all this and redirects to the actual content if the user is logged in. Add a page based on this template. Then use the Rewrite API to send all requests to this page.

  3. andymdesign
    Posted 2 years ago #

    thanks, great to know this is possible, can you supply any help on how to do this?
    Im ok at theme creation but i think i may need to help with this integration.

  4. bcworkz
    Posted 2 years ago #

    Just go ahead and dive in! Work in small attainable segments, ensuring each works properly before building on that. If you get stuck somewhere, someone here should be able to help you out.

    Perhaps start with a simple custom page template that just redirects to the home page. Then add a rewrite rule to your theme's functions.php (or .htaccess if you prefer) that sends any requests with username etc. parameters to a page based on this template.

    The next step is ensure the template can correctly get the URL parameters from $_GET. Then assemble a user data array from these values. The last step is to pass this array to wp_insert_user() and you should be in business.

Topic Closed

This topic has been closed to new replies.

About this Topic