Merge remote-tracking branch 'tootsuite/master' into merge-upstream

Conflicts:
      app/javascript/styles/mastodon/components.scss
This commit is contained in:
David Yip
2018-02-02 08:39:52 -06:00
30 changed files with 244 additions and 95 deletions

View File

@@ -8,7 +8,13 @@ class UnreservedUsernameValidator < ActiveModel::Validator
private
def pam_controlled?(value)
return false unless Devise.pam_authentication && Devise.pam_controlled_service
Rpam2.account(Devise.pam_controlled_service, value).present?
end
def reserved_username?(value)
return true if pam_controlled?(value)
return false unless Setting.reserved_usernames
Setting.reserved_usernames.include?(value.downcase)
end