Disabled editing of SSO overridden fields

This commit is contained in:
Douglas Browne 2014-03-08 01:16:49 -05:00
parent 4efabef8f2
commit 23d7b17f1a
1 changed files with 2 additions and 0 deletions

View File

@ -6,12 +6,14 @@ module UserGuardian
end
def can_edit_username?(user)
return false if (SiteSetting.sso_overrides_username? && SiteSetting.enable_sso?)
return true if is_staff?
return false if SiteSetting.username_change_period <= 0
is_me?(user) && (user.post_count == 0 || user.created_at > SiteSetting.username_change_period.days.ago)
end
def can_edit_email?(user)
return false if (SiteSetting.sso_overrides_email? && SiteSetting.enable_sso?)
return true if is_staff?
return false unless SiteSetting.email_editable?
can_edit?(user)