From c37df1321fdd3cb9f07980c3546b2d1ae4e80443 Mon Sep 17 00:00:00 2001 From: DiscourseHosting Date: Wed, 14 Jan 2015 02:06:28 -0500 Subject: [PATCH] Add bcrypt for Vanilla support --- plugin.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugin.rb b/plugin.rb index 00af02a..952a2c6 100644 --- a/plugin.rb +++ b/plugin.rb @@ -12,6 +12,7 @@ # for Phorum #{password} md5(pass) # for Wordpress #{password} phpass(8).crypt(pass) +gem 'bcrypt', '3.1.3' require 'digest' @@ -103,7 +104,12 @@ after_initialize do def self.check_all(password, crypted_pass) AlternativePassword::check_vbulletin(password, crypted_pass) || AlternativePassword::check_md5(password, crypted_pass) || - AlternativePassword::check_wordpress(password, crypted_pass) + AlternativePassword::check_wordpress(password, crypted_pass) || + AlternativePassword::check_bcrypt(password, crypted_pass) + end + + def self.check_bcrypt(password, crypted_pass) + BCrypt::Password.new(crypted_pass) == password end def self.check_vbulletin(password, crypted_pass)