aboutsummaryrefslogtreecommitdiff
path: root/authorization_required.cgi
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2011-02-25 09:46:58 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2011-02-25 09:46:58 +0100
commita31094910db67877ff9041fb1c3f4da58c584130 (patch)
treeb41400d13c624dd12aa69ab11db019c18d7ed50a /authorization_required.cgi
parentf597773e46be57b5e6fce1df57663c16d2c4be84 (diff)
bugfix for the googlebot
Diffstat (limited to 'authorization_required.cgi')
-rwxr-xr-xauthorization_required.cgi38
1 files changed, 22 insertions, 16 deletions
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 << "<h2>" + _("Authorization Required") + "</h2>"
+ 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 => "<code>#{$cgi["user"]}</code>"}
+
+ $d.out
- $d << "<h2>" + _("Authorization Required") + "</h2>"
- 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 => "<code>#{$cgi["user"]}</code>"}
- $d.out
else
$d = Dudle.new(:title => _("Authorization Required"), :hide_lang_chooser => true)
returnstr = _("Return to dudle home and Schedule a new Poll")