Skip to content

Commit

Permalink
Setting module
Browse files Browse the repository at this point in the history
  • Loading branch information
picman committed Nov 27, 2024
1 parent 5ed5c0b commit c9d0aed
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions lib/redmine_oauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,8 @@ def button_icon
end

def hide_login_form
if Setting.plugin_redmine_oauth['hide_login_form'].is_a?(TrueClass)
Setting.plugin_redmine_oauth['hide_login_form']
else
Setting.plugin_redmine_oauth['hide_login_form'].to_i.positive?
end
value = Setting.plugin_redmine_oauth['hide_login_form']
value.is_a?(TrueClass) || value.is_a?(FalseClass) ? value : value.to_i.positive?
end

def self_registration
Expand All @@ -163,27 +160,18 @@ def custom_lastname_field
end

def update_login
if Setting.plugin_redmine_oauth['update_login'].is_a?(TrueClass)
Setting.plugin_redmine_oauth['update_login']
else
Setting.plugin_redmine_oauth['update_login'].to_i.positive?
end
value = Setting.plugin_redmine_oauth['update_login']
value.is_a?(TrueClass) || value.is_a?(FalseClass) ? value : value.to_i.positive?
end

def oauth_logout
if Setting.plugin_redmine_oauth['oauth_logout'].is_a?(TrueClass)
Setting.plugin_redmine_oauth['oauth_logout']
else
Setting.plugin_redmine_oauth['oauth_logout'].to_i.positive?
end
value = Setting.plugin_redmine_oauth['oauth_logout']
value.is_a?(TrueClass) || value.is_a?(FalseClass) ? value : value.to_i.positive?
end

def oauth_login
if Setting.plugin_redmine_oauth['oauth_login'].is_a?(TrueClass)
Setting.plugin_redmine_oauth['oauth_login']
else
Setting.plugin_redmine_oauth['oauth_login'].to_i.positive?
end
value = Setting.plugin_redmine_oauth['oauth_login']
value.is_a?(TrueClass) || value.is_a?(FalseClass) ? value : value.to_i.positive?
end

def custom_logout_endpoint
Expand Down

0 comments on commit c9d0aed

Please sign in to comment.