vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   log-in to non-vb pages using vb passwords? (https://vborg.vbsupport.ru/showthread.php?t=113282)

amykhar 05-02-2006 11:04 PM

If you add the vbulletin userid to the user table, it's a simple matter to check to see the userid of the user on the page. You just check for $vbulletin->userinfo[userid]

Once you know that, you can do several things. You can check to see if that userid is listed in your custom database. If it isn't, show the no permission page.

If it is, send them to an edit form for their profile.

You don't necessarily have to use a login script on your page. You could do this:

Code:

require_once('./global.php');

$userid = $vbulletin->userinfo[userid];
if(!$userid)
{
    print_no_permission();
}

else
{
  // query the custom database to see if userid is in there
  // if it is, show your edit form
  // if it's not, throw the user out.
  print_no_permission();
}

That's a rough start. If you run into trouble, use print statements to verify that you are seeing the correct userid, etc.

arossphoto 05-03-2006 01:23 PM

Thanks again Amy, but I think this might be beyond my current abilities. I've been able to accomplish a lot on my site using Dreamweaver to create dynamic pages, restrict access to pages, etc, but I'm not too good at writing php from scratch.

If it's not too much to ask would you be able to provide a sample page that uses your example above with a print statement to verify I'm seeing the userid? I tried for a few hours last night and I just couldn't get it to work. That might give me a good place to start and I might be able to figure how to pass the userid as a session variable to the edit form for their profile.

Thanks again,

Andrew


All times are GMT. The time now is 04:18 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.01016 seconds
  • Memory Usage 1,712KB
  • 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
  • (1)bbcode_code_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
  • (2)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