diff options
-rw-r--r-- | config_sample.rb | 15 | ||||
-rwxr-xr-x | index.cgi | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/config_sample.rb b/config_sample.rb index 5497f47..aac1ff8 100644 --- a/config_sample.rb +++ b/config_sample.rb @@ -23,8 +23,19 @@ # Warning: git needs git >=1.6.5 require "git" -# Change this if the url is not determined correctly -SITEURL = "http://#{$cgi.server_name}#{$cgi.script_name.gsub(/[^\/]*$/,"")}" +# Change the SITEURL if the url is not determined correctly +case $cgi.server_port +when 80 + protocol = "http" + port = "" +when 443 + protocol = "https" + port = "" +else + protocol = "http" + port = ":#{$cgi.server_port}" +end +SITEURL = "#{protocol}://#{$cgi.server_name}#{port}#{$cgi.script_name.gsub(/[^\/]*$/,"")}" # If you want to encourage the user to send bug reports, state the errorlog, # which you have configured in your apache conf with the ErrorLog directive. @@ -70,7 +70,7 @@ if $cgi.include?("create_poll") && $cgi.include?("poll_url") Dir.chdir("..") $d.html.header["status"] = "REDIRECT" $d.html.header["Cache-Control"] = "no-cache" - $d.html.header["Location"] = SITEURL + POLLURL+ "/edit_columns.cgi" + $d.html.header["Location"] = 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>"} end end |