News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Bare Bones Username/Password Checking

Started by ldk, June 30, 2004, 10:29:27 AM

Previous topic - Next topic

ldk

Hello,

I bought a multi-member photo album software package called PhotoPost.  PhotoPost is written in PHP/mySQL.

I'd like to insert something into the "registration" code for PhotoPost that simply makes sure that the username and password the person chose already exists in SMF's database.  i.e. I'm trying to make it so that you need to be a member of my forum to use PhotoPost and I'd like the usernames to match up .

Can someone provide me with some PHP code that I can place into PhotoPost who's sole purpose is to just look up a username and password in SMF's database and see if they match? 

I've been poking around Sources/LogInOut.php and I'm afraid I just don't have the mySQL chops to extract just the essential code and also make it so that code can be used outside of that file.

I don't mind if the code you give me is "untested" -- I can probably hammer out any bugs/typos, etc.

Thanks for any help you can give me!

see SMF put to the test at http://www.craftster.org/

[Unknown]

I'm writing an API file, but considering the fact that my current living space/financial/etc. situation is... quite unstable... I may not be able to work on it for a little while... I'm sorry.

It's not that hard though, it just uses md5_hmac (a function in Load.php.)  The first parameter should be the password, and the second a lowercase'd username.  Note that the cookie is hmac'd again.

I suggest you look at loadUserSettings() in Load.php.

-[Unknown]

ldk

An API would be great. Thanks for putting the time into that.

I'm off to investigate Load.php.

Thanks!
see SMF put to the test at http://www.craftster.org/

Advertisement: