16
Mods & Plugins (Requests & Discussions) / [Pre-mod] Redirect back to url after login
« on: February 20, 2006, 05:28:39 PM »
*BETA*
Addon for http://www.4homepages.de/forum/index.php?topic=7062.0 ([MOD] Information if Guest follows direct link to an image/category)
Hey.
If a user view a picture they do not have access to and they tries to login, they get send back to /index.php
But this redirects them back to the image (at least I think it does)
Open login.php
Find:
And View a picture I don't have access to and tries to login from that page It redirects me to a blank /login.php page. (with no code at all) I'm going to put up a temp install, so you guys can see for your self.
Addon for http://www.4homepages.de/forum/index.php?topic=7062.0 ([MOD] Information if Guest follows direct link to an image/category)
Hey.
If a user view a picture they do not have access to and they tries to login, they get send back to /index.php
But this redirects them back to the image (at least I think it does)
Open login.php
Find:
Code: [Select]
$user_name = trim($HTTP_POST_VARS['user_name']);
$user_password = trim($HTTP_POST_VARS['user_password']);
$auto_login = (isset($HTTP_POST_VARS['auto_login']) && $HTTP_POST_VARS['auto_login'] == 1) ? 1 : 0;
if ($site_sess->login($user_name, $user_password, $auto_login)) {
if (!ereg("index.php", $url) && !ereg("login.php", $url) && !ereg("register.php", $url) && !ereg("member.php", $url)) {
header("Location: ".$site_sess->url($url, "&"));
}
else {
header("Location: ".$site_sess->url(ROOT_PATH."index.php", "&"));
}
}
else {
$error = $lang['invalid_login'];
Replace with:Code: [Select]
$user_name = trim($HTTP_POST_VARS['user_name']);
$user_password = trim($HTTP_POST_VARS['user_password']);
$auto_login = (isset($HTTP_POST_VARS['auto_login']) && $HTTP_POST_VARS['auto_login'] == 1) ? 1 : 0;
if ($site_sess->login($user_name, $user_password, $auto_login)) {
if (!ereg("index.php", $url) && !ereg("login.php", $url) && !ereg("register.php", $url) && !ereg("member.php", $url)) {
header("Location: ".$site_sess->url($url, "&"));
}
else {
header("Location: ".$site_sess->url($url, "&"));
}
}
else {
$error = $lang['invalid_login'];
but I have one problem with it. As soon I use this: http://www.4homepages.de/forum/index.php?topic=6729.msg57268#msg57268 ([Mod] Search Engine Friendly URLs aka Short URLs)And View a picture I don't have access to and tries to login from that page It redirects me to a blank /login.php page. (with no code at all) I'm going to put up a temp install, so you guys can see for your self.