Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 10-27-2004, 04:45 AM
Iezugod Iezugod is offline
 
Join Date: Mar 2002
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Check vB password with main page comment script

I am writing a comment script for the news section of my website and I would like to make it so that users have to be registered on the forums to comment. I would like to set it so that when they input their password, the script queries the vB database, checks their input username and password and see if it matches the database. If so, the script should then send the comments to the main page database.

I have the entire script written except for the password check system. I just want to know what the code would be?

I'm assuming it would be similar to the check code for the forums:

PHP Code:
if ($bbuserinfo['password'] != iif($password AND !$md5passwordmd5(md5($password) . $bbuserinfo['salt']), '') AND $bbuserinfo['password'] != md5($md5password $bbuserinfo['salt'])) 
Reply With Quote
  #2  
Old 10-27-2004, 06:47 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[sql]SELECT userid FROM user WHERE username = 'foo' AND password = MD5(CONCAT(MD5('bar'), salt))
[/sql]

Where foo ist the username and bar is the password.
If this query returns a row the username/password-combination is valid
Reply With Quote
  #3  
Old 10-27-2004, 03:22 PM
Iezugod Iezugod is offline
 
Join Date: Mar 2002
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I figured it out last night:

PHP Code:
$sql "SELECT username, password, salt FROM user WHERE username = '$xUsername' LIMIT 0,1";
$query mysql_query($sql);
$records mysql_num_rows($query);
while (
$result mysql_fetch_array($query)) {
extract ($result);
if (
$records == '1') {
$md5password md5(md5($xPassword). $salt);
if (
$password == $md5password) {
echo 
"Login: Valid";
} else {
echo 
"Login: Invalid";
}}
if (
$records == '0') {
echo 
"Invalid Username<br>";

That worked out perfectly. I didn't know about the 'salt' variable.
Reply With Quote
  #4  
Old 03-10-2006, 11:11 AM
void void is offline
 
Join Date: Nov 2001
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What is the status of this script?

Does anyone know of script similar to this http://www.mylittlehomepage.net/comment_script?

It should use a dedicated news comment forum (each news item being a single thread) and that requires the user to be logged in?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:09 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03982 seconds
  • Memory Usage 2,191KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete