Merge pull request #2080 from Xenograph/fix-sso-override

Username/email change should not be allowed with SSO and username/email override enabled
This commit is contained in:
Sam 2014-03-10 10:32:08 +11:00
commit cbf269fdbf
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)