- Moderated by:
- Support
-
- rank:
-
Helper
- registered:
- November 2003
- Status:
- offline
- last visit:
- 07.02.06
- Posts:
- 104
Hi all
I am trying to set up my PN so that when you log in it takes you to a certain page. curently it takes me to your personal page. Any way to change that. or to remove that personal page all toghether.
thanx dave -
- rank:
-
Freshman
- registered:
- July 2003
- Status:
- offline
- last visit:
- 07.06.04
- Posts:
- 7
Yes yes, actually what I want is when someone enters a direct link that non-logged in user don't have access to, after they login, it redirects them to the page they were trying to get to, not to the user info page. -
- rank:
-
Professional
- registered:
- March 2003
- Status:
- offline
- last visit:
- 10.11.06
- Posts:
- 904
To change the destination of the redirect after a user logs in, modify the NS-User module, specifically, the "tools.php" file. You will see the very first function in that file is the redirect function, and you can modify the URL in that function to change the redirect address. I have done this with all my sites.
I don't have an answer handy for Ulic's question though. -
- rank:
-
Freshman
- registered:
- July 2003
- Status:
- offline
- last visit:
- 07.06.04
- Posts:
- 7
Okay, here is what I did to get it redirect from the source page (ie. like I sent someone a gallery link in an e-mail, but they have to login to view it). In my theme where I have my login (if you are using the login box, the concept is the same, but where you put it will be different), there is a hidden form value name 'URL', I simply set URL to equal this PHP code,
Code
$_SERVER['SCRIPT_NAME']."?".$_SERVER['QUERY_STRING']
So if my current URL is "http://myserver.com/index.php?test=snarf", then the form in the HTML will look like
Code
<input type="hidden" name="url" value="/index.php?test=snarf" />
So after they fill in the login info, hit login, get the "Logging you in, hang tight" message they are redirected to /index.php?test=snarf -
- rank:
-
Professional
- registered:
- December 1969
- Status:
- offline
- last visit:
- 10.01.08
- Posts:
- 1631
muttley
./modules/NS-User/tools.php around line 63 change
Quote
echo "\n";
to
Quote
echo "\n";
This should send you back to the home page after login.
At least I think thats what your after.
Doesnt seem to work for me, any one have any ideas? I want the user redirected to a specific module after login. Changing that file name does nothing. -
- rank:
-
Professional
- registered:
- December 1969
- Status:
- offline
- last visit:
- 10.01.08
- Posts:
- 1631
Sweet, got it to work. I just commented out line 260 in NS-User/user.php:
Code
function user_user_loginscreen()
{
include 'header.php';
OpenTable();
echo "<form action=\"user.php\" method=\"post\">\n"
."<font class=\"pn-title\">"._USERLOGIN."</font><br><br>\n"
."<table border=\"0\"><tr><td>\n"
."<font class=\"pn-normal\">"._NICKNAME.": </font></td><td><input type=\"text\" name=\"uname\" size=\"26\" maxlength=\"25\"></td></tr>\n"
."<tr><td><font class=\"pn-normal\">"._PASSWORD.": </font></td><td><input type=\"password\" name=\"pass\" size=\"21\" maxlength=\"20\"></td></tr>\n";
if (pnConfigGetVar('seclevel') != 'High') {
echo "<tr><td><font class=\"pn-normal\">"._REMEMBERME.": </font></td><td><input type=\"checkbox\" name=\"rememberme\"></td></tr>\n";
}
echo "</table>\n";
// ."<input type=\"hidden\" name=\"url\" value=\"".getenv("HTTP_REFERER")."\">\n";
user_submit('NS-User','login',_LOGIN);
echo "</form>\n";
CloseTable();
That way it just goes to the user.php file, instead of redirecting back to the page that refered it. Also had to add a ; at the end of the line before it.
I couldnt pick the module, but i got what I wanted.
