vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Ajax Login/Logout (https://vborg.vbsupport.ru/showthread.php?t=213469)

sanjeev_jha 05-12-2009 09:56 AM

Ajax Login/Logout
 
I am trying to integrate vbulletin in my application. I am using vb user table for login.

User logs in from inline popup form. User login details are verified via AJAX.

So far, I have been able to verify user logins (username and password) through AJAX but I got struck in creating session.

Can anyone help me in creating Sessions? What are the cookies that need to be set?

EnIgMa1234 05-12-2009 11:07 AM

Taken from login.php

PHP Code:

process_new_login($vbulletin->GPC['logintype'], $vbulletin->GPC['cookieuser'], $vbulletin->GPC['cssprefs']); 


sanjeev_jha 05-13-2009 04:00 AM

Thanks for the quick response.

Actually I am using my own function to check user login details. How can I pass username to process_new_login function. Also is there any other way for creating session?

Dismounted 05-13-2009 05:54 AM

Look inside the function and see what it does.

sanjeev_jha 05-13-2009 10:56 AM

Quote:

Originally Posted by Dismounted (Post 1809882)
Look inside the function and see what it does.

I went through the function. There are some variables used like $vbulletin->userinfo['userid']. Can you help me to set these variables?

So far, I have been able to verify username and password using my own function. Here's how I have verifed:
Code:

1. Get userid, username, password, salt from Database for the given username.
2. Check the given password
        md5( md5($given_password) . $salt) with password in database.

After this, I am trying to create session. I cannot directly use vbulletin's login.php script because I have to use AJAX login.

I think I have missed some steps before using process_new_login(). Would you please help me in finding the missing steps?

EnIgMa1234 05-13-2009 11:01 AM

process_new_login() creates a new session.

sanjeev_jha 05-13-2009 11:21 AM

I am still unable to use this function properly.

After checking login details,

PHP Code:

// $someone is the user details fetched from database
$vbulletin->userinfo['userid'] = $someone['User']['userid'];
$vbulletin->userinfo['password'] = $someone['User']['password'];                
process_new_login(''1''); 

Is this the correct way of using this function?

sanjeev_jha 05-19-2009 03:47 AM

Thanks everybody for your help.

I solved this problem myself using Curl :)


All times are GMT. The time now is 03: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.01052 seconds
  • Memory Usage 1,731KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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