how to use phpbb_hash()

Discussion forum for MOD Writers regarding MOD Development.
Registered User
Posts: 9
Joined: Sun Aug 24, 2008 4:54 pm

how to use phpbb_hash()

Post by Balpo »


i want to use phpbb's user database along with my site, so that registered users can use both applications with the same username and password.

i read phpbb uses phpbb_hash() function, defined in functions.php to hash de password.

who can I use these functions?
what files should I include?
and finally, how would I authenticate the user?

thank you in advance

Balpo :shock:
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean

Re: how to use phpbb_hash()

Post by Erik Frèrejean »

First off all you have to integrate your application within phpBB
Knowledge Base - phpBB3 Sessions Integration, then you are ready to use the the phpBB hashes. On how to use them have a look at this topic and have a look for posts by Acyd Burn. He gives some examples in that topic.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh

Re: how to use phpbb_hash()

Post by ckwalsh »

And moved to MOD Writer's Discussion
Where to post what | Forum Rules | The Dos and Don'ts of General Discussion
In Seattle and want to meet, chat, or have a coffee? Drop me a PM.
Registered User
Posts: 375
Joined: Fri Jul 13, 2007 8:24 am
Location: $user->data['user_location'];

Re: how to use phpbb_hash()

Post by comkidwizzer3 »

Here's a quick sum up:

To hash:

Code: Select all

To check hash:

Code: Select all

phpbb_hash_check($string, $hash); 
Feel free to replace $string and $hash with any variables you like

$string is the what will be hashed, and the $hash is the already hashed hash either of the string or not.
~My MODs~
Login After Register - v1.0.0 | Custom Ranks MOD - RC

User avatar
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: how to use phpbb_hash()

Post by igorw »

There is some information on the wiki: phpbb_hash

I believe you only need to define IN_PHPBB = true and include includes/functions.php.
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three

Return to “[3.0.x] MOD Writers Discussion”