mirror of
https://github.com/moparisthebest/discourse-migratepassword
synced 2024-11-15 21:45:02 -05:00
Remove debug...
This commit is contained in:
parent
72020e195f
commit
2ee8561012
@ -92,17 +92,13 @@ after_initialize do
|
|||||||
module ::AlternativePassword
|
module ::AlternativePassword
|
||||||
def confirm_password?(password)
|
def confirm_password?(password)
|
||||||
return true if super
|
return true if super
|
||||||
puts "### 1"
|
|
||||||
return false unless self.custom_fields.has_key?('import_pass')
|
return false unless self.custom_fields.has_key?('import_pass')
|
||||||
puts "### 2"
|
|
||||||
|
|
||||||
if AlternativePassword::check_all(password, self.custom_fields['import_pass'])
|
if AlternativePassword::check_all(password, self.custom_fields['import_pass'])
|
||||||
puts "### 3"
|
|
||||||
self.password = password
|
self.password = password
|
||||||
self.custom_fields.delete('import_pass')
|
self.custom_fields.delete('import_pass')
|
||||||
return save
|
return save
|
||||||
end
|
end
|
||||||
puts "### 4"
|
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -135,10 +131,8 @@ puts "### 4"
|
|||||||
|
|
||||||
def self.check_smf(password, crypted_pass)
|
def self.check_smf(password, crypted_pass)
|
||||||
user, hash = crypted_pass.split(':', 2)
|
user, hash = crypted_pass.split(':', 2)
|
||||||
puts "### #{user} hash #{hash} CP #{crypted_pass}"
|
|
||||||
sha1 = Digest::SHA1.new
|
sha1 = Digest::SHA1.new
|
||||||
sha1.update user + password
|
sha1.update user + password
|
||||||
puts "### #{sha1.hexdigest}"
|
|
||||||
hash == sha1.hexdigest
|
hash == sha1.hexdigest
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user