Topic: Auto Login
Is there a way that i can do something like login.php?username=Tyler&password=userspassword or something like that in a link to auto login someone?
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 discussion → Auto Login
Is there a way that i can do something like login.php?username=Tyler&password=userspassword or something like that in a link to auto login someone?
Take a look in the login page: there should be a checkbox to log you in every time you go to the forum ;-)
If you really must be able to provide the username and password via the URL, you can hack login.php to fetch the username and password from the PHP array $_REQUEST instead of $_POST.
If you really must be able to provide the username and password via the URL, you can hack login.php to fetch the username and password from the PHP array $_REQUEST instead of $_POST.
Will the login page still work as it does, and with the new way?
Yes.
Strange i cant get it to work, oh well.
Here's how. Open up login.php and locate:
if (isset($_POST['form_sent']) && $action == 'in')
{
$form_username = unescape(trim($_POST['req_username']));
$form_password = unescape(trim($_POST['req_password']));
and replace it with
if (isset($_REQUEST['form_sent']) && $action == 'in')
{
$form_username = unescape(trim($_REQUEST['req_username']));
$form_password = unescape(trim($_REQUEST['req_password']));
Then, to login, you access the script via:
login.php?form_sent=1&action=in&req_username=USERNAME&req_password=PASSWORD
Thanks.
but its wont be safe method know?
It will not be any less safe provided that people don't lose track of their "login URL".
Can someone tell me why this wont work now?
EDIT:I have taken unescape away and it works now.
Still any comments would be good.
I would assume unescape was a PunBB function in an earlier version which no longer exists?
Hello! I have a error whith this code.
when login
login.php?form_sent=1&action=in&req_username=MyUsername&req_password=MyPassword
I have
Fatal error: Call to undefined function: unescape() in /var/www/html/l/lesbizounours/forums/login.php on line 40
In login.php, I have
(ligne 38) if (isset($_REQUEST['form_sent']) && $action == 'in')
(ligne 39) {
(ligne 40) $form_username = unescape(trim($_REQUEST['req_username']));
(ligne 41) $form_password = unescape(trim($_REQUEST['req_password']));
Thank you in advance
Hello! I have a error whith this code.
when login
login.php?form_sent=1&action=in&req_username=MyUsername&req_password=MyPassword
I haveFatal error: Call to undefined function: unescape() in /var/www/html/l/lesbizounours/forums/login.php on line 40
In login.php, I have
(ligne 38) if (isset($_REQUEST['form_sent']) && $action == 'in') (ligne 39) { (ligne 40) $form_username = unescape(trim($_REQUEST['req_username'])); (ligne 41) $form_password = unescape(trim($_REQUEST['req_password']));
Thank you in advance
I have no idea what unescape() does, but try replacing it with $db->escape()
It works fine with "$db->escape()". Thanks!
PunBB Forums → PunBB 1.2 discussion → Auto Login
Powered by PunBB, supported by Informer Technologies, Inc.