Redirect to 'Profile' page after log in/sign in
I want users to be redirected to their 'Profile' page instead of going to 'Home Page' after Log in/ Sign in. Where should I set this up?
-
-
·
LeonidS
- ·
Hello Scholar !
You may use this solution to redirect to Dashboard https://una.io/page/cmts-view?sys=bx_forum&id=4477&cmt_id=19513 . For the Profile page it's impossible without a code's changes because there is no known profile id before login.
-
·
LeonidS
-
- · Scholar
-
·
In reply to LeonidS
- ·
LeonidS which part of the code I need to change? is it the login function? if so, where can I find the code for this? and where to set the 'relocate' attribute?
-
-
·
LeonidS
-
·
In reply to Scholar
S
- ·
In member.php file, find this line:
header('Location: ' . BX_DOL_URL_ROOT);
replace it with:
header('Location: ' . BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=view-persons-profile&id=' . bx_get_logged_profile_id()));
-
·
LeonidS
-
- · Scholar
-
·
In reply to LeonidS
- ·
LeonidS thanks a lot for your help. I tried your code but it sounds that there is a problem with permalink() and unpermalink() functions on UNA.
The generated code gets a random wrong value of the id=
for example I was logged in with a profile id=2, after logging out and login again I was directed to profile id=5
I tried to use getLoggedId() instead of bx_get_logged_profile_id() but both generate wrong value for the id variable. -
-
·
LeonidS
-
·
In reply to Scholar
S
- ·
Sorry, but it needs to track what's wrong, both functions should return the correct current profile id.
-
·
LeonidS
-
- · Scholar
-
·
In reply to LeonidS
- ·
Sorry, but it needs to track what's wrong, both functions should return the correct current profile id.
both functions getLoggedId() and bx_get_logged_profile_id() work fine in other areas of the code. it sounds that the problem is with the permalink /unpermalink functions. Have you been able to reproduce this error?
- where do you want me to track this? the error and access log files have nothing. -
-
·
LeonidS
-
·
In reply to Scholar
S
- ·
Then try this variant:
header('Location: ' . BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=view-persons-profile', array('id' => bx_get_logged_profile_id())));
-
·
LeonidS