[Radiant] authentication state and shared_layout question

2009-10-30 Thread qutic development
Hopefully someone can help me with this:

I am developing a visitor extension with signup, login, logout using  
restful_authentication plugin and the shared_layout extension to use  
radiant layout with my own controllers. This works all fine.

Now I need a radiant tag rendering 'login, signup' if the visitor is  
not logged in and 'logout' if the visitor is logged in.

The problem is that I do not have access to the session in the tag  
helper... For normal radiant pages I use this in my visitor_extension.rb

def activate
   Page.class_eval do
 attr_accessor :visitor_logged_in
   end
   SiteController.class_eval do
 include AuthenticatedSystem # for visitor authentication
 after_filter :store_location # for 'redirect_back_or_default'  
method
 def show_page
   ...some code before
   @page.visitor_logged_in = visitor_logged_in?
   ...some code after
 end
   end
end

Now I can access page.visitor_logged_in in the tag helper - but not  
for my own controllers.

Is there a way to get the session data in the tag helper? If not: how  
can I add this to the shared_layout extension?

I am using no cache ;-) And don´t want to use JavaScript!

Thanks a lot
jerry
___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant


Re: [Radiant] authentication state and shared_layout question (solved)

2009-10-30 Thread qutic development
Maybe some is interested in the solution of my problem:

I am using a cattr_accessor (class) instead of a attr_accessor  
(instance) - that´s it ;-)

___
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant