trabajo-afectivo/lib/password_policy/length.rb
2022-01-01 14:38:12 +01:00

18 lines
411 B
Ruby

# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class PasswordPolicy
class Length < PasswordPolicy::Backend
def valid?
Setting.get('password_min_size').to_i <= @password.length
end
def error
[__('Invalid password, it must be at least %s characters long!'), Setting.get('password_min_size')]
end
def self.applicable?
true
end
end
end