Permalink
Browse files

Merge pull request #7 from brenard/master

Added possibility to enable or disable CAS logout
  • Loading branch information...
2 parents 4a65ed7 + 1f73268 commit c9c0d6a5016dbc94a23d93b90dcae4f8964aa75b @vjt vjt committed May 3, 2012
Showing with 8 additions and 3 deletions.
  1. +4 −0 app/views/settings/_settings.html.erb
  2. +4 −3 lib/redmine_cas.rb
View
4 app/views/settings/_settings.html.erb
@@ -23,4 +23,8 @@
<%= check_box_tag 'settings[auto_update_attributes_on_login]', true, @settings[:auto_update_attributes_on_login] %><br />
<em>On each login update Redmine user attributes from CAS extra user attributes</em>
</p>
+ <p>
+ <label>Logout user in CAS</label>
+ <%= check_box_tag 'settings[cas_logout]', true, @settings[:cas_logout] %><br />
+ </p>
</fieldset>
View
7 lib/redmine_cas.rb
@@ -25,7 +25,8 @@
:cas_base_url => 'https://localhost',
:login_without_cas => false,
:auto_create_users => false,
- :auto_update_attributes_on_login => false
+ :auto_update_attributes_on_login => false,
+ :cas_logout => true
}, :partial => 'settings/settings'
end
@@ -228,7 +229,7 @@ def login_with_cas
alias_method_chain :login, :cas
def logout_with_cas
- if RedmineCas.ready?
+ if RedmineCas.ready? and RedmineCas.get_setting(:cas_logout)
CASClient::Frameworks::Rails::Filter.logout(self, home_url)
logout_user
else
@@ -242,4 +243,4 @@ def logout_with_cas
end
-end
+end

0 comments on commit c9c0d6a

Please sign in to comment.