6 Replies Latest reply on Jan 31, 2009 2:00 PM by Günter Schenk

    Redirect to specific login page

      This may be a stupid question, but.......

      How would I do this? I have a site with a login system. There is a default login page. But I have one page that is for a different use (and has a restricted access behavior applied) and I would like when a user who is NOT logged in comes to that page to be redirected to a different login page than the default login page. Is that possible?

      Thank you for your help.
        • 1. Re: Redirect to specific login page
          Günter Schenk Level 4
          Hi James, <br /> <br />I fear this isn´t possible to do with ADDT, as it will - when using its Restrict Access To Page behaviour - always redirect to the page you specified in the Control Panel. <br /> <br />However you can help yourself with a simple custom PHP redirect script <i>(place it @ @ line 1 of your document)</i> which checks whether the "kt_login_id" Session Variable is set, and if it´s not set, redirect to a different login page: <br /> <br /><?php<br />if (!isset($_SESSION['kt_login_id'])) {<br />header('Location: http://www.example.com/directory/login.php') ;<br />}<br />?> <br /> <br />Hint: users who login via a different login page will still be redirected to ADDT´s default login page when logging out <br /> <br />Cheers, <br />Günter Schenk <br />Adobe Community Expert, Dreamweaver
          • 2. Re: Redirect to specific login page
            Level 1
            Hi Günter,

            I tried that but I kept going back to the default login pages. I did keep the very first line as my require_once the connections file (I'm running mysql) and then put in the line.

            Then I tried to put "session_start" before it thinking perhaps I needed that to come, but that didn't work either. And then I tried putting the line before absolutely everything and it didn't work. I changed the URL in the code line but nothing else.

            Did I do something wrong?

            Thanks again for your help.

            James
            • 3. Re: Redirect to specific login page
              Günter Schenk Level 4
              Hi James,

              -------
              I tried that but I kept going back to the default login pages
              -------

              did you possibly leave ADDT´s restrict access to page behaviour in place ? When implementing such a custom PHP redirection, ADDT´s behaviour will have to go away in order to avoid a conflict

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: Redirect to specific login page
                Level 1
                Oh, that must be what it is. I'll go try that right now.

                Is this method as secure as the ADDT restrict access?
                • 5. Re: Redirect to specific login page
                  Level 1
                  BRILLIANT!!! That works! Am I losing any effectiveness in the security going this way?

                  Thank you, thank you, Günter!!
                  • 6. Re: Redirect to specific login page
                    Günter Schenk Level 4
                    Hi James,

                    -------
                    Am I losing any effectiveness in the security going this way?
                    -------

                    No, because ADDT´s Restrict Access To Page behaviour *basically* also checks whether the Session Variable "kt_login_id" is set -- of course you get some additional features like checking the user´s login level, but on that particular page these extras don´t seem to be required anyway.

                    Cheers,
                    Günter Schenk
                    Adobe Community Expert, Dreamweaver