•  · 12 friends

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?

0 0 0 0 0 0
  • 247
Replies (7)
  • 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.

    0 0 0 0 0 0
    • 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?

      0 0 0 0 0 0
      • 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()));

        0 0 0 0 0 0
        • 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.

          0 0 0 0 0 0
          • Sorry, but it needs to track what's wrong, both functions should return the correct current profile id.

            0 0 0 0 0 0
            • 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. 

              0 0 0 0 0 0
              • 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())));

                0 0 0 0 0 0
                Not logged in users can't 'Comments Post'.
                4
                4
                Added:
                Category:

                UNA - Social Media Software Framework

                Close