VBulletin password encoding ?

Discussion in 'PHP' started by stats, Sep 12, 2007.

  1. #1
    Hi guys

    i need to know what encoding does vbulletin use to store the passwords in DB ?

    what i try to get done is make an addon that will, amongst other thigns, verify the user's login information from the vbulletin DB

    i have tried md5 .. doesn't work

    any idea please ?
     
    stats, Sep 12, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    $password = md5(md5($password_text) . $usersalt);
    
    PHP:
     
    nico_swd, Sep 12, 2007 IP
  3. stats

    stats Well-Known Member

    Messages:
    586
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Thanks

    will try that right now
     
    stats, Sep 13, 2007 IP
  4. stats

    stats Well-Known Member

    Messages:
    586
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #4
    Thanks, it worked :)

    one more question

    i have this
    $checkquery = mysql_query("select `userid` from `user` where `userid`='$userid'");
    if (!mysql_result($checkquery, 0)) {
    ........
    }

    to check if the user exists ..

    it does the checking correct .. it works .. however, every time it displays a warning telling that it can't jump on row 0 in mysql_result ..

    what would be another (better) way to check if the user exists ?

    Thanks
     
    stats, Sep 13, 2007 IP
  5. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #5
    If you're making an addon, I suggest using vB's functions and classes.

    
    
    // Make sure global.php is included.
    
    if (!$userinfo = fetch_userinfo($userid))
    {
        // User doesn't exist
    }
    
    PHP:

    If you have to write custom queries, don't forget to add the TABLE_PREFIX infront of the table names. (Some users might not be using the default values)
     
    nico_swd, Sep 13, 2007 IP
  6. stats

    stats Well-Known Member

    Messages:
    586
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #6
    ok thanks

    will try to figure it out
     
    stats, Sep 13, 2007 IP
  7. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #7
    Look at some of vB's file and see how they do stuff. They have a lot of handy functions.
     
    nico_swd, Sep 13, 2007 IP