vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   vBulletin Login Page on Site? (https://vborg.vbsupport.ru/showthread.php?t=249563)

Force011 08-29-2010 09:53 PM

vBulletin Login Page on Site?
 
Heres what I am trying to do, I have a site and a forum. I put a login page on the site for the forum. However when I login, I get sent to the forum page and it says login successful, then afterwards I get sent back to same login page on my site. Instead of it being sent to the login page on my site, I want the login page to display Welcome $username, and give them links to update their profile, change password, etc.

I am using the login code here - http://www.vbulletin.com/forum/showt...ng-In&p=720724, later in the thread a user describes a similar problem.

kh99 08-29-2010 11:01 PM

Just to make sure I follow - you want it to go to the forum home page after logging in, just like you had logged in normally?

I'm not sure, but try this: it looks like if you're coming from somewhere "unusual" then it uses $_REQUEST['url'] as the place to redirect, so on the form submission url (which I guess ends in login.php?do=login now), try adding "&url=" and then the url you want it to go to.

Force011 08-31-2010 03:31 PM

Heres an example on my site below.

Code:

http://www.limitedition.org
On the side it has a login, I can login fine it takes me to vBulletin and says thanks for logging in, problem is it redirects to the main page and still asks me to login again, instead of it asking me to login it should say Welcome $username (or this case my username).

kh99 09-01-2010 12:39 AM

Well, I'm not doing too well lately - not only did I misundertsand what you wanted but I obviously didn't fully understand the code. But I did try putting this html file on my local machine:

Code:

<html><body>
<form action="http://*************/forum/login.php" method="post" onSubmit="md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)">
                      <p class="content">
                        <script type="text/javascript" src="http://losttv-forum.com/forum/clientscript/vbulletin_md5.js"></script>
                        Username: <br><input type="text" class="content" name="vb_login_username" id="navbar_username" size="30" accesskey="u" tabindex="1" value="Username" onFocus="if (this.value == 'Username') this.value = '';" /><br>
                        Password: <br><input type="password" class="content" name="vb_login_password" size="30" accesskey="p" tabindex="2" /><br>
                        <input type="checkbox" name="cookieuser" value="1" tabindex="3" id="cb_cookieuser_navbar" accesskey="c" checked="checked" />Remember Me</label><br />
                        <input type="submit" class="button" value="Login" tabindex="4" title="" accesskey="s" />
                        <input type="hidden" name="s" value="" />
                        <input type="hidden" name="do" value="login" />
                        <input type="hidden" name="forceredirect" value="1" />
                        <input type="hidden" name="vb_login_md5password" />
                        <input type="hidden" name="vb_login_md5password_utf" />
                        <input type="hidden" name="url" value="http://*************/forum" />
                      </form>
</body></html>

It's just your login form with a couple changes (and I replace my site iwth *'s). When I copied your code it logged me in but sent me back to the above login page. So I added the "url" hidden field with my site's home page and then it sent me there with the "Welcome $username" message. I have no idea if this will help you at all - maybe it's just saying that it worked for me but it still doesn't work for you.

Anyone else?

Force011 09-01-2010 01:55 AM

Heres a copy of that form in its full.

Code:

<form action="forums/login.php" method="post" onSubmit="md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)">
                      <p class="content">
                        <script type="text/javascript" src="forums/clientscript/vbulletin_md5.js"></script>
                        Username: <br><input type="text" class="content" name="vb_login_username" id="navbar_username" size="30" accesskey="u" tabindex="1" value="Username" onFocus="if (this.value == 'Username') this.value = '';" /><br>
                        Password: <br><input type="password" class="content" name="vb_login_password" size="30" accesskey="p" tabindex="2" /><br>
                        <input type="checkbox" name="cookieuser" value="1" tabindex="3" id="cb_cookieuser_navbar" accesskey="c" checked="checked" />Remember Me</label><br />
                        <input type="submit" class="button" value="Login" tabindex="4" title="" accesskey="s" />
                        <input type="hidden" name="s" value="" />
                        <input type="hidden" name="do" value="login" />
                        <input type="hidden" name="forceredirect" value="1" />                       
                        <input type="hidden" name="vb_login_md5password" />
                        <input type="hidden" name="vb_login_md5password_utf" />
                        <br>
                        <a href="http://forums.limitedition.org/login.php?do=lostpw" class="link">Forgot your password?</a><br>
                      Not a registered member? <a href="http://forums.limitedition.org/register.php" class="link">Register Now</a>
                      </form>

The problem is, that even if it does login, if you go back to the main site, it still asks you to login, I am basically just trying to change that login form into Welcome $username after login, on the main page, and not just on the forums.

kh99 09-01-2010 05:16 AM

Oh, now I've got you - sorry I'm so slow. I guess what threw me is that I assumed your main page is a static HTML page so of course it's not going to change (but probably that's the whole point of your question).

Anyone else?

Force011 09-01-2010 12:26 PM

Quote:

Originally Posted by kh99 (Post 2092293)
Oh, now I've got you - sorry I'm so slow. I guess what threw me is that I assumed your main page is a static HTML page so of course it's not going to change (but probably that's the whole point of your question).

Anyone else?

Nah, I use a lot of PHP, but I just don't know how to make this work with my site.


All times are GMT. The time now is 12:58 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01263 seconds
  • Memory Usage 1,741KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete