vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Login Hack (https://vborg.vbsupport.ru/showthread.php?t=47640)

Dark_Angel2 01-12-2003 01:02 PM

Login Hack
 
Hi,

I'm looking for a hack which will allow to me to have a login box to my forums on a non VB PHP page. I would love it to work the same as this hack: https://vborg.vbsupport.ru/showthrea...threadid=37134 but with just the login box.

I've tried to edit that hack to do what I want but I can't get it to work correctly. Can anyone help me out please, it doesn't seem like a huge job and I would be so greatful.

Thanks in advance for any help.

poi@nwdnb 01-12-2003 10:43 PM

I have done this today, the page that I have had the login boxes display on is not even php. Only a plain html form is needed.

Insert this into the HTML output of your page

PHP Code:

<form action="http://yoursite.com/forum/member.php" method="post">
<
b>Your User Name:</b><input type="text" name="username" value="" size="25"><br>
<
b>Your Password:</b><input type="password" name="password" value="" size="25"><br>
<
input type="hidden" name="action" value="login"><br>
<
input type="submit" value="Login!">
</
form

You'll need to change the form tag's action parameter to point to your member.php file.

You can have a look at the template "error_nopermission_loggedout" for reference, this has a similar form on it too.

Hope this helps!

sbryan 01-14-2003 10:41 AM

can u then use that somehow to log people into another part of the site? ie use the forum as your membership signup tool and then use the users login details on other parts of the site to access member only content?

poi@nwdnb 01-14-2003 10:50 AM

If your main site is on the same domain as the forums, you can check for the "bbuserid" cookie. When a user is logged into the forums, this cookie is present and stores the user's id.

So only allow them access if this cookie is present.

sbryan 01-14-2003 10:51 AM

ahhhh that may be a workaround... have u seen any examples of this or know of any code anywhere?

poi@nwdnb 01-14-2003 10:53 AM

I have coded it in the last two days, but our main site is in ASP, so that may not be of any help to you.

If you want to see the code i have used, just shout! :)

sbryan 01-14-2003 11:00 AM

what im after is a comments field down the bottom of news items that i post. my site is in php. www.xboxworld.com.au

i could go either way

1.when page loads, detects forum cookie and displays comments text box/form at the bottom of the post, if not detected displays nothing.

2.for comments form under news post have username and login fields with the main comment text field. username and login is validated against the forum DB and allows them to make a comment if they are a member. if not it directs them to the signup forum page.

poi@nwdnb 01-14-2003 03:50 PM

The way i would probably do it is..

1a. Check the cookie and see if the user is logged in. If the user is logged in, then the comment fields can go up, no problems there.


If the users ISNT logged in:

2a. Display the form that i posted earlier in this thread (with a message saying "login to post a comment" or similar). This form will hand all the authentication duties over to the proper vBulletin scripts (member.php).

2b. Have the login auto-redirect back to the main page, and the user will be back, with the correct cookie, and stage 1a above will occur!

Use this hidden field in your form, this is what the member.php script will re-direct the user to if he logs in successfully:

PHP Code:

<input type="hidden" name="url" value="http://your.site.com/"


sbryan 01-14-2003 08:26 PM

thanks for that ill give it a test out this afternoon!

svoec 01-16-2003 01:50 AM

I needed this exact code for some other project I was working on --- it rocks!! thanks!!!

poi@nwdnb 01-16-2003 01:53 AM

Glad it helped :)


All times are GMT. The time now is 04:21 AM.

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.00992 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)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