summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2013-04-27 17:20:23 -0400
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2013-04-27 17:20:23 -0400
commit5d72e64529dbbaac8d5fef531c9720e506380791 (patch)
tree0e468f8cbd2a54171d1f65067c30a86258f9c4c9
parent350cde2324cf4bc9df6c4bcecf638b8208495b64 (diff)
Remove duplicate “Ask as” entry when asking without certs
-rw-r--r--forum/forum.ur13
1 files changed, 8 insertions, 5 deletions
diff --git a/forum/forum.ur b/forum/forum.ur
index 2dbfcb0..e742ef9 100644
--- a/forum/forum.ur
+++ b/forum/forum.ur
@@ -31,7 +31,8 @@ table question : { Id : int,
sequence questionIdS
(* Grabs real name out of MIT certificate. *)
-val getName = getenv (blessEnvVar "SSL_CLIENT_S_DN_CN")
+val getName : transaction (option string) =
+ getenv (blessEnvVar "SSL_CLIENT_S_DN_CN")
fun prettyPrintQuestion row : xbody =
<xml>
@@ -51,10 +52,12 @@ fun main () : transaction page =
<textbox {#Title} size=80 /><br />
<textarea {#Body} rows=12 cols=80 /><br />
Asking as:
- <select {#Asker}>
- <option>{[askerOpt]}</option>
- <option>Anonymous</option>
- </select>
+ <select {#Asker}>
+ {case askerOpt of
+ None => <xml/>
+ | Some nam => <xml><option>{[nam]}</option></xml>}
+ <option>Anonymous</option>
+ </select>
<submit action={ask} value="Ask" />
</form>
</div>