Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Lionel Lionel is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 01-10-2002 Last Update: Never Installs: 0
 
No support by the author.

I found a free simple classifieds software that I would like to use with VB. Problem is, it is using a password text instead of MD5. I was able to encrypt the MD5 at registration. Now I have to be able to read it at login and set the cookie to be vb's cookie. Once I do that, then I can use VB login system.

How can I alter the below function to read MD5 instead of text?
I am also including portion of the login and setcookie of that other software

Function

function verifyUser()
{
global $ADMIN_EMAIL;
session_start();
global $email, $passwd;
if( session_is_registered( "email" ) && session_is_registered( "passwd" ) )
{
$result = mysql_query( "SELECT email, passwd FROM user WHERE email='$email' AND passwd LIKE BINARY '$passwd'" ) or error( "Login failed, please contact <a href=\"$ADMIN_EMAIL\">adminstrator</a>" );
if( mysql_num_rows( $result ) == 1 ) return true;
}
return false;
}
function verifyAdmin()
{
session_start();
global $ADMIN_NAME, $ADMIN_PASS, $adminPasswd, $adminName;
if( session_is_registered( "adminName" ) && session_is_registered( "adminPasswd" ) )
{
if( $adminName == $ADMIN_NAME && $adminPasswd == $ADMIN_PASS )
return true;
}
return false;
}




login.php

if( $action == "login" )
{
$email = trim( $email );
$passwd = trim( $passwd );
if( $email == "" ) error( "Please enter your e-mail" );
if( $passwd == "" ) error( "Please enter your password" );

dbConnect();
$result = mysql_query( "SELECT email FROM user WHERE email='$email'" ) or error( mysql_error() );
if( mysql_num_rows( $result ) != 1 ) error( "Sorry, e-mail doesn't exist" );
$result = mysql_query( "SELECT email FROM user WHERE email='$email' AND passwd LIKE BINARY '$passwd'" ) or error( mysql_error() );
if( mysql_num_rows( $result ) != 1 ) error( "Sorry, invalid password" );
else
{
session_register( "email" );
session_register( "passwd" );
setcookie( "email", $email, time()+3600*24*365 );
if( isset( $cat ) ) header( "Location: ./list.php?cat=$cat" );
if( $cat == "" ) header( "Location: ./account.php" );
}
}

}

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-10-2002, 09:33 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Function

function verifyUser()
{
global $ADMIN_EMAIL;
session_start();
global $email, $passwd;
if( session_is_registered( "email" ) && session_is_registered( "passwd" ) )
{
$result = mysql_query( "SELECT email, passwd FROM user WHERE email='$email' AND passwd LIKE BINARY '".md5($passwd)."'" ) or error( "Login failed, please contact <a href=\"$ADMIN_EMAIL\">adminstrator</a>" );
if( mysql_num_rows( $result ) == 1 ) return true;
}
return false;
}
function verifyAdmin()
{
session_start();
global $ADMIN_NAME, $ADMIN_PASS, $adminPasswd, $adminName;
if( session_is_registered( "adminName" ) && session_is_registered( "adminPasswd" ) )
{
if( $adminName == $ADMIN_NAME && $adminPasswd == $ADMIN_PASS )
return true;
}
return false;
}

login.php

if( $action == "login" )
{
$email = trim( $email );
$passwd = trim( $passwd );
if( $email == "" ) error( "Please enter your e-mail" );
if( $passwd == "" ) error( "Please enter your password" );

dbConnect();
$result = mysql_query( "SELECT email FROM user WHERE email='$email'" ) or error( mysql_error() );
if( mysql_num_rows( $result ) != 1 ) error( "Sorry, e-mail doesn't exist" );
$result = mysql_query( "SELECT email FROM user WHERE email='$email' AND passwd LIKE BINARY '".md5($passwd)."'" ) or error( mysql_error() );
if( mysql_num_rows( $result ) != 1 ) error( "Sorry, invalid password" );
else
{
session_register( "email" );
session_register( "passwd" );
setcookie( "email", $email, time()+3600*24*365 );
if( isset( $cat ) ) header( "Location: ./list.php?cat=$cat" );
if( $cat == "" ) header( "Location: ./account.php" );
}
}

}
Reply With Quote
  #3  
Old 01-10-2002, 10:56 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

login.php does not let me in...
Reply With Quote
  #4  
Old 01-10-2002, 01:09 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you sure the passwords are really encrypted in the database?
Make sure that your password is (maybe only the newer passwords are and not all of them).
Reply With Quote
  #5  
Old 01-10-2002, 01:23 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

they are. Anyway I got around it by leaving it as is and parse bbuserinfo[username] and bbuserinfo[password] just like you helped with the other album code. I made it such a way that I removed all login info, switch registration to VB form, updates that database from register.php and member.php. Then in welcometext template I placed the links. As a result, non members can view albums (if not private or if provided password to view) and ads from main menu, members access their controls to manipulate private albums and ads by parsing the required info directly from the welcometext. The whole thing is nice. I have not put up the ads yet because it requires gd which I installed, but am afraid to recompile php so I do not mess up site which got a lot of traffic.

I saw your answer at .com in the html section and I am going to try it in the usercpnav. There I had simulated it with a transparent gif but it bothered my eyes a little because it was not aligning with other menuitems.

Thanks for all help!
Reply With Quote
Reply


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 10:47 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.03658 seconds
  • Memory Usage 2,240KB
  • Queries Executed 18 (?)
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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)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_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