aboutsummaryrefslogtreecommitdiff
path: root/index.cgi
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2016-10-14 08:58:29 +0200
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2016-10-14 08:58:29 +0200
commit2f84860dd300d6da024666053c5ce5149122097f (patch)
tree59be59814486a46b44c398678aa606f21f4d69b4 /index.cgi
parentaf92765798574598edc29651fa306d8b2eb67004 (diff)
bugfix: poll creation failed
Diffstat (limited to 'index.cgi')
-rwxr-xr-xindex.cgi5
1 files changed, 4 insertions, 1 deletions
diff --git a/index.cgi b/index.cgi
index 5146b0b..09af72e 100755
--- a/index.cgi
+++ b/index.cgi
@@ -51,7 +51,6 @@ if $cgi.include?("create_poll") && $cgi.include?("poll_url")
else Dir.mkdir(POLLURL)
Dir.chdir(POLLURL)
begin
- Poll.new(CGI.escapeHTML(POLLTITLE),$cgi["poll_type"])
VCS.init
File.symlink("../participate.rb","index.cgi")
VCS.add("index.cgi")
@@ -63,12 +62,16 @@ if $cgi.include?("create_poll") && $cgi.include?("poll_url")
File.open(f,"w").close
VCS.add(f)
}
+ Poll.new(CGI.escapeHTML(POLLTITLE),$cgi["poll_type"])
Dir.chdir("..")
$d.html.header["status"] = "REDIRECT"
$d.html.header["Cache-Control"] = "no-cache"
$d.html.header["Location"] = $conf.siteurl + POLLURL + "/edit_columns.cgi"
$d << _("The poll was created successfully. The link to your new poll is: %{link}") % {:link => "<br /><a href=\"#{POLLURL}\">#{POLLURL}</a>"}
rescue WrongPollTypeError # should only happen in case of hacking
+ Dir.chdir("..")
+ require "fileutils"
+ FileUtils.rm_r(POLLURL)
$d.html.header["status"] = "REDIRECT"
$d.html.header["Cache-Control"] = "no-cache"
$d.html.header["Location"] = "http://localhost/"