Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.prefs.special.passwords
on passwords () { <<Changes <<1/8/02; 8:42:24 PM by JES <<Commented out some debugging code. <<12/4/01; 1:51:37 PM by DW <<Changed the title of the first column to Password Name per Susan Kitchens' suggestion. <<Add checkboxes to allow deletion of passwords. local (pta = html.getpagetableaddress ()); <<scratchpad.radioparams = pta^.radioresponder local (errorstrings = {}); if pta^.method == "POST" { bundle { //first process the checkboxes local (keepers, i, adr, name); new (tabletype, @keepers); for i = sizeof (pta^.radioresponder.postargs) downto 1 { adr = @pta^.radioresponder.postargs [i]; if nameof (adr^) beginswith "cb/" { name = string.delete (nameof (adr^), 1, 3); keepers.[name] = user.radio.prefs.passwords.[name]; delete (adr)}}; user.radio.prefs.passwords = keepers}; bundle { //set the passwords for those that match local (adr, name, adrpassword); for adr in @pta^.radioresponder.postargs { name = nameof (adr^); adrpassword = @user.radio.prefs.passwords.[name]; if not (name contains ".") { local (adrrepeat = @pta^.radioresponder.postargs.[name + ".repeat"]); if adr^ == adrrepeat^ { //they match if defined (adrpassword^) { adrpassword^ = binary (adr^); errorstrings = errorstrings + {""}}} else { if defined (adrpassword^) { errorstrings = errorstrings + {"<font color=\"red\">Sorry, they don't match.</font>"}}}}}}}; local (htmltext = "", indentlevel = 0); on add (s) { htmltext = htmltext + string.filledstring ("\t", indentlevel) + s + "\r\n"}; add ("<table cellspacing=\"0\" cellpadding=\"5\">"); indentlevel++; add ("<tr><td> </td><td><b>Password Name</b> </td><td><b>Value</b></td><td><b>Repeat</b></td></tr>"); local (adr, input1, inputrepeat, ix = 1, es, checkbox); for adr in @user.radio.prefs.passwords { checkbox = "<input type=\"checkbox\" name=\"cb/" + nameof (adr^) + "\" value=xxx checked>"; input1 = "<input type=\"password\" name=\"" + nameof (adr^) + "\" size=\"20\" maxlength=\"100\" value=\"" + string (adr^) + "\">"; inputrepeat = "<input type=\"password\" name=\"" + nameof (adr^) + ".repeat\" size=\"20\" maxlength=\"100\" value=\"" + string (adr^) + "\">"; if ix <= sizeof (errorstrings) { es = errorstrings [ix++]} else { es = ""}; add ("<tr><td>" + checkbox + "</td><td>" + nameof (adr^) + ": </td><td>" + input1 + "</td><td>" + inputrepeat + "</td><td>" + es + "</td></tr>")}; add ("</table>"); indentlevel--; return (htmltext)}
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.