Like the idea.
I’ll check how easy that might be to add
Hi Ben,
Any word from the developers on adding URL parameter/tokenized login?
thanks,
John
I came up with a solution for now by modifying password-protected.php:
function maybe_show_login() {
// Don't show login if not enabled
if ( ! $this->is_active() )
return;
//>>>>>>>>>>>>> ADDED FOR AUTO LOGIN FROM URL ARGUMENT
if ((isset($_REQUEST["password"])) && ($_REQUEST["password"] == "MY_PASSWORD"))
{
$this->set_auth_cookie();
return;
}
//<<<<<<<<<<
Adam,
Many thanks.
I am pretty amateur with PHP …
Can you show me how you integrated this code? I just pasted this code at line 136 and am getting errors that I can’t re-declare the function.
Also, is this the URL structure?
http://domain.com/?password-protected=login&password=mypassword
If you find the function maybe_show_login() in password-protected.php you just need to paste the code between the >>>> and <<< markers where shown (after the return; above it). Change MY_PASSWORD to whatever you want to use. Then use ?password=MY_PASSWORD on the end of any URL to a page on your wordpress site and it will take you straight there, logging in to the Password Protected plugin for you automatically in if needed.
perfect. thanks again Adam.
Can someone point me to the editable php file? i cant find “password-protected.php” anywhere and even after looking at file structure lists i only see wp-pass.php but my install is missing that?
Also is there a plugin yet to make urls with passwords in them?
Adam1567, I tried your modification to password-protected.php but unfortunately I couldn’t make it work.
I pasted your code according the instructions but I am not sure if I placed it correctly.
Can you please copy the code starting at line 299 or from function maybe_show_login down to the next few lines of orginal code? If I can see the neighboring code surrounding your modification, that would really help.
Ummm, I forgot to change MY_PASSWORD to my password. Hope my goof helps someone!