Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Redirecting members after login and logout - Half way there, assistance required

  1. #1
    Join Date
    Jan 2007
    Posts
    403

    Default Redirecting members after login and logout - Half way there, assistance required

    Hi all.

    What I would like:
    That members click a a "login" button on the main menu, which drops down a login form for them to "sign in" to a generic "members area". Having signed in I would like them whisked directly there. The main menu link then changes to "logout". When that is pressed they are simply deposited back on the home page.

    What I have already accomplished:
    All of the above, except the redirect to a chosen page after login. The main nav button is a simple matter of surrounding the login button with {check_guest} and the logout button with {check_member} tags. The drop down form I animated with jQuery.

    How I redirected after logout:
    I managed to redirect back to the home page (rather than the "original" sign in form) by changing line 399 of "login.inc.php":

    Code:
     // Refresh the screen
                    if ($type == 'admin') {
                            header('Location:' . $config['baseurl'] . '/admin/');
    Changed to:
    Code:
    // Refresh the screen
                    if ($type == 'admin') {
                            header('Location:' . $config['baseurl'] . '/');
    The help I require:
    Could someone please indicate the core changes required to redirect to a specific page on successful sign in?

    Many thanks as always.

  2. #2
    Join Date
    Jan 2007
    Posts
    403

    Default Re: Redirecting members after login and logout - Half way there, assistance required

    One polite bump for this one, since it really is fundamental to my project. I am pretty confident that for someone who knows the login.inc.php well this isn't too hard. I could be entirely incorrect! If that's the case it would also help to have that pointed out, since if it's "impossible" I would be forced to think of something else...

    ...the trouble is I don't know what! Hence the bump and the extra please!

    Please!

  3. #3
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default Re: Redirecting members after login and logout - Half way there, assistance required

    What is the member area you want to send them to? If it is an addon, the addon should check to see if they are logged in and if not, show the login form. When they login, they would still be on the same page. You would point the login link to the addon and you wouldn't need any redirection. That's how my userpage addon is setup.

  4. #4
    Join Date
    Jan 2007
    Posts
    403

    Default Re: Redirecting members after login and logout - Half way there, assistance required

    Hi pb, thanks for the response. It's almost simpler than that! I simply intend to provide a "secret microsite" for members to login to. I have an array of marketing materials that aren't suitable for "public consumption" (but they're not super-secret) so I thought to provide access to them this way.

    I hope I'm not confusing you! My current site is "super simple". I am admin. There are no other agents. There is no membership system. However I want to provide access for local companies to see some extra marketing materials that I don't want the public to simply "stumble into". To to that I simply made one member, and I intend to give the same login details to every company. Something like "1234" - like I said - this stuff isn't super sensitive, but I didn't want the public reading about "sell through rates" etc.

    So I have a two column form which drops down when a small "login" button is clicked. One column lets them ask for the access codes, which I email to them in response. The other form lets them login (to OR's member system). At that point I could easily make a big red button show up (between {check_member} brackets) saying "click here for special information" - but why bother? It would be so much neater to just send them along to the "secret info home page". This could be an "OR" page, or it could be to a physical microsite on the same server, or even http://somewhereelse I guess Logout is easy via one new button of course, which redirects back to home page (I already cracked that bit!)

    I will go now and check out your member area addon - I had heard of it before, perhaps it will do the job?

    I am still confident that this is a simple (for someone who knows the code) change to login.inc, in the same way that I already changed the logout redirect. As usual, I might be wrong.

    Your help very much appreciated. You can see how fundamental it is to my project I suppose otherwise I will have to bring in another php login script and layer it on top of OR, but it seems a pity when OR already has a "user rights" system. Plus in the future maybe I will give each company separate logins and use OR like a user database, closer to the way it was intended.

    Thanks again.

  5. #5
    Join Date
    Jan 2007
    Posts
    403

    Default Re: Redirecting members after login and logout - Half way there, assistance required

    Hi guys, I'll have to investigate an additional script to power the login forms tomorrow morning. That seems a shame because I'll loose all the power of OR's membership system, and the ability to use the user manager one day if I need it too. Definitely no one can answer this please?

    Thanks.

  6. #6
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default Re: Redirecting members after login and logout - Half way there, assistance required

    Instead of using OR why not make a password protected folder on your server and give them the login details? This way the stuff is truly protected from anyone stumbling upon it.

  7. #7
    Join Date
    Jan 2007
    Posts
    403

    Default Re: Redirecting members after login and logout - Half way there, assistance required

    Hi pb, thanks for the suggestion. Even after all that explaining above I have still caused confusion I fear! The "materials" I refer too aren't so much files, as more an "area" of the site that contains information for agents rather than end users. A kind of microsite if you will, with the content simply between {check_member} tags. (Or at least the way "into" it in tags)

    OR already has (very nearly!) the prefect solution for this built in. All I need do is make one member and give all the agents the login details for that one member. Later on, if it proves popular, I might give each agent a separate login. This would really exploit the OR system and would be a user management system built right in.

    I just want them to login and go to the agents "section" of the site directly. Otherwise they will login and think - "oh...what happened then... why am I still the home page?"

    I hope you follow me. I am still convinced it's just one line change, the same as it was to alter the "logout" redirect. Instead of redirecting to the home page, I want to redirect to (say) "page_link_9" or an absolute url.

    All my problems solved with one change, that's why I am so eager to solve this little difficulty.

  8. #8
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default Re: Redirecting members after login and logout - Half way there, assistance required

    I didn't realize the content you want restricted was within OR.

    In login.inc.php change the header command on line 199 to redirect to where you want.

  9. #9
    Join Date
    Jan 2007
    Posts
    403

    Default Re: Redirecting members after login and logout - Half way there, assistance required

    DONE! One line! I knew it! Thanks so very much pb. I knew we'd get there in the end! haha. Hooray!

  10. #10
    Join Date
    Nov 2008
    Posts
    44

    Default Re: Redirecting members after login and logout - Half way there, assistance required

    Quote Originally Posted by zarathustra View Post
    DONE! One line! I knew it! Thanks so very much pb. I knew we'd get there in the end! haha. Hooray!
    happy that you could solve your problem finally, and not nice that we don't know how you got it solved? !!!

    success

Similar Threads

  1. UMP - Diagnosis assistance required
    By julianps in forum Language help, ideas, discussion & Releases (CLOSED)
    Replies: 7
    Last Post: 06-03-2008, 01:38 AM
  2. Delay in Login for Members
    By istos in forum Installation/Configuration Help (CLOSED)
    Replies: 5
    Last Post: 04-03-2007, 01:32 PM
  3. LOGIN / LOGOUT links?
    By cellularguy in forum General Help (CLOSED)
    Replies: 1
    Last Post: 06-15-2005, 09:34 PM
  4. Half the site works half doesnt
    By skeeve in forum HELP (CLOSED)
    Replies: 8
    Last Post: 02-18-2005, 04:36 PM
  5. no logout for members
    By marb in forum Feature Request (CLOSED)
    Replies: 1
    Last Post: 06-28-2003, 07:17 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •