Skip to content

Commit

Permalink
Added possibility to enable or disable CAS logout
Browse files Browse the repository at this point in the history
  • Loading branch information
brenard committed Dec 7, 2011
1 parent 7a852b8 commit 1f73268
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/views/settings/_settings.html.erb
Expand Up @@ -23,4 +23,8 @@
<%= check_box_tag 'settings[auto_update_attributes_on_login]', true, @settings[:auto_update_attributes_on_login] %><br /> <%= 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> <em>On each login update Redmine user attributes from CAS extra user attributes</em>
</p> </p>
<p>
<label>Logout user in CAS</label>
<%= check_box_tag 'settings[cas_logout]', true, @settings[:cas_logout] %><br />
</p>
</fieldset> </fieldset>
7 changes: 4 additions & 3 deletions lib/redmine_cas.rb
Expand Up @@ -25,7 +25,8 @@
:cas_base_url => 'https://localhost', :cas_base_url => 'https://localhost',
:login_without_cas => false, :login_without_cas => false,
:auto_create_users => false, :auto_create_users => false,
:auto_update_attributes_on_login => false :auto_update_attributes_on_login => false,
:cas_logout => true
}, :partial => 'settings/settings' }, :partial => 'settings/settings'


end end
Expand Down Expand Up @@ -228,7 +229,7 @@ def login_with_cas
alias_method_chain :login, :cas alias_method_chain :login, :cas


def logout_with_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) CASClient::Frameworks::Rails::Filter.logout(self, home_url)
logout_user logout_user
else else
Expand All @@ -242,4 +243,4 @@ def logout_with_cas


end end


end end

0 comments on commit 1f73268

Please sign in to comment.