vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Check vB password with main page comment script (https://vborg.vbsupport.ru/showthread.php?t=71042)

Iezugod 10-27-2004 04:45 AM

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'])) 


Andreas 10-27-2004 06:47 AM

[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

Iezugod 10-27-2004 03:22 PM

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.

void 03-10-2006 11:11 AM

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?


All times are GMT. The time now is 01:42 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.01026 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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