Password protection part of a radiant web site


#1

Hello.

Is there any working solution made available by the radiant
development/user community to password protect a part of a radiant-based
web site?

Unluckily it seems the password_protected behavior doesn’t work with
0.5.2 (see below for the error I get) :frowning:

Many thanks in advance!

Luigi

ActionController::MissingTemplate (Missing template
/usr/lib/ruby/gems/1.8/gems/radiant-0.5.2/lib/…/app/views/site/show_page.rhtml):

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:1034:in
`assert_existence_of_template_file’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:724:in
`render_file’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:648:in
`render_with_no_layout’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/layout.rb:245:in
`render_without_benchmark’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in
render' /usr/lib/ruby/1.8/benchmark.rb:293:inmeasure’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:53:in
`render’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:942:in
`perform_action_without_filters’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:368:in
`perform_action_without_benchmark’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:inmeasure’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:in
`perform_action’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in
`send’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in
`process_without_filters’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in
`process_without_session_management_support’

/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in
process' /usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:indispatch’
/opt/lsws/fcgi-bin/RailsRunner.rb:12


#2

Ruben D. Orduz wrote:

ho questo archivio “app/views/site/show_page.rhtml” in questo diretorio?

Ciao Ruben, grazie per l’aiuto! :slight_smile:

the file is effectively missing. My installation of radiant is from the
gem and not a “full” one (i.e. the app dir is not in my application root
directory).

What the show_page file is supposed to contain?

Grazie.

Luigi


#3

Luigi,

ho questo archivio “app/views/site/show_page.rhtml” in questo diretorio?


#4

Luigi R. wrote:

Ruben D. Orduz wrote:

ho questo archivio “app/views/site/show_page.rhtml” in questo diretorio?
the file is effectively missing. My installation of radiant is from the
gem and not a “full” one (i.e. the app dir is not in my application root
directory).

I created the file “app/views/site/show_page.rhtml”, and when I access
the password protected page it is simply rendered to the browser but no
authentication request is issued. I think it worth noticing I’m using
litespeed as web server to serve the radiant site.

L


#5

What I don’t get is how can he be running Radiant w/o an app folder
inside RAILS_ROOT dir? I’m still puzzled about that one. Sensa una
buona explicazione non puo fare niente.


#6

Luigi R. wrote:

Hello.

Is there any working solution made available by the radiant
development/user community to password protect a part of a radiant-based
web site?

Unluckily it seems the password_protected behavior doesn’t work with
0.5.2 (see below for the error I get) :frowning:

Probably the easiest thing to do is to setup basic authentication with
an apache .htaccess file. Would that work for you?


John L.
http://wiseheartdesign.com


#7

Ruben D. Orduz wrote:

What I don’t get is how can he be running Radiant w/o an app folder
inside RAILS_ROOT dir? I’m still puzzled about that one. Sensa una
buona explicazione non puo fare niente.

Hello Ruben.

I installed radiant from a gem, and not as an application bu as an
instance. Here is what the installation dir has inside:
http://pastie.caboo.se/32595

(Note: the show_page.rhtml file in the “app/views/site” was added today)

It seems to me the problem is with the HTTP Authentication part of the
password_protected behavior, which doesn’t seem to happen … (maybe
because of litespeed?). I’m using the latest behavior available and I
installed it as a plugin.

Thank you for you assistance.

L


#8

Many thanks for your assistance.

John W. Long wrote:

Probably the easiest thing to do is to setup basic authentication with
an apache .htaccess file. Would that work for you?

It would work but how can be, for example, the
“/official-documents/documents” page protected with .htaccess? In other
words, where should I put the .htaccess file to protect a “virtual”
radiant sub-sub-directory?

L


#9

Luigi,

Yeah .htaccess will not work under litespped or lighthttpd, so John’s
suggestion probably won’t work. And if the password protection of the
extension relies on HTTP auth, then it probably won’t work either.