No announcement yet.

Invoking the login page

  • Filter
  • Time
  • Show
Clear All
new posts

  • Invoking the login page

    I've seen a lot of different scripts that are similar, but don't do this exactly.

    In order to see a set of static pages on our site which are outside of our forums, I'd like to use a script that does the following -
    1. Someone goes from the Home Page to Page A.
    2. Page A needs the user to be logged in and invokes the actual page like
    3. The user logs in and gets redirected back to Page A.
    Thanks in advance.
    NxTek Solutions Inc
    Award-winning Hosting, Development, and Ecommerce Solutions

  • #2
    The redirection URL is defined in the STANDARD_ERROR template by the red code:

    		<if condition="$show['permission_error']">		
    			<script type="text/javascript" src="clientscript/vbulletin_md5.js"></script>
    			<form action="login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)">
    			<input type="hidden" name="do" value="login" />
    			<input type="hidden" name="forceredirect" value="1" />
    			<input type="hidden" name="url" value="[color=red]$scriptpath[/color]" />
    			<input type="hidden" name="vb_login_md5password" />
    			<input type="hidden" name="vb_login_md5password_utf" />
    			<input type="hidden" name="s" value="$session[sessionhash]" />
    			<!-- permission error message - user not logged in -->
    You can replace that with your own path / URL if you want.


    • #3
      That code goes at the top of "Page A"?

      I don't need any calls to global.php?
      NxTek Solutions Inc
      Award-winning Hosting, Development, and Ecommerce Solutions


      • #4
        This link:

        ...pulls up that template. No custom scripts required, just edit that template to change the redirection link of the login form on that page.


        • #5
          Right, but this would need to be on about 100 pages with different $scriptpath's.

          Can I use the same code on every page (include?) that is basically just a "make sure they're logged, if not, log them in" type if thing.
          NxTek Solutions Inc
          Award-winning Hosting, Development, and Ecommerce Solutions


          • #6
            All stop pages that display the login form use that template, so only one change is required, not hundreds.


            • #7
              This is very similiar to what I want to do I think... I want to redirect new users to a difrent log in page....

              I know this is very close to whats happing in this thread... can someone explain???



              • #8
                There is no single login page that you can link to. The login form can be generated by any stop message on any page to which the user does not have access. I am guessing this person has denied everyone access to the calendar so he can link to the calendar to generate the login form.


                • #9
                  Jake, I am talking about instead of non registered user getting directed to the vb message page he would get directed to something totally different...

                  Can this be done??


                  • #10
                    Yes. Change the value of the hidden URL field from my first post in this thread.


                    • #11
                      You mean the red highlighted url?? I did that.... nothing... am I missing something else????

                      I cannot understand why that did not work for me.....

                      Last edited by RichieBoy67; Thu 14 Apr '05, 11:10am.


                      • #12
                        Whatever URL you enter in place of $scriptpath will be the URL to which users are redirected after they login using that specific login form.


                        • #13
                          Oh I see.... That is not exactly what I am talking about... I am talking about unregistered users. When they try to post instead of getting re-directed to the error page I want them re-directed to another log in page that is on the main part of the site.....

                          Isn't there a fairly easy way to do this???

                          Thanks for your reply!!


                          • #14
                            I just replied to your PM about this. That is a different question than what the original poster of this thread was asking. That would require modifying the files themselves. For this reason I recommend you post on


                            • #15
                              Hi Jake,

                              Did you think I meant that I wanted to be able to specify an URL that *all* of the vB login forms redirected the users to?

                              If so, no, but wouldn't that interfere with, for example, the login form when the user goes to make a forum post. They won't be redirected back to the "New Post" form after logging in; they'd be redirected to your custom URL.

                              What I'm looking for is a way to *invoke* that login form from an external script, then have it redirect back to a specific URL after the user logs in. I still don't see any way to do that.
                              NxTek Solutions Inc
                              Award-winning Hosting, Development, and Ecommerce Solutions


                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.