Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-18-2004, 11:39 AM
marklar marklar is offline
 
Join Date: Oct 2004
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Where does vB check login

I want to check that a user is logged in to somewhere else (Hivemail) but I can't find the script that vB uses to check whether someone is logged in (the sessions / cookies bit).
Reply With Quote
  #2  
Old 10-18-2004, 11:47 AM
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Posts: 1,551
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

use
PHP Code:
if ($bbuserinfo[userid] != 0)
{


or the other way around:
PHP Code:
if ($bbuserinfo[userid] == 0)
{
printnopermission();

The nopermission function has a different name, but I can't recall it at the moment.
Reply With Quote
  #3  
Old 10-18-2004, 12:39 PM
nexialys
Guest
 
Posts: n/a
Default

i think he was more searching for something like "Who's Online, AND Where..." ...
Reply With Quote
  #4  
Old 10-18-2004, 01:04 PM
marklar marklar is offline
 
Join Date: Oct 2004
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, I mean that whenever you go to a page in vB, it checks to see if you are logged in. I want to know where it does that.

Then within that function I am going to put the login check for Hivemail, so if they are logged in to vB and not Hivemail, I'll log them in using the vB user/pass.
Reply With Quote
  #5  
Old 10-18-2004, 03:17 PM
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Posts: 1,551
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vB doesn't actually have a function to check if a person's logged in. It has the session, in which it stores some data, and then one can check if the user is logged in by checking if $bbuserinfo[userid] is equal to 0 (meaning he's not logged in) or if his userid is set, meaning he is logged in.
Reply With Quote
  #6  
Old 10-18-2004, 04:52 PM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vb also checks cookies if user is browsing via cookies
Reply With Quote
  #7  
Old 10-19-2004, 05:02 AM
marklar marklar is offline
 
Join Date: Oct 2004
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Colin: So there is script on every page rather than 1 function? Where is $bbuserinfo[userid] defined?

AN: I know, but where is the code? (
Reply With Quote
  #8  
Old 10-19-2004, 07:26 AM
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Posts: 1,551
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

probably in either the global.php or the includes/session.php...
Reply With Quote
  #9  
Old 10-19-2004, 07:49 AM
marklar marklar is offline
 
Join Date: Oct 2004
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't think you know exactly what I mean. global.php is included in most if not all pages so it's definitely down that path. Within global.php other files are included, session.php being one of them & the most likely.

What I'm asking is, I want to put in a line of code which gets run every time vB checks to see if someones logged in, where do I put it?

I mentioned that it is a login script I am putting in because it would need to be put at the last stage of the vB login check after it has gone through all the variable/session/cookie possibilities.
Reply With Quote
  #10  
Old 10-19-2004, 08:00 AM
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Posts: 1,551
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Look for it

Sorry, but I'm at work, so I don't have the vB files at hand at the moment. If you haven't found it by this evening I can have a look if I find it...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:16 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.04301 seconds
  • Memory Usage 2,251KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (9)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete