2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2020-08-28 14:07:30 +00:00
|
|
|
class PasswordPolicy
|
|
|
|
class Length < PasswordPolicy::Backend
|
|
|
|
|
|
|
|
def valid?
|
|
|
|
Setting.get('password_min_size').to_i <= @password.length
|
|
|
|
end
|
|
|
|
|
|
|
|
def error
|
2021-11-15 15:58:19 +00:00
|
|
|
[__('Invalid password, it must be at least %s characters long!'), Setting.get('password_min_size')]
|
2020-08-28 14:07:30 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.applicable?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|