mram-phpbb_hash 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +10 -9
- data/lib/mram-phpbb_hash.rb +1 -0
- data/lib/mram-phpbb_hash/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -4,19 +4,20 @@ Mram::PhpbbHash
|
|
4
4
|
i'm not exactly sure what, and why, the phpBB people are doing this crazy custom hashing. but if you ever need to authenticate against a phpBB user table, this gem will help you do exactly that.
|
5
5
|
|
6
6
|
Usage
|
7
|
-
|
7
|
+
-----
|
8
8
|
|
9
9
|
just include mram-phpbb\_hash in your Gemfile, and use it like this:
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
inputpass = params[:password] # from post variables, for example
|
12
|
+
phpbbhash = get_hash_from_phpbb_database(params[:user]) # whatever you need to do to get the hash from the database
|
13
|
+
if Mram::PhpbbHash.check_hash(inputpass, phpbbhash) then
|
14
|
+
puts "success!"
|
15
|
+
else
|
16
|
+
puts "hash does not match!"
|
17
|
+
end
|
18
18
|
|
19
19
|
Other Info
|
20
|
-
|
20
|
+
----------
|
21
21
|
|
22
22
|
the actual code was translated to ruby by me from [phpBB 3 Sources](https://github.com/phpbb/phpbb3/blob/develop/phpBB/includes/functions.php).
|
23
|
+
appearently, there was no other gem doing this so far..
|
data/lib/mram-phpbb_hash.rb
CHANGED