Request for log-in function

This forum is now closed as part of retiring phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
[HEAD]NaaDje
Registered User
Posts: 2
Joined: Tue Aug 09, 2005 11:09 am

Request for log-in function

Post by [HEAD]NaaDje »

Hi there, I myself am quite new to phpBB(2) forums, but not new to PHP.
(also this is my first post on these boards here)

I have googled, I have used the mod_search.php but I couldend find what I was looking for :-/

I am looking for a mod/addon, which either, removes the encryption on the passwords (usernames??) or, a mod, that allows the user to login, without having to visit the forum instead.

Now, you would be wondering, why-oh-why does he want that?

Well I play WoW, and I play WoW, in a guild, and now we want our own guild-site. All cool and stuff, but we also want to be able to upload pictures/screenshots. We have a phpBB(2) forum for it already, only, we don't want any random person to be able to upload pictures/screenshots.
So I tought, well then I will make a login section and stuff. But then, we would have 2 different user databases. which is not all that handy, so we tought about a mod/addon, so we could use the user-database from the phpBB(2) forums, so that the users that are registered on our forum, would be able to login (on my own created login page?).

As I said, I am not new to php. It is just, that I am 100% new to phpBB(2). and have no clue about encryptions and stuff.

So, all I would need is a de-crypter, for the phpBB(2) user accounts. That would say *login is correct, or not* I can make the rest myself :] (or just a mod, that removes the encryption of the passwords)

oke, alot of text, sorry.

Thanks in advance!
Sephiseraph
Registered User
Posts: 73
Joined: Sun Jan 16, 2005 11:19 am

Post by Sephiseraph »

The passwords use a function called md5() to be encrypted.

So you'd just have to do something like this:

Code: Select all

$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string($_POST['password']);

$sql = "SELECT u.user_id, u.username FROM phpbb_users u WHERE u.user_password = ".md5($password);
if ($result = $db->sql_query($sql)) {
  if ($row = $db->sql_fetchrow($result)) {
    // do the good stuff from here
  }
  else { echo "Failed To Log In"; }
}
else { echo "Failed to Log In."; }
Hope that helps!
[HEAD]NaaDje
Registered User
Posts: 2
Joined: Tue Aug 09, 2005 11:09 am

Post by [HEAD]NaaDje »

I hope so!

I currently have no access to the forum (sadly) and I don't have a phpbb(2) forum on my localhost.

But I will try and test it asap :]

thanks !
Post Reply

Return to “[2.0.x] MOD Requests”