vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=263)
-   -   Single login (https://vborg.vbsupport.ru/showthread.php?t=293728)

gtfreymann 04-06-2013 12:54 AM

Quote:

Originally Posted by frankgeraci (Post 2414598)
I am also pretty interested in this. I initially saw the vbsso plugin, but it will not work with vb 5. I also have a site that handles registration and would like users to automatically have a forum account.

I never heard back from that other fellow after I emailed him my scripts but like my message says. Pm me with your email address and I'll send you what I have.

fungku 04-06-2013 05:10 PM

thanks for the scripts. they are good. however, i haven't had time to set up my forum yet and now I'm thinking of waiting for fluxxBB 2.0 or making my own. disappointed with the direction of VB lately since vb5 came out and started thinking maybe the earlier I jump off the sinking ship the better. :P

nathan-mahdavi 04-12-2013 01:21 PM

This is a working script (tested on VB 5.0.1) that will create a random user and then log them in using their ID. If you already know a users ID then you can just log them in using the log_user_in function.

PHP Code:

<?php

chdir
("forum/core/"); // change to your core folder location
require_once("global.php");

function 
create_random_user(){
    
$dataman =& datamanager_init('User'$vbulletin);  
    
$dataman->set('username'"user".rand());
    
$dataman->set('email'rand()."@domain.com");
    
$dataman->set('password'"leighf");
    return 
$dataman->save();
}

function 
log_user_in($userid){
    
$user fetch_userinfo($userid);
    
$auth vB_User::verifyAuthentication($user['username'], "leighf"$user['password'], $user['password']);
    
$res vB_User::processNewLogin($auth);
    
vbsetcookie('userid'$res['userid']); 
    
vbsetcookie('password'$res['password']);
    
vbsetcookie('sessionhash'$res['sessionhash']);
}

// create random user
$userid create_random_user();

// log them in
log_user_in($userid);

It's a script in its simplest of states. The usernames password is hardcoded but assuming you know what's going on in the above snippet, you'll be fine adding this yourself.


All times are GMT. The time now is 11:00 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.01179 seconds
  • Memory Usage 1,735KB
  • 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_php_printable
  • (1)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
  • (3)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