vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Integration with vBulletin - Simple login page/box/code for external pages (https://vborg.vbsupport.ru/showthread.php?t=174073)

gusfune 03-24-2008 10:00 PM

Simple login page/box/code for external pages
 
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 03-24-2008 11:03 PM

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:
Code:

<a href="pathtoyourforums/register.php">Not a member? Register now</a>

dilbert 03-24-2008 11:49 PM

Interesting.
My site is primarily cold fusion, with a vB forum.
Can i use this in a CF page?

gusfune 03-25-2008 02:21 AM

Quote:

Originally Posted by dilbert (Post 1473734)
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 03-25-2008 03:59 AM

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 03-28-2008 08:54 PM

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

this addrese appears after logging in

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

TF-TM 03-29-2008 04:03 PM

Very Very Thanks

smooth-c 03-29-2008 04:18 PM

wow! thank you soo much!

smooth-c 03-30-2008 03:43 PM

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 03-30-2008 07:08 PM

Quote:

Originally Posted by jeddah_eyes (Post 1477129)
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

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


Code:

<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>

Quote:

Originally Posted by smooth-c (Post 1478401)
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-04-2008 11:38 AM

Now I will try it. :)

Triky 04-04-2008 11:46 AM

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 05-21-2008 07:10 AM

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 05-29-2008 01:11 AM

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 05-29-2008 02:22 AM

Awesome...this was exactly what i was looking for since last couple of days for my wordpress homepage. Thanks a zillion !!!

ti07shadow 05-31-2008 05:18 AM

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 05-31-2008 11:47 PM

Awesome mod

cmedic101 08-14-2008 03:28 AM

Great mod:) Good instructions and it works well with 3.7x

thank you


cmedic101

Thronx 08-16-2008 05:36 PM

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 09-11-2008 01:03 AM

Quote:

Originally Posted by LT Mote (Post 1526554)
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

Quote:

Originally Posted by Thronx (Post 1600173)
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 09-14-2008 07:29 AM

syntax error...

:S

Gursimran 09-21-2008 12:08 PM

What do you think about adding a feature in which logged in user see Welcome $username in the place of the form again?

tunistunis 09-21-2008 01:16 PM

<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 02-05-2009 07:15 AM

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:

Code:

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

Here is the code used:
Code:

<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 02-15-2009 05:46 AM

Is there a way to limit the size of the login boxes? I need them smaller? Thanks.

UKBusinessLive 03-19-2009 07:46 PM

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://vborg.vbsupport.ru/external/2009/05/7.png

Thanks for this

:D

Shaven_LTS 04-29-2009 08:57 AM

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 05-29-2009 09:37 AM

Add this before or inside the <form> tag or in the <head> tag
Code:

<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 06-14-2009 01:58 AM

reserved

ahmer 07-10-2009 02:03 AM

this is gr8 thanks

fake83 08-02-2010 08:34 AM

how to show the username if the person is already logged in? Thank you, Great mod!

yotsume 01-28-2011 03:18 PM

Quote:

Originally Posted by gusfune (Post 1473700)
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 08-29-2011 07:30 PM

Does anyone know whether this mod works for VB 4?

Thanks

absofts 10-10-2011 06:26 AM

Yes its working in vb 4.
Thanks for the mod.
how to log out the user from forum and non vb pages ?

Sovereign123 10-30-2011 12:58 PM

Thanks mate, that code helped me finally fix the problems with my page, eternally grateful!

Hellmaster 11-18-2011 11:19 PM

Works on 3.8.x?

AwesomeMetalB 04-02-2015 01:18 PM

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 04-02-2015 01:31 PM

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 04-02-2015 01:59 PM

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 04-03-2015 10:09 AM

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.p...n.php?do=login

If someone can confirm this.


All times are GMT. The time now is 05:23 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.01310 seconds
  • Memory Usage 1,840KB
  • 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
  • (5)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete