View Single Post
  #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
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02583 seconds
  • Memory Usage 1,812KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete