vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Login Function (https://vborg.vbsupport.ru/showthread.php?t=45294)

nsr81 11-01-2002 09:06 PM

Login Function
 
Hi all,

Can anyone tell me if it is possible to send the login function a URL to which the user will be be redirected after logging in, instead of going to the forum home?

Also, in order to use vB variables such as username and userid on non vB pages, what files do I need to include and how can I access the variables?

Thanks :)

Xenon 11-02-2002 01:13 PM

edit member.php
you can find the redirects there, section login..

you need to include global.php, then you can use the $bbuserinfo array.

nsr81 11-03-2002 03:57 PM

Thanks Xenon :)

I have the following code, but it produces a blank page:

PHP Code:

<?
include('../forum/global.php');

if ($bbuserinfo['userid']!=0) {
  $username=$bbuserinfo['username'];
  echo $username;
}       
 
?>

Seems like if I include global.php into a file that is not in the forum directory, nothing works.

Any ideas how to make it work?

One more thing. I need to use vB's database to authenticate for some other stuff on my site. that means my own script will connect to the database. So I'm wondering how can I check if a user has activated his account in my SQL queries.

Xenon 11-03-2002 07:06 PM

hmm, you can try this part:
PHP Code:

<?
chdir("../forum");
require('global.php');

if ($bbuserinfo['userid']!=0) {
  $username=$bbuserinfo['username'];
  echo $username;
}       
 
?>

this should work, and then you don't need to write your own scripts to check if a user account is activated, you can just check if he is in usergroup=2 -> registred user..

nsr81 11-03-2002 07:13 PM

worked like a charm. Thanks again :D

Xenon 11-03-2002 07:56 PM

:)
you're welcome


All times are GMT. The time now is 12:35 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.00939 seconds
  • Memory Usage 1,716KB
  • 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
  • (6)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