Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-04-2005, 11:25 PM
SkyCatcher's Avatar
SkyCatcher SkyCatcher is offline
 
Join Date: Feb 2003
Location: Germany
Posts: 310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vbulletin password hash - how do I integrate

Hi all,



I need some help asap.



I've got another php application that requires you to log on. I've tried to integrate this into vbulletin's database.



Both vb and the app share the 'user' databases userid, username and password fields.



The problem is that VB and the other app create, mask, or hash the passwords differently!



So although the other app sees that I am a user, the password I enter will be incorrect because it can't read vb's pass with the salt and all.



Can someone please help me come up with a way to make the other app login using vb's method, or at least be able to decrypt password the same way vb does so I can log on to both the forum and this other app?





I've added the login.php test from the other app.





PHP Code:
 <?

session_start();

include ("config/config.php");

include ("config/settings.php");

include ("config/datecalc.php");

if (isset($loginok)||$islogin=="yes") { 

$getusr=mysql_query("SELECT * FROM user WHERE username='$username'");

$row=mysql_fetch_array($getusr);

$thepass=$row['password'];

$mbid=$row['userid'];

$mbname=$row['name'];

$mbuser=$row['username'];

$isactive=$row['active'];

//echo "THE PASS: $thepass, PASS: ".md5($password);

if (substr($thepass,0,10)==substr(md5($password),0,10)&&$password!=""&&$username!="") {

if ($isactive==1) {

session_register('membersarea');

session_register('memberid');

    $memberid=$mbid;

session_register('membername');

    $membername=$mbname;

session_register('memberusern');

    $memberusern=$mbuser;

} else if ($isactive!=1&&$setts[account_mode]==2) {

//session_register('membersarea');

session_register('memberid');

    $memberid=$mbid;

session_register('membername');

    $membername=$mbname;

session_register('memberusern');

    $memberusern=$mbuser;

if (!session_is_registered('accsusp')) {

    session_register('accsusp');

     $_SESSION[accsusp]=2;

}

} else if ($isactive!=1&&$setts[account_mode]!=2) {

$accsusp=1;

}

}

}

include ("themes/$setts[default_theme]/header.php");

?>

<? header5(strtoupper($lang[memberlogin])); ?>

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr> 

    <td class="contentfont">

     <br> 

     <? if (session_is_registered('membersarea')||$_SESSION[accsusp]==2) { 

if ($auctionid!=0&&$redirect=="") $link="auctiondetails.php?id=$auctionid";

else if ($redirect=="sell") $link="sellitem.php";

else if ($redirect=="buynow") $link="buynow.php?id=$auctionid";

else if ($redirect=="swapitem") $link="swapitems.php?id=$auctionid";

else if ($redirect=="invoice") $link="invoice.php?id=$memberid";

else $link = "membersarea.php";

echo "<p class=contentfont align=center>$lang[loading]</p><p>&nbsp;</p>";

echo "<script>window.setTimeout('changeurl();',500); function changeurl(){window.location='$link'}</script>";

}

else {

 

if ($accsusp==1) {

echo "<p class=contentfont align=center>$lang[susp_login]</p><br>";

} else {

?>

 

     <form action="login.php" method="post">

        <input type="hidden" name="redirect" value="<?=$redirect;?>">

        <table width="400" border="0" cellpadding="4" cellspacing="4" align="center" class="border"> 

         <tr class="c3"> 

            <td width="50%" align="right"><?=$lang[username]?></td>

            <td width="50%"><input name="username" type="text" id="state4" class="contentfont"></td>

         </tr>

         <tr class="c2"> 

            <td width="50%" align="right"><?=$lang[pass]?></td>

            <td width="50%"><input name="password" type="password" id="state5" class="contentfont"></td>

         </tr>

         <tr> 

            <td colspan="2" align="center" class="c4"><input name="loginok" type="submit" id="loginok" value="<?=$lang[memberlogin]?>"></td>

         </tr>

         <tr> 

            <td colspan="2" align="center" class="c2">

            <a href="lostpass.php"><?=$lang[forgotpass]?></a></td>

         </tr>

        </table>

     </form>

     <br> 

     <? }

} ?>

    </td>

</tr>

</table>

<? include ("themes/$setts[default_theme]/footer.php"); ?>
Reply With Quote
 


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 11:41 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.04076 seconds
  • Memory Usage 2,425KB
  • Queries Executed 12 (?)
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)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.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_threaded
  • showthread_threaded_construct_link
  • 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