From a31094910db67877ff9041fb1c3f4da58c584130 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Fri, 25 Feb 2011 09:46:58 +0100 Subject: bugfix for the googlebot --- authorization_required.cgi | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'authorization_required.cgi') diff --git a/authorization_required.cgi b/authorization_required.cgi index d8ed581..c79926c 100755 --- a/authorization_required.cgi +++ b/authorization_required.cgi @@ -22,27 +22,33 @@ require "dudle" if $cgi.include?("poll") + if File.directory?($cgi["poll"]) + Dir.chdir($cgi["poll"]) + $is_poll = true - Dir.chdir($cgi["poll"]) - $is_poll = true + # check for trailing slash + if ENV["REDIRECT_URL"] =~ /#{$cgi["poll"]}$/ + $d = Dudle.new(:hide_lang_chooser => true, :relative_dir => "#{$cgi["poll"]}/") + else + $d = Dudle.new(:hide_lang_chooser => true) + end - # check for trailing slash - if ENV["REDIRECT_URL"] =~ /#{$cgi["poll"]}$/ - $d = Dudle.new(:hide_lang_chooser => true, :relative_dir => "#{$cgi["poll"]}/") - else - $d = Dudle.new(:hide_lang_chooser => true) - end + $d << "

" + _("Authorization Required") + "

" + case $cgi["user"] + when "admin" + $d << _("The configuration of this Poll is protected by password!") + when "participant" + $d << _("This Poll is protected by password!") + end + $d << _("In order to proceed, you have to give the password for user %{user}.") % {:user => "#{$cgi["user"]}"} + + $d.out - $d << "

" + _("Authorization Required") + "

" - case $cgi["user"] - when "admin" - $d << _("The configuration of this Poll is protected by password!") - when "participant" - $d << _("This Poll is protected by password!") + else + $cgi = CGI.new + $cgi.out({"status" => "BAD_REQUEST"}){""} end - $d << _("In order to proceed, you have to give the password for user %{user}.") % {:user => "#{$cgi["user"]}"} - $d.out else $d = Dudle.new(:title => _("Authorization Required"), :hide_lang_chooser => true) returnstr = _("Return to dudle home and Schedule a new Poll") -- cgit v1.2.3