vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Manually setting Cookies / Login (https://vborg.vbsupport.ru/showthread.php?t=131442)

fhs2006 11-13-2006 08:29 AM

Manually setting Cookies / Login
 
probably someone of you can help me. i want vbulletin authenticate against an axternal database. this one is a very easy one, just 4 fields (username, userid, password, email).

i added a hook in login.php just below of
Code:

$vbulletin->input->clean_array_gpc()
Code:

($hook = vBulletinHook::fetch_hook('external_login_hook')) ? eval($hook) : false;
this is working fine. then after the authentication (works, too) i add the user to the vbulletin database (if auth was ok). this works, too.
Code:

$newuser =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY);
$newuser->set('username', $external_uid);
$newuser->set('email', 'email@email.com');
$newuser->set('password', 'somepassword');
$newuser->set('usergroupid', 2);

the email comes from external db, too, password doesnt matter, i set any random value to this.

now the problem starts, after authentication (useradding or not doesnt matter)
i have a problem with starting vb session and redirecting to the board again.

i try it with this code:
Code:

verify_authentication($vbulletin->GPC['vb_login_username'], $vbulletin->GPC['vb_login_password'], $vbulletin->GPC['cookieuser'], true);
exec_unstrike_user($vbulletin->GPC['vb_login_username']);
process_new_login($vbulletin->GPC['logintype'], $vbulletin->GPC['cookieuser'], $vbulletin->GPC['cssprefs']);
do_login_redirect();

but now, he is redirecting and says "Thank you for logging in, .", redirects (sometimes) me, but i am not logged in.

can anyone please help me how to, create the vb sessions?

would be very nice.

thanks

-andy

ianskate 09-26-2007 05:46 PM

yeah i need the same info :) im told by others to "just search the board" but i been searching for hours, cant find the exact info i need...


All times are GMT. The time now is 03:53 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.00907 seconds
  • Memory Usage 1,710KB
  • 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
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete