Changeset

420:eaafb38daa5e

mod_auth_phpbb3: Support legacy PHPBB2 password hashes (simple MD5).
author Waqas Hussain <waqas20@gmail.com>
date Sat, 10 Sep 2011 22:37:18 +0500
parents 419:2a2b70e1a998
children 421:816d8e3e83a3
files mod_auth_phpbb3/mod_auth_phpbb3.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_auth_phpbb3/mod_auth_phpbb3.lua	Sat Sep 10 22:35:59 2011 +0500
+++ b/mod_auth_phpbb3/mod_auth_phpbb3.lua	Sat Sep 10 22:37:18 2011 +0500
@@ -178,6 +178,7 @@
 function provider.test_password(username, password)
 	--module:log("debug", "test_password '%s' for user %s", tostring(password), tostring(username));
 	local hash = get_password(username);
+	if hash and #hash == 32 then return hash == md5(password, true); end -- legacy PHPBB2 hash
 	return hash and phpbbCheckHash(password, hash);
 end
 function provider.user_exists(username)