aboutsummaryrefslogtreecommitdiff
path: root/index.cgi
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-11-25 10:08:22 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-11-25 10:08:22 +0100
commitd172b56e183ab13b83604ce60f5c13694d2221aa (patch)
tree15caa38977c017867a34c7cb2a960856b6954081 /index.cgi
parenta885e4d8b3842709c71e077ea991342c7f4aa814 (diff)
use pwgen to generate address if not given
Diffstat (limited to 'index.cgi')
-rwxr-xr-xindex.cgi14
1 files changed, 10 insertions, 4 deletions
diff --git a/index.cgi b/index.cgi
index 79d9e6b..4af4546 100755
--- a/index.cgi
+++ b/index.cgi
@@ -45,11 +45,17 @@ $htlm.add_atom("atom.cgi") if File.exists?("atom.cgi")
if $cgi.include?("create_poll") && $cgi.include?("poll_url")
POLLNAME=$cgi["create_poll"]
- POLLURL=$cgi["poll_url"]
+ if $cgi["poll_url"] == ""
+ POLLURL = `pwgen -1`.chomp
+ else
+ POLLURL=$cgi["poll_url"]
+ end
+
+
if !(POLLURL =~ /^[\w\-_]*$/)
- createnotice = "Custom alias may only contain letters, numbers, and dashes."
+ createnotice = "Custom address may only contain letters, numbers, and dashes."
elsif File.exist?(POLLURL)
- createnotice = "A Poll with this alias already exists."
+ createnotice = "A Poll with this address already exists."
else Dir.mkdir(POLLURL)
Dir.chdir(POLLURL)
VCS.init
@@ -99,7 +105,7 @@ unless $html.header["status"] == "REDIRECT"
<td style='padding-bottom:0.7ex'><input type='submit' value='create' /></td>
</tr>
<tr>
- <td colspan='2' style='border-top:solid thin;padding-top:0.7ex;'>Custom alias (optional):
+ <td colspan='2' style='border-top:solid thin;padding-top:0.7ex;'>Custom address (optional):
<span class='hint'>May contain letters, numbers, and dashes.</span></td>
</tr>
<tr>