Skip to content
Browse files

Released v2.0.6

Providing control after logging in or out as Rich-CMS admin
  • Loading branch information...
1 parent aa01887 commit 972bdd7350056266fcce08a44ded0b0c3706357b Paul Engel committed Oct 8, 2010
Showing with 29 additions and 12 deletions.
  1. +4 −0 CHANGELOG
  2. +1 −1 VERSION
  3. +21 −8 lib/app/controllers/rich/cms_controller.rb
  4. +3 −3 rich_cms.gemspec
View
4 CHANGELOG
@@ -1,5 +1,9 @@
= Rich-CMS CHANGELOG
+== Version 2.0.6 (October 8, 2010)
+
+* Providing control after logging in or out as Rich-CMS admin
+
== Version 2.0.5 (October 2, 2010)
* Using RaccoonTip v1.0.7
View
2 VERSION
@@ -1 +1 @@
-2.0.5
+2.0.6
View
29 lib/app/controllers/rich/cms_controller.rb
@@ -19,7 +19,23 @@ def login
when :authlogic
@current_rich_cms_admin_session = rich_cms_authenticated_class.new params[key = rich_cms_authenticated_class.name.underscore.gsub("/", "_")]
authenticated = @current_rich_cms_admin_session.save
+
+ after_rich_cms_login authenticated, key
+ end
+ end
+ def logout
+ case rich_cms_auth.logic
+ when :authlogic
+ (@current_rich_cms_admin_session ||= rich_cms_authenticated_class.find).destroy
+ end
+ session[:rich_cms] = nil
+
+ after_rich_cms_logout
+ end
+
+ unless ::ApplicationController.instance_methods.include?("after_rich_cms_login")
+ def after_rich_cms_login(authenticated, key)
if request.xhr?
render :update do |page|
if authenticated
@@ -30,17 +46,14 @@ def login
end
else
redirect_to request.referrer
- end
+ end
end
end
-
- def logout
- case rich_cms_auth.logic
- when :authlogic
- (@current_rich_cms_admin_session ||= rich_cms_authenticated_class.find).destroy
+
+ unless ::ApplicationController.instance_methods.include?("after_rich_cms_logout")
+ def after_rich_cms_logout
+ redirect_to request.referrer
end
- session[:rich_cms] = nil
- redirect_to request.referrer
end
def update
View
6 rich_cms.gemspec
@@ -5,11 +5,11 @@
Gem::Specification.new do |s|
s.name = %q{rich_cms}
- s.version = "2.0.5"
+ s.version = "2.0.6"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Paul Engel"]
- s.date = %q{2010-10-02}
+ s.date = %q{2010-10-08}
s.description = %q{Rich-CMS is a module of E9s (http://github.com/archan937/e9s) which provides a frontend for your CMS content. You can use this gem to manage CMS content or translations (in an internationalized application). The installation and setup process is very easily done. You will have to register content at the Rich-CMS engine and also you will have to specify the authentication mechanism. Both are one-liners.}
s.email = %q{paul.engel@holder.nl}
s.extra_rdoc_files = [
@@ -90,7 +90,7 @@ Gem::Specification.new do |s|
"test/test_helper.rb",
"uninstall.rb"
]
- s.homepage = %q{http://github.com/archan937/rich_cms}
+ s.homepage = %q{http://codehero.es/rails_gems_plugins/rich_cms}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.7}

0 comments on commit 972bdd7

Please sign in to comment.
Something went wrong with that request. Please try again.