PDA

View Full Version : Integration with vBulletin - Simple login page/box/code for external pages


gusfune
25 Mar 2008, 00:00
Ever wondered how you could add your own login box or fully customized login page outside your VB forums?
Ever had problems with other solutions that require a lot of files, PHP coding that in the end need a lot of tweaks or can give you a big headache? :mad:

Well, the problem is now solved. :D
100% Reliable
100% Bug Free*
No Uneeded codes running
No PHP knowledge required


*if you use the code properly

By just using the same piece of code used in every Vbulletin pages I've managed to create login pages, boxes in any page I wanted outside my forums. Works 100% and by just following the instructions (2 simple steps) you'll be able to add and customize your login page wherever you want.

There is a screenshot of an example page built with this code that it's fully customized and logins to the forums on another domain. Just an example of what you can do.

The ZIP file contain the code instructions and 2 HTML pages with the code inside.
There are two versions of the code: With or Without "Remember me?" checkbox.

Hope it helps.
If you've found this useful, had problems with other methods of external login, etc, consider donating a small amount, I'd appreciate :)

gusfune
25 Mar 2008, 00:03
To-do list (what to expect in future releases):
Currently the login box when you log will redirect you to your main boards page, if you go back to where the login page, you'll see the login box again. I plan soon to upgrade the code and show a logged in stat.

Can you put a register button?
You can do it yourself by just adding the following line on the code wherever you want the register line to be:
<a href="pathtoyourforums/register.php">Not a member? Register now</a>

dilbert
25 Mar 2008, 00:49
Interesting.
My site is primarily cold fusion, with a vB forum.
Can i use this in a CF page?

gusfune
25 Mar 2008, 03:21
Interesting.
My site is primarily cold fusion, with a vB forum.
Can i use this in a CF page?
I don't have experience with cold fusion, but being this code only HTML tags, I don't think you'll have problems implemnenting it on your page.

NeuroLancer
25 Mar 2008, 04:59
Quite a bit different to the other mod like this, in that it doesnt need to connect to your site, it just posts the values. It's a bit easier to use in that sense, and as described this will work on a html page, doesnt have to be php.

Nice one. Works good.

jeddah_eyes
28 Mar 2008, 21:54
i faced a problem with it

after logging in the code return me to another addres end with /path

for example

www.dm3ty.net/path (http://www.dm3ty.net/path)

this addrese appears after logging in

note i change the path in the page as http://www.dm3ty.net/vb

TF-TM
29 Mar 2008, 17:03
Very Very Thanks

smooth-c
29 Mar 2008, 17:18
wow! thank you soo much!

smooth-c
30 Mar 2008, 16:43
I know you're probably working on other things aswell, but do you think you could ad the ability to display a persons username? so like - say they log in - once they do - it says their username at the top with thier avatar next to it? That'd be absolutely awesome!

gusfune
30 Mar 2008, 20:08
i faced a problem with it

after logging in the code return me to another addres end with /path

for example

www.dm3ty.net/path (http://www.dm3ty.net/path)

this addrese appears after logging in

note i change the path in the page as http://www.dm3ty.net/vb

You probably haven't changed all the needed places to make it work on your webpage, make sure (being the code directly on the .net page, in your case, it is dm3ty.net) the code is (using the 'remember me' checkbox code):

*the places to modify the code are highlighted

<form action="vb/login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
<input type="hidden" name="do" value="login" />
<input type="hidden" name="url" value="/vb" />
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
<input type="hidden" name="s" value="$session[sessionhash]" />
<label>Username:<input name="vb_login_username" type="text" id="login" tabindex="1" class="bginput" accesskey="u"/></label>
<label>Password:<input name="vb_login_password" type="password" id="password" tabindex="1" class="bginput" /></label>
<label>Remember me?<input type="checkbox" name="cookieuser" value="1" id="cb_cookieuser" tabindex="1" /></label>
<input name="submit" type="submit" id="submit" tabindex="1" value="Login" accesskey="s" class="button" />
</form>

I know you're probably working on other things aswell, but do you think you could ad the ability to display a persons username? so like - say they log in - once they do - it says their username at the top with thier avatar next to it? That'd be absolutely awesome!
This would require php coding, and the objective of this addon is avoid at any costs using php. I could work on a bigger release of this code (with simple php calls), but this isn't something I'm planning to do too soon.

Triky
04 Apr 2008, 12:38
Now I will try it. :)

Triky
04 Apr 2008, 12:46
Yup, I would like to have the same of smooth-c has requested. This becouse I can use this one in order to login an user on my forum.. but I want to make a login form and then a 'welcome box' in order to redirect my user to the same page, where they can see his welcome message (with avatar, if possible)..

LT Mote
21 May 2008, 08:10
Can this be used for an external domain as well? such as subdomain or domain1.com and domain2.com If so could u paste the appropriate code for me :)


Thanks in advance.

sdavis2702
29 May 2008, 02:11
Awesome hack... thanks!

I added the highlighted portion so that the site would open up in a new window :)

<form action="http://MySite'sURL/login.php?do=login" target="_new" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">


Thanks!!!

wicked80
29 May 2008, 03:22
Awesome...this was exactly what i was looking for since last couple of days for my wordpress homepage. Thanks a zillion !!!

ti07shadow
31 May 2008, 06:18
Now see this is a great mod, But I dont like external scripts for 1 reason, I tell my mmebers never to use one of these that directs to my forum for the fatal cause that someone probably implemented a logging code to get their login, thats one reason why I dont use these and tell my members only to loging directly on the forums. Otherwise this is a good code.

oz_girl
01 Jun 2008, 00:47
Awesome mod

cmedic101
14 Aug 2008, 04:28
Great mod:) Good instructions and it works well with 3.7x

thank you


cmedic101

Thronx
16 Aug 2008, 18:36
Many thanks indeed!

I see something interesting here. The code has referrences to a php variable and the javascript function mhash() in the onsubmit, which aren't in the html page (or included). Yet it still works. In fact, I removed all references to the function and php variable, and it *still* works! Perhaps the vBulletin login.php page sees missing values and generates them at that point.

This is the html code, amazingly:

<form action="path-to-your-forum/forums/login.php?do=login" method="post">
<input type="hidden" name="do" value="login" />
<input type="hidden" name="url" value="path-back-to-your-original-page" />
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
<input type="hidden" name="s" value="" />
<input type="hidden" name="cookieuser" value="1" id="cb_cookieuser" tabindex="1" />
<label>Username:<input name="vb_login_username" type="text" id="login" tabindex="1" class="bginput" accesskey="u"/></label>
<label>Password<input name="vb_login_password" type="password" id="password" tabindex="1" class="bginput" /></label>
<input name="submit" type="submit" id="submit" tabindex="1" value="Login" accesskey="s" class="button" />
</form>

! Cheers, Jeffrey:D

gusfune
11 Sep 2008, 02:03
Can this be used for an external domain as well? such as subdomain or domain1.com and domain2.com If so could u paste the appropriate code for me
Works on any domain, just follow the instructions

Many thanks indeed!

I see something interesting here. The code has referrences to a php variable and the javascript function mhash() in the onsubmit, which aren't in the html page (or included). Yet it still works. In fact, I removed all references to the function and php variable, and it *still* works! Perhaps the vBulletin login.php page sees missing values and generates them at that point.

Thanks! I'll be releasing an update soon with improvements on the code, update to the latest Vbulletin version (just going to do a few checks) and releasing a update that will make possible for users to show a "logged in" box in external pages. Coming soon.

Darked_Hax
14 Sep 2008, 08:29
syntax error...

:S

Gursimran
21 Sep 2008, 13:08
What do you think about adding a feature in which logged in user see Welcome $username in the place of the form again?

tunistunis
21 Sep 2008, 14:16
<form action="path-to-your-forum/forums/login.php?do=login" method="post">
<input type="hidden" name="do" value="login" />
<input type="hidden" name="url" value="path-back-to-your-original-page" />
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
<input type="hidden" name="s" value="" />
<input type="hidden" name="cookieuser" value="1" id="cb_cookieuser" tabindex="1" />
<label>Username:<input name="vb_login_username" type="text" id="login" tabindex="1" class="bginput" accesskey="u"/></label>
<label>Password<input name="vb_login_password" type="password" id="password" tabindex="1" class="bginput" /></label>
<input name="submit" type="submit" id="submit" tabindex="1" value="Login" accesskey="s" class="button" />
</form>

hydn
05 Feb 2009, 08:15
In IE 6 and 7 (70% of traffic) we get a pager error after clicking to login.

Users are logged in correctly and there are no issues as far as "function" however there is a page error on Internet Explorer browsers:

ROW: 274
LINE: 2
Error: 'Null' is null or not an object
Code: 0
Page: login.php?do=login

Here is the code used:
<form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
<input type="hidden" name="do" value="login" />
<input type="hidden" name="url" value="/index.php" />
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
<input type="hidden" name="s" value="$session[sessionhash]" />
<label>Username:<input name="vb_login_username" type="text" id="login" tabindex="1" class="bginput" accesskey="u"/></label>
<label>Password:<input name="vb_login_password" type="password" id="password" tabindex="1" class="bginput" /></label>
<label>Remember me?<input type="checkbox" name="cookieuser" value="1" id="cb_cookieuser" tabindex="1" /></label>
<input name="submit" type="submit" id="submit" tabindex="1" value="Login" accesskey="s" class="button" />
</form>

I'm on vb 3.7.4. How can this be fixed?

Thanks

metalguy639
15 Feb 2009, 06:46
Is there a way to limit the size of the login boxes? I need them smaller? Thanks.

UKBusinessLive
19 Mar 2009, 20:46
Excellent Job, Works fine for me

See my Demo:http://www.ukbusinesslive.co.uk/

to the right half way down, I added a picture and enclosed it withing a frame, looks well smart.

https://www.vbulletin.org/forum/external/2009/05/7.png

Thanks for this

:D

Shaven_LTS
29 Apr 2009, 09:57
is there anyway you can set it up so that when I go to the page i want my members to go to it will ask me to login and Ill have to... what i am getting at is once the login script sends them off to the page i want them to see I dont want them to be able to just copy the address in the address bar and pass it own to buddies and them not have to login... since the page i am directing them to is a paid member only page.

email me shvnem@yahoo.com if anyone has any idea on how to help me

yaworski
29 May 2009, 10:37
Add this before or inside the <form> tag or in the <head> tag

<script type="text/javascript" src="vbpath/clientscript/vbulletin_md5.js?v=373"></script>

to load md5hash javascript function referenced by onsubmit attribute. With this passwords are sent in the form of md5 hash like in built-in login form.

You also need to set proper vb version in the url (v=373 is for vb 3.7.3).

profanitytalker
14 Jun 2009, 02:58
reserved

ahmer
10 Jul 2009, 03:03
this is gr8 thanks

fake83
02 Aug 2010, 09:34
how to show the username if the person is already logged in? Thank you, Great mod!

yotsume
28 Jan 2011, 16:18
To-do list (what to expect in future releases):
Currently the login box when you log will redirect you to your main boards page, if you go back to where the login page, you'll see the login box again. I plan soon to upgrade the code and show a logged in stat.

Hey developer... how about this update to show the login stat please. Can you do this sooner then later since its been years already! :)

nima6
29 Aug 2011, 20:30
Does anyone know whether this mod works for VB 4?

Thanks

absofts
10 Oct 2011, 07:26
Yes its working in vb 4.
Thanks for the mod.
how to log out the user from forum and non vb pages ?

Sovereign123
30 Oct 2011, 12:58
Thanks mate, that code helped me finally fix the problems with my page, eternally grateful!

Hellmaster
18 Nov 2011, 23:19
Works on 3.8.x?

AwesomeMetalB
02 Apr 2015, 15:18
Hello,

If this modification really works this will be amazing, I am getting the following error

"Your submission could not be processed because a security token was missing."

I understand a little about token-based authentication and what it is used for but not sure about the implementation.

The following edit in the given code

<form action="http://www.awesomemetalbands.com/forum.php/login.php?do=login"

that's the only change i made as stated in the documentation


Thank you

Daniel

www.awesomemetalbands.com

AwesomeMetalB
02 Apr 2015, 15:31
I have corrected the URL but now its saying

"Thank you for logging in, Awesome Metal Bands Admin."

and when i get to the forum I am not logged in.

advice would be fantastic

Thank you
Daniel

AwesomeMetalB
02 Apr 2015, 15:59
Could this be an issue with cookies, well i can log in via the forums but on the separate html page i get ""Thank you for logging in, Awesome Metal Bands Admin." but im not logged in once re directed

AwesomeMetal
03 Apr 2015, 12:09
Anyone reading this will the same problem the solution might be the url for the forum

http://awesomemetalbands.com/login.php?do=login

not http://awesomemetalbands.com/forum.php/login.php?do=login

If someone can confirm this.

blind-eddie
03 Apr 2015, 14:49
You are running vb4.1.7, is the login form compatible?



I would suggest looking at vb 4.1.7 login template and edit the code in the readme to reflect the changes.

If you are creating vbulletin pages via php/template then you don't need this as it picks up forum permissions.

AwesomeMetal
13 Apr 2015, 19:47
Thank you very much for the reply working perfectly now, I was using the wrong url

http://awesomemetalbands.com/login.php?do=login