Author:
|
Topic: main page | ||||
tmacdonaldLast Visit: 08/03/10 ![]() Moderator Dev Joined: 04/17/06 Forum Posts: 207 |
How do you stop it from going to the profile page after logging in. I would like it to go to the main page.
Tim Get'er Done |
||||
| Logged |
| ||||
Woo HooLast Visit: 09/09/10 Administrator Dev Joined: 05/26/06 Forum Posts: 2237 |
Well...
You would have to take a look at user.pl. The login goes through the login2 sub and it ends with a call to the welcome sub like this: code: Now the welcome subs looks for the $returnpage variable set-up in the login2 sub. This should resemble the page you are viewing when you log in. If not you go on through the rest of the welcome sub until you hit the end. Which is a call to the myprofile sub. code: Now instead of going to the profile view what if you replace that call to myprofile sub at the end of the welcome sub with this: code: That should just load up the home page... I think. 0 but true |
||||
| Logged |
| ||||
tmacdonaldLast Visit: 08/03/10 ![]() Moderator Dev Joined: 04/17/06 Forum Posts: 207 |
Thanks
Tim Get'er Done |
||||
| Logged |
| ||||
tmacdonaldLast Visit: 08/03/10 ![]() Moderator Dev Joined: 04/17/06 Forum Posts: 207 |
sub welcome {
############# #loadcookie(); loaduser("hello", "$username"); #loaduser("hello", "$username", "$usersid", "$usermac"); myprofile("$username"); print_main(); } If I take out the myprofile("$username"); line then you cannot log in, it just refreshes the screen? Tim Get'er Done |
||||
| Logged |
| ||||
tmacdonaldLast Visit: 08/03/10 ![]() Moderator Dev Joined: 04/17/06 Forum Posts: 207 |
It does log the visitor in but does not bring them to the home page with the menus on the side. How do I call the home page with the menus?
Tim Get'er Done |
||||
| Logged |
| ||||
Woo HooLast Visit: 09/09/10 Administrator Dev Joined: 05/26/06 Forum Posts: 2237 |
Hmm...
I'm not sure what you mean by not being able to logging in when you remove the myprofile sub. The myprofile sub has little to nothing to do with logging in from what I can tell. It loads "after" a log in. The print_main sub loads the home page. Look at the top of the welcome sub code: If $returnpage exists then you are directed to it. If you logged in while viewing the forum, for example, you would return to the forum after logging in. The code would not go any further (exit;) and not even see the myprofile sub. Maybe use a redirect at the end of the welcome sub or there's an unused sub (from what I can tell) in user.pl called "login" of all things. It looks like this: code: Maybe use that instead of myprofile (or print_main). or... maybe it's the way this code works anymore. It's not a "coder" type of script anymore. It would appear that everything may be too dependent on each other to work and any slight change would upset the script. I try to write more modular code that allows for quick little changes on the fly. That's why I stick with my old crap which runs under strict and using taint. 0 but true |
||||
| Logged |
| ||||
tmacdonaldLast Visit: 08/03/10 ![]() Moderator Dev Joined: 04/17/06 Forum Posts: 207 |
I replaced myprofile("$username"); with
print "Location: $scripturl/$cgi?action=$returnpage\n\n"; It return you to the main page with the menus Tim Get'er Done |
||||
| Logged |
| ||||
Woo HooLast Visit: 09/09/10 Administrator Dev Joined: 05/26/06 Forum Posts: 2237 |
You could probably leave off the "?action=$returnpage" because if you got that far in the subroutine then $returnpage didn't exist and you are being sent to the home page because of the empty action by default. 0 but true |
||||
| Logged |
|
| Pages: [1] | ||