| Author |
Message |
aseitz Regular


Joined: Mar 08, 2005 Posts: 57 Location: Portland, Oregon USA
|
Posted:
Tue Jun 27, 2006 11:01 am |
|
How do I redirect a user to the mainpage (index.html) instead of their account page on login?
-- EDIT --
Fixed, see final 3 posts for completion steps. |
Last edited by aseitz on Tue Jun 27, 2006 12:38 pm; edited 1 time in total |
|
|
 |
Guardian2003 Site Admin

Joined: Aug 28, 2003 Posts: 6299 Location: Vsetin, Czech Republic
|
Posted:
Tue Jun 27, 2006 11:34 am |
|
You mean, so you can prevent them from logging in? |
|
|
|
 |
aseitz Regular


Joined: Mar 08, 2005 Posts: 57 Location: Portland, Oregon USA
|
Posted:
Tue Jun 27, 2006 11:37 am |
|
| Guardian2003 wrote: | | You mean, so you can prevent them from logging in? |
Nono, I want them to log in.
I just don't want them to log in and the first thing they see is the "My Account" screen. I would much rather it just re-directed back to the main page, all logged in and stuff. |
|
|
|
 |
Guardian2003 Site Admin

Joined: Aug 28, 2003 Posts: 6299 Location: Vsetin, Czech Republic
|
Posted:
Tue Jun 27, 2006 11:54 am |
|
Well I know this has been covered before so searching the forums might help you.
I think this is in the function login(). It has something like | Code: | if (empty($redirect)) {
Header("Location: modules.php?name=Your_Account&op=userinfo&bypass=1&username=$username"); |
You could try changing that to something like | Code: |
if (empty($redirect)) {
Header("Location: index.php); |
In any event, you will need to alter the code in the user info block, the login block, the relevant forum files etc to be consistently redirecting users back to the home page. |
|
|
|
 |
gregexp The Mouse Is Extension Of Arm

Joined: Feb 21, 2006 Posts: 1497 Location: In front of a screen....HELP! lol
|
Posted:
Tue Jun 27, 2006 12:09 pm |
|
Find this line in index.php of the Your account module, under function login
| Code: | if (empty($redirect)) {
Header("Location: modules.php?name=Your_Account&op=userinfo&bypass=1&username=$username"); |
then make it:
| Code: | if (empty($redirect)) {
Header("Location: index.php"); |
Have not been able to test this so BACK IT UP FIRST. |
|
|
 |
 |
gregexp The Mouse Is Extension Of Arm

Joined: Feb 21, 2006 Posts: 1497 Location: In front of a screen....HELP! lol
|
Posted:
Tue Jun 27, 2006 12:15 pm |
|
sorry guardian...i had this screen open for a bit while i searched for the code.
didnt see that you were on and thought perhaps you had limited time as others do. |
|
|
 |
 |
aseitz Regular


Joined: Mar 08, 2005 Posts: 57 Location: Portland, Oregon USA
|
Posted:
Tue Jun 27, 2006 12:37 pm |
|
Thanks you two, it worked like a charm! |
|
|
|
 |
Guardian2003 Site Admin

Joined: Aug 28, 2003 Posts: 6299 Location: Vsetin, Czech Republic
|
Posted:
Wed Jun 28, 2006 12:18 am |
|
No problem, glad it worked as I didn't test it.
darklord - not a problem, better to have 2 answers the same than no reply at all  |
|
|
|
 |
CodyG Life Cycles Becoming CPU Cycles

Joined: Jan 02, 2003 Posts: 666 Location: Vancouver Island
|
Posted:
Fri Apr 10, 2009 4:22 pm |
|
Does this method still work for RN 2.3.1?
IOW, can I change line 210 in Your_Account/index.php
| Code: |
} elseif ($redirect == '') {
Header('Location: modules.php?name=Your_Account&op=userinfo&bypass=1&username=' . $username);
|
to this?
| Code: |
} elseif ($redirect == '') {
Header('Location: index.php);
|
I'm wondering if YA has been reworked in such a way to not allow this tweek. |
|
|
|
 |
misterpat Hangin' Around

Joined: Mar 02, 2009 Posts: 48
|
Posted:
Fri Apr 10, 2009 5:11 pm |
|
I have done it on my RN 2.3.1 and it works great. |
|
|
|
 |
|
|
|
|