aboutsummaryrefslogtreecommitdiff
path: root/customize.rb
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-11-20 18:40:35 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2009-11-20 18:40:35 +0100
commit58bd120e541cb9d80a7bcf2daae8b8a97df17586 (patch)
tree1cb29c2176def01b486c693e81cf0aaa50a2e1f7 /customize.rb
parent92dd6c0911be3356d01eeba1e0a93c3b760a8f7f (diff)
implemented default username feature
Diffstat (limited to 'customize.rb')
-rwxr-xr-xcustomize.rb23
1 files changed, 17 insertions, 6 deletions
diff --git a/customize.rb b/customize.rb
index 8a9231a..bad79c1 100755
--- a/customize.rb
+++ b/customize.rb
@@ -32,10 +32,13 @@ $html.header["Cache-Control"] = "no-cache"
$html.add_css("../dudle.css")
-$html << "<body>"
-$html << Dudle::tabs("Customize")
-$html << "<div id='main'>"
-$html << "<h1>Customize Personal Settings</h1>"
+$html << <<END
+<body>
+#{Dudle::tabs("Customize")}
+<div id='main'>
+<h1>Customize Personal Settings</h1>
+You need cookies enabled in order to personalize your settings.
+END
$html << <<CHARSET
<div id='charset'>
@@ -77,13 +80,21 @@ $html << <<CHARSET
</div>
CHARSET
+
+username = $cgi.cookies["username"][0]
+if $cgi.include?("username")
+ username = $cgi["username"]
+ $html.add_cookie("username",username,"/",Time.now + 1*60*60*24*365)
+end
+
+
$html << <<CHARSET
<div id='config_user'>
<h2>Default Username</h2>
-<form method='post' action=''>
+<form method='GET' action=''>
<div>
<label for=''>Username: </label>
- <input id='' size='16' type='text' value="" name='default_username' />
+ <input id='' size='16' type='text' value="#{username}" name='username' />
<input type='submit' value='Save' />
</div>
</form>