vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Possible to authenticate elsewhere on webpage? (https://vborg.vbsupport.ru/showthread.php?t=99158)

Marco van Herwaarden 11-10-2005 06:39 PM

Do a search on 'salt' here. There might also be a topic on this in the How-To forum.

roosevelt 11-10-2005 07:11 PM

Yes you can authenticate users with the datas stored in the vbulletin database. There are two concepts you have to understand.

Make the user log-in both your site area and the forum or just one module
To do this you will need to study vBulletin sessions system, what algorithm is used to encrypt the password so that it matches the users password in the database. Say your users's id is bob and password is 2005.

For example if vbulletin used md5() hash to encrypt the password the password 2005 would be stored as 2983jdkfsdm23847 in the database.

So, when the user enteres his username, and password on the log-in form you made for your website area... make it check the database and if the values matches you sent the user to his destination else return a error. The actual code will look like:

PHP Code:

<?php
$username 
$_POST['username'];
$password md5($_POST['password']);

// Use this area to connect to vbulletin database, and select the users table.

$query mysql_query("SELECT username, password FROM users WHERE username = $username, passwod = $password");

if (
$query){
    echo 
"Welcome";
    
register_session(.username.);
   
//Enter the vbulletin register session if you want him to login the forums aswell
} else {
    echo 
"Invalid log-in";
}

?>

The code I provided is really crappy but it will help you understand the concept. The thing you should notice is on the variables I surrounded the $_POST['password'] variable with md5() function. So, whatever user's password is, it is encrypted before it is checked on the database. Because the password 2005 doesn't even exist in the database, but if we encrypt is before checking it... then it will see the match and will let the user login right away.

If you are not into PHP, then I recommend study it first... because for someone new session could be a pain. And also understanding the classes and objects in vbulletin system if wish to work with the vbulletin session class.

:)

Here is a mod which will do that: https://vborg.vbsupport.ru/showthread.php?t=91129


All times are GMT. The time now is 08:10 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.01023 seconds
  • Memory Usage 1,726KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete