summaryrefslogtreecommitdiff
path: root/web/cgi
diff options
context:
space:
mode:
Diffstat (limited to 'web/cgi')
-rw-r--r--web/cgi/.htaccess32
l---------web/cgi/alpine.tcl1
-rwxr-xr-xweb/cgi/alpine/1.0/addrbook.tcl583
-rwxr-xr-xweb/cgi/alpine/1.0/addredit.tcl224
-rwxr-xr-xweb/cgi/alpine/1.0/addrpick.tcl134
-rwxr-xr-xweb/cgi/alpine/1.0/addrsave.tcl244
l---------web/cgi/alpine/1.0/alpine.tcl1
-rwxr-xr-xweb/cgi/alpine/1.0/attach.tcl96
-rwxr-xr-xweb/cgi/alpine/1.0/cledit.tcl232
-rwxr-xr-xweb/cgi/alpine/1.0/cmdfunc.tcl639
-rwxr-xr-xweb/cgi/alpine/1.0/common.tcl289
-rwxr-xr-xweb/cgi/alpine/1.0/compose.tcl804
-rwxr-xr-xweb/cgi/alpine/1.0/comview.tcl184
-rwxr-xr-xweb/cgi/alpine/1.0/conf_process.tcl1358
-rwxr-xr-xweb/cgi/alpine/1.0/detach.tcl183
-rw-r--r--web/cgi/alpine/1.0/do_help.tcl48
-rwxr-xr-xweb/cgi/alpine/1.0/do_open.tcl126
-rwxr-xr-xweb/cgi/alpine/1.0/do_quit.tcl98
-rwxr-xr-xweb/cgi/alpine/1.0/do_view.tcl190
-rwxr-xr-xweb/cgi/alpine/1.0/docancel.tcl56
-rwxr-xr-xweb/cgi/alpine/1.0/dosend.tcl99
-rwxr-xr-xweb/cgi/alpine/1.0/export.tcl165
-rw-r--r--web/cgi/alpine/1.0/exporting.tcl187
-rwxr-xr-xweb/cgi/alpine/1.0/filtedit.tcl704
-rwxr-xr-xweb/cgi/alpine/1.0/filter.tcl63
-rwxr-xr-xweb/cgi/alpine/1.0/flags.tcl112
-rwxr-xr-xweb/cgi/alpine/1.0/fldrbrowse.tcl335
-rwxr-xr-xweb/cgi/alpine/1.0/fldrsavenew.tcl202
-rwxr-xr-xweb/cgi/alpine/1.0/folders.tcl727
-rwxr-xr-xweb/cgi/alpine/1.0/fr_addrbrowse.tcl66
-rw-r--r--web/cgi/alpine/1.0/fr_addredit.tcl86
-rwxr-xr-xweb/cgi/alpine/1.0/fr_cledit.tcl79
-rwxr-xr-xweb/cgi/alpine/1.0/fr_compose.tcl144
-rwxr-xr-xweb/cgi/alpine/1.0/fr_filtedit.tcl136
-rwxr-xr-xweb/cgi/alpine/1.0/fr_flags.tcl67
-rw-r--r--web/cgi/alpine/1.0/fr_fldrbrowse.tcl71
-rw-r--r--web/cgi/alpine/1.0/fr_fldrsavenew.tcl65
-rwxr-xr-xweb/cgi/alpine/1.0/fr_help.tcl91
-rwxr-xr-xweb/cgi/alpine/1.0/fr_index.tcl58
-rwxr-xr-xweb/cgi/alpine/1.0/fr_ldapbrowse.tcl61
-rw-r--r--web/cgi/alpine/1.0/fr_ldapquery.tcl75
-rwxr-xr-xweb/cgi/alpine/1.0/fr_main.tcl34
-rwxr-xr-xweb/cgi/alpine/1.0/fr_promptsave.tcl68
-rwxr-xr-xweb/cgi/alpine/1.0/fr_queryattach.tcl70
-rwxr-xr-xweb/cgi/alpine/1.0/fr_queryauth.tcl71
-rwxr-xr-xweb/cgi/alpine/1.0/fr_querycreate.tcl42
-rwxr-xr-xweb/cgi/alpine/1.0/fr_querydelfldr.tcl43
-rwxr-xr-xweb/cgi/alpine/1.0/fr_queryexpunge.tcl71
-rw-r--r--web/cgi/alpine/1.0/fr_queryimport.tcl44
-rwxr-xr-xweb/cgi/alpine/1.0/fr_querynewdir.tcl43
-rwxr-xr-xweb/cgi/alpine/1.0/fr_querynewfldr.tcl43
-rwxr-xr-xweb/cgi/alpine/1.0/fr_querynewfoldir.tcl43
-rw-r--r--web/cgi/alpine/1.0/fr_queryprune.tcl66
-rw-r--r--web/cgi/alpine/1.0/fr_queryquit.tcl70
-rwxr-xr-xweb/cgi/alpine/1.0/fr_queryrenfldr.tcl43
-rwxr-xr-xweb/cgi/alpine/1.0/fr_querysave.tcl68
-rwxr-xr-xweb/cgi/alpine/1.0/fr_resume.tcl104
-rwxr-xr-xweb/cgi/alpine/1.0/fr_seldate.tcl70
-rwxr-xr-xweb/cgi/alpine/1.0/fr_select.tcl71
-rwxr-xr-xweb/cgi/alpine/1.0/fr_selstat.tcl71
-rwxr-xr-xweb/cgi/alpine/1.0/fr_seltext.tcl71
-rwxr-xr-xweb/cgi/alpine/1.0/fr_spellcheck.tcl71
-rw-r--r--web/cgi/alpine/1.0/fr_split.tcl58
-rw-r--r--web/cgi/alpine/1.0/fr_take.tcl70
-rw-r--r--web/cgi/alpine/1.0/fr_takeedit.tcl79
-rw-r--r--web/cgi/alpine/1.0/fr_takesame.tcl79
-rwxr-xr-xweb/cgi/alpine/1.0/fr_tconfig.tcl69
-rwxr-xr-xweb/cgi/alpine/1.0/fr_view.tcl30
-rwxr-xr-xweb/cgi/alpine/1.0/genvars.tcl114
-rwxr-xr-xweb/cgi/alpine/1.0/header.tcl226
-rwxr-xr-xweb/cgi/alpine/1.0/help.tcl36
-rw-r--r--web/cgi/alpine/1.0/help/about.tcl30
-rw-r--r--web/cgi/alpine/1.0/help/addrbook.html61
-rw-r--r--web/cgi/alpine/1.0/help/addrbrowse.html27
-rw-r--r--web/cgi/alpine/1.0/help/addredit.html59
-rw-r--r--web/cgi/alpine/1.0/help/attach.html37
-rw-r--r--web/cgi/alpine/1.0/help/compose.html147
-rw-r--r--web/cgi/alpine/1.0/help/create_save.tcl17
-rw-r--r--web/cgi/alpine/1.0/help/expunge.html20
-rw-r--r--web/cgi/alpine/1.0/help/filtconf.html62
-rw-r--r--web/cgi/alpine/1.0/help/filtedit.html240
-rw-r--r--web/cgi/alpine/1.0/help/folders.html39
-rw-r--r--web/cgi/alpine/1.0/help/foldiradd.html30
-rw-r--r--web/cgi/alpine/1.0/help/forward.tcl16
-rw-r--r--web/cgi/alpine/1.0/help/index.html281
-rw-r--r--web/cgi/alpine/1.0/help/index.tcl.1301
-rw-r--r--web/cgi/alpine/1.0/help/release.html83
-rw-r--r--web/cgi/alpine/1.0/help/reply.tcl17
-rw-r--r--web/cgi/alpine/1.0/help/resume.html28
-rw-r--r--web/cgi/alpine/1.0/help/secure.html119
-rw-r--r--web/cgi/alpine/1.0/help/takeaddr.html34
-rw-r--r--web/cgi/alpine/1.0/help/takeedit.html63
-rw-r--r--web/cgi/alpine/1.0/help/tech-notes.html471
-rw-r--r--web/cgi/alpine/1.0/help/view.html195
-rw-r--r--web/cgi/alpine/1.0/help/wpsys.jpegbin0 -> 17284 bytes
-rwxr-xr-xweb/cgi/alpine/1.0/helpbody.tcl200
-rwxr-xr-xweb/cgi/alpine/1.0/helpindex.tcl102
-rwxr-xr-xweb/cgi/alpine/1.0/index.tcl1972
-rwxr-xr-xweb/cgi/alpine/1.0/ldapbrowse.tcl220
-rwxr-xr-xweb/cgi/alpine/1.0/ldapentry.tcl315
-rwxr-xr-xweb/cgi/alpine/1.0/ldappick.tcl76
-rwxr-xr-xweb/cgi/alpine/1.0/ldapquery.tcl144
-rwxr-xr-xweb/cgi/alpine/1.0/ldapresult.tcl375
-rwxr-xr-xweb/cgi/alpine/1.0/main.tcl84
-rwxr-xr-xweb/cgi/alpine/1.0/open.tcl33
-rwxr-xr-xweb/cgi/alpine/1.0/post.tcl651
-rwxr-xr-xweb/cgi/alpine/1.0/promptsave.tcl149
-rwxr-xr-xweb/cgi/alpine/1.0/prune.tcl74
-rwxr-xr-xweb/cgi/alpine/1.0/queryattach.tcl145
-rwxr-xr-xweb/cgi/alpine/1.0/querycreate.tcl114
-rwxr-xr-xweb/cgi/alpine/1.0/querydelfldr.tcl121
-rwxr-xr-xweb/cgi/alpine/1.0/queryexpunge.tcl203
-rwxr-xr-xweb/cgi/alpine/1.0/queryimport.tcl146
-rwxr-xr-xweb/cgi/alpine/1.0/querynewdir.tcl113
-rwxr-xr-xweb/cgi/alpine/1.0/querynewfldr.tcl112
-rwxr-xr-xweb/cgi/alpine/1.0/querynewfoldir.tcl131
-rwxr-xr-xweb/cgi/alpine/1.0/querynick.tcl171
-rwxr-xr-xweb/cgi/alpine/1.0/queryprune.tcl170
-rwxr-xr-xweb/cgi/alpine/1.0/queryquit.tcl196
-rwxr-xr-xweb/cgi/alpine/1.0/queryrenfldr.tcl109
-rwxr-xr-xweb/cgi/alpine/1.0/querysave.tcl98
-rwxr-xr-xweb/cgi/alpine/1.0/resume.tcl169
-rwxr-xr-xweb/cgi/alpine/1.0/ripcord.tcl64
-rwxr-xr-xweb/cgi/alpine/1.0/seldate.tcl193
-rwxr-xr-xweb/cgi/alpine/1.0/select.tcl303
-rwxr-xr-xweb/cgi/alpine/1.0/select2.tcl318
-rwxr-xr-xweb/cgi/alpine/1.0/selstat.tcl156
-rwxr-xr-xweb/cgi/alpine/1.0/seltext.tcl181
-rwxr-xr-xweb/cgi/alpine/1.0/spellcheck.tcl399
-rwxr-xr-xweb/cgi/alpine/1.0/takeaddr.tcl215
l---------web/cgi/alpine/1.0/tclsh1
-rwxr-xr-xweb/cgi/alpine/1.0/tconfig.tcl1183
-rwxr-xr-xweb/cgi/alpine/1.0/view.tcl920
-rwxr-xr-xweb/cgi/alpine/1.0/wp.tcl135
-rw-r--r--web/cgi/alpine/2.0/.htaccess7
l---------web/cgi/alpine/2.0/alpine.tcl1
-rwxr-xr-xweb/cgi/alpine/2.0/browse336
-rw-r--r--web/cgi/alpine/2.0/common.tcl905
-rwxr-xr-xweb/cgi/alpine/2.0/compose817
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/apply.tcl76
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/attach.tcl101
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/cert.tcl48
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/complete.tcl54
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/contactlist.tcl306
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/empty.tcl73
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/exists.tcl65
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/expand.tcl84
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/export168
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/flag.tcl77
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/folderlist.tcl255
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/getcontact.tcl53
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/import73
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/mark.tcl77
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/newmail.tcl56
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/post.tcl333
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/query.tcl83
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/settings.tcl184
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/storecontact.tcl67
-rwxr-xr-xweb/cgi/alpine/2.0/conduit/take.tcl84
l---------web/cgi/alpine/2.0/conduit/tclsh1
-rwxr-xr-xweb/cgi/alpine/2.0/contacts201
-rw-r--r--web/cgi/alpine/2.0/css/cbn/contactdialog.css108
-rw-r--r--web/cgi/alpine/2.0/css/cbn/contacts.css87
-rw-r--r--web/cgi/alpine/2.0/css/cbn/folderdialog.css96
-rw-r--r--web/cgi/alpine/2.0/css/cbn/folders.css99
-rw-r--r--web/cgi/alpine/2.0/css/cbn/screen.css2084
-rw-r--r--web/cgi/alpine/2.0/css/help.css119
-rw-r--r--web/cgi/alpine/2.0/css/help_popup.css114
-rw-r--r--web/cgi/alpine/2.0/css/menu.css71
-rw-r--r--web/cgi/alpine/2.0/css/print.css0
-rwxr-xr-xweb/cgi/alpine/2.0/detach172
-rw-r--r--web/cgi/alpine/2.0/foldercache.tcl177
-rwxr-xr-xweb/cgi/alpine/2.0/folders240
l---------web/cgi/alpine/2.0/forward1
-rw-r--r--web/cgi/alpine/2.0/help/alpha-index.html225
-rw-r--r--web/cgi/alpine/2.0/help/compose.html102
-rw-r--r--web/cgi/alpine/2.0/help/contacts.html80
-rw-r--r--web/cgi/alpine/2.0/help/folders.html96
-rw-r--r--web/cgi/alpine/2.0/help/graphics/attach_sm.gifbin0 -> 235 bytes
-rw-r--r--web/cgi/alpine/2.0/help/graphics/compose.gifbin0 -> 14390 bytes
-rw-r--r--web/cgi/alpine/2.0/help/graphics/fwd.gifbin0 -> 202 bytes
-rw-r--r--web/cgi/alpine/2.0/help/graphics/new.gifbin0 -> 236 bytes
-rw-r--r--web/cgi/alpine/2.0/help/graphics/parts.gifbin0 -> 19744 bytes
-rw-r--r--web/cgi/alpine/2.0/help/graphics/replied.gifbin0 -> 207 bytes
-rw-r--r--web/cgi/alpine/2.0/help/graphics/replied_and_fwd.gifbin0 -> 216 bytes
-rw-r--r--web/cgi/alpine/2.0/help/graphics/screen-header.gifbin0 -> 8054 bytes
-rw-r--r--web/cgi/alpine/2.0/help/graphics/star.gifbin0 -> 573 bytes
-rw-r--r--web/cgi/alpine/2.0/help/help_home.htm46
-rw-r--r--web/cgi/alpine/2.0/help/help_index.htm67
-rw-r--r--web/cgi/alpine/2.0/help/help_settings.htm66
-rw-r--r--web/cgi/alpine/2.0/help/inbox.html145
-rw-r--r--web/cgi/alpine/2.0/help/popup/_notes/dwsync.xml4
-rw-r--r--web/cgi/alpine/2.0/help/popup/help_set_display.htm36
-rw-r--r--web/cgi/alpine/2.0/help/quick-start.html136
-rw-r--r--web/cgi/alpine/2.0/help/read.html145
-rw-r--r--web/cgi/alpine/2.0/help/search.html77
-rw-r--r--web/cgi/alpine/2.0/help/settings.html124
-rw-r--r--web/cgi/alpine/2.0/help/topic-list.html101
-rw-r--r--web/cgi/alpine/2.0/img/cbn/Thumbs.dbbin0 -> 147456 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/_notes/dwsync.xml91
-rw-r--r--web/cgi/alpine/2.0/img/cbn/addcontact_sm.gifbin0 -> 1000 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/addfolder.gifbin0 -> 384 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/alert.gifbin0 -> 2139 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/alpinelogo.gifbin0 -> 2306 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/attach.gifbin0 -> 248 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/attach_sm.gifbin0 -> 235 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/base.gifbin0 -> 372 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/blank.gifbin0 -> 43 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/border-bl.gifbin0 -> 813 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/border-br.gifbin0 -> 812 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/border-ft.gifbin0 -> 815 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/border-lt-2.gifbin0 -> 959 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/border-lt.gifbin0 -> 426 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/border-rt-2.gifbin0 -> 961 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/border-rt.gifbin0 -> 426 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/border-tl.gifbin0 -> 295 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/border-tr.gifbin0 -> 295 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/btnbg.gifbin0 -> 283 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/btnhi.gifbin0 -> 283 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/but_back.gifbin0 -> 151 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/ccme.gifbin0 -> 112 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/check2.gifbin0 -> 1151 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/checkmail.gifbin0 -> 1249 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/close.gifbin0 -> 177 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/close2.gifbin0 -> 1013 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/close3.gifbin0 -> 958 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/col.gifbin0 -> 95 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/colsel.gifbin0 -> 146 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/compose.gifbin0 -> 642 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/contacts.gifbin0 -> 1071 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/dawg.gifbin0 -> 377 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/dbar.gifbin0 -> 825 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/delete.gifbin0 -> 256 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/detach.gifbin0 -> 417 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/div.gifbin0 -> 45 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/div2.gifbin0 -> 45 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/dn.gifbin0 -> 59 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/edit.gifbin0 -> 564 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/exclaim.gifbin0 -> 90 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/f_contacts.gifbin0 -> 1046 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/f_delete.gifbin0 -> 244 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/f_drafts.gifbin0 -> 349 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/f_folder.gifbin0 -> 212 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/f_inbox.gifbin0 -> 237 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/f_manage.gifbin0 -> 241 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/f_minus.gifbin0 -> 201 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/f_plus.gifbin0 -> 204 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/f_search.gifbin0 -> 242 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/f_sent.gifbin0 -> 348 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/f_spam.gifbin0 -> 364 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/fldsel.gifbin0 -> 149 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/folder.gifbin0 -> 372 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/folderopen.gifbin0 -> 376 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/foldersopen.gifbin0 -> 400 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/forward.gifbin0 -> 652 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/fwd.gifbin0 -> 202 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/group_contact.gifbin0 -> 1121 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/help.gifbin0 -> 1037 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/help_sm.gifbin0 -> 631 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/high.gifbin0 -> 906 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/highest.gifbin0 -> 938 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/inbox.gifbin0 -> 1169 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/info.gifbin0 -> 111 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/infomsg.gifbin0 -> 1044 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/lo.gifbin0 -> 150 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/logo.gifbin0 -> 4117 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/logo.pngbin0 -> 9271 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/logoff.gifbin0 -> 1092 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/lookup.gifbin0 -> 413 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/low.gifbin0 -> 99 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/menu.gifbin0 -> 81 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/msglist.gifbin0 -> 413 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/msglist.gif.bakbin0 -> 413 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/musicfolder.gifbin0 -> 633 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/navbg.gifbin0 -> 283 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/new.gifbin0 -> 236 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/page.gifbin0 -> 582 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/parent.gifbin0 -> 374 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/partly.gifbin0 -> 371 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/pg_down.gifbin0 -> 133 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/pg_first.gifbin0 -> 213 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/pg_last.gifbin0 -> 217 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/pg_next.gifbin0 -> 144 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/pg_prev.gifbin0 -> 139 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/pg_up.gifbin0 -> 136 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/print.gifbin0 -> 252 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/question.gifbin0 -> 1538 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/question.jpgbin0 -> 1278 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/question.pngbin0 -> 3304 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/question2.jpgbin0 -> 1599 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/remove.gifbin0 -> 1031 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/rename.gifbin0 -> 161 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/replied.gifbin0 -> 207 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/replied_and_fwd.gifbin0 -> 216 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/reply.gifbin0 -> 669 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/replyall.gifbin0 -> 671 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/return.gifbin0 -> 75 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/rt.gifbin0 -> 71 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/save.gifbin0 -> 259 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/search.gifbin0 -> 718 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/send.gifbin0 -> 407 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/settings.gifbin0 -> 996 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/sound.gifbin0 -> 1014 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/spam.gifbin0 -> 623 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/spam2.gifbin0 -> 1426 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/spell.gifbin0 -> 166 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/spritelib.gifbin0 -> 10907 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/spritelib.pngbin0 -> 24911 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/star.gifbin0 -> 573 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/starred.gifbin0 -> 541 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/statbak.gifbin0 -> 145 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/statbakend.gifbin0 -> 89 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/statbakl.gifbin0 -> 93 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/statbakr.gifbin0 -> 93 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/sunny.gifbin0 -> 360 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/tome.gifbin0 -> 122 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/trans.gifbin0 -> 55 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/up.gifbin0 -> 59 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/uw.gifbin0 -> 1569 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/uwlogo.gifbin0 -> 2458 bytes
-rw-r--r--web/cgi/alpine/2.0/img/cbn/wbar.gifbin0 -> 94 bytes
-rw-r--r--web/cgi/alpine/2.0/lib/INSTALL3
-rw-r--r--web/cgi/alpine/2.0/lib/common.js1586
-rw-r--r--web/cgi/alpine/2.0/lib/compose.js833
-rw-r--r--web/cgi/alpine/2.0/lib/contacts.js121
-rw-r--r--web/cgi/alpine/2.0/lib/folders.js258
-rw-r--r--web/cgi/alpine/2.0/lib/mailbox.js1076
-rw-r--r--web/cgi/alpine/2.0/lib/settings.js183
l---------web/cgi/alpine/2.0/lib/yui1
l---------web/cgi/alpine/2.0/mailto1
-rw-r--r--web/cgi/alpine/2.0/messagelist.tcl622
-rw-r--r--web/cgi/alpine/2.0/messageview.tcl731
-rwxr-xr-xweb/cgi/alpine/2.0/newlist.tcl477
-rwxr-xr-xweb/cgi/alpine/2.0/newview.tcl306
l---------web/cgi/alpine/2.0/reply1
l---------web/cgi/alpine/2.0/replyall1
l---------web/cgi/alpine/2.0/resume1
-rwxr-xr-xweb/cgi/alpine/2.0/settings734
l---------web/cgi/alpine/2.0/tclsh1
-rwxr-xr-xweb/cgi/alpine/2.0/view237
l---------web/cgi/alpine/alpine.tcl1
-rwxr-xr-xweb/cgi/alpine/farewell.tcl40
l---------web/cgi/alpine/tclsh1
-rwxr-xr-xweb/cgi/alpine/whackatch.tcl46
l---------web/cgi/detach1
-rwxr-xr-xweb/cgi/favicon.icobin0 -> 5694 bytes
-rwxr-xr-xweb/cgi/greeting.tcl21
-rw-r--r--web/cgi/images/Lavender_Chiffon.gifbin0 -> 2578 bytes
-rw-r--r--web/cgi/images/b_minus.gifbin0 -> 64 bytes
-rw-r--r--web/cgi/images/b_plus.gifbin0 -> 81 bytes
-rw-r--r--web/cgi/images/barblank.gifbin0 -> 57 bytes
-rw-r--r--web/cgi/images/barclose.gifbin0 -> 96 bytes
-rw-r--r--web/cgi/images/barclose_mid.gifbin0 -> 65 bytes
-rw-r--r--web/cgi/images/barmsg.gifbin0 -> 71 bytes
-rw-r--r--web/cgi/images/baropen.gifbin0 -> 91 bytes
-rw-r--r--web/cgi/images/baropen_mid.gifbin0 -> 65 bytes
-rw-r--r--web/cgi/images/barvert.gifbin0 -> 73 bytes
-rw-r--r--web/cgi/images/barvertmsg.gifbin0 -> 76 bytes
-rw-r--r--web/cgi/images/bg_index.gifbin0 -> 46 bytes
-rw-r--r--web/cgi/images/blackdot.gifbin0 -> 35 bytes
-rw-r--r--web/cgi/images/book.gifbin0 -> 279 bytes
-rw-r--r--web/cgi/images/but_abook.gifbin0 -> 265 bytes
-rw-r--r--web/cgi/images/but_cancel.gifbin0 -> 213 bytes
-rw-r--r--web/cgi/images/but_create.gifbin0 -> 211 bytes
-rw-r--r--web/cgi/images/but_folddel.gifbin0 -> 269 bytes
-rw-r--r--web/cgi/images/but_foldexp.gifbin0 -> 279 bytes
-rw-r--r--web/cgi/images/but_foldren.gifbin0 -> 302 bytes
-rw-r--r--web/cgi/images/but_remove.gifbin0 -> 145 bytes
-rw-r--r--web/cgi/images/but_resume.gifbin0 -> 218 bytes
-rw-r--r--web/cgi/images/but_rnd_block.gifbin0 -> 2067 bytes
-rw-r--r--web/cgi/images/but_rnd_first3.gifbin0 -> 911 bytes
-rw-r--r--web/cgi/images/but_rnd_last3.gifbin0 -> 905 bytes
-rw-r--r--web/cgi/images/but_rnd_next3.gifbin0 -> 908 bytes
-rw-r--r--web/cgi/images/but_rnd_prev3.gifbin0 -> 923 bytes
-rw-r--r--web/cgi/images/but_s_do.gifbin0 -> 158 bytes
-rw-r--r--web/cgi/images/but_save.gifbin0 -> 197 bytes
-rw-r--r--web/cgi/images/buttons/silver/allmsgs.gifbin0 -> 2882 bytes
-rw-r--r--web/cgi/images/buttons/silver/attach.gifbin0 -> 2805 bytes
-rw-r--r--web/cgi/images/buttons/silver/cancel.gifbin0 -> 2807 bytes
-rw-r--r--web/cgi/images/buttons/silver/compose.gifbin0 -> 2893 bytes
-rw-r--r--web/cgi/images/buttons/silver/compose8.gifbin0 -> 680 bytes
-rw-r--r--web/cgi/images/buttons/silver/config.gifbin0 -> 2889 bytes
-rw-r--r--web/cgi/images/buttons/silver/delete.gifbin0 -> 2807 bytes
-rw-r--r--web/cgi/images/buttons/silver/delete2.gifbin0 -> 2076 bytes
-rw-r--r--web/cgi/images/buttons/silver/done.gifbin0 -> 2722 bytes
-rw-r--r--web/cgi/images/buttons/silver/exit.gifbin0 -> 2896 bytes
-rw-r--r--web/cgi/images/buttons/silver/expunge.gifbin0 -> 2863 bytes
-rw-r--r--web/cgi/images/buttons/silver/firstpage.gifbin0 -> 2575 bytes
-rw-r--r--web/cgi/images/buttons/silver/firstpage2.gifbin0 -> 1706 bytes
-rw-r--r--web/cgi/images/buttons/silver/firstpage4.gifbin0 -> 1703 bytes
-rw-r--r--web/cgi/images/buttons/silver/folders.gifbin0 -> 2903 bytes
-rw-r--r--web/cgi/images/buttons/silver/forward.gifbin0 -> 2908 bytes
-rw-r--r--web/cgi/images/buttons/silver/lastpage.gifbin0 -> 2595 bytes
-rw-r--r--web/cgi/images/buttons/silver/lastpage2.gifbin0 -> 1717 bytes
-rw-r--r--web/cgi/images/buttons/silver/lastpage4.gifbin0 -> 1691 bytes
-rw-r--r--web/cgi/images/buttons/silver/logout.gifbin0 -> 2832 bytes
-rw-r--r--web/cgi/images/buttons/silver/messages.gifbin0 -> 2894 bytes
-rw-r--r--web/cgi/images/buttons/silver/nextpage.gifbin0 -> 2520 bytes
-rw-r--r--web/cgi/images/buttons/silver/nextpage2.gifbin0 -> 2611 bytes
-rw-r--r--web/cgi/images/buttons/silver/ok.gifbin0 -> 2640 bytes
-rw-r--r--web/cgi/images/buttons/silver/prevpage.gifbin0 -> 2485 bytes
-rw-r--r--web/cgi/images/buttons/silver/prevpage2.gifbin0 -> 1672 bytes
-rw-r--r--web/cgi/images/buttons/silver/quit.gifbin0 -> 2689 bytes
-rw-r--r--web/cgi/images/buttons/silver/reply.gifbin0 -> 2805 bytes
-rw-r--r--web/cgi/images/buttons/silver/replyall.gifbin0 -> 2932 bytes
-rw-r--r--web/cgi/images/buttons/silver/save.gifbin0 -> 2733 bytes
-rw-r--r--web/cgi/images/buttons/silver/send.gifbin0 -> 2738 bytes
-rw-r--r--web/cgi/images/buttons/silver/undelete.gifbin0 -> 2864 bytes
-rw-r--r--web/cgi/images/caution.gifbin0 -> 134 bytes
-rw-r--r--web/cgi/images/cf_add.gifbin0 -> 150 bytes
-rw-r--r--web/cgi/images/cf_delete.gifbin0 -> 166 bytes
-rw-r--r--web/cgi/images/cf_edit.gifbin0 -> 148 bytes
-rw-r--r--web/cgi/images/cf_help.gifbin0 -> 65 bytes
-rw-r--r--web/cgi/images/cf_shdown.gifbin0 -> 102 bytes
-rw-r--r--web/cgi/images/cf_shup.gifbin0 -> 103 bytes
-rw-r--r--web/cgi/images/decreas4.gifbin0 -> 900 bytes
-rw-r--r--web/cgi/images/dot.gifbin0 -> 49 bytes
-rw-r--r--web/cgi/images/dot2.gifbin0 -> 43 bytes
-rw-r--r--web/cgi/images/dotblink.gifbin0 -> 261 bytes
-rw-r--r--web/cgi/images/dstripe.gifbin0 -> 73 bytes
-rw-r--r--web/cgi/images/env/d_new.gifbin0 -> 142 bytes
-rw-r--r--web/cgi/images/env/d_newans.gifbin0 -> 157 bytes
-rw-r--r--web/cgi/images/env/d_newansdel.gifbin0 -> 209 bytes
-rw-r--r--web/cgi/images/env/d_newdel.gifbin0 -> 235 bytes
-rw-r--r--web/cgi/images/env/d_newimp.gifbin0 -> 169 bytes
-rw-r--r--web/cgi/images/env/d_newimpans.gifbin0 -> 219 bytes
-rw-r--r--web/cgi/images/env/d_newimpansdel.gifbin0 -> 241 bytes
-rw-r--r--web/cgi/images/env/d_newimpdel.gifbin0 -> 222 bytes
-rw-r--r--web/cgi/images/env/d_newyou.gifbin0 -> 156 bytes
-rw-r--r--web/cgi/images/env/d_newyouans.gifbin0 -> 173 bytes
-rw-r--r--web/cgi/images/env/d_newyouansdel.gifbin0 -> 225 bytes
-rw-r--r--web/cgi/images/env/d_newyoudel.gifbin0 -> 177 bytes
-rw-r--r--web/cgi/images/env/d_read.gifbin0 -> 159 bytes
-rw-r--r--web/cgi/images/env/d_readans.gifbin0 -> 203 bytes
-rw-r--r--web/cgi/images/env/d_readansdel.gifbin0 -> 221 bytes
-rw-r--r--web/cgi/images/env/d_readdel.gifbin0 -> 282 bytes
-rw-r--r--web/cgi/images/env/d_readimp.gifbin0 -> 187 bytes
-rw-r--r--web/cgi/images/env/d_readimpans.gifbin0 -> 234 bytes
-rw-r--r--web/cgi/images/env/d_readimpansdel.gifbin0 -> 250 bytes
-rw-r--r--web/cgi/images/env/d_readimpdel.gifbin0 -> 310 bytes
-rw-r--r--web/cgi/images/env/d_readyou.gifbin0 -> 171 bytes
-rw-r--r--web/cgi/images/env/d_readyouans.gifbin0 -> 218 bytes
-rw-r--r--web/cgi/images/env/d_readyouansdel.gifbin0 -> 236 bytes
-rw-r--r--web/cgi/images/env/d_readyoudel.gifbin0 -> 292 bytes
-rw-r--r--web/cgi/images/env/new.gifbin0 -> 144 bytes
-rw-r--r--web/cgi/images/env/newans.gifbin0 -> 196 bytes
-rw-r--r--web/cgi/images/env/newansdel.gifbin0 -> 216 bytes
-rw-r--r--web/cgi/images/env/newdel.gifbin0 -> 162 bytes
-rw-r--r--web/cgi/images/env/newimp.gifbin0 -> 174 bytes
-rw-r--r--web/cgi/images/env/newimpans.gifbin0 -> 200 bytes
-rw-r--r--web/cgi/images/env/newimpansdel.gifbin0 -> 245 bytes
-rw-r--r--web/cgi/images/env/newimpdel.gifbin0 -> 220 bytes
-rw-r--r--web/cgi/images/env/newyou.gifbin0 -> 161 bytes
-rw-r--r--web/cgi/images/env/newyouans.gifbin0 -> 208 bytes
-rw-r--r--web/cgi/images/env/newyouansdel.gifbin0 -> 231 bytes
-rw-r--r--web/cgi/images/env/newyoudel.gifbin0 -> 204 bytes
-rw-r--r--web/cgi/images/env/read.gifbin0 -> 165 bytes
-rw-r--r--web/cgi/images/env/readans.gifbin0 -> 182 bytes
-rw-r--r--web/cgi/images/env/readansdel.gifbin0 -> 229 bytes
-rw-r--r--web/cgi/images/env/readdel.gifbin0 -> 184 bytes
-rw-r--r--web/cgi/images/env/readimp.gifbin0 -> 192 bytes
-rw-r--r--web/cgi/images/env/readimpans.gifbin0 -> 212 bytes
-rw-r--r--web/cgi/images/env/readimpansdel.gifbin0 -> 256 bytes
-rw-r--r--web/cgi/images/env/readimpdel.gifbin0 -> 235 bytes
-rw-r--r--web/cgi/images/env/readyou.border.gifbin0 -> 209 bytes
-rw-r--r--web/cgi/images/env/readyou.gifbin0 -> 173 bytes
-rw-r--r--web/cgi/images/env/readyouans.gifbin0 -> 196 bytes
-rw-r--r--web/cgi/images/env/readyouansdel.gifbin0 -> 238 bytes
-rw-r--r--web/cgi/images/env/readyoudel.gifbin0 -> 217 bytes
-rw-r--r--web/cgi/images/hdr.gifbin0 -> 95 bytes
-rw-r--r--web/cgi/images/hdrless.gifbin0 -> 164 bytes
-rw-r--r--web/cgi/images/hdrmore.gifbin0 -> 170 bytes
-rw-r--r--web/cgi/images/hdrnon.gifbin0 -> 108 bytes
-rw-r--r--web/cgi/images/help_trans.gifbin0 -> 125 bytes
-rw-r--r--web/cgi/images/ibarmsg.gifbin0 -> 137 bytes
-rw-r--r--web/cgi/images/ibarvertmsg.gifbin0 -> 76 bytes
-rw-r--r--web/cgi/images/if_blank.gifbin0 -> 325 bytes
-rw-r--r--web/cgi/images/if_left.gifbin0 -> 329 bytes
-rw-r--r--web/cgi/images/if_narrow.gifbin0 -> 408 bytes
-rw-r--r--web/cgi/images/if_narrow2.gifbin0 -> 328 bytes
-rw-r--r--web/cgi/images/if_remove.gifbin0 -> 318 bytes
-rw-r--r--web/cgi/images/if_right.gifbin0 -> 330 bytes
-rw-r--r--web/cgi/images/if_widen.gifbin0 -> 412 bytes
-rw-r--r--web/cgi/images/if_wider.gifbin0 -> 328 bytes
-rw-r--r--web/cgi/images/increas4.gifbin0 -> 838 bytes
-rw-r--r--web/cgi/images/indexhdr.gifbin0 -> 143 bytes
-rw-r--r--web/cgi/images/logo/alpine/back.gifbin0 -> 251 bytes
-rw-r--r--web/cgi/images/logo/alpine/big.gifbin0 -> 9059 bytes
-rw-r--r--web/cgi/images/logo/alpine/small-blank.gifbin0 -> 3352 bytes
-rw-r--r--web/cgi/images/logo/alpine/small.gifbin0 -> 3067 bytes
-rw-r--r--web/cgi/images/markall3.gifbin0 -> 189 bytes
-rw-r--r--web/cgi/images/marknone3.gifbin0 -> 165 bytes
-rw-r--r--web/cgi/images/minus2.gifbin0 -> 64 bytes
-rw-r--r--web/cgi/images/nondither10x10.gifbin0 -> 6829 bytes
-rw-r--r--web/cgi/images/plus2.gifbin0 -> 73 bytes
-rw-r--r--web/cgi/images/postmark.gifbin0 -> 562 bytes
-rw-r--r--web/cgi/images/printer2.gifbin0 -> 145 bytes
-rw-r--r--web/cgi/images/slidein.gifbin0 -> 126 bytes
-rw-r--r--web/cgi/images/slideout.gifbin0 -> 125 bytes
-rw-r--r--web/cgi/images/tabless.gifbin0 -> 90 bytes
-rw-r--r--web/cgi/images/tabmore.gifbin0 -> 102 bytes
-rw-r--r--web/cgi/images/tabs/abdtab.gifbin0 -> 550 bytes
-rw-r--r--web/cgi/images/tabs/abtab.gifbin0 -> 265 bytes
-rw-r--r--web/cgi/images/tabs/blank.gifbin0 -> 130 bytes
-rw-r--r--web/cgi/images/tabs/cdtab.gifbin0 -> 493 bytes
-rw-r--r--web/cgi/images/tabs/ctab.gifbin0 -> 214 bytes
-rw-r--r--web/cgi/images/tabs/fdtab.gifbin0 -> 461 bytes
-rw-r--r--web/cgi/images/tabs/ftab.gifbin0 -> 190 bytes
-rw-r--r--web/cgi/images/tabs/gdtab.gifbin0 -> 471 bytes
-rw-r--r--web/cgi/images/tabs/gtab.gifbin0 -> 196 bytes
-rw-r--r--web/cgi/images/tabs/mldtab.gifbin0 -> 529 bytes
-rw-r--r--web/cgi/images/tabs/mltab.gifbin0 -> 251 bytes
-rw-r--r--web/cgi/images/tabs/mvdtab.gifbin0 -> 540 bytes
-rw-r--r--web/cgi/images/tabs/mvtab.gifbin0 -> 255 bytes
-rw-r--r--web/cgi/images/tabs/rdtab.gifbin0 -> 437 bytes
-rw-r--r--web/cgi/images/tabs/rtab.gifbin0 -> 173 bytes
-rw-r--r--web/cgi/images/tabs/tabbg.gifbin0 -> 236 bytes
-rw-r--r--web/cgi/images/tabs/tabmid.gifbin0 -> 64 bytes
-rw-r--r--web/cgi/motd.sample5
l---------web/cgi/pub/alpine.tcl1
-rwxr-xr-xweb/cgi/pub/getach.tcl87
-rw-r--r--web/cgi/pub/standard.css45
-rw-r--r--web/cgi/pub/standard.js414
l---------web/cgi/pub/tclsh1
-rw-r--r--web/cgi/session/.htaccess28
-rw-r--r--web/cgi/session/_htaccess28
l---------web/cgi/session/alpine.tcl1
-rwxr-xr-xweb/cgi/session/greeting.tcl395
-rwxr-xr-xweb/cgi/session/init.tcl218
-rwxr-xr-xweb/cgi/session/logon.tcl169
-rwxr-xr-xweb/cgi/session/logout.tcl67
l---------web/cgi/session/logout/alpine.tcl1
-rwxr-xr-xweb/cgi/session/logout/logout.tcl51
l---------web/cgi/session/logout/tclsh1
-rwxr-xr-xweb/cgi/session/monitor.tcl282
-rwxr-xr-xweb/cgi/session/queryauth.tcl120
-rwxr-xr-xweb/cgi/session/setauth.tcl68
-rwxr-xr-xweb/cgi/session/setauth2.tcl58
-rwxr-xr-xweb/cgi/session/setpassphrase.tcl52
-rwxr-xr-xweb/cgi/session/startup.tcl33
l---------web/cgi/session/tclsh1
-rw-r--r--web/cgi/sounds/ding.wavbin0 -> 11598 bytes
-rw-r--r--web/cgi/sounds/mail_msg.wavbin0 -> 23022 bytes
l---------web/cgi/tclsh1
544 files changed, 42895 insertions, 0 deletions
diff --git a/web/cgi/.htaccess b/web/cgi/.htaccess
new file mode 100644
index 00000000..b59de05b
--- /dev/null
+++ b/web/cgi/.htaccess
@@ -0,0 +1,32 @@
+#
+# Tweek server to encourage caching and set appropriate type for icons
+#
+DirectoryIndex greeting.tcl
+
+AddType image/x-icon .ico
+
+AddHandler cgi-script tcl
+
+<IfModule mod_headers.c>
+
+<Files *.gif>
+Header append Cache-Control "public"
+</Files>
+
+<Files *.jpg>
+Header append Cache-Control "public"
+</Files>
+
+<Files *.jpeg>
+Header append Cache-Control "public"
+</Files>
+
+<Files *.js>
+Header append Cache-Control "public"
+</Files>
+
+<Files *.css>
+Header append Cache-Control "public"
+</Files>
+
+</IfModule>
diff --git a/web/cgi/alpine.tcl b/web/cgi/alpine.tcl
new file mode 120000
index 00000000..976166f1
--- /dev/null
+++ b/web/cgi/alpine.tcl
@@ -0,0 +1 @@
+../config/alpine.tcl \ No newline at end of file
diff --git a/web/cgi/alpine/1.0/addrbook.tcl b/web/cgi/alpine/1.0/addrbook.tcl
new file mode 100755
index 00000000..fcaf4f04
--- /dev/null
+++ b/web/cgi/alpine/1.0/addrbook.tcl
@@ -0,0 +1,583 @@
+# $Id: addrbook.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# addrbook.tcl
+#
+# Purpose: CGI script to generate html output associated with address
+# book entry and collection management
+#
+# Input:
+set abook_vars {
+ {op {} "view"}
+ {field {} "none"}
+ {uid "" 0}
+ {oncancel "" "fr_main.tcl"}
+ {reload}
+}
+
+# Output:
+#
+# HTML/CSS data representing the address book
+
+
+# Command Menu definition for Message View Screen
+set addr_menu {
+}
+
+set common_menu {
+ {
+ {expr {$view}}
+ {
+ {
+ # * * * * Ubiquitous INBOX link * * * *
+ if {[string compare inbox [string tolower [WPCmd PEMailbox mailboxname]]]} {
+ cgi_put [cgi_url INBOX open.tcl?folder=INBOX&colid=0&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url INBOX fr_main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ }
+ {
+ {expr {$view}}
+ {
+ {
+ # * * * * FOLDER LIST * * * *
+ cgi_puts [cgi_url "Folder List" "wp.tcl?page=folders&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {expr {$view}}
+ {
+ {
+ # * * * * COMPOSE * * * *
+ cgi_puts [cgi_url Compose wp.tcl?page=compose&oncancel=addrbook&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {expr {$view}}
+ {
+ {
+ # * * * * RESUME * * * *
+ cgi_puts [cgi_url Resume wp.tcl?page=resume&oncancel=addrbook&cid=[WPCmd PEInfo key] class=navbar]
+ }
+ }
+ }
+ {
+ {expr {$browse}}
+ {
+ {
+ # * * * * USE ADDRESSES * * * *
+ cgi_submit_button "address=Address" class="navtext"
+ }
+ }
+ }
+ {
+ {expr {$browse}}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_submit_button "cancel=Cancel" class="navtext"
+ }
+ }
+ }
+ {
+ {expr {0 && $browse}}
+ {
+ {
+ # * * * * Address/Cancel * * * *
+ cgi_submit_button doit=Done class="navbar"
+ cgi_br
+ cgi_select addrop class=navtext {
+ cgi_option "Action..." value=null
+ cgi_option Address value=address
+ cgi_option Cancel value=cancel
+ }
+ }
+ }
+ }
+}
+
+
+## read vars
+foreach item $abook_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+# perform any requested actions
+
+# preserve vars that my have been overridden with cgi parms
+
+set cid [WPCmd PEInfo key]
+WPCmd PEAddress safecheck
+
+set view [expr {[string compare $op "view"] == 0}]
+set browse [expr {[string compare $op "browse"] == 0}]
+
+if {$view} {
+ if {[catch {WPNewMail $reload} newmail]} {
+ error [list _action "new mail" $newmail]
+ }
+
+ if {[WPCmd PEInfo ldapenabled] == 1} {
+ if {[catch {WPCmd PELdap directories} directories] || [llength $directories] <= 0} {
+ catch {unset directories}
+ } else {
+ for {set i 0} {$i < [llength $directories]} {incr i} {
+ lappend exclusions document.ldapsearch${i}.srchstr
+ }
+ }
+ }
+}
+
+# paint the page
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ set onload "onLoad="
+ set onunload "onUnload="
+
+ if {[info exists _wp(exitonclose)] && $view} {
+ WPExitOnClose
+ append onload "wpLoad();"
+ append onunload "wpUnLoad();"
+ }
+
+ if {$view} {
+ set normalreload [cgi_buffer {WPHtmlHdrReload "[file join $_wp(appdir) $_wp(ui1dir) wp.tcl?page=addrbook]"}]
+ if {[info exists _wp(exitonclose)]} {
+ WPStdHtmlHdr "Address Book View"
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_put "function indexReloadTimer(t){"
+ cgi_put " reloadtimer = window.setInterval('wpLink(); window.location.replace(\\'[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=addrbook&reload=1\\')', t * 1000);"
+ cgi_puts "}"
+ }
+
+ append onload "indexReloadTimer($_wp(refresh));"
+
+ cgi_noscript {
+ cgi_puts $normalreload
+ }
+ } else {
+ cgi_puts $normalreload
+ }
+ }
+
+ WPStyleSheets
+ cgi_puts "<style type='text/css'>"
+ if {$browse} {
+ cgi_puts ".navbtn { color: white ; font-family: geneva, arial, sans-serif ; font-size: 9pt ; letter-spacing: 0pt ; text-decoration: underline ; background: transparent; border: 0 ; text-align: left }"
+ } elseif {$view} {
+ cgi_puts ".gradient { background-image: url('[WPimg indexhdr]') ; background-repeat: repeat-x }"
+ }
+ cgi_puts "</style>"
+
+ if {$_wp(keybindings)} {
+ set kequiv {
+ {{i} {top.location = 'fr_main.tcl'}}
+ {{l} {top.location = 'wp.tcl?page=folders'}}
+ {{?} {top.location = 'wp.tcl?page=help&oncancel=addrbook'}}
+ }
+
+ lappend kequiv [list {c} "top.location = 'wp.tcl?page=compose&oncancel=addrbook&cid=$cid'"]
+
+ if {![info exists exclusions]} {
+ set exclusions ""
+ }
+
+ append onload [WPTFKeyEquiv $kequiv $exclusions]
+ }
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) background=[file join $_wp(imagepath) logo $_wp(logodir) back.gif] "style=\"background-repeat: repeat-x\"" $onload $onunload {
+
+ if {$view} {
+ catch {WPCmd PEInfo set help_context addrbook}
+ } else {
+ catch {WPCmd PEInfo set help_context addrbrowse}
+ }
+
+ set books [WPCmd PEAddress books]
+ set entrylist {}
+ set entryexists 0
+ foreach book $books {
+ set entries [WPCmd PEAddress list [lindex $book 0]]
+ if {[llength $entries] > 0} {
+ incr entryexists
+ }
+ lappend entrylist $entries
+ }
+
+ if {$view} {
+ WPTFTitle "Address Books" $newmail 0 addrbook
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+ if {$browse} {
+ cgi_puts "<form action=\"[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl\" name=addrchoice method=get target=_top>"
+ cgi_text "page=addrpick" type=hidden notab
+ cgi_text "field=$field" type=hidden notab
+ cgi_text "restore=1" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ }
+ cgi_table_row {
+ #
+ # next comes the menu down the left side
+ #
+ cgi_table_data valign=top rowspan=4 class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=0 width=112 {
+ if {!$browse} {
+ cgi_table_row {
+ cgi_table_data class=navbar "style=\"padding: 6 0 6 4\"" {
+ cgi_puts [cgi_span "style=font-weight: bold" "Current Folder"]
+ cgi_division align=center "style=\"margin-top:4;margin-bottom:4\"" {
+ set mbn [WPCmd PEMailbox mailboxname]
+ if {[string length $mbn] > 16} {
+ set mbn "[string range $mbn 0 14]..."
+ }
+
+ cgi_put [cgi_url $mbn fr_main.tcl target=_top class=navbar]
+ switch -exact -- [WPCmd PEMailbox state] {
+ readonly {
+ cgi_br
+ #cgi_put [cgi_span "style=color: black; border: 1px solid red; background-color: pink; font-weight: bold" "Read Only"]
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Read Only)"]
+ }
+ closed {
+ cgi_br
+ #cgi_put [cgi_span "style=color: black; border: 1px solid red; background-color: pink; font-weight: bold" "Closed"]
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Closed)"]
+ }
+ ok -
+ default {}
+ }
+
+ cgi_br
+ }
+
+ cgi_hr "width=75%"
+ }
+ }
+ }
+
+ if {$view && [llength $books] == 1 && [lindex [lindex $books 0] 3]} {
+ cgi_table_row {
+ cgi_table_data class=navbar "style=\"padding-left: 4\"" {
+ # * * * * ADD ENTRY * * * *
+ cgi_puts [cgi_url "Add Entry" wp.tcl?page=addredit&add=1&book=0&cid=[WPCmd PEInfo key] class=navbar]
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class=navbar {
+ cgi_put [cgi_nbspace]
+ }
+ }
+ }
+
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ if {$view} {
+ lappend common_menu {{cgi_put [cgi_nbspace]}}
+ lappend common_menu [list {} [list {cgi_puts [cgi_url "Configure" wp.tcl?page=conf_process&newconf=1&oncancel=addrbook&cid=[WPCmd PEInfo key] class=navbar target=_top]}]]
+ lappend common_menu [list {} [list {cgi_puts [cgi_url "Get Help" wp.tcl?page=help&oncancel=addrbook target=_top class=navbar]}]]
+ lappend common_menu {{cgi_put [cgi_nbspace]}}
+
+ if {[WPCmd PEInfo feature quit-without-confirm]} {
+ lappend common_menu [list {} [list {cgi_puts [cgi_url "Quit $_wp(appname)" $_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=$sessid class=navbar]}]]
+ } else {
+ lappend common_menu [list {} [list {cgi_puts [cgi_url "Quit $_wp(appname)" wp.tcl?page=quit&cid=[WPCmd PEInfo key] target=_top class=navbar]}]]
+ }
+ }
+
+
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar "style=\"padding: 0 0 10 2\"" {
+ WPTFCommandMenu addr_menu common_menu
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_data valign=top width=100% class=dialog {
+ set n 1
+ set bookno 0
+ foreach book $books {
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" {
+ if {$browse} {
+ cgi_table_row {
+ cgi_table_data width="100%" colspan=16 class=dialog align=center valign=middle {
+ cgi_table cellpadding=4 width="70%" {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "Check the box next to the addresses you'd like to add to the [cgi_bold "[string toupper [string range $field 0 0]][string range $field 1 end]:"] field, then click [cgi_italic Address] button."
+ }
+ }
+ }
+ }
+ }
+ }
+
+ set format [WPCmd PEAddress format [lindex $book 0]]
+ set name [lindex $book 1]
+ set readwrite [lindex $book 3]
+ if {[llength $books] > 1} {
+ if {[string index $name 0] == "\{"} {
+ if {$readwrite} {
+ set name "Remote Address Book"
+ } else {
+ set name "Global Address Book"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data height=35 valign=middle colspan=[expr ([llength $format] + 1) * 2] nowrap {
+ if {$readwrite || $browse} {
+ cgi_puts "[cgi_font size=+1 [cgi_bold $name]]"
+ } else {
+ cgi_table border=0 cellspacing=0 cellpadding=0 width=100% {
+ cgi_table_row {
+ cgi_table_data align=left {
+ cgi_puts "[cgi_font size=+1 [cgi_bold $name]]"
+ }
+ cgi_table_data align=right {
+ cgi_puts "[cgi_bold "(Read Only)"]"
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if {$view && $readwrite} {
+ cgi_table_row {
+ cgi_table_data nowrap height=40 {
+ cgi_put [cgi_url "Add New Entry" wp.tcl?page=addredit&add=1&book=${bookno}&cid=[WPCmd PEInfo key]]
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" {
+ set linenum 1
+ set nonick 1
+ set nfields [llength $format]
+
+ if {$view} {
+ cgi_table_row class=\"gradient\" {
+ foreach f $format {
+ cgi_table_data {
+ cgi_put [cgi_img [WPimg dot2] border=0 width=3 height=24]
+ }
+ cgi_table_data align=left class=indexhdr {
+ switch [lindex $f 0] {
+ nick {
+ cgi_put "Nickname (Click to edit entry)"
+ }
+ full {
+ cgi_put "Full Name"
+ }
+ addr {
+ cgi_put "Address (Click to Compose To)"
+ }
+ }
+ }
+ }
+ }
+ }
+
+ for {set i 0} {$i < $nfields && $nonick} {incr i} {
+ if {[string compare "nick" [lindex [lindex $format $i] 0]] == 0} {
+ set nonick 0
+ }
+ }
+ set entries [lindex $entrylist [lindex $book 0]]
+ if {[llength $entries] == 0} {
+ cgi_table_row {
+ cgi_table_data colspan=16 align=center {
+ cgi_puts [cgi_italic "This address book is currently empty."]
+ }
+ }
+ }
+ set aindex 0
+ foreach entry $entries {
+ if {[incr linenum] % 2} {
+ set bgcolor #ffffff
+ } else {
+ set bgcolor #eeeeee
+ }
+ cgi_table_row bgcolor=$bgcolor {
+ set nick [lindex [lindex $entry 0] 0]
+ set safenick [WPPercentQuote $nick]
+
+ set nfields [llength $format]
+ if {$browse} {
+ cgi_table_data valign=top nowrap {
+ cgi_checkbox "nickList=[lindex $book 0].$aindex.[lindex [lindex $entry 0] 0]" style="background-color:$bgcolor"
+ }
+ }
+ for {set i 0} {$i < $nfields} {incr i} {
+ set field [lindex $format $i]
+ set data [lindex $entry [expr $i + 1]]
+
+ if {$view} {
+ cgi_table_data nowrap {
+ if {$nonick && $i == 0} {
+ set data [cgi_url $data "wp.tcl?page=addredit&nick=${safenick}&book=${bookno}&ai=${aindex}"]
+ }
+ cgi_puts [cgi_nbspace][cgi_nbspace][cgi_nbspace][cgi_nbspace]
+ }
+ }
+
+ cgi_table_data valign=top nowrap {
+ switch -- [lindex $field 0] {
+ addr {
+ switch -- [lindex [lindex $entry 0] 1] {
+ single {
+ regsub -all "<" $data "\\&lt;" data
+ regsub -all ">" $data "\\&gt;" data
+ if {$view} {
+ set data [cgi_url $data "wp.tcl?page=compose&nickto=${safenick}&book=${bookno}&ai=${aindex}&oncancel=addrbook&cid=[WPCmd PEInfo key]"]
+ }
+ cgi_puts [cgi_font size=-1 face=courier $data]
+ }
+ list {
+ cgi_table {
+ cgi_table_row {
+ cgi_table_data {
+ foreach addr $data {
+ regsub -all "<" $addr "\\&lt;" addr
+ regsub -all ">" $addr "\\&gt;" addr
+ if {$view} {
+ set addr [cgi_url $addr "wp.tcl?page=compose&nickto=${safenick}&book=${bookno}&ai=${aindex}&oncancel=addrbook&cid=[WPCmd PEInfo key]"]
+ }
+ cgi_puts [cgi_font size=-1 face=courier $addr]
+ cgi_br
+ }
+ if {$view} {
+ cgi_puts "</a>"
+ }
+ }
+ }
+ }
+ }
+ default {
+ cgi_puts "Unknown entry type"
+ }
+ }
+ }
+ nick {
+ regsub -all "<" $data "\\&lt;" data
+ regsub -all ">" $data "\\&gt;" data
+ if {$view} {
+ if {[string length $data]} {
+ set text "$data"
+ } else {
+ set text "\[Edit\]"
+ }
+
+ cgi_puts [cgi_url $text "wp.tcl?page=addredit&nick=${safenick}&book=${bookno}&ai=${aindex}"]
+ } else {
+ if {![string length $nick]} {
+ set nick [cgi_nbspace]
+ }
+
+ cgi_puts "$nick"
+ }
+ }
+ default {
+ regsub -all "<" $data "\\&lt;" data
+ regsub -all ">" $data "\\&gt;" data
+ if {[string compare "$data" ""] == 0} {
+ cgi_puts "&nbsp;"
+ } else {
+ cgi_puts "$data"
+ }
+ }
+ }
+ }
+ }
+ }
+ incr aindex
+ }
+ }
+ }
+ }
+ }
+ incr bookno
+ }
+ if {$browse} {
+ cgi_puts "</form>"
+ }
+
+ if {[info exists directories]} {
+ cgi_table border=0 cellspacing=0 cellpadding=4 width="100%" "style=\"padding-top:10\"" {
+ for {set i 0} {$i < [llength $directories]} {incr i} {
+ set directory [lindex $directories $i]
+ set nick [lindex $directory 0]
+ set server [lindex $directory 1]
+ if {[string length $nick]} {
+ set ref $nick
+ } elseif {[string length $server]} {
+ set ref "<$server>"
+ } else {
+ set ref "some server"
+ }
+
+ cgi_table_row {
+ cgi_table_data colspan=3 valign=middle nowrap {
+ cgi_puts "[cgi_font size=+1 [cgi_bold "Directory server [cgi_quote_html $ref]"]]"
+ }
+ }
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post enctype=multipart/form-data name=ldapsearch${i} {
+ cgi_text "sessid=$_wp(sessid)" type=hidden notab
+ cgi_text "page=ldapquery" type=hidden notab
+
+ cgi_text "searchtype=0" type=hidden notab
+ cgi_text "op=view" type=hidden notab
+ cgi_text "dir=$i" type=hidden notab
+
+ cgi_table_row {
+ cgi_table_data class=dialog align=center valign=middle "style=\"background-color:white\"" {
+ cgi_puts "Search Directory :"
+ cgi_text "srchstr=" size=35
+ cgi_submit_button "search=Search"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data height=200 class=dialog {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/addredit.tcl b/web/cgi/alpine/1.0/addredit.tcl
new file mode 100755
index 00000000..8aecda2e
--- /dev/null
+++ b/web/cgi/alpine/1.0/addredit.tcl
@@ -0,0 +1,224 @@
+#!./tclsh
+# $Id: addredit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# addredit.tcl
+#
+# Purpose: CGI script to generate html form used to view/set
+# individual addressbook entries
+#
+# Input:
+set ae_vars {
+ {book {} -1}
+ {nick {} ""}
+ {add {} 0}
+ {fn {} ""}
+ {addrs {} ""}
+ {fcc {} ""}
+ {comment {} ""}
+ {take {} 0}
+ {newnick {} ""}
+ {ai {} -1}
+}
+
+set ae_fields {
+ {0 "newnick" "Nickname<sup class=notice>*</sup>"}
+ {1 "fn" "Full Name&nbsp;"}
+ {2 "addrs" "Addresses<sup class=notice>*</sup>"}
+ {3 "fcc" "Fcc&nbsp;"}
+ {4 "comment" "Comments&nbsp;"}
+}
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+# Output:
+#
+#
+
+set ae_menu {
+ {
+ {}
+ {
+ {
+ cgi_image_button help=[WPimg help_trans] border=0 alt="Help"
+ }
+ }
+ }
+}
+
+WPEval $ae_vars {
+
+ if {$book < 0} {
+ if {[catch {WPCmd PEInfo set ae_help_state} ae_help_state] == 0} {
+ foreach v $ae_help_state {
+ eval set [lindex $v 0] [list [lindex $v 1]]
+ }
+
+ set addrinfo [list "$newnick" "$fn" [list "$addrs"] "$fcc" "$comment"]
+ WPCmd PEInfo unset ae_help_state
+ } else {
+ return [list _action "Web Alpine" "Unspecified Address Book"]
+ }
+ }
+
+ catch {WPCmd PEInfo unset ae_help_state}
+
+ if {![info exists addrinfo]} {
+ if {$take != 0} {
+ set addrinfo [list "$newnick" "$fn" [list "$addrs"] "$fcc" "$comment"]
+ } elseif {$add == 0} {
+ if {[catch {WPCmd PEAddress fullentry $book $nick $ai} addrinfo]} {
+ if {[string length $addrinfo]} {
+ set entryerror "Address Error: $addrinfo"
+ } else {
+ set entryerror "Nickname $nick does not exist"
+ }
+
+ set addrinfo [list "" "" [list ""] "" ""]
+ }
+ } else {
+ set addrinfo [list "" "" [list ""] "" ""]
+ }
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Addressbook Update"
+ WPStyleSheets
+ }
+
+ if {$take == 1} {
+ set onload "onLoad=document.addredit.newnick.focus()"
+ } else {
+ set onload ""
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" $onload {
+ set books [WPCmd PEAddress books]
+ set readwrite [lindex [lindex $books $book] 3]
+
+ catch {WPCmd PEInfo set help_context addredit}
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post enctype=multipart/form-data name=addredit target=_top {
+ cgi_table_row {
+ #
+ # next comes the menu down the left side
+ #
+ eval {
+ cgi_table_data $_wp(menuargs) rowspan=1000 {
+ WPTFCommandMenu ae_menu {}
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data valign=top width="100%" class=dialog {
+ if {[info exists entryerror]} {
+ cgi_division class=notice align=center {
+ cgi_puts $entryerror
+ }
+ }
+
+
+ if {$take == 1} {
+ lappend tmptxt "Edit the new entry below as neccessary (note, some are required). To create a list entry, simply add each desired address to the [cgi_italic Addresses] field separated by a comma."
+ lappend tmptxt "When finished, click [cgi_italic Save] to update your address book, or [cgi_italic Cancel] to return to the message view."
+ } elseif {$add == 1} {
+ lappend tmptxt "The address book entry editor is used to create a new address book entry. Fill in the fields as desired below (note, some are required). To create a list entry, simply add each desired address to the [cgi_italic Addresses] field separated by a comma."
+ lappend tmptxt "When finished, click [cgi_italic Save] to update your address book, or [cgi_italic Cancel] to return to your unchanged address book."
+ } elseif {$readwrite == 0} {
+ set tmptxt "These are the current settings for the selected entry"
+ } else {
+ lappend tmptxt "The address book entry editor is used to edit an existing address book entry. Edit the fields as desired below (note, some are required)."
+ lappend tmptxt " then click [cgi_italic Save] to update your address book, or [cgi_italic Cancel] to return to your unchanged address book."
+ }
+
+ cgi_table align=center width=75% cellpadding=10 border=0 {
+ foreach t $tmptxt {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts $t
+ }
+ }
+ }
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=5 align=center {
+ cgi_text "page=addrsave" type=hidden notab
+
+ if {$take == 1} {
+ cgi_text "oncancel=main" type=hidden notab
+ cgi_text "take=1" type=hidden notab
+ } else {
+ cgi_text "oncancel=addrbook" type=hidden notab
+ }
+
+ cgi_text "book=$book" type=hidden notab
+ if {$add == 0} {cgi_text "nick=$nick" type=hidden notab}
+ if {$add != 0} {cgi_text "add=1" type=hidden notab}
+ cgi_text "ai=${ai}" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+
+ foreach fieldval $ae_fields {
+ cgi_table_row {
+ cgi_table_data valign=top align=right width="30%" class=dialog {
+ # cgi_puts [cgi_font face=tahoma,verdana,geneva size=+1 "[lindex $fieldval 2]:"]
+ cgi_puts [cgi_bold "[lindex $fieldval 2]:"]
+ }
+ cgi_table_data align=left {
+ switch -regexp [lindex $fieldval 1] {
+ ^addrs$ {
+ set addrvals [lindex $addrinfo [lindex $fieldval 0]]
+ set line [join $addrvals ", "]
+ cgi_text "[lindex $fieldval 1]=${line}" size=50
+ }
+ default {
+ cgi_text "[lindex $fieldval 1]=[lindex $addrinfo [lindex $fieldval 0]]" size=50
+ }
+ }
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_puts [cgi_font class=notice size=-1 "* Required field"]
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=center colspan=2 {
+ if {$readwrite} {
+ cgi_submit_button "save=Save Entry"
+ cgi_put [cgi_img [WPimg dot2] border=0 alt="" width=10]
+ }
+
+ if {$readwrite && $add == 0 && $take == 0} {
+ cgi_submit_button "delete=Delete Entry"
+ cgi_put [cgi_img [WPimg dot2] border=0 alt="" width=10]
+ }
+
+ cgi_submit_button "cancel=Cancel"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/addrpick.tcl b/web/cgi/alpine/1.0/addrpick.tcl
new file mode 100755
index 00000000..a71f55d6
--- /dev/null
+++ b/web/cgi/alpine/1.0/addrpick.tcl
@@ -0,0 +1,134 @@
+# $Id: addrpick.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# addrpick.tcl
+#
+# Purpose: CGI script to handle address book choices from the
+# via the addrbook browser generated form
+#
+# Input:
+set pick_vars {
+ {cid "Missing Command ID"}
+ {field "Missing Field Name"}
+ {addrop {} ""}
+ {cancel {} 0}
+}
+
+# Output:
+
+
+# read vars
+foreach item $pick_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ error [list _action "Impart Variable" $result]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ catch {WPCmd PEInfo statmsg "Invalid Command ID"}
+}
+
+WPLoadCGIVarAs nickList listonicks
+set usenewfcc 0
+
+if {$cancel == 1 || [string compare cancel [string tolower $cancel]] == 0 || [string compare cancel [string tolower $addrop]] == 0} {
+} elseif {[string length $listonicks] > 0} {
+ foreach nick $listonicks {
+ # determine which book
+ if {[regexp {^([0-9]+)\.([0-9]+)\.(.*)$} $nick dummy book ai nick]} {
+ if {[catch {WPCmd PEAddress entry $book $nick $ai} result]} {
+ regsub -all "'" $result "\\'" result
+ WPCmd PEInfo statmsg $result
+ } else {
+ set resaddr [lindex $result 0]
+ regsub -all "'" $resaddr "\\'" resaddr
+ if {[info exists newaddrs]} {
+ append newaddrs ", "
+ }
+ if {[string compare $field "to"] == 0 && [string length [lindex $result 1]]} {
+ # arbitrarily the last returned entry with an fcc wins
+ set fcc [lindex $result 1]
+ if {[string compare $fcc "\"\""] == 0} {
+ set fcc ""
+ }
+ regsub -all "'" $fcc "\\'" fcc
+ set usenewfcc 1
+ }
+
+ append newaddrs $resaddr
+ }
+ } else {
+ WPCmd PEInfo statmsg "Malformed entry request: $addr"
+ }
+ }
+
+ if {[info exists newaddrs]} {
+ if {[catch {WPCmd PEInfo set suspended_composition} msgdata] == 0} {
+ for {set i 0} {$i < [llength $msgdata]} {incr i} {
+ if {[string compare [string tolower [lindex [lindex $msgdata $i] 0]] $field] == 0} {
+ if {[string length [lindex [lindex $msgdata $i] 1]]} {
+ set newfield [list $field "[lindex [lindex $msgdata $i] 1], $newaddrs"]
+ } else {
+ set newfield [list $field $newaddrs]
+ }
+ break
+ }
+ }
+
+ if {$usenewfcc} {
+ for {set j 0} {$j < [llength $msgdata]} {incr j} {
+ if {[string compare fcc [string tolower [lindex [lindex $msgdata $j] 0]]] == 0} {
+ set fcc_index $j
+ break
+ }
+ }
+
+ set savedef [WPTFSaveDefault 0]
+ set colid [lindex $savedef 0]
+ if {[info exists fcc_index]} {
+ if {[string compare $fcc [lindex [lindex [lindex $msgdata $fcc_index] 1] 1]]} {
+ lappend msgdata [list postoption [list fcc-set-by-addrbook 1]]
+ }
+
+ set msgdata [lreplace $msgdata $fcc_index $fcc_index [list Fcc [list $colid $fcc]]]
+ } else {
+ lappend msgdata [list Fcc [list $colid $fcc]]
+ lappend msgdata [list postoption [list fcc-set-by-addrbook 1]]
+ }
+ }
+
+ if {[info exists newfield]} {
+ set msgdata2 [lreplace $msgdata $i $i $newfield]
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata2} result] == 0} {
+ unset result
+ }
+ } else {
+ lappend msgdata [list $field $newaddrs]
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} result] == 0} {
+ unset result
+ }
+ }
+
+ if {[info exists result]} {
+ WPCmd PEInfo statmsg "Cannot Update $field field: $result"
+ }
+ } else {
+ WPCmd PEInfo statmsg "Cannot change Message Data: $msgdata"
+ }
+ }
+}
+
+source [WPTFScript compose]
diff --git a/web/cgi/alpine/1.0/addrsave.tcl b/web/cgi/alpine/1.0/addrsave.tcl
new file mode 100755
index 00000000..37a70ebe
--- /dev/null
+++ b/web/cgi/alpine/1.0/addrsave.tcl
@@ -0,0 +1,244 @@
+# $Id: addrsave.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# addrsave.tcl
+#
+# Purpose: CGI script to handle address book change/save
+# via addredit generated form
+#
+# Input:
+set abs_vars {
+ {cid "Missing Command ID"}
+ {save {} 0}
+ {delete {} 0}
+ {replace {} 0}
+ {compose {} 0}
+ {take {} 0}
+ {help {} 0}
+ {cancel {} 0}
+ {oncancel {} ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $abs_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ error [list _action "Impart Variable" $result]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ catch {WPCmd PEInfo statmsg "Invalid Command ID"}
+}
+
+if {$help != 0} {
+ set save_vars {
+ {book {} 0}
+ {newnick {} ""}
+ {nick {} ""}
+ {ai {} 0}
+ {fn {} ""}
+ {addrs {} ""}
+ {fcc {} ""}
+ {comment {} ""}
+ {add {} 0}
+ {take {} 0}
+ }
+
+ foreach i $abs_vars {
+ lappend ae_help_state [list [lindex $i 0] [subst $[lindex $i 0]]]
+ }
+
+ foreach i $save_vars {
+ eval WPImport $i
+ lappend ae_help_state [list [lindex $i 0] [subst $[lindex $i 0]]]
+ }
+
+ WPCmd PEInfo set ae_help_state $ae_help_state
+
+ set _cgi_uservar(topic) takeedit
+ set _cgi_uservar(oncancel) addredit
+ if {$take} {
+ set _cgi_uservar(index) none
+ }
+
+ set src help
+
+} elseif {$save == 1 || [string compare [string tolower $save] "save entry"] == 0} {
+ WPLoadCGIVar book
+ WPLoadCGIVar newnick
+ WPLoadCGIVar ai
+ WPLoadCGIVar fn
+ WPLoadCGIVar addrs
+ WPLoadCGIVar fcc
+ WPLoadCGIVar comment
+ if {[catch {cgi_import_cookie add}] != 0} {set add 0}
+ if {[catch {cgi_import_cookie nick}] != 0} {set nick ""}
+
+ if {![string length $newnick]} {
+ WPCmd PEInfo statmsg "No entry created. New entries must include a Nickname."
+ set src takeedit
+ } else {
+ if {!$take || [catch {WPCmd PEAddress entry $book $newnick $ai} result] || ![llength $result]} {
+ set result ""
+ if {[catch {WPCmd PEAddress edit $book $newnick $ai $fn $addrs $fcc $comment $add $nick} result]} {
+ catch {WPCmd PEInfo statmsg "Address Set Failure: $result"}
+ set adderr $result
+ } elseif {[string length $result]} {
+ catch {WPCmd PEInfo statmsg "$result"}
+ set adderr $result
+ }
+
+ if {$take == 1} {
+ if {[info exists adderr]} {
+ WPCmd PEInfo statmsg "No address book entry changed: $adderr"
+ } else {
+ WPCmd PEInfo statmsg "New address book entry \"$newnick\" created."
+ }
+ }
+ } else {
+ set src takesame
+ }
+
+ if {$take == 1 && ![info exists src]} {
+ set src $oncancel
+ }
+ }
+} elseif {$delete == 1 || [string compare [string tolower $delete] "delete entry"] == 0} {
+ WPLoadCGIVar book
+ WPLoadCGIVar nick
+ WPLoadCGIVar ai
+
+ set result ""
+ if {[catch {WPCmd PEAddress delete $book $nick $ai} result]} {
+ catch {WPCmd PEInfo statmsg "Address Set Failure $result"}
+ } elseif {[string compare $result ""]} {
+ catch {WPCmd PEInfo statmsg "$result"}
+ }
+} elseif {[string compare [string tolower $replace] "replace entry"] == 0} {
+
+ WPLoadCGIVar book
+ WPLoadCGIVar newnick
+ WPLoadCGIVar ai
+ WPLoadCGIVar fn
+ WPLoadCGIVar addrs
+ WPLoadCGIVar fcc
+ WPLoadCGIVar comment
+ if {[catch {cgi_import_cookie add}] != 0} {set add 0}
+ if {[catch {cgi_import_cookie nick}] != 0} {set nick ""}
+
+ if {![string length $newnick]} {
+ WPCmd PEInfo statmsg "No entry created. New entries must include a Nickname."
+ set src takeedit
+ } else {
+ if {[catch {WPCmd PEAddress delete $book $newnick $ai} result]} {
+ set adderr $result
+ } else {
+ set result ""
+ if {[catch {WPCmd PEAddress edit $book $newnick $ai $fn $addrs $fcc $comment $add $nick} result]} {
+ catch {WPCmd PEInfo statmsg "Address Set Failure result"}
+ set adderr $result
+ } elseif {[string length $result]} {
+ catch {WPCmd PEInfo statmsg "$result"}
+ set adderr $result
+ }
+ }
+
+ if {$take == 1} {
+ if {[info exists adderr]} {
+ WPCmd PEInfo statmsg "No address book entry changed: $adderr."
+ } else {
+ WPCmd PEInfo statmsg "Address book entry \"$newnick\" replaced."
+ }
+
+ if {![info exists src]} {
+ set src $oncancel
+ }
+ }
+ }
+} elseif {[string compare [string tolower $replace] "add to entry"] == 0} {
+ WPLoadCGIVar book
+ WPLoadCGIVar newnick
+ WPLoadCGIVar ai
+ WPLoadCGIVar fn
+ WPLoadCGIVar addrs
+ WPLoadCGIVar fcc
+ WPLoadCGIVar comment
+ if {[catch {cgi_import_cookie add}] != 0} {set add 0}
+ if {[catch {cgi_import_cookie nick}] != 0} {set nick ""}
+
+ if {![string length $newnick]} {
+ WPCmd PEInfo statmsg "No entry created. New entries must include a Nickname."
+ set src takeedit
+ } else {
+ if {[catch {WPCmd PEAddress fullentry $book $newnick $ai} result] || ![llength $result]} {
+ if {[string length $result]} {
+ set adderr $result
+ } else {
+ set adderr "No pre-existing entry"
+ }
+ } else {
+ set fn [lindex $result 1]
+ set newaddrs [join [lindex $result 2] ","]
+ append newaddrs ", $addrs"
+ set fcc [lindex $result 3]
+ set comment [lindex $result 4]
+ set result ""
+ if {[catch {WPCmd PEAddress edit $book $newnick $ai $fn $newaddrs $fcc $comment 0 $newnick} result]} {
+ set adderr $result
+ } elseif {[string length $result]} {
+ catch {WPCmd PEInfo statmsg "$result"}
+ set adderr $result
+ }
+ }
+
+ if {$take == 1} {
+ if {[info exists adderr]} {
+ WPCmd PEInfo statmsg "No address book entry created: $adderr."
+ } else {
+ WPCmd PEInfo statmsg "Address book entry \"$newnick\" appended"
+ }
+
+ if {![info exists src]} {
+ set src $oncancel
+ }
+ }
+ }
+} elseif {[string compare [string tolower $replace] edit] == 0} {
+ set src takeedit
+} elseif {$compose == 1} {
+ set oncancel addrbook
+ set src compose
+} elseif {$cancel == 1 || [string compare [string tolower $cancel] cancel] == 0} {
+ if {$take == 1} {
+ set act "Take Address"
+ } else {
+ set act "Address Edit"
+ }
+
+ catch {WPCmd PEInfo statmsg "$act cancelled. Address book unchanged."}
+ set src $oncancel
+} else {
+ catch {WPCmd PEInfo statmsg "Unknown Address Book Operation"}
+}
+
+if {![info exists src]} {
+ set src addrbook
+}
+
+source [WPTFScript $src]
diff --git a/web/cgi/alpine/1.0/alpine.tcl b/web/cgi/alpine/1.0/alpine.tcl
new file mode 120000
index 00000000..5ad8d42f
--- /dev/null
+++ b/web/cgi/alpine/1.0/alpine.tcl
@@ -0,0 +1 @@
+../alpine.tcl \ No newline at end of file
diff --git a/web/cgi/alpine/1.0/attach.tcl b/web/cgi/alpine/1.0/attach.tcl
new file mode 100755
index 00000000..e0423171
--- /dev/null
+++ b/web/cgi/alpine/1.0/attach.tcl
@@ -0,0 +1,96 @@
+# $Id: attach.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# attach.tcl
+#
+# Purpose: CGI script to handle attaching attachment
+# to composition via queryattach generated form
+#
+# Input:
+set attach_vars {
+ {cid "Missing Command ID"}
+ {file "Missing File Upload Data"}
+ {attachop "" ""}
+ {cancel "" ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $attach_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ error [list _action "Impart Variable" $result]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cancel == 1 || [string compare cancel [string tolower $cancel]] == 0 || [string compare cancel [string tolower $attachop]] == 0} {
+} else {
+
+ if {$cid != [WPCmd PEInfo key]} {
+ catch {WPCmd PEInfo statmsg "Invalid Command ID"}
+ }
+
+ if {[string length [lindex $file 1]]} {
+ if {[catch {cgi_import description}]} {
+ set description ""
+ }
+
+ # "file" is a list: local_file remote_file content-type/content-subtype
+ # trim path from file name on remote system
+ # since we can't be certain what the delimiter is,
+ # try the usual suspects
+ set delims [list "\\" "/" ":"]
+ set native [lindex $file 1]
+ if {[string length $native]} {
+ foreach delim $delims {
+ if {[set crop [string last $delim $native]] >= 0} {
+ set native [string range $native [expr {$crop + 1}] [string length $native]]
+ break;
+ }
+ }
+
+ regsub -all "'" $native "\\'" jsnative
+
+ if {0 == [string length [lindex $file 2]]} {
+ set conttype [list text plain]
+ } else {
+ set conttype [split [lindex $file 2] "/"]
+ }
+
+ set id [WPCmd PECompose attach [lindex $file 0] [lindex $conttype 0] [lindex $conttype 1] $native $description]
+
+ catch {unset style}
+ set restore 1
+
+ if {[catch {WPCmd PEInfo lappend suspended_composition [list attach $id]} result]} {
+ WPCmd PEInfo statmsg "Cannot append attachment info, nothing attached"
+ }
+
+ set fsize [file size [lindex $file 0]]
+ if {$fsize <= 0} {
+ WPCmd PEInfo statmsg "Attachment $jsnative empty or nonexistant"
+ }
+ } else {
+ WPCmd PEInfo statmsg "Requested attachment does not exist"
+ }
+ } else {
+ catch {file delete [lindex $file 0]}
+ WPCmd PEInfo statmsg "Empty file name, nothing attached"
+ }
+}
+
+source [WPTFScript compose]
diff --git a/web/cgi/alpine/1.0/cledit.tcl b/web/cgi/alpine/1.0/cledit.tcl
new file mode 100755
index 00000000..dabf6044
--- /dev/null
+++ b/web/cgi/alpine/1.0/cledit.tcl
@@ -0,0 +1,232 @@
+#!./tclsh
+# $Id: cledit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+#
+# cledit.tcl
+#
+# Purpose: CGI script to generate html form editing of a single collection
+
+# read config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set cledit_vars {
+ {cid "Missing Command ID"}
+ {oncancel "Missing oncancel"}
+ {cl {} 0}
+ {add {} 0}
+ {errtext {} 0}
+ {nick {} ""}
+ {server {} ""}
+ {ssl {} 1}
+ {user {} ""}
+ {stype {} "imap"}
+ {path {} ""}
+ {view {} ""}
+ {onclecancel {} ""}
+}
+
+## read vars
+foreach item $cledit_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ if {[llength $item] > 2} {
+ set [lindex $item 0] [lindex $item 2]
+ } else {
+ error [list _action [lindex $item 1] $result]
+ }
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+set cledit_menu {
+ {
+ {}
+ {
+ {
+ # * * * * OK * * * *
+ if {$add} {
+ cgi_image_button cle_save=[WPimg but_save] border=0 alt="Save Config"
+ } else {
+ cgi_image_button cle_save=[WPimg but_save] border=0 alt="Save Config"
+ }
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * CANCEL * * * *
+ if {[string length $onclecancel]} {
+ cgi_puts [WPMenuURL "wp.tcl?page=$onclecancel&cid=$cid&oncancel=$oncancel" "" [cgi_img [WPimg but_cancel] border=0 alt="Cancel"] "" target=_top]
+ } else {
+ cgi_puts [WPMenuURL "wp.tcl?page=$oncancel&cid=$cid" "" [cgi_img [WPimg but_cancel] border=0 alt="Cancel"] "" target=_top]
+ }
+ }
+ }
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Collection List Configuration"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=clconfig target=_top {
+ cgi_text "cid=$cid" type=hidden notab
+ cgi_text "page=conf_process" type=hidden notab
+ cgi_text "cp_op=clconfig" type=hidden notab
+ cgi_text "oncancel=$oncancel" type=hidden notab
+ cgi_text "cl=$cl" type=hidden notab
+ cgi_text "add=$add" type=hidden notab
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ #
+ # next comes the menu down the left side
+ #
+ eval {
+ cgi_table_data $_wp(menuargs) rowspan=4 {
+ WPTFCommandMenu cledit_menu {}
+ }
+ }
+ }
+
+ #
+ # In main body of screen goe confg list
+ #
+ cgi_table_row {
+ cgi_table_data valign=top width="100%" class=dialog {
+ if {$add == 0 && $errtext == 0} {
+ set item [WPCmd PEConfig clextended $cl]
+ set nick [lindex $item 0]
+ set server [lindex $item 2]
+ set path [lindex $item 3]
+ set view [lindex $item 4]
+ set user ""
+ set stype "imap"
+ set ssl 0
+ }
+ set server_flags {
+ ssl
+ user
+ imap
+ }
+ # jpf: took out nntp, service, and pop3
+ foreach flag $server_flags {
+ if {[regexp -nocase "^\[^/\]*(/\[^/\]*)*(/$flag\[^/\]*)(/\[^/\]*)*" $server match junk1 flagset junk2]} {
+ set regprob 1
+ if {[regexp -nocase "^/$flag\$" $flagset]} {
+ set regprob 0
+ if {[string compare [string tolower $flag] "ssl"] == 0} {
+ set ssl 1
+ } elseif {[regexp -nocase "(imap|nntp|pop3)" $flag]} {
+ set stype "$flag"
+ } else {
+ set regprob 1
+ }
+ } elseif {[regexp -nocase "^/user=(.*)\$" $flagset match tuser]} {
+ set user "$tuser"
+ set regprob 0
+ } elseif {[regexp -nocase "^/service=(.*)\$" $flagset match tuser]} {
+ if {[regexp -nocase "(imap|nntp|pop3)" $tuser]} {
+ set stype "$stype"
+ } else {set regprob 1}
+ } else {
+ set regprob 1
+ }
+ if {$regprob == 0} {
+ regsub -nocase "^(\[^/\]*)(/\[^/\]*)*(/$flag\[^/\]*)(/\[^/\]*)*" $server "\\1\\2\\4" server
+ }
+ }
+ }
+ cgi_table border=0 cellspacing=0 cellpadding=5 {
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_puts "[cgi_font size=+1 "Nickname[cgi_nbspace]: "]"
+ }
+ cgi_table_data align=left {
+ cgi_text "nick=$nick" size=40 notab
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=right valign=top {
+ cgi_puts "[cgi_font size=+1 "Server[cgi_nbspace]: "]"
+ }
+ cgi_table_data align=left {
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" {
+ cgi_table_row {
+ cgi_table_data colspan=2 {
+ cgi_text "server=$server" size=40 notab
+ }
+ }
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts "[cgi_font size=-1 "SSL"]"
+ if {$ssl == 1} {
+ set checked checked
+ } else {
+ set checked ""
+ }
+ cgi_checkbox "ssl" style=background-color:$_wp(dialogcolor) $checked
+ }
+ cgi_table_data align=right {
+ cgi_puts "[cgi_font size=-1 "User:[cgi_nbspace]"]"
+ cgi_text "user=$user" size=10 notab
+ }
+ cgi_text "stype=imap" type=hidden notab
+ }
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_puts "[cgi_font size=+1 "Path[cgi_nbspace]: "]"
+ }
+ if {[string compare "nntp" $stype] == 0 && [regexp -nocase {^#news\.(.*)$} $path match rempath]} {
+ set path "$rempath"
+ }
+ cgi_table_data align=left {
+ cgi_text "path=$path" size=40 notab
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_puts "[cgi_font size=+1 "View[cgi_nbspace]: "]"
+ }
+ cgi_table_data align=left {
+ cgi_text "view=$view" size=40 notab
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data height=200 class=dialog {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/cmdfunc.tcl b/web/cgi/alpine/1.0/cmdfunc.tcl
new file mode 100755
index 00000000..949baf0f
--- /dev/null
+++ b/web/cgi/alpine/1.0/cmdfunc.tcl
@@ -0,0 +1,639 @@
+#!./tclsh
+# $Id: cmdfunc.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# cmdfunc.tcl
+#
+# Purpose: CGI script to serve as single location for menu/command
+# function definitions
+#
+# OPTIMIZE: have servlet interpreter grok/exec these?
+#
+# Input:
+
+# Output:
+#
+
+proc WPTFTitle {{context {some page}} {newmail {}} {nologo 0} {aboutcancel {}}} {
+ global _wp
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" class=title {
+ cgi_table_row {
+ if {!$nologo} {
+ cgi_table_data valign=top align=left height=$_wp(titleheight) {
+
+ if {[string length $aboutcancel]} {
+ cgi_put [cgi_url [cgi_imglink smalllogo] wp.tcl?page=help&topic=about&oncancel=$aboutcancel class=navbar target=_top]
+ } else {
+ cgi_put [cgi_imglink smalllogo]
+ }
+ }
+ }
+
+ # work in new mail here
+ if {[llength $newmail]} {
+ cgi_table_data align=center {
+ WPTFStatusTable $newmail
+ }
+ }
+
+ cgi_table_data align=right valign=middle height=$_wp(titleheight) {
+ cgi_put [cgi_span "style=margin-right: 8; color: $_wp(titlecolor)" "$context"]
+ }
+ }
+ }
+}
+
+proc WPTFStatusTable {msgs {iconlink {0}} {style {}}} {
+ global _wp
+
+ cgi_table width=100% border=0 cellpadding=0 cellspacing=0 $style {
+ cgi_table_row align=right {
+
+ if {[info exists _wp(statusicons)] && $_wp(statusicons)} {
+ set img [cgi_imglink bang]
+ set snd ""
+ foreach m $msgs {
+ if {[string length [lindex $m 1]]} {
+ set img [cgi_imglink [lindex $m 1]]
+ if {$iconlink && [string length [lindex $m 2]]} {
+ set img [cgi_url $img wp.tcl?page=view&uid=[lindex $m 2] target=body]
+ }
+
+ set snd [lindex $m 3]
+ break
+ }
+ }
+
+ cgi_table_data {
+ cgi_puts ${img}${snd}
+ }
+ }
+
+ cgi_table_data align=center class="statustext" {
+ set i 0
+
+ foreach m $msgs {
+
+ if {[array exists lastmsg] && [info exists lastmsg([lindex $m 0])]} {
+ incr lastmsg([lindex $m 0])
+ continue
+ }
+
+ if {0 == [string compare [string range [lindex $m 0] 0 20] "Alert received while "]} {
+ set style "style=border: 1px solid red ; background-color: pink; padding: 2; width: 80%;"
+ } elseif {!([info exists _wp(statusicons)] && $_wp(statusicons))} {
+ set style "style=color: white ; background-color: $_wp(menucolor); padding-left:8px; padding-right:8px; white-space: nowrap;"
+ } else {
+ set style
+ }
+
+ if {$iconlink && [string length [lindex $m 2]] && !([info exists _wp(statusicons)] && $_wp(statusicons))} {
+ set txt [cgi_url [lindex $m 0] wp.tcl?page=fr_view&uid=[lindex $m 2] target=body "style=text-decoration: none; color: white"]
+ } else {
+ set txt [lindex $m 0]
+ }
+
+ cgi_division "style=\"padding-bottom: 1px\"" {
+ cgi_puts [cgi_span $style $txt]
+ }
+
+ set lastmsg([lindex $m 0]) 1
+ }
+ }
+
+ if {[info exists _wp(statusicons)] && $_wp(statusicons)} {
+ cgi_table_data align=left {
+ cgi_puts $img
+ }
+ }
+ }
+ }
+}
+
+
+proc WPTFImageButton {args} {
+ return [cgi_buffer {eval cgi_image_button $args border=0}]
+}
+
+proc WPTFCommandMenu {s_menu c_menu} {
+ global _wp
+
+ set clist {}
+ if {[string length $s_menu]} {
+ upvar $s_menu specificmenu
+ if {[llength $specificmenu]} {
+ lappend clist $specificmenu
+ }
+ }
+
+ if {[string length $c_menu]} {
+ upvar $c_menu commonmenu
+ if {[llength $commonmenu]} {
+ if {[llength $clist]} {
+ lappend clist {}
+ }
+ lappend clist $commonmenu
+ }
+ }
+
+ cgi_table border=0 bgcolor=$_wp(menucolor) cellpadding=0 cellspacing=0 width=112 "style=\"padding: 8 0 8 4\"" {
+ foreach menulist $clist {
+ switch [llength $menulist] {
+ 0 {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_hr "width=75%"
+ }
+ }
+ }
+ default {
+ foreach item $menulist {
+ if {[llength $item] == 0} {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_hr "width=75%"
+ }
+ }
+ continue
+ }
+ if {[llength $item] == 1} {
+ cgi_table_row {
+ cgi_table_data {
+ eval [lindex $item 0]
+ }
+ }
+ continue
+ }
+ if {[string length [lindex $item 0]]} {
+ if {[uplevel [lindex $item 0]] == 0} {
+ continue
+ }
+ }
+
+ cgi_table_row {
+ foreach l [lindex $item 1] {
+ cgi_table_data align=left valign=middle class=navbar {
+ uplevel $l
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+proc WPTFScript {scrpt {dflt ""}} {
+ global _wp
+
+ switch -- $scrpt {
+ main {
+ set src main.tcl
+ }
+ index {
+ set src index.tcl
+ WPCmd PEInfo set wp_body_script $src
+ }
+ view {
+ set src view.tcl
+ WPCmd PEInfo set wp_body_script $src
+ }
+ body {
+ if {[catch {WPCmd PEInfo set wp_body_script} src]} {
+ set src index.tcl
+ catch {WPCmd PEInfo set wp_body_script $src}
+ }
+ }
+ fr_view {
+ set src do_view.tcl
+ }
+ quit {
+ set src fr_queryquit.tcl
+ }
+ folders {
+ set src folders.tcl
+ }
+ fldrbrowse {
+ set src fldrbrowse.tcl
+ }
+ fldrsavenew {
+ set src fldrsavenew.tcl
+ }
+ fldrdel {
+ set src fr_querydelfldr.tcl
+ }
+ compose {
+ set src fr_compose.tcl
+ }
+ addrbrowse {
+ set src fr_addrbrowse.tcl
+ }
+ savebrowse {
+ set src fr_fldrbrowse.tcl
+ }
+ savecreate {
+ set src fr_fldrsavenew.tcl
+ }
+ take {
+ set src fr_take.tcl
+ }
+ takeedit {
+ set src fr_takeedit.tcl
+ }
+ takesame {
+ set src fr_takesame.tcl
+ }
+ ldapbrowse {
+ set src fr_ldapbrowse.tcl
+ }
+ addrbook {
+ set src addrbook.tcl
+ }
+ tconfig {
+ set src tconfig.tcl
+ }
+ cledit {
+ set src cledit.tcl
+ }
+ filtedit {
+ set src filtedit.tcl
+ }
+ conf_process {
+ set src conf_process.tcl
+ }
+ resume {
+ set src fr_resume.tcl
+ }
+ spell {
+ set src fr_spellcheck.tcl
+ }
+ auth {
+ set src fr_queryauth.tcl
+ }
+ expunge {
+ set src fr_queryexpunge.tcl
+ }
+ askattach {
+ set src fr_queryattach.tcl
+ }
+ ldapquery {
+ set src fr_ldapquery.tcl
+ }
+ querycreate {
+ set src fr_querycreate.tcl
+ }
+ queryprune {
+ set src fr_queryprune.tcl
+ }
+ attach {
+ set src attach.tcl
+ }
+ dosend {
+ set src dosend.tcl
+ }
+ docancel {
+ set src docancel.tcl
+ }
+ help {
+ set src fr_help.tcl
+ }
+ split {
+ set src fr_split.tcl
+ }
+ default {
+ if {[regexp {.*\.tcl$} $scrpt s]} {
+ set src $scrpt
+ } elseif {[string length $dflt]} {
+ set src $dflt
+ } else {
+ error "Unrecognized script abbreviation: $scrpt"
+ }
+ }
+ }
+
+ return [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) $src]
+}
+
+proc WPTFSaveDefault {{uid 0}} {
+ # "size" rather than "number" to work around temporary alpined bug
+ if {$uid == 0
+ || [catch {WPCmd PEMessage $uid size} n]
+ || $n == 0
+ || [catch {WPCmd PEMessage $uid savedefault} savedefault]} {
+ if {[WPCmd PEFolder isincoming 0]} {
+ set colid 1
+ } else {
+ set colid 0
+ }
+
+ return [list $colid "saved-messages"]
+ }
+
+ return $savedefault
+}
+
+if {$_wp(keybindings)} {
+ proc WPTFKeyEquiv {kl {exclusions {}} {frame window}} {
+ if {[llength $kl] > 0} {
+ WPStdScripts
+
+ append js "function bindListener(o,f)\{"
+ if {[isW3C]} {
+ append js "o.addEventListener('keypress',f, false);\n"
+ set cancelkeystroke "e.preventDefault(); return false;"
+ } elseif {[isIE]} {
+ append js "o.onkeydown = f;\n"
+ set cancelkeystroke "return false;"
+ } else {
+ append js "o.onkeydown = f;"
+ append js "o.captureEvents(Event.KEYDOWN);\n"
+ set cancelkeystroke "return false;"
+ }
+ append js "\}\n"
+
+ append js "function nobubble(e)\{"
+ if {[isW3C]} {
+ append js " e.stopPropagation();"
+ } elseif {[isIE]} {
+ append js " event.cancelBubble = true;"
+ }
+ append js "\}\n"
+
+ append js "function keyed(e)\{"
+ if {[isW3C] && [llength $exclusions]} {
+ set ex ""
+ foreach o $exclusions {
+ if {[string length $ex]} {
+ append ex " || "
+ }
+
+ append ex "e.target == $o"
+ }
+ append js "if (e.target && ($ex)) return true;"
+ }
+ append js " var c = getKeyStr(e);"
+ append js " if(getControlKey(e))\{"
+ append js " switch(c)\{"
+ append js " case 'n' : window.status = 'New window creation disabled in WebPine.' ; $cancelkeystroke"
+ append js " \}"
+ append js " \}"
+ append js " else"
+ append js " switch(c)\{"
+ foreach kb $kl {
+ append js " case '[lindex $kb 0]' : ${frame}.webpinelink = 1; [lindex $kb 1] ; $cancelkeystroke"
+ }
+
+ append js " \}\}\n"
+
+ set onload "bindListener(document,keyed);"
+
+ if {![isW3C]} {
+ foreach o $exclusions {
+ append onload "bindListener($o,nobubble);"
+ }
+ }
+
+ cgi_javascript {
+ cgi_puts $js
+ }
+
+ return $onload
+ }
+ }
+}
+
+# add given folder name to the cache of saved-to folders
+proc WPTFAddSaveCache {f_name} {
+ global _wp
+
+ if {[catch {WPSessionState save_cache} flist] == 0} {
+ if {[set i [lsearch -exact $flist $f_name]] < 0} {
+ set flist [lrange $flist 0 [expr {$_wp(save_cache_max) - 2}]]
+ } else {
+ set flist [lreplace $flist $i $i]
+ }
+
+ set flist [linsert $flist 0 $f_name]
+ } else {
+ set flist [list $f_name]
+ }
+
+ catch {WPSessionState save_cache $flist}
+}
+
+# return the list of cached saved-to folders and make sure given
+# default is somewhere in the list
+proc WPTFGetSaveCache {{def_name ""}} {
+
+ if {![string length $def_name]} {
+ set savedef [WPTFSaveDefault 0]
+ set def_name [lindex $savedef 1]
+ }
+
+ set seen ""
+
+ if {[catch {WPSessionState save_cache} flist] == 0} {
+ foreach f $flist {
+ if {[string compare $def_name $f] == 0} {
+ set def_listed 1
+ }
+
+ if {[string length $f] && [lsearch -exact $seen $f] < 0} {
+ lappend options $f
+ lappend options $f
+ lappend seen $f
+ }
+ }
+ }
+
+ if {!([info exists options] && [info exists def_listed])} {
+ lappend options $def_name
+ lappend options $def_name
+ }
+
+ if {[catch {WPCmd set wp_cache_folder} wp_cache_folder]
+ || [string compare $wp_cache_folder [WPCmd PEMailbox mailboxname]]} {
+ # move default to top on new folder
+ switch -- [set x [lsearch -exact $options $def_name]] {
+ 0 { }
+ default {
+ if {$x > 0} {
+ set options [lreplace $options $x [expr {$x + 1}]]
+ }
+
+ set options [linsert $options 0 $def_name]
+ set options [linsert $options 0 $def_name]
+ }
+ }
+
+ catch {WPCmd set wp_cache_folder [WPCmd PEMailbox mailboxname]}
+ }
+
+ lappend options "\[ folder I type in \]"
+ lappend options "__folder__prompt__"
+
+ lappend options "\[ folder in my folder list \]"
+ lappend options "__folder__list__"
+
+ return $options
+}
+
+# add given folder name to the visited folder cache
+proc WPTFAddFolderCache {f_col f_name} {
+ global _wp
+
+ if {$f_col != 0 || [string compare [string tolower $f_name] inbox]} {
+ if {0 == [catch {WPSessionState folder_cache} flist]} {
+
+ if {[catch {WPSessionState left_column_folders} fln]} {
+ set fln $_wp(fldr_cache_def)
+ }
+
+ for {set i 0} {$i < [llength $flist]} {incr i} {
+ set f [lindex $flist $i]
+ if {$f_col == [lindex $f 0] && 0 == [string compare [lindex $f 1] $f_name]} {
+ break
+ }
+ }
+
+ if {$i >= [llength $flist]} {
+ set flist [lrange $flist 0 $fln]
+ } else {
+ set flist [lreplace $flist $i $i]
+ }
+
+ set flist [linsert $flist 0 [list $f_col $f_name]]
+ # let users of data know it's changed (cheaper than hash)
+ WPScriptVersion common 1
+ } else {
+ catch {unset flist}
+ lappend flist [list $f_col $f_name] [list [WPTFSaveDefault 0]]
+ # ditto
+ WPScriptVersion common 1
+ }
+
+ catch {WPSessionState folder_cache $flist}
+ }
+}
+
+# return the list of cached visited folders and make sure given
+# default is somewhere in the list
+proc WPTFGetFolderCache {} {
+ if {[catch {WPSessionState folder_cache} flist]} {
+ catch {unset flist}
+ lappend flist [WPTFSaveDefault 0]
+ catch {WPSessionState folder_cache $flist}
+ }
+
+ return $flist
+}
+
+proc WPExitOnClose {{frame window}} {
+ global _wp
+
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_put "function wpLink(){"
+ cgi_put " ${frame}.webpinelink = 1;"
+ cgi_put " return true;"
+ cgi_puts "}"
+ cgi_put "function wpLoad(){"
+ cgi_put " ${frame}.webpinelink = 0;"
+ cgi_puts "}"
+ cgi_put "function wpUnLoad(){"
+ cgi_put " if(!${frame}.webpinelink){"
+ cgi_put " window.open('[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/ripcord.tcl?t=10&cid=[WPCmd PEInfo key]','Depart','width=350,height=200');"
+ cgi_put " }"
+ cgi_puts "}"
+ }
+
+ uplevel 1 {
+
+ # tweak some cgi_* procs for global effect
+ if {0 == [catch {rename cgi_url _wp_orig_cgi_url}]} {
+ proc cgi_url {args} {
+ lappend newargs [lindex $args 0]
+ foreach a [lrange $args 1 end] {
+ if {[regexp "^(onClick)=(.*)" $a dummy attr str]} {
+ set onclicked 1
+ lappend newargs "${attr}=wpLink();${str}"
+ } else {
+ lappend newargs $a
+ }
+ }
+
+ if {![info exists onclicked]} {
+ lappend newargs "onClick=wpLink();"
+ }
+
+ return [eval "_wp_orig_cgi_url $newargs"]
+ }
+ }
+
+ if {0 == [catch {rename cgi_area _wp_orig_cgi_area}]} {
+ proc cgi_area {args} {
+ lappend newargs [lindex $args 0]
+ foreach a [lrange $args 1 end] {
+ if {[regexp "^(onClick)=(.*)" $a dummy attr str]} {
+ set onclicked 1
+ lappend newargs "${attr}=\"wpLink();${str}\""
+ } else {
+ lappend newargs $a
+ }
+ }
+
+ if {![info exists onclicked]} {
+ lappend newargs "onClick=\"return wpLink();\""
+ }
+
+ return [eval "_wp_orig_cgi_area $newargs"]
+ }
+ }
+
+ if {0 == [catch {rename cgi_form _wp_orig_cgi_form}]} {
+ proc cgi_form {args} {
+ foreach a [lrange $args 0 [expr [llength $args]-2]] {
+ if {[regexp "^onSubmit=(.*)" $a dummy str]} {
+ set onsubmitted 1
+ lappend newargs "onSubmit=wpLink(); ${str}"
+ } else {
+ lappend newargs $a
+ }
+ }
+
+ if {![info exists onsubmitted]} {
+ lappend newargs "onSubmit=return wpLink();"
+ }
+
+ lappend newargs [lindex $args end]
+
+ uplevel 1 "_wp_orig_cgi_form $newargs"
+ }
+ }
+ }
+}
+
+proc WPTFIndexWidthRatio {fields field} {
+ # should be formula based on total fields
+ # and number of "wider" fields
+ switch [string toupper $field] {
+ TO -
+ FROM -
+ FROMORTO -
+ FROMORTONOTNEWS -
+ RECIPS -
+ SENDER -
+ SUBJECT { return 1.25 }
+ default { return 1 }
+ }
+}
diff --git a/web/cgi/alpine/1.0/common.tcl b/web/cgi/alpine/1.0/common.tcl
new file mode 100755
index 00000000..4a540cc8
--- /dev/null
+++ b/web/cgi/alpine/1.0/common.tcl
@@ -0,0 +1,289 @@
+#!./tclsh
+# $Id: common.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# common.tcl
+#
+# Purpose: CGI script snippet to generate html output associated
+# with the WebPine message view/index ops frame
+#
+# Input:
+set ops_vars {
+}
+
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set padleft 3px
+
+#
+# Command Menu definition for Message View Screen
+#
+set view_menu {
+}
+
+set common_menu {
+ {
+ {expr {0}}
+ {
+ {
+ # * * * * UBIQUITOUS INBOX LINK * * * *
+ if {[string compare inbox [string tolower [WPCmd PEMailbox mailboxname]]]} {
+ cgi_put [cgi_url INBOX open.tcl?folder=INBOX&colid=0&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url INBOX fr_index.tcl target=spec class=navbar]
+ }
+ }
+ }
+ }
+ {
+ {expr {0}}
+ {
+ {
+ # * * * * FOLDER LIST * * * *
+ cgi_puts [cgi_url "Folder List" "wp.tcl?page=folders&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * COMPOSE * * * *
+ cgi_puts [cgi_url Compose wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * RESUME * * * *
+ cgi_puts [cgi_url Resume wp.tcl?page=resume&oncancel=main.tcl&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Addr books * * * *
+ cgi_puts [cgi_url "Address Book" wp.tcl?page=addrbook&oncancel=main.tcl target=_top class=navbar]
+ }
+ }
+ }
+}
+
+
+WPEval $ops_vars {
+ cgi_http_head {
+ WPStdHttpHdrs {} 60
+ }
+
+ cgi_html {
+ cgi_head {
+ if {[info exists _wp(exitonclose)]} {
+ WPExitOnClose top.spec.body
+ }
+
+ WPStyleSheets
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_puts "function flip(n){"
+ cgi_put " var d = top.spec.body.document;"
+ cgi_put " var f = d.index;"
+ cgi_put " if(f && document.implementation){"
+ cgi_put " var e = d.createElement('input');"
+ cgi_put " var ver = navigator.appVersion;"
+ cgi_put " if(!((ver.indexOf('MSIE')+1) && (ver.indexOf('Macintosh')+1))) e.type = 'hidden';"
+ cgi_put " e.name = 'bod_'+n;"
+ cgi_put " e.value = '1';"
+ cgi_put " f.appendChild(e);"
+ cgi_put " f.submit();"
+ cgi_put " return false;"
+ cgi_puts " }"
+ cgi_puts " return true;"
+ cgi_puts "}"
+ }
+
+ if {$_wp(keybindings)} {
+ set kequiv {
+ {{l} {top.location = 'wp.tcl?page=folders'}}
+ {{a} {top.location = 'wp.tcl?page=addrbook'}}
+ {{?} {top.location = 'wp.tcl?page=help'}}
+ {{n} {if(flip('next')) top.spec.body.location = 'wp.tcl?page=body&bod_next=1'}}
+ {{p} {if(flip('prev')) top.spec.body.location = 'wp.tcl?page=body&bod_prev=1'}}
+ {{i} {if(top.spec.cmds) top.spec.location = 'fr_index.tcl'}}
+ {{s} {if(top.spec.cmds) top.spec.cmds.document.saveform.f_name.focus()}}
+ {{d} {if(top.spec.cmds) top.spec.cmds.document.delform.op[0].click()}}
+ {{u} {if(top.spec.cmds) top.spec.cmds.document.delform.op[1].click()}}
+ {{r} {if(top.spec.cmds) top.spec.cmds.document.replform.op.click()}}
+ {{f} {if(top.spec.cmds) top.spec.cmds.document.forwform.op.click()}}
+ {{ } {if(top.spec.body.document.index && flip('next')) top.spec.body.location = 'wp.tcl?page=body&bod_next=1'}}
+ {{-} {if(top.spec.body.document.index && flip('prev')) top.spec.body.location = 'wp.tcl?page=body&bod_prev=1'}}
+ {{z} {if(top.spec.body.document.index && top.spec.body.document.index.zoom) top.spec.body.document.index.zoom.click()}}
+ }
+
+ lappend kequiv [list {c} "top.location = 'wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key]'"]
+
+ if {[WPCmd PEInfo feature enable-full-header-cmd]} {
+ lappend kequiv [list {h} "if(top.spec.cmds.document.saveform) top.spec.body.location = 'wp.tcl?page=view&fullhdr=flip'"]
+ }
+
+ set onload "onLoad=[WPTFKeyEquiv $kequiv {} top.spec.body] top.gen.focus();"
+ }
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) $onload {
+
+ cgi_put [cgi_url [cgi_imglink smalllogo] wp.tcl?page=help&topic=about class=navbar target=_top]
+
+ cgi_br
+
+ cgi_division class=navbar "style=\"background-color: $_wp(menucolor)\"" {
+ cgi_division "style=\"padding: 8px 0 2px $padleft\"" {
+ cgi_puts [cgi_span "style=font-weight: bold" "Current Folder"]
+ }
+
+ set mbn [WPCmd PEMailbox mailboxname]
+ if {[string length $mbn] > 16} {
+ set mbn "[string range $mbn 0 14]..."
+ }
+
+ cgi_division align=center {
+ cgi_put [cgi_url $mbn fr_index.tcl target=spec class=navbar]
+
+ switch -exact -- [WPCmd PEMailbox state] {
+ readonly {
+ cgi_br
+ cgi_put [cgi_span "style=color: yellow; font-weight: bold" "(Read Only)"]
+ }
+ closed {
+ cgi_br
+ cgi_put [cgi_span "style=color: yellow; font-weight: bold" "(Closed)"]
+ }
+ ok -
+ default {}
+ }
+ }
+
+ cgi_hr "width=75%" "style=\"margin-top:8px\""
+
+ # Common Navigation controls
+ cgi_division align=center "style=\"padding-bottom: 4px\"" {
+ cgi_put [cgi_img [WPimg but_rnd_block] border=0 "usemap=#nav" "alt=Navigation Controls"]
+ cgi_map nav {
+ cgi_area shape=rect coords=0,0,37,38 "href=wp.tcl?page=body&bod_prev=1" target=body "onClick=\"return flip('prev')\"" "alt=Previous"
+ cgi_area shape=rect coords=0,40,32,74 "href=wp.tcl?page=body&bod_next=1" target=body "onClick=\"return flip('next')\"" "alt=Next"
+ cgi_area shape=rect coords=50,0,82,38 "href=wp.tcl?page=body&bod_first=1" target=body "onClick=\"return flip('first')\"" "alt=First"
+ cgi_area shape=rect coords=50,40,82,74 "href=wp.tcl?page=body&bod_last=1" target=body "onClick=\"return flip('last')\"" "alt=Last"
+ }
+
+ # Jump option
+ if {[WPCmd PEInfo feature enable-jump-cmd]} {
+ cgi_br
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=body name=goform "style=margin-top:6" {
+ cgi_text "page=body" type=hidden notab
+ cgi_text gonum= class=navtext size=4 maxlength=6 "onClick=this.select()"
+ if {0} {
+ cgi_br
+ cgi_submit_button "goto=Jump to Msg \#" class=navtext "style=margin-right:2;margin-top:6"
+ } else {
+ cgi_submit_button "goto=Jump" class=navtext "style=margin-right:2"
+ }
+ }
+ }
+ }
+
+ cgi_hr "width=75%"
+
+ cgi_division "style=\"padding: 0 0 6px $padleft\"" {
+
+ if {[catch {WPSessionState left_column_folders} fln]} {
+ set fln $_wp(fldr_cache_def)
+ }
+
+ if {$fln > 0} {
+ cgi_puts [cgi_span "style=font-weight: bold" "Folders"]
+ cgi_division "style=\"padding-left: 4px\"" {
+ # UBIQUITOUS INBOX LINK
+ if {[string compare inbox [string tolower [WPCmd PEMailbox mailboxname]]]} {
+ cgi_put [cgi_url INBOX open.tcl?folder=INBOX&colid=0&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url INBOX fr_index.tcl target=spec class=navbar]
+ }
+
+ set n 0
+ set fc [WPTFGetFolderCache]
+ for {set i 0} {$i < [llength $fc] && $i < $fln} {incr i} {
+ set f [lindex $fc $i]
+
+ if {0 == [catch {WPCmd PEFolder exists [lindex $f 0] [lindex $f 1]} result] && $result} {
+ cgi_br
+
+ set fn [lindex $f 1]
+ if {[string length $fn] > 15} {
+ set fn "...[string range $fn end-15 end]"
+ }
+
+ if {[string compare [lindex $f 1] [WPCmd PEMailbox mailboxname]]} {
+ cgi_put [cgi_url $fn "open.tcl?folder=[lindex $f 1]&colid=[lindex $f 0]&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url $fn fr_index.tcl target=spec class=navbar]
+ }
+
+ if {[incr n] >= $fln} {
+ break
+ }
+ }
+ }
+
+ cgi_br
+ cgi_puts [cgi_url "More Folders..." "wp.tcl?page=folders&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ }
+ } else {
+ cgi_puts [cgi_url "Folder List" "wp.tcl?page=folders&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ }
+ }
+
+ cgi_hr "width=75%"
+
+ # Common Operations
+ cgi_division "style=\"padding: 0 0 0 $padleft\"" {
+ # * * * * COMPOSE * * * *
+ cgi_puts [cgi_url Compose wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ cgi_br
+ # * * * * RESUME * * * *
+ cgi_puts [cgi_url Resume wp.tcl?page=resume&oncancel=main.tcl&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ cgi_br
+ # * * * * Addr books * * * *
+ cgi_puts [cgi_url "Address Book" wp.tcl?page=addrbook&oncancel=main.tcl target=_top class=navbar]
+ }
+
+ cgi_division "style=\"padding: 12px 0 0 $padleft\"" {
+ cgi_put [cgi_url "Configure" wp.tcl?page=conf_process&newconf=1&oncancel=main.tcl&cid=[WPCmd PEInfo key] class=navbar target=_top]
+ cgi_br
+ cgi_put [cgi_url "Get Help" wp.tcl?page=help class=navbar target=_top]
+ }
+
+ cgi_division "style=\"padding: 12px 0 10px $padleft\"" {
+ if {[WPCmd PEInfo feature quit-without-confirm]} {
+ cgi_puts [cgi_url "Quit $_wp(appname)" $_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=$sessid target=_top class=navbar]
+ } else {
+ cgi_puts [cgi_url "Quit $_wp(appname)" wp.tcl?page=quit&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/compose.tcl b/web/cgi/alpine/1.0/compose.tcl
new file mode 100755
index 00000000..d5a6af3d
--- /dev/null
+++ b/web/cgi/alpine/1.0/compose.tcl
@@ -0,0 +1,804 @@
+#!./tclsh
+# $Id: compose.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# compose.tcl
+#
+# Purpose: TCL script to generate html form representing
+# a message composition.
+
+# Input:
+set compose_vars {
+ {uid "" 0}
+ {style "" ""}
+ {nickto "" ""}
+ {book "" 0}
+ {ai "" -1}
+ {notice "" ""}
+ {repall "" 0}
+ {reptext "" 0}
+ {repqstr "" ""}
+ {f_name "" ""}
+ {f_colid "" 0}
+ {cid "Missing Command ID"}
+ {spell "" ""}
+ {oncancel "" "main.tcl"}
+}
+
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+# Output:
+#
+
+set bgcolor $_wp(dialogcolor)
+set buttoncolor "ffcc66"
+
+# set the default for the compose form. Modern browsers should submit
+# in the character set of the HTML form.
+set default_charset "UTF-8"
+
+#set cancelmsg "Really Cancel your Message (and destroy its text)"
+
+set msgs(cancel) "Cancel message (answering OK will abandon your mail message)"
+
+set msgs(noattach) {[ Message has no attachments ]}
+
+set defaultheaders {to cc subject attach}
+
+set fccname ""
+
+proc fieldname {name} {
+ regsub -all -- {-} [string tolower $name] {_} fieldname
+ return $fieldname
+}
+
+proc default_fcc {itemval} {
+ global fccdefault f_name f_colid
+
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ set collections ""
+ }
+
+ # fcc's itemval should be a list of collection-id and folder-name
+ if {[llength $itemval] == 2} {
+ set fcccol [lindex $itemval 0]
+ set fccname [lindex $itemval 1]
+ } elseif {[string length $f_name]} {
+ set fcccol $f_colid
+ set fccname $f_name
+ } elseif {[info exists fccdefault] || [catch {WPCmd PECompose fccdefault} fccdefault] == 0} {
+ set fcccol [lindex $fccdefault 0]
+ set fccname [lindex $fccdefault 1]
+ unset fccdefault
+ } else {
+ set fccname sent-mail
+ if {[llength $collections] > 1} {
+ set fcccol 1
+ } else {
+ set fcccol 0
+ }
+ }
+
+ return [list $fccname $fcccol $collections]
+}
+
+proc rowfield {item itemval style} {
+ global _wp msgs attachments bgcolor postoption fccname cols
+
+ set litem [string tolower $item]
+
+ if {$cols == 80} {
+ set textsize "60%"
+ } else {
+ set textsize $cols
+ }
+
+ cgi_table_row class=body $style bgcolor="$bgcolor" {
+ cgi_table_data align=left class=comphdr width=60 {
+ switch -- [string tolower $item] {
+ attach {
+ #cgi_submit_button "queryattach=Attach" class="comphdrbtn"
+ cgi_put Attachments
+ }
+ x_fcc {
+ cgi_submit_button "br_fcc=Fcc" class=comphdrbtn
+ }
+ default {
+ cgi_put $item
+ }
+ }
+ }
+
+ cgi_table_data align=center class=comphdr "style=\"padding: 0px 6px 0px 2px\"" {
+ cgi_put [cgi_bold ":"]
+ }
+
+ cgi_table_data align=left valign=middle class=comptext "style=\"padding: 2px 0px\"" nowrap {
+ switch -- [string tolower $item] {
+ attach {
+ cgi_table border=0 cellpadding=0 cellspacing=0 width="100%" {
+ cgi_table_row {
+ set alist ""
+ cgi_table_data align=left {
+ if {[info exists attachments] && [set n [llength $attachments]]} {
+ cgi_table border=0 cellpadding=0 cellspacing=0 width="100%" {
+ # format: {ID TITLE SIZE TYPE}
+ set i 1
+ foreach a $attachments {
+ cgi_table_row {
+ if {$n > 1} {
+ cgi_table_data {
+ cgi_puts [cgi_font face=Helvetica "$i)"]
+ }
+ incr i
+ }
+ cgi_table_data valign=middle align=left {
+ set id [lindex $a 0]
+ cgi_puts [cgi_font face=Helvetica "[lindex $a 1] ([lindex $a 2] bytes) [lindex $a 3]"]
+ lappend alist $id
+ }
+ cgi_table_data align=right height=23 width=23 {
+ cgi_image_button detach_${id}=[WPimg but_remove] border=0 align=right alt="Delete Attachment"
+ }
+ }
+ }
+ }
+ } else {
+ cgi_put [cgi_font size="-1" face=Helvetica $msgs(noattach)]
+ }
+
+ cgi_text attachments=[join $alist ","] type=hidden notab
+ }
+
+ cgi_table_data align=right width=70 {
+ cgi_submit_button "queryattach=Attach" class=compbtn "style=\"width:64\""
+ }
+ }
+ }
+ }
+ cc -
+ bcc -
+ reply-to -
+ to {
+ set fn [fieldname $item]
+ cgi_text $fn=${itemval} size=$textsize "style=\"padding: 2px\""
+ cgi_image_button "br_${fn}=[WPimg book]" class=compbtn "alt=Address Book" "style=\"vertical-align:text-bottom\""
+ cgi_submit_button "ex_${fn}=Expand" class=compbtn "style=\"vertical-align:base-line\""
+ }
+ fcc {
+ set deffcc [default_fcc $itemval]
+
+ set fccname [lindex $deffcc 0]
+ set fcccol [lindex $deffcc 1]
+ set collections [lindex $deffcc 2]
+
+ cgi_table border=0 cellpadding=0 cellspacing=0 width="100%" {
+ cgi_table_row {
+ cgi_table_data {
+ if {[llength $collections] > 1} {
+ cgi_text [fieldname $item]=$fccname size=38 onFocus=this.select()
+ #cgi_put [cgi_font face=Helvetica "in[cgi_nbspace]collection:[cgi_nbspace]"]
+ cgi_put [cgi_font class=comphdr in][cgi_nbspace]
+ cgi_select colid align=center {
+ for {set j 0} {$j < [llength $collections]} {incr j} {
+ if {$j == $fcccol} {
+ set selected selected
+ } else {
+ set selected {}
+ }
+
+ set colname [lindex [lindex $collections $j] 1]
+ if {[string length $colname] > 15} {
+ set colname "[string range $colname 0 12]..."
+ }
+
+ cgi_option $colname value=$j $selected
+ }
+ }
+ } else {
+ cgi_text [fieldname $item]=$fccname size=$textsize maxlength=1024 onFocus=this.select()
+ cgi_text "colid=0" type=hidden notab
+ }
+ }
+
+ cgi_table_data align=right {
+ cgi_submit_button "br_fcc=Browse" class="compbtn"
+ }
+ }
+ }
+ }
+ default {
+ cgi_text [fieldname $item]=${itemval} size=$textsize maxlength=1024
+ }
+ }
+ }
+ }
+
+ switch -- [string tolower $item] {
+ attach {
+ cgi_table_row class=smallhdr {
+ cgi_table_data colspan=2 {
+ cgi_put [cgi_img [WPimg dot]]
+ }
+
+ cgi_table_data {
+ cgi_table cellpadding=0 cellspacing=0 border=0 {
+ cgi_table_row {
+ cgi_table_data valign=middle class=smallhdr {
+ # complicated cause prompt and feature are reverse sense
+ if {[info exists postoption(fcc-without-attachments)]} {
+ if {$postoption(fcc-without-attachments)} {
+ set checked ""
+ } else {
+ set checked checked
+ }
+ } elseif {[WPCmd PEInfo feature "fcc-without-attachments"]} {
+ set checked ""
+ } else {
+ set checked checked
+ }
+
+ cgi_checkbox fccattach=1 class=smallhdr id="fcccb" $checked
+ }
+ cgi_table_data valign=middle class=smallhdr {
+ set blurb "Include attachments in copy of message saved to Fcc"
+ if {[string length $fccname]} {
+ append blurb " (i.e., \"$fccname\")"
+ }
+
+ cgi_put [cgi_span "style=cursor: pointer" onclick="flipCheck('fcccb')" $blurb]
+ }
+ }
+ }
+ }
+ }
+ }
+ default {}
+ }
+}
+
+set compose_menu {
+ {
+ {expr [info exists _wp(ispell)] && [file executable $_wp(ispell)]}
+ {
+ {
+ # * * * * SPELLCHECK * * * *
+ cgi_put [cgi_img [WPimg dot] width=4]
+ cgi_submit_button "check=Spell Check" class=navtext "style=\"margin-top:8\""
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_put [cgi_img [WPimg dot] width=4]
+ cgi_submit_button "help=Get Help" class=navtext "style=\"margin-top:8;margin-bottom:8\""
+ }
+ }
+ }
+}
+
+set compose2_menu {
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_put [cgi_img [WPimg dot] width=4]
+ cgi_submit_button "help=Get Help" class=navtext
+ }
+ }
+ }
+}
+
+WPEval $compose_vars {
+
+ if {$cid != [WPCmd PEInfo key]} {
+ error [list _close "Invalid Command ID"]
+ }
+
+ set cols [WPCmd PEConfig columns]
+
+ switch -- $style {
+ Reply {
+ set title "Reply to Message [WPCmd PEMessage $uid number]"
+
+ if {[catch {cgi_import part}]} {
+ set part ""
+ }
+
+ foreach h [WPCmd PEMessage $uid replyheaders $part] {
+ set hdrvals([fieldname [lindex $h 0]]) [lindex $h 1]
+ }
+
+ if {!$repall} {
+ catch {unset hdrvals(cc)}
+ }
+
+ if {[WPCmd PEInfo feature quell-format-flowed] == 0} {
+ set flowed 1
+ }
+
+ if {$reptext} {
+ set replytext [WPCmd PEMessage $uid replytext $repqstr $part]
+ set body [join [lindex $replytext 0] "\r\n"]
+ if {[WPCmd PEInfo feature include-attachments-in-reply]} {
+ set attachments [lindex $replytext 1]
+ }
+ } else {
+ set body ""
+ foreach line [WPCmd PEInfo signature] {
+ append body "$line\r\n"
+ }
+ }
+
+ catch {WPCmd set help_context reply}
+ }
+ Forward {
+ set title "Forward Message [WPCmd PEMessage $uid number]"
+
+ if {[catch {cgi_import part}]} {
+ set part ""
+ }
+
+ foreach h [WPCmd PEMessage $uid forwardheaders $part] {
+ set hdrvals([fieldname [lindex $h 0]]) [lindex $h 1]
+ }
+
+ foreach line [WPCmd PEInfo signature] {
+ append body "$line\r\n"
+ }
+
+ if {[WPCmd PEInfo feature quell-format-flowed] == 0} {
+ set flowed 1
+ }
+
+ set forwardtext [WPCmd PEMessage $uid forwardtext $part]
+ append body [join [lindex $forwardtext 0] "\r\n"]
+
+ set attachments [lindex $forwardtext 1]
+ catch {WPCmd set help_context forward}
+ }
+ Postponed {
+ set title "Postponed Message"
+ set postponed [WPCmd PEPostpone extract $uid]
+
+ foreach h [lindex $postponed 0] {
+ append hdrvals([fieldname [lindex $h 0]]) [lindex $h 1]
+ }
+
+ set body [join [lindex $postponed 1] "\r\n"]
+ set attachments [lindex $postponed 2]
+
+ foreach opt [lindex $postponed 3] {
+ switch [lindex $opt 0] {
+ charset {
+ set charset [lindex $opt 1]
+ }
+ }
+ }
+
+ unset postponed
+ catch {WPCmd set help_context compose}
+ }
+ default {
+ if {![info exists title]} {
+ set title "Compose New Message"
+ }
+
+ if {[catch {cgi_import ldap}] == 0
+ && [string compare $ldap 1] == 0
+ && [catch {cgi_import qn}] == 0
+ && [catch {cgi_import si}] == 0
+ && [catch {cgi_import ni}] == 0
+ && [catch {WPCmd PELdap ldapext $qn "${si}.${ni}"} leinfo] == 0} {
+ foreach item [lindex $leinfo 1] {
+ switch -- [string tolower [lindex $item 0]] {
+ "email address" {
+ if {[catch {cgi_import ei}] == 0} {
+ set ldap_email [lindex [lindex $item 1] $ei]
+ } else {
+ set ldap_email [lindex [lindex $item 1] 0]
+ }
+ }
+ name {
+ set ldap_name [lindex [lindex $item 1] 0]
+ }
+ "fax telephone" {
+ set ldap_fax [lindex [lindex $item 1] 0]
+ }
+ }
+ }
+
+ # put it all together
+ if {[catch {cgi_import fax}] == 0 && [string compare $fax yes] == 0} {
+ set n {[0-9]}
+ set n3 $n$n$n
+ set n4 $n$n$n$n
+ if {[info exists ldap_name]
+ && [regexp "^\\\+1 ($n3) ($n3)-($n4)\$" $ldap_fax dummy areacode prefix number]
+ && [lsearch -exact {206 425} $areacode] >= 0} {
+ regsub -all { } $ldap_name {_} ldap_fax_name
+ set hdrvals(to) "\"Fax to ${ldap_name}\" <${ldap_fax_name}@${areacode}-${prefix}-${number}.fax.cac.washington.edu>"
+ set hdrvals(subject) "FAX: "
+ }
+ } elseif {[info exists ldap_email]} {
+ if {[info exists ldap_name]} {
+ set hdrvals(to) "\"$ldap_name\" <$ldap_email>"
+ } else {
+ set hdrvals(to) $ldap_email
+ }
+ }
+ }
+
+ if {[WPCmd PEInfo feature quell-format-flowed] == 0} {
+ set flowed 1
+ }
+
+ if {![info exists body] || [string length $body] == 0} {
+ if {([info exists msgdata] && [llength $msgdata]) || [catch {WPCmd set suspended_composition} msgdata] == 0} {
+ set attachments {}
+ foreach e $msgdata {
+ switch -- [string tolower [lindex $e 0]] {
+ "" {
+ # do nothing, empty field
+ }
+ attach {
+ if {[catch {WPCmd PECompose attachinfo [lindex $e 1]} ai]} {
+ WPCmd PEInfo statmsg $ai
+ } else {
+ lappend attachments [list [lindex $e 1] [lindex $ai 0] [lindex $ai 1] [lindex $ai 2]]
+ # attachment description is in [lindex $ai 3]
+ }
+ }
+ body {
+ catch {unset body}
+ if {[string compare $style Spell] == 0} {
+ if {[catch {cgi_import_as spell spell} result] == 0} {
+ if {[string compare $spell Cancel] == 0} {
+ WPCmd PEInfo statmsg "Spell Check Cancelled"
+ } elseif {[catch {WPCmd set wp_spellresult} spellresult] == 0} {
+ set oldbody [lindex $e 1]
+ foreach l $spellresult {
+ set oldline [lindex $oldbody [lindex $l 0]]
+ set newline ""
+ set offset 0
+ foreach w [lindex $l 1] {
+ set o [lindex $w 0]
+ append newline "[string range $oldline $offset [expr {$o - 1}]][lindex $w 2]"
+ set offset [expr {$o + [lindex $w 1]}]
+ }
+
+ append newline [string range $oldline $offset end]
+
+ set newlines([lindex $l 0]) $newline
+ }
+
+ for {set n 0} {$n < [llength $oldbody]} {incr n} {
+ if {[info exists newlines($n)]} {
+ append body $newlines($n)
+ } else {
+ append body [lindex $oldbody $n]
+ }
+
+ append body "\r\n"
+ }
+ } else {
+ WPCmd PEInfo statmsg "No corrections present, Nothing changed."
+ }
+ }
+
+ catch {WPCmd PEInfo unset wp_spellresult}
+ }
+
+ if {![info exists body]} {
+ set body [join [lindex $e 1] "\r\n"]
+ }
+ }
+ fcc {
+ if {[string length $f_name]} {
+ set hdrvals(fcc) [list $f_colid $f_name]
+ } else {
+ set hdrvals(fcc) [lindex $e 1]
+ }
+ }
+ postoption {
+ set opt [lindex $e 1]
+ switch -- [lindex $opt 0] {
+ charset {
+ set charset [lindex $opt 1]
+ }
+ default {
+ set postoption([lindex $opt 0]) [lindex $opt 1]
+ }
+ }
+ }
+ default {
+ set hdrvals([fieldname [lindex $e 0]]) [lindex $e 1]
+ }
+ }
+ }
+
+ if {![info exists body]} {
+ set body ""
+ }
+ } else {
+ set body ""
+ foreach line [WPCmd PEInfo signature] {
+ append body "$line\r\n"
+ }
+
+ if {[string length $nickto] != 0 || $ai != -1} {
+ if {[catch {WPCmd PEAddress entry $book $nickto $ai} entryval] == 0} {
+ set addrlist [lindex $entryval 0]
+ set newfcc [lindex $entryval 1]
+ if {[string length $newfcc]} {
+ global fccdefault
+ if {[string compare $newfcc "\"\""] == 0} {
+ set newfcc ""
+ }
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ set collections ""
+ }
+ set fccdefault [list [expr {[llength $collections] > 1 ? 1 : 0}] $newfcc]
+ }
+ } else {
+ set addrlist $nickto
+ }
+ # bug: where's "to" supposed to come from?
+ if {0 && [string length $to]} {
+ append to ", ${addrlist}"
+ } else {
+ set to $addrlist
+ }
+ }
+
+ WPCmd PECompose noattach
+ }
+ }
+
+ catch {WPCmd set help_context compose}
+ }
+ }
+
+ if {[catch {WPCmd PECompose userhdrs} headers]} {
+ error [list _action "Header Retrieval Failure" $headers]
+ }
+
+ catch {fconfigure stdout -encoding binary}
+
+ if {![info exists charset]} {
+ set charset $default_charset
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=\"$charset\""
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_http_equiv Content-Type "text/html; charset=$charset"
+
+ WPStdHtmlHdr "Compose Message"
+ WPStdScripts
+ WPStyleSheets
+
+ cgi_put "<style type='text/css'>"
+ cgi_put ".comptext { background-color: $bgcolor ; font-family: courier, serif ; font-size: 10pt }"
+ cgi_put ".comphdr { background-color: $bgcolor ; font-family: arial, sans-serif ; font-size: 10pt ; font-weight: bold }"
+ cgi_put ".comphdrbtn { background-color: $bgcolor ; font-family: arial, sans-serif ; font-size: 10pt ; font-weight: bold ; text-decoration: underline }"
+ cgi_put ".comphdrbtnx { background-color: $buttoncolor ; font-family: arial, sans-serif ; font-size: 10pt ; font-weight: bold ; text-decorationx: underline }"
+ cgi_put ".compbtn { font-family: arial, sans-serif ; font-size: 9pt }"
+ cgi_put ".attachlist { width: 300 }"
+ cgi_put ".smallhdr { background-color: $bgcolor ; font-family: arial, sans-serif ; font-size: 8pt }"
+ cgi_puts "</style>"
+
+ cgi_javascript {
+ cgi_put "function setop(i){"
+ cgi_put " eval('document.compose.sendop\['+i+'\].checked = true');"
+ cgi_put " return false;"
+ cgi_put "}"
+ }
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" onLoad=document.compose.to.focus() {
+ if {[info exists comments]} {
+ cgi_puts "Diag: "
+ foreach c $comments {
+ cgi_html_comment $c
+ }
+ }
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post name=compose enctype=multipart/form-data target=_top {
+ cgi_table border=0 cellspacing=0 cellpadding=0 width=100% {
+ cgi_table_row {
+ lappend msglist [list $notice]
+ # next comes the menu down the left side
+ eval {
+ cgi_table_data $_wp(menuargs) rowspan=2 {
+
+ cgi_division class=navbar "style=background-color:$_wp(menucolor)" {
+ # * * * * SEND * * * *
+ cgi_puts "<fieldset>"
+ set doneverb " OK "
+
+ cgi_puts [cgi_span class=navtext "When finished, choose action below, then click [cgi_italic $doneverb].[cgi_nl][cgi_nl]"]
+
+ cgi_radio_button sendop=send id="RB1"
+ cgi_put [cgi_span class=navtext "style=color:white; cursor: pointer" onclick=\"flipCheck('RB1')\" "Send"]
+ cgi_br
+ cgi_radio_button sendop=postpone id="RB2"
+ cgi_put [cgi_span class=navtext "style=color:white; cursor: pointer" onclick=\"flipCheck('RB2')\" "Postpone"]
+ cgi_br
+ cgi_radio_button sendop=cancel id="RB3"
+ cgi_put [cgi_span class=navtext "style=color:white; cursor: pointer" onclick=\"flipCheck('RB3')\" "Cancel"]
+ cgi_br
+ cgi_br
+ #cgi_image_button action=[WPimg but_s_do] border=0 alt="Do"
+ cgi_division "style=padding-bottom:4" align=center {
+ cgi_submit_button "action=$doneverb" class=navtext
+ }
+ cgi_puts "</fieldset>"
+ }
+
+ WPTFCommandMenu compose_menu {}
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data border=0 bgcolor=$bgcolor {
+ cgi_table {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table border=0 cellspacing=0 cellpadding=0 align=left {
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "sessid=$sessid" type=hidden notab
+ cgi_text "page=post" type=hidden notab
+ cgi_text "postpost=$oncancel" type=hidden notab
+ if {[string length $repqstr]} {
+ cgi_text "repqstr=$repqstr" type=hidden notab
+ }
+
+ if {0 && [info exists charset]} {
+ cgi_text "form_charset=$charset" type=hidden notab
+ # character encoding suport: the idea is to plant a known
+ # char in the given charset and see what comes back to
+ # post.tcl from the browser. Why is it again the @#*$!
+ # browser can't just tell us?
+ foreach tc {#8364 #1066 thorn tcedil #65509} {
+ cgi_puts "<input name=\"ke_$tc\" value=&${tc}; type=hidden notab>"
+ }
+ }
+
+ if {[info exists flowed]} {
+ cgi_text "form_flowed=yes" type=hidden notab
+ }
+
+ foreach field [WPCmd PECompose syshdrs] {
+ set hdr [fieldname [lindex $field 0]]
+ if {[info exists hdrvals($hdr)]} {
+ cgi_text "${hdr}=$hdrvals($hdr)" type=hidden notab
+ }
+ }
+
+ if {[catch {WPCmd set wp_extra_hdrs} extras] == 0 && $extras == 0} {
+ set extrahdrs {}
+ }
+
+ foreach field $headers {
+ set item [lindex $field 0]
+
+ if {[string length $item] == 0} {
+ continue
+ }
+
+ set itemvaldef [lindex $field 1]
+ set litem [string tolower $item]
+ set fn [fieldname $item]
+
+ if {[info exists hdrvals($fn)]} {
+ set itemval $hdrvals($fn)
+ } elseif {[info exists $litem] && [string length [subst $$litem]]} {
+ set itemval [subst $$litem]
+ } elseif {[string length $itemvaldef]} {
+ set itemval $itemvaldef
+ } else {
+ set itemval ""
+ }
+
+ if {[catch {WPCmd PECompose composehdrs} h] == 0 && [llength $h] > 0} {
+ set display_headers [string tolower $h]
+ } else {
+ set display_headers $defaultheaders
+ }
+
+ if {![info exists extrahdrs]} {
+ if {[info exists postoption(fcc-set-by-addrbook)]} {
+ if {[lsearch -exact $display_headers fcc] < 0} {
+ lappend display_headers fcc
+ }
+ }
+ }
+
+ if {[info exists attachments] && [llength $attachments]
+ && [lsearch -exact $display_headers attach] < 0} {
+ lappend display_headers attach
+ }
+
+ if {[lsearch -exact $display_headers [string tolower $item]] >= 0} {
+ rowfield $item $itemval $style
+ } elseif {[info exists extrahdrs]} {
+ lappend extrahdrs [list $item $itemval $style]
+ } else {
+ switch -- [string tolower $item] {
+ fcc {
+ set deffcc [default_fcc $itemval]
+
+ set fccname [lindex $deffcc 0]
+ set fcccol [lindex $deffcc 1]
+
+ cgi_text [fieldname $item]=$fccname type=hidden notab
+ cgi_text "colid=$fcccol" type=hidden notab
+ }
+ default {
+ cgi_text "[fieldname $item]=$itemval" type=hidden notab
+ }
+ }
+ }
+ }
+
+ if {[info exists extrahdrs]} {
+ cgi_table_row class=body bgcolor="$bgcolor" {
+ cgi_table_data colspan=4 align=left class=comptext {
+ cgi_image_button extrahdrs=[WPimg hdrless] border=0 alt="Hide Extra Headers"
+ }
+ }
+
+ foreach pb $extrahdrs {
+ rowfield [lindex $pb 0] [lindex $pb 1] [lindex $pb 2]
+ }
+ } else {
+ cgi_table_row class=body bgcolor="$bgcolor" {
+ cgi_table_data colspan=4 align=left class=comptext {
+ cgi_image_button extrahdrs=[WPimg hdrmore] border=0 alt="Show Extra Headers"
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" {
+ cgi_table_row class=body bgcolor="$bgcolor" {
+ cgi_table_data colspan=4 align=center class=comptext {
+ cgi_textarea body=${body} rows=20 cols=$cols wrap=physical class=view "style=\"padding: 2px\""
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/comview.tcl b/web/cgi/alpine/1.0/comview.tcl
new file mode 100755
index 00000000..01e1af80
--- /dev/null
+++ b/web/cgi/alpine/1.0/comview.tcl
@@ -0,0 +1,184 @@
+#!./tclsh
+# $Id: comview.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# comview.tcl
+#
+# Purpose: CGI script to produce the common view commands frame
+
+# Input:
+set comview_vars {
+ {f_colid {} [WPCmd PEFolder isincoming 0]}
+ {f_name {} "saved-messages"}
+}
+
+# inherit global config
+source ./alpine.tcl
+source ./cmdfunc.tcl
+
+WPEval $comview_vars {
+ cgi_http_head {
+ WPStdHttpHdrs {} 60
+ }
+
+ cgi_html {
+ cgi_head {
+ if {[info exists _wp(exitonclose)]} {
+ WPExitOnClose top.spec.body
+ }
+
+ WPStyleSheets
+ cgi_put "<style type='text/css'>"
+ cgi_put ".viewop { font-family: arial, sans-serif; font-size: 7pt }"
+ cgi_puts "</style>"
+ if {$_wp(keybindings)} {
+ set kequiv {
+ {{?} {top.location = 'wp.tcl?page=help'}}
+ {{l} {top.location = 'wp.tcl?page=folders'}}
+ {{a} {top.location = 'wp.tcl?page=addrbook'}}
+ {{n} {top.spec.body.location = 'wp.tcl?page=view&bod_next=1'}}
+ {{p} {top.spec.body.location = 'wp.tcl?page=view&bod_prev=1'}}
+ {{i} {top.spec.location = 'fr_index.tcl'}}
+ {{s} {document.saveform.f_name.focus()}}
+ {{d} {document.delform.op[0].click()}}
+ {{u} {document.delform.op[1].click()}}
+ {{r} {document.replform.op.click()}}
+ {{f} {document.forwform.op.click()}}
+ }
+
+ lappend kequiv [list {c} "top.location = 'wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key]'"]
+
+ if {[WPCmd PEInfo feature enable-full-header-cmd]} {
+ lappend kequiv [list {h} "top.spec.body.location = 'wp.tcl?page=view&fullhdr=flip'"]
+ }
+
+ set onload "onLoad=[WPTFKeyEquiv $kequiv document.saveform.f_name top.spec.body]"
+ }
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) background=[file join $_wp(imagepath) logo $_wp(logodir) back.gif] "style=\"background-repeat: repeat-x\"" $onload {
+ cgi_table class=ops cellpadding=0 cellspacing=0 border=0 width="100%" height=24 {
+ cgi_table_row {
+ cgi_table_data valign=middle align=left nowrap class=viewop {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=_top name=replform {
+ cgi_text "page=view" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "oncancel=main.tcl" type=hidden notab
+ cgi_text "postpost=fr_main.tcl" type=hidden notab
+
+ cgi_table border=0 class=ops cellpadding=0 cellspacing=0 class=viewop {
+ cgi_table_row {
+ cgi_table_data class=viewop rowspan=2 {
+ # * * * * REPLY * * * *
+ cgi_submit_button op=Reply class="viewop" "style=\"vertical-align: middle; margin-left: 4\""
+ }
+ cgi_table_data class=viewop {
+ cgi_checkbox "repall=1" style=vertical-align:middle
+ cgi_put "To All[cgi_nbspace]"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class=viewop rowspan=2 {
+ cgi_checkbox "reptext=1" checked style=vertical-align:middle
+ cgi_put "Include text"
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_data valign=middle align=center {
+ cgi_put [cgi_img [WPimg blackdot] width=1 height=26]
+ }
+
+ cgi_table_data valign=middle align=center nowrap {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=_top name=forwform {
+ cgi_text "page=view" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "oncancel=main.tcl" type=hidden notab
+ cgi_text "postpost=fr_main.tcl" type=hidden notab
+
+ # * * * * FORWARD * * * *
+ cgi_submit_button op=Forward class="viewop"
+ }
+ }
+
+ cgi_table_data valign=middle align=center {
+ cgi_put [cgi_img [WPimg blackdot] width=1 height=26]
+ }
+
+ cgi_table_data valign=middle align=center nowrap class=viewop {
+ cgi_table class=ops cellpadding=0 cellspacing=0 border=0 class=viewop {
+ cgi_table_row {
+ cgi_table_data class=viewop {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=spec name=saveform {
+ cgi_text "page=fr_view" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "sid=[clock seconds]" type=hidden notab
+
+ # * * * * Save * * * *
+ cgi_submit_button "save=Save" class="viewop"
+ cgi_put "[cgi_nbspace]to "
+
+ cgi_text f_colid=$f_colid type=hidden notab
+ cgi_text op=save type=hidden notab
+
+ cgi_select f_name class=viewop style=vertical-align:middle "onchange=document.saveform.save.click(); return false;" {
+ foreach {oname oval} [WPTFGetSaveCache] {
+ cgi_option $oname value=$oval
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_data valign=middle align=center {
+ cgi_put [cgi_img [WPimg blackdot] width=1 height=26]
+ }
+
+ cgi_table_data valign=middle align=center nowrap {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=_top name=take {
+ cgi_text "page=view" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_submit_button op=Take class="viewop"
+ }
+ }
+
+ cgi_table_data valign=middle align=center {
+ cgi_put [cgi_img [WPimg blackdot] width=1 height=26]
+ }
+
+ cgi_table_data valign=middle align=right nowrap {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=body name=delform {
+ cgi_text "page=view" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+
+ # * * * * UNDELETE * * * *
+ cgi_submit_button op=Delete class="viewop"
+
+ # * * * * UNDELETE * * * *
+ cgi_submit_button op=Undelete class="viewop" "style=\"margin-right: 4\""
+
+ # * * * * ANTISPAM * * * *
+ if {([info exists _wp(spamaddr)] && [string length $_wp(spamaddr)])
+ || ([info exists _wp(spamfolder)] && [string length $_wp(spamfolder)])} {
+ cgi_submit_button "op=Report Spam" class="viewop" "style=\"margin-right: 4; color: white; background-color: black\""
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/conf_process.tcl b/web/cgi/alpine/1.0/conf_process.tcl
new file mode 100755
index 00000000..a8170c4e
--- /dev/null
+++ b/web/cgi/alpine/1.0/conf_process.tcl
@@ -0,0 +1,1358 @@
+#!./tclsh
+# $Id: conf_process.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# conf_process.tcl
+#
+# Purpose: CGI script to perform various message/mailbox
+# oriented operations
+
+source genvars.tcl
+source filter.tcl
+
+set cfs_vars {
+ {cid "Missing Command ID"}
+ {oncancel "Missing oncancel"}
+ {cp_op {} noop}
+ {save {} 0}
+ {delete {} 0}
+ {compose {} 0}
+ {cancel {} 0}
+ {gtab {} 0}
+ {mltab {} 0}
+ {mvtab {} 0}
+ {ctab {} 0}
+ {abtab {} 0}
+ {ftab {} 0}
+ {rtab {} 0}
+ {wv {} ""}
+ {varlistadd {} ""}
+ {newconf {} 0}
+}
+
+## read vars
+foreach item $cfs_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ error [list _action "Import Variable" $result]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+proc wpGetVar {_var {valid ""}} {
+ upvar $_var var
+
+ if {[catch {cgi_import_as $_var var} result]} {
+ error [list _action "Import Var $_var" $result]
+ }
+
+ if {[string length $valid]} {
+ switch -exact -- $valid {
+ _INTEGER_ {
+ if {[string is integer -strict $var] != 1} {
+ error [list _action "Invalid Input" "Non-Numeric Value for $_var"]
+ }
+ }
+ default {
+ if {[lsearch -exact $valid $var] < 0} {
+ error [list _action "Invalid Input" "Unrecognized Value $var for $_var"]
+ }
+ }
+ }
+ }
+}
+
+proc wpGetVarAs {_var _varas} {
+ upvar $_varas varas
+
+ if {[catch {cgi_import_as $_var varas} result]} {
+ set varas ""
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ catch {WPCmd PEInfo statmsg "Invalid Command ID"}
+}
+
+proc wpGetGoodVars {} {
+ global wv
+ global general_vars msglist_vars composer_vars folder_vars address_vars msgview_vars rule_vars
+
+ switch -- $wv {
+ msgl {
+ set goodvars $msglist_vars
+ }
+ msgv {
+ set goodvars $msgview_vars
+ }
+ address {
+ set goodvars $address_vars
+ }
+ composer {
+ set goodvars $composer_vars
+ }
+ folder {
+ set goodvars $folder_vars
+ }
+ rule {
+ set goodvars $rule_vars
+ }
+ general {
+ set goodvars $general_vars
+ }
+ }
+ return $goodvars
+}
+
+proc fieldPos {fmt field} {
+ for {set i 0} {$i < [llength $fmt]} {incr i} {
+ if {[string compare [string toupper [lindex [lindex $fmt $i] 0]] [string toupper $field]] == 0} {
+ return $i
+ }
+ }
+
+ return -1
+}
+
+proc numberedVar {nvbase nvtotal} {
+ if {[catch {wpGetVarAs $nvtotal nvtot}] == 0} {
+ for {set i 0} {$i < $nvtot} {incr i} {
+ if {[catch {wpGetVar ${nvbase}${i}} nvval] == 0} {
+ return $i
+ }
+ }
+ }
+
+ return -1
+}
+
+set op $cp_op
+if {[catch {WPCmd set conf_page} conftype]} {
+ set conftype general
+}
+if {[string length $wv]} {
+ set conftype $wv
+ set op tab
+}
+if {$save == 1 || [string compare $save Save] == 0} {
+ set op tab
+ set subop save
+} elseif {$newconf} {
+ set op noop
+} elseif {$gtab} {
+ set op "tab"
+ set conftype "general"
+} elseif {$mltab} {
+ set op "tab"
+ set conftype "msgl"
+} elseif {$mvtab} {
+ set op "tab"
+ set conftype "msgv"
+} elseif {$ctab} {
+ set op "tab"
+ set conftype "composer"
+} elseif {$abtab} {
+ set op "tab"
+ set conftype "address"
+} elseif {$ftab} {
+ set op "tab"
+ set conftype "folder"
+} elseif {$rtab} {
+ set op "tab"
+ set conftype "rule"
+} elseif {$cancel == 1 || [string compare $cancel Cancel] == 0} {
+ set op "cancel"
+}
+
+proc wpGetRulePattern {} {
+ global pattern_fields
+
+ set patlist {}
+
+ foreach {patvar patfield} $pattern_fields {
+ wpGetVarAs $patvar tval
+
+ switch $patvar {
+ headers {
+ # collect header fields/values into "headers"
+ set headers {}
+ if {[catch {wpGetVarAs header_total hcnt} res] == 0} {
+ for {set i 0} {$i < $hcnt} {incr i} {
+ if {[catch {wpGetVarAs hdrfld${i} fld}] == 0
+ && [catch {wpGetVarAs hdrval${i} val}] == 0} {
+ lappend headers [list $fld $val]
+ }
+ }
+ }
+
+ lappend patlist [list headers $headers]
+ }
+ default {
+ lappend patlist [list $patvar $tval]
+ }
+ }
+ }
+
+
+ return $patlist
+
+}
+
+proc wpGetRuleAction {tosave} {
+ set actlist {}
+ wpGetVar action
+ if {$tosave == 1} {
+ lappend actlist [list "action" $action]
+ } else {
+ switch -- $action {
+ move {lappend actlist [list "kill" 0]}
+ delete {lappend actlist [list "kill" 1]}
+ }
+ }
+ wpGetVar actionfolder
+ lappend actlist [list "folder" $actionfolder]
+ wpGetVarAs moind moind
+ if {[string compare $moind "on"] == 0} {
+ lappend actlist [list [expr {$tosave == 1 ? "moind" : "move_only_if_not_deleted"}] "1"]
+ } else {
+ lappend actlist [list [expr {$tosave == 1 ? "moind" : "move_only_if_not_deleted"}] "0"]
+ }
+}
+
+ #
+ # Meat and potatoes of processing goes on here.
+ # Errors are barfed up as they occur,
+ # otherwise the result is communicated below...
+ #
+ set setfeatures [WPCmd PEConfig featuresettings]
+ set script fr_tconfig.tcl
+ switch -- $op {
+ tab {
+ if {[info exists goodvars] == 0} {
+ set goodvars [wpGetGoodVars]
+ }
+ foreach goodvar $goodvars {
+ set vtypeinp [lindex $goodvar 0]
+ set varname [lindex $goodvar 1]
+ set hlpthisvar 0
+ wpGetVarAs hlp.$varname.x thlp
+ if {[string length $thlp]} {
+ set hlpthisvar 1
+ set helpcancelset conf_process
+ }
+ switch -- $vtypeinp {
+ special {
+ switch -- $varname {
+ wp-columns {
+ if {$hlpthisvar} {
+ set subop varhelp
+ set varhelpname wp-columns
+ } else {
+ wpGetVar columns
+ WPCmd PEConfig columns $columns
+ }
+ }
+ left-column-folders {
+ if {0 == [catch {wpGetVar fcachel}]} {
+ if {$fcachel <= $_wp(fldr_cache_max)} {
+ catch {WPSessionState left_column_folders $fcachel}
+ }
+ }
+ }
+ signature {
+ wpGetVar signature
+ set cursig [string trimright [join [WPCmd PEConfig rawsig] "\n"]]
+ set signature [string trimright $signature]
+ if {[string compare $cursig $signature]} {
+ WPCmd PEConfig rawsig [split $signature "\n"]
+ }
+ }
+ filters {
+ wpGetVarAs $varname-sz sz
+ wpGetVarAs vla.$varname.x fltadd
+ wpGetVarAs hlp.$varname.x do_help
+ if {[string length $do_help]} {
+ set subop varhelp
+ set varhelpname filtconf
+ } elseif {[string length $fltadd]} {
+ set script "fr_filtedit.tcl"
+ set filtedit_add 1
+ set filtedit_onfiltcancel conf_process
+ } else {
+ if {[string length $sz] == 0} {
+ error [list _action "ERROR" "No size given for filters"]
+ }
+ for {set i 0} {$i < $sz} {incr i} {
+ wpGetVarAs vle.$varname.$i.x vle
+ wpGetVarAs vld.$varname.$i.x vld
+ wpGetVarAs vlsu.$varname.$i.x vlsu
+ wpGetVarAs vlsd.$varname.$i.x vlsd
+ set flt_ret 0
+ set flt_res ""
+ if {[string length $vle]} {
+ set script "fr_filtedit.tcl"
+ set filtedit_fno $i
+ set filtedit_onfiltcancel conf_process
+ } elseif {[string length $vld]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset filter delete $i} flt_res]
+ } elseif {[string length $vlsu]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset filter shuffup $i} flt_res]
+ } elseif {[string length $vlsd]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset filter shuffdown $i} flt_res]
+ }
+ if {$flt_ret} {
+ # error
+ } elseif {[string length $flt_res]} {
+ # something wrong here
+ }
+ }
+ }
+ }
+ scores {
+ wpGetVarAs $varname-sz sz
+ wpGetVarAs vla.$varname.x fltadd
+ wpGetVarAs hlp.$varname.x do_help
+ if {[string length $do_help]} {
+ set subop varhelp
+ set varhelpname filtconf
+ } elseif {[string length $fltadd]} {
+ set script "fr_filtedit.tcl"
+ set filtedit_add 1
+ set filtedit_score 1
+ set filtedit_onfiltcancel conf_process
+ } else {
+ if {[string length $sz] == 0} {
+ error [list _action "ERROR" "No size given for scores"]
+ }
+ for {set i 0} {$i < $sz} {incr i} {
+ wpGetVarAs vle.$varname.$i.x vle
+ wpGetVarAs vld.$varname.$i.x vld
+ wpGetVarAs vlsu.$varname.$i.x vlsu
+ wpGetVarAs vlsd.$varname.$i.x vlsd
+ set flt_ret 0
+ set flt_res ""
+ if {[string length $vle]} {
+ set script "fr_filtedit.tcl"
+ set filtedit_score 1
+ set filtedit_fno $i
+ set filtedit_onfiltcancel conf_process
+ } elseif {[string length $vld]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset score delete $i} flt_res]
+ } elseif {[string length $vlsu]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset score shuffup $i} flt_res]
+ } elseif {[string length $vlsd]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset score shuffdown $i} flt_res]
+ }
+ if {$flt_ret} {
+ # error
+ } elseif {[string length $flt_res]} {
+ # something wrong here
+ }
+ }
+ }
+ }
+ indexcolor {
+ wpGetVarAs $varname-sz sz
+ wpGetVarAs vla.$varname.x fltadd
+ wpGetVarAs hlp.$varname.x do_help
+ if {[string length $do_help]} {
+ set subop varhelp
+ set varhelpname filtconf
+ } elseif {[string length $fltadd]} {
+ set script "fr_filtedit.tcl"
+ set filtedit_add 1
+ set filtedit_indexcolor 1
+ set filtedit_onfiltcancel conf_process
+ } else {
+ if {[string length $sz] == 0} {
+ error [list _action "ERROR" "No size given for index colors"]
+ }
+ for {set i 0} {$i < $sz} {incr i} {
+ wpGetVarAs vle.$varname.$i.x vle
+ wpGetVarAs vld.$varname.$i.x vld
+ wpGetVarAs vlsu.$varname.$i.x vlsu
+ wpGetVarAs vlsd.$varname.$i.x vlsd
+ set flt_ret 0
+ set flt_res ""
+ if {[string length $vle]} {
+ set script "fr_filtedit.tcl"
+ set filtedit_indexcolor 1
+ set filtedit_fno $i
+ set filtedit_onfiltcancel conf_process
+ } elseif {[string length $vld]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset indexcolor delete $i} flt_res]
+ } elseif {[string length $vlsu]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset indexcolor shuffup $i} flt_res]
+ } elseif {[string length $vlsd]} {
+ set flt_ret [catch {WPCmd PEConfig ruleset indexcolor shuffdown $i} flt_res]
+ }
+ if {$flt_ret} {
+ # error
+ } elseif {[string length $flt_res]} {
+ # something wrong here
+ }
+ }
+ }
+ }
+ collections {
+ wpGetVarAs $varname-sz sz
+ wpGetVarAs vla.$varname.x cladd
+ if {[string length $cladd]} {
+ set script "fr_cledit.tcl"
+ set cledit_add 1
+ set cledit_onclecancel conf_process
+ } else {
+ if {[string length $sz] == 0} {
+ error [list _action "ERROR" "No size given for collections"]
+ }
+ for {set i 0} {$i < $sz} {incr i} {
+ wpGetVarAs vle.$varname.$i.x vle
+ wpGetVarAs vld.$varname.$i.x vld
+ wpGetVarAs vlsu.$varname.$i.x vlsu
+ wpGetVarAs vlsd.$varname.$i.x vlsd
+ set cle_ret 0
+ set cle_res ""
+ if {[string length $vle]} {
+ set script "fr_cledit.tcl"
+ set cledit_cl $i
+ set cledit_onclecancel conf_process
+ } elseif {[string length $vld]} {
+ set cle_ret [catch {WPCmd PEConfig cldel $i} cle_res]
+ } elseif {[string length $vlsu]} {
+ set cle_ret [catch {WPCmd PEConfig clshuff up $i} cle_res]
+ } elseif {[string length $vlsd]} {
+ set cle_ret [catch {WPCmd PEConfig clshuff down $i} cle_res]
+ }
+ if {$cle_ret} {
+ # error
+ } elseif {[string length $cle_res]} {
+ WPCmd PEInfo statmsg $cle_res
+ # something wrong here
+ }
+ }
+ }
+ }
+ index-format {
+ wpGetVarAs index-format iformat
+
+ set varchanged 0
+
+ if {$hlpthisvar} {
+ set subop varhelp
+ set varhelpname index-format
+ } elseif {[catch {cgi_import hlp.index_tokens.x} result] == 0} {
+ set subop secthelp
+ set topicclass plain
+ set feathelpname h_index_tokens
+ set varhelpname h_index_tokens
+ }
+
+ if {[catch {cgi_import indexadd}] == 0
+ && [string compare "Add Field" $indexadd] == 0
+ && [catch {cgi_import indexaddfield}] == 0} {
+ if {[lsearch $iformat $indexaddfield] < 0} {
+ set iformat [linsert $iformat 0 $indexaddfield]
+ set varchanged 1
+ }
+ } elseif {[catch {cgi_import adjust}] == 0
+ && [string compare Change $adjust] == 0
+ && [catch {cgi_import iop}] == 0
+ && [catch {cgi_import ifield}] == 0
+ && [set pos [fieldPos $iformat $ifield]] >= 0} {
+ switch $iop {
+ left {
+ set iformat [lreplace $iformat $pos $pos]
+ set iformat [linsert $iformat [incr pos -1] $ifield]
+ set varchanged 1
+ }
+ right {
+ set iformat [lreplace $iformat $pos $pos]
+ set iformat [linsert $iformat [incr pos] $ifield]
+ set varchanged 1
+ }
+ widen {
+ set f [lindex [lindex $iformat $pos] 0]
+ set w [lindex [lindex $iformat $pos] 1]
+ set dw [expr {round((100/[llength $iformat]) * [WPTFIndexWidthRatio $iformat $f])}]
+
+ if {[regexp {([0123456789]+)[%]} $w dummy w] == 0} {
+ set w $dw
+ }
+
+ if {$w < 95} {
+ incr w 5
+ } else {
+ set w 99
+ }
+
+ if {$w == $dw} {
+ set ws ""
+ } else {
+ set ws "${w}%"
+ }
+
+ set iformat [lreplace $iformat $pos $pos [list $f $ws]]
+ set varchanged 1
+ }
+ narrow {
+ set f [lindex [lindex $iformat $pos] 0]
+ set w [lindex [lindex $iformat $pos] 1]
+ set dw [expr {round((100/[llength $iformat]) * [WPTFIndexWidthRatio $iformat $f])}]
+
+ if {[regexp {([0123456789]+)[%]} $w dummy w] == 0} {
+ set w $dw
+ }
+
+ if {$w > 5} {
+ incr w -5
+ } else {
+ set w 1
+ }
+
+ if {$w == $dw} {
+ set ws ""
+ } else {
+ set ws "${w}%"
+ }
+
+ set iformat [lreplace $iformat $pos $pos [list $f $ws]]
+ set varchanged 1
+ }
+ remove {
+ set iformat [lreplace $iformat $pos $pos]
+ set varchanged 1
+ }
+ }
+ } else {
+ foreach f $iformat {
+ if {[catch {cgi_import_as shrm.${f}.x shift} result] == 0} {
+ if {[set pos [fieldPos $iformat $f]] >= 0} {
+ set iformat [lreplace $iformat $pos $pos]
+ set varchanged 1
+ }
+ } elseif {[catch {cgi_import_as shlf.${f}.x shift} result] == 0} {
+ if {[set pos [fieldPos $iformat $f]] > 0} {
+ set iformat [lreplace $iformat $pos $pos]
+ set iformat [linsert $iformat [incr pos -1] $f]
+ set varchanged 1
+ }
+ } elseif {[catch {cgi_import_as shrt.${f}.x shift} result] == 0} {
+ if {[set pos [fieldPos $iformat $f]] >= 0} {
+ set iformat [lreplace $iformat $pos $pos]
+ set iformat [linsert $iformat [incr pos] $f]
+ set varchanged 1
+ }
+ }
+ }
+ }
+
+ if {$varchanged} {
+ foreach f $iformat {
+ if {[string length [lindex $f 1]]} {
+ lappend ifv "[lindex $f 0]([lindex $f 1])"
+ } else {
+ lappend ifv [lindex $f 0]
+ }
+ }
+
+ WPCmd PEConfig varset index-format [list $ifv]
+ }
+ }
+ view-colors {
+ if {$hlpthisvar} {
+ set subop varhelp
+ set varhelpname index-format
+ } elseif {[catch {cgi_import_as colormap.x colx}] == 0
+ && [catch {cgi_import_as colormap.y coly}] == 0} {
+ set rgbs {"000" "051" "102" "153" "204" "255"}
+ set xrgbs {"00" "33" "66" "99" "CC" "FF"}
+ set rgblen [llength $rgbs]
+ set imappixwidth 10
+
+ set colx [expr {${colx} / $imappixwidth}]
+ set coly [expr {${coly} / $imappixwidth}]
+ if {($coly >= 0 && $coly < $rgblen)
+ && ($colx >= 0 && $colx < [expr {$rgblen * $rgblen}])} {
+ set ired $coly
+ set igreen [expr {($colx / $rgblen) % $rgblen}]
+ set iblue [expr {$colx % $rgblen}]
+ set rgb "[lindex $rgbs $ired],[lindex $rgbs ${igreen}],[lindex $rgbs ${iblue}]"
+ set xrgb "[lindex $xrgbs $ired][lindex $xrgbs ${igreen}][lindex $xrgbs ${iblue}]"
+
+ if {[catch {cgi_import_as text tt}] == 0} {
+ set type [split $tt .]
+ catch {WPCmd set config_deftext [lindex $type end]}
+
+ if {[catch {cgi_import_as ground ground}] == 0} {
+ switch $ground {
+ f {
+ catch {WPCmd set config_defground f}
+ set fg $xrgb
+ }
+ b {
+ catch {WPCmd set config_defground b}
+ set bg $xrgb
+ }
+ }
+
+ if {[info exists fg] || [info exists bg]} {
+ switch [lindex $type 0] {
+ hdr {
+ set type [lindex $type 1]
+ if {[catch {cgi_import_as add.${type} foo}] == 0} {
+ set colop add
+ } elseif {[catch {cgi_import_as hi.${type} hindex}] == 0} {
+ set colop change
+ }
+
+ if {[info exists colop]} {
+ if {![info exists bg] && [catch {cgi_import_as dbg.$type bg} result]} {
+ WPCmd PEInfo statmsg "Can't import default background: $result"
+ } elseif {![info exists fg] && [catch {cgi_import_as dfg.$type fg} result]} {
+ WPCmd PEInfo statmsg "Can't import default foreground: $result"
+ }
+
+ switch $colop {
+ change {
+ if {[catch {WPCmd PEConfig colorset viewer-hdr-colors update [list $hindex $type ""] [list $fg $bg]} result]} {
+ WPCmd PEInfo statmsg "Problem changing $type color: $result"
+ }
+ }
+ add {
+ if {[catch {WPCmd PEConfig colorset viewer-hdr-colors add [list $type ""] [list $fg $bg]} result]} {
+ WPCmd PEInfo statmsg "Problem adding $type color: $result"
+ }
+ }
+ }
+
+ }
+ }
+ default {
+ if {![info exists bg] && [catch {cgi_import_as dbg.$type bg} result]} {
+ WPCmd PEInfo statmsg "Can't import default background: $result"
+ } elseif {![info exists fg] && [catch {cgi_import_as dfg.$type fg} result]} {
+ WPCmd PEInfo statmsg "Can't import default foreground: $result"
+ } elseif {[catch {WPCmd PEConfig colorset $type [list $fg $bg]} result]} {
+ WPCmd PEInfo statmsg "Can't set $type color: $result"
+ }
+ }
+ }
+ } else {
+ WPCmd PEInfo statmsg "Invalid fore/back ground input!"
+ }
+ } else {
+ WPCmd PEInfo statmsg "Choose foreground or background!"
+ }
+ } else {
+ WPCmd PEInfo statmsg "Choose the type of text to color!"
+ }
+ } else {
+ WPCmd PEInfo statmsg "Invalid RGB Input!"
+ }
+ } elseif {[catch {cgi_import addfield}] == 0
+ && [string compare "add " [string tolower [string range $addfield 0 3]]] == 0
+ && [catch {cgi_import newfield}] == 0
+ && [string length [set newfield [string trim $newfield]]]
+ && [catch {cgi_import_as dfg.normal dfg}] == 0
+ && [catch {cgi_import_as dbg.normal dbg}] == 0} {
+ if {[catch {WPCmd PEConfig colorset viewer-hdr-colors add [list $newfield ""] [list $dfg $dbg]} result]} {
+ WPCmd PEInfo statmsg "Problem adding $type color: $result"
+ }
+ } elseif {[catch {cgi_import reset}] == 0
+ && [string compare "restore " [string tolower [string range $reset 0 7]]] == 0} {
+ if {[catch {cgi_import_as text tt}] == 0} {
+ if {[llength [set type [split $tt .]]] == 2 && [string compare [lindex $type 0] hdr] == 0} {
+ set hdr [lindex $type end]
+ if {[catch {cgi_import_as hi.$hdr hindex}] == 0} {
+ if {[catch {WPCmd PEConfig colorset viewer-hdr-colors delete $hindex} result]} {
+ # bug: reloads cause this error - need better way to report it
+ #WPCmd PEInfo statmsg "Can't reset $hdr ($hindex) text: $result!"
+ } else {
+ catch {WPCmd PEInfo unset config_deftext}
+ }
+ }
+ } elseif {[string compare normal $tt] == 0} {
+ if {[catch {WPCmd PEConfig varset normal-foreground-color ""} result]
+ || [catch {WPCmd PEConfig varset normal-background-color ""} result]} {
+ WPCmd PEInfo statmsg "Can't reset normal text: $result!"
+ }
+ } elseif {[catch {cgi_import_as dfg.normal dfg}] == 0
+ && [catch {cgi_import_as dbg.normal dbg}] == 0} {
+ catch {WPCmd set config_deftext $tt}
+ if {[catch {WPCmd PEConfig colorset $tt [list $dfg $dbg]} result]} {
+ WPCmd PEInfo statmsg "Can't reset $tt text: $result!"
+ }
+ }
+ } else {
+ WPCmd PEInfo statmsg "Choose the type of text to color!"
+ }
+ }
+ }
+ }
+ }
+ var {
+ wpGetVarAs $varname formval
+ set varvals [WPCmd PEConfig varget $varname]
+ set vals [lindex $varvals 0]
+ set vartype [lindex $varvals 1]
+ set formvals [split $formval "\n"]
+ set varchanged 0
+
+ if {$hlpthisvar} {
+ set subop varhelp
+ set varhelpname $varname
+ }
+
+ if {[string compare $vartype textarea] == 0} {
+ wpGetVarAs vla.$varname.x vlavar
+ wpGetVarAs $varname-sz sz
+ wpGetVarAs $varname-add valadd
+ if {[string length $vlavar]} {
+ set fr_tconfig_vlavar $varname
+ }
+ set formvals {}
+ if {[string length $valadd]} {
+ lappend formvals $valadd
+ }
+ if {[string length $sz]} {
+ set prevwassd 0
+ for {set i 0} {$i < $sz} {incr i} {
+ wpGetVarAs vle.$varname.$i fval
+ wpGetVarAs vld.$varname.$i.x fvaldel
+ wpGetVarAs vlsu.$varname.$i.x fvalsu
+ wpGetVarAs vlsd.$varname.$i.x fvalsd
+ set fed 0
+ set fdel 0
+ set fsu 0
+ set fsd 0
+ if {[string length $fval]} {
+ set fed 1
+ }
+ if {[string length $fvaldel]} {
+ set fdel 1
+ } elseif {[string length $fvalsu]} {
+ set fsu 1
+ } elseif {[string length $fvalsd]} {
+ set fsd 1
+ }
+ if {$fed && $fdel == 0 && $prevwassd} {
+ set prevwassd 0
+ set formvals [linsert $formvals [expr {[llength $formvals] - 1}] $fval]
+ } elseif {$fed && $fdel == 0 && $fsu == 0} {
+ lappend formvals $fval
+ if {$fsd} {
+ set prevwassd 1
+ }
+ } elseif {$fed && $fdel == 0 && $fsu} {
+ set fvallen [llength $formvals]
+ if {$fvallen} {
+ set formvals [linsert $formvals [expr {$fvallen - 2}] $fval]
+ } else {
+ lappend formvals $fval
+ }
+ }
+ }
+ }
+ set len [llength $formvals]
+ if {$len != [llength $vals]} {
+ set varchanged 1
+ } else {
+ for {set i 0} {$i < $len} {incr i} {
+ if {[string compare [lindex $formvals $i] [lindex $vals $i]]} {
+ set varchanged 1
+ break
+ }
+ }
+ }
+ } elseif {[llength $formvals] != [llength $vals]} {
+ set varchanged 1
+ } else {
+ set valslength [llength $vals]
+ for {set i 0} {$i < $valslength} {incr i} {
+ if {[string compare [lindex $vals $i] [lindex $formvals $i]]} {
+ set varchanged 1
+ break
+ }
+ }
+ }
+ if {$varchanged} {
+ WPCmd PEConfig varset $varname $formvals
+ }
+ # what about wp-indexheight?
+ }
+ feat {
+ wpGetVarAs $varname tval
+ if {$hlpthisvar} {
+ set subop feathelp
+ set feathelpname $varname
+ }
+ set featset [expr {[lsearch $setfeatures $varname] >= 0}]
+ set formfeatset [expr {[string compare $tval on] == 0}]
+ if {$formfeatset != $featset} {
+ WPCmd PEConfig feature $varname $formfeatset
+ }
+ }
+ }
+ }
+ if {[info exists subop]} {
+ switch -- $subop {
+ varhelp {
+ catch {WPCmd PEInfo unset help_context}
+ catch {WPCmd set oncancel $oncancel}
+ set help_vars [list topic topicclass]
+ set topic $varhelpname
+ set _cgi_uservar(topic) $varhelpname
+ set topicclass variable
+ set _cgi_uservar(topicclass) variable
+ set _cgi_uservar(oncancel) conf_process
+ set script help
+ }
+ feathelp {
+ catch {WPCmd PEInfo unset help_context}
+ catch {WPCmd set oncancel $oncancel}
+ set help_vars [list topic topicclass oncancel]
+ set topic $feathelpname
+ set _cgi_uservar(topic) $feathelpname
+ set topicclass feature
+ set _cgi_uservar(topicclass) feature
+ set _cgi_uservar(oncancel) conf_process
+ set script help
+ }
+ secthelp {
+ catch {WPCmd PEInfo unset help_context}
+ catch {WPCmd set oncancel $oncancel}
+ set help_vars [list topic topicclass oncancel]
+ set topic $feathelpname
+ set _cgi_uservar(topic) $feathelpname
+ set topicclass $topicclass
+ set _cgi_uservar(topicclass) $topicclass
+ set _cgi_uservar(oncancel) conf_process
+ set script help
+ }
+ save {
+ if {$cid != [WPCmd PEInfo key]} {
+ error [list _close "Invalid Operation ID"]
+ }
+ WPCmd PEConfig saveconf
+ set script $oncancel
+ catch {WPCmd PEInfo unset config_deftext}
+ }
+ }
+ }
+ }
+ filtconfig {
+ wpGetVar fno [list _INTEGER_]
+ wpGetVar subop [list edit add]
+
+ if {[catch {wpGetVar filtcancel}]} {
+ if {[catch {wpGetVar filthelp}] == 0} {
+ catch {WPCmd PEInfo unset help_context}
+ catch {WPCmd set oncancel $oncancel}
+
+ set patlist [wpGetRulePattern]
+ set actlist [wpGetRuleAction 0]
+ # we have to save this exactly as it would look when getting it from alpined
+ set ftsadd [expr {[string compare $subop "add"] == 0 ? 1 : 0}]
+ set ftsform [list [list "pattern" $patlist] [list "filtaction" $actlist]]
+ catch {WPCmd set filttmpstate [list $ftsadd $fno $ftsform]}
+
+ set help_vars [list topic]
+ set topic filtedit
+ set _cgi_uservar(topic) filtedit
+
+ if {[string compare $subop "edit"] == 0} {
+ set fakeimg "vle.filters.$fno"
+ set fakesz [expr {$fno + 1}]
+ } else {
+ set fakeimg "vla.filters"
+ set fakesz 1
+ }
+
+ set _cgi_uservar(oncancel) [WPPercentQuote "conf_process&wv=rule&filters-sz=${fakesz}&${fakeimg}.x=1&${fakeimg}.y=1&oncancel=main.tcl"]
+ set script help
+ } elseif {[set nv [numberedVar rmheader header_total]] >= 0} {
+
+ # load all the rules, process "headers"
+ foreach pat [wpGetRulePattern] {
+ set [lindex $pat 0] [lindex $pat 1]
+
+ if {[string compare headers [lindex $pat 0]] == 0} {
+ if {[llength $headers] > $nv} {
+ set headers [lreplace $headers $nv $nv]
+ }
+ }
+ }
+
+ # load all the actions
+ foreach act [wpGetRuleAction 0] {
+ set [lindex $act 0] [lindex $act 1]
+ }
+
+ # load other variables
+ wpGetVarAs nickname nickname
+ wpGetVarAs comment comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set filterrtext 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ } elseif {[catch {wpGetVar addheader}] == 0} {
+
+ # load all the rules, process "headers"
+ foreach pat [wpGetRulePattern] {
+ set [lindex $pat 0] [lindex $pat 1]
+ if {[string compare headers [lindex $pat 0]] == 0} {
+ foreach h [set headers [lindex $pat 1]] {
+ if {0 == [string length [lindex $h 0]]
+ && 0 == [string length [lindex $h 1]]} {
+ set emptyheader 1
+ }
+ }
+
+ if {![info exists emptyheader]} {
+ lappend headers [list {} {}]
+ }
+ }
+ }
+
+ # load all the actions
+ foreach act [wpGetRuleAction 0] {
+ set [lindex $act 0] [lindex $act 1]
+ }
+
+ # load other variables
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set filterrtext 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ } else {
+ # load other variables
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set patlist [wpGetRulePattern]
+ set actlist [wpGetRuleAction 1]
+
+ lappend patlist [list nickname $nickname]
+ lappend patlist [list comment $comment]
+
+ set ret [catch {WPCmd PEConfig ruleset filter $subop $fno $patlist $actlist} res]
+ if {$ret} {
+ error [list _action "Filter Set" $res]
+ } elseif {[string length $res]} {
+ WPCmd PEInfo statmsg "Filter setting failed: $res"
+
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ }
+ }
+ }
+ }
+ scoreconfig {
+ wpGetVar fno [list _INTEGER_]
+ wpGetVar subop [list edit add]
+
+ if {[catch {wpGetVar filtcancel}]} {
+ if {[catch {wpGetVar filthelp}] == 0} {
+ catch {WPCmd PEInfo unset help_context}
+ catch {WPCmd set oncancel $oncancel}
+ if {[string compare $subop "edit"] == 0 || [string compare $subop "add"] == 0} {
+ set patlist [wpGetRulePattern]
+
+ # we have to save this exactly as it would look when getting it from alpined
+ set ftsadd [expr {[string compare $subop "add"] == 0 ? 1 : 0}]
+ set ftsform [list [list "pattern" $patlist] [list "filtaction" $actlist]]
+ catch {WPCmd set filttmpstate [list $ftsadd $fno $ftsform]}
+ }
+ set help_vars [list topic]
+ set topic scoreedit
+ set _cgi_uservar(topic) scoreedit
+ switch -- $subop {
+ edit {
+ set fakeimg "vle.scores.$fno"
+ set fakesz [expr {$fno + 1}]
+ }
+ add {
+ set fakeimg "vla.scores"
+ set fakesz 1
+ }
+ }
+
+ set _cgi_uservar(oncancel) [WPPercentQuote "conf_process&wv=rule&scores-sz=${fakesz}&${fakeimg}.x=1&${fakeimg}.y=1&oncancel=main.tcl"]
+ set script help
+ } elseif {[set nv [numberedVar rmheader header_total]] >= 0} {
+
+ # load all the rules, process "headers"
+ foreach pat [wpGetRulePattern] {
+ set [lindex $pat 0] [lindex $pat 1]
+
+ if {[string compare headers [lindex $pat 0]] == 0} {
+ if {[llength $headers] > $nv} {
+ set headers [lreplace $headers $nv $nv]
+ }
+ }
+ }
+
+ # load other variables
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set filterrtext 1
+ set filtedit_score 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ } elseif {[catch {wpGetVar addheader}] == 0} {
+
+ # load all the rules, process "headers"
+ foreach pat [wpGetRulePattern] {
+ set [lindex $pat 0] [lindex $pat 1]
+ if {[string compare headers [lindex $pat 0]] == 0} {
+ foreach h [set headers [lindex $pat 1]] {
+ if {0 == [string length [lindex $h 0]]
+ && 0 == [string length [lindex $h 1]]} {
+ set emptyheader 1
+ }
+ }
+
+ if {![info exists emptyheader]} {
+ lappend headers [list {} {}]
+ }
+ }
+ }
+
+ # load other variables
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set filterrtext 1
+ set filtedit_score 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ } else {
+ switch -- $subop {
+ edit -
+ add {
+ # load other variables
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set patlist [wpGetRulePattern]
+
+ lappend patlist [list nickname $nickname]
+ lappend patlist [list comment $comment]
+
+ wpGetVar scoreval
+ lappend actlist [list "scoreval" $scoreval]
+
+ wpGetVar scorehdr
+ lappend actlist [list "scorehdr" $scorehdr]
+
+ set ret [catch {WPCmd PEConfig ruleset score $subop $fno $patlist $actlist} res]
+
+ if {$ret} {
+ error [list _action "Score Set" $res]
+ } elseif {[string length $res]} {
+ WPCmd PEInfo statmsg "Score setting failed: $res"
+
+ set filtedit_score 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ }
+ }
+ }
+ }
+ }
+ }
+ indexcolorconfig {
+ wpGetVar fno [list _INTEGER_]
+ wpGetVar subop [list edit add]
+
+ if {[catch {wpGetVar filtcancel}]} {
+ if {[catch {wpGetVar filthelp}] == 0} {
+ catch {WPCmd PEInfo unset help_context}
+ catch {WPCmd set oncancel $oncancel}
+ if {[string compare $subop "edit"] == 0 || [string compare $subop "add"] == 0} {
+ set patlist [wpGetRulePattern]
+
+ # we have to save this exactly as it would look when getting it from alpined
+ set ftsadd [expr {[string compare $subop "add"] == 0 ? 1 : 0}]
+ set ftsform [list [list "pattern" $patlist] [list "filtaction" $actlist]]
+ catch {WPCmd set filttmpstate [list $ftsadd $fno $ftsform]}
+ }
+ set help_vars [list topic]
+ set topic indexcoloredit
+ set _cgi_uservar(topic) indexcoloredit
+ switch -- $subop {
+ edit {
+ set fakeimg "vle.indexcolor.$fno"
+ set fakesz [expr {$fno + 1}]
+ }
+ add {
+ set fakeimg "vla.indexcolor"
+ set fakesz 1
+ }
+ }
+
+ set _cgi_uservar(oncancel) [WPPercentQuote "conf_process&wv=rule&indexcolor-sz=${fakesz}&${fakeimg}.x=1&${fakeimg}.y=1&oncancel=main.tcl"]
+ set script help
+ } elseif {[set nv [numberedVar rmheader header_total]] >= 0} {
+
+ # load all the rules, process "headers"
+ foreach pat [wpGetRulePattern] {
+ set [lindex $pat 0] [lindex $pat 1]
+
+ if {[string compare headers [lindex $pat 0]] == 0} {
+ if {[llength $headers] > $nv} {
+ set headers [lreplace $headers $nv $nv]
+ }
+ }
+ }
+
+ # load other variables
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set filterrtext 1
+ set filtedit_indexcolor 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ } elseif {[catch {wpGetVar addheader}] == 0} {
+ # load all the rules, process "headers"
+ foreach pat [wpGetRulePattern] {
+ set [lindex $pat 0] [lindex $pat 1]
+ if {[string compare headers [lindex $pat 0]] == 0} {
+ foreach h [set headers [lindex $pat 1]] {
+ if {0 == [string length [lindex $h 0]]
+ && 0 == [string length [lindex $h 1]]} {
+ set emptyheader 1
+ }
+ }
+
+ if {![info exists emptyheader]} {
+ lappend headers [list {} {}]
+ }
+ }
+ }
+
+ # load other variables
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+
+ set filterrtext 1
+ set filtedit_indexcolor 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ } elseif {[catch {cgi_import_as colormap.x colx}] == 0
+ && [catch {cgi_import_as colormap.y coly}] == 0} {
+ set rgbs {"000" "051" "102" "153" "204" "255"}
+ set xrgbs {"00" "33" "66" "99" "CC" "FF"}
+ set rgblen [llength $rgbs]
+ set imappixwidth 10
+
+ set colx [expr {${colx} / $imappixwidth}]
+ set coly [expr {${coly} / $imappixwidth}]
+ if {($coly >= 0 && $coly < $rgblen)
+ && ($colx >= 0 && $colx < [expr {$rgblen * $rgblen}])} {
+ set ired $coly
+ set igreen [expr {($colx / $rgblen) % $rgblen}]
+ set iblue [expr {$colx % $rgblen}]
+ set rgb "[lindex $rgbs $ired],[lindex $rgbs ${igreen}],[lindex $rgbs ${iblue}]"
+ set xrgb "[lindex $xrgbs $ired][lindex $xrgbs ${igreen}][lindex $xrgbs ${iblue}]"
+
+ if {[catch {wpGetVar fgorbg [list fg bg]}]} {
+ WPCmd PEInfo statmsg "Invalid fore/back ground input!"
+ catch {unset xrgb}
+ }
+ } else {
+ WPCmd PEInfo statmsg "Invalid RGB Input!"
+ }
+
+ # relay any other config changes
+ wpGetVar nickname
+ wpGetVar comment
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+ foreach pat [wpGetRulePattern] {
+ set [lindex $pat 0] [lindex $pat 1]
+ }
+
+ # import previous settings
+ wpGetVarAs fg fg
+ wpGetVarAs bg bg
+
+ # set new value
+ if {[info exists xrgb]} {
+ set $fgorbg $xrgb
+ }
+
+ set filterrtext 1
+ set filtedit_indexcolor 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ } else {
+ switch -- $subop {
+ edit -
+ add {
+
+ wpGetVar nickname
+ wpGetVar comment
+
+ set patlist [wpGetRulePattern]
+
+ lappend patlist [list nickname $nickname]
+ lappend patlist [list comment $comment]
+
+ # save config?
+ set actlist {}
+ if {[catch {wpGetVar fg}] == 0 && [catch {wpGetVar bg}] == 0} {
+ lappend actlist [list fg $fg]
+ lappend actlist [list bg $bg]
+
+ # save rule
+ set ret [catch {WPCmd PEConfig ruleset indexcolor $subop $fno $patlist $actlist} res]
+ if {$ret} {
+ error [list _action "Color Set Error" $res]
+ } elseif {[string length $res]} {
+ WPCmd PEInfo statmsg "Index Color setting failed: $res"
+
+ set filtedit_indexcolor 1
+ set filtedit_fno $fno
+ set filtedit_add [expr {[string compare $subop add] == 0 ? 1 : 0}]
+ set filtedit_onfiltcancel conf_process
+ set script "fr_filtedit.tcl"
+ }
+ } else {
+ error [list _action "Unset FG/BG" "Internal Error: Unset Color Variables"]
+ }
+ }
+ }
+ }
+ }
+ }
+ clconfig {
+ wpGetVar cl
+ wpGetVar nick
+ wpGetVar server
+ wpGetVar user
+ wpGetVar stype
+ wpGetVar path
+ wpGetVar view
+ wpGetVar add
+ wpGetVarAs cle_cancel.x cle_cancel
+ wpGetVarAs cle_save.x cle_save
+
+ set cledit_add $add
+ set cledit_cl $cl
+ set cledit_onclecancel conf_process
+ if {[string length $cle_save]} {
+ if {[catch {cgi_import_as "ssl" sslval}]} {
+ set ssl 0
+ } else {
+ if {[string compare $sslval on] == 0} {
+ set ssl 1
+ } else {
+ set ssl 0
+ }
+ }
+ regexp "\{?(\[^\}\]*)\}?(.*)" $server match serverb serverrem
+ if {[string length $serverb]} {
+ if {$ssl == 1} {
+ set serverb "$serverb/ssl"
+ }
+ if {[string compare "" "$user"]} {
+ set serverb "$serverb/user=$user"
+ }
+ if {[string compare "imap" [string tolower $stype]]} {
+ set serverb "$serverb/[string tolower $stype]"
+ }
+ if {[string compare "nntp" [string tolower $stype]] == 0} {
+ regsub -nocase {^(#news\.)?(.*)$} "$path" "#news.\\2" path
+ if {[string compare "" $path] == 0} {
+ set path "#news."
+ }
+ }
+ set result ""
+ set ret 0
+ set servera "\{$serverb\}$serverrem"
+ if {$add} {
+ set ret [catch {WPCmd PEConfig cladd $cl $nick $servera $path $view} result]
+ } else {
+ set ret [catch {WPCmd PEConfig cledit $cl $nick $servera $path $view} result]
+ }
+ if {$ret != 0} {
+ error [list _action "Collection List Set" $result]
+ } elseif {[string compare "" $result]} {
+ if {$add} {
+ set clerrtext "Add failed: $result"
+ } else {
+ set clerrtext "Edit failed: $result"
+ }
+ WPCmd PEInfo statmsg $clerrtext
+ set script "fr_cledit.tcl"
+ }
+ } else {
+ set clerrtext "Bad data: Nothing defined for Server"
+ WPCmd PEInfo statmsg $clerrtext
+ set script "fr_cledit.tcl"
+ }
+ }
+ }
+ noop {
+ catch {WPCmd PEInfo noop}
+ }
+ cancel {
+ set script $oncancel
+ catch {WPCmd unset conf_page} res
+ }
+ default {
+ error [list _close "Unknown process operation: $op"]
+ }
+ }
+
+source [WPTFScript $script]
diff --git a/web/cgi/alpine/1.0/detach.tcl b/web/cgi/alpine/1.0/detach.tcl
new file mode 100755
index 00000000..d53ef313
--- /dev/null
+++ b/web/cgi/alpine/1.0/detach.tcl
@@ -0,0 +1,183 @@
+#!./tclsh
+# $Id: detach.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006-2007 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# detach.tcl
+#
+# Purpose: CGI script to retrieve requested attachment
+#
+# Input:
+set detach_vars {
+ {uid "Unknown Message UID"}
+ {part "Unknown Message Part"}
+ {download "" 0}
+}
+
+#set detach_via_ip_address 1
+#set detach_via_local_hostname 1
+
+# inherit global config
+source ./alpine.tcl
+
+proc WPServerIP {} {
+ global _wp
+
+ catch {
+ set ip 127.0.0.1
+ set sid [socket -async [info hostname] [expr {([string length $_wp(serverport)]) ? $_wp(serverport) : 80}]]
+ set ip [lindex [ fconfigure $sid -sockname ] 0]
+ close $sid
+ }
+
+ return $ip
+}
+
+WPEval $detach_vars {
+ if {[info exists env(PATH_INFO)]} {
+ if {[string index $env(PATH_INFO) 0] == "/"} {
+ set s [string range $env(PATH_INFO) 1 end]
+ if {[set i [string first "/" $s]] >= 0} {
+ set uid [string range $s 0 [expr {$i - 1}]]
+ set s [string range $s [incr i] end]
+ if {[set i [string first "/" $s]] >= 0} {
+ set part [string range $s 0 [expr {$i - 1}]]
+ }
+ }
+ }
+ }
+
+ if {[info exists uid] == 0 || [info exists part] == 0} {
+ error [list _action "Unspecified attachment UID or Part" "Please close this window."]
+ }
+
+ # generate big random string to reference the thing
+
+ # generate filenames to hold detached data and control file
+ for {set n 0} {1} {incr n} {
+
+ set rhandle [WPCmd PESession random 64]
+ set cfile [file join $_wp(fileroot) $_wp(detachpath) detach.${rhandle}-control]
+ set dfile [file join $_wp(fileroot) $_wp(detachpath) detach.${rhandle}-data]
+
+ if {[file exists $cfile] == 0 && [file exists $dfile] == 0} {
+ if {[catch {open $cfile {RDWR CREAT EXCL} [cgi_tmpfile_permissions]} cfd]} {
+ error [list _action Detach "Cannot create control file: [cgi_quote_html $cfd]" "Please close this window"]
+ } else {
+ exec echo ${rhandle}-control | [file join $_wp(cgipath) $_wp(appdir) whackatch.tcl] >& /dev/null &
+ }
+
+ if {[catch {open $dfile {RDWR CREAT EXCL} [cgi_tmpfile_permissions]} dfd]} {
+ catch {close $cfd}
+ error [list _action Detach "Cannot create command file: [cgi_quote_html $dfd]" "Please close this window"]
+ } else {
+ exec echo ${rhandle}-data | [file join $_wp(cgipath) $_wp(appdir) whackatch.tcl] >& /dev/null &
+ }
+
+ # exec chmod [cgi_tmpfile_permissions] $cfile
+ # exec chmod [cgi_tmpfile_permissions] $dfile
+ break
+ } elseif {$n > 4} {
+ error [list _action Detach "Command file creation limit" "Please close this window"]
+ }
+ }
+
+ if {[catch {WPCmd PEMessage $uid detach $part $dfile} attachdata]} {
+ error [list _action Detach $attachdata "Please close this window"]
+ }
+
+ if {[info exists detach_via_ip_address]} {
+ if {[regsub {^(http[s]?://)[A-Za-z0-9\\-\\.]+(.*)$} "[cgi_root]/pub/getach.tcl" "\\1\[[WPServerIP]\]\\2" redirect] != 1} {
+ error [list _action Detach "Cannot determine server address" "Please close this window"]
+ }
+ } elseif {[info exists detach_via_local_hostname]} {
+ if {[regsub {^(http[s]?://)[A-Za-z0-9\\-\\.]+(.*)$} "[cgi_root]/pub/getach.tcl" "\\1\[[info hostname]\]\\2" redirect] != 1} {
+ error [list _action Detach "Cannot determine server address" "Please close this window"]
+ }
+ } else {
+ set redirect "[cgi_root]/pub/getach.tcl"
+ }
+
+ set mimetype [lindex $attachdata 0]
+ set mimesubtype [lindex $attachdata 1]
+ set contentlength [lindex $attachdata 2]
+ set givenname [lindex [lindex $attachdata 3] 0]
+ set tmpfile [lindex $attachdata 4]
+
+ if {[string compare $tmpfile $dfile]} {
+ set straytmp "&straytmp=1"
+ } else {
+ set straytmp ""
+ }
+
+ if {![string length $givenname]} {
+ set givenname "attachment"
+ switch -regexp $mimetype {
+ ^[Tt][Ee][Xx][Tt]$ {
+ switch -regexp $mimesubtype {
+ ^[Pp][Ll][Aa][Ii][Nn]$ {
+ set givenname "attached.txt"
+ }
+ ^[Hh][Tt][Mm][Ll]$ {
+ set givenname "attached.html"
+ }
+ }
+ }
+ }
+ }
+
+ set safegivenname $givenname
+ regsub -all {[/]} $safegivenname {-} safegivenname
+ regsub -all {[ ]} $safegivenname {_} safegivenname
+ regsub -all {[\?]} $safegivenname {X} safegivenname
+ regsub -all {[&]} $safegivenname {X} safegivenname
+ regsub -all {[#]} $safegivenname {X} safegivenname
+ regsub -all {[=]} $safegivenname {X} safegivenname
+ set safegivenname "/[WPPercentQuote $safegivenname {.}]"
+
+ if {$download == 1} {
+ puts $cfd "Content-type: Application/X-Download"
+ puts $cfd "Content-Disposition: attachment; filename=\"$givenname\""
+ } else {
+ puts $cfd "Content-type: ${mimetype}/${mimesubtype}"
+ }
+
+ # side-step the cgi_xxx stuff in this special case because
+ # we don't want to buffer up the downloading attachment...
+
+ puts $cfd "Content-Length: $contentlength"
+ puts $cfd "Expires: [clock format [expr {[clock seconds] + 3600}] -f {%a, %d %b %Y %H:%M:%S GMT} -gmt true]"
+ puts $cfd "Cache-Control: max-age=3600"
+ puts $cfd ""
+
+ puts $cfd $tmpfile
+
+ # exec chmod [cgi_tmpfile_permissions] $tmpfile
+
+ close $cfd
+
+ # prepare to clean up if the brower never redirects
+
+ cgi_http_head {
+ # redirect to the place we stuffed the detach info. use the ip address
+ # to foil spilling any session cookies or the like
+ #cgi_redirect ${redirect}${safegivenname}?h=${rhandle}
+
+ if {[info exists env(SERVER_PROTOCOL)] && [regexp {[Hh][Tt][Tt][PP]/([0-9]+)\.([0-9]+)} $env(SERVER_PROTOCOL) m vmaj vmin] && $vmaj >= 1 && $vmin >= 1} {
+ cgi_puts "Status: 303 Temporary Redirect"
+ } else {
+ cgi_puts "Status: 302 Redirected"
+ }
+
+ cgi_puts "URI: ${redirect}${safegivenname}?h=${rhandle}${straytmp}"
+ cgi_puts "Location: ${redirect}${safegivenname}?h=${rhandle}${straytmp}"
+ }
+}
diff --git a/web/cgi/alpine/1.0/do_help.tcl b/web/cgi/alpine/1.0/do_help.tcl
new file mode 100644
index 00000000..400b3af2
--- /dev/null
+++ b/web/cgi/alpine/1.0/do_help.tcl
@@ -0,0 +1,48 @@
+# $Id: do_help.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ if {![string length $topic]} {
+ if {[catch {WPCmd PEInfo set help_context} s] == 0} {
+ set topic $s
+ catch {WPCmd PEInfo unset help_context}
+ }
+ }
+
+ cgi_head {
+ cgi_title "Alpine Help"
+ }
+
+ cgi_frameset "cols=112,*" frameborder=0 framespacing=0 border=0 {
+ set parms ""
+
+ foreach v $help_vars {
+ set val [subst $[lindex $v 0]]
+ if {[string length $val]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=$val"
+ }
+ }
+
+ cgi_frame bodindx=helpindex.tcl$parms title="Help Navigation"
+ cgi_frame bodtext=helpbody.tcl$parms title="Help Text"
+ }
+}
diff --git a/web/cgi/alpine/1.0/do_open.tcl b/web/cgi/alpine/1.0/do_open.tcl
new file mode 100755
index 00000000..22599a97
--- /dev/null
+++ b/web/cgi/alpine/1.0/do_open.tcl
@@ -0,0 +1,126 @@
+# $Id: do_open.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+if {$cid != [WPCmd PEInfo key]} {
+ error [list _action open "Invalid Operation ID" "Click Back button to try again."]
+}
+
+if {[catch {WPLoadCGIVar cancel}] == 0 && [string compare Cancel $cancel] == 0} {
+ catch {WPCmd PEInfo statmsg "Authentication Cancelled"}
+ cgi_http_head {
+ cgi_redirect [cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=${oncancel}.tcl
+ }
+} else {
+
+ if {[catch {WPLoadCGIVar path}]} {
+ WPLoadCGIVar colid
+ WPLoadCGIVar folder
+ set path [list $colid $folder]
+ } else {
+ set colid [lindex $path 0]
+ set folder [lrange $path 1 end]
+ }
+
+ if {[info exists src] == 0 && [catch {eval WPCmd PEMailbox open $path} reason]} {
+ if {[string first ": no such folder" $reason] > 0} {
+ catch {WPCmd PEInfo statmsg "Folder [lrange $path 1 end] doesn't exist"}
+ set src $oncancel
+ } elseif {[string compare BADPASSWD [string range $reason 0 8]] == 0 || [string compare $reason "Login Error"] == 0} {
+ # control error messages
+ set statmsgs [WPCmd PEInfo statmsgs]
+ WPCmd PEMailbox newmailreset
+ if {[catch {WPCmd PESession creds $colid $folder} creds] == 0 && $creds != 0} {
+ catch {
+ WPCmd PEInfo statmsg "Invalid Username or Password"
+ WPCmd PESession nocred $colid $folder
+ }
+ }
+
+ if {[catch {WPCmd PEFolder clextended} coln]} {
+ WPCmd set reason "Can't get Collection Info: $coln"
+ } else {
+ set coln [lindex $coln $colid]
+ if {[regexp {^([a-zA-Z\.]+).*\/user=([^ /]*)} [lindex $coln 4] dummy srvname authuser]} {
+ WPCmd set reason "Opening folder [cgi_bold $folder] first requires that you log in o the server [cgi_bold "$srvname"]."
+ WPCmd set authuser $authuser
+ } elseif {[WPCmd PEFolder isincoming $colid]} {
+ WPCmd set reason "Incoming folder [cgi_bold $folder] requires you log into the the server."
+ } else {
+ WPCmd set reason "Opening [cgi_bold $folder] in [cgi_bold [lindex $coln 1]] requires you log into the the server."
+ }
+ }
+
+ WPCmd set cid [WPCmd PEInfo key]
+ WPCmd set authcol $colid
+ WPCmd set authfolder $folder
+ WPCmd set authpage [WPPercentQuote "[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/open.tcl?folder=${folder}&colid=${colid}"]
+ WPCmd set authcancel [WPPercentQuote "[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders"]
+
+ set src [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_queryauth.tcl]
+
+ } else {
+ catch {WPCmd PEInfo statmsg "Cannot open $path: $reason"}
+ set src folders
+ }
+ } else {
+
+ # manage caching last folder opened
+ if {0 == [catch {WPCmd set wp_open_folder} last_folder]} {
+ WPTFAddFolderCache [lindex $last_folder 0] [lindex $last_folder 1]
+ }
+
+ catch {WPCmd set wp_open_folder [list $colid $folder]}
+
+ # start with the message indicated by the
+ # incoming-startup-rule' in the current index
+ set firstmsg 1
+ if {![catch {WPCmd PEMailbox firstinteresting} firstint] && $firstint > 0} {
+ set messagecount [WPCmd PEMailbox messagecount]
+ if {[catch {WPCmd PEInfo indexlines} ppg] || $ppg == 0} {
+ set ppg $_wp(indexlines)
+ }
+
+ for {set i 1} {$i < $messagecount} {incr i $ppg} {
+ if {$i >= $firstint} {
+ break
+ }
+
+ set firstmsg $i
+ }
+
+ # show whole last page
+ if {$firstmsg + $ppg > $messagecount} {
+ if {[set n [expr {($messagecount + 1) - $ppg}]] > 0} {
+ set firstmsg $n
+ } else {
+ set firstmsg 1
+ }
+ }
+ }
+
+ if {[catch {WPCmd PEMailbox uid $firstmsg} exp]} {
+ set exp 1
+ }
+
+ WPCmd set first $firstmsg
+ WPCmd set top $exp
+ WPCmd set uid $exp
+
+ WPCmd set width $_wp(width)
+ WPCmd set wp_spec_script fr_index.tcl
+ set src main.tcl
+ }
+}
+
+if {[info exists src]} {
+ source [WPTFScript $src]
+}
diff --git a/web/cgi/alpine/1.0/do_quit.tcl b/web/cgi/alpine/1.0/do_quit.tcl
new file mode 100755
index 00000000..0c013e4b
--- /dev/null
+++ b/web/cgi/alpine/1.0/do_quit.tcl
@@ -0,0 +1,98 @@
+#!./tclsh
+# $Id: do_quit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryquit.tcl
+#
+# Purpose: CGI script to handle quit query, either redirecting
+# to session logout or returning to message listn
+#
+# Input:
+set quit_vars {
+ {cid "Command ID"}
+ {quit {} ""}
+ {expinbox {} 0}
+ {expcurrent {} 0}
+ {cancel {} ""}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $quit_vars {
+ if {$cid != [WPCmd PEInfo key]} {
+ error "Invalid Command ID"
+ }
+
+ switch -regexp -- $quit {
+ "^Yes, .*" {
+
+ set exps ""
+
+ if {[string compare $expinbox "on"] == 0} {
+ append exps "&expinbox=1"
+ }
+
+ if {[string compare $expcurrent "on"] == 0} {
+ append exps "&expcurrent=1"
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_http_equiv Refresh "0; url=$_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=${sessid}${exps}"
+ }
+
+ cgi_body {
+ cgi_table height="20%" {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+
+ cgi_center {
+ cgi_table border=0 width=500 cellpadding=3 {
+ cgi_table_row {
+ cgi_table_data align=center rowspan=2 {
+ cgi_put [cgi_imglink logo]
+ }
+
+ cgi_table_data rowspan=2 {
+ put [nbspace]
+ put [nbspace]
+ }
+
+ cgi_table_data {
+ cgi_puts [cgi_font size=+2 face=Helvetica "Quitting Alpine ..."]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ default {
+ source [WPTFScript main]
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/do_view.tcl b/web/cgi/alpine/1.0/do_view.tcl
new file mode 100755
index 00000000..fb8c5af6
--- /dev/null
+++ b/web/cgi/alpine/1.0/do_view.tcl
@@ -0,0 +1,190 @@
+# $Id: do_view.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# do_view.tcl
+#
+# Purpose: CGI script to serve as the frame-work for including
+# supplied script snippets that generate the various
+# javascript-free webpine pages
+#
+# Input:
+set view_vars {
+ {uid {} 0}
+ {op {} ""}
+ {f_colid {} ""}
+ {f_name {} ""}
+ {savecancel {} ""}
+ {sid {} ""}
+ {auths {} 0}
+ {user {} ""}
+ {pass {} ""}
+ {create {} 0}
+}
+
+## read vars
+foreach item $view_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+WPCmd PEInfo set wp_spec_script fr_view.tcl
+
+proc statmsg {msg} {
+ catch {WPCmd PEInfo statmsg $msg}
+}
+
+if {$uid} {
+ # commit to servlet, view will retrieve it
+ WPCmd set uid $uid
+}
+
+set uidparm ""
+
+# If there's an "op" (meaning we got here from a comview.tcl
+# reference) trust "uid" is set within alpined's interpreter.
+if {[string length $op]} {
+# Set "op" only after we've concluded the folder's ready
+# for view.tcl to do the actual copy
+ if {[string compare save [string tolower $op]]} {
+ append uidparm "&op=$op"
+ }
+} else {
+ append uidparm "&uid=$uid"
+}
+
+if {[string length $savecancel]} {
+ append uidparm "&savecancel=$savecancel"
+}
+
+
+# handle doing the actual save mechanics here rather than
+# view.tcl since the result will have to be reflected
+# in comview.tcl's Save dropdown.
+if {[string compare save [string tolower $op]] == 0} {
+ if {[string length $savecancel] == 0} {
+ if {[string length [set folder [string trim $f_name]]]} {
+ switch -exact -- $folder {
+ __folder__prompt__ {
+ set uid 0
+ _cgi_set_uservar onselect {fr_view op=save}
+ _cgi_set_uservar oncancel fr_view
+ _cgi_set_uservar target spec
+ _cgi_set_uservar controls 0
+ source [WPTFScript savecreate]
+ set nopage 1
+ }
+ __folder__list__ {
+ set uid 0
+ _cgi_set_uservar onselect {fr_view op=save}
+ _cgi_set_uservar oncancel fr_view
+ _cgi_set_uservar target spec
+ _cgi_set_uservar controls 0
+ source [WPTFScript savebrowse]
+ set nopage 1
+ }
+ default {
+ if {$uid > 0} {
+ if {$auths} {
+ catch {WPCmd PESession nocred $f_colid $folder}
+ if {[catch {WPCmd PESession creds $f_colid $folder $user $pass} result]} {
+ statmsg "Cannot set credentials ($f_colid) $folder: result"
+ }
+ }
+
+ if {[catch {WPCmd PEFolder exists $f_colid $folder} reason]} {
+ if {[string compare BADPASSWD [string range $reason 0 8]] == 0} {
+ set oncancel "view.tcl&uid=$uid&savecancel=1"
+ set conftext "Create Folder '$folder'?"
+ lappend params [list page fr_view]
+ lappend params [list uid $uid]
+ lappend params [list op save]
+ lappend params [list f_name $folder]
+ lappend params [list f_colid $f_colid]
+ source [WPTFScript auth]
+ set nopage 1
+ } else {
+ statmsg "Existance test failed: $reason"
+ }
+ } elseif {$reason == 0} {
+ if {$create == 1 || [string compare create [string tolower $create]] == 0} {
+ if {[catch {WPCmd PEFolder create $f_colid $folder} reason]} {
+ statmsg "Create failed: $reason"
+ } else {
+ set dosave 1
+ }
+ } else {
+ #set oncancel "view&uid=$uid&savecancel=1"
+ set qstate [list $folder]
+ set params [list [list page fr_view]]
+ lappend params [list uid $uid]
+ lappend params [list sid [clock seconds]]
+ lappend params [list op save]
+ lappend params [list f_name $folder]
+ lappend params [list f_colid $f_colid]
+ lappend qstate $params
+
+ if {[catch {WPCmd PEInfo set querycreate_state $qstate}] == 0} {
+ source [WPTFScript querycreate]
+ set nopage 1
+ } else {
+ statmsg "Error saving creation state"
+ }
+ }
+ } else {
+ set dosave 1
+ }
+
+ if {[info exists dosave]} {
+ append uidparm "&op=save"
+ }
+ } else {
+ statmsg "Cannot Save unknown message ID"
+ }
+ }
+ }
+ } else {
+ statmsg "Cannot Save to emtpy folder name"
+ }
+ }
+}
+
+
+if {![info exists nopage]} {
+ cgi_http_head {
+ WPStdHttpHdrs {} 60
+ }
+
+ cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=38,*" border=0 frameborder=0 framespacing=0 {
+
+ if {[string length $f_colid] && [string length $f_name]} {
+ set parms "&f_colid=${f_colid}&f_name=[WPPercentQuote ${f_name}]"
+ if {[string length $sid]} {
+ append parms "&sid=$sid"
+ }
+ } else {
+ set parms ""
+ }
+
+ cgi_frame cmds=comview.tcl?c=[WPCmd PEInfo key]${parms} scrolling=no title="Message Commands"
+ cgi_frame body=wp.tcl?page=view${uidparm}${parms} title="Message Text"
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/docancel.tcl b/web/cgi/alpine/1.0/docancel.tcl
new file mode 100755
index 00000000..e3d0aab5
--- /dev/null
+++ b/web/cgi/alpine/1.0/docancel.tcl
@@ -0,0 +1,56 @@
+# $Id: docancel.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# post.tcl
+#
+# Purpose: CGI script to perform message posting via compose.tcl
+# generated form
+#
+# Input:
+set post_vars {
+ {cid "Missing Command ID"}
+ {postpost "" main}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $post_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ error [list _action "Impart Variable" $result]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ error [list _action Postpone "Invalid Operation ID" "Click Back button to try again."]
+}
+
+# clean up attachments
+WPCmd PEInfo statmsg "Message cancelled"
+catch {WPCmd PEInfo unset suspended_composition}
+
+source [WPTFScript $postpost]
diff --git a/web/cgi/alpine/1.0/dosend.tcl b/web/cgi/alpine/1.0/dosend.tcl
new file mode 100755
index 00000000..44130572
--- /dev/null
+++ b/web/cgi/alpine/1.0/dosend.tcl
@@ -0,0 +1,99 @@
+# $Id: dosend.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# post.tcl
+#
+# Purpose: CGI script to perform message posting via compose.tcl
+# generated form
+#
+# Input:
+set post_vars {
+ {cid "Missing Command ID"}
+ {postpost "" "main.tcl"}
+ {user "" ""}
+ {pass "" ""}
+ {server "" ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $post_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ error [list _action "Impart Variable" $result]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ error [list _action Postpone "Invalid Operation ID" "Click Back button to try again."]
+}
+
+if {[string length $user] && [string length $pass] && [string length $server]} {
+ set cclientname "\{$server\}"
+ catch {WPCmd PESession nocred 0 $cclientname}
+ if {[catch {WPCmd PESession creds 0 $cclientname $user $pass} result]} {
+ WPCmd PEInfo statmsg "Cannot set credentials for $server"
+ }
+}
+
+if {[catch {WPCmd PEInfo set suspended_composition} msgdata] == 0} {
+ if {[catch {WPCmd PECompose post $msgdata} errstr]} {
+ if {[string compare BADPASSWD [string range $errstr 0 8]] == 0
+ && [catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ set oncancel "page=compose&restore=1&cid=$cid"
+ set conftext "Send Messsage?"
+ set reason "The server used to send this message requires authentication.[cgi_nl][cgi_nl]Enter Username and Password to connect to $server"
+ _cgi_set_uservar params [WPPercentQuote [list [list server $server] [list page dosend] [list postpost $postpost]]]
+ set src auth
+ } else {
+ # regurgitate the compose window
+ _cgi_set_uservar style ""
+ #set style ""
+ set title "Send Error: [cgi_font class=notice "$errstr"]"
+ if {[string length $errstr]} {
+ set notice "Send FAILED: $errstr"
+ } else {
+ set notice "Send FAILED: [WPCmd PEInfo statmsg]"
+ }
+ WPCmd PEInfo statmsg "$notice"
+
+ if {[info exists attachments]} {
+ set a [split $attachments ","]
+ unset attachments
+ foreach id $a {
+ # id file size type/subtype
+ if {[catch {WPCmd PECompose attachinfo $id} result]} {
+ WPCmd PEInfo statmsg $result
+ } else {
+ lappend attachments [list $id [lindex $result 0] [lindex $result 1] [lindex $result 2]]
+ }
+ }
+ }
+
+ set src compose
+ }
+ } else {
+ catch {WPCmd PEInfo unset suspended_composition}
+ WPCmd PEInfo statmsg "Message Sent!"
+ set src $postpost
+ }
+} else {
+ WPCmd PEInfo statmsg "Internal Error: $msgdata"
+ set src $postpost
+}
+
+source [WPTFScript $src]
diff --git a/web/cgi/alpine/1.0/export.tcl b/web/cgi/alpine/1.0/export.tcl
new file mode 100755
index 00000000..338e928c
--- /dev/null
+++ b/web/cgi/alpine/1.0/export.tcl
@@ -0,0 +1,165 @@
+#!./tclsh
+# $Id: export.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# export.tcl
+#
+# Purpose: CGI script to download exported folder
+#
+# Input:
+set export_vars {
+ {cid "Unknown Command ID"}
+ {fid "Unknown Collection ID"}
+}
+
+#set export_via_ip_address 1
+#set export_via_local_hostname 1
+
+# inherit global config
+source ./alpine.tcl
+
+set mailextension ".mbx"
+
+proc WPServerIP {} {
+ global _wp
+
+ catch {
+ set ip 127.0.0.1
+ set sid [socket -async [info hostname] [expr {([string length $_wp(serverport)]) ? $_wp(serverport) : 80}]]
+ set ip [lindex [ fconfigure $sid -sockname ] 0]
+ close $sid
+ }
+
+ return $ip
+}
+
+
+WPEval $export_vars {
+ # generate filenames to hold exported folder and control file
+ for {set n 0} {1} {incr n} {
+
+ set rhandle [WPCmd PESession random 64]
+ set cfile [file join $_wp(detachpath) detach.${rhandle}.control]
+ set dfile [file join $_wp(detachpath) detach.${rhandle}.data]
+
+ if {[file exists $cfile] == 0 && [file exists $dfile] == 0} {
+ if {[catch {open $cfile {RDWR CREAT EXCL} [cgi_tmpfile_permissions]} cfd]
+ || [catch {open $dfile {RDWR CREAT EXCL} [cgi_tmpfile_permissions]} dfd]} {
+ if {[info exists dfd]} {
+ catch {close $cfd}
+ catch {file delete -force $cfile}
+ set errstr $dfd
+ } else {
+ set errstr $cfd
+ }
+
+ error [list _action Export "Cannot create command/control files: [cgi_quote_html $errstr]" "Please close this window"]
+ } else {
+ close $dfd
+ break
+ }
+ } elseif {$n > 4} {
+ error [list _action Export "Command file creation limit" "Please close this window"]
+ }
+ }
+
+ set colid [lindex $fid 0]
+ set fldr [eval "file join [lrange $fid 1 end]"]
+
+ catch {file delete $dfile}
+
+ if {[catch {WPCmd PEFolder export $colid $fldr $dfile} result]} {
+ WPCmd PEInfo statmsg $result
+ } else {
+ if {[set dfilesize [file size $dfile]] > 0
+ && ([info exists _wp(uplim_bytes)] && $_wp(uplim_bytes) > 0)
+ && $dfilesize > $_wp(uplim_bytes)} {
+ if {$_wp(uplim_bytes) > (1000000)} {
+ set dfs [format {%s.%.2s MB} [WPcomma [expr {$dfilesize / 1000000}]] [expr {$dfilesize % 1000000}]]
+ set esl [format {%s.%.2s MB} [WPcomma [expr {$_wp(uplim_bytes) / 1000000}]] [expr {$_wp(uplim_bytes) % 1000000}]]
+ } else {
+ set dfs "[WPcomma $dfs] KB"
+ set esl "[WPcomma $_wp(uplim_bytes)] KB"
+ }
+
+ WPCmd PEInfo statmsg "Exported folder size ($dfs) exceeds the maximum ($esl) size that can be imported.<br>If you wish to import this folder back into Web Alpine at a later time,<br>you should break it up into smaller folders"
+ }
+
+ if {[info exists export_via_ip_address]} {
+ if {[regsub {^(http[s]?://)[A-Za-z0-9\\-\\.]+(.*)$} "[cgi_root]/pub/getach.tcl" "\\1\[[WPServerIP]\]\\2" redirect] != 1} {
+ WPCmd PEInfo statmsg "Cannot determine server address"
+ catch {unset redirect}
+ }
+ } elseif {[info exists export_via_local_hostname]} {
+ if {[regsub {^(http[s]?://)[A-Za-z0-9\\-\\.]+(.*)$} "[cgi_root]/pub/getach.tcl" "\\1\[[info hostname]\]\\2" redirect] != 1} {
+ WPCmd PEInfo statmsg "Cannot determine server address"
+ catch {unset redirect}
+ }
+ } else {
+ set redirect "[cgi_root]/pub/getach.tcl"
+ }
+
+ set givenname "[file tail $fldr]${mailextension}"
+ set safegivenname $givenname
+ regsub -all {[/]} $safegivenname {-} safegivenname
+ regsub -all {[ ]} $safegivenname {_} safegivenname
+ regsub -all {[\?]} $safegivenname {X} safegivenname
+ regsub -all {[&]} $safegivenname {X} safegivenname
+ regsub -all {[#]} $safegivenname {X} safegivenname
+ regsub -all {[=]} $safegivenname {X} safegivenname
+ set safegivenname "/$safegivenname"
+
+ puts $cfd "Content-type: Application/X-Mail-Folder"
+ puts $cfd "Content-Disposition: attachment; filename=\"$givenname\""
+
+ # side-step the cgi_xxx stuff in this special case because
+ # we don't want to buffer up the downloading attachment...
+
+ puts $cfd "Content-Length: $dfilesize"
+ puts $cfd "Expires: [clock format [expr {[clock seconds] + 3600}] -f {%a, %d %b %Y %H:%M:%S GMT} -gmt true]"
+ puts $cfd "Cache-Control: max-age=3600"
+ puts $cfd "Refresh: 0; URL=\"$_wp(serverpath)/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders\""
+ puts $cfd ""
+
+ puts $cfd $dfile
+
+ # exec chmod [cgi_tmpfile_permissions] $dfile
+
+ close $cfd
+
+ exec /bin/chmod [cgi_tmpfile_permissions] $cfile
+ exec /bin/chmod [cgi_tmpfile_permissions] $dfile
+ }
+
+ # prepare to clean up if the brower never redirects
+ if {[info exists redirect]} {
+ set redirect "${redirect}${safegivenname}?h=${rhandle}"
+ } else {
+ set redirect "wp.tcl?page=folders&cid=$cid"
+ }
+
+ cgi_http_head {
+ # redirect to the place we stuffed the export info. use the ip address
+ # to foil spilling any session cookies or the like
+
+ if {[info exists env(SERVER_PROTOCOL)] && [regexp {[Hh][Tt][Tt][PP]/([0-9]+)\.([0-9]+)} $env(SERVER_PROTOCOL) m vmaj vmin] && $vmaj >= 1 && $vmin >= 1} {
+ cgi_puts "Status: 303 Temporary Redirect"
+ } else {
+ cgi_puts "Status: 302 Redirected"
+ }
+
+ cgi_puts "URI: $redirect"
+ cgi_puts "Location: $redirect"
+ }
+
+ exec echo $rhandle | [file join $_wp(cgipath) [WPCmd PEInfo set wp_ver_dir] whackatch.tcl] >& /dev/null &
+}
diff --git a/web/cgi/alpine/1.0/exporting.tcl b/web/cgi/alpine/1.0/exporting.tcl
new file mode 100644
index 00000000..b1242843
--- /dev/null
+++ b/web/cgi/alpine/1.0/exporting.tcl
@@ -0,0 +1,187 @@
+# $Id: exporting.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# exporting.tcl
+#
+# Purpose: CGI script to generate html output associated with folder
+# exporting explanation text
+#
+# Input:
+set export_vars {
+ {fid "Missing Collection ID"}
+ {cid "Missing Command ID"}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+# Command Menu definition for Message View Screen
+set export_menu {
+}
+
+set common_menu {
+ {
+ {}
+ {
+ {
+ # * * * * Cancel * * * *
+ cgi_put [cgi_url "Folder List" wp.tcl?page=folders&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+}
+
+## read vars
+foreach item $export_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {[catch {WPCmd PEInfo key} key]} {
+ error [list _action "command ID" $key]
+}
+
+# massage fid, strip leading "f_"
+set fid [string range [lindex $fid 0] 2 end]
+set digfid [cgi_unquote_input $fid]
+set colid [lindex $digfid 0]
+if {[set l [llength $digfid]] > 2} {
+ set fpath [eval "file join [lrange $digfid 1 [expr {[llength $digfid] - 1}]]"]
+} else {
+ set fpath ""
+}
+set fldr [lindex $digfid end]
+
+# paint the page
+cgi_http_head {
+ WPStdHttpHdrs text/html
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder Exporting"
+ WPStyleSheets
+ cgi_http_equiv Refresh "0; url=$_wp(serverpath)/$_wp(appdir)/$_wp(ui1dir)/export.tcl?fid=${fid}&cid=$cid"
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) {
+
+ set mbox [WPCmd PEMailbox mailboxname]
+
+ WPTFTitle "Folder Export"
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+
+ cgi_table_row {
+ cgi_table_data rowspan=2 valign=top class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=2 {
+ cgi_table_row {
+ cgi_table_data class=navbar style=padding-top:6 {
+ cgi_puts "Current Folder :"
+ cgi_division align=center "style=margin-top:4;margin-bottom:4" {
+ cgi_put [cgi_url [WPCmd PEMailbox mailboxname] fr_main.tcl target=_top class=navbar]
+
+ switch -exact -- [WPCmd PEMailbox state] {
+ readonly {
+ cgi_br
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Read Only)"]
+ }
+ closed {
+ cgi_br
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Closed)"]
+ }
+ ok -
+ default {}
+ }
+
+ cgi_br
+ }
+
+ cgi_hr "width=75%"
+ }
+ }
+
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar style=padding-bottom:10 {
+ WPTFCommandMenu export_menu common_menu
+ }
+ }
+ }
+ }
+ }
+
+ # down the right side of the table is the window's contents
+ cgi_table_data width="100%" valign=top class=dialog {
+
+ cgi_division "style=\"margin-left: 12%; margin-right: 12%\"" {
+
+ cgi_division align=center "style=\"padding: 18; font-size: bigger \"" {
+ cgi_puts "Export Folder"
+ }
+
+ cgi_puts "WebPine is preparing the folder [cgi_bold $fldr] for download. "
+ cgi_puts "You should see your browser's File Open Dialog appear any momment."
+
+ cgi_p
+
+ cgi_puts "The exported file will contain all of the messages in the folder separated "
+ cgi_puts "by a traditional mail message delimiter, and should be recognizable by "
+ cgi_puts "a variety of desktop mail programs."
+
+ cgi_p
+
+ cgi_puts "Be sure to pick a good name for the downloaded mail folder."
+ cgi_puts "If you are sure the folder has been exported properly (that is, "
+ cgi_puts "there were no error messages or other such problems, you can "
+ if {[string compare inbox [string tolower $mbox]]} {
+ cgi_puts "delete the folder from the collection."
+ } else {
+ cgi_puts "delete and expunge the messages from your INBOX."
+ }
+
+ cgi_p
+
+ cgi_puts "WebPine's [cgi_span "style=font-weight: bold; font-style: italic" Import] command, found to the right of each collection and "
+ cgi_puts "directory entry in the folder list, can be used to transfer the exported "
+ cgi_puts "mail folder from your computer back into a folder collection "
+ cgi_puts "suitable for viewing within WebPine "
+
+ cgi_p
+
+ cgi_puts "If your browser does not automatically return to the Folder List page after the download is complete, click the button below."
+
+ cgi_p
+
+ cgi_division align=center {
+ cgi_form $_wp(serverpath)/$_wp(appdir)/$_wp(ui1dir)/wp.tcl method=get {
+ cgi_text "page=folders" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+
+ cgi_submit_button "done=Return to Folder List"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
diff --git a/web/cgi/alpine/1.0/filtedit.tcl b/web/cgi/alpine/1.0/filtedit.tcl
new file mode 100755
index 00000000..34b9bd0f
--- /dev/null
+++ b/web/cgi/alpine/1.0/filtedit.tcl
@@ -0,0 +1,704 @@
+#!./tclsh
+# $Id: filtedit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# filtedit.tcl
+#
+# Purpose: CGI script to generate html form editing of a single filter
+
+#
+# include common filter info
+source filter.tcl
+
+#
+# Input:
+set filtedit_vars {
+ {cid "No cid"}
+ {oncancel "No oncancel"}
+ {onfiltcancel {} ""}
+ {fno {} -1}
+ {add {} 0}
+ {filterrtext {} ""}
+ {filtedit_score {} 0}
+ {filtedit_indexcolor {} 0}
+ {fg {} ""}
+ {bg {} ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $filtedit_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ if {[llength $item] > 2} {
+ set [lindex $item 0] [lindex $item 2]
+ } else {
+ error [list _action [lindex $item 1] $result]
+ }
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$filtedit_score} {
+ set filttype score
+ set filttypename Score
+} elseif {$filtedit_indexcolor} {
+ set filttype indexcolor
+ set filttypename "Index Color"
+} else {
+ set filttype filt
+ set filttypename Filter
+}
+
+if {[info exists filtedit_add]} {
+ set add $filtedit_add
+}
+
+if {[info exists filtedit_fno]} {
+ set fno $filtedit_fno
+}
+
+if {[info exists filtedit_onfiltcancel]} {
+ set onfiltcancel $filtedit_onfiltcancel
+}
+
+if {[info exists filtedit_filterrtext]} {
+ set filterrtext $filtedit_filterrtext
+}
+
+set filterr 0
+if {[string length $filterrtext]} {
+ set filterr 1
+}
+
+set filtedit_menu {
+ {
+ {}
+ {
+ {
+ # * * * * OK * * * *
+ #cgi_image_button filt_save=[WPimg but_save] border=0 alt="Save Config"
+ cgi_submit_button "${filttype}_save=Save"
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_submit_button filtcancel=Cancel
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_submit_button "${filttype}help=Get Help"
+ }
+ }
+ }
+}
+
+
+proc wpGetVarAs {_var _varas} {
+ upvar $_varas varas
+
+ if {[catch {cgi_import_as $_var varas} result]} {
+ set varas ""
+ }
+}
+
+proc freetext_cell {intro varname varval} {
+ cgi_table_data align=right {
+ cgi_puts [cgi_bold "$intro :[cgi_nbspace][cgi_nbspace]"]
+ }
+ cgi_table_data align=left {
+ cgi_text "$varname=$varval" "style=margin:2"
+ }
+}
+
+
+array set idvarnames $pattern_id
+array set idvarvals {}
+array set patvarnames $pattern_fields
+array set patvarvals {}
+array set actionvarnames $pattern_actions
+array set colvarnames $pattern_colors
+array set scorevarnames $pattern_scores
+
+array set actionvals {}
+
+cgi_http_head {
+ cgi_content_type
+ cgi_pragma no-cache
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "$filttypename List Configuration"
+ WPStyleSheets
+ }
+
+ if {$add == 0} {
+ if {$filtedit_score} {
+ set actions $pattern_scores
+ set fext [WPCmd PEConfig scoreextended $fno]
+ } elseif {$filtedit_indexcolor} {
+ set actions $pattern_colors
+ set fext [WPCmd PEConfig indexcolorextended $fno]
+ } else {
+ set actions $pattern_actions
+ set fext [WPCmd PEConfig filtextended $fno]
+ }
+
+ foreach fvar $fext {
+ switch -- [lindex $fvar 0] {
+ id {
+ foreach idvar [lindex $fvar 1] {
+ set idname [lindex $idvar 0]
+ if {[info exists idvarnames($idname)]} {
+ set idvarvals($idname) [lindex $idvar 1]
+ }
+ }
+ }
+ pattern {
+ foreach patternvar [lindex $fvar 1] {
+ set patname [lindex $patternvar 0]
+ if {[info exists patvarnames($patname)]} {
+ set patvarvals($patname) [lindex $patternvar 1]
+ }
+ }
+ }
+ filtaction {
+ foreach actionvar [lindex $fvar 1] {
+ set actionname [lindex $actionvar 0]
+ if {[info exists actionvarnames($actionname)]} {
+ set actionvals($actionname) [lindex $actionvar 1]
+ }
+ }
+ }
+ indexcolors {
+ foreach colvar [lindex $fvar 1] {
+ set colname [lindex $colvar 0]
+ if {[info exists colvarnames($colname)]} {
+ set actionvals($colname) [lindex $colvar 1]
+ }
+ }
+ }
+ scores {
+ foreach colvar [lindex $fvar 1] {
+ set actionvals([lindex $colvar 0]) [lindex $colvar 1]
+ }
+ }
+ }
+ }
+ } else {
+ if {$filtedit_score} {
+ set actions $pattern_scores
+ } elseif {$filtedit_indexcolor} {
+ set actions $pattern_colors
+ } else {
+ set actions $pattern_actions
+ }
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=filtconfig target=_top {
+ cgi_text "page=conf_process" type=hidden notab
+ cgi_text "cp_op=${filttype}config" type=hidden notab
+ cgi_text "cid=$cid" type=hidden notab
+ cgi_text "oncancel=$oncancel" type=hidden notab
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+ cgi_table_row {
+ #
+ # next comes the menu down the left side
+ #
+ eval {
+ cgi_table_data $_wp(menuargs) rowspan=4 {
+ WPTFCommandMenu filtedit_menu {}
+ }
+ }
+
+ #
+ # In main body of screen goes confg list
+ #
+ cgi_table_data valign=top width="100%" class=dialog {
+ if {[string length $onfiltcancel]} {
+ cgi_text "onfiltcancel=$onfiltcancel" type=hidden notab
+ }
+ cgi_text "fno=$fno" type=hidden notab
+ cgi_text "subop=[expr {$add ? "add" : "edit"}]" type=hidden notab
+ cgi_table border=0 cellspacing=0 cellpadding=0 {
+ # pattern title
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts "<fieldset>"
+ cgi_puts "<legend style=\"font-weight:bold;font-size:bigger\">$filttypename Identification</legend>"
+ cgi_table {
+ foreach {idname idtype} $pattern_id {
+ if {[info exists idvarvals($idname)]} {
+ set val $idvarvals($idname)
+ } else {
+ wpGetVarAs $idname val
+ }
+ cgi_table_row {
+ freetext_cell "$filttypename [lindex $idtype 0]" $idname $val
+ }
+ }
+ }
+ cgi_puts "</fieldset>"
+ }
+ }
+
+ # Folder Conditions
+ wpGetVarAs folder folder
+ wpGetVarAs ftype ftype
+ cgi_table_row {
+ cgi_table_data colspan=2 {
+ cgi_puts "<fieldset>"
+ cgi_puts "<legend style=\"font-weight:bold;font-size:bigger\">Folder Conditions</legend>"
+ cgi_table {
+ cgi_table_row {
+ cgi_table_data align=right valign=top {
+ cgi_puts [cgi_bold "Current Folder Type :"]
+ }
+ cgi_table_data align=left {
+ cgi_table border=0 cellpadding=0 cellspacing=0 {
+ cgi_table_row {
+ cgi_table_data width=50 {
+ cgi_puts "[cgi_nbspace]"
+ }
+ cgi_table_data {
+ cgi_table border=0 cellpadding=0 cellspacing=0 {
+ foreach type {any news email specific} {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_radio_button ftype=$type [expr {[string compare $ftype $type] == 0 ? "checked" : ""}] style="background-color:$_wp(dialogcolor)"
+ }
+ cgi_table_data {
+ switch -- $type {
+ any -
+ news -
+ email {
+ cgi_puts "[string toupper [string range $type 0 0]][string range $type 1 end]"
+ }
+ specific {
+ cgi_puts "Specific Folder List :"
+ cgi_text "folder=$folder"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ cgi_puts "</fieldset>"
+ }
+ }
+
+ # Message Conditions
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts "<fieldset>"
+ cgi_puts "<legend style=\"font-weight:bold;font-size:bigger\">Message Conditions</legend>"
+ cgi_table border=0 {
+ foreach {pvarname parvarval} $pattern_fields {
+
+ if {$filterr} {
+ wpGetVarAs $pvarname pvarval
+ } elseif {[info exists patvarvals($pvarname)]} {
+ set pvarval $patvarvals($pvarname)
+ } else {
+ set pvarval ""
+ }
+
+ cgi_table_row {
+ switch -- [lindex $patvarnames($pvarname) 1] {
+ freetext {
+ freetext_cell [lindex $patvarnames($pvarname) 0] $pvarname $pvarval
+ }
+ status {
+ cgi_table_data align=right {
+ cgi_puts "[cgi_bold [lindex $patvarnames($pvarname) 0]] :[cgi_nbspace][cgi_nbspace]"
+ }
+ cgi_table_data align=left {
+ cgi_select $pvarname "style=margin:2" {
+ cgi_option "Don't care, always matches" "value=either"
+ cgi_option "Yes" "value=yes" [expr {[string compare $pvarval "yes"] == 0 ? "selected" : ""}]
+ cgi_option "No" "value=no" [expr {[string compare $pvarval "no"] == 0 ? "selected" : ""}]
+ }
+ }
+ }
+ addrbook {
+ cgi_table_data align=right valign=top {
+ cgi_puts "[cgi_bold [lindex $patvarnames($pvarname) 0]] :[cgi_nbspace][cgi_nbspace]"
+ }
+ cgi_table_data align=left {
+ cgi_select addrbook "style=margin:2" {
+ cgi_option "Don't care, always matches" "value=either" [expr {[string compare $pvarval "either"] == 0 ? "selected" : ""}]
+ cgi_option "Yes, in any address book" "value=yes" [expr {[string compare $pvarval "yes"] == 0 ? "selected" : ""}]
+ cgi_option "No, not in any addressbook" "value=no" [expr {[string compare $pvarval "no"] == 0 ? "selected" : ""}]
+ cgi_option "Yes, in specific address book" "value=yesspecific" [expr {[string compare $pvarval "yesspecific"] == 0 ? "selected" : ""}]
+ cgi_option "No, not in specific address book" "value=nospecific" [expr {[string compare $pvarval "nospecific"] == 0 ? "selected" : ""}]
+ }
+ cgi_br
+ cgi_puts "Specific Addressbook:"
+ cgi_text "specificabook=" "style=margin:4"
+ cgi_br
+ cgi_puts "Types of addresses to check for in address book:"
+ cgi_table style=margin-left:30 {
+ cgi_table_row {
+ cgi_table_data nowrap {
+ cgi_checkbox abookfrom [expr {[string compare $pvarval "no"] == 0 ? "selected" : ""}]
+ cgi_puts "From"
+ }
+
+ cgi_table_data nowrap {
+ cgi_checkbox abookreplyto
+ cgi_puts "Reply-To"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data nowrap {
+ cgi_checkbox abooksender
+ cgi_puts "Sender"
+ }
+
+ cgi_table_data nowrap {
+ cgi_checkbox abookto
+ cgi_puts "To"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data nowrap {
+ cgi_checkbox abookcc
+ cgi_puts "Cc"
+ }
+ }
+ }
+ }
+ }
+ headers {
+ cgi_table_data align=right valign=top {
+ cgi_put "[cgi_bold [lindex $patvarnames($pvarname) 0]] :[cgi_nbspace][cgi_nbspace]"
+ }
+ cgi_table_data align=left {
+ cgi_table {
+ set hdrnum 0
+
+ if {[llength $pvarval] > 0} {
+ for {set n 0} {$n < [llength $pvarval]} {incr n} {
+ cgi_table_row {
+ cgi_table_data align=left nowrap {
+ cgi_text "hdrfld${n}=[lindex [lindex $pvarval $n] 0]" "style=margin:2"
+ cgi_put ":"
+ cgi_text "hdrval${n}=[lindex [lindex $pvarval $n] 1]" "style=margin:2"
+ cgi_submit_button "rmheader${n}=Remove"
+ }
+ }
+ }
+
+ cgi_text "header_total=$n" type=hidden notab
+ }
+
+ cgi_table_row {
+ cgi_table_data align=left nowrap {
+ cgi_submit_button "addheader=Add Header"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ cgi_puts "</fieldset>"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data "style=\"padding-bottom: 40\"" {
+ cgi_puts "<fieldset>"
+ cgi_puts "<legend style=\"font-weight:bold;font-size:bigger\">Filter Actions</legend>"
+ foreach {avarname patval} $actions {
+ switch -- $avarname {
+ indexcolor {
+ set ih [WPIndexLineHeight]
+ set iformat [WPCmd PEMailbox indexformat]
+ set num 0
+ cgi_division "width=100%" align=center "style=\"font-size: bigger; font-weight: bold; margin: 0 0 12 0 \"" {
+ cgi_puts "Choose Index Line Colors"
+ }
+
+ cgi_table width=100% align=center cellpadding=0 cellspacing=0 "style=\"font-family: geneva, arial, sans-serif; height: ${ih}pix; width: 90%; background-color: white ; border: 1px solid black\"" {
+ foreach l [list "Line One" "Sample Message" "Line Three"] {
+ set iclass [lindex {i0 i1} [expr ([incr num] % 2)]]
+ set istyle ""
+ if {$num == 2} {
+ wpGetVarAs fg fg
+ if {[string length $fg] == 0} {
+ if {[info exists actionvals($avarname)]} {
+ set fg [lindex $actionvals($avarname) 0]
+ }
+ }
+
+ cgi_text "fg=$fg" type=hidden notab
+ append istyle "; color: $fg"
+
+ wpGetVarAs bg bg
+ if {[string length $bg] == 0} {
+ if {[info exists actionvals($avarname)]} {
+ set bg [lindex $actionvals($avarname) 1]
+ }
+ }
+
+ cgi_text "bg=$bg" type=hidden notab
+ append istyle "; background-color: $bg"
+ }
+
+ cgi_table_row {
+ if {[WPCmd PEInfo feature enable-aggregate-command-set]} {
+ cgi_table_data height=${ih}pix class=$iclass "style=\"$istyle\"" {
+ cgi_checkbox bogus
+ }
+ }
+
+ foreach fmt $iformat {
+ cgi_table_data height=${ih}pix width=[lindex $fmt 1]% nowrap class=$iclass "style=\"$istyle\"" {
+ switch -regex [string tolower [lindex $fmt 0]] {
+ number {
+ cgi_puts "$num"
+ }
+ status {
+ set n [expr {(int((10 * rand()))) % 5}]
+ cgi_puts [lindex {N D F A { }} $n]
+ }
+ .*size.* {
+ cgi_puts "([expr int((10000 * rand()))])"
+ }
+ from.* {
+ cgi_puts "Some Sender"
+ }
+ subject {
+ cgi_puts $l
+ }
+ date {
+ cgi_puts [clock format [clock seconds] -format "%d %b"]
+ }
+ default {
+ cgi_puts [lindex $fmt 0]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ cgi_table width=80% align=center {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_table "style=\"background-color: #ffcc66\"" {
+ wpGetVarAs fgorbg fgorbg
+ cgi_table_row {
+ cgi_table_data {
+ if {[string length $fgorbg] == 0 || [string compare $fgorbg fg] == 0} {
+ set checked checked=1
+ } else {
+ set checked ""
+ }
+
+ cgi_radio_button fgorbg=fg $checked
+ }
+ cgi_table_data "style=\"align: left; padding-left: 12\"" {
+ cgi_puts "Foreground"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data {
+ if {[string length $checked]} {
+ set checked ""
+ } else {
+ set checked checked=1
+ }
+
+ cgi_radio_button fgorbg=bg $checked
+ }
+ cgi_table_data "style=\"align: left; padding-left: 12\"" {
+ cgi_puts "Background"
+ }
+ }
+ }
+ }
+ cgi_table_data align=center {
+ cgi_image_button "colormap=[WPimg nondither10x10]" alt="Color Pattern" "style=\"border: 1px solid black\""
+ }
+ }
+ }
+ }
+ folder {
+ if {[info exists actionvals(kill)]} {
+ set killit $actionvals(kill)
+ } else {
+ set killit 0
+ }
+
+ if {$filterr} {
+ wpGetVarAs action tval
+ set killit [expr {([string compare $tval "delete"] == 0) ? 1 : 0}]
+ }
+ cgi_table border=0 cellpadding=0 cellspacing=0 {
+ cgi_table_row {
+ cgi_table_data width=50 align=right valign=top {
+ cgi_puts [cgi_bold "Action:[cgi_nbspace]"]
+ }
+ cgi_table_data {
+ cgi_table border=0 cellpadding=0 cellspacing=0 {
+ cgi_table_row {
+ cgi_table_data valign=top {
+ cgi_radio_button action=status [expr {$killit ? "checked" : ""}] style="background-color:$_wp(dialogcolor)"
+ }
+ cgi_table_data {
+ cgi_puts "Set Message Status:"
+ cgi_division "style=\"margin-left: .5in\"" {
+ cgi_select actsetimp {
+ cgi_option "Don't change Important Status" "value=leave" [expr {[string compare $pvarval "either"] == 0 ? "selected" : ""}]
+ cgi_option "Set Important status" "value=set" [expr {[string compare $pvarval "yes"] == 0 ? "selected" : ""}]
+ cgi_option "Clear Important status" "value=clear" [expr {[string compare $pvarval "no"] == 0 ? "selected" : ""}]
+ }
+
+ cgi_br
+
+ cgi_select actsetnew {
+ cgi_option "Don't change New Status" "value=leave" [expr {[string compare $pvarval "either"] == 0 ? "selected" : ""}]
+ cgi_option "Set New status" "value=set" [expr {[string compare $pvarval "yes"] == 0 ? "selected" : ""}]
+ cgi_option "Clear New status" "value=clear" [expr {[string compare $pvarval "no"] == 0 ? "selected" : ""}]
+ }
+
+ cgi_br
+
+ cgi_select actsetdel {
+ cgi_option "Don't change Deleted Status" "value=leave" [expr {[string compare $pvarval "either"] == 0 ? "selected" : ""}]
+ cgi_option "Set Deleted status" "value=set" [expr {[string compare $pvarval "yes"] == 0 ? "selected" : ""}]
+ cgi_option "Clear Deleted status" "value=clear" [expr {[string compare $pvarval "no"] == 0 ? "selected" : ""}]
+ }
+
+ cgi_br
+
+ cgi_select actsetans {
+ cgi_option "Don't change Answered Status" "value=leave" [expr {[string compare $pvarval "either"] == 0 ? "selected" : ""}]
+ cgi_option "Set Answered status" "value=set" [expr {[string compare $pvarval "yes"] == 0 ? "selected" : ""}]
+ cgi_option "Clear Answered status" "value=clear" [expr {[string compare $pvarval "no"] == 0 ? "selected" : ""}]
+ }
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data valign=top {
+ cgi_radio_button action=delete [expr {$killit ? "checked" : ""}] style="background-color:$_wp(dialogcolor)"
+ }
+ cgi_table_data {
+ cgi_puts "Delete"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data valign=top {
+ cgi_radio_button action=move [expr {$killit == 0 ? "checked" : ""}] style="background-color:$_wp(dialogcolor)"
+ }
+ cgi_table_data {
+ cgi_puts "Move to Folder :"
+ if {$filterr} {
+ wpGetVarAs actionfolder tval
+ cgi_text "actionfolder=$tval"
+ } else {
+ if {[info exists actionvals($avarname)]} {
+ set av $actionvals($avarname)
+ } else {
+ set av 0
+ }
+
+ cgi_text "actionfolder=$av"
+ }
+ cgi_br
+ if {$filterr} {
+ wpGetVarAs moind moinval
+ set tval [expr {([string compare $moinval on] == 0) ? "checked" : ""}]
+ } else {
+ if {[info exists actionvals($avarname)] && $actionvals($avarname) == 1} {
+ set tval checked
+ } else {
+ set tval ""
+ }
+ }
+ cgi_checkbox moind $tval
+ cgi_puts "Move only if not deleted."
+ }
+ }
+ }
+ }
+ }
+ cgi_table_row {
+ wpGetVarAs setkeywords setkeywords
+ freetext_cell "Set these Keywoards" setkeywords $setkeywords
+ }
+ cgi_table_row {
+ wpGetVarAs clearkeywords clearkeywords
+ freetext_cell "Clear these Keywoards" clearkeywords $clearkeywords
+ }
+ }
+ }
+ scores {
+ cgi_table border=0 cellpadding=4 cellspacing=0 align=center {
+ cgi_table_row {
+ wpGetVarAs scoreval scoreval
+ if {[string length $scoreval] == 0} {
+ set scoreval $actionvals(scoreval)
+ }
+
+ freetext_cell "Score Value" scoreval $scoreval
+ }
+ cgi_table_row {
+ wpGetVarAs scorehdr scorehdr
+ if {[string length $scorehdr] == 0} {
+ set scorehdr $actionvals(scorehdr)
+ }
+
+ freetext_cell "Score Header" scorehdr $scorehdr
+ }
+ }
+ }
+ }
+ }
+
+ cgi_puts "</fieldset>"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/filter.tcl b/web/cgi/alpine/1.0/filter.tcl
new file mode 100755
index 00000000..2974f6ca
--- /dev/null
+++ b/web/cgi/alpine/1.0/filter.tcl
@@ -0,0 +1,63 @@
+# $Id: filter.tcl 391 2007-01-25 03:53:59Z mikes@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# filter.tcl
+#
+# Purpose: Common filter management data/routines
+
+set pattern_id {
+ nickname {"Nickname" freetext}
+ comment {"Comment" freetext}
+}
+
+set pattern_fields {
+ to {"To" freetext}
+ from {"From" freetext}
+ sender {"Sender" freetext}
+ cc {"Cc" freetext}
+ recip {"Recipients" freetext}
+ partic {"Participants" freetext}
+ news {"Newsgroups" freetext}
+ subj {"Subject" freetext}
+ alltext {"All Text" freetext}
+ bodytext {"Body Text" freetext}
+ age {"Age Interval" freetext}
+ size {"Size Interval" freetext}
+ score {"Score Interval" freetext}
+ keyword {"Keyword" freetext}
+ charset {"Character Set" freetext}
+ headers {"Extra Headers" headers}
+ stat_new {"Message is New" status}
+ stat_rec {"Message is Recent" status}
+ stat_del {"Message is Deleted" status}
+ stat_imp {"Message is Important" status}
+ stat_ans {"Message is Answered" status}
+ stat_8bitsubj {"Subject contains raw 8bit characters" status}
+ stat_bom {"Beginning of Month" status}
+ stat_boy {"Beginning of Year" status}
+ addrbook {"Address in address book" addrbook}
+}
+
+
+set pattern_actions {
+ kill {"kill"}
+ folder {"Folder"}
+ move_only_if_not_deleted {"moind"}
+}
+
+set pattern_colors {
+ indexcolor {indexcolor}
+}
+
+set pattern_scores {
+ scores {scores}
+}
diff --git a/web/cgi/alpine/1.0/flags.tcl b/web/cgi/alpine/1.0/flags.tcl
new file mode 100755
index 00000000..7cc83962
--- /dev/null
+++ b/web/cgi/alpine/1.0/flags.tcl
@@ -0,0 +1,112 @@
+#!./tclsh
+# $Id: flags.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryexpunge.tcl
+#
+# Purpose: CGI script to generate html form used to confirm
+# deleted message expunge
+#
+# Input:
+set flag_vars {
+ {uid "Missing UID"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+
+WPEval $flag_vars {
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Set Flags"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=body {
+ cgi_text "page=index" type=hidden notab
+ cgi_text "sessid=$sessid" type=hidden notab
+ cgi_text "uid=$uid" type=hidden notab
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="75%" {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts [cgi_nl][cgi_nl]
+ cgi_puts "Status flags are attributes you can assign to messages that help you associate certain meanings (for example, [cgi_bold Important]) or indicate to Web Alpine"
+ cgi_puts "how you would like to operate on the message (for example, the [cgi_bold Deleted] flag tells WebPine to permanently remove the"
+ cgi_puts "message from the folder when you [cgi_bold Expunge])."
+ cgi_puts [cgi_nl][cgi_nl]
+ cgi_puts "Set or unset desired flags for message [WPCmd PEMessage $uid number] below then"
+ cgi_puts "click [cgi_italic "Set Flags"], or [cgi_italic Cancel] to return to the list of messages"
+ cgi_puts "in [WPCmd PEMailbox mailboxname]."
+ cgi_br
+ cgi_br
+
+ set flaglist [WPCmd PEInfo flaglist]
+ set setflags [WPCmd PEMessage $uid status]
+
+ cgi_table class=dialog {
+ foreach item $flaglist {
+ cgi_table_row {
+ cgi_table_data valign=top align=right width="30%" {
+ if {[lsearch $setflags $item] >= 0} {
+ set checked checked
+ } else {
+ set checked ""
+ }
+
+ cgi_checkbox $item style="background-color:$_wp(dialogcolor)" $checked
+ }
+
+ cgi_table_data valign=top align=left {
+ switch -- $item {
+ New { set text "New" }
+ Answered { set text "Answered" }
+ Deleted { set text "Deleted" }
+ default { set text $item }
+ }
+ cgi_puts $text
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data colspan=2 height=50 {
+ cgi_br
+ cgi_submit_button "op=Set Flags"
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/fldrbrowse.tcl b/web/cgi/alpine/1.0/fldrbrowse.tcl
new file mode 100755
index 00000000..b9021a4d
--- /dev/null
+++ b/web/cgi/alpine/1.0/fldrbrowse.tcl
@@ -0,0 +1,335 @@
+# $Id: fldrbrowse.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# folders.tcl
+#
+# Purpose: CGI script to generate html output associated with folder
+# and collection management
+#
+# Input:
+set folder_vars {
+ {uid {} 0}
+ {show {} ""}
+ {expand {} ""}
+ {contract {} ""}
+ {target {} ""}
+ {onselect {} "compose"}
+ {oncancel {} "index"}
+ {controls {} 1}
+ {reload}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+# the name of this script
+set me [file tail [info script]]
+
+set indention 18
+
+proc pretty_folder_name {collections folder} {
+ set fcolid [lindex $folder 0]
+ for {set i 0} {$i < [llength $collections]} {incr i} {
+ set col [lindex $collections $i]
+ if {$fcolid == [lindex $col 0]} {
+ set coltext [lindex $col 1]
+ }
+ }
+ return "${coltext}:[join [lrange $folder 1 end] /]"
+}
+
+
+set key [WPCmd PEInfo key]
+
+
+#
+# Display the given folder list in a table (w/ mihodge mods)
+#
+proc blat_folder_list {colid flist shown path baseurl scroll anchorcntref onselect depth} {
+
+ global key border indention _wp target
+
+ set mbox [WPCmd PEMailbox mailboxname]
+
+ upvar $anchorcntref anchorcnt
+
+ set rownum 0
+
+ foreach folder $flist {
+ set t [lindex $folder 0]
+ set f [lindex $folder 1]
+ set ff [linsert $path [llength $path] $f]
+ set index -1
+
+ # initial pad=12, expand/contract control is 9px wide
+ set cellpad [expr {12 + ($depth * $indention)}]
+
+ if {[string first F $t] >= 0} {
+ set delim [WPCmd PEFolder delimiter $colid]
+ set fullpath [join [lrange $ff 1 end] $delim]
+ regsub -all {(')} [lrange $ff 1 end] {\\\\\1} ef
+ set celldata [cgi_url $f wp.tcl?page=[join ${onselect} {&}]&f_colid=${colid}&f_name=[WPPercentQuote [join $ef $delim]]&target=${target}&cid=$key target=${target}]
+ } else {
+ set celldata $f
+ }
+
+ if {[string first D $t] >= 0} {
+
+ if {[set index [lsearch $shown $ff]] < 0} {
+ set control expand
+ } else {
+ set control contract
+ }
+
+ set celldata "[cgi_url [cgi_imglink $control] "${baseurl}${control}=[WPPercentQuote $ff]#f_[WPPercentQuote $ff]" name=f_[WPPercentQuote $ff] "style=\"padding-right:10px\""]$celldata"
+ incr cellpad -19
+ }
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_put [cgi_img [WPimg dot2] height=1]
+ }
+
+ cgi_table_data align=left "style=\"padding-left: ${cellpad}px\"" nowrap {
+ cgi_put $celldata
+ }
+
+ cgi_table_data valign=top nowrap {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+
+ if {[string first D $t] >= 0 && $index >= 0} {
+ set nflist [eval WPCmd PEFolder list $ff]
+ set newpath $path
+ lappend newpath $f
+ blat_folder_list $colid $nflist $shown $newpath $baseurl $scroll anchorcnt $onselect [expr {$depth + 1}]
+ }
+
+ catch {unset control}
+ }
+}
+
+#
+# Command Menu definition for Message View Screen
+#
+set folder_menu {
+}
+
+set common_menu {
+ {
+ {expr {$controls == 1}}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_puts [cgi_url Cancel wp.tcl?page=$oncancel&cid=[WPCmd PEInfo key] class=navbar target=_top]
+ }
+ }
+ }
+ {}
+ {
+ {}
+ {
+ {
+ cgi_puts "Get Help"
+ }
+ }
+ }
+}
+
+
+## read vars
+foreach item $folder_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {[catch {WPNewMail $reload} newmail]} {
+ error [list _action "new mail" $newmail]
+}
+
+
+# perform any requested actions
+
+# preserve vars that my have been overridden with cgi parms
+
+if {[catch {WPCmd PEFolder collections} collections]} {
+ error [list _action "Collectoin list" $collections]
+}
+
+set shown [split $show ,]
+set scroll {}
+set anchorcnt 0
+
+# mihodge: process actions
+if {[llength $expand]} {
+ lappend shown $expand
+ set scroll $expand
+}
+
+if {[llength $contract]} {
+ if {[set index [lsearch $shown $contract]] >= 0} {
+ set shown [lreplace $shown $index $index]
+ set scroll $contract
+ }
+}
+
+set baseurl wp.tcl?page=fldrbrowse&onselect=[WPPercentQuote ${onselect}]&oncancel=${oncancel}&controls=${controls}&target=${target}&
+
+if {[llength $shown]} {
+ append baseurl "show=[WPPercentQuote [join $shown ,]]&"
+}
+
+
+# paint the page
+cgi_http_head {
+ WPStdHttpHdrs text/html
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder List" folders
+ if {$controls == 1} {
+ WPHtmlHdrReload "$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders"
+ }
+
+ WPStyleSheets
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) {
+
+ catch {WPCmd PEInfo set help_context folders}
+
+ # prepare context and navigation information
+
+ set navops ""
+
+ if {$controls == 1} {
+ WPTFTitle "Browse Folder" $newmail
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+ cgi_table_row {
+ if {$controls > 0} {
+ cgi_table_data rowspan=2 valign=top class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=0 {
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar {
+ WPTFCommandMenu folder_menu common_menu
+ }
+ }
+ }
+ }
+ }
+ }
+
+ # down the right side of the table is the window's contents
+ cgi_table_data width="100%" align=center valign=top class=dialog {
+
+ # then the table representing the folders
+ cgi_table width=75% border=0 cellspacing=0 cellpadding=2 align=center {
+
+ cgi_table_row {
+ cgi_table_data height=80 align=center valign=middle class=dialog {
+ switch $controls {
+ 0 -
+ 2 { set task "the Saved message" }
+ default { set task "your composition's [cgi_italic "File Carbon Copy"] (Fcc)" }
+ }
+
+ cgi_puts "Click a folder name below to use it as the destination for $task, or click [cgi_italic Cancel]"
+ cgi_puts "to return without choosing anything."
+ }
+ }
+
+ if {$controls != 1} {
+ cgi_table_row {
+ cgi_table_data align=center valign=top height=40 class=navbar {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=$target {
+ cgi_text page=$oncancel type=hidden notab
+ cgi_text cid=[WPCmd PEInfo key] type=hidden notab
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table border=0 cellspacing=0 cellpadding=2 align=center {
+ for {set i 0} {$i < [llength $collections]} {incr i} {
+ set col [lindex $collections $i]
+ set colid [lindex $col 0]
+
+ cgi_table_row {
+ cgi_table_data width=18 valign=top {
+ if {[llength $collections] > 1} {
+ if {[set index [lsearch $shown $colid]] < 0} {
+ cgi_puts [cgi_url [cgi_imglink expand] "${baseurl}expand=$colid"]
+ } else {
+ cgi_puts [cgi_url [cgi_imglink contract] "${baseurl}contract=$colid"]
+ }
+ } else {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+
+ cgi_table_data align=left {
+ if {[llength $collections] == 1} {
+ set menu "c"
+ set flist 1
+ } else {
+ if {[set index [lsearch $shown $colid]] < 0} {
+ set menu "ce"
+ set flist {}
+ } else {
+ set menu "cc"
+ set flist 1
+ }
+ }
+
+ if {[llength $flist]} {
+ set flist [WPCmd PEFolder list $colid]
+ }
+
+ if {$scroll == $colid} {
+ #cgi_javascript {cgi_puts {scroll = window.document.anchors.length;}}
+ }
+
+ cgi_puts [cgi_font face=Helvetica size=+1 "[lindex $col 1]<A NAME=\"f_$colid\">&nbsp;</A>"]
+
+ incr anchorcnt
+
+ if {[llength $flist]} {
+ blat_folder_list $colid $flist $shown $colid $baseurl $scroll anchorcnt $onselect 1
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/fldrsavenew.tcl b/web/cgi/alpine/1.0/fldrsavenew.tcl
new file mode 100755
index 00000000..a2a5f457
--- /dev/null
+++ b/web/cgi/alpine/1.0/fldrsavenew.tcl
@@ -0,0 +1,202 @@
+# $Id: fldrsavenew.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fldrsavenew.tcl
+#
+# Purpose: CGI script to generate html output associated with message
+# Save to a new folder
+#
+# Input:
+set folder_vars {
+ {onselect "" "index"}
+ {oncancel "" "index"}
+ {target "" ""}
+ {controls "" 1}
+ {reload}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+set key [WPCmd PEInfo key]
+
+#
+# Command Menu definition for Message View Screen
+#
+set folder_menu {
+}
+
+set common_menu {
+ {
+ {expr {$controls == 1}}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_puts [cgi_url Cancel wp.tcl?page=$oncancel&cid=[WPCmd PEInfo key] class=navbar target=_top]
+ }
+ }
+ }
+ {}
+ {
+ {}
+ {
+ {
+ cgi_puts "Get Help"
+ }
+ }
+ }
+}
+
+
+## read vars
+foreach item $folder_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {[catch {WPNewMail $reload} newmail]} {
+ error [list _action "new mail" $newmail]
+}
+
+# perform any requested actions
+
+# preserve vars that my have been overridden with cgi parms
+
+# paint the page
+cgi_http_head {
+ WPStdHttpHdrs text/html
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder Create for Save" folders
+ if {$controls == 1} {
+ WPHtmlHdrReload "$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=fldrsavenew"
+ }
+
+ WPStyleSheets
+ }
+
+ cgi_body onload=document.savepmt.f_name.focus() bgcolor=$_wp(bordercolor) {
+
+ catch {WPCmd PEInfo set help_context fldrsave}
+
+ # prepare context and navigation information
+
+ set navops ""
+
+ if {$controls == 1} {
+ WPTFTitle "Browse Folder" $newmail
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ if {$controls > 0} {
+ cgi_table_data rowspan=2 valign=top class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=2 {
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar {
+ WPTFCommandMenu folder_menu common_menu
+ }
+ }
+ }
+ }
+ }
+ }
+
+ # down the right side of the table is the window's contents
+ cgi_table_data width="100%" align=center valign=top class=dialog {
+
+ if {[string length $target] == 0} {
+ set target _top
+ }
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=$target name=savepmt {
+ cgi_text page=[lindex $onselect 0] type=hidden notab
+ for {set i 1} {$i < [llength $onselect]} {incr i} {
+ set a [split [lindex $onselect $i] {=}]
+ cgi_text [lindex $a 0]=[lindex $a 1] type=hidden notab
+ }
+
+ cgi_text cid=[WPCmd PEInfo key] type=hidden notab
+
+ # then the table representing the folders
+ cgi_table width=75% border=0 cellspacing=0 cellpadding=2 align=center {
+
+ cgi_table_row {
+ cgi_table_data height=140 align=center valign=middle class=dialog {
+ cgi_p "Enter the name of the folder to save to below, and then click [cgi_italic OK]."
+ cgi_p "You may enter either the name of an existing folder, or the name of a new folder name to have it created. You may also specify a directory path in front of the folder name."
+ cgi_p "Click [cgi_italic Cancel] to return without saving (or creating) anything."
+ }
+ }
+
+ if {[WPCmd PEFolder isincoming 0]} {
+ set f_colid 1
+ } else {
+ set f_colid 0
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center valign=top height=40 class=dialog {
+ cgi_put "Folder name : "
+ cgi_text f_name= type=text size=20 maxlength=256 style=vertical-align:middle onFocus=this.select()
+
+ if {[catch {WPCmd PEFolder collections} collections] == 0 && [llength $collections] > 1} {
+
+ cgi_put "within "
+
+ cgi_select f_colid style=vertical-align:middle {
+ set j 0
+ foreach i $collections {
+ if {$j == $f_colid} {
+ set selected selected
+ } else {
+ set selected {}
+ }
+ if {[string length [set f [lindex $i 1]]] > 12} {
+ set f "[string range $f 0 10]..."
+ }
+
+ cgi_option $f value=$j $selected
+ incr j;
+ }
+ }
+ } else {
+ cgi_text f_colid=0 type=hidden notab
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center valign=middle height=60 class=dialog {
+ cgi_submit_button "ok= OK "
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/web/cgi/alpine/1.0/folders.tcl b/web/cgi/alpine/1.0/folders.tcl
new file mode 100755
index 00000000..a173b778
--- /dev/null
+++ b/web/cgi/alpine/1.0/folders.tcl
@@ -0,0 +1,727 @@
+# $Id: folders.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# folders.tcl
+#
+# Purpose: CGI script to generate html output associated with folder
+# and collection management
+#
+# Input:
+set folder_vars {
+ {uid "" 0}
+ {cid {} ""}
+ {show {} ""}
+ {expand {} ""}
+ {contract {} ""}
+ {oncancel "" main}
+ {frestore "" 0}
+ {delquery {} ""}
+ {dwnquery {} ""}
+ {delete {} ""}
+ {renquery {} ""}
+ {rename {} ""}
+ {newfolder {} ""}
+ {folder {} ""}
+ {newdir {} ""}
+ {directory {} ""}
+ {import {} ""}
+ {cancelled {} ""}
+ {fid {} ""}
+ {reload}
+}
+
+set indention 18
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+proc linecolor {linenum} {
+ if {$linenum % 2} {
+ return "#EEEEEE"
+ } else {
+ return "#FFFFFF"
+ }
+}
+
+proc pretty_folder_name {collections folder} {
+ set fcolid [lindex $folder 0]
+ for {set i 0} {$i < [llength $collections]} {incr i} {
+ set col [lindex $collections $i]
+ if {$fcolid == [lindex $col 0]} {
+ set coltext [lindex $col 1]
+ }
+ }
+ return "${coltext}:[join [lrange $folder 1 end] /]"
+}
+
+#
+# Display the given folder list in a table (w/ mihodge mods)
+#
+proc blat_folder_list {colid flist shown path baseurl scroll anchorcntref depth} {
+ global key border indention mbox _wp
+
+ upvar $anchorcntref anchorcnt
+
+ set rownum 0
+
+ foreach folder $flist {
+ set t [lindex $folder 0]
+ set f [lindex $folder 1]
+ set ff [linsert $path [llength $path] $f]
+ set index -1
+
+ set bgcolor [linecolor [incr anchorcnt]]
+
+ # initial pad=12, expand/contract control is 9px wide
+ set cellpad [expr {12 + ($depth * $indention)}]
+ set delim [WPCmd PEFolder delimiter $colid]
+ set fullpath [join [lrange $ff 1 end] $delim]
+
+ if {[string first F $t] >= 0} {
+ regsub -all {(')} [lrange $ff 1 end] {\\\\\1} ef
+ set celldata [cgi_url $f open.tcl?colid=${colid}&folder=[WPPercentQuote $fullpath]&oncancel=folders&cid=$key target=_top]
+ } else {
+ set celldata $f
+ }
+
+ if {[string first D $t] >= 0} {
+
+ if {[set index [lsearch $shown $ff]] < 0} {
+ set control expand
+ } else {
+ set control contract
+ }
+
+ set celldata "[cgi_url [cgi_imglink $control] "${baseurl}${control}=[WPPercentQuote $ff]#f_[WPPercentQuote $ff]" name=f_[WPPercentQuote $ff] "style=\"padding-right:10px\""]$celldata"
+ incr cellpad -19
+ }
+
+ cgi_table_row bgcolor=$bgcolor {
+
+ cgi_table_data align=center {
+ if {[string first F $t] >= 0 || ([WPCmd PEFolder isincoming $colid] == 0 && [string compare $mbox $fullpath])} {
+ cgi_radio_button "fid=f_[WPPercentQuote $ff]"
+ }
+ }
+
+ cgi_table_data align=left "style=\"padding-left: ${cellpad}px\"" nowrap {
+ cgi_put $celldata
+ }
+
+ cgi_table_data valign=top nowrap {
+ if {[info exists control] && [string compare $control contract] == 0} {
+ cgi_submit_button "new_[WPPercentQuote $ff]=Create New..."
+ cgi_submit_button "imp_[WPPercentQuote $ff]=Import..."
+ } else {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+
+ if {[string first D $t] >= 0 && $index >= 0} {
+ set nflist [eval WPCmd PEFolder list $ff]
+ set newpath $path
+ lappend newpath $f
+ blat_folder_list $colid $nflist $shown $newpath $baseurl $scroll anchorcnt [expr {$depth + 1}]
+ }
+
+ catch {unset control}
+ }
+}
+
+
+#
+# Command Menu definition for Message View Screen
+#
+set folder_menu {
+}
+
+set common_menu {
+ {
+ {}
+ {
+ {
+ # * * * * Ubiquitous INBOX link * * * *
+ if {[string compare inbox [string tolower $mbox]]} {
+ cgi_put [cgi_url INBOX [cgi_root]/$_wp(appdir)/$_wp(ui1dir)/open.tcl?folder=INBOX&colid=0&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url INBOX fr_main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * COMPOSE * * * *
+ cgi_puts [cgi_url Compose wp.tcl?page=compose&oncancel=folders&cid=$key target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * RESUME * * * *
+ #set button [cgi_img [WPimg but_resume] border=0 alt="Resume"]
+ set button Resume
+ cgi_puts [cgi_url $button wp.tcl?page=resume&oncancel=folders&cid=$key class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Addr books * * * *
+ #set button [cgi_img [WPimg but_abook] border=0 alt="Address Book"]
+ set button "Address Book"
+ cgi_puts [cgi_url $button wp.tcl?page=addrbook&oncancel=folders class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ cgi_put [cgi_url "Configure" wp.tcl?page=conf_process&newconf=1&oncancel=folders&cid=[WPCmd PEInfo key] class=navbar target=_top]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ cgi_put [cgi_url "Get Help" wp.tcl?page=help&oncancel=folders class=navbar target=_top]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ # * * * * LOGOUT * * * *
+ if {[WPCmd PEInfo feature quit-without-confirm]} {
+ cgi_puts [cgi_url "Quit $_wp(appname)" $_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=$sessid target=_top class=navbar]
+ } else {
+ cgi_puts [cgi_url "Quit $_wp(appname)" wp.tcl?page=quit&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ }
+}
+
+## read vars
+foreach item $folder_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {[catch {WPCmd PEInfo key} key]} {
+ error [list _action "command ID" $key]
+}
+
+# perform requested op
+if {$delquery == 1 || [string compare $delquery Delete] == 0} {
+ if {[string length $fid]} {
+ set fid [string range $fid 2 end]
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_querydelfldr.tcl]
+ set nopage 1
+ } else {
+ lappend newmail [list "Click button next to folder name then Click [cgi_italic Delete]"]
+ }
+} elseif {$delete == 1 || [string compare $delete Delete] == 0} {
+ if {$cid != $key} {
+ lappend newmail [list "Invalid Command ID"]
+ } elseif {[string length $fid]} {
+ if {[catch [concat WPCmd PEFolder delete $fid] result] == 0} {
+ lappend newmail [list "'[lindex $fid end]' permanently removed"]
+ }
+ } else {
+ lappend newmail [list "Click button next to folder name then Click [cgi_italic Delete]"]
+ }
+} elseif {[string compare $delete Cancel] == 0} {
+ catch {WPCmd PEInfo unset wp_folder_script}
+ lappend newmail [list "Folder Delete Cancelled"]
+} elseif {[string compare $rename Cancel] == 0} {
+ catch {WPCmd PEInfo unset wp_folder_script}
+ lappend newmail [list "Folder Rename Cancelled"]
+} elseif {$renquery == 1 || [string compare $renquery Rename] == 0} {
+ if {$cid != $key} {
+ lappend newmail [list "Invalid Command ID"]
+ } elseif {[string length $fid]} {
+ set fid [string range $fid 2 end]
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_queryrenfldr.tcl]
+ set nopage 1
+ } else {
+ lappend newmail [list "Click button next to folder name then Click [cgi_italic Rename]"]
+ }
+} elseif {$dwnquery == 1 || [string compare $dwnquery Export] == 0} {
+ if {$cid != $key} {
+ lappend newmail [list "Invalid Command ID"]
+ } elseif {[string length $fid] <= 0} {
+ lappend newmail [list "Click button next to folder name then Click [cgi_italic Export]"]
+ } elseif {[file isdirectory $_wp(detachpath)] <= 0} {
+ lappend newmail [list "Server Configuration Problem: $_wp(detachpath) does not exist"]
+ } else {
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) exporting.tcl]
+ set nopage 1
+ }
+} elseif {[string compare $rename Rename] == 0} {
+ if {[string length $folder]} {
+ if {[catch [concat WPCmd PEFolder rename $fid [list $folder]] result]} {
+ } else {
+ lappend newmail [list "'[lindex $fid end]' renamed to '$folder'"]
+ }
+ } else {
+ lappend newmail [list "Rename failed: no new name provided"]
+ }
+} elseif {[string compare [string range $newfolder 0 5] Create] == 0} {
+ if {$cid != $key} {
+ lappend newmail [list "Invalid Command ID"]
+ } elseif {[string length $folder]} {
+ set fpath [lrange $fid 1 end]
+ lappend fpath $folder
+ if {[catch {WPCmd PEFolder delimiter [lindex $fid 0]} result]
+ || [catch {WPCmd PEFolder create [lindex $fid 0] [join $fpath $result]} result]} {
+ lappend newmail [list "Create failed: $result"]
+ } else {
+ lappend newmail [list "Folder $folder created"]
+ }
+ } else {
+ lappend newmail [list "Folder creation failed: no folder name provided"]
+ }
+} elseif {[string compare $newfolder Cancel] == 0} {
+ catch {WPCmd PEInfo unset wp_folder_script}
+ lappend newmail [list "Folder Create Cancelled"]
+} elseif {[string compare [string range $import 0 5] Import] == 0} {
+ if {[catch {WPImport file "Missing File Upload"} errstr] == 0} {
+ set local_file [lindex $file 0]
+
+ if {[catch {WPImport iname "import name"} errstr] == 0} {
+ set iname [string trim $iname]
+
+ if {[string length $iname]} {
+
+ set colid [lindex $fid 0]
+ set fldr [eval "file join [lrange $fid 1 end] $iname"]
+
+ if {[catch {WPCmd PEFolder import $local_file $colid $fldr} errstr] == 0} {
+ lappend newmail [list "Imported folder $iname"]
+ } else {
+ lappend newmail [list "Can't Import File: $errstr"]
+ }
+ } else {
+ lappend newmail [list "Must provide uploaded folder name"]
+ }
+ } else {
+ lappend newmail [list "Can't get uploaded folder name"]
+ }
+
+ catch {file delete -force $local_file}
+ } else {
+ lappend newmail [list "Problem uploading file"]
+ }
+} elseif {[string compare [string range $newdir 0 5] Create] == 0} {
+ if {$cid != $key} {
+ lappend newmail [list "Invalid Command ID"]
+ } elseif {[string length $directory]} {
+ set fpath [lrange $fid 1 end]
+ lappend fpath "${directory}/"
+ if {[catch {WPCmd PEFolder delimiter [lindex $fid 0]} result]
+ || [catch {WPCmd PEFolder create [lindex $fid 0] [join $fpath $result]} result]} {
+ lappend newmail [list "Create failed: $result"]
+ } else {
+ lappend newmail [list "Folder $directory created"]
+ }
+ } else {
+ lappend newmail [list "Directory Create failed: no name provided"]
+ }
+} elseif {[string compare $newdir Cancel] == 0} {
+ catch {WPCmd PEInfo unset wp_folder_script}
+ lappend newmail [list "Directory Creation Cancelled"]
+} elseif {[string compare $cancelled Cancel] == 0} {
+ catch {WPCmd PEInfo unset wp_folder_script}
+ lappend newmail [list "New Folder or Directory Creation Cancelled"]
+} elseif {[catch {WPCmd PEInfo set wp_folder_script} script] == 0} {
+ catch {WPCmd PEInfo unset wp_folder_script}
+ set uid 0
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) $script]
+ set nopage 1
+} else {
+ foreach i [cgi_import_list] {
+ switch -regexp -- $i {
+ ^new_[a-zA-Z0-9%_]*$ {
+ set fid [string range $i 4 end]
+ catch {WPCmd PEInfo set fid $fid}
+ catch {WPCmd PEInfo set wp_folder_script fr_querynewdir.tcl}
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_querynewfoldir.tcl]
+ set nopage 1
+ }
+ ^nd_[a-zA-Z0-9%_]*$ {
+ set fid [string range $i 3 end]
+ catch {WPCmd PEInfo set fid $fid}
+ catch {WPCmd PEInfo set wp_folder_script fr_querynewdir.tcl}
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_querynewdir.tcl]
+ set nopage 1
+ }
+ ^nf_[a-zA-Z0-9%_]*$ {
+ set fid [string range $i 3 end]
+ catch {WPCmd set fid $fid}
+ catch {WPCmd set wp_folder_script fr_querynewfldr.tcl}
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_querynewfldr.tcl]
+ set nopage 1
+ }
+ ^imp_[a-zA-Z0-9%_]*$ {
+ set fid [string range $i 4 end]
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_queryimport.tcl]
+ set nopage 1
+ }
+ default {
+ }
+ }
+
+ catch {WPCmd PEInfo unset fid}
+ catch {WPCmd PEInfo unset wp_folder_script}
+ }
+}
+
+if {[info exists nopage] == 0} {
+ if {$reload || $frestore || ([string length $show] == 0 && [string length $expand] == 0 && [string length $contract] == 0)} {
+ catch {set show [WPCmd PEInfo set fr_show]
+ set expand [WPCmd PEInfo set fr_expand]
+ set contract [WPCmd PEInfo set fr_contract]}
+ } else {
+ WPCmd set fr_show $show
+ WPCmd set fr_expand $expand
+ WPCmd set fr_contract $contract
+ }
+
+ # collect top level folder lists
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ error [list _action "Collection list" $collections]
+ }
+
+ set shown [split $show ,]
+ set scroll {}
+ set anchorcnt 0
+
+ # mihodge: process actions
+ if {[llength $expand]} {
+ lappend shown $expand
+ set scroll $expand
+ }
+
+ if {[llength $contract]} {
+ if {[set index [lsearch $shown $contract]] >= 0} {
+ set shown [lreplace $shown $index $index]
+ set scroll $contract
+ }
+ }
+
+ set baseurl wp.tcl?page=folders&
+
+ if {[llength $shown]} {
+ append baseurl "show=[WPPercentQuote [join $shown ,]]&"
+ }
+
+ # build top-level collection's folder list
+ for {set i 0} {$i < [llength $collections]} {incr i} {
+ set col [lindex $collections $i]
+ set colid [lindex $col 0]
+
+ if {[llength $collections] == 1} {
+ set flist 1
+ } else {
+ if {[set index [lsearch $shown $colid]] < 0} {
+ set flist {}
+ } else {
+ set flist 1
+ }
+ }
+
+ if {[llength $flist]} {
+ if {[catch {WPCmd PEFolder list $colid} flist]} {
+ if {[string compare BADPASSWD [string range $flist 0 8]] == 0} {
+ # control error messages
+ set statmsgs [WPCmd PEInfo statmsgs]
+ WPCmd PEMailbox newmailreset
+ if {[catch {WPCmd PESession creds [lindex $expand 0] folder} creds] == 0 && $creds != 0} {
+ catch {WPCmd PEInfo statmsg "Invalid Username or Password"}
+ WPCmd PESession nocred $expand folder
+ }
+
+ if {[catch {WPCmd PEFolder clextended} coln]} {
+ WPCmd set reason "Can't get Collection Info: $coln"
+ } else {
+ set coln [lindex $coln $expand]
+ if {[regexp {^([a-zA-Z\.]+).*\/user=([^ /]*)} [lindex $coln 4] dummy srvname authuser]} {
+ WPCmd set reason "Listing folders in the [cgi_bold [lindex $coln 1]] collection first requires that you log in to the server [cgi_bold "$srvname"]."
+ WPCmd set authuser $authuser
+ } else {
+ WPCmd set reason "Folders in the [cgi_bold [lindex $coln 1]] collection are on a server that must be logged into."
+ }
+ }
+
+ WPCmd set cid [WPCmd PEInfo key]
+ WPCmd set authcol [lindex $expand 0]
+ WPCmd set authfolder folder
+ WPCmd set authpage [WPPercentQuote "[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders&expand=$expand"]
+ WPCmd set authcancel [WPPercentQuote "[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders"]
+
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_queryauth.tcl]
+
+ catch {WPCmd unset fr_expand}
+
+ set nopage 1
+ } else {
+ set flist {}
+ }
+ }
+ }
+
+ lappend collectionfolders $flist
+ }
+}
+
+if {[info exists nopage] == 0} {
+ # collect new mail message and errors
+ if {[catch {WPNewMail $reload} newmailmsg]} {
+ error [list _action "new mail" $newmailmsg]
+ } else {
+ foreach m $newmailmsg {
+ lappend newmail $m
+ }
+
+ if {[info exists newmail] == 0} {
+ set newmail ""
+ }
+ }
+
+ # paint the page
+ cgi_http_head {
+ WPStdHttpHdrs text/html
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder List" folders
+
+ set onload "onLoad="
+ set onunload "onUnload="
+ set normalreload [cgi_buffer {WPHtmlHdrReload "$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders"}]
+
+ if {[info exists _wp(exitonclose)]} {
+ WPExitOnClose
+ append onload "wpLoad();"
+ append onunload "wpUnLoad();"
+
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_put "function viewReloadTimer(t){"
+ cgi_put " reloadtimer = window.setInterval('wpLink(); window.location.replace(\\'[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders&reload=1\\')', t * 1000);"
+ cgi_puts "}"
+ }
+
+ append onload "viewReloadTimer($_wp(refresh));"
+ cgi_noscript {
+ cgi_puts $normalreload
+ }
+ } else {
+ cgi_puts $normalreload
+ }
+
+ WPStyleSheets
+ if {$_wp(keybindings)} {
+ set kequiv {
+ {{i} {top.location = 'fr_main.tcl'}}
+ {{a} {top.location = 'wp.tcl?page=addrbook'}}
+ {{?} {top.location = 'wp.tcl?page=help&oncancel=folders'}}
+ }
+
+ lappend kequiv [list {c} "top.location = 'wp.tcl?page=compose&oncancel=folders&cid=$key'"]
+
+ append onload [WPTFKeyEquiv $kequiv]
+ }
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) background=[file join $_wp(imagepath) logo $_wp(logodir) back.gif] "style=\"background-repeat: repeat-x\"" $onload $onunload {
+
+ catch {WPCmd PEInfo set help_context folders}
+
+ # prepare context and navigation information
+
+ set mbox [WPCmd PEMailbox mailboxname]
+
+ lappend pagehier [list "Folder List"]
+ lappend pagehier [list [cgi_bold "\[Return to $mbox\]"] fr_main.tcl "View list of messages"]
+ if {[string compare $oncancel view] == 0} {
+ if {$uid} {
+ set num [WPCmd PEMessage $uid number]
+ } else {
+ set num View
+ }
+
+ lappend pagehier [list [cgi_bold "\[Return to Message $num\]"] view.tcl "View Message"]
+ }
+
+ set navops ""
+
+ WPTFTitle "Folder List" $newmail 0 "folders"
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+
+ cgi_table_row {
+ cgi_table_data valign=top class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=0 {
+ cgi_table_row {
+ cgi_table_data class=navbar "style=\"padding: 6 0 0 4\"" {
+ cgi_puts [cgi_span "style=font-weight: bold" "Current Folder"]
+ cgi_division align=center "style=margin-top:4;margin-bottom:4" {
+ set mbn [WPCmd PEMailbox mailboxname]
+ if {[string length $mbn] > 16} {
+ set mbn "[string range $mbn 0 14]..."
+ }
+
+ cgi_put [cgi_url $mbn fr_main.tcl target=_top class=navbar]
+
+ switch -exact -- [WPCmd PEMailbox state] {
+ readonly {
+ cgi_br
+ #cgi_put [cgi_span "style=color: black; border: 1px solid red; background-color: pink; font-weight: bold" "Read Only"]
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Read Only)"]
+ }
+ closed {
+ cgi_br
+ #cgi_put [cgi_span "style=color: black; border: 1px solid red; background-color: pink; font-weight: bold" "Closed"]
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Closed)"]
+ }
+ ok -
+ default {}
+ }
+
+ cgi_br
+ }
+
+ cgi_hr "width=75%"
+ }
+ }
+
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar style=padding-bottom:10 {
+ WPTFCommandMenu folder_menu common_menu
+ }
+ }
+ }
+ }
+ }
+
+ # down the right side of the table is the window's contents
+ cgi_table_data width="100%" bgcolor=#ffffff valign=top {
+
+ if {[llength $collections] > 1} {
+ cgi_division "style=\"font-family: helvetica; padding: 18; text-align: center\"" {
+ cgi_puts [cgi_span "style=font-weight: bold; font-size: 14pt; vertical-align: middle" "Folder Collections"]
+ cgi_br
+ cgi_puts [cgi_span "style=font-size: smaller" "(click to expand, open, delete, etc.)"]
+ }
+ }
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post target=_top {
+ cgi_text "page=folders" type=hidden notab
+ cgi_text "cid=$key" type=hidden notab
+ cgi_text "frestore=1" type=hidden notab
+ # then the table representing the folders
+ cgi_table border=0 cellspacing=0 cellpadding=2 align=center {
+ for {set i 0} {$i < [llength $collections]} {incr i} {
+ set col [lindex $collections $i]
+ set colid [lindex $col 0]
+
+ if {[llength $collections] == 1} {
+ set menu "c"
+ set flist 1
+ } else {
+ if {[set index [lsearch $shown $colid]] < 0} {
+ set menu "ce"
+ set flist {}
+ } else {
+ set menu "cc"
+ set flist 1
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data nowrap valign=middle {
+ if {[WPCmd PEFolder isincoming $colid] == 0 && [llength $flist]} {
+ cgi_image_button delquery=[WPimg but_folddel] border=0 alt=Delete
+ cgi_image_button renquery=[WPimg but_foldren] border=0 alt=Rename style=margin-left:4
+ cgi_image_button dwnquery=[WPimg but_foldexp] border=0 alt=Export style=margin-left:4
+ }
+ }
+
+ if {[llength $collections] > 1} {
+ if {[set index [lsearch $shown $colid]] < 0} {
+ set colpref [cgi_url [cgi_imglink expand] "${baseurl}expand=$colid" name=f_$colid]
+ } else {
+ set colpref [cgi_url [cgi_imglink contract] "${baseurl}contract=$colid" name=f_$colid]
+ }
+ } else {
+ set colpref ""
+ }
+
+ cgi_table_data align=left "style=\"padding-left:10\"" nowrap {
+ if {[llength [lindex $collectionfolders $i]]} {
+ set flist [lindex $collectionfolders $i]
+ }
+
+ cgi_puts ${colpref}[cgi_span "style=font-family:Helvetica; size: large; padding-left:10" "[lindex $col 1]"]
+ }
+
+ if {[llength $flist]} {
+ if {[WPCmd PEFolder isincoming $colid] == 0} {
+ cgi_table_data valign=middle nowrap {
+ cgi_submit_button "new_$colid=Create New..."
+ cgi_submit_button "imp_$colid=Import..."
+ }
+ }
+ }
+ }
+
+ if {[llength $flist]} {
+ blat_folder_list $colid $flist $shown $colid $baseurl $scroll anchorcnt 1
+ }
+
+ cgi_table_row {
+ cgi_table_data height=12 {
+ cgi_put [cgi_nbspace]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_addrbrowse.tcl b/web/cgi/alpine/1.0/fr_addrbrowse.tcl
new file mode 100755
index 00000000..2e1d2504
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_addrbrowse.tcl
@@ -0,0 +1,66 @@
+# $Id: fr_addrbrowse.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_addrbrowse.tcl
+#
+# Purpose: CGI script to generate frame set for selecting addresses
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {op "" ""}
+ {field "" ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ append parms "&[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=73
+ cgi_frame subbody=wp.tcl?page=addrbook${parms}
+ }
+ }
diff --git a/web/cgi/alpine/1.0/fr_addredit.tcl b/web/cgi/alpine/1.0/fr_addredit.tcl
new file mode 100644
index 00000000..5836c001
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_addredit.tcl
@@ -0,0 +1,86 @@
+# $Id: fr_addredit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_addredit.tcl
+#
+# Purpose: CGI script to generate frame set for address book operations
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {book {} -1}
+ {nick {} ""}
+ {add {} 0}
+ {fn {} ""}
+ {addrs {} ""}
+ {fcc {} ""}
+ {comment {} ""}
+ {take {} 0}
+ {newnick {} ""}
+ {ai {} -1}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ set parms ""
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+ }
+
+ if {$add} {
+ set title 72
+ } else {
+ set title 71
+ }
+
+ cgi_frame hdr=header.tcl?title=${title}
+ cgi_frame body=addredit.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_cledit.tcl b/web/cgi/alpine/1.0/fr_cledit.tcl
new file mode 100755
index 00000000..60ae3909
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_cledit.tcl
@@ -0,0 +1,79 @@
+#!./tclsh
+# $Id: fr_cledit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_conf_process.tcl
+#
+# Purpose: CGI script to generate frame set for config operations
+# in webpine-lite pages.
+# This page assumes that it was loaded by conf_process.tcl
+
+# Input:
+set frame_vars {
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+ set add 0
+ if {[info exists cledit_add] && $cledit_add == 1} {
+ set add 1
+ }
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr [expr {$add == 1 ? "Add Collection Configuration" : "Edit Collection Configuration"}]
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ if {0} {
+ set parms ""
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+ }
+
+ set title [expr {$add == 1 ? 151 : 152}]
+ set parms ""
+ if {[info exists cledit_add]} {
+ set parms "${parms}&add=${cledit_add}"
+ }
+ if {[info exists cledit_cl]} {
+ set parms "${parms}&cl=${cledit_cl}"
+ }
+ if {[info exists cledit_onclecancel]} {
+ set parms "${parms}&onclecancel=${cledit_onclecancel}"
+ }
+
+ cgi_frame hdr=header.tcl?title=${title}
+ cgi_frame body=wp.tcl?page=cledit&cid=$cid&oncancel=$oncancel$parms
+ }
+ }
+
diff --git a/web/cgi/alpine/1.0/fr_compose.tcl b/web/cgi/alpine/1.0/fr_compose.tcl
new file mode 100755
index 00000000..bcdd3c35
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_compose.tcl
@@ -0,0 +1,144 @@
+# $Id: fr_compose.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_comp.tcl
+#
+# Purpose: CGI script to generate frame set for composer in
+# webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {uid "" 0}
+ {part "" ""}
+ {style "" ""}
+ {nickto "" ""}
+ {book "" 0}
+ {ai "" -1}
+ {notice "" ""}
+ {repall "" 0}
+ {reptext "" 0}
+ {repqstr "" ""}
+ {restore "" 0}
+ {f_name "" ""}
+ {f_colid "" 0}
+ {cid "Missing Command ID"}
+ {spell "" ""}
+ {oncancel "" "main.tcl"}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Import Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+switch -- $style {
+ Reply {
+ set title "40,[WPCmd PEMessage $uid number]"
+ }
+ Forward {
+ set title "30,[WPCmd PEMessage $uid number]"
+ }
+ Postponed {
+ set title "20,"
+ }
+ Spell {
+ # validate input
+ set spellresult {}
+ if {[catch {cgi_import_as last_line last} result] == 0 && [regexp {^[0-9]+$} $last] && $last < 10000} {
+ array set replace {}
+
+ for {set n 0} {$n < $last} {incr n} {
+ if {[catch {cgi_import_as l_$n locs} result] == 0} {
+
+ set words {}
+
+ foreach l [split $locs {,}] {
+ if {[regexp {[0-9]+_([0-9]+)_([0-9]+)} $l match o len]} {
+ if {[info exists replace($l)]} {
+ lappend words [list $o $len $replace($l)]
+ } elseif {([catch {cgi_import_as r_$l newword} result] == 0 && [string length [set newword [string trim $newword { }]]])
+ || ([catch {cgi_import_as s_$l newword} result] == 0 && [string length [set newword [string trim $newword { }]]])} {
+ lappend words [list $o $len $newword]
+ if {[catch {cgi_import_as a_$l allofem} result] == 0
+ && [string compare $allofem on] == 0
+ && [catch {cgi_import_as e_$l allofem} result] == 0} {
+ foreach e [split $allofem {,}] {
+ set replace($e) $newword
+ }
+ }
+ }
+ }
+ }
+
+ if {[llength $words]} {
+ lappend spellresult [list $n $words]
+ }
+ }
+ }
+
+ if {[llength $spellresult]} {
+ catch {WPCmd PEInfo set wp_spellresult $spellresult}
+ }
+ }
+
+ set title "10,"
+ }
+ default {
+ set title "10,"
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr Compose
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms &
+ } else {
+ append parms ?
+ }
+
+ append parms "[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=$title title="Composer Title"
+ cgi_frame body=compose.tcl${parms} title="Compose Form"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_filtedit.tcl b/web/cgi/alpine/1.0/fr_filtedit.tcl
new file mode 100755
index 00000000..41abee9b
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_filtedit.tcl
@@ -0,0 +1,136 @@
+#!./tclsh
+# $Id: fr_filtedit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_conf_process.tcl
+#
+# Purpose: CGI script to generate frame set for config operations
+# in webpine-lite pages.
+# This page assumes that it was loaded by conf_process.tcl
+
+# Input:
+set frame_vars {
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+source filter.tcl
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Filter Configuration"
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ if {[info exists filtedit_add] && 1 == $filtedit_add} {
+ set title 153
+ } else {
+ set title 154
+ }
+
+ set parms ""
+ if {[info exists filtedit_add]} {
+ set parms "${parms}&add=${filtedit_add}"
+ }
+ if {[info exists filtedit_fno]} {
+ set parms "${parms}&fno=${filtedit_fno}"
+ }
+ if {[info exists filtedit_onfiltcancel]} {
+ set parms "${parms}&onfiltcancel=${filtedit_onfiltcancel}"
+ }
+ if {[info exists filtedit_indexcolor]} {
+ set parms "${parms}&filtedit_indexcolor=1"
+ if {[info exists fg] && [string length $fg]} {
+ set parms "${parms}&fg=$fg"
+ }
+ if {[info exists bg] && [string length $bg]} {
+ set parms "${parms}&bg=$bg"
+ }
+ if {[info exists fgorbg]} {
+ set parms "${parms}&fgorbg=$fgorbg"
+ }
+ } elseif {[info exists filtedit_score]} {
+ set parms "${parms}&filtedit_score=1"
+ if {[info exists scoreval] && [string length $scoreval]} {
+ set parms "${parms}&scoreval=$scoreval"
+ }
+ if {[info exists scorehdr] && [string length $scorehdr]} {
+ set parms "${parms}&scoreval=$scorehdr"
+ }
+ }
+
+ if {[info exists filterrtext]} {
+ # relay pattern elements
+ set parms "${parms}&filterrtext=${filterrtext}"
+ foreach {pvar pexp} $pattern_id {
+ if {[info exists $pvar]} {
+ if {[string length [set pval [subst $$pvar]]]} {
+ append parms "&${pvar}=${pval}"
+ }
+ }
+ }
+
+ foreach {pvar pexp} $pattern_fields {
+ if {[info exists $pvar]} {
+ if {[string length [set pval [subst $$pvar]]]} {
+ append parms "&${pvar}=${pval}"
+ }
+ }
+ }
+
+ # relay various pattern actions
+ if {[info exists action] || 0 == [catch {WPImport action}]} {
+ append parms "&action=$action"
+ }
+
+ if {0 == [catch {WPImport actionfolder}]} {
+ append parms "&actionfolder=$actionfolder"
+ }
+
+ if {0 == [catch {WPImport moind}] && [string length $moind]} {
+ append parms "&moind=$moind"
+ }
+
+ if {0 == [catch {WPImport actionfolder}]} {
+ append parms "&actionfolder=$actionfolder"
+ }
+
+ if {[info exists folder] == 0} {
+ wpGetVarAs folder folder
+ }
+
+ if {[string length $folder]} {
+ append parms "&folder=$folder"
+ }
+
+ if {[info exists ftype] == 0} {
+ wpGetVarAs ftype ftype
+ }
+
+ if {[string length $ftype]} {
+ append parms "&ftype=$ftype"
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=${title}
+ cgi_frame body=wp.tcl?page=filtedit&cid=$cid&oncancel=$oncancel$parms
+ }
+ }
+
diff --git a/web/cgi/alpine/1.0/fr_flags.tcl b/web/cgi/alpine/1.0/fr_flags.tcl
new file mode 100755
index 00000000..febc2eaf
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_flags.tcl
@@ -0,0 +1,67 @@
+#!./tclsh
+# $Id: fr_flags.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_flags.tcl
+#
+# Purpose: CGI script to generate frame set for flag setting
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {uid "Missing UID"}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $frame_vars {
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=160
+ cgi_frame subbody=flags.tcl${parms}
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_fldrbrowse.tcl b/web/cgi/alpine/1.0/fr_fldrbrowse.tcl
new file mode 100644
index 00000000..9373e5ff
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_fldrbrowse.tcl
@@ -0,0 +1,71 @@
+# $Id: fr_fldrbrowse.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_fldrbrowse.tcl
+#
+# Purpose: CGI script to generate frame set for selecting a folder from the user's
+# defined collections in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {onselect "" main}
+ {oncancel "" main}
+ {target "" ""}
+ {controls "" 0}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ append parms "&[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+
+ switch $controls {
+ 2 { set tnum 221 }
+ default {set tnum 220}
+ }
+
+ cgi_frame subhdr=header.tcl?title=${tnum} title="Folder Selection for Save"
+ cgi_frame subbody=wp.tcl?page=fldrbrowse${parms} title="Folder Selection Frame"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_fldrsavenew.tcl b/web/cgi/alpine/1.0/fr_fldrsavenew.tcl
new file mode 100644
index 00000000..f59a8914
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_fldrsavenew.tcl
@@ -0,0 +1,65 @@
+# $Id: fr_fldrsavenew.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_fldrcreate.tcl
+#
+# Purpose: CGI script to generate frame set for creating a new folder to save to
+
+# Input:
+set frame_vars {
+ {onselect "" main}
+ {oncancel "" main}
+ {target "" ""}
+ {controls "" 0}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ append parms "&[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+
+ switch $controls {
+ 2 { set tnum 223 }
+ default {set tnum 222}
+ }
+
+ cgi_frame subhdr=header.tcl?title=${tnum} title="Folder Creation for Save"
+ cgi_frame subbody=wp.tcl?page=fldrsavenew${parms} title="Folder Creation Frame"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_help.tcl b/web/cgi/alpine/1.0/fr_help.tcl
new file mode 100755
index 00000000..a6f7e388
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_help.tcl
@@ -0,0 +1,91 @@
+# $Id: fr_help.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_help.tcl
+#
+# Purpose: CGI script to generate frame set for display of help text
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {topic "" ""}
+ {index "" ""}
+ {oncancel "" ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ cgi_title "WebPine Help"
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),0,*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists help_vars]} {
+ foreach v $help_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ lappend parmlist [lindex $v 0]
+
+ append parms "[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+ }
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {(![info exists parmlist] || [lsearch -exact $parmlist [lindex $v 0]] < 0) && [string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=140 title="Help Title"
+ cgi_frame noop=wp.tcl?page=noop
+ cgi_frame body=help.tcl$parms title="Help Body"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_index.tcl b/web/cgi/alpine/1.0/fr_index.tcl
new file mode 100755
index 00000000..92b34184
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_index.tcl
@@ -0,0 +1,58 @@
+#!./tclsh
+# $Id: fr_index.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_index.tcl
+#
+# Purpose: CGI script to serve as the frame-work for including
+# supplied script snippets that generate the various
+# javascript-free webpine pages
+
+# Input:
+set index_vars {
+ {expunge ""}
+ {emptyit ""}
+ {f_colid {} ""}
+ {f_name {} ""}
+ {cid {} 0}
+ {split {} 0}
+}
+
+# Output:
+#
+
+# read config
+source ./alpine.tcl
+
+WPEval $index_vars {
+ cgi_http_head {
+ WPStdHttpHdrs {} 10
+ }
+
+ cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=100%,*" border=0 frameborder=0 framespacing=0 {
+ set parms ""
+ if {[info exists index_vars]} {
+ foreach v $index_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ append parms "&[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame body=wp.tcl?page=index${parms} title="Message List"
+ }
+ }
+} \ No newline at end of file
diff --git a/web/cgi/alpine/1.0/fr_ldapbrowse.tcl b/web/cgi/alpine/1.0/fr_ldapbrowse.tcl
new file mode 100755
index 00000000..c6ac8c59
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_ldapbrowse.tcl
@@ -0,0 +1,61 @@
+# $Id: fr_ldapbrowse.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_ldapbrowse.tcl
+#
+# Purpose: CGI script to generate frame set for selecting addresses
+# from an LDAP query in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input: (NOTE: these are expected to be set when we get here)
+set frame_vars {
+ {ldapquery "" ""}
+ {addresses "" ""}
+ {field "" ""}
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=74
+ cgi_frame subbody=ldapbrowse.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_ldapquery.tcl b/web/cgi/alpine/1.0/fr_ldapquery.tcl
new file mode 100644
index 00000000..b2b90e24
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_ldapquery.tcl
@@ -0,0 +1,75 @@
+# $Id: fr_ldapquery.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_ldapquery.tcl
+#
+# Purpose: CGI script to generate frame set for LDAP server query
+# handling in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {dir "Missing Directory Index"}
+ {srchstr {} ""}
+ {field {} ""}
+ {op {} ""}
+ {searchtype {} ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ set parms ""
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=240
+ cgi_frame body=ldapquery.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_main.tcl b/web/cgi/alpine/1.0/fr_main.tcl
new file mode 100755
index 00000000..8654ab69
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_main.tcl
@@ -0,0 +1,34 @@
+#!./tclsh
+# $Id: fr_main.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_main.tcl - frame set for Index and View
+#
+# Purpose: CGI script to serve as the frame-work for including
+# supplied script snippets that generate the various
+# javascript-free webpine pages
+
+# Input:
+set frame_vars {
+ {expunge {} 0}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+
+
+WPEval $frame_vars {
+ source main.tcl
+}
diff --git a/web/cgi/alpine/1.0/fr_promptsave.tcl b/web/cgi/alpine/1.0/fr_promptsave.tcl
new file mode 100755
index 00000000..4bbf040b
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_promptsave.tcl
@@ -0,0 +1,68 @@
+# $Id: fr_promptsave.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_promptsave.tcl
+#
+# Purpose: CGI script to generate frame set for resume composition form
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=3 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=190
+ cgi_frame subbody=promptsave.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_queryattach.tcl b/web/cgi/alpine/1.0/fr_queryattach.tcl
new file mode 100755
index 00000000..8cbdc015
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_queryattach.tcl
@@ -0,0 +1,70 @@
+# $Id: fr_queryattach.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_queryattach.tcl
+#
+# Purpose: CGI script to generate frame set for specifying an attachment
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=110
+ cgi_frame subbody=queryattach.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_queryauth.tcl b/web/cgi/alpine/1.0/fr_queryauth.tcl
new file mode 100755
index 00000000..ad5d13d1
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_queryauth.tcl
@@ -0,0 +1,71 @@
+# $Id: fr_queryauth.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_queryauth.tcl
+#
+# Purpose: CGI script to generate frame set for input of user/passwd
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {cid "Missing Command ID"}
+ {authcol "Missing Authenticaion Collection"}
+ {authfolder "Missing Authentication Folder"}
+ {authpage "Missing Post Authorization Instructions"}
+ {authcancel "Missing Auth Cancel Instructions"}
+ {authuser "" ""}
+ {reason "" ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ append parms "&[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=130 title="Status Frame"
+ cgi_frame body=$_wp(serverpath)/session/queryauth.tcl?sessid=$_wp(sessid)${parms} title="User and Password Prompt"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_querycreate.tcl b/web/cgi/alpine/1.0/fr_querycreate.tcl
new file mode 100755
index 00000000..b3ff332c
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_querycreate.tcl
@@ -0,0 +1,42 @@
+# $Id: fr_querycreate.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_querycreate.tcl
+#
+# Purpose: CGI script to generate frame set for creation confirmation
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ cgi_frame subhdr=header.tcl?title=120 title="Status Frame"
+ cgi_frame subbody=querycreate.tcl title="Creation Confirmation Prompt"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_querydelfldr.tcl b/web/cgi/alpine/1.0/fr_querydelfldr.tcl
new file mode 100755
index 00000000..653c52cb
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_querydelfldr.tcl
@@ -0,0 +1,43 @@
+# $Id: fr_querydelfldr.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_querydelfldr.tcl
+#
+# Purpose: CGI script to generate frame set for folder delete confirmation
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {fid "No Folder Specified"}
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ cgi_frame subhdr=header.tcl?title=170
+ cgi_frame subbody=querydelfldr.tcl?fid=$fid
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_queryexpunge.tcl b/web/cgi/alpine/1.0/fr_queryexpunge.tcl
new file mode 100755
index 00000000..704c12c7
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_queryexpunge.tcl
@@ -0,0 +1,71 @@
+# $Id: fr_queryexpunge.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_expunge.tcl
+#
+# Purpose: CGI script to generate frame set for expunge confirmation
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ WPCmd PEInfo set wp_spec_script fr_queryexpunge.tcl
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=90
+ cgi_frame subbody=queryexpunge.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_queryimport.tcl b/web/cgi/alpine/1.0/fr_queryimport.tcl
new file mode 100644
index 00000000..d4e7ee28
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_queryimport.tcl
@@ -0,0 +1,44 @@
+# $Id: fr_queryimport.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_queryimport.tcl
+#
+# Purpose: CGI script to generate frame set for specifying a folder
+# to upload and import to a collection. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {fid "No Folder Specified"}
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ cgi_frame subhdr=header.tcl?title=250 title="Folder Import Dialog"
+ cgi_frame subbody=queryimport.tcl?fid=$fid
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_querynewdir.tcl b/web/cgi/alpine/1.0/fr_querynewdir.tcl
new file mode 100755
index 00000000..a8f54899
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_querynewdir.tcl
@@ -0,0 +1,43 @@
+# $Id: fr_querynewdir.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_querynewdir.tcl
+#
+# Purpose: CGI script to generate frame set for Directory create confirmation
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {fid "No Folder Specified"}
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ cgi_frame subhdr=header.tcl?title=172
+ cgi_frame subbody=querynewdir.tcl?fid=$fid
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_querynewfldr.tcl b/web/cgi/alpine/1.0/fr_querynewfldr.tcl
new file mode 100755
index 00000000..6bc17b42
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_querynewfldr.tcl
@@ -0,0 +1,43 @@
+# $Id: fr_querynewfldr.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_querynewfldr.tcl
+#
+# Purpose: CGI script to generate frame set for folder create confirmation
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {fid "No Folder Specified"}
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ cgi_frame subhdr=header.tcl?title=171
+ cgi_frame subbody=querynewfldr.tcl?fid=$fid
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_querynewfoldir.tcl b/web/cgi/alpine/1.0/fr_querynewfoldir.tcl
new file mode 100755
index 00000000..fc6a61b7
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_querynewfoldir.tcl
@@ -0,0 +1,43 @@
+# $Id: fr_querynewfoldir.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_querynewfoldir.tcl
+#
+# Purpose: CGI script to generate frame set for Folder/Directory create confirmation
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {fid "No Folder Specified"}
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ cgi_frame subhdr=header.tcl?title=174
+ cgi_frame subbody=querynewfoldir.tcl?fid=$fid
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_queryprune.tcl b/web/cgi/alpine/1.0/fr_queryprune.tcl
new file mode 100644
index 00000000..20e9638c
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_queryprune.tcl
@@ -0,0 +1,66 @@
+# $Id: fr_queryprune.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_queryprune.tcl
+#
+# Purpose: CGI script to generate frame set for pruning dialog
+# in webpine.
+
+# Input:
+set frame_vars {
+ {cid "Missing Command ID"}
+ {start "Missing Start Page"}
+ {nojs "" 0}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ }
+
+ append parms "[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
+ }
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=260 title="Folder Pruning Frame"
+ cgi_frame body=queryprune.tcl?sessid=$_wp(sessid)&${parms} title="Folder Pruning Dialog"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_queryquit.tcl b/web/cgi/alpine/1.0/fr_queryquit.tcl
new file mode 100644
index 00000000..4f12e8ba
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_queryquit.tcl
@@ -0,0 +1,70 @@
+# $Id: fr_queryquit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_queryquit.tcl
+#
+# Purpose: CGI script to generate frame set for logging out of a session
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {cid "Missing Command ID"}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ cgi_http_equiv Refresh "$_wp(logoutpause); url=$_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=${sessid}"
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=3 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=230
+ cgi_frame subbody=queryquit.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_queryrenfldr.tcl b/web/cgi/alpine/1.0/fr_queryrenfldr.tcl
new file mode 100755
index 00000000..a498700c
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_queryrenfldr.tcl
@@ -0,0 +1,43 @@
+# $Id: fr_queryrenfldr.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_queryrenfldr.tcl
+#
+# Purpose: CGI script to generate frame set for folder rename confirmation
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {fid "No Folder Specified"}
+}
+
+# Output:
+#
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ cgi_frame subhdr=header.tcl?title=173
+ cgi_frame subbody=queryrenfldr.tcl?fid=$fid
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_querysave.tcl b/web/cgi/alpine/1.0/fr_querysave.tcl
new file mode 100755
index 00000000..af8e8c88
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_querysave.tcl
@@ -0,0 +1,68 @@
+# $Id: fr_querysave.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_querysave.tcl
+#
+# Purpose: CGI script to generate frame set for resume composition form
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=3 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=90
+ cgi_frame subbody=querysave.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_resume.tcl b/web/cgi/alpine/1.0/fr_resume.tcl
new file mode 100755
index 00000000..3e332cae
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_resume.tcl
@@ -0,0 +1,104 @@
+# $Id: fr_resume.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_resume.tcl
+#
+# Purpose: CGI script to generate frame set for resume composition form
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {oncancel "" main}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+proc ppnd_uid {ppnd} {
+ foreach i $ppnd {
+ switch -- [lindex $i 0] {
+ uid {
+ return [lindex $i 1]
+ }
+ }
+ }
+
+ error "No Valid UID for Postponed message"
+}
+
+
+if {[catch {WPLoadCGIVar cid} result]} {
+ catch {WPCmd PEInfo statmsg "Missing Command ID: $result"}
+ source [WPTFScript $oncancel]
+} elseif {$cid != [WPCmd PEInfo key]} {
+ catch {WPCmd PEInfo statmsg "Invalid Command ID"}
+ source [WPTFScript $oncancel]
+} elseif {[catch {WPCmd PEPostpone count} postponed]} {
+ catch {WPCmd PEInfo statmsg "Resume Error: $postponed"}
+ source [WPTFScript $oncancel]
+} else {
+ switch -- $postponed {
+ -1 -
+ 0 {
+ catch {WPCmd PEInfo statmsg "No Postponed Messages"}
+ source [WPTFScript $oncancel]
+ }
+ default {
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ set parms ""
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=80 title="Status Frame"
+ cgi_frame body=resume.tcl${parms} title="Resumable Message List"
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_seldate.tcl b/web/cgi/alpine/1.0/fr_seldate.tcl
new file mode 100755
index 00000000..99f0a933
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_seldate.tcl
@@ -0,0 +1,70 @@
+# $Id: fr_seldate.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_seldate.tcl
+#
+# Purpose: CGI script to generate frame set for selecting by date
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {uid "" 0}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=101
+ cgi_frame subbody=seldate.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_select.tcl b/web/cgi/alpine/1.0/fr_select.tcl
new file mode 100755
index 00000000..8b70d23a
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_select.tcl
@@ -0,0 +1,71 @@
+# $Id: fr_select.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_select.tcl
+#
+# Purpose: CGI script to generate frame set for selecting by the various methods
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {uid "" 0}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=104 title="Status Frame"
+ cgi_frame subbody=select.tcl${parms} title="Search Criteria"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_selstat.tcl b/web/cgi/alpine/1.0/fr_selstat.tcl
new file mode 100755
index 00000000..317684fd
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_selstat.tcl
@@ -0,0 +1,71 @@
+# $Id: fr_selstat.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_selstat.tcl
+#
+# Purpose: CGI script to generate frame set for selecting by status
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {uid "" 0}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=103
+ cgi_frame subbody=selstat.tcl${parms}
+ }
+ }
diff --git a/web/cgi/alpine/1.0/fr_seltext.tcl b/web/cgi/alpine/1.0/fr_seltext.tcl
new file mode 100755
index 00000000..644ed353
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_seltext.tcl
@@ -0,0 +1,71 @@
+# $Id: fr_seltext.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_seltext.tcl
+#
+# Purpose: CGI script to generate frame set for selecting by text
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {uid "" 0}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=102
+ cgi_frame subbody=seltext.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_spellcheck.tcl b/web/cgi/alpine/1.0/fr_spellcheck.tcl
new file mode 100755
index 00000000..bdd64e07
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_spellcheck.tcl
@@ -0,0 +1,71 @@
+# $Id: fr_spellcheck.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_spellcheck.tcl
+#
+# Purpose: CGI script to generate frame set for spell checking composition
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {repqstr "" ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame hdr=header.tcl?title=180
+ cgi_frame body=spellcheck.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_split.tcl b/web/cgi/alpine/1.0/fr_split.tcl
new file mode 100644
index 00000000..1861ad35
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_split.tcl
@@ -0,0 +1,58 @@
+# $Id: fr_split.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_split.tcl
+#
+# Purpose: CGI script to serve as the frame-work for including
+# supplied script snippets that generate the various
+# javascript-free webpine pages
+
+# Input:
+set split_vars {
+}
+
+# Output:
+#
+
+## read vars
+foreach item $split_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs {} 10
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=33%,*" {
+ set parms ""
+ if {[info exists split_vars]} {
+ foreach v $split_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ append parms "&[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame fr_top=wp.tcl?page=index&split=1${parms} title="Message List"
+ cgi_frame fr_bottom=fr_view.tcl?split=1${parms} title="Message View"
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_take.tcl b/web/cgi/alpine/1.0/fr_take.tcl
new file mode 100644
index 00000000..b5a37ebb
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_take.tcl
@@ -0,0 +1,70 @@
+# $Id: fr_take.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_take.tcl
+#
+# Purpose: CGI script to generate frame set for taking addresses
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {uid "Missing UID"}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=210
+ cgi_frame subbody=takeaddr.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_takeedit.tcl b/web/cgi/alpine/1.0/fr_takeedit.tcl
new file mode 100644
index 00000000..a339bafe
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_takeedit.tcl
@@ -0,0 +1,79 @@
+# $Id: fr_takeedit.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_takeedit.tcl
+#
+# Purpose: CGI script to generate frame set for taking addresses
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {book "Missing address book"}
+ {nick {} ""}
+ {add {} 0}
+ {fn {} ""}
+ {addrs {} ""}
+ {fcc {} ""}
+ {comment {} ""}
+ {take {} 0}
+ {newnick {} ""}
+ {ai {} -1}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=211
+ cgi_frame subbody=addredit.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_takesame.tcl b/web/cgi/alpine/1.0/fr_takesame.tcl
new file mode 100644
index 00000000..fb69a4aa
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_takesame.tcl
@@ -0,0 +1,79 @@
+# $Id: fr_takesame.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_takeedit.tcl
+#
+# Purpose: CGI script to generate frame set for taking addresses
+# in webpine-lite pages. the idea is that this
+# page specifies a frameset that loads a "header" page
+# used to keep the servlet alive via
+# periodic reloads and a "body" page containing static/form
+# elements that can't/needn't be periodically reloaded or
+# is blocked on user input.
+
+# Input:
+set frame_vars {
+ {book "Missing address book"}
+ {nick {} ""}
+ {add {} 0}
+ {fn {} ""}
+ {addrs {} ""}
+ {fcc {} ""}
+ {comment {} ""}
+ {take {} 0}
+ {newnick {} ""}
+ {ai {} -1}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $frame_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+cgi_html {
+ cgi_head {
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+
+ set parms ""
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ cgi_frame subhdr=header.tcl?title=212
+ cgi_frame subbody=querynick.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/1.0/fr_tconfig.tcl b/web/cgi/alpine/1.0/fr_tconfig.tcl
new file mode 100755
index 00000000..a7d62244
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_tconfig.tcl
@@ -0,0 +1,69 @@
+#!./tclsh
+# $Id: fr_tconfig.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_conf_process.tcl
+#
+# Purpose: CGI script to generate frame set for config operations
+# in webpine-lite pages.
+# This page assumes that it was loaded by conf_process.tcl
+
+# Intput:
+set frame_vars {
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Configuration"
+ }
+
+ cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
+ if {0} {
+ set parms ""
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ if {[string length $parms]} {
+ append parms "&"
+ } else {
+ append parms "?"
+ }
+
+ append parms "[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+ }
+
+ set title 150
+
+ set vlavarstr ""
+ if {[info exists fr_tconfig_vlavar]} {
+ set vlavarstr "&vlavar=$fr_tconfig_vlavar"
+ }
+ cgi_frame hdr=header.tcl?title=${title} title="Status Frame"
+ cgi_frame body=wp.tcl?page=tconfig&newconf=$newconf&oncancel=$oncancel&wv=$conftype$vlavarstr title="Configuration options"
+ }
+ }
+
diff --git a/web/cgi/alpine/1.0/fr_view.tcl b/web/cgi/alpine/1.0/fr_view.tcl
new file mode 100755
index 00000000..a4258baa
--- /dev/null
+++ b/web/cgi/alpine/1.0/fr_view.tcl
@@ -0,0 +1,30 @@
+#!./tclsh
+# $Id: fr_view.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# fr_view.tcl - wrapper around do_view.tcl to start tcl interp
+#
+# Purpose: CGI script to serve as the frame-work for including
+# supplied script snippets that generate the various
+# javascript-free webpine pages
+
+# Input:
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+
+WPEval {} {
+ source do_view.tcl
+}
diff --git a/web/cgi/alpine/1.0/genvars.tcl b/web/cgi/alpine/1.0/genvars.tcl
new file mode 100755
index 00000000..b982aee9
--- /dev/null
+++ b/web/cgi/alpine/1.0/genvars.tcl
@@ -0,0 +1,114 @@
+# $Id: genvars.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+set general_vars {
+ {var personal-name "Name"}
+ {var user-domain "User Domain"}
+ {var inbox-path "Inbox Location"}
+ {var default-fcc "Default Fcc"}
+ {var postponed-folder "Default Postponed Folder"}
+ {var alt-addresses "Other Addresses"}
+ {var wp-indexheight "Font Size"}
+ {var smtp-server "SMTP Server"}
+ {feat enable-newmail-sound "Enable Background Sound on New Mail Arrival"}
+ {feat enable-flag-cmd "Enable Flag Command"}
+ {feat auto-move-read-msgs "Automatically Move Read Messages"}
+ {feat expunge-without-confirm "Expunge INBOX Without Confirming"}
+ {feat expunge-without-confirm-everywhere "Expunge Everywhere Without Confirming"}
+ {feat quit-without-confirm "Quit Without Confirming"}
+ {feat enable-jump-cmd "Enable Jump Command"}
+ {special wp-columns "Display Width"}
+ {special left-column-folders "Message View/List Folder List Count"}
+}
+
+set msglist_vars {
+ {special index-format "Message Line Format"}
+ {var sort-key "Sort By"}
+ {var incoming-startup-rule "Start At"}
+ {var wp-indexlines "Message Lines Displayed"}
+ {feat mark-for-cc "Mark Messages For Cc"}
+ {feat enable-aggregate-command-set "Enable Aggregate Commands"}
+ {feat auto-zoom-after-select "Zoom View after Search"}
+ {feat auto-unselect-after-apply "Unmark Messages After Command"}
+}
+
+set composer_vars {
+ {special signature "Signature"}
+ {var default-composer-hdrs "Default Composer Headers"}
+ {var customized-hdrs "Customized Headers"}
+ {var fcc-name-rule "Fcc name rule"}
+ {var empty-header-message "Empty Header Message"}
+ {var posting-character-set "Posting Character Set"}
+ {feat compose-rejects-unqualified-addrs "Compose Rejects Unqualified Addresses"}
+ {feat enable-sigdashes "Enable Sigdashes"}
+ {feat quell-user-lookup-in-passwd-file "Don't Look Up Users in passwd File"}
+ {var reply-indent-string "Reply Indent String"}
+ {feat enable-reply-indent-string-editing "Enable Reply Indent String Editing"}
+ {var reply-leadin "Reply Leadin"}
+ {feat include-attachments-in-reply "Include Attachments in Reply"}
+ {feat include-header-in-reply "Include Header in Reply"}
+ {feat include-text-in-reply "Include Text in Reply"}
+ {feat signature-at-bottom "Signature at Bottom"}
+ {feat strip-from-sigdashes-on-reply "Strip From Sigdashes on Reply"}
+ {feat fcc-without-attachments "Fcc Without Attachments"}
+ {feat enable-8bit-esmtp-negotiation "Enable 8bit ESMTP Negotiation"}
+ {feat enable-delivery-status-notification "Enable Delivery Status Notification"}
+ {feat enable-verbose-smtp-posting "Enable Verbose SMTP Posting"}
+ {feat use-sender-not-x-sender "Use Sender, Not X-Sender"}
+ {feat send-confirms-only-expanded "Confirm Send only if Addresses Expanded"}
+ {feat quell-content-id "Prevent Content-ID header in Attachments"}
+ {feat quell-format-flowed "Do Not Send Flowed Text"}
+ {feat forward-as-attachment "Forward message as attachment"}
+}
+
+set folder_vars {
+ {special collections "Folder Collections"}
+ {var default-fcc "Default Fcc"}
+ {var default-saved-msg-folder "Default Saved Message Folder"}
+ {var saved-msg-name-rule "Saved Message Name Rule"}
+ {var postponed-folder "Postponed Folder"}
+ {var read-message-folder "Read Messages Folder"}
+ {var form-letter-folder "Form Letter Folder"}
+ {var folder-sort-rule "Folder Sort Rule"}
+ {var incoming-folders "Incoming Folders"}
+ {var pruned-folders "Pruned Folders"}
+ {var pruning-rule "Pruning Rule"}
+ {feat prune-uses-yyyy-mm "Prune Uses YYYY-MM"}
+ {feat enable-dot-folders "Enable Hidden Folders"}
+ {feat enable-lame-list-mode "Enable Lame List Mode"}
+ {feat try-alternative-authentication-driver-first "Try Alternative Authentication First"}
+ {feat quell-empty-directories "Do Not Display Empty Directores"}
+}
+
+set address_vars {
+ {var address-book "Address Books"}
+ {var global-address-book "Global Address Books"}
+ {var addrbook-sort-rule "Address Book Sort Rule"}
+ {var ldap-servers "Directory Servers"}
+}
+
+set msgview_vars {
+ {special view-colors "Message View Color Settings"}
+ {var viewer-hdrs "Viewer Headers"}
+ {feat enable-msg-view-urls "Enable URLs"}
+ {feat enable-msg-view-web-hostnames "Enable Web Hostnames"}
+ {feat enable-msg-view-addresses "Enable Address Links"}
+ {feat enable-msg-view-attachments "Enable Attachments View"}
+ {feat enable-full-header-cmd "Enable Full Headers"}
+ {feat quell-host-after-url "Hide server name display after links in HTML"}
+}
+
+set rule_vars {
+ {special filters "Filters"}
+ {special scores "Scoring"}
+ {special indexcolor "Index Colors"}
+}
diff --git a/web/cgi/alpine/1.0/header.tcl b/web/cgi/alpine/1.0/header.tcl
new file mode 100755
index 00000000..8bff53e6
--- /dev/null
+++ b/web/cgi/alpine/1.0/header.tcl
@@ -0,0 +1,226 @@
+#!./tclsh
+# $Id: header.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# header.tcl
+#
+# Purpose: CGI script to generate generic header for
+# webpine-lite pages. the idea is that this
+# page goes in the {title,nav}-bar portion of a
+# framed page so we keep the servlet alive via
+# periodic reloads while more static/form stuff
+# is displayed in the "body" frame.
+
+# Input:
+set header_vars {
+ {title "" "0,0"}
+ {reload}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set nologo 0
+set about {}
+
+WPEval $header_vars {
+
+ set tv [split $title ","]
+ switch -- [lindex $tv 0] {
+ 10 {
+ set title_text "Compose New Message"
+ }
+ 20 {
+ set title_text "Postponed Message"
+ }
+ 30 {
+ set title_text "Forward Message"
+ if {[regexp {^[0-9]*$} [lindex $tv 1]]} {
+ append title_text " [lindex $tv 1]"
+ }
+ }
+ 40 {
+ set title_text "Reply to Message"
+ if {[regexp {^[0-9]*$} [lindex $tv 1]]} {
+ append title_text " [lindex $tv 1]"
+ }
+ }
+ 50 {
+ set title_text "Message Index"
+ set nologo 1
+ }
+ 60 {
+ set title_text "Help System"
+ }
+ 70 {
+ set title_text "Address Books"
+ }
+ 71 {
+ set title_text "Edit Address Book Entry"
+ }
+ 72 {
+ set title_text "New Address Book Entry"
+ }
+ 73 {
+ set title_text "Address Selection"
+ }
+ 74 {
+ set title_text "LDAP Query Result Selection"
+ }
+ 80 {
+ set title_text "Select Postponed Message"
+ }
+ 90 {
+ set title_text "Expunge Deleted Messages"
+ set nologo 1
+ }
+ 101 {
+ set title_text "Select Messages by Date"
+ set nologo 1
+ }
+ 102 {
+ set title_text "Select Messages by Text"
+ set nologo 1
+ }
+ 103 {
+ set title_text "Select Messages by Status"
+ set nologo 1
+ }
+ 104 {
+ set title_text "Search and Mark Messages"
+ set nologo 1
+ }
+ 110 {
+ set title_text "Attach a File"
+ }
+ 120 {
+ set title_text "File Creation Confirmation"
+ set nologo 1
+ }
+ 130 {
+ set title_text "Authentication Required"
+ }
+ 140 {
+ set title_text "Web Alpine Help"
+ }
+ 150 {
+ set title_text "Configuration"
+ }
+ 151 {
+ set title_text "Add Collection Configuration"
+ }
+ 152 {
+ set title_text "Edit Collection Configuration"
+ }
+ 153 {
+ set title_text "Add Filter Configuration"
+ }
+ 154 {
+ set title_text "Edit Filter Configuration"
+ }
+ 160 {
+ set title_text "Set Message Flags"
+ set nologo 1
+ }
+ 170 {
+ set title_text "Confirm Folder Delete"
+ }
+ 171 {
+ set title_text "New Folder Creation"
+ }
+ 172 {
+ set title_text "New Directory Creation"
+ }
+ 173 {
+ set title_text "Folder Rename"
+ }
+ 174 {
+ set title_text "Create New Folder or Directory"
+ }
+ 180 {
+ set title_text "Spell Check Composition"
+ }
+ 190 {
+ set title_text "Save Messages"
+ set nologo 1
+ }
+ 200 {
+ set title_text "Attachment Display"
+ }
+ 210 {
+ set title_text "Take Addresses"
+ }
+ 211 {
+ set title_text "Take Address Edit"
+ }
+ 212 {
+ set title_text "Take Address Same Nickname"
+ }
+ 220 {
+ set title_text "Folder List for Save"
+ set nologo 1
+ }
+ 221 {
+ set title_text "Folder List for Save"
+ }
+ 222 {
+ set title_text "Folder To Save To"
+ set nologo 1
+ }
+ 223 {
+ set title_text "Folder To Save To"
+ }
+ 230 {
+ set title_text "Quitting Web Alpine"
+ }
+ 240 {
+ set title_text "LDAP Query"
+ }
+ 250 {
+ set title_text "Folder Upload and Import"
+ }
+ 260 {
+ set title_text "Monthly Folder Clean Up"
+ }
+ default {
+ if {[catch {WPCmd PEInfo set wp_header_title} title_text]} {
+ set title_text Untitled
+ }
+ }
+ }
+
+ WPCmd PEInfo set wp_header_title $title_text
+
+ if {[catch {WPNewMail $reload} newmail]} {
+ error [list _action "new mail" $newmail]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs text/html
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr Header
+ WPHtmlHdrReload "$_wp(appdir)/$_wp(ui1dir)/header.tcl?sessid=$sessid"
+ WPStyleSheets
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) background=[file join $_wp(imagepath) logo $_wp(logodir) back.gif] "style=\"background-repeat: repeat-x\"" {
+ WPTFTitle $title_text $newmail $nologo $about
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/help.tcl b/web/cgi/alpine/1.0/help.tcl
new file mode 100755
index 00000000..6881895d
--- /dev/null
+++ b/web/cgi/alpine/1.0/help.tcl
@@ -0,0 +1,36 @@
+#!./tclsh
+# $Id: help.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# help.tcl
+#
+# Purpose: CGI script to generate html help text for Alpine
+
+# Input:
+set help_vars {
+ {topic {} ""}
+ {topicclass {} ""}
+ {index {} ""}
+ {oncancel {} main}
+ {params {} ""}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS help text for alpine
+
+# inherit global config
+source ./alpine.tcl
+
+WPEval $help_vars {
+ source do_help.tcl
+}
diff --git a/web/cgi/alpine/1.0/help/about.tcl b/web/cgi/alpine/1.0/help/about.tcl
new file mode 100644
index 00000000..44d28a12
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/about.tcl
@@ -0,0 +1,30 @@
+# $Id: about.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+cgi_h2 "About Web Alpine"
+cgi_p "Version [WPCmd PEInfo version].[WPCmd PEInfo revision] (basic HTML interface)"
+cgi_p {
+Web Alpine is a mail user agent, built on the Alpine Mail System, designed to
+provide email access and management facilities via the World Wide Web.
+As a web-based application, Alpine provides universal, convenient, and
+secure access to your email environment.
+}
+cgi_p {Because its foundation is shared
+with the Alpine Mail System, Web Alpine can easily provide a view of your email
+environment consistent with that of Alpine and PC-Alpine. However, due to
+inherent speed and efficiency limitations of web email, it is not intended
+to replace any other email programs. Web Alpine is designed specifically for
+those away from their own desktop computers and for people with light duty
+email needs.
+}
+cgi_p {
+}
+cgi_p "Send comments and suggestions to [cgi_quote_html "<$_wp(comments)>"]."
diff --git a/web/cgi/alpine/1.0/help/addrbook.html b/web/cgi/alpine/1.0/help/addrbook.html
new file mode 100644
index 00000000..11399f33
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/addrbook.html
@@ -0,0 +1,61 @@
+<!--
+# $Id: addrbook.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<font size="+2"><b>Address Books</b></font>
+
+<p>The Address Books screen provides a listing of addresses and contact information. If you have
+more than one address book, your "Read-Only" books will be listed directly beneath your personal
+listing.</p>
+
+<ul type="square">
+<li><a href="#add"><b>Adding an entry</b></a></li>
+<li><a href="#remove"><b>Removing an entry</b></a></li>
+<li><a href="#edit"><b>Editing an entry</b></a></li>
+<li><a href="#create"><b>Creating a distribution list</b></a></li>
+<li><a href="#compose"><b>Going directly to Message Compose</b></a></li>
+</ul>
+
+<a name="add"><b>Adding an entry</b></a><br>
+Click <input type=submit value="Add New Entry"> to go to a screen that includes the following
+fields: "Nickname:", "Full Name:", "Addresses:", "Fcc:", "Comments:".
+Complete the information that you want to save in your address book and
+click <input type=submit value="Save Entry"> to add an entry to your personal addressbook.
+
+<p>For more information about these fields, see the <a href="addrentry.html">Address Book Entry</a>
+help text.</p>
+
+<p>
+<a name="remove"><b>Removing an entry</b></a><br>
+Click the nickname of an entry you would like to remove. On the next
+screen, click <input type=submit value="Delete Entry">.
+<p>
+
+<a name="edit"><b>Editing an entry</b></a><br>
+Click the nickname of an entry you would like to edit. On the next
+screen, make your desired changes and click <input type=submit value="Save Entry">.
+<p>
+
+<a name="create"><b>Creating a distribution list</b></a><br>
+Click <input type=submit value="Add New Entry"> to go to a screen that includes the following
+fields: "Nickname:", "Full Name:", "Addresses:", "Fcc:", "Comments:".
+Complete the information that you want to save in your
+address book. Include the addresses for your distribution (or group
+mailing) list in the "Addresses:" field, separating each address by a
+comma. Use a Nickname and Full Name that will be meaningful for you for
+this list. <p>
+
+<a name="compose"><b>Going directly to Message Compose</b></a><br>
+Click a highlighted address to go directly to your Message Compose page.
+The address you select will be in the "To:" field ready for your new
+message. In the case of distribution lists, select any one of the
+addresses in that list and they will all be included in the "To:" field.
diff --git a/web/cgi/alpine/1.0/help/addrbrowse.html b/web/cgi/alpine/1.0/help/addrbrowse.html
new file mode 100644
index 00000000..3e9abf2e
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/addrbrowse.html
@@ -0,0 +1,27 @@
+<!--
+# $Id: addrbrowse.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<font size="+2"><b>Addressing Messages</b></font>
+
+<p>Select addresses for your message composition in your address book after you
+click <img src="../../images/book.gif" alt="Address book icon" style="vertical-align:middle"> on your Message Compose
+screen.</p>
+
+<p>Click the checkbox next to address or addresses to which you want to send your
+message.</p>
+
+<p>Click <input type=submit value="Address"> to return to your Message Compose screen.
+Your message will now include the addresses you have selected.
+
+<p>Click <input type=submit value="Cancel"> to return to your Message Compose screen without
+adding an address.</p>
diff --git a/web/cgi/alpine/1.0/help/addredit.html b/web/cgi/alpine/1.0/help/addredit.html
new file mode 100644
index 00000000..01defdcc
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/addredit.html
@@ -0,0 +1,59 @@
+<!--
+# $Id: addredit.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<font size="+2"><b>Address Book Entry</b></font>
+
+<p>You can add and edit individual and group entries to your address book by adding information to
+the following fields:</p>
+
+<P>
+<ul type="square">
+ <li><a href="#nick"><b>Nickname</b></a></li>
+ <li><a href="#fullname"><b>Full Name</b></a></li>
+ <li><a href="#addresses"><b>Addresses</b></a></li>
+ <li><a href="#fcc"><b>Fcc</b></a></li>
+ <li><a href="#comments"><b>Comments</b></a></li>
+</ul>
+
+<a name="nick"><b>Nickname</b></a><br>
+Enter a nickname which will identify this address book entry. Every
+address book entry needs to have a unique nickname associated with it.
+While composing a message, you can use the nickname in place of the address.
+By clicking <input type=submit value="Expand">, the nickname will automatically by replace by
+the full address or addresses for this entry. The nickname is not seen in the outgoing message.
+
+<p><a name="fullname"><b>Full Name</b></a><br>
+Enter the full name for this entry. For an
+individual entry, you will ordinarily use that person's name. For a group
+of addresses (or distribution list), use a descriptive word or phrase
+that describes the group.
+
+<p><a name="addresses"><b>Addresses</b></a><br>
+Enter the email address or addresses for this entry. You must complete this field for all your
+address book entries. You can create group mailing lists for sending
+email messages to several addresses at once by listing the addresses
+separated by commas, just as you would enter them when composing a
+message. For those addresses already in your address book, you can just
+add the nicknames separated by commas.
+
+<p><a name="fcc"><b>Fcc</b></a><br>
+When the "Fcc:" (Folder carbon copy) field is used, a copy of all messages
+that you send with this addressbook entry as the first address in the
+"To:" field will be saved in the folder specified in the "Fcc:" field
+rather than your default Fcc folder (usually "sent-mail").
+
+<p><a name="comments"><b>Comments</b></a><br>
+
+This optional field allows you to enter any comments about the entry. This field is not used in your
+outgoing messages.
+
diff --git a/web/cgi/alpine/1.0/help/attach.html b/web/cgi/alpine/1.0/help/attach.html
new file mode 100644
index 00000000..b632c9f4
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/attach.html
@@ -0,0 +1,37 @@
+<!--
+# $Id: attach.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<font size="+2"><b>Add an Attachment</b></font>
+
+<p>Add a file (such as a document, image, audio clip) to your message after
+you click <input type=submit value="Attach"> on your Message Compose screen.</p>
+
+<p>Click <input type=submit value="Browse..."> to find and select the file you want to attach.
+If you know the exact path to the file, simply type in that path.</p>
+
+<p>You have the option of entering a short description of the attachment
+in the second text box. If you choose to include a description, your
+recipients will see that text alongside the file name. Descriptions
+can be particularly helpful when you include several attachments to your
+message.</p>
+
+<p>Click <input type=submit value="Add Attachment"> to return to your Message Compose screen.
+Your attached file will be listed in the "Attachments:" field. To add
+another attachment, from Message Compose, click <input type=submit value="Attach"> again.</p>
+
+<p>If you have attached a file that you do not want to send, return to the Message
+Compose screen by clicking <input type=submit value="Cancel">. Then click the corresponding <img
+src="../../images/but_remove.gif" alt="remove icon"> to remove it.</p>
+
+<p>Click <input type=submit value="Cancel"> to return to your Message Compose screen without
+adding an attachment.</p>
diff --git a/web/cgi/alpine/1.0/help/compose.html b/web/cgi/alpine/1.0/help/compose.html
new file mode 100644
index 00000000..aad7ac40
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/compose.html
@@ -0,0 +1,147 @@
+<!--
+# $Id: compose.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<form action="alpine/wp.tcl" target="noop" method=get>
+<input name="page" value="noop" type=hidden notab>
+<font size="+2"><b>Message Compose</b></font>
+
+<p>The Message Compose screen is where you will write and send your email
+messages.</p>
+
+<p>
+<ul type="square">
+ <li><a href="#header"><b>Using your header fields</b></a></li>
+ <li><a href="#write"><b>Writing your messages</b></a></li>
+ <li><a href="#send"><b>Sending, postponing and canceling</b></a></li>
+ <li><a href="#note"><b>Differences from Pine and PC-Pine</b></a></li>
+</ul>
+
+<a name="header"><b>Using your headers</b></a><p>
+
+The message header area is used for addressing your message and providing
+other information that may be useful to you or the message recipient.
+
+<p>By default, your messages headers will include: To, Cc,
+Attachments, Subject. Go to <b>Configure</b> from the Message View or List
+page and click the Composer tab to change
+the defaults or customize your settings. If you have additional headers
+configured, click <img src="../../images/hdrmore.gif" alt="More Headers"
+style="background-color:#ffffcc;padding:4;vertical-align:middle; xborder: 1px solid brown"> to
+display them.
+Below is a description of commonly used headers:
+
+<ul>
+<li>
+<b>To:</b> Use this field to specify intended email recipients. This can
+be done in any of three ways:
+<ul type="square">
+ <li>Type the full email address of the intended message recipient.
+Separate multiple addresses with a comma.</li>
+
+ <li>Type a name or nickname specified in your address book and click
+<input type=submit value="Expand">. Alpine will not automatically expand
+your addresses without this step. Separate multiple names or nicknames
+with a comma.</li>
+
+ <li>Click <img src="../../images/book.gif" alt="Address book icon"
+style="vertical-align:middle"> to go to your address book to select an
+address.</li>
+</ul></p></li>
+
+<li> <b>Attachments:</b> Use this field to attach files (such as
+documents,
+images, audio clips) to your message. Click <input type=submit
+value="Attach"> to find and attach a file
+from your local system. If you have attached a file that you do not want
+to send,
+click the corresponding <img src="../../images/but_remove.gif" alt="remove
+icon" style="vertical-align:middle"> to
+remove it. <p></li>
+
+<li><b>Subject:</b> Use this field to provide a few words that summarize
+the message.<p></li>
+
+<li><b>Cc:</b> (Carbon copy) This field is similar to the "To:" field, but
+it is used to send a copy of the message to one or more people. These
+email
+addresses will be seen by all message recipients.<p></li>
+
+<li><b>Bcc:</b> (Blind carbon copy) This field is similar to the "To:" and
+"Cc:" fields, but it is
+used to send a copy of the message to one or more people whose
+addresses you do not want disclosed to other message recipients.<p></li>
+
+<li><b>Fcc:</b> (File carbon copy) Use this field to specify the folder
+to which a copy of your
+outgoing message will be saved. When this header is visible, you can
+change or remove the Fcc by editing the folder name.<p></li>
+
+<li><b>Reply-To:</b> Use this field when you would like replies to your
+messages to be directed to an address other than your usual "From:"
+address.<p></li>
+
+</ul>
+
+<a name="write"><b>Writing your messages</b></a><p>
+
+Type your message in the large text box beneath the headers. Depending on
+your browser, messages you send may contain a single long line rather than
+the nicely wrapping text shown in the text box. In those cases,
+recipients will have to scroll horizontally to read your message. To
+avoid this problem, use the Return key at the end of each line.
+
+<p>To spell check your message, click the
+<input type=submit value="Spell Check"> button. The resulting page will list each
+potentially misspelled word. Each word will have a text box for you to
+enter a correction. Additionally, some words will also have
+a list of suggested corrections. Click the <i>Apply</i> button to have
+your changes appear in the composer, or
+<i>Cancel</i> to return to the composer with the original text.
+</p>
+
+<p>Do you want to add a personalized signature line to your messages? Go
+to <b>Configure</b> from the Message View or List page and click the Composer tab.</p>
+
+
+<a name="send"><b>Sending, postponing, canceling</b></a><p>
+To send your message, postpone it to resume later, or to cancel it
+completely, click the appropriate radio button and then click <input
+type=submit value="OK">.
+<ul>
+ <li><b>Send</b> - Use this option to send your message to the
+recipients.<p></li>
+ <li><b>Postpone</b> - Use this option to store an unfinished message
+without sending it. To finish the message at a later time, click
+<b>Resume</b> in the far left column of the Message List.<p></li>
+ <li><b>Cancel</b> - Use this option to throw out the current composition.
+The message will not be sent and you will not be able to resume
+it.<p></li>
+</ul>
+
+<p><a name="note"><b>Differences from Pine and PC-Pine</b></a><p>
+
+<p>Alpine is designed primarily for easy access to email. It is not
+intended to replace any other heavy duty email programs. Accordingly, it
+is missing some of the more advanced features you will find in Pine and
+PC-Pine. As development continues, features will be added as long as they
+do not make a large impact on Alpine's speed or efficiency.
+
+<p> Some of the features you will not currently find in Alpine Compose:
+<ul>
+<li>Lcc (List carbon copy)
+<li>Where is (instead, use your browser's "find" command)
+<li>Read a file into the composition
+</ul>
+
+</ul>
+</form>
diff --git a/web/cgi/alpine/1.0/help/create_save.tcl b/web/cgi/alpine/1.0/help/create_save.tcl
new file mode 100644
index 00000000..f2a07b5c
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/create_save.tcl
@@ -0,0 +1,17 @@
+# $Id: create_save.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+cgi_h2 "Create Folder Confirmation Help"
+cgi_p "Help pages for the create file to save in confirmation page will appear here."
+cgi_p {
+ Someday.
+
+}
diff --git a/web/cgi/alpine/1.0/help/expunge.html b/web/cgi/alpine/1.0/help/expunge.html
new file mode 100644
index 00000000..f1602175
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/expunge.html
@@ -0,0 +1,20 @@
+<!--
+# $Id: expunge.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<font size="+2"><b>Expunge Deleted Messages</b></font>
+
+<p>Click <input type=submit value="Expunge"> to permanently remove the messages you have flagged for deletion. You will
+not be able to retrieve your messages once you have expunged them. </p>
+
+<p>Click <input type=submit value="Cancel"> to return to your list of messages. The messages you previously flagged for
+deletion will remain in your folder, still flagged for deletion.</p>
diff --git a/web/cgi/alpine/1.0/help/filtconf.html b/web/cgi/alpine/1.0/help/filtconf.html
new file mode 100644
index 00000000..67654e35
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/filtconf.html
@@ -0,0 +1,62 @@
+<HTML>
+<!--
+# $Id: filtconf.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<BODY>
+<FONT SIZE=+2><B>Message Filtering</B></FONT>
+
+
+<p>Filtering is a way to automatically move certain messages from one
+folder to another or to delete messages, according to rules that you
+define. For each filtering rule you define, you will provide a
+<i>Pattern</i> to establish the messages you want filtered, and an
+<i>Action</i>, to control what to do with those messages.</p>
+
+<p>Click <img src="../../images/cf_add.gif" alt="Add" align=middle> to go to a screen where you can define a set of
+new filter rules.
+
+<p>Click <img src="../../images/cf_edit.gif" alt="Edit" align=middle> next to a filter that you would like to change. You
+will go to an edit screen. You will only see this option if you have
+already created filters.</p>
+
+
+<p>Click <img src="../../images/cf_delete.gif" alt="Delete" align=middle> next to a filter rule you would like to remove.
+That filter will disappear. You will only see this option if
+you have already created filter rules.</p>
+
+<p>When you have more than one filter defined, you will see the <img src="../../images/cf_shup.gif" xalign=middle> (shuffle up),
+and <img src="../../images/cf_shdown.gif" xalign=middle> (shuffle down), options next to each filter. Use these to
+move your filters up or down in the list. The order is important. Your
+messages will be checked for filtering against the top filter first and,
+if the filter is set up for that message, it will be filtered. If no
+matching information is found, the message will be checked against the
+second filter and so on down the list. Messages that do not match any
+filter rules will be delivered to your Inbox.</p>
+
+<p>Performance considerations:</p>
+<ul>
+ <li>The more filters you have defined the longer it will take to run
+ down the list. Deleting unused filters is a good
+ idea.
+ <li>Filtering in newsgroups served by an NNTP server will be slow if your
+ patterns include tests other than "From:" or
+ "Subject:".
+ <li>Filtering a folder served by an IMAP server based on protocol
+ versions prior to 4.
+</ul>
+
+
+
+</BODY>
+</HTML>
+
diff --git a/web/cgi/alpine/1.0/help/filtedit.html b/web/cgi/alpine/1.0/help/filtedit.html
new file mode 100644
index 00000000..0adb42f7
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/filtedit.html
@@ -0,0 +1,240 @@
+<html>
+<head>
+<!--
+# $Id: filtedit.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+</head>
+<body>
+<font size="+2"><b>Filter Configuration</b></font>
+<p>This Filter Configuration screen is where you can add new filters
+or modify existing ones.</p>
+
+<p>In order to determine whether or not a message matches a filter, the
+message is compared with the Filter's Pattern. Once a filter match is
+found for a particular message, there are some actions which may be
+taken.</p>
+
+<p>NOTE: When you set up a Pattern to delete messages, it is recommended
+that you test the Pattern first with a "Move" folder in case unintended
+matches occur. Messages that are deleted will be removed from the folder
+and may be unrecoverable.</p>
+
+<ul type="square">
+<li><a href="#patterns"><b>Filter Patterns</b></a>
+</li><li><a href="#actions"><b>Filter Actions</b></a>
+</li><li><a href="#examples"><b>Examples</b></a>
+</li></ul>
+
+<a name="patterns"><b>Filter Patterns</b></a><br>
+
+<ul>
+<li><b>Nickname:</b><br>
+This is a nickname to help you. You should have a different nickname for
+each filtering rule you define. The nickname will be used in the Message
+Filtering screen to allow you to pick a rule to edit.<p></p>
+
+</li><li><b>To:</b><br>
+Any text you enter as the "To pattern" will be compared to the recipients
+from the To: line of messages when WebPine
+opens folders. When the text you entered matches all or part of the To:
+line of a message, then the Filter Action you
+have specified will be carried out. (Any other non-blank parts of the
+Pattern must match, too.)
+
+<p>You may enter a complete email address, part of an address, or a
+comma-separated list of addresses or partial
+addresses. For example:</p>
+
+<pre> To: = friend@public.com
+ To: = rated.net
+ To: = admin@public.com, admin@msn.com, fool@motleyfool.com
+</pre>
+
+<p>Each of those are valid "To patterns".</p>
+
+<p>Messages match those patterns if any of the addresses in the To: line
+of the message contains the pattern. If the pattern is a comma-separated
+list of patterns (like the last example above) then it is a match if any
+of the patterns in the list match any of the addresses in the To: line.
+(It is not possible to specify two addresses which must BOTH be present
+for a match. It is only possible to specify that EITHER address1 OR
+address2 must be present. That is exactly what the comma-separated list
+does.)</p>
+
+<p>Some messages may be "bounced" to you, and will have a "Resent-To:"
+header line. If the message contains a Resent-To: line, WebPine will look
+for matches to your "To: patterns" there, and NOT in the original To:
+line.</p>
+
+</li><li><b>From:</b><br>
+This is just like the "To pattern" except that it is compared with the
+address in the From: line of the message instead of the addresses from the
+To: line. See the help for the To pattern for more information on header
+patterns.<p></p>
+
+</li><li><b>Sender:</b><br>
+This is just like the "To pattern" except that it is compared with the
+address from the Sender: line of the message
+instead of the addresses from the To: line. See the help for the To
+pattern for more information on header patterns.<p></p>
+
+</li><li>Cc:</li><br>
+This is just like the "To pattern" except that it is compared with the
+addresses from the Cc: line of the message instead of the addresses from
+the To: line. See the help for the To pattern for more information on
+header patterns.<p></p>
+
+
+<li><b>Recipient:</b><br>
+This is just like the "To pattern" except that it is compared with the
+addresses from both the To: line and the Cc:
+line of the message instead of just the addresses from the To: line. In
+other words, it is considered a match if the
+pattern matches EITHER an address in the To: line OR an address in the Cc:
+line. (Notice that defining the Recipient
+pattern does not have the same effect as defining both the To and Cc
+patterns. Recipient is To OR Cc; not To AND Cc.
+It is equivalent to having two different rules; one with a To pattern and
+the other with the same Cc pattern.)<p></p>
+
+
+</li><li><b>Participants:</b><br>
+This is just like the "To pattern" except that it is compared with the
+addresses from the From: line, the To: line, and the Cc: line of the
+message instead of just the addresses from the To: line. In other words,
+it is considered a match if the pattern matches EITHER an address in the
+From: line, OR an address in the To: line, OR an address in the Cc: line.
+(Notice that defining the Participant pattern does not have the same
+effect as defining all of the From, To, and Cc patterns. Participant is
+From OR To OR Cc; not From AND To AND Cc. It is equivalent to having
+three different rules; one with a From pattern, another with the same To
+pattern, and a third with the same Cc pattern.)<p></p>
+
+
+</li><li><b>Newsgroups:</b><br>
+If this pattern is non-blank, then for this rule to be considered a match,
+at least one of the newsgroups from the
+Newsgroups line of the message must match this pattern. If this pattern is
+a comma-separated list of patterns, then at
+least one of the newsgroups must match at least one of the patterns. (Any
+other non-blank parts of the Pattern must
+match, too.)<p></p>
+
+</li><li><b>Subject:</b><br>
+This is similar to the other parts of the Pattern. It is compared with the
+contents from the Subject of the message.
+
+<p>If you enter non-ASCII characters in this field then the search will be
+done using the character set you have defined with the "character-set"
+configuration variable. (The truly sophisticated may use an alternate
+character set for a search by entering the MIME encoding of the header
+string here.)</p>
+
+
+</li><li><b>All Text:</b><br>
+This is similar to the header patterns. Instead of comparing with text in
+a particular header field it is compared with all of the text in the
+message header and body.
+
+<p>If you enter non-ASCII characters in this field then the search will be
+done using the character set you have defined
+with the "character-set" configuration variable. (The truly sophisticated
+may use an alternate character set for a
+search by entering the MIME encoding of the header string here.)</p>
+
+<p>It is possible that you may notice degraded performance when using
+AllText Patterns.</p>
+
+
+</li><li><b>Message is New</b><br>
+This part of the Pattern may have one of three possible values. The
+default value is "Don't care", which matches any message. The other two
+values are "Yes", which means the message must be "New" in order to be a
+match; or "No", which means the message must not be "New" in order to be a
+match. "New" is the same as Unseen and not "New" is the same as Seen.<p></p>
+
+</li><li><b>Message is Deleted</b><br>
+This part of the Pattern may have one of three possible values. The
+default value is "Don't care", which matches any message. The other two
+values are "Yes", which means the message must be marked "Deleted" in
+order to be a match; or "No", which means the message must not be marked
+"Deleted" in order to be a match.
+
+<p>If you are thinking of using this part of the Pattern as a way to
+prevent messages from being filtered more than once in a Filter Pattern,
+take a look at the Filter Option "move-only-if-not-deleted" instead. It
+should work better than using this field since it will hide the filtered
+messages even if they are already Deleted. That option is at the bottom of
+the Filter configuration screen.</p>
+
+</li><li><b>Message is Important</b><br>
+This part of the Pattern may have one of three possible values. The
+default value is "Don't care", which matches any message. The other two
+values are "Yes", which means the message must be flagged "Important" in
+order to be a match; or "No", which means the message must not be flagged
+"Important" in order to be a match.<p></p>
+
+</li><li><b>Message is Answered</b><br>
+This part of the Pattern may have one of three possible values. The
+default value is "Don't care", which matches any message. The other two
+values are "Yes", which means the message must be marked "Answered" in
+order to be a match; or "No", which means the message must not be marked
+"Answered" in order to be a match.
+</li></ul>
+
+<a name="actions"><b>Filter Actions</b></a><br>
+The Filter Action specifies the action to be taken when the Pattern is a
+match. It may be either <b>Delete</b> or <b>Move</b>
+
+<p>If you set it to "Move", then provide the name of the folder to which
+the matching message should be moved in the corresponding text box. You
+may type a list of folders separated by commas, in which case the message
+will be copied to all of the folders in the list before it is deleted.</p>
+
+<b>Move only if not deleted</b><br> If you set this option then a message
+will be moved into the specified folder only if it is not marked for
+deletion. This is useful if you have multiple Pine or WebPine sessions
+running simultaneously and you don't want messages to be filtered into a
+folder more than once. It is also useful if you want to filter only the
+"undeleted" messages in a newsgroup into a folder. This method is not
+foolproof. There may be cases where a message gets marked deleted and so
+it is never filtered into the folder. For example, if you deleted it in
+another Pine or WebPine session or another mail program that didn't use
+the filtering rule.<br>
+
+This option has no effect if the Filter Action is not set to Move.<p></p>
+
+<a name="examples"><b>Examples</b></a><br>
+To create a filter to move all incoming messages from
+"sue@travelworld.com" to your "Vacation" folder, add the following to the
+Filter Configuration screen:<br>
+<b>Nickname:</b> Travelworld<br>
+<b>From:</b> sue@travelworld.com<br>
+<b>Move filter action:</b>Vacation<br>
+
+Click <b>Save</b> to add the filter.<br>
+
+<p>To create a filter to delete all incoming messages that contain the
+text "Make Money fast!" in the subject line, add the following to your
+Filter Configuration screen:<br>
+<b>Nickname:</b> Make Money<br>
+<b>Subject:</b> Make Money Fast!<br>
+<b>Delete:</b> (Click next to this option)<br>
+Reminder: It is a very good idea to test this with the "Move to Folder"
+option in case unintended matches occur.<br>
+
+Click <b>Save</b> to add the filter.
+
+
+
+</p></body></html> \ No newline at end of file
diff --git a/web/cgi/alpine/1.0/help/folders.html b/web/cgi/alpine/1.0/help/folders.html
new file mode 100644
index 00000000..6e23973b
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/folders.html
@@ -0,0 +1,39 @@
+<!--
+# $Id: folders.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<font size="+2"><b>Folder List</b></font>
+
+<p> Your email messages are stored in folders. The Folder List screen allows you to
+get to those folders by clicking on the folder name. Manage your folders by doing
+the following:</p>
+
+<ul>
+<li>Delete a folder: Click the radio button corresponding to the correct
+folder and click <img src="../../images/but_folddel.gif" alt="delete icon" style="vertical-align:middle">.
+You will be prompted for confirmation before the folder is actually deleted.</li>
+<li>Rename a folder: Click the radio button corresponding to the correct
+folder and click
+<img src="../../images/but_foldren.gif" alt="folder rename icon" style="vertical-align:middle">.
+You will be prompted for confirmation before the folder is actually renamed.</li>
+<li>Add a folder: Click <input type=submit value="Create New..."> to go to the Folder Creation
+screen.</li>
+</ul>
+
+<p>If your folder list includes directories (used to contain folders) or
+collections (used to organize folders on different email hosts), you will
+see the following icons:</p>
+
+<ul>
+<li>Click <img src="../../images/b_plus.gif" alt="expand icon"> to expand the listing to see the contents</li>
+<li>Click <img src="../../images/b_minus.gif" alt="contract icon"> to collapse the listing and see the top-level only</li>
+</ul>
diff --git a/web/cgi/alpine/1.0/help/foldiradd.html b/web/cgi/alpine/1.0/help/foldiradd.html
new file mode 100644
index 00000000..2823ea72
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/foldiradd.html
@@ -0,0 +1,30 @@
+<!--
+# $Id: foldiradd.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<font size="+2"><b>Creating Folders</b></font>
+
+<p>Folders are used to contain messages. Directories are used to contain folders.
+<p>
+After you click <input type=submit value="Create New..."> on the Folder List page, you can create either
+one.
+
+<ul>
+ <li>To add a folder: enter the name of the folder you want to add to
+ in the "New folder name:" text box. Click <input type=submit value="Create New Folder">.</li>
+ <li>To add a directory: enter the name of the directory you want to add to
+ in the "Create New Directory:" text box. Click <input type=submit value="Create New Directory">.</li>
+</ul>
+
+<p>Click <input type=submit value="Cancel"> to return to the Folder List screen without creating a new
+directory or folder.</p>
+
diff --git a/web/cgi/alpine/1.0/help/forward.tcl b/web/cgi/alpine/1.0/help/forward.tcl
new file mode 100644
index 00000000..c016ca23
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/forward.tcl
@@ -0,0 +1,16 @@
+# $Id: forward.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+cgi_h2 "Forward Help"
+cgi_p "Help pages for the Forward compose form will appear here."
+cgi_p {
+ Someday.
+}
diff --git a/web/cgi/alpine/1.0/help/index.html b/web/cgi/alpine/1.0/help/index.html
new file mode 100644
index 00000000..58bcd323
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/index.html
@@ -0,0 +1,281 @@
+<!--
+# $Id: index.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<form action="alpine/wp.tcl" target="noop" method=get>
+<input name="page" value="noop" type=hidden notab>
+<font size="+2"><b>Message List</b></font>
+
+<p>Your Message List contains summary information about each of the messages in
+your current Alpine folder and provides ways for you to take actions on
+those messages.</p>
+
+<p>To compose a new message, resume a postponed one, or go to another folder,
+click the appropriate option in the far left column of your page.
+You will also see options to change your Alpine configuration and to
+manage your address book.</p>
+
+<ul type="square">
+ <li><a href="#read"><b>Reading your mail</b></a></li>
+ <li><a href="#navigate"><b>Navigating your list</b></a></li>
+ <li><a href="#scroll"><b>Scrolling through messages</b></a></li>
+ <li><a href="#sort"><b>Sorting your mail</b></a></li>
+ <li><a href="#delete"><b>Deleting messages</b></a></li>
+ <li><a href="#expunge"><b>Removing deleted messages</b></a></li>
+ <li><a href="#save"><b>Saving messages to another folder</b></a></li>
+ <li><a href="#flags"><b>Setting status flags</b></a></li>
+ <li><a href="#search"><b>Searching</b></a></li>
+ <li><a href="#jump"><b>Jump Command (optional)</b></a></li>
+ <li><a href="#note"><b>Differences in Pine and PC-Pine</b></a></li>
+</ul>
+
+<a name="read"><b>Reading your mail</b></a><p>
+
+After logging into Alpine, you will see your Message List INBOX. This is the default folder for new
+mail. To read a message, click its subject.
+
+<p>Click <b>Folder List</b> if you want to read mail within a different folder.</p>
+
+
+<a name="navigate"><b>Navigating your list</b></a><p>
+In the column on the left side of your Message List page, you will
+see four navigation options: <b>Previous</b>, <b>First</b>, <b>Next</b>,
+<b>Last</b>.
+<table border=0 cellpadding=4 style="margin-left:24">
+ <tr>
+ <td><img src="../../images/but_rnd_prev3.gif" alt="Previous"></td>
+ <td>to display messages in the current folder before those currently listed</td>
+ </tr>
+ <tr>
+ <td><img src="../../images/but_rnd_first3.gif" alt="First"></td>
+ <td>to display messages in the current folder beginning with message 1</td>
+ </tr>
+ <tr>
+ <td><img src="../../images/but_rnd_next3.gif" alt="Next"></td>
+ <td>to display messages in the current folder after those currently listed</td>
+ </tr>
+ <tr>
+ <td><img src="../../images/but_rnd_last3.gif" alt="Last"></td>
+ <td>to display messages in the current folder at the end of the list</td>
+ </tr>
+</table>
+
+<p>With most browsers and the usual settings, you also have the option of
+using keyboard controls for some of your navigation. You may, however,
+need to first click in your Alpine window to make sure that your system
+knows which screen is active.
+
+<p>The keyboard controls are:
+<table border=0 cellspacing=12 cellpadding=3>
+<tr><td text align="center">n</td>
+ <td>next message</td></tr>
+<tr><td text align="center">p</td>
+ <td>previous message</td></tr>
+<tr><td text align="center">i</td>
+ <td>return to message index</td></tr>
+<tr><td text align="center">c</td>
+ <td>compose new message</td></tr>
+<tr><td text align="center">l</td>
+ <td>list folder</td></tr>
+<tr><td text align="center">d</td>
+ <td>flag message as deleted</td></tr>
+<tr><td text align="center">u</td>
+ <td>unflag message as deleted</td></tr>
+<tr><td text align="center">a</td>
+ <td>go to address book</td></tr>
+<tr><td text align="center">r</td>
+ <td>reply to current message</td></tr>
+<tr><td text align="center">f</td>
+ <td>forward current message</td></tr>
+</table>
+
+
+<a name="scroll"><b>Scrolling through messages</b></a><p>
+You have the option of scrolling, rather than paging using <i>Next</i> and
+<i>Previous</i>, through most of your messages in your Message List. Go
+to <b>Configure</b> on the left side of your Message List page, click the
+Message List tab and enter a higher number in the <i>Message Lines
+Displayed</i> field. Bear in mind that the higher
+number you choose, the longer it may take Alpine to open your folders.
+
+
+<p><a name="sort"><b>Sorting your mail</b></a><p>
+To sort your mail, the List Headers Bar must first be displayed. Display the bar by clicking
+the <img src="../../images/baropen.gif" alt="small arrow"> icon
+near the top of the screen.
+
+<p>Using the Sort options, you can arrange your mail by <b>Date</b>,
+<b>From</b>, <b>To</b>, <b>Size</b>, <b>Subject</b>, <b>Ordered
+Subject</b>, and <b>Thread</b>. Click:
+<ul>
+ <li><b>Date</b> to sort by the date your messages were sent.</li>
+ <li><b>From</b> to sort alphabetically by the email address of the sender of the message.</li>
+ <li><b>To</b> to sort alphabetically according to the "To:" line.</li>
+ <li><b>Size</b> to sort by the number of characters in the message.</li>
+ <li><b>Subject</b> to sort alphabetically according to the "Subject:" line.</li>
+ <li><b>Ordered Subject</b> to group messages with the same "Subject:" line and put them into date order.</li>
+ <li><b>Thread</b> to present messages as a continuous chain grouped by "Subject:" line. This sort is particularly helpful when viewing newsgroups.</li>
+</ul>
+
+<p>Once you have sorted your mail, the name of that sort (i.e. the column
+heading) will be highlighted and an arrow will appear next to the name. To
+reverse the sort order, click the arrow.
+By default, your Message List is set to sort your mail by arrival time.
+</p>
+
+<!--<p><i>{Do you want to change your default sort order? <a href="">Click
+here</a> for that configuration option.[not implemented yet]}</i></p>-->
+
+<a name="delete"><b>Deleting messages</b></a><p>
+<ul>
+ <li>Click the checkboxes next to the appropriate messages</li>
+ <li>Click <input type=submit value="Delete">. All messages with a mark in the checkbox will be flagged for deletion. (If you notice that some messages are mistakenly flagged for deletion, click their associated checkboxes and click <input type=submit value="Undelete">)</li>
+ <li>Click <input type=submit value="Expunge"> to permanently remove from your folder all the messages that have been flagged for deletion</li>
+</ul>
+
+<p>If you want to delete several messages at once that share a similar
+attribute, you might want to first perform a search. See the
+<a href="#search">Searching</a> text for more information.</p>
+
+<p>Note: if marking a message for deletion fails to work it may be because
+you recently used your browser's "Back" button. To avoid this, be sure to
+Alpine links and navigation options.
+
+
+<!-- <p><i>{Do you want to Expunge without being prompted for a
+confirmation? <a href="">Click here</a> to change that configuration
+option. [not implemented yet]}</i>
+<p>{<i><a href="">Click here</a> to enable aggregate commands to have
+this option available on this page. [not implemented yet]</i>}</p> -->
+
+<p>
+<a name="expunge"><b>Removing deleted messages</b></a><p>
+Flagging messages for deletion is only half the process of actually removing the messages from the folder altogether.
+Click <input type=submit value="Expunge"> to permanently remove messages flagged for deletion. Because removed messages cannot
+be restored, you will be prompted to confirm your desire. At the prompting click:</p>
+
+<p><input type=submit value="Expunge"> to permanently remove the messages you have flagged for deletion. You will
+not be able to retrieve your messages once you have expunged them. </p>
+
+<p><input type=submit value="Cancel"> to return to your list of messages. The messages you previously flagged for
+deletion will remain in your folder, still flagged for deletion.</p>
+
+
+<p> <a name="save"><b>Saving messages to another folder</b></a>
+<p>
+
+To save messages from your Message List, the Message Command Bar must
+first be displayed. Display the bar by clicking the <img
+src="../../images/baropen.gif" alt="small arrow"> icon near the top of the
+screen. Then, click the checkboxes next to the messages you want to
+save to another folder (or click just one checkbox if you are only
+saving that one message).
+
+<p>
+Save the chosen messages by choosing from the options in the dropdown menu next to the
+<input type=submit value="Save"> button. Among the Save options, you'll find:
+
+<ul>
+ <li> The name of the default folder to save to, typically <font face="courier">saved-messages</font>.
+ <li> Several, typically six, names of folders you have most recently saved messages to
+ <li> An option to type in directly the name of the folder you wish to save to (either a new folder you wish to create, or one
+already containing messages)
+ <li> An option to choose the folder from the list of all your folders
+</ul>
+
+If Alpine does not act on your choice immediately, click the <input type=submit value="Save">
+button to initiate saving. Once saved, the chosen messages will be marked for deletion.
+
+<p>
+
+<!---Config option for Collection lists?-->
+
+<a name="flags"><b>Setting status flags</b></a><p>
+By default, the area immediatly to the left of the message numbers is reserved for the following status flags:
+<table border=0 cellpadding=4 style="margin-left:24">
+ <tr>
+ <td><font face=Courier><b>+</b></font></td>
+ <td>message has your address in the To: line [Note: this is a fixed value]</td>
+ </tr>
+ <tr>
+ <td><font face=Courier><b>*</b></font></td>
+ <td>(Important) - You have previously set the status of this message to important</td>
+ <tr>
+ </tr>
+ <td><font face=Courier><b>A</b></font></td>
+ <td>(answered) - You have replied to this message</td>
+ </tr>
+ <tr>
+ <td><font face=Courier><b>N</b></font></td>
+ <td>(new) - You have not yet looked at the text of this message</td>
+ </tr>
+ <tr>
+ <td><font face=Courier><b>D</b></font></td>
+ <td>(deleted) - You have marked this message for deletion, but not yet expunged it</td>
+ </tr>
+</table>
+
+To add or remove the status flags, the Message Command Bar must first be
+displayed. Display the bar by clicking the <img src="../../images/baropen.gif"
+alt="small arrow"> icon near the top of the screen. Then: <ul>
+ <li>Click the checkboxes next to the appropriate messages</li>
+ <li>Choose the appropriate value from the dropdown menu</li>
+ <li>Click <input type=submit value="Set"></li>
+</ul>
+
+
+<!--Config option for enabling status w/click-->
+
+<a name="search"><b>Searching</b></a><p>
+
+To search, the Message Command Bar must first be displayed. Display the bar
+by clicking the <img src="../../images/baropen.gif" alt="small arrow"> icon
+near the top of the screen.
+
+<p>Click <input type=submit value="Search"> to get to a page where you can find messages by
+text, date, or status.</p>
+
+After you specify your search criteria, you will be returned to your
+Message List. If matches were found, your Message List will display your
+found messages and those messages will be marked. (Be aware: by default
+Search will include messages marked before the search along with your
+search results.) Click <input type=submit value="Show All Messages"> to display your entire Message
+List.
+
+<p><a name="jump"><b>Jump Command (optional)</b></a><p>
+
+Depending on your configuration, you may also see a text box next to a
+<input type=submit value="Jump"> button on the left side of the page. Enter a
+message number into the text box and click the button to redisplay
+the Message List with the chosen message at the top of the page.
+
+<p>
+You may find message numbers on the Message List lines make this command more useful.
+If not displayed in the Message List, you can add message numbers to each line by
+going to <b>Configure</b> on the left of the Message List page, clicking the
+Message List tab and adjusting the Message Line Format accordingly.
+
+<p><a name="note"><b>Differences from Alpine and PC-Alpine</b></a><p>
+
+<p>Alpine is designed primarily for easy access to email. It is not
+intended to replace any other heavy duty email programs. Accordingly, it
+is missing some of the more advanced features you will find in Pine and
+PC-Pine. As development continues, features will be added as long as they
+do not make a large impact on Alpine's speed or efficiency.
+
+<p> Some of the features you will not currently find in Alpine Message
+List: <ul>
+<li>Go directly to a folder you type in (may be added soon)
+<li>Export message
+
+</ul>
+<!--Go to Configure to change the view display after search default-->
diff --git a/web/cgi/alpine/1.0/help/index.tcl.1 b/web/cgi/alpine/1.0/help/index.tcl.1
new file mode 100644
index 00000000..67cc941d
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/index.tcl.1
@@ -0,0 +1,301 @@
+# $Id$
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+cgi_put [cgi_font size=+2 [cgi_bold "Message List"]]
+
+cgi_p
+cgi_puts [cgi_font size=-1 color=red "Note: This text may be out-of-date; changes to the Message List page are in process."]
+
+cgi_p {
+ Your Message List contains summary information about each of the
+ messages in your current WebPine-lite folder and provides ways for you to
+ take actions on those messages.
+}
+
+cgi_p {
+ To compose a new message, resume a postponed one, or go to another
+ folder, select the appropriate option in the column on the left-hand side
+ of your page. You will also see options to change your WebPine-lite
+ configuration and to manage your address book.
+}
+
+cgi_bullet_list type=square {
+ cgi_li [cgi_url [cgi_bold "Reading your mail"] "#read"]
+ cgi_li [cgi_url [cgi_bold "Navigating your list"] "#navigate"]
+ cgi_li [cgi_url [cgi_bold "Sorting your mail"] "#sort"]
+ cgi_li [cgi_url [cgi_bold "Operating on a set of messages"] "#aggregate"]
+ cgi_li [cgi_url [cgi_bold "Deleting messages"] "#delete"]
+ cgi_li [cgi_url [cgi_bold "Saving messages to another folder"] "#save"]
+ cgi_li [cgi_url [cgi_bold "Setting status flags"] "#flags"]
+ cgi_li [cgi_url [cgi_bold "Searching"] "#search"]
+}
+
+cgi_anchor_name "read"
+cgi_puts [cgi_bold "Reading your mail"][cgi_nl]"
+cgi_puts {
+ Once you log into WebPine-lite, you will see your Message List INBOX. To
+ read a message within any folder, select its subject line.
+}
+
+cgi_p {
+ Go to [cgi_bold "Folder List"] if you want to read mail within another
+ folder.
+}
+
+cgi_p {
+ Your INBOX is where your new mail is delivered unless you filter some
+ mail to another folder.
+}
+
+if {0} {
+<!-- <p>{<i><a href="">Click here</a> to configure mail filters.[not
+implemented yet]}</i></p> -->
+}
+
+cgi_anchor_name "navigate"
+cgi_puts [cgi_bold "Navigating your list"][cgi_nl]
+cgi_puts {
+ In the column on the left-hand side of your Message List page, you will
+ see four navigation options: [cgi_bold Previous], [cgi_bold First], [cgi_bold Next],
+ [cgi_bold Last].
+}
+
+cgi_puts "Select:[cgi_nl]"
+cgi_bullet_list {
+ cgi_li {
+ [cgi_bold Previous] to download your Message List page that contains
+ your previous set of messages. For example, if you see messages 101-150
+ out of 280, select [cgi_bold Previous] to go to messages 50-100.[cgi_nl]
+ }
+ cgi_li {
+ [cgi_bold First] to view your Message List beginning with message number 1.
+ }
+ cgi_li {
+ [cgi_bold Next] to download your Message List page that contains
+ your next set of messages. For example, if you see messages 101-150 out
+ of 280, select [cgi_bold Next] to go to messages 151-200.
+ }
+ cgi_li {
+ [cgi_bold Last to view your Message List page that ends with your last
+ message in that folder.
+ }
+}
+
+cgi_p {
+ Use your browser scrollbar to see messages that are downloaded, but are
+ out of eyesight due to screen size.
+}
+
+if {0} {
+<!-- <p>{<i>Do you want to change the number of messages WebPine-lite
+downloads to your Message List? <a href="">Click here</a> to make that
+configuration change.[not implemented yet]}</i></p> -->
+}
+
+cgi_p {
+ [cgi_anchor_name "sort"][cgi_bold "Sorting your mail"][cgi_nl]
+ Using the Sort options you can arrange your mail by [cgi_bold "Date"],
+ [cgi_bold "From"], [cgi_bold "To"], [cgi_bold "Size"], [cgi_bold "Subject"], [cgi_bold "Ordered Subject"],
+ and [cgi_bold "Thread"]. By default, your Message List is set to
+ sort your mail by arrival time. Most of the time, arrival time and date
+ (effectively departure time) are nearly the same. They may differ,
+ however, because of messages may take a long time in delivery or because
+ of time zone differences.
+}
+
+
+cgi_puts "Select:[cgi_nl]"
+cgi_button_list {
+ cgi_li "[cgi_bold "Date"] to sort by the date your messages were sent.<br>
+ cgi_li "[cgi_bold "From"] to sort by the name of the sender of the
+message.<br>
+ cgi_li "[cgi_bold "To"] to sort your messages alphabetically according to the "To:"
+line.<br>
+ cgi_li "[cgi_bold "Size"] to sort by the number of characters in the message.<br>
+ cgi_li "[cgi_bold "Subject"] to sort your messages alphabetically according to the
+subject line.<br>
+ cgi_li "[cgi_bold "Ordered Subject"] to group messages with the same subject name and
+put them into date order.<br>
+ cgi_li "[cgi_bold "Thread"] to present messages as a continuous chain grouped by
+Subject. This sort is particularly helpful when viewing newsgroups.</ul>
+
+cgi_p
+Once you have sorted your mail, the name of that sort (i.e. the column
+heading) will be highlighted and an arrow will appear next to the name. To
+reverse the sort order, click the arrow.</p>
+
+<!-- <p><i>{Do you want to change your default sort order? <a href="">Click
+here</a> for that configuration option.[not implemented yet]}</i></p> -->
+
+cgi_p
+cgi_anchor_name "aggregate">[cgi_bold "Operating on a set of messages"]</a><br>
+
+cgi_p
+Operating on a set of messages is referred to as [cgi_italic "aggregate operations"].
+The way you perform aggregate operations is by placing a mark in the checkbox on
+the line associated with the desired message,
+and then choosing the operation to perform such as deleting or setting
+other message flags, or saving them to a folder.
+
+cgi_p
+The set of aggregate operations are either hidden or exposed. When
+hidden you will see a <img src=../../images/slideout.gif style="vertical-align:middle"> tab on the left edge of the line
+containing the sort names. Click the tab to expose the aggregate
+commands and the checkboxes next to each message. Similarly, when aggregate operations are visible, you will see a
+<img src=../../images/slidein.gif style="vertical-align:middle"> tab on the line containg the sort names. You can click this
+tab to hide aggregate operations.
+
+cgi_p
+When aggregate commands are exposed, the set of commands available is either
+simple or complete. The simple set consists of only the ability to [cgi_bold "Delete"]
+messages. When the simple mode is in effect, you will see a [cgi_bold "Delete"] button
+and next to it the <img src=../../images/tabmore.gif style="vertical-align:middle"> tab
+above the column of checkboxes. Click the <img src=../../images/tabmore.gif style="vertical-align:middle"> tab
+to expose the complete set of commands.
+
+cgi_p
+When the complete set of commands is visible, a <img src=../../images/tabless.gif style="vertical-align:middle">
+tab will be on the sort name row. Click it to return to the simple aggregate command set.
+
+cgi_p
+The complete set of aggregate operations adds an additional display line above the sort names row.
+It contains the [cgi_bold "Flag"] and [cgi_bold "Save"] commands. The choices above the checkbox column will change
+as well into a dropdown list of alternative methods for setting or unsetting checkboxes.
+
+cgi_p
+There are three ways to mark a message when the complete mode is in effect:</p>
+<ul>
+ cgi_li "Select the checkbox next to the message or messages
+ cgi_li "Perform a Search using the [cgi_bold "Search/Mark..."] menu
+ cgi_li "Select [cgi_italic "Mark All"] from the [cgi_bold "Search/Mark..."] menu.
+</ul>
+
+cgi_p
+Lastly, the dropdown will offer a [cgi_bold "Zoom"] option. Choosing it will change the Message List by
+hiding all of the unchecked messages from view. This is useful, for example, to examine a Search result
+that may have marked only a few messages in a large folder.
+
+<!-- <p><i>{<a href="">Click here</a> to enable or disable aggregate
+commands from this page. [not implemented yet]}</i></p> -->
+
+cgi_p
+cgi_anchor_name "delete">[cgi_bold "Deleting Messages"]</a><br>
+When you see the [cgi_bold "Delete"] option in the upper-right corner of
+your Message List page, to delete messages:
+<blockquote>
+<ul>
+ cgi_li "Select the checkboxes next to the appropriate messages
+ cgi_li "Select [cgi_bold "Delete"]
+ cgi_li "Select [cgi_bold "Expunge"] to remove the messages from your folder
+</ul>
+</blockquote>
+
+When you are showing all of your aggregate operations (i.e. you
+will see the [cgi_bold "Search/Mark..."] menu and the "Set Message Status" and
+"Save Messages" operations), to delete:
+cgi_division style=
+<ul>
+ cgi_li "Select the checkboxes next to the appropriate messages by either
+selecting them individually or use the [cgi_bold "Search/Mark..."]
+menu options
+ cgi_li "Select [cgi_bold "Flag"] messages as Deleted
+ cgi_li "Select [cgi_bold "Expunge"] to remove the messages from your folder.
+</ul>
+</blockquote>
+
+cgi_p
+If you do not see checkboxes to the left of your messages, all of your
+aggregate operations are hidden. Click the tab to the left of your column
+sort names to show [cgi_bold "Delete"], then click the tab next to [cgi_bold "Delete"]
+if you want to see all the aggregate operations.</p>
+
+<!-- <p><i>{Do you want to Expunge without being prompted for a
+confirmation? <a href="">Click here</a> to change that configuration
+option. [not implemented yet]}</i>
+cgi_p
+{<i><a href="">Click here</a> to enable aggregate commands to have
+this option available on this page. [not implemented yet]</i>}</p> -->
+
+
+cgi_anchor_name "save">[cgi_bold "Saving messages to another folder"]</a><br>
+"Save Messages" is only available from your Message List page when all of
+your aggregate operations are showing. If you do not see "Save Messages"
+on the top right-hand side of your page, some of your aggregate operations
+are hidden. Click the tab to the left of your sort column headings to show
+all of them.
+
+Select the checkboxes next to the messages you want to save to
+another folder. Alongside the [cgi_bold "Save"] button, type in the name of the
+folder to which you want the messages saved. The folder name can be one
+that already exists, or you can create a new folder by typing in a new
+name. If you have folder collections, select the correct one using the
+dropdown menu. Select [cgi_bold "Save"] to save the message(s) into the folder
+you have typed.
+
+cgi_p
+The messages in your current folder that you have saved to another
+will be flagged for deletion.</p>
+
+
+cgi_anchor_name "flags">[cgi_bold "Setting status flags"]</a><br>
+Immediately to the left of your message numbers is an underscore
+reserved for your status flags:
+cgi_button_list {
+ cgi_li "[cgi_bold "+"] message sent directly to your address (your address was in the To: line)"
+ cgi_li "[cgi_bold "*"] important message"
+ cgi_li "[cgi_bold "A"] answered message"
+ cgi_li "[cgi_bold "N"] new (unread) message"
+ cgi_li "[cgi_bold "D"] flagged for deletion (additionally the subject line will have a strike through it)"
+</ul>
+
+cgi_p {
+ Select the underscore to go to a page where you can set or unset any of
+ your message status flags.
+}
+
+cgi_anchor_name "search"
+cgi_puts {
+ [cgi_bold "Searching"][cgi_nl]
+ You can search through your messages in your Message List using the
+ [cgi_bold "Search/Mark..."] dropdown menu. If you do not see the menu
+ (to the left of your sort column headings), some of your aggregate
+ commands are hidden. Click the tab in that area to show more commands.
+}
+
+cgi_p {
+ Select one of the menu items under [cgi_bold "Search/Mark..."] to
+ find messages:
+}
+cgi_bullet_list {
+ cgi_li [cgi_italic "...by text"]
+ cgi_li [cgi_italic "...by date"]
+ cgi_li [cgi_italic "...by status"]
+}
+
+cgi_puts {
+ Specify your search criteria on the next page. After you make your
+ selection, you will return to your Message List and the checkbox will be
+ selected for those messages found in your search.
+}
+
+cgi_p {
+ If you want to display just those messages that were found in your
+ search, next select [cgi_bold "Zoom"] from the [cgi_bold "Search/Mark..."] menu list.
+ (Be aware that if you had other messages checked for selection before your
+ search, they will also be included in your zoomed view).
+}
+
+if {0} {
+<!-- <p><i>Note: If your browser is not javascript-enabled, after you make
+your selection from the dropdown menu you will need to select the
+<b>Do</b> button.</i></p> -->
+}
+
diff --git a/web/cgi/alpine/1.0/help/release.html b/web/cgi/alpine/1.0/help/release.html
new file mode 100644
index 00000000..3396a3b3
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/release.html
@@ -0,0 +1,83 @@
+<HTML>
+<HEAD>
+
+<!--
+# $Id: release.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+
+<TITLE>Alpine Release Information</TITLE>
+
+<STYLE TYPE='TEXT/CSS'>
+BODY { background-color: #FEFAC9 ; font-family: Arial, sans-serif }
+DL { padding: 0 18 }
+DT { font-weight: bold }
+DD { padding-bottom: 12 }
+</STYLE>
+
+</HEAD>
+
+<BODY>
+
+<DIV STYLE="font-weight: bold; font-size: 16pt ; padding: 12" ALIGN="CENTER">
+<IMG SRC="../../images/logo/alpine/small.gif" STYLE="float: left; padding-left: 20">
+Alpine Release Highlights
+</DIV>
+
+<DIV STYLE="background-color: white; padding: 24; margin: 20; border: 1px solid black">
+This page is used to publish the highlights of periodic updates. Bug fixes, explanations
+for new features and so forth can typically be found here.
+<P>
+<H2>December 2007:</H2>
+
+<DL>
+<DT>Web Alpine General Release</DT>
+<DD>
+<P>
+This is the first release to the general public of the Web Alpine IMAP
+client. It's built on the Alpine Mail System which itself is derived
+from the Pine Mail System. Externally, besides numerous new features,
+the most significant change is likely the new licensing. The Alpine Mail System
+has been release under the Apache 2.0 license.
+
+<P>
+Internally, there are significant changes. The code has been
+restructured to partition mail data access routines from those
+functions that provide the user interface. This allows development on
+the mail engine proper to be easily reflected across the supported
+interfaces. Similarly, each interface, Unix, Windows, and Web, can be
+developed reasponably independently.
+<P>
+Similarly, significant work has been done to make Alpine more
+international. Internally, message text and so forth is represented in
+Unicode, and the groundwork has been laid to support status and
+command translations.
+
+<P>
+As for the Web Alpine IMAP client, it is an updated, evolutionary
+improvement upon the Pine-based version that has been serving tens of
+thousands of users daily on the University of Washington campus for
+several years. It is not quite as fully featured as the other Alpine
+mail tools, but is a reasonably solid and complete IMAP client. We
+also tend to agree with many of its critics that it is a somewhat homely
+interface, and we are taking significant steps toward addressing that
+criticism. Stay tuned!
+
+</DD>
+</DL>
+
+<P>
+
+</DIV>
+
+</BODY>
+</HTML>
diff --git a/web/cgi/alpine/1.0/help/reply.tcl b/web/cgi/alpine/1.0/help/reply.tcl
new file mode 100644
index 00000000..32fb66ae
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/reply.tcl
@@ -0,0 +1,17 @@
+# $Id: reply.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+cgi_p
+cgi_h2 "Reply Help"
+cgi_p "Help pages for the Reply compose form will appear here."
+cgi_p {
+ Someday.
+}
diff --git a/web/cgi/alpine/1.0/help/resume.html b/web/cgi/alpine/1.0/help/resume.html
new file mode 100644
index 00000000..7a59e908
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/resume.html
@@ -0,0 +1,28 @@
+<!--
+# $Id: resume.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<font size="+2"><b>Message Resume</b></font>
+
+<p>At the Message Resume screen, you can return to composing an unfinished
+message that you have previously postponed. </p>
+
+<p>Click the radio button next to the message that you want to continue composing. Click
+<input type=submit value="Resume Chosen Message"> to go to a Message Compose screen that
+contains your postponed message.</p>
+
+<p>If you decide not to resume a message, Click <input type=submit value="Cancel">. Note, cancelling
+on this screen will not remove any of your messages. To
+remove a postponed message you must first click <input type=submit value="Resume Chosen Message">
+and then, on the Message Compose screen, click
+<input type=submit value="Cancel">.
+
diff --git a/web/cgi/alpine/1.0/help/secure.html b/web/cgi/alpine/1.0/help/secure.html
new file mode 100644
index 00000000..f44df381
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/secure.html
@@ -0,0 +1,119 @@
+<HTML>
+<HEAD>
+<!--
+# $Id: secure.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<TITLE>Alpine with Session Encryption</TITLE>
+<STYLE TYPE='TEXT/CSS'>
+BODY { background-color: #F3F3F3 ; font-family: Arial, sans-serif }
+</STYLE>
+</HEAD>
+
+<BODY>
+
+<DIV STYLE="font-weight: bold; font-size: 16pt ; padding: 12" ALIGN="CENTER">
+<IMG SRC="../../images/logo/alpine-w-logo-small.gif" STYLE="float: left; padding-left: 20">
+Alpine with Session Encryption
+</DIV>
+
+<DIV STYLE="background-color: white; padding: 24; margin: 20">
+
+Web browser access to email is inherently slower than a desktop email
+application.&nbsp; And while Alpine is designed to be as efficient as
+possible, there remain certain performance obstacles that cannot be
+easily overcome.&nbsp;
+
+<p>
+
+One obstacle is session encryption (also known as
+<a href="http://www.washington.edu/computing/web/publishing/ssl.html">Secure
+Socket Layer</a> or SSL).&nbsp; When session encryption is enabled, all
+communication between the browser and the Alpine server is scrambled
+such that an eavesdropper would find it extremely difficult to observe
+the contents.&nbsp; When disabled, all communication, except for your
+username and password, between the browser and Alpine server takes
+place in clear text and is easily observable.&nbsp;
+
+<p>
+
+While encryption and decryption require some extra computing
+resources, the heaviest performance cost has to do with default
+browser behavior.&nbsp; Usually browsers retain a copy of pages and
+their various elements, such as images, for a time with the intent of
+avoiding costly network communication next time that page or a page
+containing the same elements is requested.&nbsp; However, to be extra
+careful of potentially exposing sensitive information, many browsers
+default behavior is not to retain copies of elements retrieved over
+encrypted connections.&nbsp; Thus, Alpine's performance cost has to
+do with the browser re-requesting common elements on the various
+Alpine pages.&nbsp;
+
+<p>
+
+Typically, from a computer connected directly to the campus network
+(or other high-speed network such as DSL or cable-modem) this
+performance cost is not noticeable.&nbsp; However, a user on a slower,
+modem-connected computer can be severely effected.&nbsp;
+
+<p>
+
+There are two ways to work around this situation.&nbsp; One is to alter the
+browser's configuration to retain elements on pages served securely.&nbsp;
+The downside is that this setting often will then apply to all secure
+pages, not just Alpine.&nbsp; The other work around is to disable session
+encryption for Alpine.&nbsp; The downside is that communication between
+the Alpine server and your computer, except for passwords, is
+visible.&nbsp;
+
+<p>
+
+The likelihood that the communication will be observed depends on the
+path the communication takes over the network.&nbsp; For example, while
+using a computer in a campus lab or laptop connected to a wireless
+hub, it is not unthinkable that someone on the local network may be
+watching traffic.&nbsp; In such situations the communication speed is high
+enough to offset the performance cost, so session encryption is a pretty
+good idea.&nbsp; Similarly, communication between the Alpine server and a
+computer connected to a campus modem, is not likely to travel
+over a publicly accessible network, so malicious eavesdropping is much
+less likely.&nbsp; Given the slower communication speed and reduced risk of
+observation, disabling session encryption while connected via modem
+is reasonable.&nbsp;
+
+<p>
+
+Alpine knows about the campus modem pools, and will adjust the
+&quot;Session Encryption&quot; default setting based on whether or not
+the browser you are using appears to be running on a computer
+connected to a campus modem pool.&nbsp; Modem pool connections will
+default to <b>not</b> using session encryption.&nbsp; All other connections
+will default to using session encryption.&nbsp; That is, a computer on the
+campus network or connected to a network or dial-in service outside
+the UW will have its Alpine session encrypted unless you uncheck the
+box labelled "SSL Session Encryption."&nbsp; If you are on a slow
+connection and confident that your connection is not likely to travel
+any hostile path, or otherwise decide the performance benefit
+outweighs the risk of observation, then unchecking the box may be a
+reasonable option for you.&nbsp;
+
+<p>
+
+Please note: Session encryption <i>only</i> ensures that communication
+between your browser and the Alpine server is secure. It does not
+mean email messages you send from Alpine are in any way safe from
+observation or otherwise confidential.
+
+
+</DIV>
+</BODY>
+</HTML>
diff --git a/web/cgi/alpine/1.0/help/takeaddr.html b/web/cgi/alpine/1.0/help/takeaddr.html
new file mode 100644
index 00000000..053b9063
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/takeaddr.html
@@ -0,0 +1,34 @@
+<!--
+# $Id: takeaddr.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<FONT SIZE=+2><B>Take</B></FONT>
+
+<P>
+
+Use <b>Take</b> to capture addresses from your current email message and
+put them into your address book. All the email addresses contained within
+your message will be listed as choices for entry into your address book.
+
+<p>
+
+<p> Click the check-box next to the address or addresses you would like to
+take to your address book. Click one check-box if you want to add just
+that single address. Click more than one check-box to create a group
+mailing list, which will link those addresses to one nickname in
+your address book. After you make your selection, click <b>Take
+Address</b> to then complete your address book entry, or click
+<b>Cancel</b> to return to your email message without altering anything.
+
+<p> If you have more than one address book, you will see a pull-down menu.
+Use that menu to select among your defined address books.
+</p>
diff --git a/web/cgi/alpine/1.0/help/takeedit.html b/web/cgi/alpine/1.0/help/takeedit.html
new file mode 100644
index 00000000..18d18392
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/takeedit.html
@@ -0,0 +1,63 @@
+<!--
+# $Id: takeedit.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<FONT SIZE=+2><B>Address Book Entry - Take</B></FONT>
+<P>
+
+To complete your entry, supply the following information for
+your address book:
+
+<P>
+<UL TYPE=square>
+<LI><a href="#nick"><b>Nickname</b></a>
+<LI><a href="#fullname"><b>Full Name</b></a>
+<LI><a href="#addresses"><b>Addresses</b></a>
+<LI><a href="#fcc"><b>Fcc</b></a>
+<LI><a href="#comments"><b>Comments</b></a>
+</UL>
+
+<a name="nick"><b>Nickname</b></a><br>
+The nickname you choose will identify this address book entry. Every
+address book entry is required to have a nickname associated with it.
+Use the nickname in place of an address on the Message Compose page and
+<b>Expand</b> will fill in the address or addresses for this entry. The
+nickname is not seen in the outgoing message.
+
+<p>
+<a name="fullname"><b>Full Name</b></a><br>
+This optional field is for the full name for this entry. For an individual
+entry, you will ordinarily use that person's name. For a group of
+addresses (or distribution list), use a descriptive word or phrase that
+describes the group. Edit existing names by typing in the field.
+
+<p>
+<a name="addresses"><b>Addresses</b></a><br>
+This required field will be filled in with the addresses you selected from
+your email message. Group mailing lists will have addresses separated by
+commas.
+
+<p>
+<a name="fcc"><b>Fcc</b></a><br>
+The "Folder carbon copy" field gives you the ability to save a copy of the
+messages you send to the folder name you put here. The Fcc name will be
+used instead of your default Fcc folder (usually "sent-mail") when you
+use this address book entry as the first address in To: line of messages
+you compose.
+
+<p>
+<a name="comments"><b>Comments</b></a><br>
+This is a comment you can add for your convenience. This field is not
+used in your outgoing messages.
+
+<p>When finished, click <b>Save</b> to update your address book, or
+<b>Cancel</b> to return to the message view without making any changes.
diff --git a/web/cgi/alpine/1.0/help/tech-notes.html b/web/cgi/alpine/1.0/help/tech-notes.html
new file mode 100644
index 00000000..7f275620
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/tech-notes.html
@@ -0,0 +1,471 @@
+<html>
+<head>
+<!--
+# $Id: tech-notes.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+</head>
+<body>
+<font size=+3><b>Web Alpine Technical Notes</b></font>
+
+<!-- history: originally prepared for AIT, 22 October 2002 -->
+<!-- history: updated for initial campus release, 19 Apr 2004 -->
+
+<h2>Why Web Alpine</h2>
+
+Web Alpine was originally conceived as a means of providing reliable,
+ubiquitous, and consistent access to UW email facilites via the Interactive
+Message Access Protocol (IMAP). As with Pine, it is intended to present a
+simple, approachable interface that can be easily navigated with
+minimal familiarity. It is also intended to be as efficient as
+possible, in both page-service and user navigation while meshing
+as neatly as possible with the central campus IMAP infrastructure.
+
+<p>
+
+<h2>How Web Alpine</h2>
+
+<p>
+
+Web Alpine's foundation rests firmly on Unix Alpine's many years of
+development and deployment. It's core element is a per-session server
+(or serverette) that provides data to the scripts generating the web
+pages the users sees and manages the connection to the IMAP mail
+server where the user's mail resides. This serverette is literally
+built from the same Alpine sources used to build the Unix Alpine and
+PC-Alpine mail user agents. Thus, it inherits most of the efficiency,
+such as data caching and request ordering and grouping, that has been
+built into Alpine, as well as many of the features and functions.
+
+<p>
+
+<h3>Components</h3>
+<p>
+
+<table width=80% align=center border=0 cellpadding=8>
+<tr>
+ <td valign=top align=left><b>Browser</b></td>
+ <td>Performs usual browser role: sends requests, renders responses and displays or hands off for display non-HTML data</td>
+</tr>
+<tr>
+ <td valign=top align=left nowrap><b>Web Server</b></td>
+ <td>Performs extraordinary web server role: produces HTML responses to requests, maintains relationship between user's browser and IMAP server for the life of the user's session.</td>
+</tr>
+<tr>
+ <td valign=top align=left nowrap><b>IMAP Server</b></td>
+ <td>Performs usual mail server role: provides access to the various bits and pieces of mail data via Interactive Message Access Protocol</td>
+</tr>
+</table>
+<p>
+<div align=center>
+<img src=wpsys.jpeg>
+</div>
+<p>
+
+<h3>Protocols, Services, Technologies</h3>
+<p>
+
+<table width=80% align=center>
+<tr><td>
+ <dl>
+ <dt><b>HTTP(s)</b></dt>
+ <dd>Protocol between browser and web server. Common language allowing users to get at their mail from the widest variety of platforms and locations.</dd>
+ <dt><b>IMAP(s)</b></dt>
+ <dd>Broadly implemented distributed mail protocol which permits users to access mail from a variety of
+ clients: web alpine, pine, pc-pine, outlook express, eudora.</dd>
+ <dt><b>Pubcookie</b></dt>
+ <dd>Secure, distributed web-based authentication service optionally used as the mechanism to authenticate users in the Web Alpine login process.</dd>
+ <dt><b>GSSAPI</b></dt>
+ <dd>SASL authentication mechanism used to establish session between Web Alpine serverette and IMAP server on behalf of Pubcookie authenticated user.</dd>
+ <dt><b>Tcl</b></dt>
+ <dd>Tool Command Language. Chosen CGI scripting language for the Web Alpine page templates. Reasonable
+ language, reasonably implemented, reasonably supported, particularly well suited for exporting functionality
+ in pre-existing C-based tools.</dd>
+ <dt><b>Unix Domain Sockets</b></dt>
+ <dd>Communication channel used to pass requests/responses between Tcl interpreters processing scripts and web alpine serverette.</dd>
+</dl>
+</td></tr>
+</table>
+<p>
+
+<h3>Web Alpine Distribution Layout</h3>
+<p>
+The Web Alpine application consists of three main components; the CGI scripts that generate pages containing the user's email data,
+a serverette running on the http server spanning the life of the user's session, and a couple of libraries
+to aid page generation and serverette communciation.
+
+<p>
+Web Alpine is packaged as part of the Alpine Distribution and it's source resides
+within the <tt>web/</tt> subdirectory. Subdirectories are organized by the service
+the provide, and breakdown as follows:
+<p>
+<table border=0 xbgcolor="#dddddd" align=center width="90%" cellpadding=2>
+<tr>
+ <td valign=top><tt>bin/</tt></td>
+ <td></td>
+ <td></td>
+ <td valign=top>Contains scripts and generated binaries that initiate and maintain Web Alpine sessions.
+ </td>
+</tr>
+<tr>
+ <td valign=top><tt>cgi/</tt></td>
+ <td></td>
+ <td></td>
+ <td valign=top>Contains scripts referenced by the browser to generate the Web Alpine interface.
+ Subdirectories within organize scripts by function, and allow for suitable scoping
+ of session key.
+ </td>
+</tr>
+<tr>
+ <td></td>
+ <td valign=top><tt>alpine/</tt></td>
+ <td></td>
+ <td valign=top>Browser's view of Web Alpine application. Contains scripts to generate pages
+ the user interacts with.
+ </td>
+</tr>
+<tr>
+ <td></td>
+ <td valign=top><tt>session/</tt></td>
+ <td></td>
+ <td valign=top>Scripts referenced by the browser to manage session initiation.
+ </td>
+</tr>
+<tr>
+ <td></td>
+ <td valign=top><tt>images/</tt><br><tt>sounds/</tt><br><tt>pub/</tt></td>
+ <td></td>
+ <td valign=top>Scripts and data that don't require restricted access control.
+ </td>
+</tr>
+<tr>
+ <td valign=top><tt>config/</tt></td>
+ <td></td>
+ <td></td>
+ <td valign=top>Server configuration scripts, default settings.
+ </td>
+</tr>
+<tr>
+ <td valign=top><tt>lib/</tt></td>
+ <td></td>
+ <td></td>
+ <td valign=top>Contains components to support IPC, CGI processing and HTML generation.
+ </td>
+</tr>
+<tr>
+ <td valign=top><tt>src/</tt></td>
+ <td></td>
+ <td></td>
+ <td valign=top>Contains source files for Web Alpine's binary components which will be linked
+ against the <tt>pith/</tt> libarary components.
+ </td>
+ </td>
+</tr>
+<tr>
+ <td></td>
+ <td valign=top><tt>alpined.d/</tt></td>
+ <td></td>
+ <td valign=top>Source files for <tt>alpined</tt> serverette. This is a per-user, per-session
+ server that services requests for email data from the CGI scripts via UNIX domain
+ socket.
+ </td>
+</tr>
+<tr>
+ <td></td>
+ <td valign=top><tt>pubcookie/</tt></td>
+ <td></td>
+ <td valign=top>Source files providing UW Pubcookie web authentication support.
+ </td>
+</tr>
+<tr>
+ <td></td>
+ <td valign=top><tt>cgi.tcl-1.10/</tt></td>
+ <td></td>
+ <td valign=top>Source for TCL library providing CGI/HTML support
+ </td>
+</tr>
+<tr>
+ <td valign=top><tt>detach@</tt></td>
+ <td></td>
+ <td></td>
+ <td valign=top>Typically a symbolic link to a subdirectory within <tt>/tmp</tt>. It is used to hold temporary
+ copies of message attachments as they're downloaded to the browser.
+<table width="100%" align=center bgcolor="#dddddd"><tr><td>
+In the pubcookie case, it must have world read/write/execute mode set due to
+<tt>alpined</tt> pseudo-uid partitioning.
+</td></tr></table>
+
+</tr>
+</table>
+
+<p>
+
+<h2>Web Alpine Configuration</h2>
+<h3>CGI Script Configuration</h3>
+<p>
+Most Web Alpine configuration is contained in the <tt>config/alpine.tcl</tt> configuration file.
+Most of the interesting settings are toward the top of the file and pretty much suggest
+what they set. The most important settings, though, are probably:
+
+<table width="80%" align=center>
+<tr><td>
+<dl width=80%>
+<dt>
+ <tt>_wp(fileroot)</tt>
+</dt>
+<dd>
+that defines where the Web Alpine application was unpacked on your system, and
+</dd>
+<dt>
+<tt>_wp(urlprefix)</tt>
+</dt>
+<dd>
+which defines where browsers can find Web Alpine's CGI scripts. This is set to
+the null string if the server's DocumentRoot is synonymous with the root of
+Web Alpine's CGI directory. Othewise, it's typically set to the Alias accessed
+subdirectory in the web server's configuration.
+
+</dd>
+</dl>
+</td></tr>
+</table>
+
+
+<h3>Web Server Configuration</h3>
+<p>
+Typically, a Web Alpine server is used solely to serve Web Alpine pages. That is, no other hosting is
+done by the server. Thus, it is usually convenient to configure the web server to treat
+the <tt>web/cgi/</tt> directory within the distribution as the root directory of the pages
+it serves (or to move those files and directories into the web server's document root).
+Similarly, it may be necessary to configure the web server to process CGI scripts from
+it's root (since this <em>should</em> be a dedicated server this shouldn't matter).
+
+<h3>IMAP Server Configuration</h3>
+<p>
+Genarally, no configuration is required of the IMAP server.
+<table width="75%" align=center bgcolor="#dddddd"><tr><td>
+However, in the Pubcookie case the Web and IMAP servers need to coordinate the
+existence of a meta-user, such as <tt>webalpine</tt>, used for SASL proxy authentication. For UW imapd this
+means creating an account on the IMAP server that is a member of the <tt>&quot;mailadm&quot;</tt>
+group. A SASL GSSAPI authentication handshake is used between the
+Web and IMAP server when the web server initiates a session on behalf of
+a particular user.
+</td></tr></table>
+
+<h3>User Configuration</h3>
+<p>
+Since no user-initiated local file or mailbox access is permitted by (much less compiled into) the <tt>alpined</tt>,
+user configuration and data files are stored using Pine's remote pinerc and address book capabilites. The configuration
+settings in <tt>web/config/</tt> are used to set per-user defaults and direct Web Alpine toward the user's configuration
+settings on the IMAP server. Similarly, the default addressbook is stored as an IMAP folder on the server as well.
+Concurrent Web Alpine, Unix Pine and PC-Pine users that would like a consistent mail environment can easily configure their
+other Pine's to use the <tt>remote_pinerc</tt> and <tt>remote_addrbook</tt> on their IMAP server.
+
+<h3>Browser Configuration</h3>
+<p>
+A Web Alpine goal is to run reasonably on as many browsers as possible. Toward that end, little beyond basic table and form support
+is required of the browser. And while Javascript is not a requirement to access Web Alpine functions, when enabled in the browser
+some enhanced capability is available such as keyboard accessible commands and implicit selection of various listbox choices.
+
+<h2>Session Lifecycle</h2>
+<p>
+
+<ol>
+ <li>User requests <tt>greeting.tcl</tt> which consists of a form to be filled out with any necessary authentication tokens and mail server choice.
+ <table width="75%" align=center bgcolor="#dddddd"><tr><td>
+In Pubcookie case user is not presented the username/password option unless they have chosen to
+connect to a mail server outside the locally managed, predefined set.
+ </td></tr></table>
+ <li>User submits form with authentication tokens and initial mail server
+ <table width="75%" align=center bgcolor="#dddddd"><tr><td>
+By default, the submitted authentication tokens consist of a username/password pair. When Pubcookie is
+in use, the browser sends the pubcookie-specific authentication token with the form submission.
+ </td></tr></table>
+
+ <li>Web Alpine CGI logon script processes form and instantiates serverette. The logon script:
+ <ol>
+ <li>validates form data
+ <li>generates session key
+ <li>launches the Web Alpine serverette, <tt>alpined</tt>, passing session key via stdin
+ <table width="75%" align=center bgcolor="#dddddd"><tr><td>
+<tt>serverette</tt> reads session key, creates Unix domain socket, and enters command loop
+waiting for input on the fresh socket
+ </td></tr></table>
+ <li>sends serverette the command to establish a session with the requested IMAP server on behalf of the given user
+ <table width="75%" align=center bgcolor="#dddddd"><tr><td>
+By default, the login script simply passes the username/password pair to the serverette where
+it's the serverette's job to present them to the IMAP server for validation. If the IMAP server
+declines, a "bad user or password" error page is generated and sent to the browser and the serverette
+ exits.
+<p>
+The Pubcookie case is a bit more involved. The CGI scripts rely on the netid specified in the REMOTE_USER
+environment variable which is set as a side effect of pubcookie module processing. The trusted netid
+is not passed directly to the serverette, rather all CGI processing is done via a setuid Tcl interpreter.
+The uid is unique to each netid on the system, but not related to any netid/uid binding on general access
+systems. Running the CGI scripts and serverette under a netid-bound uid provides a convenient way to implement
+the authentication mechanism between the serverette and the IMAP server as well as a useful way to partition
+serverettes such that one compromised serverette can't affect others.
+ </td></tr></table>
+
+ <li>With a valid IMAP session established, the logon script redirects the user's browser to the initial
+ Message List page.
+ </ol>
+ <li>The user navigates/manipulates their email environment based on web pages generated by Tcl script
+templates which were fleshed out via requests to the <tt>alpined</tt> serverette. The serverette in turn
+may draw on its cache of IMAP data, make new requests of the IMAP server, post messages via SMTP or
+the local mail queue, formulate LDAP queries, or perform other tasks as required.
+ <table width="75%" align=center bgcolor="#dddddd"><tr><td>
+Note: Web Alpine sessions run as long as the user's browser requests pages. In the absense of user interaction
+Web Alpine will self-refresh every few minutes to mainain the session. Sessions only end when the user logs out
+or closes the browser.
+ </td></tr></table>
+ <li>User ends session and confirms
+ <table width="75%" align=center bgcolor="#dddddd"><tr><td>
+ Note: If the user simply closes their browser, the serverette will self-exit after 30 minutes.
+ </td></tr></table>
+</ol>
+
+<h3>Web Server Considerations</h3>
+<p>
+Web Alpine has been developed under Apache (versions 1.x thru 2.x). However, because the intent was to be as flexible
+and manageable as possible, little aside from SSL and basic CGI services are required of the web server. It's
+conceivable Web Alpine could be made to run under another server, or even Windows and IIS modulo the UNIX-Sockets communication
+issues between the CGI scripts and <tt>alpined</tt>.
+
+<p>
+The downside, of course, is that this requires somewhat redundant
+parses of the configuration and CGI-helper library with each page request. It's a trade-off. A slightly more efficient approach might be to create
+an apache module that understands requests and passes them directly to the corresponding <tt>alpined</tt> which would execute the script and return
+HTML directly. However, the additional cost in installation and management complexity stands to offset those gains.
+
+<p>
+Similarly, it is <bold>assumed</bold> that the Web Alpine service is provided on a black box server. That is, a host
+that has no general user accounts. Unmodified, Web Alpine creates the UNIX-domain sockets corresponding
+pretty directly to the user's session key in the <tt>/tmp</tt> directory. In addition, depending on the nature
+of the connection, the session key may also be exposed via oridinary httpd logging. <em>Important safety tip:</em> make
+sure ordinary users do not have access to the Web Alpine system or httpd log files. In the future those sockets may be moved into
+a access-restricted subdirectory, but the httpd log file record may be harder, and less reliably concealed.
+
+<h3>CGI Considerations</h3>
+<p>
+
+Most Web Alpine pages are generated via CGI scripts written in Tcl. A
+library of Tcl functions called <tt>cgi.tcl</tt> is used heavily to
+help with the HTML generation. Of course, this means that a web
+developer that might wish to change or enhance Web Alpine pages, will have
+to acquire some Tcl knowledge. Additionally, the library has one or two
+interface inconsistencies (not unlike Tcl, but that's another
+discussion), which will mean a bit steeper learning curve, but we
+think this is only slightly more difficult than the amount of Tcl
+one would have to learn in a more template-oriented approach. We think
+the scipt's logic flow and such is much easier to understand
+and maintain than the substitution and recursion necessary in an
+html-template approach.
+
+<p>
+
+
+<h3><span style="font-family: monospace; font-size: big">alpined</span> Considerations</h3>
+<p>
+Tcl, incidentally, is also the language used to move data in and out
+of the Web Alpine serverette, <tt>alpined</tt>. Tcl lends itself nicely
+to string oriented data, and provides a convenient, simple interface
+to export functionality contained in C-based utilities.
+
+<h3>HTML Considerations</h3>
+<p>
+Much of the HTML generated by Web Alpine does layout based on tables. This somewhat sub-optimal state
+mostly has to do with when the Web Alpine development effort was initiated and the concurrent browser
+chaos. The goal is to move scripts toward generating more CSS-oriented layout over time.
+
+<p>
+Similarly, earlier versions of Web Alpine relied heavily on Javascript in a misguided attempt to make the
+browser-based experience feel as familiar as possible to a dedicated desktop application. Beyond the fact that
+Javascript support varied widely across browsers at the time, it should have also been obvious that
+by presenting a familiar desktop-like interface, we also set desktop-like performance
+expectations which we had no hope of meeting.
+
+<h3>Clustering Considerations</h3>
+<p>
+Since <tt>alpined</tt> persists for the life of the user's session, the session is bound to the particular
+server that initiated it. In order to provide service to a sizeable constituency, it may be necessary to spread usage across
+a group or cluster of servers. There exist numerous strategies to distribute connecting users across a cluster, such
+as an initial server that redirects randomly to one of the servers in a cluster, DNS-based randomizing, or load-balancing
+strategies. The former can lead to web server names users find distracting (though this doesn't appear to be to
+much of an issue) and the latter, of course, could lead to misdirected requests over time (or as loads change) so
+it is necessary for servers to either redirect or proxy requests to the appropriate server.
+<p>
+As a basic allowance for such installations, Web Alpine's session key
+contains the hostname of the server that created it. Similarly, the
+access routines that parse the key for access to the appropriate
+<tt>alpined</tt> are aware of the hostname and will redirect
+misguided requests to the appropriate server. This isn't particularly
+satisfying in terms of network RTTs.
+<p>
+One alternative that saves network performance
+at the expense of slightly increased server load is to introduce a
+directory above the <tt>web alpine/</tt> script directory and then add one
+along side that new directory for each server in the cluster. It's then possible to use the Apache
+directive to proxy requests within the scope of those directories to
+the corresponding server.
+
+<h3>Security Considerations</h3>
+<p>
+<ul>
+<li>Session keys only valid for life of session. Can't acquire increased or prolonged rights based on key.
+<li>Link layer (ssl) encryption available (and likely the default in most situations)
+<li><tt>alpined</tt> pseudo-uid partitioning is employed in the pubcookie context
+</ul>
+<p>
+
+<h2>Future Plans</h2>
+<p>
+Through the semi-formal usability testing process, early testing
+phases and regular campus use, overall response has been very favorable.
+Usability testing concurrent with ongoing feature development and interface adjustments
+continues to hone rough edges, particularly where the drive for performance has led to
+less intuitive interface choices. We plan to continue emphasis on the refine/feedback
+loop as we roll in many of the features Pine users have come to appreciate.
+
+<p>
+Performance in terms of both user perceived response time and users per web server are
+always a concern, but must, of course, be balanced against additional maintenance and complexity costs.
+Less obvious complicating factors must be considered, such as <tt>alpined</tt> process partitioning
+and session-key containing cookie exposure in the face of malicous HTML attachments.
+We plan, of course, to continue exploring various methods to improve performance.
+
+<h2>Appendix: Installation Tests</h2>
+<p>
+For the most part, if you can get the login greeting page and
+then log into a session, things should be working for the
+most part. Some things you might try to verify
+a complete installation include:
+
+<ul>
+<li>Open a secondary folder</li>
+<li>Go back to Inbox</li>
+<li>View or Save an attachment</li>
+<li>Send a message</li>
+<li>Send a message with an attachment</li>
+<li>Spell check a message (if is ispell installed on the web server)</li>
+<li>Create an address book entry</li>
+<li>Delete an address book entry</li>
+<li>Save a message to a new folder</li>
+<li>Verify the new folder appears in the cached folder drop down</li>
+<li>Logout, Verify the folder appears in drop down list of subsequent session</li>
+<li>Try configuration settings such as Enable Full Headers</li>
+<li>Logout, Verify the setting change in subsequent session</li>
+</ul>
+
+
+</body>
+</html>
diff --git a/web/cgi/alpine/1.0/help/view.html b/web/cgi/alpine/1.0/help/view.html
new file mode 100644
index 00000000..0560ad2b
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/view.html
@@ -0,0 +1,195 @@
+<!--
+# $Id: view.html 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+-->
+<form action="alpine/wp.tcl" target="noop" method=get>
+<input name="page" value="noop" type=hidden notab>
+<font size="+2"><b>Message View</b></font>
+
+<p>The Message View is where you will read, forward, and reply to your mail.</p>
+
+<UL TYPE=square>
+ <li><a href="#navigate"><b>Navigating your messages</b></a></li>
+ <li><a href="#attach"><b>Viewing attachments</b></a></li>
+ <li><a href="#reply"><b>Replying to the message</b></a></li>
+ <li><a href="#forward"><b>Forwarding the message</b></a></li>
+ <li><a href="#save"><b>Saving the message to another folder</b></a></li>
+ <li><a href="#take"><b>Adding addresses directly to address book</b></a></li>
+ <li><a href="#header"><b>Displaying full headers</b></a></li>
+ <li><a href="#print"><b>Printing</b></a></li>
+ <li><a href="#jump"><b>Jump Command (optional)</b></a></li>
+ <li><a href="#note"><b>Differences from Pine and PC-Pine</b></a></li>
+</ul>
+
+<a name="navigate"><b>Navigating your messages</b></a><p>
+In the far left column of the Message View screen, there are four navigation options: <b>Previous</b>, <b>First</b>, <b>Next</b>,
+<b>Last</b>. Click:
+<table border=0 cellpadding=4 style="margin-left:24">
+ <tr>
+ <td><img src="../../images/but_rnd_prev3.gif" alt="Previous"></td>
+ <td>to go to the previous message in this folder</td>
+ </tr>
+ <tr>
+ <td><img src="../../images/but_rnd_first3.gif" alt="First"></td>
+ <td>to go to the first message in this folder</td>
+ </tr>
+ <tr>
+ <td><img src="../../images/but_rnd_next3.gif" alt="Next"></td>
+ <td>to go the next message in this folder</td>
+ </tr>
+ <tr>
+ <td><img src="../../images/but_rnd_last3.gif" alt="Last"></td>
+ <td> to go to the last message in this folder</td>
+ </tr>
+</table>
+<p>
+
+With most broswsers and the usual settings, you also have the option of
+using keyboard controls for some of your navigation. You may, however,
+need to first click in your Alpine window to make sure that your system
+knows which screen is active.
+
+<p>The keyboard controls are:
+<table border=0 cellspacing=12 cellpadding=3>
+<tr><td text align="center">n</td>
+ <td>next message</td></tr>
+<tr><td text align="center">p</td>
+ <td>previous message</td></tr>
+<tr><td text align="center">i</td>
+ <td>return to message index</td></tr>
+<tr><td text align="center">c</td>
+ <td>compose new message</td></tr>
+<tr><td text align="center">l</td>
+ <td>list folder</td></tr>
+<tr><td text align="center">d</td>
+ <td>flag message as deleted</td></tr>
+<tr><td text align="center">u</td>
+ <td>unflag message as deleted</td></tr>
+<tr><td text align="center">a</td>
+ <td>go to address book</td></tr>
+<tr><td text align="center">r</td>
+ <td>reply to current message</td></tr>
+<tr><td text align="center">f</td>
+ <td>forward current message</td></tr>
+</table>
+
+<p>
+<a name="attach"><b>Viewing attachments</b></a><p>
+When a message includes an attachment, you will see highlighted links
+under the heading "Parts/Attachments." Click either "View" or the link
+description to see the attachment. Click "Save" to
+download the attachment.
+
+<p>The attachment links also allow you to read messages delivered as HTML.
+Simply view the second attachment to display the message as intended.
+
+<p>If you cannot view your attachments, go to
+<b>Configuration</b>
+ and click the Message View tab. Make sure "Enable Attachments View" is marked.</p>
+<p>
+
+<a name="reply"><b>Replying to the message</b></a><p>
+Use <input type=submit value="Reply"> to respond to the author of the message and/or to the
+other recipients who were sent the original message.
+
+<p>To respond to all original recipients, check "<input type=checkbox checked> To All" and then click
+<input type=submit value="Reply">.</p>
+
+<p>By default, "Include text" will be checked. If you do not want to
+include the previous text in your reply, remove that checkmark before you
+click <input type=submit value="Reply">.</p>
+
+
+<a name="forward"><b>Forwarding the message</b></a><p>
+Use <input type=submit value="Forward"> to send the message you are
+viewing to someone else.
+You will need to supply the email address of the new recipient on the
+subsequent Message Compose screen.</p>
+
+
+
+<a name="save"><b>Saving the message to another folder</b></a><p>
+
+Save the message you are viewing to another folder by choosing from
+the options in the dropdown menu next to the
+<input type=submit value="Save"> button. Among the Save options,
+you'll find
+
+<ul>
+ <li> The name of the default folder to save to, typically <font face="courier">saved-messages</font>.
+ <li> Several, typically six, names of folders you have most recently saved messages to
+ <li> An option to type in directly the name of the folder you wish to save to (either a new folder you wish to create, or one
+already containing messages)
+ <li> An option to choose the folder from the list of all your folders
+</ul>
+
+If Alpine does not act on your choice immediately, click the <input type=submit value="Save">
+button to initiate saving. Once saved, the chosen messages will be marked for deletion.
+
+
+<p>
+<a name="take"><b>Adding addresses directly to address book</b></a></p>
+Click <input type=submit value="Take"> on the top panel of
+your screen to go to a listing of all the email addresses contained within
+this message. Click next to any or all of those addresses to add them
+to your addressbook.<p>
+
+<a name="header"><b>Displaying full headers</b></a><p>
+Click the <img src="../../images/hdr.gif" alt="display full headers"> icon
+near the top right of your screen to view your full headers. The full
+headers contain information about the path taken by this email message. To
+return to digested headers, click <img src="../../images/hdrnon.gif" alt="display digested headers">.<p>
+
+
+<a name="print"><b>Printing</b></a><p>
+Click the <img src="../../images/printer2.gif" alt="print"> icon near the top
+right
+of your screen to print your message.
+
+<p>If you lose the right edge of your message, you may want to decrease
+your font size:
+
+<ol>
+<li>Click <b>Configure</b>
+<li>Click the "General" tab on the subsequent screen
+<li>Choose "small font" or "smallest font" from the drop down box next to
+<b>Font Size?</b>
+</ol>
+
+
+<p><a name="jump"><b>Jump Command (optional)</b></a><p>
+
+Depending on your configuration, you may also see a text box next to a
+<input type=submit value="Jump"> button on the left side of the page. Enter a
+message number into the text box and click the button to have that message
+number's text displayed.
+
+
+<p><a name="note"><b>Differences from Pine and PC-Pine</b></a><p>
+
+<p>Alpine is designed primarily for easy access to email. It is not
+intended to replace any other heavy duty email programs. Accordingly, it
+is missing some of the more advanced features you will find in Pine and
+PC-Pine. As development continues, features will be added as long as they
+do not make a large impact on Alpine's speed or efficiency.
+
+<p> Some of the features you will not currently find in Alpine Message
+View:
+<ul>
+<li>Change message status (available on Message List page)
+<li>Bounce
+<li>Go directly to a specific folder (may be added soon)
+<li>Where is (instead, use your browser's "find" command)
+<li>Export message
+</ul>
+</form>
+
diff --git a/web/cgi/alpine/1.0/help/wpsys.jpeg b/web/cgi/alpine/1.0/help/wpsys.jpeg
new file mode 100644
index 00000000..ba601d85
--- /dev/null
+++ b/web/cgi/alpine/1.0/help/wpsys.jpeg
Binary files differ
diff --git a/web/cgi/alpine/1.0/helpbody.tcl b/web/cgi/alpine/1.0/helpbody.tcl
new file mode 100755
index 00000000..1adbf1e3
--- /dev/null
+++ b/web/cgi/alpine/1.0/helpbody.tcl
@@ -0,0 +1,200 @@
+#!./tclsh
+# $Id: helpbody.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# helpbody.tcl
+#
+# Purpose: CGI script to generate html help text for Web Alpine
+
+# Input:
+set help_vars {
+ {topic "" about}
+ {topicclass "" ""}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+
+set sections {
+ {about 0 "About Web Alpine" about}
+ {index 0 "Message List" index}
+ {view 0 "Message View" view}
+ {take 1 "Take Address" takeaddr}
+ {takeedit 1 "Take Address Edit" takeedit}
+ {folders 0 "Folder List" folders}
+ {foldiradd 1 "New Folder or Directory" foldiradd}
+ {compose 0 Compose compose}
+ {addrbrowse 1 "Address Browse" addrbrowse}
+ {attach 1 "Attach" attach}
+ {resume 0 "Resume" resume}
+ {addrbook 0 "Address Books" addrbook}
+ {addredit 1 "Edit Entry" addredit}
+}
+
+set hidden_sections {
+ {filtconf 0 "Filter Configuration" filtconf}
+ {filtedit 0 "Filter Editor" filtedit}
+}
+
+proc WPHelpTopic {topic} {
+ source genvars.tcl
+ foreach g [list general_vars msglist_vars composer_vars folder_vars address_vars msgview_vars rule_vars] {
+ foreach m [set $g] {
+ if {[string compare $topic [lindex $m 1]] == 0} {
+ return [lindex $m 2]
+ }
+ }
+ }
+
+ return $topic
+}
+
+WPEval $help_vars {
+ foreach s $sections {
+ if {[string compare $topic [lindex $s 0]] == 0} {
+ set helpfile [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) help [lindex $s 3]]
+ }
+ }
+
+ if {![info exists helpfile]} {
+ foreach s $hidden_sections {
+ if {[string compare $topic [lindex $s 0]] == 0} {
+ set helpfile [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) help [lindex $s 3]]
+ }
+ }
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Web Alpine Help"
+ WPStyleSheets
+ }
+
+ cgi_body_args
+ cgi_body BGCOLOR=white "style=margin:16;margin-right:40;margin-bottom:64" {
+ if {[info exists helpfile]} {
+ if {[file exists ${helpfile}.tcl]} {
+ source ${helpfile}.tcl
+ } elseif {[file exists ${helpfile}.html]} {
+
+ cgi_puts "<form action=\"[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl\" target=\"noop\" method=get>"
+ cgi_puts {<input name="page" value="noop" type=hidden notab>}
+
+ if {[catch {open ${helpfile}.html r} fid]} {
+ unset helpfile
+ } else {
+ cgi_put [read $fid]
+ close $fid
+ }
+ } else {
+ unset helpfile
+ }
+
+ cgi_puts "</form>"
+ }
+
+ if {[info exists helpfile] == 0} {
+ if {[string length $topicclass] && [catch {WPCmd PEInfo help $topic $topicclass} helptext] == 0 && [llength $helptext]} {
+ set shownvarname [WPHelpTopic $topic]
+
+ # rough once-over to digest it for suitable display in the alpine context
+ set show 1
+ foreach line $helptext {
+ switch -regexp -- $line {
+ {^<[/]?[hH][tT][mM][lL]>.*} -
+ {^<[/]?[tT][iI][tT][lL][eE]>.*} -
+ {^<[/]?[bB][oO][dD][yY]>.*} {
+ continue
+ }
+ {^<!--chtml if pinemode=.*} {
+ if {[regexp {^<!--chtml if pinemode=["]([^"]*).*} $line dummy mode]
+ && [string compare $mode web] == 0} {
+ set show 1
+ } else {
+ set show 0
+ }
+ }
+ {^<!--chtml else[ ]*-->} {
+ set show [expr {$show == 0}]
+ }
+ {^<!--chtml endif-->} {
+ set show 1
+ }
+ default {
+ if {$show} {
+ set urls {}
+ while {[regexp {<[aA] ([^>]*)>} $line urlargs]} {
+ lappend urls $urlargs
+ if {[regsub {(.*)<[aA] ([^>]*)>(.*)} $line "\\1___URL___\\3" line] == 0} {
+ break
+ }
+ }
+
+ # special locally expanded markup
+ set exp {<!--[#]echo var=([^ ]*)-->}
+ while {[regexp $exp $line dummy locexp]} {
+ set locexp [string trim $locexp {"}]
+ switch -regex $locexp {
+ ^FEAT_* {
+ set locexp [WPHelpTopic [string range $locexp 5 end]]
+ }
+ ^VAR_* {
+ set locexp [WPHelpTopic [string range $locexp 4 end]]
+ }
+ }
+
+ if {[regsub $exp $line $locexp line] == 0} {
+ break
+ }
+ }
+
+ if {[info exists shownvarname]} {
+ regsub -all -nocase $topic $line $shownvarname line
+ }
+
+ foreach url $urls {
+ if {[regsub {.*[Hh][Rr][Ee][Ff]=[\"]?([^ \">]*)[\"]?.*} $url {\1} href]} {
+ set newurl "<a href=helpbody.tcl?topic=$href\\&topicclass=plain>"
+ } else {
+ set newurl ""
+ }
+ if {[regsub {(.*)___URL___(.*)} $line "\\1$newurl\\2" line] == 0} {
+ break
+ }
+ }
+
+ cgi_puts $line
+ }
+ }
+ }
+ }
+ } else {
+ cgi_center {
+ cgi_put [cgi_img [WPimg dot2] height=50]
+ cgi_put [cgi_font class=notice "Help text for [cgi_italic $topic] doesn't exist yet, but when it does it'll appear here."]
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/helpindex.tcl b/web/cgi/alpine/1.0/helpindex.tcl
new file mode 100755
index 00000000..235e619d
--- /dev/null
+++ b/web/cgi/alpine/1.0/helpindex.tcl
@@ -0,0 +1,102 @@
+#!./tclsh
+# $Id: helpindex.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+#
+# helpindx.tcl
+#
+# Purpose: CGI script to generate html help text for Alpine
+#
+# Input:
+
+set help_vars {
+ {topic "" about}
+ {index "" ""}
+ {oncancel "" main}
+ {params "" ""}
+}
+
+#
+#
+# Output:
+#
+# HTML/Javascript/CSS help text for Alpine
+#
+
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+
+set help_menu {
+}
+
+set sections {
+ {about 0 "About Alpine" about}
+ {index 0 "Message List" index}
+ {view 0 "Message View" view}
+ {take 1 "Take Address" takeaddr}
+ {takeedit 1 "Take Address Edit" takeedit}
+ {folders 0 "Folder List" folders}
+ {foldiradd 1 "New Folder or Directory" foldiradd}
+ {compose 0 Compose compose}
+ {addrbrowse 1 "Address Browse" addrbrowse}
+ {attach 1 "Attach" attach}
+ {resume 0 "Resume" resume}
+ {addrbook 0 "Address Books" addrbook}
+ {addredit 1 "Edit Entry" addredit}
+}
+
+
+WPEval $help_vars {
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Web Alpine Help"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ lappend help_menu [list {} [list {cgi_put [cgi_nl][cgi_url [cgi_bold "Exit Help"] wp.tcl?page=${oncancel}&cid=[WPCmd PEInfo key]&x=[clock seconds] target=_top class=navbar]}]]
+ lappend help_menu {}
+
+ if {[string compare [string tolower $index] full] == 0} {
+ foreach s $sections {
+ set prefix ""
+ if {[lindex $s 1]} {
+ for {set j 0} {$j < [lindex $s 1]} {incr j} {
+ append prefix [cgi_nbspace][cgi_nbspace]
+ }
+
+ append prefix {- }
+ }
+
+ if {[string compare $topic [lindex $s 0]] == 0} {
+ lappend help_menu [list {} [list "cgi_puts \"<table width=\\\"100%\\\" cellspacing=0 cellpadding=0><tr><td class=navbar bgcolor=#000000>${prefix}[lindex $s 2]</td></tr></table>\""]]
+ } else {
+ lappend help_menu [list {} [list "cgi_puts \"${prefix}\[cgi_url \"[lindex $s 2]\" \"help.tcl?topic=[lindex $s 0]&oncancel=[WPPercentQuote $oncancel]&index=${index}\" class=navbar target=body\]\""]]
+ }
+ }
+ } else {
+ lappend help_menu [list {} [list "cgi_puts \"\[cgi_url \"About Web Alpine\" \"helpbody.tcl?topic=about&oncancel=[WPPercentQuote $oncancel]\" class=navbar target=bodtext\]\""]]
+ if {[string compare [string tolower $index] none]} {
+ lappend help_menu [list {} [list "cgi_puts \"\[cgi_url \"Other Topics\" \"helpindex.tcl?topic=${topic}&index=full&oncancel=[WPPercentQuote $oncancel]\" class=navbar target=bodindx\]\""]]
+ }
+ }
+
+ WPTFCommandMenu help_menu {}
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/index.tcl b/web/cgi/alpine/1.0/index.tcl
new file mode 100755
index 00000000..6a0fa543
--- /dev/null
+++ b/web/cgi/alpine/1.0/index.tcl
@@ -0,0 +1,1972 @@
+# $Id: index.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# index.tcl
+#
+# Purpose: CGI script snippet to generate html output associated
+# with the WebPine message list (index) body frame
+#
+# Input:
+set index_vars {
+ {sort {} date}
+ {rev {} 0}
+ {top {} 0}
+ {uid {} 0}
+ {width {} $_wp(width)}
+ {op {} none}
+ {bod_next {} 0}
+ {bod_last {} 0}
+ {bod_first {} 0}
+ {bod_prev {} 0}
+ {growpage {} 0}
+ {shrinkpage {} 0}
+ {grownum {} 0}
+ {goto {} ""}
+ {gonum {} ""}
+ {select {} ""}
+ {selectop {} ""}
+ {doselect {} 0}
+ {auths {} 0}
+ {user {} ""}
+ {pass {} ""}
+ {create {} 0}
+ {save {} ""}
+ {browse {} ""}
+ {f_name {} ""}
+ {f_colid {} ""}
+ {savecancel {} ""}
+ {promptsave {} ""}
+ {setflag {} ""}
+ {flags {} ""}
+ {repall {} 0}
+ {reptext {} 0}
+ {sortrev {} 0}
+ {sortto {} 0}
+ {sortfrom {} 0}
+ {sortdate {} 0}
+ {sortsize {} 0}
+ {sortsubject {} 0}
+ {sortorderedsubj {} 0}
+ {sortthread {} 0}
+ {queryexpunge {} 0}
+ {expunge {} 0}
+ {cid {} 0}
+ {folders {} 0}
+ {compose {} 0}
+ {submitted {} 0}
+ {zoom {} ""}
+ {mark {} ""}
+ {unmark {} ""}
+ {search {} ""}
+ {aggon {} ""}
+ {aggoff {} ""}
+ {hdron {} ""}
+ {hdroff {} ""}
+ {split {} 0}
+ {spamit {} ""}
+ {reload}
+}
+
+# Output:
+#
+
+# FOR TESTING VARIOUS LAYOUTS AND SUCH
+set do_status_icons 1
+
+set selectverb Search
+
+set growmax 50
+set growverb Increase
+set shrinkverb Decrease
+
+# various color defs
+set color(sortfg) "#FFFFFF"
+set color(sortbg) "#BFBFBF"
+set color(line1) "#EEEEEE"
+set color(line2) "#FFFFFF"
+set color(greyout) "#888888"
+set sb_width 13
+set sb_dir bar
+
+set aggbar 1
+set sortbar 2
+
+set gonum ""
+
+if {[catch {WPCmd PEInfo indexlines} ppg] || $ppg <= 0} {
+ set ppg $_wp(indexlines)
+}
+
+# make sure any caching doesn't screw this setting
+catch {WPCmd PEInfo set wp_spec_script fr_index.tcl}
+
+proc statmsg {s} {
+ global newmail
+
+ lappend newmail [list $s]
+}
+
+proc selectresponse {type num prevnum zoomref topref uidref} {
+ upvar $zoomref zoomed
+ upvar $topref top
+ upvar $uidref uid
+
+ if {$num == 0} {
+ if {$prevnum} {
+ set statmsg "$type search found no additional messages. Set of marked messages unchanged"
+ } else {
+ set statmsg "$type search found no matching messages"
+ }
+ } elseif {$num > 0} {
+ if {$prevnum} {
+ set statmsg "$type search found $num messages. [expr {$num + $prevnum}] total messages now marked."
+ } else {
+ set statmsg "$type search found and marked $num messages"
+ }
+
+ if {!$zoomed} {
+ # force reframing
+ set top "0+0"
+ set uid 0
+ }
+ } else {
+ set statmsg "[set num [expr abs($num)]] messages Unmarked."
+ if {$prevnum > $num} {
+ append statmsg " [expr {$prevnum - $num}] remain Marked."
+ }
+ }
+
+ # update zoomed count or zoom if necessary
+ if {$zoomed} {
+ set zoomed [WPCmd PEMailbox selected]
+ } elseif {[WPCmd PEInfo feature auto-zoom-after-select] && [WPCmd PEMailbox selected]} {
+ set zoomed [WPCmd PEMailbox zoom 1]
+ #append statmsg ". Those not matching excluded from view."
+ }
+
+ statmsg $statmsg
+ catch {WPCmd PEInfo unset wp_def_search_text}
+}
+
+
+proc sortname {name {current 0}} {
+ global rev me
+
+ switch -- $name {
+ Number { set newname "#" }
+ OrderedSubj { set newname "Ordered Subject" }
+ Arrival { set newname Arv }
+ Status { set newname "&nbsp;" }
+ default { set newname $name }
+ }
+
+ if {$current} {
+ if {$rev > 0} {
+ set text [cgi_imglink increas]
+ set args rev=0
+ } else {
+ set text [cgi_imglink decreas]
+ set args rev=1
+ }
+
+ append newname [cgi_url $text "wp.tcl?page=index&sortrev=1" "title=Reverse $newname ordering" target=body]
+ }
+
+ return $newname
+}
+
+proc lineclass {linenum} {
+ if {$linenum % 2} {
+ return i0
+ } else {
+ return i1
+ }
+}
+
+proc uid_framed {u mv} {
+ foreach m $mv {
+ if {$u == [lindex $m 1]} {
+ return 1
+ }
+ }
+ return 0
+}
+
+proc index_quote {text} {
+ set text [cgi_quote_html $text]
+ regsub -all { } $text {\&nbsp;} text
+
+ return $text
+}
+
+proc index_part_color {text color} {
+ if {[llength $color] == 2} {
+ set fg [lindex $color 0]
+ set bg [lindex $color 1]
+ return [cgi_span "style=color: $fg; background-color: $bg" $text]
+ } else {
+ return $text
+ }
+}
+
+## read vars
+foreach item $index_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+# check for new mail first since counts
+# and sort order might change...
+if {[catch {WPNewMail $reload ""} newmail]} {
+ error [list _action "new mail" $newmail]
+}
+
+set cid [WPCmd PEInfo key]
+
+set messagecount [WPCmd PEMailbox messagecount]
+set delcount [WPCmd PEMailbox flagcount deleted]
+set flagcmd [WPCmd PEInfo feature enable-flag-cmd]
+set aggops [WPCmd PEInfo feature enable-aggregate-command-set]
+set aggtabstate [WPCmd PEInfo aggtabstate]
+set zoomed [WPCmd PEMailbox zoom]
+
+set indexheight [WPIndexLineHeight]
+
+if {$split != "0"} {
+ set vtarget fr_bottom
+} else {
+ set vtarget spec
+}
+
+# perform any requested actions
+if {$queryexpunge == 1 || [string compare [string tolower $queryexpunge] expunge] == 0} {
+ if {$delcount > 0} {
+ set fn [WPCmd PEMailbox mailboxname]
+ set oncancel index
+ # delcount, messagecount set above
+ source [WPTFScript expunge]
+ set nopage 1
+ } else {
+ statmsg "No deleted messages to Expunge"
+ }
+} elseif {$expunge == 1
+ || [string compare [string tolower $expunge] expunge] == 0
+ || [string compare [string range [string tolower $expunge] 0 10] "yes, remove"] == 0} {
+ if {$delcount > 0} {
+ if {$delcount < $messagecount
+ || ($delcount == $messagecount
+ && 0 == [catch {cgi_import emptyit}]
+ && 1 == $emptyit)} {
+ set setflags [WPCmd PEMessage $top status]
+ if {[lsearch $setflags "Deleted"] != -1} {
+ set curmsg [WPCmd PEMessage $top number]
+ set nextmsg [WPCmd PEMailbox next $curmsg]
+ set done 0
+ while {$nextmsg > $curmsg && $done == 0} {
+ set nextuid [WPCmd PEMailbox uid $nextmsg]
+ set setflags [WPCmd PEMessage $nextuid status]
+ if {[lsearch $setflags "Deleted"] == -1} {
+ set uid $nextuid
+ set top $uid
+ set done 1
+ } else {
+ set curmsg $nextmsg
+ set nextmsg [WPCmd PEMailbox next $curmsg]
+ }
+ }
+
+ if {$done == 0} {
+ set curmsg [WPCmd PEMessage $top number]
+ set prevmsg [WPCmd PEMailbox next $curmsg -1]
+ while {$prevmsg < $curmsg && $done == 0} {
+ set prevuid [WPCmd PEMailbox uid $prevmsg]
+ set setflags [WPCmd PEMessage $prevuid status]
+ if {[lsearch $setflags "Deleted"] == -1} {
+ set uid $prevuid
+ set top $uid
+ set done 1
+ } else {
+ set curmsg $prevmsg
+ set prevmsg [WPCmd PEMailbox next $curmsg -1]
+ }
+ }
+ }
+ }
+
+ if {[catch {WPCmd PEMailbox expunge} blasted] || [string length $blasted]} {
+ statmsg "Expunge problem: $blasted"
+ } else {
+ set delcount 0
+ set messagecount [WPCmd PEMailbox messagecount]
+ if {$messagecount < 1} {
+ set uid 0
+ set top 0
+ set first 1
+ if {$zoomed} {
+ WPCmd PEMailbox zoom 0
+ }
+ } else {
+ if {$top > 0 && ([catch {WPCmd PEMessage $top number} n] || $n <= 0)} {
+ # previous top message is gone, figure new one below
+ set top 0
+ }
+
+ if {$uid > 0 && ([catch {WPCmd PEMessage $uid number} n] || $n <= 0)} {
+ # recently viewed message is gone
+ set uid 0
+ }
+ }
+ }
+ } else {
+ statmsg "<div style=\"width: 75%; background-color: pink; border: 1px solid red; padding: 0 8\"><span style=\"font-size: 12pt; color: white; background-color: red; padding: 0 5\">No Messages Expunged!</span><div style=\"font-weight: normal; padding: 4 8\">To prevent unintended deletions, you must check the box on the Expunge Confirmation page to indicate that you acknowledge expunge will leave the folder <b>[WPCmd PEMailbox mailboxname]</b> empty.</div></div>"
+ }
+ } else {
+ statmsg "No deleted messages to Expunge"
+ }
+} elseif {$growpage == 1 || [string compare $growverb $growpage] == 0} {
+ if {$grownum <= 0 || $grownum > $growmax} {
+ set grownum 5
+ }
+
+ incr ppg $grownum
+ catch {WPCmd PEInfo set grownum $grownum}
+ WPCmd PEInfo indexlines $ppg
+} elseif {$shrinkpage == 1 || [string compare $shrinkverb $shrinkpage] == 0} {
+ if {$grownum <= 0 || $grownum > $growmax} {
+ set grownum 5
+ }
+
+ incr ppg -$grownum
+ catch {WPCmd PEInfo set grownum $grownum}
+
+ if {$ppg < 1} {
+ set ppg 1
+ }
+
+ WPCmd PEInfo indexlines $ppg
+} elseif {$bod_prev} {
+ set top "$top-$ppg"
+ set uid 0
+} elseif {$bod_first} {
+ set first 1
+ if {$messagecount > 0} {
+ set top [WPCmd PEMailbox uid $first]
+ }
+
+ set uid 0
+} elseif {$bod_next} {
+ set top "$top $ppg"
+ set uid 0
+} elseif {$bod_last} {
+ if {$messagecount > 0} {
+ if {$zoomed} {
+ if {$zoomed > $ppg} {
+ if {[catch {WPCmd PEMailbox uid [WPCmd PEMailbox next [expr {[WPCmd PEMailbox last] - [expr {${ppg} - 1}]}]]} top]} {
+ set first [WPCmd PEMailbox first]
+ set top [WPCmd PEMailbox uid $first]
+ } else {
+ set first [WPCmd PEMessage $top number]
+ }
+ }
+ } else {
+ if {[set first [expr {$messagecount - $ppg + 1}]] < 0} {
+ set first 1
+ }
+
+ set top [WPCmd PEMailbox uid $first]
+ }
+ }
+
+ set uid 0
+} elseif {[string length $goto]} {
+ if {[regexp {^([0-9]+)$} $gonum n]} {
+ if {$n > 0 && $n <= [WPCmd PEMailbox last]} {
+ set first $n
+ set uid [WPCmd PEMailbox uid $first]
+ set top $uid
+ set gonum ""
+ } else {
+ statmsg "Jump value $gonum out of range"
+ set goto ""
+ }
+ } else {
+ if {[string length $gonum]} {
+ statmsg "Unrecognized Jump value: $gonum"
+ } else {
+ statmsg "Enter a message number, then click 'Jump'"
+ }
+ }
+} elseif {$promptsave == 1 || [string compare [string tolower $promptsave] save] == 0} {
+ if {[WPCmd PEMailbox selected] == 0} {
+ statmsg "Place checkmarks in the box next to desired messages, then click 'Save'"
+ } else {
+ set uid 0
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_promptsave.tcl]
+ set nopage 1
+ }
+} elseif {$savecancel == 1 || [string compare cancel [string tolower $savecancel]] == 0} {
+ catch {WPCmd PEInfo unset wp_index_script}
+ lappend newmail [list "Save cancelled. Folder not created."]
+} elseif {[string length $browse] && [string compare $browse Browse] == 0} {
+ set uid 0
+ _cgi_set_uservar onselect main
+ _cgi_set_uservar oncancel main
+ _cgi_set_uservar controls 0
+ source [WPTFScript savebrowse]
+ set nopage 1
+} elseif {([string length $save] && ([string compare [string trim $save] OK] == 0 || [string compare [string trim $save] Save] == 0)) || [string compare save [string tolower $op]] == 0} {
+ if {[WPCmd PEMailbox selected] == 0} {
+ statmsg "Place checkmarks in the box next to desired messages, then click 'Save'"
+ } elseif {[catch {cgi_import cancel}] == 0} {
+ statmsg "Save cancelled"
+ } else {
+ set f_name [string trim $f_name]
+ if {[string length $f_name]} {
+ if {[regexp {^([0-9]+)$} $f_colid]} {
+ switch -exact -- $f_name {
+ __folder__prompt__ {
+ set uid 0
+ _cgi_set_uservar onselect {index save=OK}
+ _cgi_set_uservar oncancel index
+ _cgi_set_uservar target body
+ _cgi_set_uservar controls 0
+ source [WPTFScript savecreate]
+ set nopage 1
+ }
+ __folder__list__ {
+ set uid 0
+ _cgi_set_uservar onselect {index save=OK}
+ _cgi_set_uservar oncancel index
+ _cgi_set_uservar target body
+ _cgi_set_uservar controls 0
+ source [WPTFScript savebrowse]
+ set nopage 1
+ }
+ default {
+ if {$auths} {
+ catch {WPCmd PESession nocred $f_colid $f_name}
+ if {[catch {WPCmd PESession creds $f_colid $f_name $user $pass} result]} {
+ lappend newmail ["Cannot set credentials ($f_colid) $f_name: result"]
+ }
+ }
+
+ if {[catch {WPCmd PEFolder exists $f_colid $f_name} reason]} {
+ if {[string compare BADPASSWD [string range $reason 0 8]] == 0} {
+ set oncancel "index.tcl&savecancel=1"
+ set conftext "Create Folder '$f_name'?"
+ lappend params [list page index]
+ lappend params [list save Save]
+ lappend params [list f_name $f_name]
+ lappend params [list f_colid $f_colid]
+ source [WPTFScript auth]
+ set nopage 1
+ } else {
+ lappend newmail [list "Existance test failed: $reason"]
+ }
+ } elseif {$reason == 0} {
+ if {$create == 1 || [string compare create [string tolower $create]] == 0} {
+ if {[catch {WPCmd PEFolder create $f_colid $f_name} reason]} {
+ lappend newmail [list "Create failed: $reason"]
+ } else {
+ set dosave 1
+ }
+ } else {
+ set qstate [list $f_name]
+ set params [list [list page index]]
+ lappend params [list save OK]
+ lappend params [list f_name $f_name]
+ lappend params [list f_colid $f_colid]
+ lappend qstate $params
+
+ if {[catch {WPCmd PEInfo set querycreate_state $qstate}] == 0} {
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_querycreate.tcl]
+ set nopage 1
+ } else {
+ statmsg "Error saving creation state"
+ }
+ }
+ } else {
+ set dosave 1
+ }
+
+ if {[info exists dosave]} {
+ if {[catch {WPCmd PEMailbox apply save $f_colid $f_name} reason]} {
+ error [list _action "Cannot save to $f_name in $f_colid" $reason]
+ } else {
+ set statmsg "Saved $reason message[WPplural $reason] to $f_name"
+
+ set savedef [WPTFSaveDefault $uid]
+ if {[lindex $savedef 0] == $f_colid} {
+ WPTFAddSaveCache $f_name
+ }
+
+ if {[WPCmd PEInfo feature auto-unselect-after-apply]} {
+ if {[catch {WPCmd PEMailbox select none} result]} {
+ set statmsg "Cannot clear all message marks: $result"
+ } else {
+ if {$result == 0} {
+ set statmsg "No Marked messages to Unmark"
+ } else {
+ append statmsg " and unmarked"
+ }
+ }
+ }
+
+ statmsg $statmsg
+ }
+ }
+ }
+ }
+ } else {
+ statmsg "Unrecognized collection id"
+ }
+ } else {
+ statmsg "Must provide a folder name to Save to"
+ }
+ }
+} elseif {[string compare Set $setflag] == 0 || [string compare Delete $setflag] == 0 || [string compare Undelete $setflag] == 0} {
+ switch -- $setflag {
+ Delete {
+ set flagverb Delete
+ set flags delete
+ }
+ Undelete {
+ set flagverb Undelete
+ set flags undeleted
+ }
+ default {
+ set flagverb Set
+ }
+ }
+
+ if {[WPCmd PEMailbox selected] == 0} {
+ statmsg "Place checkmarks in the box next to desired messages, then click '$flagverb'"
+ } else {
+ switch -- $flags {
+ delete {
+ set flagverb "for deletion"
+ if {[catch {WPCmd PEMailbox apply delete} reason]} {
+ set statmsg "Problem deleting: $reason"
+ }
+ }
+ undeleted {
+ set flagverb Undeleted
+ if {[catch {WPCmd PEMailbox apply undelete} reason]} {
+ set statmsg "Problem undeleting: $reason"
+ }
+ }
+ new {
+ set flagverb New
+ if {[catch {WPCmd PEMailbox apply flag ton new} reason]} {
+ set statmsg "Problem setting New flag: $reason"
+ }
+ }
+ read {
+ set flagverb Read
+ if {[catch {WPCmd PEMailbox apply flag not new} reason]} {
+ set statmsg "Problem Unsetting New flag: $reason"
+ }
+ }
+ answered {
+ set flagverb Answered
+ if {[catch {WPCmd PEMailbox apply flag ton ans} reason]} {
+ set statmsg "Problem setting Answered flag: $reason"
+ }
+ }
+ unanswered {
+ set flagverb "Not Answered"
+ if {[catch {WPCmd PEMailbox apply flag not ans} reason]} {
+ set statmsg "Problem Unsetting Answered flag: $reason"
+ }
+ }
+ important {
+ set flagverb "Important"
+ if {[catch {WPCmd PEMailbox apply flag ton imp} reason]} {
+ set statmsg "Problem setting Important flag: $reason"
+ }
+ }
+ unimportant {
+ set flagverb "Not Important"
+ if {[catch {WPCmd PEMailbox apply flag not imp} reason]} {
+ set statmsg "Problem Unsetting Important flag: $reason"
+ }
+ }
+ default {
+ statmsg "Unknown flag set request: $flags"
+ }
+ }
+
+ if {![info exists statmsg]} {
+ set statmsg "$reason message[WPplural $reason] flagged $flagverb"
+ if {[WPCmd PEInfo feature auto-unselect-after-apply]} {
+ if {[catch {WPCmd PEMailbox select none} result]} {
+ set statmsg "Cannot clear all message marks: $result"
+ } else {
+ if {$result == 0} {
+ set statmsg "No Selected messages to Unmark"
+ } else {
+ append statmsg " and unmarked"
+ }
+ }
+ }
+ }
+
+ statmsg $statmsg
+ }
+} elseif {[string length $mark]} {
+ if {[string compare mark [string tolower [lindex $mark 0]]] == 0} {
+ if {[catch {WPCmd PEMailbox select all} result]} {
+ statmsg "Cannot mark all messages: $result"
+ } else {
+ set zm ""
+ if {$zoomed} {
+ set zoomed [WPCmd PEMailbox zoom 0]
+ set zm ". Message List now displaying all messages."
+ }
+ statmsg "All messages in folder '[WPCmd PEMailbox mailboxname]' marked$zm"
+ }
+ } elseif {[string compare $mark 1] == 0} {
+ if {$zoomed} {
+ statmsg "Messages on page already marked"
+ } elseif {$messagecount > 0} {
+ set p [split $uidpage ","]
+ set s [WPCmd PEMessage [lindex $p 0] number]
+ set e [WPCmd PEMessage [lindex $p end] number]
+
+ if {[catch {WPCmd PEMailbox select broad num $s $e} result]} {
+ statmsg "Cannot mark messages: $result"
+ } else {
+ statmsg "Marked all messages [cgi_underline "on this page"]"
+ }
+ }
+ }
+} elseif {[string length $unmark]} {
+ if {[string compare unmark [lindex [string tolower $unmark] 0]] == 0} {
+ if {[catch {WPCmd PEMailbox select none} result]} {
+ statmsg "Cannot clear all message marks: $result"
+ } else {
+ if {$result == 0} {
+ statmsg "No marked messages to Unmark"
+ } else {
+ if {[regexp {[0-9]+} $result] && $result == $messagecount} {
+ set result All
+ }
+
+ statmsg "Unmarked $result Messages"
+ }
+ }
+ } elseif {[string compare $unmark 1] == 0} {
+ if {[catch {WPCmd PEMailbox select clear [split $uidpage ","]} result]} {
+ statmsg "Cannot clear message marks: $result"
+ } else {
+ if {$result == 0} {
+ statmsg "No marked messages to Unmark"
+ } else {
+ statmsg "Unmarked all messages [cgi_underline "on this page"]"
+ }
+ }
+ }
+} elseif {[string length $select] && [string compare $select $selectverb] == 0} {
+ switch -- $selectop {
+ mark {
+ if {[catch {WPCmd PEMailbox select all} result]} {
+ statmsg "Cannot mark all messages: $result"
+ } elseif {0} {
+ statmsg "All messages marked"
+ }
+ }
+ clear {
+ if {[catch {WPCmd PEMailbox select none} result]} {
+ statmsg "Cannot clear all message marks: $result"
+ } elseif {0} {
+ if {$result == 0} {
+ statmsg "No marked messages to Unmark"
+ } else {
+ statmsg "Unmarked $result messages"
+ }
+ }
+ }
+ text {
+ set uid 0
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_seltext.tcl]
+ set nopage 1
+ }
+ date {
+ set uid 0
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_seldate.tcl]
+ set nopage 1
+ }
+ stat {
+ set uid 0
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_selstat.tcl]
+ set nopage 1
+ }
+ zoom {
+ if {[WPCmd PEMailbox selected] == 0} {
+ statmsg "No marked messages to Zoom on"
+ } elseif {$zoomed == 0} {
+ set zoomed [WPCmd PEMailbox zoom 1]
+ }
+ }
+ unzoom {
+ set zoomed [WPCmd PEMailbox zoom 0]
+ }
+ null {
+ }
+ default {
+ set uid 0
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) fr_select.tcl]
+ set nopage 1
+ }
+ }
+} elseif {$zoom != ""} {
+ set z 0
+ if {[WPCmd PEMailbox selected] == 0} {
+ if {[string compare [string tolower [string range $zoom 0 7]] "show all"]} {
+ statmsg "No marked messages to Zoom in on!"
+ }
+ } elseif {$zoomed == 0} {
+ set z 1
+ }
+
+ set zoomed [WPCmd PEMailbox zoom $z]
+} elseif {$doselect == 1} {
+ WPLoadCGIVar result
+
+ if {[string compare new [string tolower $result]] == 0} {
+ catch {WPCmd PEMailbox select none}
+ catch {WPCmd PEMailbox zoom 0}
+ set zoomed 0
+ set result broad
+ }
+
+ set selected [WPCmd PEMailbox selected]
+
+ if {[catch {WPLoadCGIVar cancel}] || [string compare cancel [string tolower $cancel]] != 0} {
+ if {[catch {WPLoadCGIVar by}]} {
+ if {[string length $selectop]} {
+ set by [string tolower [lindex $selectop 1]]
+ } else {
+ statmsg "Unknown Search Option -- Click button associated with desired search"
+ set by unset
+ }
+ }
+
+ switch -- $by {
+ date {
+ WPLoadCGIVar datecase ;# on, since or before
+ WPLoadCGIVar datemon ;# month abbrev: jan, feb etc
+ WPLoadCGIVar dateday ;# day num
+ WPLoadCGIVar dateyear ;# year num
+
+ if {[catch {WPCmd PEMailbox select $result date $datecase $dateyear $datemon $dateday} reason]} {
+ statmsg "Date Search Failed: $reason"
+ } else {
+ selectresponse Date $reason $selected zoomed top uid
+ }
+ }
+ text {
+ WPLoadCGIVar textcase ;# ton, not
+ WPLoadCGIVar field ;# to from cc recip partic subj any
+ WPLoadCGIVar text ;# search string
+
+ if {[catch {WPCmd PEMailbox select $result text $textcase $field $text} reason]} {
+ statmsg "Text Search Failed: $reason"
+ } else {
+ switch -- $field {
+ subj {set fieldtext "\"Subject:\""}
+ from {set fieldtext "\"From:\""}
+ to {set fieldtext "\"To:\""}
+ cc {set fieldtext "\"Cc:\""}
+ recip {set fieldtext "Recipient"}
+ partic {set fieldtext "Participant"}
+ default {set fieldtext "Full text"}
+ }
+
+ selectresponse $fieldtext $reason $selected zoomed top uid
+ }
+ }
+ status {
+ if {[catch {WPLoadCGIVar flag}]} {
+ statmsg "Choose a Status value and then click [cgi_bold "Search Status"]"
+ } else {
+ WPLoadCGIVar statcase
+ if {[catch {WPCmd PEMailbox select $result status $statcase $flag} reason]} {
+ statmsg "Flag Search Failed: $reason"
+ } else {
+ switch -- $statcase {
+ not { set casetext "NOT " }
+ default { set casetext "" }
+ }
+ switch -- $flag {
+ imp {set flagtext Important}
+ new {set flagtext "New status"}
+ ans {set flagtext Answered}
+ del {set flagtext Deleted}
+ }
+ selectresponse "${casetext}${flagtext} status" $reason $selected zoomed top uid
+ }
+ }
+ }
+ unset {
+ if {[catch {WPLoadCGIVar text}] == 0} {
+ catch {WPCmd PEInfo set wp_def_search_text $text}
+ }
+ }
+ default {
+ WPCmd PEInfo statmsg "Unknown Search Option"
+ }
+ }
+ } else {
+ catch {WPCmd PEInfo unset wp_def_search_text}
+ }
+
+ catch {WPCmd PEInfo unset wp_index_script}
+} elseif {$sortrev} {
+ if {$rev} {
+ set rev 0
+ } else {
+ set rev 1
+ }
+} elseif {$sortto} {
+ set sort To
+} elseif {$sortfrom} {
+ set sort From
+} elseif {$sortdate} {
+ set sort Date
+} elseif {$sortsize} {
+ set sort siZe
+} elseif {$sortsubject} {
+ set sort Subject
+} elseif {$sortorderedsubj} {
+ set sort OrderedSubj
+} elseif {$sortthread} {
+ set sort tHread
+} elseif {$folders} {
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) folders.tcl]
+ set nopage 1
+} elseif {[string compare reply [string tolower $op]] == 0} {
+ if {0} {
+ set oncancel index
+ set cid [WPCmd PEInfo key]
+ #_cgi_set_uservar style Reply
+ source [WPTFScript compose]
+ set nopage 1
+ }
+ statmsg "Aggregate Reply not implemented yet"
+} elseif {[string compare forward [string tolower $op]] == 0} {
+ statmsg "Aggregate Forward not implemented yet"
+} elseif {[string length $aggon]} {
+ set aggtabstate [expr {$aggtabstate | $aggbar}]
+ WPCmd PEInfo aggtabstate $aggtabstate
+} elseif {[string length $aggoff]} {
+ if {$zoomed} {
+ set zoomed [WPCmd PEMailbox zoom 0]
+ statmsg "Message List now displaying all (marked and unmarked) messages"
+ }
+
+ set aggtabstate [expr {$aggtabstate & ~$aggbar}]
+ WPCmd PEInfo aggtabstate $aggtabstate
+} elseif {[string length $hdron]} {
+ set aggtabstate [expr {$aggtabstate | $sortbar}]
+ WPCmd PEInfo aggtabstate $aggtabstate
+} elseif {[string length $hdroff]} {
+ set aggtabstate [expr {$aggtabstate & ~$sortbar}]
+ WPCmd PEInfo aggtabstate $aggtabstate
+} elseif {[catch {WPCmd PEInfo set wp_index_script} script] == 0} {
+ catch {WPCmd PEInfo unset wp_index_script}
+ set uid 0
+ source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) $script]
+ set nopage 1
+} elseif {[string length $spamit]} {
+ if {[WPCmd PEMailbox selected] == 0} {
+ statmsg "Place checkmarks in the box next to desired messages, then click '$spamit'"
+ } else {
+ # create
+
+ # aggregate save
+ if {[info exists _wp(spamsubj)] && [string length $_wp(spamsubj)]} {
+ set spamsubj $_wp(spamsubj)
+ } else {
+ set spamsubj "Spam Report"
+ }
+
+ # aggregate delete
+ if {[info exists _wp(spamfolder)] && [string length $_wp(spamfolder)]
+ && [catch {
+ set savedef [WPCmd PEMailbox savedefault]
+ if {[WPCmd PEFolder exists [lindex $savedef 0] $_wp(spamfolder)] == 0} {
+ WPCmd PEFolder create [lindex $savedef 0] $_wp(spamfolder)
+ }
+
+ WPCmd PEMailbox apply save [lindex $savedef 0] $_wp(spamfolder)
+ } result]} {
+ statmsg "Error Reporting Spam: $result"
+ } elseif {[info exists _wp(spamaddr)] && [string length $_wp(spamaddr)]
+ && [catch {WPCmd PEMailbox apply spam $_wp(spamaddr) $spamsubj} reason]} {
+ statmsg "Error Sending Spam Notice: $reason"
+ } elseif {[catch {WPCmd PEMailbox apply delete} reason]} {
+ statmsg "Error marking Spam Deleted: $reason"
+ } else {
+ set seld [WPCmd PEMailbox selected]
+ statmsg "$seld spam message[WPplural $seld] reported and flagged for deletion"
+ catch {WPCmd PEMailbox select none}
+ }
+ }
+} elseif {[string compare "set flags" [string tolower $op]] == 0} {
+ if {[catch {WPCmd PEInfo flaglist} flags]} {
+ statmsg "Can't get flags: $flags"
+ } else {
+ # then go thru flag list setting and clearing as needed
+ foreach flag $flags {
+ if {[catch {cgi_import_as $flag val}]} {
+ if {[catch {WPCmd PEMessage $uid flag $flag 0} result]} {
+ statmsg "Can't set $flag: $result"
+ break
+ }
+ } else {
+ set newval [expr {[string compare $val on] == 0}]
+ if {[catch {WPCmd PEMessage $uid flag $flag $newval} result]} {
+ statmsg "Can't set $flag: $result"
+ break
+ }
+ }
+ }
+ }
+}
+
+if {![info exists nopage]} {
+ # set the specified sort order
+ if {[catch {WPCmd PEMailbox sort $sort $rev} currentsort]} {
+ error [list _action Sort $currentsort]
+ }
+
+ if {$aggops} {
+ set selected [WPCmd PEMailbox selected]
+ if {$selected < 1 && $zoomed} {
+ set zoomed 0
+ WPCmd PEMailbox zoom 0
+ statmsg "Message List now displaying all (marked and unmarked) messages"
+ }
+ }
+
+ # "top" is uid of first message in index. n after '+' is relative offset
+ if {$messagecount <= 0} {
+ set first 1
+ set top 0
+ set miv ""
+ } else {
+ if {[regexp {^([0-9]+)([\+\ -])([0-9]+)$} $top dummy u sign offset]} {
+ if {$u == 0 || [catch {WPCmd PEMessage $u number} first]} {
+ set first [WPCmd PEMailbox first]
+ set top [WPCmd PEMailbox uid $first]
+ } else {
+ set top $u
+ }
+
+ if {$offset != 0} {
+ if {[catch {WPCmd PEMailbox next [WPCmd PEMessage $top number] ${sign}${offset}} newfirst] == 0} {
+ set first $newfirst
+ set top [WPCmd PEMailbox uid $newfirst]
+ }
+ }
+ } elseif {[regexp {^[0-9]*$} $top]} {
+ if {$top == 0 || [catch {WPCmd PEMessage $top number} first]} {
+ set first [WPCmd PEMailbox first]
+ set top [WPCmd PEMailbox uid $first]
+ }
+ } else {
+ statmsg "Invalid UID for first message"
+ set first [WPCmd PEMailbox first]
+ set top [WPCmd PEMailbox uid $first]
+ }
+
+ # validate first is in range
+ if {$messagecount && $first < [set f [WPCmd PEMailbox first]]} {
+ set first $f
+ set top [WPCmd PEMailbox uid $f]
+ }
+
+ # check framing
+ if {$zoomed} {
+ if {$zoomed < $ppg || [WPCmd PEMessage $top select] == 0} {
+ set first [WPCmd PEMailbox first]
+ set top [WPCmd PEMailbox uid $first]
+ } else {
+ set first [WPCmd PEMessage $top number]
+ }
+
+ set uid $top
+ } else {
+ if {$messagecount < $ppg} {
+ if {![string length $goto]} {
+ set first [WPCmd PEMailbox first]
+ set top [WPCmd PEMailbox uid $first]
+ }
+ } elseif {$first > $messagecount} {
+ if {[set mdiff [expr {$messagecount - $ppg + 1}]] < 0} {
+ set first [WPCmd PEMailbox first]
+ set top [WPCmd PEMailbox uid $first]
+ } else {
+ set first $mdiff
+ set top [WPCmd PEMailbox uid $mdiff]
+ }
+ }
+ }
+
+ # validate uid
+ # use "size" instead of "number" to work around temporary bug in pinetcld
+ if {$uid != 0 && ([catch {WPCmd PEMessage $uid size} n] || $n <= 0)} {
+ set uid 0
+ }
+
+ set nv [WPCmd PEMailbox nextvector $first $ppg [list indexparts indexcolor status statusbits]]
+ set miv [lindex $nv 0]
+ set charset [lindex $nv 1]
+
+ # hook to keep last viewed message in current message list
+ if {$uid > 0} {
+ if {[catch {WPCmd PEMessage $uid number} n] == 0 && [uid_framed $uid $miv] == 0} {
+ set first $n
+ set top $uid
+ set nv [WPCmd PEMailbox nextvector $first $ppg [list indexparts indexcolor status statusbits ]]
+ set miv [lindex $nv 0]
+ set charset [lindex $nv 1]
+ }
+
+ #set uid 0 ;# no longer "last viewed"
+ #catch {WPCmd PEInfo unset uid}
+ }
+
+ # remember for next time
+ catch {
+ WPCmd PEInfo set top $top
+ WPCmd PEInfo set sort $sort
+ WPCmd PEInfo set rev $rev
+ }
+ }
+
+ if {[llength $miv] == 0
+ || (!([info exists charset] && [string length $charset])
+ && ([catch {WPCmd PEConfig varget character-set} charset]
+ || [string length [set charset [lindex $charset 0]]] == 0
+ || [string compare [string tolower $charset] "us-ascii"] == 0))} {
+ set charset "UTF-8"
+ }
+
+ catch {fconfigure stdout -encoding binary}
+
+ # start writing page
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=$charset"
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_http_equiv Content-Type "text/html; charset=$charset"
+
+ set onload "onLoad="
+ set onunload "onUnload="
+ if {[info exists _wp(exitonclose)]} {
+ WPExitOnClose
+ append onload "wpLoad();"
+ append onunload "wpUnLoad();"
+ }
+
+ if {[info exists _wp(timing)]} {
+ set onsubmit "onSubmit=return submitTimestamp()"
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_puts "var loadtime = new Date();"
+ cgi_put "function submitTimestamp(){"
+ cgi_put " var now = new Date();"
+ cgi_put " document.index.submitted.value = now.getTime();"
+ cgi_put " return true;"
+ cgi_puts "}"
+ cgi_put "function fini() {"
+ cgi_put " var now = new Date();"
+ cgi_put " var t_load = (now.getTime() - loadtime.getTime())/1000;"
+ if {$submitted} {
+ cgi_put " var t_submit = (now.getTime() - $submitted)/1000;"
+ set rtt ", rtt = '+t_submit+', cumulative = '+(t_submit + t_load)"
+ } else {
+ set rtt "'"
+ }
+ cgi_put " window.status = 'Page loaded in '+t_load+' seconds${rtt};"
+ cgi_puts "}"
+ }
+ append onload "fini();"
+ } else {
+ set onsubmit ""
+ }
+
+ set normalreload [cgi_buffer {WPHtmlHdrReload "$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=index"}]
+ if {[info exists _wp(exitonclose)]} {
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_put "function indexReloadTimer(t){"
+ cgi_put " reloadtimer = window.setInterval('wpLink(); window.location.replace(\\'[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=index&reload=1\\')', t * 1000);"
+ cgi_puts "}"
+ }
+
+ append onload "indexReloadTimer($_wp(refresh));"
+ cgi_noscript {
+ cgi_puts $normalreload
+ }
+ } else {
+ cgi_puts $normalreload
+ }
+
+ WPStyleSheets
+ cgi_puts "<style type='text/css'>"
+ cgi_puts ".marked { font-weight: bold ; color: black }"
+ cgi_puts ".marked0 { font-size: 7pt; font-family: arial, sans-serif ; font-weight: bold ; color: black ; background-color: gold ; padding: 1 ; border: 1px solid black }"
+ cgi_puts ".aggop { font-family: arial, sans-serif ; font-size: 7pt }"
+ cgi_puts "A.aggop { color: white ; font-size: 7pt }"
+ cgi_puts ".navbutton { font-family: arial, sans-serif ; font-size: 7pt; overflow: visible; width: auto; padding: 0 2px; margin-right: 2px }"
+ cgi_puts ".itable { font-family: geneva, arial, sans-serif }"
+ cgi_puts ".gradient { background-image: url('[WPimg indexhdr]') ; background-repeat: repeat-x }"
+ cgi_puts ".icell { white-space: nowrap; padding-right: 8px }"
+ cgi_puts ".icell0 { white-space: nowrap }"
+ cgi_puts "</style>"
+
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_put "function flip(d){"
+ cgi_put " var f = document.index;"
+ cgi_put " if(f && document.implementation){"
+ cgi_put " var e = document.createElement('input');"
+ cgi_puts " var ver = navigator.appVersion;"
+ cgi_put " if(!((ver.indexOf('MSIE')+1) && (ver.indexOf('Macintosh')+1))) e.type = 'hidden';"
+ cgi_put " e.name = 'bod_'+d;"
+ cgi_put " e.value = 1;"
+ cgi_put " f.appendChild(e);"
+ cgi_put " f.submit();"
+ cgi_put " return false;"
+ cgi_put " }"
+ cgi_put " return true;"
+ cgi_puts "}"
+
+ cgi_put "function view(u) {"
+ cgi_put " var f = document.index;"
+ cgi_put " f.target = '$vtarget';"
+ cgi_put " f.page.value = 'fr_view';"
+ cgi_put " f.uid.value = u;"
+ cgi_puts " f.submit();"
+ cgi_puts " return false;"
+ cgi_puts "}"
+
+ cgi_put "function toggleMarks(elobj){"
+ cgi_put " var i, ckd = 1;"
+ cgi_put " for(i = 0; i < document.index.uidList.length; i++)"
+ cgi_put " if(!document.index.uidList\[i\].checked){"
+ cgi_put " ckd = 0;"
+ cgi_put " break;"
+ cgi_put " }"
+ cgi_put " for(i = 0; i < document.index.uidList.length; i++) document.index.uidList\[i\].checked = !ckd;"
+ cgi_put " elobj.src = (ckd) ? '[WPimg markall3]' : '[WPimg marknone3]';"
+ cgi_put " return false;"
+ cgi_puts "}"
+ }
+
+ if {$_wp(keybindings)} {
+ set kequiv {
+ {{?} {top.location = 'wp.tcl?page=help'}}
+ {{l} {top.location = 'wp.tcl?page=folders'}}
+ {{a} {top.location = 'wp.tcl?page=addrbook'}}
+ {{n} {if(flip('next')) location = 'wp.tcl?page=body&bod_next=1'}}
+ {{p} {if(flip('prev')) location = 'wp.tcl?page=body&bod_prev=1'}}
+ {{ } {if(flip('next')) location = 'wp.tcl?page=body&bod_next=1'}}
+ {{-} {if(flip('prev')) location = 'wp.tcl?page=body&bod_prev=1'}}
+ {{;} {if(document.index.select) document.index.select.click(); else document.index.aggon.click()}}
+ {{z} {if(document.index.zoom) document.index.zoom.click()}}
+ }
+
+ lappend kequiv [list {c} "top.location = 'wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key]'"]
+
+ if {$aggops && ($aggtabstate & $aggbar)} {
+ set exclusions document.index.f_name
+ } else {
+ set exclusions ""
+ }
+
+ append onload [WPTFKeyEquiv $kequiv $exclusions]
+ }
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) background=[file join $_wp(imagepath) logo $_wp(logodir) back.gif] "style=\"background-repeat: repeat-x\"" $onload $onunload {
+
+ catch {WPCmd set help_context index}
+
+ # check for status msg updates
+ foreach s [WPStatusMsgs] {
+ lappend newmail [list $s]
+ }
+
+ if {[llength $newmail]} {
+ WPTFStatusTable $newmail 1 "style=\"padding: 6px 0; color: white\""
+
+ if {!$reload} {
+ WPCmd PEMailbox newmailreset
+ }
+ }
+
+ if {$ppg > 50} {
+ set postmethod post
+ set enctype "multipart/form-data"
+ } else {
+ set postmethod get
+ set enctype "application/x-www-form-urlencoded"
+ }
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=$postmethod enctype=$enctype name=index $onsubmit target=body {
+
+ # context line
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" class="context" {
+ if {[llength $newmail]} {
+ cgi_table_row {
+ cgi_table_data height=1 bgcolor="#000000" width="100%" colspan=8 {
+ cgi_put [cgi_img [WPimg dot2] border=0 height=1]
+ }
+ }
+ }
+
+ cgi_table_row bgcolor="#999999" {
+ if {$zoomed} {
+ if {[catch {WPCmd PEMailbox messagecount after [lindex [lindex $miv end] 0]} messagesremaining]} {
+ unset messagesremaining
+ }
+
+ set z "[cgi_span class="marked" marked] "
+ set t $zoomed
+ } else {
+ set messagesremaining [expr {$messagecount - ($first + $ppg - 1)}]
+ set t $messagecount
+ set z ""
+ }
+
+ if {[catch {WPCmd PEMailbox messagecount before [lindex [lindex $miv 0] 0]} messagesbefore] == 0 && $messagesbefore > 0} {
+ if {$messagesbefore > $ppg} {
+ set b $ppg
+ } else {
+ set b $messagesbefore
+ }
+
+ switch $b {
+ 1 {
+ set c One
+ set p ""
+ }
+ default {
+ set c $b
+ set p s
+ }
+ }
+
+ set prevtext " [cgi_unbreakable_string "($c on [cgi_url previous wp.tcl?page=body&bod_prev=1 "onClick=return flip('prev')"] page)"]"
+ } else {
+ set messagesbefore 0
+ set prevtext ""
+ }
+
+ if {$messagesbefore <= 0 && $messagesremaining <= 0} {
+ switch $t {
+ 0 {
+ set counttext "[cgi_bold No] ${z}messages in folder"
+ }
+ 1 {
+ set counttext "[cgi_bold Only] ${z}message in folder"
+ }
+ 2 {
+ set counttext "[cgi_bold Both] ${z}messages in folder"
+ }
+ default {
+ set counttext "[cgi_bold All] $t ${z}messages in folder"
+ }
+ }
+ } elseif {$zoomed} {
+ if {$messagesbefore > 0} {
+ if {$messagesremaining > 0} {
+ set counttext "[expr {$messagesbefore + 1}] thru [expr {$zoomed - $messagesremaining}] of $zoomed [cgi_span class="marked" marked] messages"
+ } else {
+ if {[set p [llength $miv]] == 1} {
+ set lasttext ""
+ } else {
+ set lasttext " $p"
+ }
+
+ set counttext "[cgi_bold Last]${lasttext} of $zoomed [cgi_span class="marked" marked] messages"
+ }
+ } else {
+ set counttext "[cgi_bold First] $ppg of $zoomed [cgi_span class="marked" marked] messages"
+ }
+ } else {
+ set n [WPcomma $messagecount]
+
+ if {[lindex [lindex $miv 0] 0] == 1} {
+ set counttext "[cgi_bold First] $ppg of $n messages"
+ } else {
+ set l [lindex [lindex $miv end] 0]
+ if {$l == $messagecount} {
+ if {[set p [llength $miv]] == 1} {
+ set lasttext ""
+ } else {
+ set lasttext " $p"
+ }
+
+ set counttext "[cgi_bold Last]${lasttext} of $n messages"
+ } else {
+ set counttext "Message [WPcomma $first] - [WPcomma $l] of $n"
+ }
+ }
+ }
+
+ cgi_table_data align=left class="context" "style=\"padding-left: 4\"" {
+ cgi_unbreakable {
+ cgi_put "${counttext}[cgi_breakable]${prevtext}"
+ }
+ }
+
+ cgi_table_data align=right {
+ cgi_unbreakable {
+ if {[WPCmd PEInfo feature expunge-without-confirm-everywhere]
+ || ([WPCmd PEInfo feature expunge-without-confirm]
+ && [string compare [string tolower [WPCmd PEMailbox mailboxname]] inbox] == 0)} {
+ set butname expunge
+ cgi_text "emptyit=1" type=hidden notab
+ } else {
+ set butname queryexpunge
+ }
+
+ if {$aggops} {
+ cgi_submit_button "mark=Mark All in Folder" class="navbutton"
+ cgi_submit_button "unmark=Unmark All" class="navbutton"
+
+ cgi_put [cgi_breakable]
+ cgi_submit_button "setflag=Delete" class="navbutton"
+ cgi_submit_button "setflag=Undelete" class="navbutton"
+ if {([info exists _wp(spamaddr)] && [string length $_wp(spamaddr)])
+ || ([info exists _wp(spamfolder)] && [string length $_wp(spamfolder)])} {
+ cgi_submit_button "spamit=Report Spam" class="navbutton" "style=\" color: white; background-color: black\""
+ }
+ }
+
+ cgi_submit_button "${butname}=Expunge" class="navbutton"
+ }
+ }
+ }
+ }
+
+ cgi_text "page=index" type=hidden notab
+ cgi_text "cid=$cid" type=hidden notab
+ cgi_text "first=$first" type=hidden notab
+ cgi_text "uid=0" type=hidden notab
+ cgi_text "top=$top" type=hidden notab
+ cgi_text "frestore=1" type=hidden notab
+ cgi_text "submitted=0" type=hidden notab
+
+ if {$aggops} {
+ if {[llength $miv]} {
+ foreach v $miv {
+ lappend uv [lindex $v 1]
+ }
+
+ set uidpage [join $uv ","]
+ } else {
+ set uidpage ""
+ }
+
+ cgi_text "uidpage=${uidpage}" type=hidden notab
+
+ if {$aggtabstate & $aggbar} {
+ # commands
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" class=ops {
+ cgi_table_row {
+ cgi_table_data height=1 "bgcolor=#000000" colspan=12 align=left {
+ cgi_put [cgi_img [WPimg dot2] height=1]
+ }
+ }
+ cgi_table_row {
+ cgi_put "<td height=100% width=11px align=left valign=bottom background=[WPimg barclose_mid]><input type=image name=\"aggoff\" src=[WPimg barclose] border=0 alt=\"Hide Message Commands\"></td>"
+
+ cgi_table_data align=center valign=middle nowrap class=aggop width=30% {
+ cgi_puts "<fieldset>"
+ cgi_puts "<legend style=\"color: white\">Search and Mark</legend>"
+ cgi_submit_button "select=${selectverb}" class=aggop "style=\"vertical-align: middle; margin-right: 4\""
+
+ if {$zoomed} {
+ cgi_submit_button "zoom=Show All Messages" class=aggop "style=\"vertical-align: middle\""
+ } else {
+ cgi_submit_button "zoom=Show Only Marked" class=aggop "style=\"vertical-align: middle\""
+ }
+ cgi_puts "</fieldset>"
+ }
+
+ cgi_table_data align=center valign=middle nowrap class=aggop width=30% {
+ cgi_puts "<fieldset>"
+ cgi_puts "<legend style=\"color: white\">Message Status</legend>"
+ cgi_submit_button setflag=Set class=aggop "style=\"vertical-align:middle\""
+ cgi_put "[cgi_nbspace]status to "
+ cgi_select flags class=aggop "style=\"vertical-align:middle\"" {
+ #cgi_option Deleted value=delete
+ #cgi_option Undeleted value=undeleted
+ cgi_option New value=new selected
+ cgi_option Read value=read
+ cgi_option Important value=important
+ cgi_option Unimportant value=unimportant
+ cgi_option Answered value=answered
+ cgi_option Unanswered value=unanswered
+ }
+
+ cgi_puts "</fieldset>"
+ }
+
+ cgi_table_data align=center valign=middle class=aggop width=40% {
+ cgi_puts "<fieldset>"
+ cgi_puts "<legend style=\"color: white\">Save Messages</legend>"
+ # * * * * Save * * * *
+
+ cgi_submit_button "save=Save" class=aggop "style=\"vertical-align:middle\""
+ cgi_put "[cgi_nbspace]to "
+
+ set savedef [WPTFSaveDefault $uid]
+
+ cgi_text f_colid=[lindex $savedef 0] type=hidden notab
+
+ cgi_select f_name class=aggop "style=\"vertical-align:middle\"" "onchange=document.index.save.click(); return false;" {
+ foreach {oname oval} [WPTFGetSaveCache [lindex $savedef 1]] {
+ cgi_option $oname value=$oval
+ }
+ }
+
+ #cgi_put "[cgi_nbspace]"
+ #cgi_submit_button "save=OK" class=aggop "style=\"vertical-align:middle;margin-right:2\""
+ cgi_puts "</fieldset>"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data height=1 "bgcolor=#000000" colspan=12 {
+ cgi_put [cgi_img [WPimg dot2] height=1]
+ }
+ }
+ }
+ } elseif {$aggtabstate & $sortbar} {
+ # aggop bar
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" class=ops {
+ cgi_table_row {
+ cgi_table_data height=1 "bgcolor=#000000" colspan=12 align=left {
+ cgi_put [cgi_img [WPimg dot2] height=1]
+ }
+ }
+ cgi_table_row {
+ cgi_table_data {
+ cgi_image_button aggon=[WPimg baropen] border=0 alt=\"Show Search/Save Commands\"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data height=1 "bgcolor=#000000" colspan=12 {
+ cgi_put [cgi_img [WPimg dot2] height=1]
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table cellspacing=0 cellpadding=0 width="100%" class="itable" {
+ if {$messagecount < 1} {
+ # special case for mailbox with no messges
+ cgi_table_row {
+ cgi_table_data class=body valign=middle height=[expr {($ppg + 1) * $indexheight}] {
+ cgi_center {
+ cgi_puts [cgi_font size=+2 "\[Folder \"[WPCmd PEMailbox mailboxname]\" contains no messages\]"]
+ }
+ }
+ }
+ } else {
+
+ # get the desired index item order and spacing
+ set iformat [WPCmd PEMailbox indexformat]
+
+ set colspan [expr {[llength $iformat] + 1}]
+
+ # setup per-column layout parameters
+ foreach fmt $iformat {
+
+ if {[info exists oncethru]} {
+ if {![info exists firstcell]} {
+ set class icell0
+ set firstcell 1
+ } else {
+ set class icell
+ }
+
+ append layout " $class "
+ }
+
+ set oncethru 1
+
+ switch -regexp -- [lindex $fmt 0] {
+ [Ss]tatus {
+ # fixed with "envelope" icon
+ if {[string length [lindex $fmt 2]]} {
+ set width "1%"
+ } else {
+ set width "42px"
+ }
+ }
+ default {
+ # proportion computed by pith (may be user specified)
+ if {[regexp {[0123456789]+[%]} [lindex $fmt 1]]} {
+ set width [lindex $fmt 1]
+ } else {
+ set width "1%"
+ }
+ }
+ }
+
+ append layout "$width"
+ }
+
+ append layout " icell0"
+
+ #set doscrollbar [expr {($zoomed && $zoomed > $ppg) || (!$zoomed && $messagecount > $ppg)}]
+ set linenum 1
+
+ # paint the index line column headers
+ cgi_table_row class=\"gradient\" {
+ if {($aggtabstate & $sortbar) == 0} {
+ if {!([info exists headertab] && [string length $headertab])} {
+ cgi_table_data class=indexhdr align=left width=48px background=[WPimg baropen_mid] {
+ if {$aggops && ($aggtabstate & $aggbar) == 0} {
+ cgi_image_button aggon=[WPimg baropen] border=0 alt=\"Show Search/Save Commands\"
+ }
+
+ cgi_image_button hdron=[WPimg baropen] border=0 alt=\"Show List Headers\"
+ }
+
+ foreach fmt $iformat {width class} $layout {
+ cgi_table_data class=indexhdr align=left width=$width background=[WPimg baropen_mid] {
+ cgi_put [cgi_img [WPimg dot2] height=1]
+ }
+ }
+ }
+ } else {
+ if {$aggops} {
+ cgi_table_data height=100% align=left valign=bottom class=indexhdr width=\"40px\" {
+ cgi_table width=\"100%\" cellpadding=0 cellspacing=0 border=0 {
+ cgi_table_row {
+ cgi_table_data align=left valign=bottom {
+ cgi_image_button hdroff=[WPimg barclose] border=0 "alt=\"Hide List Headers\""
+ }
+ cgi_table_data align=center valign=middle "style=\"padding-right: 14px\"" {
+ set marked 1
+ foreach v $miv {
+ set u [lindex $v 1]
+ if {$u == 0 || ![WPCmd PEMessage $u select]} {
+ set marked 0
+ break
+ }
+ }
+
+ if {$marked} {
+ cgi_image_button unmark=[WPimg marknone3] border=0 alt=\"Unmark Messages on Page\" "onClick=return toggleMarks(this);"
+ } else {
+ cgi_image_button mark=[WPimg markall3] border=0 alt=\"Mark Messages on Page\" "onClick=return toggleMarks(this);"
+ }
+ }
+ }
+ }
+ }
+ } else {
+ cgi_td class=indexhdr [cgi_nbspace]
+ }
+
+ set sorts [string tolower [WPCmd PEMailbox sortstyles]]
+
+ foreach fmt $iformat {width class} $layout {
+ set title [lindex $fmt 0]
+ catch {unset sortlist}
+
+ if {[lsearch -exact $sorts [string tolower $title]] >= 0} {
+ if {[string compare [string tolower [lindex $currentsort 0]] [string tolower $title]] == 0} {
+ lappend sortlist [list indexsort [sortname $title 1]]
+ } else {
+ lappend sortlist [list indexhdr [cgi_url [sortname $title] wp.tcl?page=index&sort[string tolower $title]=1 class=indexhdr title='Sort by $title' target=body]]
+ }
+
+ # special subject sort handling
+ switch -regexp -- $title {
+ [Ss]ubject { lappend extrasort OrderedSubj ; lappend extrasort Thread }
+ [Ff]rom { lappend extrasort To }
+ x[Dd]ate { lappend extrasort Arrival }
+ }
+
+ if {[info exists extrasort]} {
+ foreach s $extrasort {
+ lappend sortlist [list indexhdr [cgi_bold "|"]]
+ # append text [cgi_nbspace][cgi_bold "|"][cgi_nbspace]
+ if {[string compare [string tolower [lindex $currentsort 0]] [string tolower $s]] == 0} {
+ if {[string compare [string tolower $s] thread] == 0} {
+ set threadsort 1
+ }
+ lappend sortlist [list indexsort [sortname $s 1]]
+ } else {
+ lappend sortlist [list indexhdr [cgi_url [sortname $s] wp.tcl?page=index&sort[string tolower $s]=1 class=indexhdr title='Sort by $s' target=body]]
+ }
+ }
+
+ # clear for next time
+ unset extrasort
+ }
+ } else {
+ lappend sortlist [list indexhdr [sortname $title]]
+ }
+
+ cgi_table_data class=indexhdr valign=middle class=$class width="$width" {
+ cgi_table border=0 cellspacing=0 cellpadding=2 {
+ cgi_table_row {
+ foreach s $sortlist {
+ cgi_table_data class=[lindex $s 0] nowrap {
+ cgi_puts [lindex $s 1]
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if {[info exists use_plus_minus_to_grow_shrink]} {
+ # grow/shrink controls
+ cgi_table_data class=indexhdr {
+ cgi_image_button growpage=[WPimg plus2] height=12 border=0 alt="Grow"
+ cgi_image_button shrinkpage=[WPimg minus2] height=12 border=0 alt="Shrink"
+ }
+ }
+ }
+ }
+
+ if {$zoomed} {
+ cgi_table_row {
+ cgi_table_data class=marked0 colspan=$colspan align=center {
+ cgi_puts "Unmarked Messages are NOT Shown - Click [cgi_url "Show All Messages" wp.tcl?page=body&zoom=0] to View All"
+ #cgi_puts "Unmarked Messages Are Excluded From View"
+ }
+ }
+ }
+
+ # get ready to map thread images
+ if {[string compare [string tolower [lindex $currentsort 0]] thread] == 0} {
+ set barblank [WPThreadImageLink barblank $indexheight]
+ set barvert [WPThreadImageLink barvert $indexheight]
+ if {[lindex $currentsort 1]} {
+ set barmsg [WPThreadImageLink ibarmsg $indexheight]
+ } else {
+ set barmsg [WPThreadImageLink barmsg $indexheight]
+ }
+
+ if {[lindex $currentsort 1]} {
+ set barvertmsg [WPThreadImageLink ibarvertmsg $indexheight]
+ } else {
+ set barvertmsg [WPThreadImageLink barvertmsg $indexheight]
+ }
+ }
+
+ foreach v $miv {
+ set n [lindex $v 0]
+ set u [lindex $v 1]
+ set msg [lindex [lindex $v 2] 0]
+ set linecolor [lindex [lindex $v 2] 1]
+ set stat [lindex [lindex $v 2] 2]
+ set statbits [lindex [lindex $v 2] 3]
+
+ set class [lineclass [incr linenum]]
+
+ if {$n > $messagecount} {
+ break
+ }
+
+ if {[llength $linecolor] == 2 && [string compare [lindex $linecolor 0] [lindex $linecolor 1]]} {
+ set style "color: #[lindex $linecolor 0] ; background-color: #[lindex $linecolor 1]"
+ } else {
+ set style ""
+ }
+
+ cgi_table_row class=$class "style=\"$style\"" {
+ if {$u == 0} {
+ cgi_table_data colspan=$colspan height=$indexheight {
+ cgi_put "Data for message $n no longer available"
+ }
+ } else {
+ if {$aggops} {
+ cgi_table_data valign=middle align=center height=$indexheight {
+ if {[WPCmd PEMessage $u select]} {
+ set checked checked
+ } else {
+ set checked ""
+ }
+
+ cgi_checkbox "uidList=$u" $checked class=$class id=cb$u "style=\"$style; margin-left: 16\""
+ }
+ } else {
+ cgi_td height=$indexheight width=2% [cgi_nbspace]
+ }
+
+ set deleted [string index $stat 0]
+ set recent [expr {[string range $stat 0 2] == "010"}]
+
+ foreach part $msg fmt $iformat {width class} $layout {
+
+ set align ""
+ set onclick ""
+
+ switch -exact -- [lindex $fmt 0] {
+ Subject {
+ set parttext ""
+ set leading ""
+ foreach p $part {
+ switch -- [lindex $p 2] {
+ threadinfo {
+ append leading [lindex $p 0]
+ regsub -all {[ ][ ]} $leading $barblank leading
+ regsub -all {[|][-]} $leading $barvertmsg leading
+ regsub -all {[\\][-]} $leading $barmsg leading
+ regsub -all {[|]} $leading $barvert leading
+ }
+ xthreadinfo {
+ set t [lindex $p 0]
+ append leading "$t"
+ for {set i 0} {$i < [string length $t]} {incr i} {
+ switch -- [string index $t $i] {
+ " " {
+ append leading [WPThreadImageLink barblank $indexheight]
+ }
+ ">" {
+ }
+ "-" {
+ if {[lindex $currentsort 1]} {
+ append leading [WPThreadImageLink ibarmsg $indexheight]
+ } else {
+ append leading [WPThreadImageLink barmsg $indexheight]
+ }
+ }
+ "|" {
+ append leading [WPThreadImageLink barvert $indexheight]
+ }
+ }
+ }
+ }
+ default {
+ append parttext [index_part_color [index_quote [lindex $p 0]] [lindex $p 1]]
+ }
+ }
+ }
+
+ if {[string length [set label $parttext]] == 0} {
+ set label {[Empty Subject]}
+ }
+
+ set text [cgi_url $label "fr_view.tcl?&uid=$u&c=[string range $cid 0 5]" target=$vtarget "onClick=return view($u)"]
+
+ if {![info exists do_status_icons] && $deleted} {
+ set text [cgi_span "style=text-decoration: line-through" $text]
+ }
+
+ set text [cgi_buffer {
+ cgi_division "style=\"height: $indexheight; overflow: hidden;\"" {
+ cgi_put "${leading}${text}"
+ }
+ }]
+ }
+ Status {
+ if {[string length [lindex $fmt 2]]} {
+ set text ""
+ foreach i $part {
+ regsub -all { } [lindex $i 0] {\&nbsp;} statstr
+ if {[llength [lindex $i 1]]} {
+ append text [cgi_span "style=background-color: #[lindex [lindex $i 1] 1]; color: #[lindex [lindex $i 1] 0]" $statstr]
+ } else {
+ append text $statstr
+ }
+ }
+
+ set text [cgi_buffer {
+ cgi_division "style=\"font-family: monospace\"" {
+ cgi_put $text
+ }
+ }]
+ } elseif {[info exists do_status_icons]} {
+ set text [WPStatusImg $u]
+ } else {
+ set text [lindex [WPStatusIcon $u gif $statbits] 2]
+ set align align=center
+ }
+
+ if {$flagcmd} {
+ set text [cgi_url $text fr_flags.tcl?uid=$u target=body]
+ }
+ }
+ Size {
+ set text [index_part_color [index_quote [lindex [lindex $part 0] 0]] [lindex $part 1]]
+ set class isize
+ set onclick "onclick=\"flipCheck('cb$u')\""
+ }
+ Number {
+ set text [index_part_color [index_quote [WPcomma [string trim [lindex [lindex $part 0] 0]]]] [lindex $part 1]]
+ set onclick "onclick=\"flipCheck('cb$u')\""
+ }
+ From -
+ To {
+ set t [index_quote [lindex [lindex $part 0] 0]]
+ if {$recent} {
+ set t [cgi_bold $t]
+ }
+
+ set text [cgi_buffer {
+ cgi_division "style=\"height: $indexheight; overflow: hidden;\"" {
+ cgi_put [index_part_color $t [lindex $part 1]]
+ }
+ }]
+
+ set onclick "onclick=\"flipCheck('cb$u')\""
+ }
+ default {
+ set text [index_part_color [index_quote [lindex [lindex $part 0] 0]] [lindex $part 1]]
+ set onclick "onclick=\"flipCheck('cb$u')\""
+ }
+ }
+
+ if {![info exists text]} {
+ set text doh
+ }
+
+ cgi_td $align class="$class" $onclick "$text"
+ }
+
+ if {[info exists use_plus_minus_to_grow_shrink]} {
+ cgi_td [cgi_nbspace]
+ }
+ }
+ }
+ }
+
+ for {} {$linenum <= $ppg} {incr linenum} {
+ cgi_table_row class="[lineclass [expr $linenum + 1]]" {
+ cgi_table_data colspan=$colspan height=$indexheight {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+ }
+
+ if {[info exists use_bottom_text_to_grow_shrink]} {
+ cgi_table_row height=1 {
+ cgi_table_data bgcolor=#000000 colspan=$colspan {
+ cgi_put [cgi_img [WPimg blackdot] height=1]
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center valign=middle colspan=$colspan class=indexhdr {
+ cgi_put "[WPcomma $ppg] messages are in the list above. Press either "
+ cgi_submit_button growpage=$growverb class=indexhdr "style=\"vertical-align:middle\""
+ cgi_put " or "
+ cgi_submit_button shrinkpage=$shrinkverb class=indexhdr "style=\"vertical-align:middle\""
+ cgi_put " to change this by "
+ cgi_select grownum class=indexhdr "style=\"vertical-align:middle\"" {
+ set growsizes {1 5 10 25 50}
+
+ if {[catch {WPCmd PEInfo set grownum} lastsize]} {
+ set lastsize 0
+ }
+
+ foreach size $growsizes {
+ if {$size == $lastsize} {
+ set sel selected
+ } else {
+ set sel ""
+ }
+
+ cgi_option $size value=$size $sel
+ }
+ }
+ cgi_put "."
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table width=100% cellpadding=0 cellspacing=0 border=0 {
+ cgi_table_row {
+ cgi_table_data align=left class=context {
+ if {[info exists messagesremaining] && $messagesremaining > 0} {
+ if {$messagesremaining > $ppg} {
+ set moretext ", $ppg"
+ } else {
+ set moretext ""
+ }
+
+ if {$zoomed} {
+ set marked " [cgi_bold marked]"
+ } else {
+ set marked ""
+ }
+
+ set nexttext " ([WPcomma $messagesremaining] more${marked} message[WPplural $messagesremaining]${moretext} on [cgi_url next wp.tcl?page=body&bod_next=1 "onClick=return flip('next')"] page)"
+ } else {
+ set nexttext ""
+ }
+
+ cgi_puts "[cgi_nbspace]${counttext}${nexttext}"
+ }
+ cgi_table_data align=right class=context {
+ cgi_put "Powered by [cgi_url Alpine "http://www.washington.edu/alpine/" target="_blank"] - [cgi_copyright] 2007 University of Washington"
+ if {[info exists _wp(ui2dir)]} {
+ cgi_puts " - [cgi_url "Standard Version " "$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)/browse" target=_top]"
+ }
+ }
+ }
+ }
+
+ if {[info exists _wp(cumulative)]} {
+ set l [string length $_wp(cumulative)]
+ if {$l < 6} {
+ set sl "."
+ while {$l < 6} {
+ append sl "0"
+ incr l
+ }
+ append sl $_wp(cumulative)
+ } else {
+ set sl "[string range $_wp(cumulative) 0 [expr $l - 7]].[string range $_wp(cumulative) [expr $l - 6] end]"
+ }
+
+ set servlettime "servlet = $sl"
+
+ if {[info exists wp_global_loadtime]} {
+ set clickdiff [expr {[clock clicks] - $wp_global_loadtime}]
+ # 500165 clicks/second
+ set st [expr ([string range $clickdiff 0 [expr [string length $clickdiff] - 4]] * 1000) / 500]
+ set l [string length $st]
+ set scripttime "tcl = [string range $st 0 [expr $l - 4]].[string range $st [expr $l - 3] end], "
+ } else {
+ set scripttime ""
+ }
+
+ cgi_puts [cgi_font size=-2 "style=font-family:arial;font-weight:bold" "\[time: ${scripttime}${servlettime}\]"]
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/ldapbrowse.tcl b/web/cgi/alpine/1.0/ldapbrowse.tcl
new file mode 100755
index 00000000..e8436fd3
--- /dev/null
+++ b/web/cgi/alpine/1.0/ldapbrowse.tcl
@@ -0,0 +1,220 @@
+#!./tclsh
+# $Id: ldapbrowse.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# ldapbrowse.tcl
+#
+# Purpose: CGI script to browse ldap results
+
+# Input: [expected to be set when we get here]
+set browse_vars {
+ {field "Missing Field Name"}
+ {ldapquery "Missing LDAP Query Number"}
+ {addresses "" ""}
+ {oncancel "" ""}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set ldapres_cmds {
+ {
+ {}
+ {
+ {
+ # * * * * USE ADDRESSES * * * *
+ cgi_submit_button "address=Address" class="navtext"
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_submit_button "cancel=Cancel" class="navtext"
+ }
+ }
+ }
+}
+
+WPEval $browse_vars {
+
+ if {[catch {WPCmd PEInfo noop} result]} {
+ error [list _action "No Op" $result]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ if {$ldapquery != 0} {
+ if {[catch {WPCmd PELdap results $ldapquery} results]} {
+ WPCmd PEInfo statmsg "Some sort of ldap problem"
+ }
+ }
+
+ cgi_head {
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post name=ldapaddr target=_top {
+ cgi_text "page=ldappick" type=hidden notab
+ cgi_text "ldapquery=$ldapquery" type=hidden notab
+ cgi_text "field=$field" type=hidden notab
+ cgi_text "addresses=[cgi_unquote_input $addresses]" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+ cgi_table_row {
+ # next comes the menu down the left side
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu ldapres_cmds {}
+ }
+ }
+
+ cgi_table_data valign=top width=100% class=dialog {
+ if {$ldapquery == 0} {
+ cgi_puts [cgi_italic "No matches found"]
+ } else {
+ cgi_table align=center width="75%" {
+ cgi_table_row {
+ cgi_table_data align=center valign=middle {
+ cgi_br
+ cgi_put "Below are directory entries matching text expanded from your message's $field field. Choose the addressees you want, then Click [cgi_bold Address]."
+ cgi_br
+ cgi_br
+ }
+ }
+ }
+
+ set numboxes 0
+ set srchindex 0
+ cgi_table border=0 cellpadding=0 cellspacing=0 align=center width=96% {
+ foreach searchres $results {
+ set srchstr [lindex $searchres 0]
+ set retdata [lindex $searchres 1]
+ set expstr ""
+ cgi_table_row {
+ cgi_table_data {
+
+ if {$srchstr != ""} {
+ set expstr " for \"[cgi_bold $srchstr]\""
+ }
+
+ cgi_text "str${srchindex}=${srchstr}" type=hidden notab
+ cgi_table border=0 cellspacing=0 cellpadding=1 width=100% {
+ cgi_table_row {
+ cgi_table_data colspan=32 valign=middle height=20 class=ops {
+ cgi_puts "[cgi_nbspace]Directory Search Results${expstr}"
+ }
+ }
+
+ set whitebg 1
+ set nameindex 0
+ set onetruebox 0
+ set numsrchboxes 0
+ foreach litem $retdata {
+ if {[llength [lindex $litem 4]] > 0} {
+ incr numsrchboxes
+ if {$numsrchboxes > 1} {
+ break
+ }
+ }
+ }
+ if {$numsrchboxes == 1} {
+ set onetruebox 1
+ }
+ foreach litem $retdata {
+ set name [lindex $litem 0]
+ set email [lindex $litem 4]
+ set nomail 0
+ if {$whitebg == 1} {
+ set bgcolor #FFFFFF
+ set whitebg 0
+ } else {
+ set bgcolor #EEEEEE
+ set whitebg 1
+ }
+ if {[llength $email] < 1} {
+ incr nameindex
+ continue
+ set nomail 1
+ }
+ cgi_table_row bgcolor=$bgcolor {
+
+ cgi_table_data valign=top nowrap {
+ if {$nomail == 1} {
+ cgi_puts "&nbsp;"
+ } else {
+ if {$onetruebox == 1} {
+ set checked checked
+ } else {
+ set checked ""
+ }
+ cgi_checkbox "ldapList=${srchindex}.${nameindex}" style="background-color:$bgcolor" $checked
+ incr numboxes
+ }
+ }
+
+ cgi_table_data valign=top nowrap {
+ regsub -all "<" $name "\\&lt;" name
+ regsub -all ">" $name "\\&gt;" name
+ cgi_puts "$name"
+ }
+ cgi_table_data valign=top nowrap {
+ if {[llength $email] > 1} {
+ cgi_table width=100% {
+ foreach eaddr $email {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts [cgi_font size=-1 "style=font-family:courier_new,monospace" "[cgi_lt]${eaddr}[cgi_gt]"]
+ }
+ }
+ }
+ }
+ } else {
+ if {$nomail == 1} {
+ cgi_puts "\[No email information\]"
+ } else {
+ cgi_puts [cgi_font size=-1 "style=font-family:courier_new,monospace" "[cgi_lt][lindex $email 0][cgi_gt]"]
+ }
+ }
+ }
+ }
+ incr nameindex
+ }
+ }
+
+ cgi_br
+ cgi_br
+ }
+ }
+ incr srchindex
+ }
+ }
+ cgi_text "numboxes=${numboxes}" type=hidden notab
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/ldapentry.tcl b/web/cgi/alpine/1.0/ldapentry.tcl
new file mode 100755
index 00000000..a483f165
--- /dev/null
+++ b/web/cgi/alpine/1.0/ldapentry.tcl
@@ -0,0 +1,315 @@
+#!./tclsh
+# $Id: ldapentry.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# ldapentry.tcl
+#
+# Purpose: CGI script to submit ldap search
+
+# Input:
+set ldap_vars {
+ {dir "Missing Directory Index"}
+ {qn "Missing Query Number"}
+ {si "Missing Search Index"}
+ {ni "Missing Name Index"}
+ {email "" 0}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+
+# Command Menu definition for Message View Screen
+set ldap_menu {
+}
+
+set common_menu {
+ {
+ {}
+ {
+ {
+ # * * * * Ubiquitous INBOX link * * * *
+ if {[string compare inbox [string tolower [WPCmd PEMailbox mailboxname]]]} {
+ cgi_put [cgi_url INBOX open.tcl?folder=INBOX&colid=0&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url INBOX fr_main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * FOLDER LIST * * * *
+ cgi_puts [cgi_url "Folder List" "wp.tcl?page=folders&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * COMPOSE * * * *
+ cgi_puts [cgi_url Compose wp.tcl?page=compose&oncancel=addrbook&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * RESUME * * * *
+ cgi_puts [cgi_url Resume wp.tcl?page=resume&oncancel=addrbook&cid=[WPCmd PEInfo key] class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Addr books * * * *
+ cgi_puts [cgi_url "Address Book" wp.tcl?page=addrbook&oncancel=main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ # * * * * ldap Query * * * *
+ cgi_puts [cgi_url "Back to Search Results" ldapresult.tcl?dir=${dir}&qn=${qn} class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {expr {$email > 0}}
+ {
+ {
+ # * * * * Compose To * * * *
+ cgi_puts [cgi_url "Send Mail To This Person" compose.tcl?ldap=1&dir=${dir}&qn=${qn}&si=${si}&ni=${ni}&cid=[WPCmd PEInfo key]&oncancel=addrbook class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ # * * * * QUIT * * * *
+ cgi_puts [cgi_url "Quit Web Alpine" "$_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=$sessid class=navbar" target=_top class=navbar]
+ }
+ }
+ }
+}
+
+
+WPEval $ldap_vars {
+
+ if {[catch {WPCmd PEInfo noop} result]} {
+ error [list _action "No Op" $result]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ if {$qn != 0} {
+ if {[catch {WPCmd PELdap results $qn} results]} {
+ WPCmd PEInfo statmsg "Some sort of ldap problem"
+ }
+ }
+
+ cgi_head {
+ WPStdHtmlHdr "LDAP Entry"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ #
+ # next comes the menu down the left side
+ #
+ cgi_table_data valign=top rowspan=4 class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=2 {
+ cgi_table_row {
+ cgi_table_data class=navbar style=padding-top:6 {
+ cgi_puts "Current Folder :"
+ cgi_division align=center "style=\"margin-top:4;margin-bottom:4\"" {
+ cgi_put [cgi_url [WPCmd PEMailbox mailboxname] fr_main.tcl target=_top class=navbar]
+ switch -exact -- [WPCmd PEMailbox state] {
+ readonly {
+ cgi_br
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Read Only)"]
+ }
+ closed {
+ cgi_br
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Closed)"]
+ }
+ ok -
+ default {}
+ }
+
+ cgi_br
+ }
+
+ cgi_hr "width=75%"
+ }
+ }
+
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar style=padding-bottom:10 {
+ WPTFCommandMenu ldap_menu common_menu
+ }
+ }
+ }
+ }
+ }
+
+
+ cgi_table_data valign=top align=center class=dialog width=100% {
+ if {$qn == 0} {
+ cgi_puts [cgi_italic "No matches found"]
+ } else {
+ if {[catch {WPCmd PELdap ldapext $qn "${si}.${ni}"} leinfo]} {
+ cgi_br
+ cgi_puts [cgi_italic "Error getting entry: $leinfo"]
+ } else {
+
+ set lehead [lindex $leinfo 0]
+ set ledata [lindex $leinfo 1]
+
+ foreach item $ledata {
+ if {[string compare [string tolower [lindex $item 0]] name] == 0} {
+ set entry_name [lindex [lindex $item 1] 0]
+ break
+ }
+ }
+
+ cgi_division "style=\"padding:10\"" {
+ cgi_puts [cgi_font size=+1 "Directory Entry for \"$entry_name\""]
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width=80% "style=\"border: 1px solid goldenrod; padding: 2\"" {
+
+ set bgwhite 1
+ foreach item $ledata {
+ switch -exact -- [string tolower [lindex $item 0]] {
+ name {
+ continue;
+ }
+ voicemailtelephonenumber {
+ set fieldname "Voice Mail"
+ }
+ "email address" {
+ set do_email 1
+ set fieldname [lindex $item 0]
+ }
+ "fax telephone" {
+ set do_fax 1
+ set fieldname [lindex $item 0]
+ }
+ default {
+ set fieldname [lindex $item 0]
+ }
+ }
+
+ set itematt ""
+ if {[llength $item] > 2} {
+ set itematt [lindex $item 2]
+ }
+ if {$itematt == "objectclass"} {
+ set vals [lindex $item 1]
+ continue
+ }
+
+ if {$bgwhite == 1} {
+ set bgcolor #ffffff
+ set bgwhite 0
+ } else {
+ set bgcolor #eeeeee
+ set bgwhite 1
+ }
+
+ set vals [lindex $item 1]
+
+ cgi_table_row bgcolor=$bgcolor {
+ cgi_table_data width=25% nowrap valign=top rowspan=[llength $vals] {
+ cgi_division "style=\"padding-top:2\"" {
+ cgi_puts [cgi_bold $fieldname]
+ }
+ }
+
+ cgi_table_data rowspan=[llength $vals] {
+ cgi_puts [cgi_img [WPimg dot2] width=8]
+ }
+
+ cgi_table_data height=20px {
+ if {[info exists do_fax]} {
+ set n {[0-9]}
+ set n3 $n$n$n
+ set n4 $n$n$n$n
+ if {[regexp "^\\\+1 ($n3) ($n3)-($n4)\$" [lindex $vals 0] dummy areacode prefix number] && [lsearch -exact {206 425} $areacode] >= 0} {
+ cgi_puts [cgi_url [lindex $vals 0] compose.tcl?ldap=1&fax=yes&dir=${dir}&qn=${qn}&si=${si}&ni=${ni}&cid=[WPCmd PEInfo key]&oncancel=addrbook]
+ } else {
+ cgi_puts [lindex $vals 0]
+ }
+
+ unset do_fax
+ } elseif {[info exists do_email]} {
+ cgi_puts [cgi_url [cgi_font size=-1 face=courier [lindex $vals 0]] compose.tcl?ldap=1&dir=${dir}&qn=${qn}&si=${si}&ni=${ni}&ei=0&cid=[WPCmd PEInfo key]&oncancel=addrbook]
+ } else {
+ cgi_puts [lindex $vals 0]
+ }
+
+ set extrarows [lrange $vals 1 end]
+ }
+ }
+
+ if {[info exists extrarows]} {
+ cgi_table_row bgcolor=$bgcolor {
+ set ei 0
+ foreach extra $extrarows {
+ cgi_table_data height=20px {
+ if {[info exists do_email]} {
+ cgi_puts [cgi_url [cgi_font size=-1 face=courier $extra] compose.tcl?ldap=1&dir=${dir}&qn=${qn}&si=${si}&ni=${ni}&ei=[incr ei]&cid=[WPCmd PEInfo key]&oncancel=addrbook]
+ } else {
+ cgi_puts $extra
+ }
+ }
+ }
+ }
+
+ unset extrarows
+ }
+
+ catch {unset do_email}
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/web/cgi/alpine/1.0/ldappick.tcl b/web/cgi/alpine/1.0/ldappick.tcl
new file mode 100755
index 00000000..4a485266
--- /dev/null
+++ b/web/cgi/alpine/1.0/ldappick.tcl
@@ -0,0 +1,76 @@
+# $Id: ldappick.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# ldappick.tcl
+#
+# Purpose: CGI script to handle LDAP result choices from the
+# via the LDAP result browser generated form
+
+# Input:
+set pick_vars {
+ {cid "Missing Command ID"}
+ {field "Missing Field Name"}
+ {ldapquery "Missing LDAP Query"}
+ {ldapList "" ""}
+ {addresses "" ""}
+ {addrop {} ""}
+ {cancel {} 0}
+}
+
+# Output:
+#
+
+# read vars
+foreach item $pick_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ error [list _action "Impart Variable" $result]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ catch {WPCmd PEInfo statmsg "Invalid Command ID"}
+}
+
+if {$cancel != 1 && !([string compare cancel [string tolower $cancel]] == 0 || [string compare cancel [string tolower $addrop]] == 0) && [string length $ldapList] > 0} {
+ set ldapListStr [join $ldapList ","]
+ if {[catch {WPCmd PELdap setaddrs $ldapquery $ldapListStr $addresses 0} newaddrlist]} {
+ WPCmd PEInfo statmsg "LDAP Error: $newaddrlist"
+ } else {
+ regsub -all "'" $newaddrlist "\\'" newaddrs
+
+ if {[catch {WPCmd PEInfo set suspended_composition} msgdata]} {
+ WPCmd PEInfo statmsg "Cannot read message data: $msgdata"
+ } else {
+ if {[info exists newaddrs]} {
+ for {set i 0} {$i < [llength $msgdata]} {incr i} {
+ set orig_field [lindex [lindex $msgdata $i] 0]
+ regsub -all -- - [string tolower $orig_field] _ fn
+
+ if {[string compare $fn $field] == 0} {
+ set msgdata [lreplace $msgdata $i $i [list $orig_field $newaddrs]]
+ break
+ }
+ }
+
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} result]} {
+ WPCmd PEInfo statmsg "Cannot Update $field field: $result"
+ }
+ }
+ }
+ }
+}
+
+source [WPTFScript compose]
diff --git a/web/cgi/alpine/1.0/ldapquery.tcl b/web/cgi/alpine/1.0/ldapquery.tcl
new file mode 100755
index 00000000..c9ca6936
--- /dev/null
+++ b/web/cgi/alpine/1.0/ldapquery.tcl
@@ -0,0 +1,144 @@
+#!./tclsh
+# $Id: ldapquery.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# ldapquery.tcl
+#
+# Purpose: CGI script to handle ldap query
+
+# Input:
+set ldap_vars {
+ {dir "Missing Directory Index"}
+ {srchstr {} ""}
+ {field {} ""}
+ {op {} ""}
+ {searchtype {} ""}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+
+set ldap_menu {
+}
+
+set common_menu {
+ {
+ {}
+ {
+ {
+ # * * * * Ubiquitous INBOX link * * * *
+ if {[string compare inbox [string tolower [WPCmd PEMailbox mailboxname]]]} {
+ cgi_put [cgi_url INBOX open.tcl?folder=INBOX&colid=0&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url INBOX fr_main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * FOLDER LIST * * * *
+ cgi_puts [cgi_url "Folder List" "wp.tcl?page=folders&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * COMPOSE * * * *
+ cgi_puts [cgi_url Compose wp.tcl?page=compose&oncancel=addrbook&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * RESUME * * * *
+ cgi_puts [cgi_url Resume wp.tcl?page=resume&oncancel=addrbook&cid=[WPCmd PEInfo key] class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Addr books * * * *
+ cgi_puts [cgi_url "Address Book" wp.tcl?page=addrbook&oncancel=main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_puts [cgi_url "Get Help" "wp.tcl?page=help&oncancel=addrbook" target=_top class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ # * * * * QUIT * * * *
+ cgi_puts [cgi_url "Quit Web Alpine" "$_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=$sessid class=navbar" target=_top class=navbar]
+ }
+ }
+ }
+}
+
+
+WPEval $ldap_vars {
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_http_equiv Refresh "0; url=$_wp(serverpath)/$_wp(appdir)/$_wp(ui1dir)/ldapresult.tcl?dir=${dir}&srchstr=[WPPercentQuote ${srchstr}]&field=${field}&op=${op}&searchtype=${searchtype}&sessid=${sessid}"
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top rclass=navbar {
+ WPTFCommandMenu {} {}
+ }
+
+ cgi_table_data valign=top bgcolor=#ffffff width=100% {
+ cgi_table border=0 width=500 cellpadding=3 {
+ cgi_table_row {
+ cgi_table_data align=center "style=\"padding-top:120px\"" {
+ cgi_put "[cgi_font "style=\"font-family: arial, sans-serif; font-size:18pt; font-weight: bold\"" "Searching Directory "][cgi_img [WPimg dotblink]]"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/ldapresult.tcl b/web/cgi/alpine/1.0/ldapresult.tcl
new file mode 100755
index 00000000..efdce665
--- /dev/null
+++ b/web/cgi/alpine/1.0/ldapresult.tcl
@@ -0,0 +1,375 @@
+#!./tclsh
+# $Id: ldapresult.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# ldapquery.tcl
+#
+# Purpose: CGI script to submit ldap search
+
+# Input:
+set ldap_vars {
+ {dir "Missing Directory Index"}
+ {srchstr {} ""}
+ {field {} ""}
+ {op {} ""}
+ {searchtype {} ""}
+ {qn {} -1}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+# Command Menu definition for Message View Screen
+set ldap_menu {
+}
+
+set common_menu {
+ {
+ {}
+ {
+ {
+ # * * * * Ubiquitous INBOX link * * * *
+ if {[string compare inbox [string tolower [WPCmd PEMailbox mailboxname]]]} {
+ cgi_put [cgi_url INBOX open.tcl?folder=INBOX&colid=0&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ } else {
+ cgi_put [cgi_url INBOX fr_main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * FOLDER LIST * * * *
+ cgi_puts [cgi_url "Folder List" "wp.tcl?page=folders&cid=[WPCmd PEInfo key]" target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * COMPOSE * * * *
+ cgi_puts [cgi_url Compose wp.tcl?page=compose&oncancel=addrbook&cid=[WPCmd PEInfo key] target=_top class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * RESUME * * * *
+ cgi_puts [cgi_url Resume wp.tcl?page=resume&oncancel=addrbook&cid=[WPCmd PEInfo key] class=navbar]
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Addr books * * * *
+ cgi_puts [cgi_url "Address Book" wp.tcl?page=addrbook&oncancel=main.tcl target=_top class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_puts [cgi_url "Get Help" "wp.tcl?page=help&oncancel=addrbook" target=_top class=navbar]
+ }
+ }
+ }
+ {{cgi_puts [cgi_nbspace]}}
+ {
+ {}
+ {
+ {
+ # * * * * QUIT * * * *
+ cgi_puts [cgi_url "Quit Web Alpine" "$_wp(serverpath)/session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=$sessid class=navbar" target=_top class=navbar]
+ }
+ }
+ }
+}
+
+
+WPEval $ldap_vars {
+
+ if {[catch {WPCmd PEInfo noop} result]} {
+ error [list _action "No Op" $result]
+ }
+
+ if {$qn == -1} {
+ set ldapfilt ""
+ set numfields 0
+ if {$searchtype == 1} {
+ set srchstr ""
+ source ldapadvsrch.tcl
+ foreach item $ldap_advanced_search {
+ WPLoadCGIVarAs [lindex $item 1] tmpval
+ regsub {^ *([^ ]|[^ ].*[^ ]) *$} $tmpval "\\1" tmpval
+ if {$tmpval != ""} {
+ set ldapfilt "${ldapfilt}([lindex $item 2]=${tmpval})"
+ incr numfields
+ }
+ }
+ if {$numfields > 1} {
+ set ldapfilt "(&${ldapfilt})"
+ }
+ }
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "LDAP Query Result"
+ WPStyleSheets
+ cgi_puts "<style type='text/css'>"
+ cgi_puts ".gradient { background-image: url('[WPimg indexhdr]') ; background-repeat: repeat-x }"
+ cgi_puts "</style>"
+
+ if {$_wp(keybindings)} {
+ set kequiv {
+ {{i} {top.location = 'fr_main.tcl'}}
+ {{l} {top.location = 'wp.tcl?page=folders'}}
+ {{?} {top.location = 'wp.tcl?page=help&oncancel=addrbook'}}
+ }
+
+ lappend kequiv
+
+ set onload "onLoad=[WPTFKeyEquiv $kequiv]"
+ } else {
+ set onload ""
+ }
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" $onload {
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ #
+ # next comes the menu down the left side
+ #
+ cgi_table_data valign=top rowspan=4 class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=2 {
+ cgi_table_row {
+ cgi_table_data class=navbar style=padding-top:6 {
+ cgi_puts "Current Folder :"
+ cgi_division align=center "style=\"margin-top:4;margin-bottom:4\"" {
+ cgi_put [cgi_url [WPCmd PEMailbox mailboxname] fr_main.tcl target=_top class=navbar]
+ switch -exact -- [WPCmd PEMailbox state] {
+ readonly {
+ cgi_br
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Read Only)"]
+ }
+ closed {
+ cgi_br
+ cgi_put [cgi_span "style=color: pink; font-weight: bold" "(Closed)"]
+ }
+ ok -
+ default {}
+ }
+
+ cgi_br
+ }
+
+ cgi_hr "width=75%"
+ }
+ }
+
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar style=padding-bottom:10 {
+ WPTFCommandMenu ldap_menu common_menu
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_data valign=top align=center class=dialog width=100% {
+
+ if {$qn == -1 && [catch {WPCmd PELdap query $dir $srchstr $ldapfilt} qn]} {
+ cgi_division align=center "style=\"background-color:white; border: 1px solid goldenrod; margin: 10; padding: 4\"" {
+ cgi_puts "A problem has occured while trying to search the directory server."
+ cgi_br
+ cgi_br
+ cgi_puts [cgi_italic [cgi_bold "$qn"]]
+ cgi_br
+ cgi_br
+ cgi_puts "Try searching again by clicking [cgi_url "Address Book" wp.tcl?page=addrbook target=_top] at the left."
+ }
+ } elseif {$qn == 0} {
+ cgi_division align=center "style=\"background-color:white; border: 1px solid goldenrod; margin: 10; padding: 4\"" {
+ cgi_puts [cgi_bold "No matches for \"$srchstr\" found."]
+ cgi_br
+ cgi_br
+ cgi_puts "You can try another search below, or click a link at the left to continue your WebPine session."
+ cgi_br
+ cgi_br
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post enctype=multipart/form-data name=ldapsearch target=_top {
+ cgi_text "sessid=$_wp(sessid)" type=hidden notab
+ cgi_text "page=ldapquery" type=hidden notab
+ cgi_text "searchtype=0" type=hidden notab
+ cgi_text "dir=$dir" type=hidden notab
+
+ cgi_puts "Search Directory :"
+ cgi_text "srchstr=${srchstr}" size=35
+ cgi_submit_button "search=Search"
+ }
+
+ cgi_br
+ cgi_br
+ }
+ } elseif {[catch {WPCmd PELdap results $qn} results]} {
+ cgi_division align=center "style=\"background-color:white; border: 1px solid goldenrod; margin: 10; padding: 4\"" {
+ cgi_puts "A problem has occured while trying to retrieve the results of your directory search."
+ cgi_br
+ cgi_br
+ cgi_puts [cgi_italic [cgi_bold "$results"]]
+ cgi_br
+ cgi_br
+ cgi_puts "Try searching again by clicking [cgi_url "Address Book" wp.tcl?page=addrbook target=_top] at the left."
+ }
+ } else {
+ set numboxes 0
+ set srchindex 0
+ cgi_table border=0 cellpadding=0 cellspacing=10 width=100% {
+
+ foreach searchres $results {
+ set srchstr [lindex $searchres 0]
+ set retdata [lindex $searchres 1]
+ set expstr ""
+ cgi_table_row {
+ cgi_table_data valign=middle align=center {
+
+ if {$srchstr != ""} {
+ set expstr " for \"[cgi_bold $srchstr]\""
+ }
+
+ cgi_puts [cgi_font size=+1 "Directory Search Results${expstr}"]
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table border=0 bgcolor=white cellspacing=0 cellpadding=0 width=90% "style=\"border: 1px solid goldenrod; padding: 1\"" {
+ set whitebg 1
+ set nameindex 0
+ set onetruebox 0
+ set numsrchboxes 0
+ foreach litem $retdata {
+ if {[llength [lindex $litem 4]] > 0} {
+ incr numsrchboxes
+ if {$numsrchboxes > 1} {
+ break
+ }
+ }
+ }
+ if {$numsrchboxes == 1} {
+ set onetruebox 1
+ }
+
+ cgi_table_row class=\"gradient\" {
+ cgi_table_data align=left class=indexhdr colspan=2 {
+ cgi_put "Full Name"
+ }
+ cgi_table_data align=left class=indexhdr height=30 {
+ cgi_put "Address (Click to Compose To)"
+ }
+ }
+
+ foreach litem $retdata {
+ set name [lindex $litem 0]
+ set email [lindex $litem 4]
+ set nomail 0
+ if {$whitebg == 1} {
+ set bgcolor #FFFFFF
+ set whitebg 0
+ } else {
+ set bgcolor #EEEEEE
+ set whitebg 1
+ }
+
+ if {[llength $email] < 1} {
+ set nomail 1
+ }
+
+ if {[llength $email]} {
+ set rowspan rowspan=[llength $email]
+ } else {
+ set rowspan ""
+ }
+
+ cgi_table_row bgcolor=$bgcolor {
+
+ cgi_table_data valign=top nowrap $rowspan {
+ regsub -all "<" $name "\\&lt;" name
+ regsub -all ">" $name "\\&gt;" name
+ # cgi_puts "$name"
+ cgi_puts "[WPurl "ldapentry.tcl?dir=${dir}&qn=${qn}&si=${srchindex}&ni=${nameindex}&email=[llength $email]" "" "$name" ""]"
+ }
+
+ cgi_table_data $rowspan {
+ cgi_puts [cgi_img [WPimg dot2] width=8]
+ }
+
+ cgi_table_data nowrap height=20px {
+ if {[llength $email] >= 1} {
+ set extrarows [lrange $email 1 end]
+ cgi_put [cgi_url [cgi_font size=-1 face=courier [lindex $email 0]] compose.tcl?ldap=1&dir=${dir}&qn=${qn}&si=${srchindex}&ni=${nameindex}&ei=0&cid=[WPCmd PEInfo key]&oncancel=addrbook]
+ } else {
+ cgi_puts [cgi_italic "&lt;No email information&gt;"]
+ }
+ }
+ }
+
+ if {[info exists extrarows] && [llength $extrarows]} {
+ cgi_table_row bgcolor=$bgcolor {
+ set ei 0
+ foreach extra $extrarows {
+ cgi_table_data height=20px {
+ cgi_put [cgi_url [cgi_font size=-1 face=courier $extra] compose.tcl?ldap=1&dir=${dir}&qn=${qn}&si=${srchindex}&ni=${nameindex}&ei=0&cid=[WPCmd PEInfo key]&oncancel=addrbook]
+ }
+ }
+ }
+
+ unset extrarows
+ }
+
+ incr nameindex
+ }
+ }
+ }
+ }
+ incr srchindex
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/main.tcl b/web/cgi/alpine/1.0/main.tcl
new file mode 100755
index 00000000..24881868
--- /dev/null
+++ b/web/cgi/alpine/1.0/main.tcl
@@ -0,0 +1,84 @@
+# $Id: main.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+
+# Input:
+
+# Output:
+#
+
+proc save_hack {} {
+ if {[catch {WPImport f_name "x"}] == 0 && [catch {WPImport f_colid "x"}] == 0} {
+ append parms "&f_name=${f_name}&f_colid=${f_colid}"
+
+ if {[catch {WPImport send "x"}] == 0} {
+ append parms "&send=${send}"
+ }
+
+ return $parms
+ }
+
+ error "not saving"
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+ WPExportCookie sessid "$_wp(sessid)@[info hostname]" $_wp(appdir)/$_wp(ui1dir)
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "WebPine"
+ }
+
+ cgi_frameset "cols=112,*" frameborder=0 framespacing=0 {
+ cgi_frame gen=common.tcl?m=[WPCmd PEMailbox mailboxname]&c=[WPCmd PEInfo key]&v=[WPScriptVersion common]&q=[WPCmd PEInfo feature quit-without-confirm] title="Navigation Commands"
+
+ if {[catch {WPCmd PEInfo set wp_spec_script} script]} {
+ set script fr_index.tcl
+ }
+
+ set parms ""
+
+ if {[info exists frame_vars]} {
+ foreach v $frame_vars {
+ if {[string length [subst $[lindex $v 0]]]} {
+ append parms "&[lindex $v 0]=[subst $[lindex $v 0]]"
+ }
+ }
+ }
+
+ switch -regexp $script {
+ ^fr_view.tcl$ {
+ if {[catch {save_hack} x] == 0} {
+ append parms "&$x"
+ }
+
+ if {[catch {WPCmd PEInfo set uid} uid] == 0} {
+ append parms "&uid=$uid"
+ }
+
+ if {[catch {WPCmd PEInfo set op} op] == 0} {
+ append parms "&op=$op"
+ }
+ }
+ ^fr_index.tcl$ -
+ ^fr_main.tcl$ {
+ if {[catch {save_hack} x] == 0} {
+ append parms "&$x"
+ }
+ }
+ }
+
+ cgi_frame spec=${script}?c=[WPCmd PEInfo key]${parms} frameborder=0 title="Message List and View"
+ }
+}
diff --git a/web/cgi/alpine/1.0/open.tcl b/web/cgi/alpine/1.0/open.tcl
new file mode 100755
index 00000000..2add6db5
--- /dev/null
+++ b/web/cgi/alpine/1.0/open.tcl
@@ -0,0 +1,33 @@
+#!./tclsh
+# $Id: open.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# open.tcl
+#
+# Purpose: CGI script to perform folder opening via folders.tcl
+
+# Input:
+set open_vars {
+ {cid "Missing Command ID"}
+ {oncancel "" "folders"}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $open_vars {
+ source do_open.tcl
+}
diff --git a/web/cgi/alpine/1.0/post.tcl b/web/cgi/alpine/1.0/post.tcl
new file mode 100755
index 00000000..dcd7c37b
--- /dev/null
+++ b/web/cgi/alpine/1.0/post.tcl
@@ -0,0 +1,651 @@
+# $Id: post.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# post.tcl
+#
+# Purpose: CGI script to perform message posting via compose.tcl
+# generated form
+
+# Input:
+set post_vars {
+ {cid "Missing Command ID"}
+ {action {} ""}
+ {send {} 0}
+ {postpone {} 0}
+ {cancel {} 0}
+ {check {} 0}
+ {br_to {} 0}
+ {br_cc {} 0}
+ {br_bcc {} 0}
+ {br_reply_to {} 0}
+ {br_fcc {} 0}
+ {ex_to {} ""}
+ {ex_cc {} ""}
+ {ex_bcc {} ""}
+ {ex_reply_to {} ""}
+ {sendop {} ""}
+ {queryattach {} 0}
+ {attach {} 0}
+ {detach {} 0}
+ {extrahdrs {} ""}
+ {help {} ""}
+ {postpost {} "main.tcl"}
+ {fccattach {} 0}
+ {form_charset {} ""}
+ {form_flowed {} ""}
+}
+
+# NOT Input
+catch {
+ unset src
+}
+
+# Output:
+#
+
+proc fieldname {name} {
+ regsub -all -- {-} [string tolower $name] {_} fieldname
+ return $fieldname
+}
+
+proc expand_address_field {field _msgdata} {
+ global has_fcc
+
+ upvar 1 $_msgdata msgdata
+
+ set fn [fieldname $field]
+ for {set i 0} {$i < [llength $msgdata]} {incr i} {
+ if {[string length [lindex [lindex $msgdata $i] 1]]} {
+ set fld [lindex $msgdata $i]
+ if {[string compare [fieldname [lindex $fld 0]] $fn] == 0} {
+ if {[catch {WPCmd PEAddress expand [lindex $fld 1] fcc} expaddr]} {
+ WPCmd PEInfo statmsg "Can't expand $field: $expaddr"
+ } else {
+ if {[lindex $expaddr 1] != 0} {
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # addresses and ldapaddrs should be set at this point
+ upvar 1 addresses a
+ upvar 1 ldapquery l
+ upvar 1 field f
+ set a [lindex $expaddr 0]
+ set l [lindex $expaddr 1]
+ set f $fn
+ return 1
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ break
+ }
+ } elseif {[string compare [lindex $expaddr 0] [lindex $fld 1]]} {
+ set msgdata [lreplace $msgdata $i $i [list [lindex $fld 0] [lindex $expaddr 0]]]
+
+ # set fcc?
+ set fccfn [lindex $expaddr 2]
+ set fccdef [WPCmd PECompose fccdefault]
+ if {[string compare to [string tolower $fn]] == 0 && [string length $fccfn]
+ && (![info exists has_fcc] || 0 == [string compare [lindex $fccdef 1] [lindex $has_fcc 1]])} {
+ for {set j 0} {$j < [llength $msgdata]} {incr j} {
+ if {[string compare fcc [fieldname [lindex [lindex $msgdata $j] 0]]] == 0} {
+ set fcc_index $j
+ break
+ }
+ }
+
+ set colid [lindex $fccdef 0]
+ if {[info exists fcc_index]} {
+ if {[string compare $fccfn [lindex [lindex [lindex $msgdata $fcc_index] 1] 1]]} {
+ lappend msgdata [list postoption [list fcc-set-by-addrbook 1]]
+ }
+
+ set msgdata [lreplace $msgdata $fcc_index $fcc_index [list Fcc [list $colid $fccfn]]]
+ } else {
+ lappend msgdata [list Fcc [list $colid $fccfn]]
+ lappend msgdata [list postoption [list fcc-set-by-addrbook 1]]
+ }
+
+ set has_fcc [list $colid $fccfn]
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return 0
+}
+
+proc chartest_value {entity} {
+ global _cgi
+
+ if {[catch {cgi_import_as ke_${entity} tc}] == 0} {
+ set tcval ""
+ if {[set j [string length $tc]]} {
+ for {set i 0} {$i < $j} {incr i} {
+ binary scan [string index $tc $i] c x
+ set x [expr ($x & 0xff)]
+ lappend tcval [format {%o} $x]
+ }
+ }
+
+ return $tcval
+ } else {
+ error "Unset testchar_$entity"
+ }
+}
+
+## read vars
+foreach item $post_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ error [list _action Postpone "Invalid Operation ID" "Click Back button to try again."]
+}
+
+# collect message data
+
+# For now the input headers have to match the postheaders
+# list. Any outside the list are ignored (and probably should
+# be to avoid hostile input). Note, postheaders is a
+# super-set of composeheaders as not all headers are meant
+# to be shown the user for composition
+if {[catch {WPCmd PECompose userhdrs} headers]} {
+ error [list _action "User Headers" $headers "Click browser's Back button to try again."]
+}
+
+if {[catch {WPCmd PECompose syshdrs} otherhdrs]} {
+ error [list _action "System Headers" $otherhdrs "Click browser's Back button to try again."]
+} else {
+ eval "lappend headers $otherhdrs"
+}
+
+foreach field $headers {
+ set hdr [string tolower [lindex $field 0]]
+ regsub -all -- {-} $hdr {_} hdr
+ WPLoadCGIVarAs $hdr val
+ switch -- $hdr {
+ attach {
+ # disregard: u/i convenience (attachments marshalled below)
+ }
+ fcc {
+ if {[string length $val]} {
+ WPLoadCGIVar colid
+ set has_fcc [list $colid $val]
+ lappend msgdata [list Fcc $has_fcc]
+ }
+ }
+ default {
+ if {[string length $val] || [lsearch -exact {subject} $hdr] >= 0} {
+ set hdrvals($hdr) $val
+ lappend msgdata [list [lindex $field 0] $val]
+ if {[lsearch -exact {to cc bcc} $hdr] >= 0} {
+ set has_$hdr 1
+ }
+ }
+ }
+ }
+}
+
+if {[info exists env(REMOTE_ADDR)]} {
+ lappend msgdata [list x-auth-received "from \[$env(REMOTE_ADDR)\] by [info hostname] via HTTP; [clock format [clock seconds] -format "%a, %d %b %Y %H:%M:%S %Z"]"]
+}
+
+if {[catch {cgi_import attachments}] == 0} {
+ foreach id [split $attachments ","] {
+ lappend msgdata [list attach $id]
+ }
+}
+
+WPLoadCGIVar body
+lappend msgdata [list body [split $body "\n"]]
+
+
+switch -exact -- $fccattach {
+ 0 -
+ 1 {
+ lappend msgdata [list postoption [list fcc-without-attachments [expr {!$fccattach}]]]
+ }
+}
+
+# pass on form's charset?
+# TURNED OFF since all compose form interaction BETTER be UTF-8
+if {0 && [string length $form_charset]} {
+ # messy charset heuristics
+ # idea is to look for planted HTML entities and see if known
+ # encoding transliterations have occured. inspired by:
+ # <http://www.cs.tut.fi/~jkorpela/chars.html#encinfo>
+
+ # test for:
+ # entity values
+ # euro (#8364)
+ # cyrillic shcha (#1060)
+ # iso-8859-15 (Latin0): euro IS 200
+ # iso-8859-1 (Latin1): thorn IS 376 or U+C3BE BUT NOT &#8220; &#254; OR &thorn;
+ # Unicode literal full width yen: U+FFE5 IS 215F (ISO-2022-JP), A1EF (EUC-JP), or 818F (Shift-JIS) and so on
+
+ # remember, the first element of each group MUST appear in compose.tcl, too
+ set cstests {}
+ set xcstests {
+ {#8364 {{{40 254} ISO-10646} {{342 202 254} UTF-8} {244 ISO-8859-15} {325 IBM-850}} {}}
+ {#1066 {{{377} KOI8-R} {312 ISO-8859-5}} {}}
+ {thorn {{376 ISO-8859-1}} {{303 276} UTF-8} {iso-8859-1 {{46 43 70 62 62 60 73} {46 43 62 65 64 73} {46 164 150 157 162 156 73}}}}
+ {tcedil {{376 ISO-8859-2}} {{46 164 143 145 144 151 154 73}}}
+ {#65509 {{{302 245} UTF-8} {{241 315} EUC-KR} {{243 244} GB2312} {{242 104} BIG5} {{241 357} EUC-JP} {{201 217} Shift-JIS} {{33 44 102 41 157 33 50 102} ISO-2022-JP}} {}}
+ }
+
+ catch {unset test_charset}
+ foreach cs $cstests {
+ # asked for test entity available?
+ if {[catch {chartest_value [lindex $cs 0]} ctest] == 0} {
+ # test for positive [re]encoding assertions
+ foreach testpos [lindex $cs 1] {
+ if {[regexp "^[lindex $testpos 0]\$" $ctest]} {
+ set test_charset [lindex $testpos 1]
+ break
+ }
+ }
+
+ if {![info exists test_charset]} {
+ set csneg [lindex [lindex $cs 2] 0]
+ foreach testneg [lindex [lindex $cs 2] 1] {
+ if {[regexp "^$testneg\$" $ctest]} {
+ if {[info exists form_charset]
+ && [string compare [string tolower $form_charset] $csneg] == 0} {
+ unset form_charset
+ break
+ }
+ }
+ }
+ } else {
+ break
+ }
+ }
+ }
+
+ if {[info exists test_charset]} {
+ lappend msgdata [list postoption [list charset $test_charset]]
+ } elseif {[info exists form_charset]} {
+ lappend msgdata [list postoption [list charset $form_charset]]
+ } else {
+ lappend msgdata [list postoption [list charset "X-UNKNOWN"]]
+ }
+} else {
+ lappend msgdata [list postoption [list charset "UTF-8"]]
+}
+
+# pass on text fomat=flowed?
+if {[string length $form_flowed]} {
+ lappend msgdata [list postoption [list flowed yes]]
+}
+
+# figure out what to do with data
+if {[string compare OK [string trim $action]] == 0 && ($send || [string compare $sendop send] == 0)} {
+ if {[info exists has_to] || [info exists has_cc] || [info exists has_bcc] || [info exists has_fcc]} {
+ # expand any nicknames
+ if {[catch {
+ set fccdef [WPCmd PECompose fccdefault]
+ for {set i 0} {$i < [llength $msgdata]} {incr i} {
+ if {[string length [lindex [lindex $msgdata $i] 1]]} {
+ set fld [lindex $msgdata $i]
+ set fn [string tolower [lindex $fld 0]]
+ switch -- $fn {
+ [Ff]cc {
+ if {[string length [lindex [lindex $fld 1] 1]]} {
+ # setup for send confirmation
+ set colidval [lindex [lindex $fld 1] 0]
+ set fccval [lindex [lindex $fld 1] 1]
+ }
+ }
+ to -
+ cc -
+ bcc -
+ reply-to {
+ set expaddr [WPCmd PEAddress expand [lindex $fld 1] {}]
+ if {[string compare [lindex $expaddr 0] [lindex $fld 1]]} {
+ set msgdata [lreplace $msgdata $i $i [list [lindex $fld 0] [lindex $expaddr 0]]]
+
+ # if expanded, update fcc?
+ if {[string compare to $fn] == 0 && [string length $fn]} {
+ set expanded_fcc [lindex $expaddr 2]
+ }
+ }
+ }
+ body {
+ if {[string length $form_flowed]} {
+ set ws "\[ \t]"
+ set nws "\[^ \t]"
+
+ set nextline [lindex [lindex $fld 1] 0]
+ for {set j 1} {$j <= [llength [lindex $fld 1]]} {incr j} {
+ set line $nextline
+ # space stuff?
+ if {[regexp "^${ws}+" $line]} {
+ set line " $line"
+ }
+
+ set nextline [lindex [lindex $fld 1] $j]
+ if {[regexp {^-- $} $line] == 0} {
+ catch {unset linetext}
+ # trim trailing WS from lines preceding those with LWS (space-stuff as needed)
+ if {[string length $nextline] == 0 || [regexp "^${ws}+(${nws}?.*)\$" $nextline dummy linetext]} {
+ set line [string trimright $line]
+ if {[info exists linetext] == 0 || [string length $linetext] == 0} {
+ set nextline ""
+ }
+ }
+
+ # break overly long lines in a flowed way
+ if {[regexp {^[^>]} $line] && [string length $line] > 1000} {
+ while {[regexp "^(${ws}*${nws}+${ws}+)$nws" [string range $line 900 end] dummy linex]} {
+ set cliplen [expr {900 + [string length $linex]}]
+ lappend newbody [string range $line 0 [expr {$cliplen - 1}]]
+ set line [string range $line $cliplen end]
+ }
+ }
+ }
+
+ lappend newbody $line
+ }
+
+ set msgdata [lreplace $msgdata $i $i [list body $newbody]]
+ }
+ }
+ default {
+ }
+ }
+ }
+ }
+ } result]} {
+ WPCmd PEInfo statmsg "Address problem: $result"
+ } else {
+ # update fcc?
+ if {[info exists expanded_fcc]
+ && (![info exists has_fcc] || 0 == [string compare [lindex $fccdef 1] [lindex $has_fcc 1]])} {
+ for {set j 0} {$j < [llength $msgdata]} {incr j} {
+ if {[string compare fcc [fieldname [lindex [lindex $msgdata $j] 0]]] == 0} {
+ set fcc_index $j
+ break
+ }
+ }
+
+ set colid [lindex $fccdef 0]
+ if {[info exists fcc_index]} {
+ set msgdata [lreplace $msgdata $fcc_index $fcc_index [list Fcc [list $colid $expanded_fcc]]]
+ } else {
+ lappend msgdata [list Fcc [list $colid $expanded_fcc]]
+ }
+ }
+
+ # do the sending...
+ set verb Send
+ set verbpast Sent
+ set postcmd PECompose
+ set postcmdopt post
+ }
+ } else {
+ WPCmd PEInfo statmsg "Send MUST include Recipients (To, Cc, Bcc, or Fcc)"
+ }
+} elseif {[string compare OK [string trim $action]] == 0 && ($postpone || [string compare $sendop postpone] == 0)} {
+ set verb Postpone
+ set verbpast Postponed
+ set postcmd PEPostpone
+ set postcmdopt append
+} elseif {$help == 1 || [string compare "get help" [string tolower $help]] == 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # fake cgi input for script
+ _cgi_set_uservar oncancel "compose&restore=1"
+ set src help
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {$check == 1 || [string compare spell [string tolower [string range $check 0 4]]] == 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ set src spell
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {$queryattach == 1 || [string compare "add attachment" [string tolower $queryattach]] == 0 || [string compare "attach" [string tolower $queryattach]] == 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # fake cgi input for script
+ set src askattach
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {$br_to == 1 || [string compare browse [string tolower $br_to]] == 0 || [string compare to [string tolower $br_to]] == 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # fake cgi input for script
+ set oncancel compose
+ _cgi_set_uservar op browse
+ _cgi_set_uservar field to
+ set src addrbrowse
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {$br_cc == 1 || [string compare browse [string tolower $br_cc]] == 0 || [string compare cc [string tolower $br_cc]] == 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # fake cgi input for script
+ set oncancel compose
+ _cgi_set_uservar op browse
+ _cgi_set_uservar field cc
+ set src addrbrowse
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {$br_bcc == 1 || [string compare browse [string tolower $br_bcc]] == 0 || [string compare bcc [string tolower $br_bcc]] == 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # fake cgi input for script
+ set oncancel compose
+ _cgi_set_uservar op browse
+ _cgi_set_uservar field bcc
+ set src addrbrowse
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {$br_reply_to == 1 || [string compare browse [string tolower $br_reply_to]] == 0 || [string compare "reply_to" [string tolower $br_reply_to]] == 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # fake cgi input for script
+ set oncancel compose
+ _cgi_set_uservar op browse
+ _cgi_set_uservar field reply-to
+ set src addrbrowse
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {$br_fcc == 1 || ($br_fcc > 0 && [string length $br_fcc] > 0)} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ # fake cgi input for script
+ _cgi_set_uservar onselect compose
+ _cgi_set_uservar oncancel compose
+ set src fldrbrowse
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {[string compare expand [string tolower $ex_to]] == 0} {
+ if {[expand_address_field To msgdata]} {
+ set src ldapbrowse
+ }
+} elseif {[string compare expand [string tolower $ex_cc]] == 0} {
+ if {[expand_address_field Cc msgdata]} {
+ set src ldapbrowse
+ }
+} elseif {[string compare expand [string tolower $ex_bcc]] == 0} {
+ if {[expand_address_field Bcc msgdata]} {
+ set src ldapbrowse
+ }
+} elseif {[string compare expand [string tolower $ex_reply_to]] == 0} {
+ if {[expand_address_field Reply-To msgdata]} {
+ set src ldapbrowse
+ }
+} elseif {[string length $extrahdrs] > 0} {
+ # save msgdata to servlet
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ if {[catch {WPCmd PEInfo set wp_extra_hdrs} extras] || $extras == 1} {
+ set toggle 0
+ } else {
+ set toggle 1
+ }
+
+ catch {WPCmd PEInfo set wp_extra_hdrs $toggle}
+
+ _cgi_set_uservar restore 1
+ set src compose
+ } else {
+ # else fall thru back into composer
+ WPCmd PEInfo statmsg "Compose Error: $errstr"
+ }
+} elseif {[string compare OK [string trim $action]] == 0 && ($cancel || [string compare $sendop cancel] == 0)} {
+ # clean up attachments
+ WPCmd PEInfo statmsg "Message cancelled"
+ catch {WPCmd PEInfo unset suspended_composition}
+ catch {WPCmd PEInfo unset wp_extra_hdrs}
+ set src ""
+} else {
+ # check for per-attachment ops
+ if {[info exists attachments]} {
+ set a [split $attachments ","]
+ for {set i 0} {$i < [llength $a]} {incr i} {
+ if {[catch {cgi_import detach_[lindex $a $i].x}] == 0} {
+ if {[catch {WPCmd PECompose unattach [lindex $a $i]} result]} {
+ WPCmd PEInfo statmsg "Unattach: $result"
+ } else {
+ set attachment_deleted [lindex $a $i]
+
+ set a [lreplace $a $i $i]
+ set attachments [join $a ","]
+
+ for {set i 0} {$i < [llength $msgdata]} {incr i} {
+ if {[string compare attach [lindex [lindex $msgdata $i] 0]] == 0 && [lindex [lindex $msgdata $i] 1] == $attachment_deleted} {
+ set msgdata [lreplace $msgdata $i $i]
+ break
+ }
+ }
+
+ WPCmd PEInfo statmsg "Attachment Removed"
+ }
+
+ break
+ }
+ }
+ }
+
+ if {![info exists attachment_deleted]} {
+ WPCmd PEInfo statmsg "Unrecognized Action"
+ }
+}
+
+#do what was asked
+if {[info exists postcmd]} {
+ if {[info exists msgdata]} {
+ if {[catch {WPCmd $postcmd $postcmdopt $msgdata} errstr]} {
+ # if auth problem, save msgdata for after we ask for credentials
+ if {([string compare NOPASSWD [string range $errstr 0 7]] == 0 || [string compare BADPASSWD [string range $errstr 0 8]] == 0)
+ && [catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+
+ if {[catch {WPCmd PEInfo authrequestor} server]} {
+ append reason "Unknown server asking for authentication. Press cancel to abort if you think this message is in error."
+ } else {
+ append reason "[cgi_nl]Enter Username and Password to connect to [cgi_bold $server]"
+ lappend params [list server $server]
+ }
+
+ if {[catch {WPCmd PESession creds 0 "{$server}"} creds] == 0 && $creds != 0} {
+ catch {WPCmd PEInfo statmsg "Invalid Username or Password"}
+ WPCmd PESession nocred 0 "{$server}"
+ }
+
+ WPCmd set reason "The server ($server) used to send this message requires authentication.[cgi_nl]"
+
+ WPCmd set cid [WPCmd PEInfo key]
+ WPCmd set authcol 0
+ WPCmd set authfolder "{$server}"
+ WPCmd set authpage [WPPercentQuote "[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=dosend"]
+ WPCmd set authcancel [WPPercentQuote "[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=compose&restore=1&cid=$cid"]
+
+ set src auth
+
+ } else {
+ # regurgitate the compose window
+ set style ""
+ set title "$verb Error: [cgi_font class=notice "$errstr"]"
+ if {[string length $errstr]} {
+ set notice "$verb FAILED: $errstr"
+ } else {
+ set notice "$verb FAILED: [WPCmd PEInfo statmsg]"
+ }
+
+ WPCmd PEInfo statmsg "$notice"
+
+ # regurgitate the compose window
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ _cgi_set_uservar restore 1
+ set src compose
+
+ unset body
+ } else {
+ }
+
+ set src compose
+ }
+ } else {
+ catch {WPCmd PEInfo unset suspended_composition}
+ WPCmd PEInfo statmsg "Message $verbpast!"
+ }
+ } else {
+ WPCmd PEInfo statmsg "No Message $verbpast!"
+ }
+
+ if {[info exists delete_me]} {
+ foreach i $delete_me {
+ catch {file delete $i}
+ }
+ }
+} elseif {![info exists src]} {
+ set style ""
+ set title "Compose Message"
+ catch {unset attachments}
+
+ # regurgitate the compose window
+ if {[catch {WPCmd PEInfo set suspended_composition $msgdata} errstr] == 0} {
+ _cgi_set_uservar restore 1
+ set src compose
+
+ unset body
+ }
+}
+
+if {[info exists src] && [string length $src]} {
+ source [WPTFScript $src]
+} else {
+ cgi_redirect "[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=$postpost"
+}
diff --git a/web/cgi/alpine/1.0/promptsave.tcl b/web/cgi/alpine/1.0/promptsave.tcl
new file mode 100755
index 00000000..c7e7c2d8
--- /dev/null
+++ b/web/cgi/alpine/1.0/promptsave.tcl
@@ -0,0 +1,149 @@
+#!./tclsh
+# $Id: promptsave.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# promptsave.tcl
+#
+# Purpose: CGI script to generate html form used to gather folder
+# name and collection for aggregate save
+
+# Input:
+# conftext :
+# params : array of key/value pairs to submit with form
+# oncancel : url to reference should user cancel dialog
+set psave_vars {
+ {uid "" 0}
+}
+
+# Output:
+#
+# HTML/CSS data representing the form for save folder dialog
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * OK * * * *
+ cgi_image_button save=[WPimg but_save] border=0 alt="Save"
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_puts [cgi_url [cgi_img [WPimg but_cancel] border=0 alt="Cancel"] wp.tcl?${oncancel}]
+ }
+ }
+ }
+}
+
+WPEval $psave_vars {
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Aggregate Save"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set help_context promptsave}
+ catch {WPCmd PEInfo set wp_index_script fr_promptsave.tcl}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
+ cgi_text page=body type=hidden notab
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data align=center valign=top class=dialog {
+ cgi_table width="80%" {
+ cgi_table_row {
+ cgi_table_data colspan=2 {
+ cgi_center {
+ cgi_puts "[cgi_nl][cgi_nl]This page provides a way to save messages to a folder"
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center nowrap class=dialog colspan=2 {
+ cgi_puts [cgi_font face=tahoma,verdana,geneva "Save for messages "]
+
+ cgi_put "Save "
+
+ if {!$uid} {
+ set n [WPCmd PEMailbox selected]
+ cgi_put "all [cgi_bold [WPcomma $n]] marked message[WPplural $n] "
+ if {[catch {WPCmd PEMessage $uid savedefault} savedefault]} {
+ set savedefault [list 1 saved-messages]
+ }
+ } else {
+ set savedefault [list 1 saved-messages]
+ }
+
+ cgi_put "to "
+ cgi_br
+
+ cgi_text "savename=[lindex $savedefault 1]" type=text size=14 maxlength=256 class=aggop style=vertical-align:middle onFocus=this.select()
+ if {[catch {WPCmd PEFolder collections} collections] == 0 && [llength $collections] > 1} {
+ cgi_put "[cgi_nbspace]in "
+ cgi_select savecolid class=aggop style=vertical-align:middle {
+ set defcol [lindex $savedefault 0]
+ set j 0
+ foreach i $collections {
+ if {$j == $defcol} {
+ set selected selected
+ } else {
+ set selected {}
+ }
+ if {[string length [set f [lindex $i 1]]] > 12} {
+ set f "[string range $f 0 10]..."
+ }
+
+ cgi_option $f value=$j $selected
+ incr j;
+ }
+ }
+ } else {
+ cgi_text "savecolid=0" type=hidden notab
+ }
+
+ cgi_br
+ cgi_puts "[cgi_nl]Click [cgi_italic Save] to save the message the folder, or [cgi_italic Cancel] to abort the save."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data class=dialog align=center colspan=2 {
+ cgi_br
+ cgi_submit_button save=Save
+ cgi_submit_button savecancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/prune.tcl b/web/cgi/alpine/1.0/prune.tcl
new file mode 100755
index 00000000..c35552e3
--- /dev/null
+++ b/web/cgi/alpine/1.0/prune.tcl
@@ -0,0 +1,74 @@
+# $Id: prune.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# post.tcl
+#
+# Purpose: CGI script to perform monthly message pruning via prunetime.tcl
+# generated form
+
+# Input:
+set prune_vars {
+ {cid "Missing Command ID"}
+ {mvcnt "Missing Move Count"}
+ {delList "" ""}
+}
+
+# Output:
+#
+
+## read vars
+foreach item $prune_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {$cid != [WPCmd PEInfo key]} {
+ error [list _action Postpone "Invalid Operation ID" "Click Back button to try again."]
+}
+
+set mvvals {}
+for {set i 0} {$i < $mvcnt} {incr i} {
+ WPLoadCGIVarAs "mv${i}" tmpmv
+ if {[string compare $tmpmv ""]} {
+ lappend mvvals $tmpmv
+ }
+}
+
+foreach mvval $mvvals {
+ set mvfrm [lindex $mvval 1]
+ set mvto [lindex $mvval 2]
+
+ if {[catch {WPCmd PEFolder rename default $mvfrm $mvto} result]} {
+ set msg "Can't Rename $mvfrm: $result"
+ } else {
+ set msg "Renaming \"${mvfrm}\" at start of month"
+ catch {WPCmd PEFolder create default $mvfrm} result
+ }
+ WPCmd PEInfo statmsg $msg
+}
+
+foreach delfldr $delList {
+ set msg ""
+ if {[catch {WPCmd PEFolder delete default $delfldr} result]} {
+ set msg "Can't delete ${delfldr}: $result"
+ } else {
+ set msg "Deleted $delfldr"
+ }
+ WPCmd PEInfo statmsg $msg
+}
+
+source [WPTFScript main]
diff --git a/web/cgi/alpine/1.0/queryattach.tcl b/web/cgi/alpine/1.0/queryattach.tcl
new file mode 100755
index 00000000..9cd7028c
--- /dev/null
+++ b/web/cgi/alpine/1.0/queryattach.tcl
@@ -0,0 +1,145 @@
+#!./tclsh
+# $Id: queryattach.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryattach.tcl
+#
+# Purpose: CGI script to generate html form used to ask for
+# attachment to composition
+
+# Input:
+
+# Output:
+#
+# HTML/CSS data representing the form
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+# make sure form's in Unicode
+set charset "UTF-8"
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ cgi_puts "Get Help"
+ }
+ }
+ }
+ {
+ {expr 0}
+ {
+ {
+ # * * * * OK * * * *
+ cgi_submit_button "attach=Add Attachment" class="navbar"
+ }
+ }
+ }
+ {
+ {expr 0}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_submit_button cancel=Cancel class="navbar"
+ }
+ }
+ }
+ {
+ {expr 0}
+ {
+ {
+ # * * * * Address/Cancel * * * *
+ cgi_submit_button doit=Done class="navbar"
+ cgi_br
+ cgi_select attachop class=navtext {
+ cgi_option "Action..." value=null
+ cgi_option Attach value=attach
+ cgi_option Cancel value=cancel
+ }
+ }
+ }
+ }
+}
+
+WPEval {} {
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=\"$charset\""
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_http_equiv Content-Type "text/html; charset=$charset"
+ WPStdHtmlHdr "Attach"
+ WPStyleSheets
+ cgi_put "<style type='text/css'>"
+ cgi_put ".filename { font-family: Courier, monospace ; font-size: 10pt }"
+ cgi_puts "</style>"
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post enctype=multipart/form-data target=_top {
+ cgi_text page=attach type=hidden notab
+ cgi_text cid=[WPCmd PEInfo key] type=hidden notab
+ if {[info exists params]} {
+ foreach p $params {
+ cgi_text "[lindex $p 0]=[lindex $p 1]" type=hidden notab
+ }
+ }
+
+ cgi_table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ cgi_table_data align=center valign=top class=dialog {
+ cgi_table border=0 width=75% cellpadding=15 {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "To attach a file to your message, enter its path and file name below, or use the [cgi_italic Browse] button to choose the file, then click [cgi_italic "Add Attachment"], or click [cgi_italic Cancel] to return to your composition without attaching anything."
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_file_button file "accept=*/*" size=30 class=filename
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "You can also provide a short description to help the message's recipient figure out what the attachment is :"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_text description= maxlength=256 size=40 class=filename
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_submit_button "attach=Add Attachment"
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/querycreate.tcl b/web/cgi/alpine/1.0/querycreate.tcl
new file mode 100755
index 00000000..b3057ab3
--- /dev/null
+++ b/web/cgi/alpine/1.0/querycreate.tcl
@@ -0,0 +1,114 @@
+#!./tclsh
+# $Id: querycreate.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# querycreate.tcl
+#
+# Purpose: CGI script to generate html form used to confirm folder
+# creation for Save
+
+# Input:
+# conftext :
+# params : array of key/value pairs to submit with form
+# oncancel : url to reference should user cancel confirmation
+set qcreate_vars {
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * OK * * * *
+ cgi_image_button create=[WPimg but_create] border=0 alt="Create"
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_puts [cgi_url [cgi_img [WPimg but_cancel] border=0 alt="Cancel"] wp.tcl?${oncancel}]
+ }
+ }
+ }
+}
+
+WPEval $qcreate_vars {
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Confirm Creation"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ if {[catch {WPCmd PEInfo set querycreate_state} qstate]} {
+
+ } else {
+ catch {WPCmd PEInfo unset querycreate_state}
+
+ set folder [lindex $qstate 0]
+ set params [lindex $qstate 1]
+
+ catch {WPCmd PEInfo set help_context create_save}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=spec {
+ if {[info exists params]} {
+ foreach p $params {
+ cgi_text "[lindex $p 0]=[lindex $p 1]" type=hidden notab
+ }
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=30 width="100%" height="100%" class=dialog {
+ cgi_table_row {
+ cgi_table_data align=center valign=top {
+ cgi_table width="80%" border=0 {
+ cgi_table_row {
+ cgi_table_data valign=top align=center {
+ cgi_puts "You are attempting to Save to a folder, [cgi_bold $folder], that does not exist."
+ cgi_br
+ cgi_puts "[cgi_nl]Click [cgi_italic Create] to create [cgi_bold $folder] and save the message, or [cgi_italic Cancel] to create nothing and return to the Message View."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_br
+ cgi_submit_button create=Create
+ cgi_submit_button savecancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/querydelfldr.tcl b/web/cgi/alpine/1.0/querydelfldr.tcl
new file mode 100755
index 00000000..e0fa960a
--- /dev/null
+++ b/web/cgi/alpine/1.0/querydelfldr.tcl
@@ -0,0 +1,121 @@
+#!./tclsh
+# $Id: querydelfldr.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# querydelfldr.tcl
+#
+# Purpose: CGI script to generate html form used to confirm
+# folder deletion
+
+# Input:
+set fldr_vars {
+ {fid "No Folder Specified"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_put "Get Help"
+ }
+ }
+ }
+}
+
+WPEval $fldr_vars {
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ error [list _action "Collection list" $collections]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Confirm Delete"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=_top {
+ cgi_text "page=folders" type=hidden notab
+ cgi_text "fid=$fid" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "frestore=1" type=hidden notab
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="75%" {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts [cgi_nl][cgi_nl][cgi_nl][cgi_nl]
+
+ regsub -all { } [lindex $fid end] {\&nbsp;} dfn
+
+ cgi_puts "Please confirm that you would like to permanently remove [cgi_bold $dfn]"
+
+ if {[llength $fid] > 2} {
+ if {[catch {WPCmd PEFolder delimiter [lindex $fid 0]} delim]} {
+ set delim /
+ }
+
+ set dirname ""
+ for {set i 1} {$i < ([llength $fid] - 1)} {incr i} {
+ append dirname "[lindex $fid $i]$delim"
+ }
+
+ if {[string length $dirname]} {
+ cgi_put " from the directory [cgi_bold $dirname] "
+ }
+ }
+ if {[llength $collections] > 1} {
+ cgi_put "in the collection '[lindex [lindex $collections [lindex $fid 0]] 1]'."
+ } else {
+ cgi_put "."
+ }
+
+ cgi_br
+ cgi_br
+ cgi_puts "Click [cgi_italic Delete] to remove the folder permanently, or [cgi_italic Cancel] to return to the Folder List."
+ cgi_br
+ cgi_br
+ cgi_submit_button delete=Delete
+ cgi_submit_button delete=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/queryexpunge.tcl b/web/cgi/alpine/1.0/queryexpunge.tcl
new file mode 100755
index 00000000..c3e552d6
--- /dev/null
+++ b/web/cgi/alpine/1.0/queryexpunge.tcl
@@ -0,0 +1,203 @@
+#!./tclsh
+# $Id: queryexpunge.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryexpunge.tcl
+#
+# Purpose: CGI script to generate html form used to confirm
+# deleted message expunge
+
+# Input (Assumed set by sourcing script):
+# fn : Name of folder getting expunged
+# delcount : Number of deleted messages
+
+# Output:
+#
+# HTML/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+
+WPEval {} {
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Confirm Expunge"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set help_context expunge}
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/fr_index method=get name=confirm target=spec {
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+
+ set mbn [WPCmd PEMailbox mailboxname]
+ cgi_table border=0 cellspacing=8 cellpadding=8 width="75%" {
+
+ if {[catch {WPCmd PEMailbox flagcount deleted} delcount] == 0 && $delcount > 0
+ && [catch {WPCmd PEMailbox messagecount} messcount] == 0} {
+
+ cgi_table_row {
+ cgi_table_data align=center valign=middle height=50 {
+ cgi_table bgcolor=yellow background=[WPimg dstripe] cellpadding=6 {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table bgcolor=black cellpadding=6 {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts [cgi_font size=+2 color=yellow [cgi_bold "CAUTION!"]]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if {$delcount == $messcount} {
+ switch $delcount {
+ 1 {
+ set m1 "The [cgi_bold only] message in the folder [cgi_bold $mbn] is deleted."
+ set m2 "that [cgi_bold single] message"
+ }
+ 2 {
+ set m1 "[cgi_bold Both] messages in the folder [cgi_bold $mbn] are deleted."
+ set m2 "[cgi_bold "both"] messages"
+ }
+ default {
+ set m1 "[cgi_span "style=font-weight: bold; color: red" "All $messcount messages"] in the folder [cgi_bold $mbn] are marked for deletion. This includes any messages that might <u>not</u> be <u>visible</u> on the screen."
+ set m2 "[cgi_bold [cgi_span "style=font-size: bigger; color: red; text-decoration: underline" "all messages"]]"
+ }
+ }
+
+ append m1 "[cgi_nl][cgi_nl]Expunge now will leave this folder "
+ append m1 "[cgi_span "style=font-weight: bold; color: red" empty]. "
+ #append m1 "[cgi_nl][cgi_nl]Please acknowledge below that you understand there will be [cgi_span "style=font-weight: bold; color: red" "no more messages"] within this folder when the expunge is complete."
+ append m1 "[cgi_nl][cgi_nl][cgi_buffer {cgi_checkbox "emptyit=1"}] "
+ append m1 "I acknowledge expunge will leave folder [cgi_bold $mbn] [cgi_span "style=font-weight: bold; color: red" empty]."
+ set style "style=\"border: 1px solid #663333; background-color: #ffcc66;\""
+ set m3 ALL
+ } else {
+ if {$delcount > 1} {
+ set whch are
+ set plrl "s"
+ } else {
+ set whch is
+ set plrl ""
+ }
+
+ set m1 "Your folder [cgi_bold $mbn] contains $messcount messages, of which [cgi_bold $delcount] $whch deleted."
+ set m2 "[cgi_span "style=font-size: bigger; font-weight: bold" $delcount] message${plrl}"
+ set m3 $delcount
+ set style ""
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center $style {
+ cgi_puts $m1
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "Do you wish to [cgi_span "style=color: red ; font-weight: bold" "permanently remove"] $m2 now?"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_submit_button "expunge=Yes, Remove $m3 message[WPplural $delcount]" tabindex=2
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_submit_button "cancel=No, Return to '$mbn'" tabindex=1 checked selected default
+ }
+ }
+ } else {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "There are [cgi_bold no] messages currently marked for deletion in the folder [cgi_bold [WPCmd PEMailbox mailboxname]]."
+ }
+ }
+
+ if {[WPCmd PEInfo feature enable-aggregate-command-set]} {
+ switch [WPCmd PEInfo aggtabstate] {
+ 0 {
+ lappend methods "Click the [cgi_img [WPimg slideout] style=vertical-align:middle] tab to expose aggregate operations"
+ lappend methods "Place a mark in the checkbox next to each desired message"
+ lappend methods "Click the [cgi_italic Delete] button"
+ }
+ 1 {
+ lappend methods "Place a mark in the checkbox next to each desired message"
+ lappend methods "Click the [cgi_italic Delete] button"
+ }
+ 2 {
+ lappend methods "Place a mark in the checkbox next to each desired message"
+ lappend methods "Within the Message Status box, choose [cgi_bold Deleted] from the drop-down list of flag choices"
+ lappend methods "Click the [cgi_italic Set] button"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "To mark a message for deletion while viewing it, simply click the [cgi_italic Delete] button at the top of the Message View page."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "To mark messages for deletion in the Message List:"
+ cgi_number_list {
+ foreach i $methods {
+ cgi_li $i
+ }
+ }
+ }
+ }
+ } else {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "To mark a message for deletion, click the [cgi_italic Delete] button while viewing the message."
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "Click [cgi_italic OK] to return to the Message List."
+ cgi_br
+ cgi_br
+ cgi_submit_button cancel=OK
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/queryimport.tcl b/web/cgi/alpine/1.0/queryimport.tcl
new file mode 100755
index 00000000..1f40bad2
--- /dev/null
+++ b/web/cgi/alpine/1.0/queryimport.tcl
@@ -0,0 +1,146 @@
+#!./tclsh
+# $Id: queryimport.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryimport.tcl
+#
+# Purpose: CGI script to generate html form used to ask for
+# importing a folder
+
+# Input:
+set import_vars {
+ {fid "No Collection Specified"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the form
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {expr {0}}
+ {
+ {
+ cgi_puts "Get Help"
+ }
+ }
+ }
+}
+
+WPEval $import_vars {
+
+ set colid [lindex $fid 0]
+ if {[llength $fid] > 1} {
+ set fpath [eval "file join [lrange $fid 1 end]"]
+ } else {
+ set fpath ""
+ }
+
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ catch {WPCmd PEInfo statmsg "Can't Import: $collections"}
+ cgi_http_head {
+ cgi_redirect [cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders.tcl
+ }
+ } elseif {$colid < 0 || $colid > [llength $collections]} {
+ catch {WPCmd PEInfo statmsg "Can't Import: Invalid collection: $colid"}
+ cgi_http_head {
+ cgi_redirect [cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=folders.tcl
+ }
+ } else {
+
+ if {[string length $fpath]} {
+ set coldesc "the directory [cgi_bold $fpath] within "
+ }
+
+ append coldesc "the collection [cgi_bold [lindex [lindex $collections $colid] 1]]"
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Import"
+ WPStyleSheets
+ cgi_put "<style type='text/css'>"
+ cgi_put ".filename { font-family: Courier, monospace ; font-size: 10pt }"
+ cgi_puts "</style>"
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post enctype=multipart/form-data target=_top {
+ cgi_text page=folders type=hidden notab
+ cgi_text cid=[WPCmd PEInfo key] type=hidden notab
+ cgi_text fid=$fid type=hidden notab
+
+ cgi_table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ cgi_table_data align=center valign=top class=dialog {
+ cgi_table border=0 width=75% cellpadding=15 {
+ cgi_table_row {
+ cgi_table_data align=center "style=\"padding-top:30\"" {
+ cgi_puts "Folder Import copies a mail folder, typically created by the Export command, from the computer your browser is running on into a new Web Alpine folder. [cgi_nbspace]Successful Import consists of three steps."
+ cgi_p
+ cgi_puts "First, enter the path and filename of the folder below. Use the [cgi_italic Browse] button to help choose the file."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_file_button file "accept=*/*" size=30 class=filename
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "Second, provide a [cgi_bold unique] name for the imported folder to be assigned within $coldesc:"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_text iname= maxlength=256 size=40 class=filename
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts "Finally, click [cgi_italic "Import File"] to copy the folder into WebPine, or [cgi_italic Cancel] to return to the folder list."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_submit_button "import=Import File" class=navtext
+ cgi_submit_button cancel=Cancel class=navtext
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/querynewdir.tcl b/web/cgi/alpine/1.0/querynewdir.tcl
new file mode 100755
index 00000000..e2adeaae
--- /dev/null
+++ b/web/cgi/alpine/1.0/querynewdir.tcl
@@ -0,0 +1,113 @@
+#!./tclsh
+# $Id: querynewdir.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# querynewfldr.tcl
+#
+# Purpose: CGI script to generate html form used to confirm
+# folder creation
+
+# Input:
+set fldr_vars {
+ {fid "No Collection Specified"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_put "Get Help"
+ }
+ }
+ }
+}
+
+WPEval $fldr_vars {
+
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ error [list _action "Collection list" $collections]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder Creation"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set help_context diradd}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=_top {
+ cgi_text "page=folders" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden
+ cgi_text "fid=$fid" type=hidden
+ cgi_text "frestore=1" type=hidden
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="70%" {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts [cgi_nl][cgi_nl][cgi_nl][cgi_nl]
+ cgi_puts "Please enter the name of the directory you would like to add"
+ if {[llength $fid] > 1} {
+ cgi_put " to the directory '[join [lrange $fid 1 end] /]'"
+ }
+ if {[llength $collections] > 1} {
+ cgi_put "in the collection '[lindex [lindex $collections [lindex $fid 0]] 1]'."
+ } else {
+ cgi_put "."
+ }
+ cgi_br
+ cgi_br
+ cgi_put "New directory name: "
+ cgi_text directory= maxlength=64 size=25%
+ cgi_br
+ cgi_br
+ cgi_puts "Click 'Create' to add a new directory by that name, or 'Cancel' to return to the Folder List."
+ cgi_br
+ cgi_br
+ cgi_submit_button newdir=Create
+ cgi_submit_button newdir=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/querynewfldr.tcl b/web/cgi/alpine/1.0/querynewfldr.tcl
new file mode 100755
index 00000000..598b6db6
--- /dev/null
+++ b/web/cgi/alpine/1.0/querynewfldr.tcl
@@ -0,0 +1,112 @@
+#!./tclsh
+# $Id: querynewfldr.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# querynewfldr.tcl
+#
+# Purpose: CGI script to generate html form used to confirm
+# folder creation
+
+# Input:
+set fldr_vars {
+ {fid "No Collection Specified"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_put [cgi_url "Get Help" wp.tcl?page=help&oncancel=folders class=navbar target=_top]
+ }
+ }
+ }
+}
+
+WPEval $fldr_vars {
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ error [list _action "Collection list" $collections]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder Creation"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set help_context foldadd}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=_top {
+ cgi_text "page=folders" type=hidden notab
+ cgi_text "fid=$fid" type=hidden
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden
+ cgi_text "frestore=1" type=hidden
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="70%" {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts [cgi_nl][cgi_nl][cgi_nl][cgi_nl]
+ cgi_puts "Please enter the name of the folder you would like to add"
+ if {[llength $fid] > 1} {
+ cgi_put " to the directory '[join [lrange $fid 1 end] /]'"
+ }
+ if {[llength $collections] > 1} {
+ cgi_put " in the collection '[lindex [lindex $collections [lindex $fid 0]] 1]'."
+ } else {
+ cgi_put "."
+ }
+ cgi_br
+ cgi_br
+ cgi_put "New folder name: "
+ cgi_text folder= maxlength=64 size=25%
+ cgi_br
+ cgi_br
+ cgi_puts "Click 'Create' to add a new folder by that name, or 'Cancel' to return to the Folder List."
+ cgi_br
+ cgi_br
+ cgi_submit_button newfolder=Create
+ cgi_submit_button newfolder=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/querynewfoldir.tcl b/web/cgi/alpine/1.0/querynewfoldir.tcl
new file mode 100755
index 00000000..13c20126
--- /dev/null
+++ b/web/cgi/alpine/1.0/querynewfoldir.tcl
@@ -0,0 +1,131 @@
+#!./tclsh
+# $Id: querynewfoldir.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# querynewfoldir.tcl
+#
+# Purpose: CGI script to generate html form used to confirm
+# folder and directory creation
+# Input:
+set fldr_vars {
+ {fid "No Collection Specified"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_put [cgi_url "Get Help" wp.tcl?page=help&oncancel=folders class=navbar target=_top]
+ }
+ }
+ }
+}
+
+WPEval $fldr_vars {
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ error [list _action "Collection list" $collections]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder Creation"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set help_context foldiradd}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=_top {
+ cgi_text "page=folders" type=hidden notab
+ cgi_text "fid=$fid" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "frestore=1" type=hidden notab
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ if {[llength $fid] > 1} {
+ set Dirpref "Subd"
+ set dirpref "subd"
+ } else {
+ set Dirpref "D"
+ set dirpref "d"
+ }
+
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="70%" {
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_br
+ cgi_put "Folders are used to contain messages. Typically, messages are placed in folders when you [cgi_italic Save] them from the Message View"
+ if {[WPCmd PEInfo feature enable-aggregate-command-set]} {
+ cgi_puts " or Message List pages."
+ } else {
+ cgi_puts "page."
+ }
+
+ cgi_put "To create a new folder"
+
+ if {[llength $fid] > 1} {
+ cgi_put " within the directory [cgi_bold [join [lrange $fid 1 end] /]]"
+ }
+ if {[llength $collections] > 1} {
+ cgi_put " in the collection [cgi_bold [lindex [lindex $collections [lindex $fid 0]] 1]]"
+ }
+
+ cgi_put ", enter the name below and click [cgi_italic "Create New Folder"]."
+ cgi_br
+ cgi_br
+
+ cgi_put "Furthermore, folders can be created within directories. The directory can either be one that now exists "
+ cgi_put " or one that you wish to create along with the new folder. "
+ cgi_put "Simply specify the directory name before the folder name separating the two with a &quot;[WPCmd PEFolder delimiter [lindex $fid 0]]&quot; character."
+ cgi_br
+ cgi_br
+ cgi_put "New folder name: "
+ cgi_text folder= maxlength=64 size=25%
+ cgi_br
+ cgi_br
+ cgi_submit_button "newfolder=Create New Folder" "style=\"margin-right: 10px\""
+ cgi_submit_button cancelled=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/querynick.tcl b/web/cgi/alpine/1.0/querynick.tcl
new file mode 100755
index 00000000..1e794822
--- /dev/null
+++ b/web/cgi/alpine/1.0/querynick.tcl
@@ -0,0 +1,171 @@
+#!./tclsh
+# $Id: querynick.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# querynick.tcl
+#
+# Purpose: CGI script to generate html form used to deal
+# with existing/taken nickname collision
+#
+
+# Input:
+set nick_vars {
+ {book "Missing address book"}
+ {nick {} ""}
+ {add {} 0}
+ {fn {} ""}
+ {addrs {} ""}
+ {fcc {} ""}
+ {comment {} ""}
+ {take {} 0}
+ {newnick {} ""}
+ {ai {} -1}
+}
+
+# Output:
+#
+
+# Command Menu
+set nick_menu {
+}
+
+set common_menu {
+ {
+ {}
+ {
+ {
+ cgi_puts "Get Help"
+ }
+ }
+ }
+}
+
+
+# Output:
+# Query prompt to deal with existing/taken nickname collision
+#
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $nick_vars {
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Take to New Entry or List"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ #catch {WPCmd PEInfo set help_context samenick}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=samenick target=_top {
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top class=navbar {
+ cgi_table bgcolor=$_wp(menucolor) border=0 cellspacing=0 cellpadding=2 {
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar {
+ WPTFCommandMenu nick_menu common_menu
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_data valign=top class=navbar {
+
+ cgi_text "page=addrsave" type=hidden notab
+ cgi_text "oncancel=main" type=hidden notab
+ cgi_text "take=1" type=hidden notab
+ cgi_text "ai=${ai}" type=hidden notab
+ cgi_text "book=${book}" type=hidden notab
+ cgi_text "nick=${nick}" type=hidden notab
+ cgi_text "fn=${fn}" type=hidden notab
+ cgi_text "addrs=${addrs}" type=hidden notab
+ cgi_text "fcc=${fcc}" type=hidden notab
+ cgi_text "comment=${comment}" type=hidden notab
+ cgi_text "newnick=${newnick}" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=15 width="75%" {
+ cgi_table_row {
+ cgi_table_data align=center colspan=2 "xstyle=padding-top:20;padding-bottom:20" {
+ cgi_puts "An address book entry with the nickname \"[cgi_bold $newnick]\" already exists. At this point you may click either:"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_submit_button "replace=Replace Entry"
+ }
+ cgi_table_data "xstyle=padding:15" {
+ cgi_puts "Replace the \"[cgi_bold $newnick]\" address book entry with your [cgi_italic Take] selection."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_submit_button "replace=Add to Entry"
+ }
+ cgi_table_data "xstyle=padding:15" {
+ if {[string first "," $addrs] >= 0} {
+ set plur "es"
+ } else {
+ set plur ""
+ }
+
+ cgi_puts "Add the address${plur} from your [cgi_italic Take] selection to the existing entry's addresses to create a list."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_submit_button "replace=Edit"
+ }
+ cgi_table_data "xstyle=padding:15" {
+ cgi_puts "Go back to editing your [cgi_italic Take] selection."
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_submit_button "cancel=Cancel"
+ }
+ cgi_table_data "xstyle=padding:15" {
+ cgi_puts "Or, Cancel your [cgi_italic Take] selection altogether."
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/queryprune.tcl b/web/cgi/alpine/1.0/queryprune.tcl
new file mode 100755
index 00000000..896bc333
--- /dev/null
+++ b/web/cgi/alpine/1.0/queryprune.tcl
@@ -0,0 +1,170 @@
+#!./tclsh
+# $Id: queryprune.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryprune.tcl
+#
+# After we've already determined that it's the
+# beginning of the month (logon.tcl), we check
+# what folders need pruning and offer them to
+# the user. Currently doesn't do automatic
+# reload.
+
+# Input:
+set prunetime_vars {
+ {cid "Missing Command ID"}
+ {start "Missing Start Page"}
+ {nojs "" 0}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set prune_menu {
+ {
+ {}
+ {
+ {
+ # * * * * DONE * * * *
+ cgi_submit_button prune=Continue
+ }
+ }
+ }
+}
+
+
+WPEval $prunetime_vars {
+ catch {WPCmd PEInfo prunetime} prunefldrs
+ set allclean 1
+ set delstuff 0
+ set askstuff 0
+ foreach prunefldr $prunefldrs {
+ if {[llength [lindex $prunefldr 1]] > 0 || [llength [lindex $prunefldr 2]] > 0} {
+ set allclean 0
+ }
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Monthly Folder Pruning"
+ WPStdScripts
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ cgi_form [file join $_wp(appdir) $_wp(ui1dir) wp] method=post name=pruneit target=_top {
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+
+ cgi_table_row {
+ # next comes the menu down the left side
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu prune_menu {}
+ }
+ }
+
+ cgi_table_data valign=top align=center class=dialog "style=\"padding: 20\"" {
+
+ if {$allclean == 1} {
+ catch {WPCmd PEInfo statmsg "Pruning Failed: $prunefldrs"}
+ cgi_puts "No folders appear to need cleaning up this month."
+ cgi_br
+ cgi_puts "Please click [cgi_url "here" $start target=_top] to continue your session."
+ } else {
+ cgi_puts "At the beginning of every month, you are asked if you would like to clean up your sent-mail folder(s). Please answer the following questions and click [cgi_italic Continue]."
+ cgi_text "sessid=$_wp(sessid)" type=hidden notab
+ cgi_text "op=pruneit" type=hidden notab
+ cgi_text "cid=${cid}" type=hidden notab
+ cgi_text "page=prune" type=hidden notab
+ set cnt 0
+ foreach prunefldr $prunefldrs {
+ set type [lindex $prunefldr 0]
+ set mv [lindex $prunefldr 1]
+ set dellist [lindex $prunefldr 2]
+
+ cgi_table border=0 cellpadding=8 cellspacing=0 "style=\"padding-top: 8\"" {
+ if {[llength $mv] > 1} {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts [cgi_bold "Move current &quot;[lindex $mv 0]&quot; to &quot;[lindex $mv 1]&quot;?"]
+ }
+ }
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table "style=\"padding-left: 20\"" {
+ cgi_table_data {
+ cgi_radio_button "mv${cnt}=mv [lindex $mv 0] [lindex $mv 1]" checked class=body
+ }
+ cgi_table_data {
+ cgi_puts "Yes"
+ }
+ cgi_table_data {
+ cgi_radio_button "mv${cnt}=" class=body
+ }
+ cgi_table_data {
+ cgi_puts "No"
+ }
+ }
+ }
+ }
+ incr cnt
+ }
+ if {[llength $dellist] > 0} {
+ cgi_table_row {
+ cgi_table_data {
+ set plurtxt ""
+ set typetxt ""
+ if {[llength $dellist] > 1} {
+ set plurtxt "s"
+ }
+ if {[string compare $type ""] != 0} {
+ set typetxt "[string toupper $type] "
+ }
+ cgi_puts "[cgi_bold "To save disk space, delete the following ${typetxt}mail folder${plurtxt}:"] (Check to delete)"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table "style=\"padding-left: 20\"" {
+ foreach del $dellist {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_checkbox "delList=$del" "style=\"background-color: #FFFFFF; padding-right: 8\""
+ cgi_puts "$del "
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ cgi_text "mvcnt=${cnt}" type=hidden notab
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/queryquit.tcl b/web/cgi/alpine/1.0/queryquit.tcl
new file mode 100755
index 00000000..8c86078c
--- /dev/null
+++ b/web/cgi/alpine/1.0/queryquit.tcl
@@ -0,0 +1,196 @@
+#!./tclsh
+# $Id: queryquit.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryquit.tcl
+#
+# Purpose: CGI script to generate html form used to confirm quitting
+# webpine while offering to expunge deleted
+
+# Input:
+# conftext :
+# params : array of key/value pairs to submit with form
+# oncancel : url to reference should user cancel confirmation
+set quit_vars {
+ {cid "Command ID"}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * OK * * * *
+ cgi_image_button quit=[WPimg but_create] border=0 alt="Create"
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_puts [cgi_url [cgi_img [WPimg but_cancel] border=0 alt="Cancel"] wp.tcl?${oncancel}]
+ }
+ }
+ }
+}
+
+WPEval $quit_vars {
+
+ if {$cid != [WPCmd PEInfo key]} {
+ error "Invalid Command ID"
+ }
+
+ catch {WPCmd PESession expungecheck quit} prompts
+
+ set qhid ""
+ set delsexist 0
+ set askinbox 1
+ set askcurrent 1
+ set ewc [WPCmd PEInfo feature expunge-without-confirm]
+ set ewce [WPCmd PEInfo feature expunge-without-confirm-everywhere]
+
+ foreach prompt $prompts {
+ if {[lindex $prompt 1] > 0} {
+ set delsexist 1
+ }
+ if {[lindex $prompt 1] > 0 && ($ewc || $ewce) && [lindex $prompt 2] == 1} {
+ set askinbox 0
+ lappend qhid [cgi_buffer {cgi_text expinbox=1 type=hidden notab}]
+ } elseif {[lindex $prompt 1] > 0 && [lindex $prompt 2] == 0 && ($ewce || ($ewc && [lindex $prompt 3] == 1))} {
+ set askcurrent 0
+ lappend qhid [cgi_buffer {cgi_text expcurrent=1 type=hidden notab}]
+ }
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Quitting Web Alpine"
+ WPStdScripts
+ WPStyleSheets
+ cgi_put "<style type='text/css'>"
+ cgi_put ".expungebox { background-color:AntiqueWhite }"
+ cgi_put ".clickit { cursor: pointer }"
+ cgi_puts "</style>"
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ #catch {WPCmd PEInfo set help_context quit}
+ cgi_table width=100% height=100% cellspacing=0 cellpadding=0 {
+ cgi_table_row {
+ cgi_table_data width=112 bgcolor=$_wp(bordercolor) {
+ cgi_put [cgi_img [WPimg dot2]]
+ }
+
+ cgi_table_data align=center valign=top bgcolor="$_wp(dialogcolor)" {
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/do_quit method=get id=quitting target=_top {
+ cgi_text cid=$cid type=hidden notab
+ cgi_text sessid=$sessid type=hidden notab
+ foreach q $qhid {
+ cgi_puts $q
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=10 width="70%" class=dialog "style=padding-top:12%" {
+ cgi_table_row {
+ cgi_table_data valign=top {
+ cgi_puts [cgi_font size=+1 "Really Quit WebPine?"]
+ }
+ }
+ cgi_table_row {
+ cgi_table_data valign=top {
+ cgi_table cellpadding=10 border=0 {
+ if {$delsexist} {
+ cgi_table_row {
+ cgi_table_data valign=middle class=expungebox "style=\"border: 1px solid red\"" {
+ if {[llength $prompts] > 1} {
+ set ftext "[lindex [lindex $prompts 0] 0] and [lindex [lindex $prompts 1] 0]"
+ } else {
+ set ftext "[lindex [lindex $prompts 0] 0]"
+ }
+
+ cgi_put "This is a good opportunity to permanently remove from ${ftext} all of the messages you have marked for deletion."
+ cgi_br
+ cgi_br
+ cgi_table border=0 cellpadding=4 {
+ set expiexists 0
+ set expcexists 0
+ set inbhit 0
+ set curhit 0
+ foreach prompt $prompts {
+ set numdels [lindex $prompt 1]
+ set fname [lindex $prompt 0]
+ set inboxflag [lindex $prompt 2]
+ set incflag [lindex $prompt 3]
+ if {$inboxflag} {
+ incr inbhit
+ } else {
+ incr curhit
+ }
+ if {$numdels && (($askinbox && $inboxflag) || ($askcurrent && $inboxflag == 0))} {
+ cgi_table_row {
+ set cbn "cb[expr {$inbhit + $curhit}]"
+ cgi_table_data align=right valign=top {
+ if {$inboxflag} {
+ cgi_checkbox "expinbox" class=expungebox id=$cbn checked
+ incr expiexists
+ } else {
+ cgi_checkbox "expcurrent" class=expungebox id=$cbn checked
+ incr expcexists
+ }
+ }
+ cgi_table_data align=left {
+ set t "Expunge ${numdels} deleted message[expr {($numdels > 1) ? "s" : ""}] from ${fname}."
+ cgi_put [cgi_span class=clickit onclick=\"flipCheck('$cbn')\" $t]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center valign=middle {
+ cgi_br
+ cgi_submit_button "quit=Yes, Quit Now"
+ cgi_put [cgi_img [WPimg dot2] width=10]
+ cgi_submit_button "cancel=No, Return to [WPCmd PEMailbox mailboxname]"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/queryrenfldr.tcl b/web/cgi/alpine/1.0/queryrenfldr.tcl
new file mode 100755
index 00000000..d84b303d
--- /dev/null
+++ b/web/cgi/alpine/1.0/queryrenfldr.tcl
@@ -0,0 +1,109 @@
+#!./tclsh
+# $Id: queryrenfldr.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryrenfldr.tcl
+#
+# Purpose: CGI script to generate html form used to confirm
+# folder creation
+
+# Input:
+set fldr_vars {
+ {fid "No Collection Specified"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the message specified
+# by the 'uid' argument
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * HELP * * * *
+ cgi_put "Get Help"
+ }
+ }
+ }
+}
+
+WPEval $fldr_vars {
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ error [list _action "Collection list" $collections]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Folder Creation"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=confirm target=_top {
+ cgi_text "page=folders" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden
+ cgi_text "fid=$fid" type=hidden
+ cgi_text "frestore=1" type=hidden
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="70%" {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts [cgi_nl][cgi_nl][cgi_nl][cgi_nl]
+ cgi_puts "Please enter the new name of the folder '[lindex $fid end]'"
+ if {[llength $fid] > 2} {
+ cgi_put " in the directory '[join [lrange $fid 1 [expr {[llength $fid] - 2}]]]'"
+ }
+ if {[llength $collections] > 1} {
+ cgi_put " in the collection '[lindex [lindex $collections [lindex $fid 0]] 1]'."
+ } else {
+ cgi_put "."
+ }
+ cgi_br
+ cgi_br
+ cgi_put "Rename [cgi_bold [lindex $fid end]] to: "
+ cgi_text folder= maxlength=64 size=25%
+ cgi_br
+ cgi_br
+ cgi_puts "Click 'Rename' to permanently change the folder name, or 'Cancel' to return to the Folder List."
+ cgi_br
+ cgi_br
+ cgi_submit_button rename=Rename
+ cgi_submit_button rename=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/querysave.tcl b/web/cgi/alpine/1.0/querysave.tcl
new file mode 100755
index 00000000..0bfdf59d
--- /dev/null
+++ b/web/cgi/alpine/1.0/querysave.tcl
@@ -0,0 +1,98 @@
+#!./tclsh
+# $Id: querysave.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# querysave.tcl
+#
+# Purpose: CGI script to generate html form used to gather folder
+# name and collection for aggregate save
+
+# Input:
+# conftext :
+# params : array of key/value pairs to submit with form
+# oncancel : url to reference should user cancel dialog
+set qsave_vars {
+}
+
+# Output:
+#
+# HTML/CSS data representing the form for save folder dialog
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * OK * * * *
+ cgi_image_button save=[WPimg but_save] border=0 alt="Save"
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * CANCEL * * * *
+ cgi_puts [cgi_url [cgi_img [WPimg but_cancel] border=0 alt="Cancel"] wp.tcl?${oncancel}]
+ }
+ }
+ }
+}
+
+WPEval $qsave_vars {
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Aggregate Save"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get {
+ if {[info exists params]} {
+ foreach p $params {
+ cgi_text "[lindex $p 0]=[lindex $p 1]" type=hidden notab
+ }
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_text "page=selsave" type=hidden notab
+ cgi_text "by=text" type=hidden notab
+ cgi_text "postpage=index" type=hidden notab
+
+ cgi_puts [cgi_nl][cgi_nl][cgi_nl][cgi_nl]
+ cgi_puts "You are attempting to Save to a folder, '$folder', that does not exist."
+ cgi_br
+ cgi_puts "[cgi_nl]Click 'Create' to create the folder and save the message, or 'Cancel' to abort the save."
+ }
+ cgi_table_row {
+ cgi_table_data {
+ cgi_submit_button save=Save
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+}
diff --git a/web/cgi/alpine/1.0/resume.tcl b/web/cgi/alpine/1.0/resume.tcl
new file mode 100755
index 00000000..7a45333a
--- /dev/null
+++ b/web/cgi/alpine/1.0/resume.tcl
@@ -0,0 +1,169 @@
+#!./tclsh
+# $Id: resume.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# resume.tcl
+#
+# Purpose: CGI script to browse postponed messages
+
+# Input:
+set resume_vars {
+ {oncancel "" main.tcl}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+
+set resume_cmds {
+ {
+ {}
+ {
+ {
+ cgi_puts [cgi_url "Get Help" wp.tcl?page=help&oncancel=resume target=_top class=navbar]
+ }
+ }
+ }
+}
+
+WPEval $resume_vars {
+
+ if {![info exists oncancel]} {
+ WPLoadCGIVarAs oncancel oncancel
+ }
+
+ if {[catch {WPCmd PEPostpone list} postponed]} {
+ error [list _action Resume $postponed "Click Back button to try again."]
+ }
+
+ set charset [lindex $postponed 1]
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=\"$charset\""
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_http_equiv Content-Type "text/html; charset=$charset"
+ WPStdHtmlHdr "Postponed Messages"
+ WPStyleSheets
+ cgi_puts "<style type='text/css'>"
+ cgi_puts ".gradient { background-image: url('[WPimg indexhdr]') ; background-repeat: repeat-x }"
+ cgi_puts "</style>"
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set help_context resume}
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+ cgi_table_row {
+ # next comes the menu down the left side
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu resume_cmds {}
+ }
+ }
+
+ cgi_table_data width=100% valign=top class=dialog {
+
+ cgi_table border=0 cellspacing=0 cellpadding=0 width=100% {
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post target=_top {
+ cgi_text "page=compose" type=hidden notab
+ cgi_text "style=Postponed" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "oncancel=$oncancel" type=hidden notab
+
+
+ set n 1
+ set fmt {{to Recipient} {date Date} {subj Subject}}
+ cgi_table_row class=\"gradient\" {
+ cgi_table_data class=indexhdr height=$_wp(indexheight) {
+ cgi_puts [cgi_nbspace]
+ }
+
+ foreach i $fmt {
+ cgi_table_data class=indexhdr {
+ cgi_puts [lindex $i 1]
+ }
+ }
+ }
+
+ set checked ""
+ set last [llength [lindex $postponed 0]]
+ for {set i 0} {$i < $last} {incr i} {
+
+ # cgi_html_comment [lindex [lindex $postponed 0] $i]
+ array set pa [join [lindex [lindex $postponed 0] $i]]
+
+ if {[info exists pa(uid)] == 0} {
+ continue;
+ }
+
+ if {$i % 2} {
+ set bgcolor #EEEEEE
+ } else {
+ set bgcolor #FFFFFF
+ }
+
+ if {[expr $i + 1] == $last} {
+ set checked checked
+ }
+
+ cgi_table_row bgcolor=$bgcolor {
+ cgi_table_data valign=top nowrap bgcolor=$bgcolor {
+ cgi_radio_button "uid=$pa(uid)" style="background-color:$bgcolor" $checked
+ }
+
+ foreach j $fmt {
+ cgi_table_data bgcolor=$bgcolor {
+ if {[info exists pa([lindex $j 0])]} {
+ cgi_puts $pa([lindex $j 0])
+ } else {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+ }
+
+ set checked ""
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center colspan=24 {
+ cgi_br
+ cgi_submit_button "resume=Resume Chosen Message"
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center colspan=24 {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=_top {
+ cgi_text "page=$oncancel" type=hidden notab
+ cgi_br
+ cgi_submit_button "cancel=Cancel"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/ripcord.tcl b/web/cgi/alpine/1.0/ripcord.tcl
new file mode 100755
index 00000000..3514d20e
--- /dev/null
+++ b/web/cgi/alpine/1.0/ripcord.tcl
@@ -0,0 +1,64 @@
+#!./tclsh
+# $Id: ripcord.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# ripcord.tcl
+#
+# Purpose: CGI script to generate html page used to arm
+# short server timeout
+
+# Input:
+set rip_vars {
+ {t "" 10}
+ {cid "Command ID"}
+}
+
+# Output:
+#
+# HTML/CSS data representing the form
+
+# inherit global config
+source ./alpine.tcl
+
+WPEval $rip_vars {
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Adjusting Session Timeout"
+ }
+
+ cgi_body BGCOLOR=#ffffff {
+ if {[string compare $cid [WPCmd PEInfo key]]} {
+ cgi_put "Messing around, heh?"
+ } else {
+ cgi_put "Making Web Alpine Server Adjustments."
+ cgi_br
+ cgi_put "This should only take a momment..."
+ if {[catch {WPCmd PESession abandon 10}] == 0} {
+ set gonow 1
+ }
+ }
+
+ cgi_script type="text/javascript" language="JavaScript" {
+ if {[info exists gonow]} {
+ cgi_puts "window.close();"
+ } else {
+ cgi_puts "window.setInterval('window.close()',5000);"
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/seldate.tcl b/web/cgi/alpine/1.0/seldate.tcl
new file mode 100755
index 00000000..e8e07c6f
--- /dev/null
+++ b/web/cgi/alpine/1.0/seldate.tcl
@@ -0,0 +1,193 @@
+#!./tclsh
+# $Id: seldate.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# seldate.tcl
+#
+# Purpose: CGI script to generate html form used to gather info
+# for date selection
+
+# Input:
+set select_vars {
+ {uid "" 0}
+}
+
+# Output:
+#
+# HTML/CSS data representing form for date select input
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $select_vars {
+
+ if {$uid} {
+ if {[catch {WPCmd PEMessage $uid number} thisnum]} {
+ set uid 0
+ }
+ } else {
+ set thisnum ""
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Search By Date"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set wp_index_script fr_seldate.tcl}
+ catch {WPCmd PEInfo set help_context seldate}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
+ cgi_text page=index type=hidden notab
+ cgi_text doselect=1 type=hidden notab
+ cgi_text by=date type=hidden notab
+ if {![WPCmd PEMailbox selected]} {
+ cgi_text result=broad type=hidden notab
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data align=center valign=top class=dialog {
+ cgi_table width="80%" {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_center {
+ cgi_puts "[cgi_nl]This page provides a way to search for messages in [cgi_bold [WPCmd PEMailbox mailboxname]] based on arrival time."
+ cgi_puts "[cgi_nl][cgi_nl]Messages arriving [cgi_italic On] the date entered below will be marked with a check in the box next to their line in the Message List. Choosing [cgi_italic Since] marks messages arriving between today and the giving date (including the given date). Choosing [cgi_italic Before] marks messages arriving before (but not on) the given date."
+ cgi_puts "[cgi_nl][cgi_nl]Choose a date below and click 'Search' to choose messages, or 'Cancel' to return to the Message List.[cgi_nl][cgi_nl]"
+ }
+ }
+ }
+
+ if {[WPCmd PEMailbox selected]} {
+ cgi_table_row class=dialog {
+ cgi_table_data colspan=2 align=center valign=middle class=dialog {
+ cgi_put [cgi_font face=tahoma,verdana,geneva "Since some messages are already marked, choose whether criteria specified here should "]
+ cgi_select result {
+ cgi_option "search all messages in '[WPCmd PEMailbox mailboxname]'" value=broad selected
+ cgi_option "search within marked messages only." value=narrow
+ cgi_option "discard previous marks and search anew." value=new
+ }
+
+ cgi_br
+ cgi_br
+ cgi_br
+ }
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_put [cgi_font face=tahoma,verdana,geneva "Messages dated "]
+
+ cgi_select datecase {
+ foreach i {On Since Before} {
+ cgi_option $i value=[string tolower $i]
+ }
+ }
+
+ cgi_br
+ cgi_br
+
+ cgi_select datemon {
+ if {$uid} {
+ set today [string tolower [WPCmd PEMessage $uid date month]]
+ } else {
+ set today [string tolower [clock format [clock seconds] -format %b]]
+ }
+
+ set months {
+ January jan
+ February feb
+ March mar
+ April Apr
+ May may
+ June jun
+ July jul
+ August aug
+ September sep
+ October oct
+ November nov
+ December dec
+ }
+
+ foreach {x y} $months {
+ if {$y == $today} {
+ cgi_option $x value=$y selected
+ } else {
+ cgi_option $x value=$y
+ }
+ }
+ }
+
+ cgi_select dateday {
+ if {$uid} {
+ set today [WPCmd PEMessage $uid date day]
+ } else {
+ set today [clock format [clock seconds] -format %d]
+ }
+
+ for {set i 1} {$i <= 31} {incr i} {
+ set v [format "%.2d" $i]
+ if {$v == $today} {
+ cgi_option $i value=$v selected
+ } else {
+ cgi_option $i value=$v
+ }
+ }
+ }
+
+ cgi_put ",[cgi_nbspace]"
+ cgi_select dateyear {
+ if {$uid} {
+ set now [WPCmd PEMessage $uid date year]
+ } else {
+ set now [clock format [clock seconds] -format "%Y"]
+ }
+
+ cgi_option $now value=$now selected
+ for {set n [expr $now - 1]} {$n >= 1970} {incr n -1} {
+ cgi_option $n value=$n
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_br
+ cgi_submit_button ok=Search
+ cgi_submit_button cancel=Cancel
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_puts [cgi_nl][cgi_nl][cgi_font size=-1 "Note, if the number of messages in this folder is larger than the number of lines in the Message List, then some matching messages may not be visible without paging/scrolling."]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/select.tcl b/web/cgi/alpine/1.0/select.tcl
new file mode 100755
index 00000000..915254c7
--- /dev/null
+++ b/web/cgi/alpine/1.0/select.tcl
@@ -0,0 +1,303 @@
+#!./tclsh
+# $Id: select.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# select.tcl
+#
+# Purpose: CGI script to generate html form used to gather info
+# for message searching selection
+
+# Input:
+set select_vars {
+}
+
+# Output:
+#
+# HTML/CSS data representing form for text select input
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $select_vars {
+ set selcount [WPCmd PEMailbox selected]
+
+ # given a uid, called from View page so use it for defaults
+ # otherwise if only one selected, use it for defaults
+ set thisuid 0
+ # leave disabled for now
+ if {0 && $uid > 0} {
+ set thisuid $uid
+ } elseif {$selcount == 1} {
+ }
+
+ if {$thisuid} {
+ if {[catch {WPCmd PEMessage $thisuid number} thisnum]} {
+ set thisuid 0
+ }
+ } else {
+ set thisnum ""
+ }
+
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Select By Text"
+ WPStyleSheets
+ cgi_put "<style type='text/css'>"
+ cgi_put ".standout { width: 90%; text-align: center; font-size: smaller; border: 1px solid #663333; background-color: #ffcc66; padding-bottom: 8; margin-top: 8; margin-bottom: 12 }"
+ cgi_puts "</style>"
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" class=dialog "style=\"padding-left: 8%; padding-right: 8%\"" {
+
+ #catch {WPCmd PEInfo set wp_index_script fr_select.tcl}
+ catch {WPCmd PEInfo set help_context select}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
+ cgi_text "page=index" type=hidden notab
+ cgi_text "doselect=1" type=hidden notab
+ set mailboxname [WPCmd PEMailbox mailboxname]
+ cgi_division align=center class=dialog "style=\"padding-top:6; padding-bottom:8\"" {
+ cgi_puts "This page provides a way to search for specific messages within the currently open folder, [cgi_bold $mailboxname]. Simply fill in the criteria below and click the associated [cgi_italic Search] button. All messages matching the criteria will be marked with a check in the box next to their line in the Message List.[cgi_nl][cgi_nl]"
+ cgi_puts "Click [cgi_italic Cancel] to return to the Message List without searching."
+ }
+
+ if {$selcount > 0} {
+ cgi_center {
+ cgi_division class=standout {
+ cgi_put "The folder '$mailboxname' has ${selcount} message"
+ if {[string length [WPplural $selcount]]} {
+ cgi_put "s with their checkboxes marked."
+ } else {
+ cgi_put " with its checkbox marked."
+ }
+
+ cgi_put "[cgi_nl]The Search specified below should"
+
+ cgi_select result {
+ cgi_option "apply to entire folder, adding result to those now marked" value=broad selected
+ cgi_option "apply only to marked messages, unmarking messages not matched" value=narrow
+ cgi_option "discard previous marks and search anew" value=new
+ }
+ }
+ }
+ } else {
+ cgi_text result=broad type=hidden notab
+ }
+
+ cgi_put "<fieldset>"
+ cgi_put "<legend>[cgi_bold "Search for Text in Message Headers or Body"]</legend>"
+ cgi_center {
+ cgi_put [cgi_font class=dialog "Select messages with text "]
+ cgi_select textcase {
+ cgi_option "in" value=ton
+ cgi_option "NOT in" value=not
+ }
+
+ cgi_br
+ cgi_br
+
+ cgi_put [cgi_font face=tahoma,verdana,geneva "the message's "]
+ if {$thisuid} {
+ set fromaddr [WPCmd PEMessage $thisuid fromaddr]
+ set deftext $fromaddr
+ } else {
+ if {[catch {WPCmd PEInfo set wp_def_search_text} deftext]} {
+ set deftext ""
+ }
+ }
+
+ set fields {
+ {Subject: field} subj ""
+ {From: field} from selected
+ {To: field} to ""
+ {Cc: field} cc ""
+ {recipient fields} recip ""
+ {participant fields} partic ""
+ {text, anywhere} any ""
+ }
+
+ cgi_select field {
+ foreach {x y z} $fields {
+ cgi_option $x value=$y $z
+ }
+ }
+
+ cgi_br
+ cgi_br
+ cgi_put [cgi_font face=tahoma,verdana,geneva "matching "]
+ cgi_text text=$deftext size=20 maxlength=256
+
+ if {$thisuid} {
+ set ft [WPJSQuote $fromaddr]
+ set tt [WPJSQuote [WPCmd PEMessage $thisuid toaddr]]
+ set st [WPJSQuote [WPCmd PEMessage $thisuid subject]]
+ if {[string length $ft] || [string length $tt] || [string length $st]} {
+ cgi_put "[cgi_nl]Using "
+ cgi_select defs {
+ cgi_option "- Nothing -" ""
+ if {[string length $ft]} {
+ cgi_option "From Address" value=$ft selected
+ }
+ if {[string length $tt]} {
+ cgi_option "To Address" value=$tt
+ }
+ if {[string length $st]} {
+ cgi_option "Subject Text" value=$st
+ }
+ }
+ cgi_put " of message ${thisnum}"
+ }
+ }
+
+ cgi_br
+ cgi_br
+ cgi_submit_button "selectop=Search Text"
+ cgi_submit_button cancel=Cancel
+ }
+ cgi_put "</fieldset>"
+
+ cgi_put "<fieldset>"
+ cgi_put "<legend>[cgi_bold "Search for Messages by Date"]</legend>"
+ cgi_center {
+ cgi_put "Messages dated "
+
+ cgi_select datecase {
+ foreach i {On Since Before} {
+ cgi_option $i value=[string tolower $i]
+ }
+ }
+
+ cgi_br
+ cgi_br
+
+ cgi_select datemon {
+ if {$thisuid} {
+ set today [string tolower [WPCmd PEMessage $thisuid date month]]
+ } else {
+ set today [string tolower [clock format [clock seconds] -format %b]]
+ }
+
+ set months {
+ January jan
+ February feb
+ March mar
+ April Apr
+ May may
+ June jun
+ July jul
+ August aug
+ September sep
+ October oct
+ November nov
+ December dec
+ }
+
+ foreach {x y} $months {
+ if {$y == $today} {
+ cgi_option $x value=$y selected
+ } else {
+ cgi_option $x value=$y
+ }
+ }
+ }
+
+ cgi_select dateday {
+ if {$thisuid} {
+ set today [WPCmd PEMessage $thisuid date day]
+ } else {
+ set today [clock format [clock seconds] -format %d]
+ }
+
+ for {set i 1} {$i <= 31} {incr i} {
+ set v [format "%.2d" $i]
+ if {$v == $today} {
+ cgi_option $i value=$v selected
+ } else {
+ cgi_option $i value=$v
+ }
+ }
+ }
+
+ cgi_put ",[cgi_nbspace]"
+ cgi_select dateyear {
+ if {$thisuid} {
+ set now [WPCmd PEMessage $thisuid date year]
+ } else {
+ set now [clock format [clock seconds] -format "%Y"]
+ }
+
+ cgi_option $now value=$now selected
+ for {set n [expr $now - 1]} {$n >= 1970} {incr n -1} {
+ cgi_option $n value=$n
+ }
+ }
+
+ cgi_br
+ cgi_br
+ cgi_submit_button "selectop=Search Date"
+ cgi_submit_button cancel=Cancel
+ }
+ cgi_put "</fieldset>"
+
+ cgi_put "<fieldset>"
+ cgi_put "<legend>[cgi_bold "Search for Messages with Certain Status Settings"]</legend>"
+ cgi_center {
+ cgi_puts [cgi_font face=tahoma,verdana,geneva "Messages "]
+ cgi_select statcase {
+ cgi_option "flagged" value=ton
+ cgi_option "NOT flagged" value=not
+ }
+
+ cgi_puts "[cgi_font face=tahoma,verdana,geneva " :"][cgi_nl][cgi_nl]"
+
+ cgi_table border=0 cellpadding=2 cellspacing=0 {
+ set statuses {
+ Important imp
+ New new
+ Answered ans
+ Deleted del
+ }
+
+ foreach {x y} $statuses {
+ cgi_table_row {
+ cgi_table_data align=right width="42%" {
+ cgi_radio_button flag=$y
+ }
+
+ cgi_table_data align=left {
+ cgi_put $x
+ }
+ }
+ }
+ }
+
+ cgi_br
+ cgi_submit_button "selectop=Search Status"
+ cgi_submit_button cancel=Cancel
+ }
+ cgi_put "</fieldset>"
+
+ cgi_center {
+ cgi_division class=standout {
+ cgi_puts "Note, if the number of messages in this folder is larger than the number of lines in the Message[cgi_nbspace]List, then some matching messages may not be visible without paging/scrolling."
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/select2.tcl b/web/cgi/alpine/1.0/select2.tcl
new file mode 100755
index 00000000..745254e7
--- /dev/null
+++ b/web/cgi/alpine/1.0/select2.tcl
@@ -0,0 +1,318 @@
+#!./tclsh
+# $Id: select2.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# select.tcl
+#
+# Purpose: CGI script to generate html form used to gather info
+# for message searching selection
+
+# Input:
+set select_vars {
+}
+
+# Output:
+#
+# HTML/CSS data representing form for text select input
+
+# coerce uid to zero since there's not method in WPL yet to initiate
+# a search from a particular message.
+set uid 0
+
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $select_vars {
+ if {$uid} {
+ if {[catch {WPCmd PEMessage $uid number} thisnum]} {
+ set uid 0
+ }
+ } else {
+ set thisnum ""
+ }
+
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Select By Text"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set wp_index_script fr_select.tcl}
+ catch {WPCmd PEInfo set help_context select}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
+ cgi_text "page=index" type=hidden notab
+ cgi_text "doselect=1" type=hidden notab
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data align=center valign=top class=dialog {
+ cgi_table width="80%" {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_center {
+ cgi_puts "[cgi_nl][cgi_nl]This page provides a way to search for specific messsages within the currently open folder, [cgi_bold [WPCmd PEMailbox mailboxname]]. Simply fill in the criteria below and click the assoicated [cgi_italic Search] button. All messages matching the criteria will be marked with a check in the box next to their line in the Message List.[cgi_nl][cgi_nl]"
+ cgi_puts "Click [cgi_italic Cancel] to return to the Message List without searching.[cgi_nl]"
+ }
+ }
+ }
+
+ if {[WPCmd PEMailbox selected]} {
+ cgi_table_row class=dialog {
+ cgi_table_data colspan=2 align=center valign=middle class=dialog {
+ cgi_put [cgi_font face=tahoma,verdana,geneva "Since some messages are already marked, choose whether criteria specified here should "]
+ cgi_select result {
+ cgi_option "search all messages in '[WPCmd PEMailbox mailboxname]'" value=broad selected
+ cgi_option "search within marked messages only." value=narrow
+ cgi_option "discard previous marks and search anew." value=new
+ }
+
+ cgi_br
+ cgi_br
+ }
+ }
+ } else {
+ cgi_text result=broad type=hidden notab
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data {
+ cgi_table width=100% border=2 cellpadding=8 {
+ cgi_table_row {
+ cgi_table_data bgcolor=#CC9900 {
+ cgi_radio_button by=text
+ }
+
+ cgi_table_data valign=top align=center nowrap class=dialog {
+ cgi_put [cgi_bold "Search for Text in Message Headers or Body"]
+ cgi_br
+ cgi_br
+ cgi_put "Select messages with text "
+ cgi_select textcase {
+ cgi_option "in" value=ton
+ cgi_option "NOT in" value=not
+ }
+
+ cgi_br
+ cgi_br
+
+ cgi_put [cgi_font face=tahoma,verdana,geneva "the message's "]
+ if {$uid} {
+ set fromaddr [WPCmd PEMessage $uid fromaddr]
+ set deftext $fromaddr
+ } else {
+ set deftext ""
+ }
+
+ set fields {
+ {Subject: field} subj ""
+ {From: field} from selected
+ {To: field} to ""
+ {Cc: field} cc ""
+ {recipient fields} recip ""
+ {participant fields} partic ""
+ {text, anywhere} any ""
+ }
+
+ cgi_select field {
+ foreach {x y z} $fields {
+ cgi_option $x value=$y $z
+ }
+ }
+
+ cgi_br
+ cgi_br
+ cgi_put [cgi_font face=tahoma,verdana,geneva "matching "]
+ cgi_text text=$deftext size=20 maxlength=256
+
+ if {$uid} {
+ set ft [WPJSQuote $fromaddr]
+ set tt [WPJSQuote [WPCmd PEMessage $uid toaddr]]
+ set st [WPJSQuote [WPCmd PEMessage $uid subject]]
+ if {[string length $ft] || [string length $tt] || [string length $st]} {
+ cgi_put "[cgi_nl]Using "
+ cgi_select defs {
+ cgi_option "- Nothing -" ""
+ if {[string length $ft]} {
+ cgi_option "From Address" value=$ft selected
+ }
+ if {[string length $tt]} {
+ cgi_option "To Address" value=$tt
+ }
+ if {[string length $st]} {
+ cgi_option "Subject Text" value=$st
+ }
+ }
+ cgi_put " of message ${thisnum}"
+ }
+ }
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data bgcolor=#CC9900 {
+ cgi_radio_button by=date
+ }
+
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_put [cgi_bold "Search for Messages by Date"]
+ cgi_br
+ cgi_br
+ cgi_put "Messages dated "
+
+ cgi_select datecase {
+ foreach i {On Since Before} {
+ cgi_option $i value=[string tolower $i]
+ }
+ }
+
+ cgi_br
+ cgi_br
+
+ cgi_select datemon {
+ if {$uid} {
+ set today [string tolower [WPCmd PEMessage $uid date month]]
+ } else {
+ set today [string tolower [clock format [clock seconds] -format %b]]
+ }
+
+ set months {
+ January jan
+ February feb
+ March mar
+ April Apr
+ May may
+ June jun
+ July jul
+ August aug
+ September sep
+ October oct
+ November nov
+ December dec
+ }
+
+ foreach {x y} $months {
+ if {$y == $today} {
+ cgi_option $x value=$y selected
+ } else {
+ cgi_option $x value=$y
+ }
+ }
+ }
+
+ cgi_select dateday {
+ if {$uid} {
+ set today [WPCmd PEMessage $uid date day]
+ } else {
+ set today [clock format [clock seconds] -format %d]
+ }
+
+ for {set i 1} {$i <= 31} {incr i} {
+ set v [format "%.2d" $i]
+ if {$v == $today} {
+ cgi_option $i value=$v selected
+ } else {
+ cgi_option $i value=$v
+ }
+ }
+ }
+
+ cgi_put ",[cgi_nbspace]"
+ cgi_select dateyear {
+ if {$uid} {
+ set now [WPCmd PEMessage $uid date year]
+ } else {
+ set now [clock format [clock seconds] -format "%Y"]
+ }
+
+ cgi_option $now value=$now selected
+ for {set n [expr $now - 1]} {$n >= 1970} {incr n -1} {
+ cgi_option $n value=$n
+ }
+ }
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data bgcolor=#CC9900 {
+ cgi_radio_button by=status
+ }
+
+ cgi_table_data class=dialog align=center {
+ cgi_put [cgi_bold "Search for Messages with Certain Flag Settings"]
+ cgi_br
+ cgi_br
+ cgi_puts [cgi_font face=tahoma,verdana,geneva "Messages "]
+ cgi_select statcase {
+ cgi_option "flagged" value=ton
+ cgi_option "NOT flagged" value=not
+ }
+
+ cgi_puts [cgi_font face=tahoma,verdana,geneva " :"]
+
+ cgi_table {
+ set statuses {
+ Important imp
+ New new
+ Answered ans
+ Deleted del
+ }
+
+ foreach {x y} $statuses {
+ cgi_table_row {
+ cgi_table_data align=right width="42%" {
+ cgi_radio_button flag=$y
+ }
+
+ cgi_table_data align=left {
+ cgi_put $x
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center nowrap class=dialog {
+ cgi_br
+ cgi_submit_button ok=Search
+ cgi_submit_button cancel=Cancel
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data colspan=2 valign=top align=center class=dialog {
+ cgi_br
+ cgi_br
+ cgi_puts [cgi_nl][cgi_nl][cgi_font size=-1 "Note, if the number of messages in this folder is larger than the number of lines in the Message List, then some matching messages may not be visible without paging/scrolling."]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/selstat.tcl b/web/cgi/alpine/1.0/selstat.tcl
new file mode 100755
index 00000000..0af0be61
--- /dev/null
+++ b/web/cgi/alpine/1.0/selstat.tcl
@@ -0,0 +1,156 @@
+#!./tclsh
+# $Id: selstat.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# selstat.tcl
+#
+# Purpose: CGI script to generate html form used to gather info
+# for status selection
+
+# Input:
+set select_vars {
+ {uid "" 0}
+}
+
+# Output:
+#
+# HTML/CSS data representing form for status select input
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $select_vars {
+ if {$uid} {
+ if {[catch {WPCmd PEMessage $uid number} thisnum]} {
+ set uid 0
+ }
+ } else {
+ set thisnum ""
+ }
+
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Search By Status"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set help_context selstat}
+ catch {WPCmd PEInfo set wp_index_script fr_selstat.tcl}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
+ cgi_text page=index type=hidden notab
+ cgi_text doselect=1 type=hidden notab
+ cgi_text by=status type=hidden notab
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data align=center valign=top class=dialog {
+ cgi_table width="80%" {
+ cgi_table_row {
+ cgi_table_data colspan=2 {
+ cgi_center {
+ cgi_puts "[cgi_nl][cgi_nl]This page provides a way to search for messages in [cgi_bold [WPCmd PEMailbox mailboxname]] based on their status flags. Messages matching the status selected below will be marked with a check in the box next to their line in the Message List."
+ cgi_puts "[cgi_nl][cgi_nl]Choose the status criteria below and click 'Search', or 'Cancel' to return to the Message List.[cgi_nl][cgi_nl]"
+ }
+ }
+
+ if {[WPCmd PEMailbox selected]} {
+ cgi_table_row class=dialog {
+ cgi_table_data colspan=2 align=center valign=middle class=dialog colspan=2 {
+ cgi_put [cgi_font face=tahoma,verdana,geneva "Since some messages are already marked, choose whether criteria specified here should "]
+ cgi_select result {
+ cgi_option "search all messages in '[WPCmd PEMailbox mailboxname]'" value=broad selected
+ cgi_option "search within marked messages only." value=narrow
+ cgi_option "discard previous marks and search anew." value=new
+ }
+
+ cgi_br
+ cgi_br
+ }
+ }
+ } else {
+ cgi_text result=broad type=hidden notab
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center nowrap class=dialog colspan=2 {
+ cgi_puts [cgi_font face=tahoma,verdana,geneva "Search for messages "]
+ cgi_select statcase {
+ cgi_option "flagged" value=ton
+ cgi_option "NOT flagged" value=not
+ }
+
+ cgi_puts [cgi_font face=tahoma,verdana,geneva " :"]
+ }
+ }
+
+ set statuses {
+ Important imp
+ New new
+ Answered ans
+ Deleted del
+ }
+
+ if {0} {
+ cgi_table_row {
+ cgi_table_data align=center colspan=2 {
+ cgi_select flag {
+ foreach {x y} $statuses {
+ cgi_option $x value=$y
+ }
+ }
+ }
+ }
+ } else {
+ foreach {x y} $statuses {
+ cgi_table_row {
+ cgi_table_data align=right width="42%" {
+ cgi_radio_button flag=$y
+ }
+
+ cgi_table_data align=left {
+ cgi_put $x
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data class=dialog align=center colspan=2 {
+ cgi_br
+ cgi_submit_button ok=Search
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center class=dialog colspan=2 {
+ cgi_puts [cgi_nl][cgi_nl][cgi_font size=-1 "Note, if the number of messages in this folder is larger than the number of lines in the Message List, then some matching messages may not be visible without paging/scrolling."]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/web/cgi/alpine/1.0/seltext.tcl b/web/cgi/alpine/1.0/seltext.tcl
new file mode 100755
index 00000000..e0ce33bb
--- /dev/null
+++ b/web/cgi/alpine/1.0/seltext.tcl
@@ -0,0 +1,181 @@
+#!./tclsh
+# $Id: seltext.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# seltext.tcl
+#
+# Purpose: CGI script to generate html form used to gather info
+# for text selection
+
+# Input:
+set select_vars {
+}
+
+# Output:
+#
+# HTML/CSS data representing form for text select input
+
+# coerce uid to zero since there's not method in WPL yet to initiate
+# a search from a particular message.
+set uid 0
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+WPEval $select_vars {
+ if {$uid} {
+ if {[catch {WPCmd PEMessage $uid number} thisnum]} {
+ set uid 0
+ }
+ } else {
+ set thisnum ""
+ }
+
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Search for Text"
+ WPStyleSheets
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+
+ catch {WPCmd PEInfo set wp_index_script fr_seltext.tcl}
+ catch {WPCmd PEInfo set help_context seltext}
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get name=auth target=body {
+ cgi_text "page=index" type=hidden notab
+ cgi_text "doselect=1" type=hidden notab
+ cgi_text "by=text" type=hidden notab
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data align=center valign=top class=dialog {
+ cgi_table width="80%" {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_center {
+ cgi_puts "[cgi_nl][cgi_nl]This page provides a way to search for specific text in the messsages contained in [cgi_bold [WPCmd PEMailbox mailboxname]]. Enter your selection criteria below, and click [cgi_italic Search]. All messages matching the criteria will be marked with a check in the box next to their line in the Message List."
+ cgi_br
+ cgi_br
+ cgi_puts "Click [cgi_italic Cancel] to return to the Message List without searching.[cgi_nl][cgi_nl]"
+ }
+ }
+ }
+
+
+ if {[WPCmd PEMailbox selected]} {
+ cgi_table_row class=dialog {
+ cgi_table_data colspan=2 align=center valign=middle class=dialog {
+ cgi_put [cgi_font face=tahoma,verdana,geneva "Since some messages are already marked, choose whether criteria specified here should "]
+ cgi_select result {
+ cgi_option "search all messages in '[WPCmd PEMailbox mailboxname]'" value=broad selected
+ cgi_option "search within marked messages only." value=narrow
+ cgi_option "discard previous marks and search anew." value=new
+ }
+
+ cgi_br
+ cgi_br
+ }
+ }
+ } else {
+ cgi_text result=broad type=hidden notab
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center nowrap class=dialog {
+ cgi_put [cgi_font face=tahoma,verdana,geneva "Search for messages with text "]
+ cgi_select textcase {
+ cgi_option "in" value=ton
+ cgi_option "NOT in" value=not
+ }
+
+ cgi_br
+ cgi_br
+
+ cgi_put [cgi_font face=tahoma,verdana,geneva "the message's "]
+ if {$uid} {
+ set fromaddr [WPCmd PEMessage $uid fromaddr]
+ set deftext $fromaddr
+ } else {
+ set deftext ""
+ }
+
+ set fields {
+ {Subject: field} subj ""
+ {From: field} from selected
+ {To: field} to ""
+ {Cc: field} cc ""
+ {recipient fields} recip ""
+ {participant fields} partic ""
+ {text, anywhere} any ""
+ }
+
+ cgi_select field {
+ foreach {x y z} $fields {
+ cgi_option $x value=$y $z
+ }
+ }
+
+ cgi_br
+ cgi_br
+ cgi_put [cgi_font face=tahoma,verdana,geneva "matching "]
+ cgi_text text=$deftext size=30 maxlength=256
+
+ if {$uid} {
+ set ft [WPJSQuote $fromaddr]
+ set tt [WPJSQuote [WPCmd PEMessage $uid toaddr]]
+ set st [WPJSQuote [WPCmd PEMessage $uid subject]]
+ if {[string length $ft] || [string length $tt] || [string length $st]} {
+ cgi_put "[cgi_nl]Using "
+ cgi_select defs {
+ cgi_option "- Nothing -" ""
+ if {[string length $ft]} {
+ cgi_option "From Address" value=$ft selected
+ }
+ if {[string length $tt]} {
+ cgi_option "To Address" value=$tt
+ }
+ if {[string length $st]} {
+ cgi_option "Subject Text" value=$st
+ }
+ }
+ cgi_put " of message ${thisnum}"
+ }
+ }
+ }
+ }
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center nowrap class=dialog {
+ cgi_br
+ cgi_submit_button ok=Search
+ cgi_submit_button cancel=Cancel
+ }
+ }
+
+ cgi_table_row class=dialog {
+ cgi_table_data valign=top align=center class=dialog {
+ cgi_puts [cgi_nl][cgi_nl][cgi_font size=-1 "Note, if the number of messages in this folder is larger than the number of lines in the Message List, then some matching messages may not be visible without paging/scrolling."]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/spellcheck.tcl b/web/cgi/alpine/1.0/spellcheck.tcl
new file mode 100755
index 00000000..ac1f9fe5
--- /dev/null
+++ b/web/cgi/alpine/1.0/spellcheck.tcl
@@ -0,0 +1,399 @@
+#!./tclsh
+# $Id: spellcheck.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# spellcheck.tcl
+#
+# Purpose: CGI script to generate html form used to check
+# body text spelling in the webpine-lite composer
+
+# Input:
+set query_vars {
+ {repqstr "" ""}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the page to correct spelling
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+
+set check_menu {
+ {
+ {expr 0}
+ {
+ {
+ # * * * * DONE * * * *
+ cgi_puts "<fieldset>"
+
+ cgi_puts [cgi_font size=-1 "When finished, choose action below, then click [cgi_italic OK].[cgi_nl][cgi_nl]"]
+ cgi_radio_button spell=spell
+ cgi_puts "[cgi_nbspace][cgi_font color=white face=Helvetica size=-1 Correct][cgi_nl]"
+ cgi_radio_button spell=cancel
+ cgi_puts "[cgi_nbspace][cgi_font color=white face=Helvetica size=-1 Cancel][cgi_nl]"
+ cgi_br
+ #cgi_image_button action=[WPimg but_s_do] border=0 alt="Do"
+ cgi_division "style=padding-bottom:4" align=center {
+ cgi_submit_button "action=OK" class=navtext
+ }
+ cgi_puts "</fieldset>"
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Done * * * *
+ cgi_submit_button "spell=Apply" class=navtext
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Cancel * * * *
+ cgi_submit_button "spell=Cancel" class=navtext
+ }
+ }
+ }
+ {
+ {expr 0}
+ {
+ {
+ # * * * * Help * * * *
+ cgi_submit_button "help=Get Help" class=navtext
+ }
+ }
+ }
+}
+
+set done 0
+set first 1
+set spellresult {}
+set line {}
+
+proc spelled {pipe} {
+ global done spellresult line first
+
+ if {[eof $pipe]} {
+ catch {close $pipe}
+ set done 1
+ return
+ }
+
+ gets $pipe w
+
+ if {$first == 0} {
+ if {[string length $w]} {
+ lappend line $w
+ } else {
+ lappend spellresult $line
+ set line {}
+ }
+ } else {
+ set first 0
+ }
+}
+
+
+WPEval $query_vars {
+ if {[catch {WPCmd PEInfo set suspended_composition} msgdata]} {
+ set problem "Can't read message text"
+ } else {
+ foreach p $msgdata {
+ if {[string compare [lindex $p 0] body] == 0} {
+ set body [lindex $p 1]
+ break
+ }
+ }
+
+ if {![info exists body]} {
+ set problem "Can't find body in message text"
+ } else {
+ # spell check and gather results
+ # set tmpfile
+ for {set i 0} {$i < 5} {incr i} {
+ set tmpfile [file join $_wp(sockdir) "sc[pid][expr rand()]"]
+ if {[file exists $tmpfile] == 0} {
+ if {[catch {open $tmpfile w} ofp] == 0} {
+ break
+ }
+ }
+ unset tmpfile
+ }
+
+ if {![info exists tmpfile]} {
+ set problem "Can't create temporary file"
+ }
+ }
+ }
+
+ if {![info exists problem]} {
+ if {[string length $repqstr]} {
+ set quoter $repqstr
+ } else {
+ set quoter "> "
+ }
+
+ foreach l $body {
+ if {[string compare $l "---------- Forwarded message ----------"] == 0} {
+ break;
+ } elseif {[regexp "^$quoter" $l]} {
+ puts $ofp ""
+ } else {
+# regsub -all {\$} $l {\$} l
+ puts $ofp "^${l}"
+ }
+ }
+
+ close $ofp
+
+ set cmd [list $_wp(ispell) "-a"]
+ set pipe [open "|$cmd < $tmpfile 2> /dev/null" r]
+
+ fileevent $pipe readable [list spelled $pipe]
+
+ vwait done
+
+ catch {file delete $tmpfile}
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Check Spelling"
+ WPStyleSheets
+ cgi_put "<style type='text/css'>"
+ cgi_put ".correction { font-family: geneva, arial, sans-serif ; font-size: 9pt }"
+ cgi_puts "</style>"
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post enctype=multipart/form-data target=_top {
+ cgi_text "page=compose" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "restore=1" type=hidden notab
+ cgi_text "style=Spell" type=hidden notab
+ cgi_text "last_line=[llength $spellresult]" type=hidden notab
+ if {[string length $repqstr]} {
+ cgi_text "repqstr=$repqstr" type=hidden notab
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu check_menu {}
+ }
+ }
+
+ cgi_table_data valign=top class=dialog {
+
+ set badlines {}
+ array set badwords {}
+ set badcount 0
+ for {set n 0} {$n < [llength $spellresult]} {incr n} {
+ set words {}
+ foreach ms [lindex $spellresult $n] {
+ if {[regexp {& ([a-zA-Z0-9]*) [0-9]+ ([0-9]+):[ ]?(.*)$} $ms match w o s]} {
+ incr badcount
+ if {[regsub -all {, } $s { } sugs] < 0} {
+ continue
+ }
+
+ lappend words [list $w [expr {$o - 1}] $sugs]
+ if {[info exists badwords($w)]} {
+ incr badwords($w)
+ } else {
+ set badwords($w) 1
+ }
+ } elseif {[regexp {# ([a-zA-Z0-9]*) ([0-9]+)$} $ms match w o]} {
+ incr badcount
+ lappend words [list $w [expr {$o - 1}] {}]
+ if {[info exists badwords($w)]} {
+ incr badwords($w)
+ } else {
+ set badwords($w) 1
+ }
+ }
+ }
+
+ if {[llength $words]} {
+ lappend badlines [list $n $words]
+ }
+ }
+
+ if {[info exists problem] || $badcount <= 0} {
+ cgi_table align=center valign=top height="100%" {
+ cgi_table_row {
+ cgi_table_data align=center valign=bottom heigh="20%" {
+ if {[info exists problem]} {
+ cgi_puts "Problem detected: $problem"
+ } else {
+ cgi_puts "No misspelled words found."
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data align=center valign=top {
+ cgi_put "Click "
+ cgi_submit_button "cancel=Continue" class=navtext
+ cgi_put " to return to your composition."
+ }
+ }
+ }
+ } else {
+ cgi_table width="95%" border=0 align=center valign=top {
+ cgi_table_row {
+ cgi_table_data align=center "style=padding-top:10;padding-bottom:10" {
+ cgi_puts "Web Alpine found [cgi_bold $badcount] possibly misspelled word[WPplural $badcount]."
+ cgi_puts "Grouped by the line on which they were found, misspelled words can be corrected by either selecting from the list of suggestions, when available (note, first option always blank), or entering the corrected spelling directly."
+ cgi_puts "When finished click [cgi_italic Apply] to correct the text, or [cgi_italic Cancel] to return to the composition unchanged."
+ }
+ }
+
+ foreach sl $badlines {
+ set lnum [lindex $sl 0]
+ set locs {}
+
+ cgi_table_row {
+ cgi_table_data bgcolor=white align=left height=20 class=view "style=font-family:courier;padding:8" {
+ set ol [lindex $body $lnum]
+ set l ""
+ set o 0
+ foreach w [lindex $sl 1] {
+ set offset [lindex $w 1]
+ set word [lindex $w 0]
+ set wordlen [string length $word]
+ append l "[cgi_quote_html [string range $ol $o [expr {$offset - 1}]]][cgi_url $word "#${lnum}_[lindex $w 1]_${wordlen}" class=mispell]"
+ set o [expr {$offset + $wordlen}]
+ }
+
+ append l [string range $ol $o end]
+
+ cgi_put $l
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table width=90% align=center border=0 {
+
+ foreach w [lindex $sl 1] {
+ set word [lindex $w 0]
+ set wordlen [string length $word]
+ set wordloc "${lnum}_[lindex $w 1]_${wordlen}"
+
+ cgi_table_row {
+
+ if {[llength [lindex $w 2]] > 0} {
+ cgi_table_data align=left class=correction nowrap {
+ cgi_put "Replace [cgi_anchor_name $wordloc][cgi_bold $word] with "
+ }
+
+ cgi_table_data align=left class=correction nowrap {
+ cgi_select s_${wordloc} class=correction {
+ cgi_option "" value=
+ foreach sug [lindex $w 2] {
+ cgi_option $sug value=$sug
+ }
+ }
+ }
+
+ cgi_table_data align=left class=correction nowrap {
+ cgi_put " or change to "
+ }
+ } else {
+ cgi_table_data align=left class=correction nowrap {
+ cgi_put "Change [cgi_anchor_name $wordloc][cgi_bold $word] to "
+ }
+ }
+
+ cgi_table_data align=left class=correction nowrap {
+ cgi_text r_${wordloc}= "size=[expr {$wordlen + 4}]" maxlength=64 class=correction
+ }
+
+ cgi_table_data align=left class=correction width=90% colspan=3 {
+
+ if {$badwords($word) > 1} {
+ if {![info exists badseen($word)]} {
+ switch $badwords($word) {
+ 2 { set badtimes both }
+ default { set badtimes "all $badwords($word)" }
+ }
+
+ cgi_put " and "
+ cgi_checkbox a_${wordloc}
+ cgi_put " apply to $badtimes occurrences"
+ set badseencount($word) 1
+ } else {
+ incr badseencount($word)
+ switch $badseencount($word) {
+ 2 { set bad1 "second " ; set bad2 "" }
+ 3 { set bad1 "third " ; set bad2 "" }
+ 4 { set bad1 "fourth " ; set bad2 "" }
+ 5 { set bad1 "fifth " ; set bad2 "" }
+ 6 { set bad1 "sixth " ; set bad2 "" }
+ default { set bad1 "" ; set bad2 " $badseencount($word)" }
+ }
+ cgi_put "(${bad1}occurrence${bad2})"
+ }
+
+ lappend badseen($word) $wordloc
+ } else {
+ cgi_put [cgi_img [WPimg dot2]]
+ }
+ }
+
+ lappend locs $wordloc
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data height=8 {
+ cgi_text "l_$lnum=[join $locs {,}]" type=hidden notab
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center height=50 {
+ foreach l [array names badseen] {
+ set m $badseen($l)
+ cgi_text "e_[lindex $m 0]=[join [lrange $m 1 end] {,}]" type=hidden notab
+ }
+
+ cgi_submit_button "spell=Apply" class=navtext
+ cgi_submit_button "spell=Cancel" class=navtext
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/web/cgi/alpine/1.0/takeaddr.tcl b/web/cgi/alpine/1.0/takeaddr.tcl
new file mode 100755
index 00000000..328febb6
--- /dev/null
+++ b/web/cgi/alpine/1.0/takeaddr.tcl
@@ -0,0 +1,215 @@
+#!./tclsh
+# $Id: takeaddr.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# takeaddr.tcl
+#
+# Purpose: CGI script to take addresses to address book
+
+# Input:
+set takeaddr_vars {
+ {uid "Missing UID"}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+# Command Menu definition for Message View Screen
+set take_menu {
+}
+
+set common_menu {
+ {
+ {}
+ {
+ {
+ cgi_put [cgi_url "Get Help" wp.tcl?page=help&topic=take&index=none&oncancel=view%2526op%253DTake class=navbar target=_top]
+ }
+ }
+ }
+}
+
+WPEval $takeaddr_vars {
+
+ if {[catch {WPCmd PEInfo noop} result]} {
+ error [list _action "No Op" $result "Please close this window."]
+ }
+
+ if {$uid > 0 && [catch {WPCmd PEMessage $uid takeaddr} tainfo]} {
+ error [list _action "takeaddr $uid" $tainfo "Click Browsers Back Button."]
+ }
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Take Address"
+ WPStyleSheets
+ }
+
+ cgi_body bgcolor=$_wp(bordercolor) {
+ cgi_table border=0 cellspacing=0 cellpadding=0 height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top class=navbar width=112 {
+ cgi_table bgcolor=$_wp(menucolor) border=0 "style=\"padding-left: 2\"" {
+ # next comes the menu down the left side, with suitable
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) class=navbar {
+ WPTFCommandMenu take_menu common_menu
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_data valign=top class=navbar {
+ cgi_table border=0 cellspacing=0 cellpadding=2 align=center valign=top height="100%" {
+ cgi_table_row {
+ cgi_table_data valign=top class=dialog {
+ cgi_table align=center border=0 width=75% height=80 class=dialog {
+ cgi_table_row {
+ cgi_table_data class=dialog align=center valign=middle {
+ set txt "Select the address that you would like to take to your address book"
+ if {[llength $tainfo] > 1} {
+ set txt "$txt, or select multiple addresses to create a list."
+ } else {
+ set txt "$txt."
+ }
+ append txt "When finished, click [cgi_italic "Take Address"] to create an entry"
+ append txt " or [cgi_italic "Cancel"] to return, creating nothing."
+ #cgi_puts [cgi_bold $txt ]
+ cgi_puts $txt
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data valign=top height=99% class=dialog {
+
+ set books [WPCmd PEAddress books]
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post target=_top name=takeaddr {
+ cgi_text page=view type=hidden notab
+ cgi_text uid=$uid type=hidden notab
+ cgi_text cid=[WPCmd PEInfo key] type=hidden notab
+ if {[llength $books] <= 1} {
+ cgi_text "book=0" type=hidden notab
+ }
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 align=center valign=top width="70%" height="100%" {
+ if {[llength $books] > 1} {
+ cgi_table_row {
+ cgi_table_data colspan=2 valign=top align=center class=dialog {
+ cgi_table border=0 cellspacing=0 cellpadding=0 "style=padding-top:20;padding-bottom:20" {
+ cgi_table_row {
+ cgi_table_data align=right {
+ cgi_puts [cgi_bold "Take to address book"]
+ }
+ cgi_table_data align=right valign=top {
+ cgi_puts [cgi_bold "[cgi_nbspace]:[cgi_nbspace]"]
+ }
+ cgi_table_data align=left {
+ cgi_select book {
+ foreach book $books {
+ cgi_option [lindex $book 1] value=[lindex $book 0]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ set linenum 1
+ foreach taline $tainfo {
+ set printstr [lindex $taline 0]
+ set addr [lindex $taline 1]
+ set sugs [lindex $taline 2]
+ if {[llength $addr] == 0 && [llength $sugs] == 0} {
+ cgi_table_row {
+ cgi_table_data align=center class=dialog colspan=2 "style=xpadding-left:8%;xpadding-right:8%;padding-top:20;padding-bottom:20" {
+ cgi_put $printstr
+ }
+ }
+
+ continue
+ }
+
+ if {[incr linenum] % 2} {
+ set bgcolor #EEEEEE
+ } else {
+ set bgcolor #FFFFFF
+ }
+
+ cgi_table_row bgcolor=$bgcolor {
+ cgi_table_data align=right {
+ cgi_checkbox "taList=tl${linenum}" style=background-color:$bgcolor
+ if {[llength $addr] > 0} {
+ if {[set tmp [lindex $addr 0]] != {}} {
+ cgi_text "tl${linenum}p=$tmp" type=hidden notab
+ }
+ if {[set tmp [lindex $addr 1]] != {}} {
+ cgi_text "tl${linenum}m=$tmp" type=hidden notab
+ }
+ if {[set tmp [lindex $addr 2]] != {}} {
+ cgi_text "tl${linenum}h=$tmp" type=hidden notab
+ }
+ }
+ if {[llength $sugs] > 0} {
+ if {[set tmp [lindex $sugs 0]] != {}} {
+ cgi_text "tl${linenum}n=$tmp" type=hidden notab
+ }
+ if {[set tmp [lindex $sugs 1]] != {}} {
+ cgi_text "tl${linenum}fn=$tmp" type=hidden notab
+ }
+ if {[set tmp [lindex $sugs 2]] != {}} {
+ cgi_text "tl${linenum}fcc=$tmp" type=hidden notab
+ }
+ if {[set tmp [lindex $sugs 3]] != {}} {
+ cgi_text "tl${linenum}c=$tmp" type=hidden notab
+ }
+ }
+ }
+ cgi_table_data align=left {
+ regsub -all "<" $printstr "\\&lt;" printstr
+ regsub -all ">" $printstr "\\&gt;" printstr
+ cgi_puts $printstr
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data height="99%" colspan=2 valign=top align=center class=dialog "style=padding-top:16" {
+ cgi_submit_button "op=Take Address"
+ cgi_submit_button takecancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/tclsh b/web/cgi/alpine/1.0/tclsh
new file mode 120000
index 00000000..385fc6c6
--- /dev/null
+++ b/web/cgi/alpine/1.0/tclsh
@@ -0,0 +1 @@
+../tclsh \ No newline at end of file
diff --git a/web/cgi/alpine/1.0/tconfig.tcl b/web/cgi/alpine/1.0/tconfig.tcl
new file mode 100755
index 00000000..6274e849
--- /dev/null
+++ b/web/cgi/alpine/1.0/tconfig.tcl
@@ -0,0 +1,1183 @@
+# $Id: tconfig.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# tconfig.tcl
+#
+# Purpose: CGI script to configure features/variables
+
+# Input:
+set conf_vars {
+ {newconf {} 0}
+ {oncancel "Nothing set for oncancel"}
+ {wv "" general}
+ {vlavar "" ""}
+}
+
+# Output:
+#
+
+# read config
+source genvars.tcl
+
+set confs {
+ {general General g genconf}
+ {msgl "Message List" ml mlconf}
+ {msgv "Message View" mv mvconf}
+ {composer Composer c compconf}
+ {address "Address Books" ab abconf}
+ {folder "Folders" f fldrconf}
+ {rule "Rules" r ruleconf}
+}
+
+
+set var_menu {
+ {
+ {}
+ {
+ {
+ # * * * * Save Config * * * *
+ #cgi_image_button save=[WPimg but_save] border=0 alt="Save Config"
+ cgi_submit_button save=Save
+ }
+ }
+ }
+ {
+ {}
+ {
+ {
+ # * * * * Close * * * *
+ #cgi_image_button cancel=[WPimg but_cancel] border=0 alt="Cancel"
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+}
+
+## read vars
+foreach item $conf_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} result]} {
+ if {[llength $item] > 2} {
+ set [lindex $item 0] [lindex $item 2]
+ } else {
+ error [list _action [lindex $item 1] $result]
+ }
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+set type $wv
+WPCmd set conf_page $type
+switch -- $type {
+ msgl {
+ set goodvars $msglist_vars
+ }
+ msgv {
+ set goodvars $msgview_vars
+ }
+ address {
+ set goodvars $address_vars
+ }
+ folder {
+ set goodvars $folder_vars
+ }
+ composer {
+ set goodvars $composer_vars
+ }
+ general {
+ set goodvars $general_vars
+ }
+ rule {
+ set goodvars $rule_vars
+ }
+}
+set typeexp "General"
+
+proc button_text {but butno fg bg text} {
+ if {[string length $fg]} {
+ set fg "color: #${fg};"
+ }
+
+ if {[string length $bg]} {
+ set bg "background-color: #${bg}"
+ }
+
+ cgi_puts "<script><!-- "
+ cgi_puts "document.write('<a href=\\\'#\\\' style=\\\"text-decoration: none;\\\" onClick=\"return setop(\\\'${but}\\\',$butno)\">');// -->"
+ cgi_puts "</script>"
+
+ cgi_put [cgi_span "style=$fg $bg" $text]
+
+ cgi_puts "<script><!-- "
+ cgi_puts "document.write('</a>');// -->"
+ cgi_puts "</script>"
+}
+
+proc button_checked {def but} {
+ if {[string compare $def $but]} {
+ return ""
+ } else {
+ return checked
+ }
+}
+
+foreach conf $confs {
+ if {[string compare $type [lindex $conf 0]] == 0} {
+ append ttitle [cgi_imglink "[lindex $conf 2]tab"]
+ lappend conftitle [list [cgi_imglink "[lindex $conf 2]tab"] {} {}]
+ set typeexp [lindex $conf 1]
+ set _wp(helpname) [lindex $conf 3]
+ } else {
+ append ttitle "<input type=image name=\"[lindex $conf 2]tab\" src=\"[WPimg "tabs/[lindex $conf 2]dtab"]\" border=0 alt=\"[lindex $conf 1]\">";
+ }
+}
+
+cgi_http_head {
+ WPStdHttpHdrs
+}
+
+if {$newconf == 1} {
+ WPCmd PEConfig newconf
+}
+
+cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Configuration"
+ WPStyleSheets
+
+ cgi_put "<style type='text/css'>"
+ cgi_put ".vtext { font-size: 10pt; font-family: courier, 'new courier', monospace ; font-weight: medium ; padding-left: 6; border-left: 1px solid black}"
+ cgi_put ".instr { font-size: 10pt; font-weight: bold}"
+ cgi_puts "</style>"
+
+ cgi_javascript {
+ cgi_put "function setop(b,i){"
+ cgi_put " eval('document.varconfig.'+b+'\['+i+'\].checked = true');"
+ cgi_put " return false;"
+ cgi_put "}"
+ }
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" {
+ set postjs ""
+
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=post name=varconfig enctype=multipart/form-data target=_top {
+ cgi_text "oncancel=$oncancel" type=hidden notab
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden notab
+ cgi_text "page=conf_process" type=hidden notab
+
+ cgi_table width="100%" cellpadding=0 cellspacing=0 {
+ cgi_table_row {
+ cgi_table_data width=112 bgcolor=$_wp(menucolor) {
+ cgi_puts [cgi_img [WPimg dot2] width=1 height=1]
+ }
+ cgi_table_data align=right nowrap background="[WPimg [file join tabs tabbg]]" {
+ cgi_put $ttitle
+ }
+ }
+ }
+ if {0} {
+ cgi_division align=right {
+ cgi_put $ttitle
+ }
+ }
+ cgi_table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%" {
+
+ cgi_table_row {
+ #
+ # next comes the menu down the left side
+ #
+ eval {
+ cgi_table_data $_wp(menuargs) rowspan=4 {
+ WPTFCommandMenu var_menu {}
+ }
+ }
+
+ #
+ # In main body of screen goe confg list
+ #
+ cgi_table_data valign=top width="100%" class=dialog "style=\"padding-left: 6\"" {
+ cgi_h2 [cgi_bold "${typeexp} configuration settings:"]
+ switch -- $type {
+ msgl {
+ cgi_text "wv=msgl" type=hidden notab
+ }
+ msgv {
+ cgi_text "wv=msgv" type=hidden notab
+ }
+ address {
+ cgi_text "wv=address" type=hidden notab
+ }
+ folder {
+ cgi_text "wv=folder" type=hidden notab
+ }
+ composer {
+ cgi_text "wv=composer" type=hidden notab
+ }
+ general {
+ cgi_text "wv=general" type=hidden notab
+ }
+ rule {
+ cgi_text "wv=rule" type=hidden notab
+ }
+ }
+ set setfeatures [WPCmd PEConfig featuresettings]
+ set icnt 0
+ cgi_table border=0 cellspacing=0 cellpadding=5 width=98% {
+ foreach tmpvar $goodvars {
+ set vtypeinp [lindex $tmpvar 0]
+ set varname [lindex $tmpvar 1]
+ set vardesc [lindex $tmpvar 2]
+
+ if {[catch {WPCmd PEConfig varget $varname} section] == 0} {
+ set varvals [lindex $section 0]
+ set vartype [lindex $section 1]
+ set vtvals [lindex $section 2]
+ set v_is_default [lindex $section 3]
+ set v_is_fixed [lindex $section 4]
+ } else {
+ # UNKNOWN VAR: configure disabled?
+ continue
+ }
+
+ switch -- $vtypeinp {
+ var {
+ cgi_table_row {
+
+ cgi_table_data align=right valign=top nowrap width=50% {
+ if {[info exists varname]} {
+ # set script "help.tcl?vn=$varname"
+ # set js "cOpen('$script', 'help', 'scrollbars=yes', 600, 400); return false;"
+ # set js "return vh('$varname')"
+ # cgi_puts [WPurl null "" $varname "" onClick=$js]
+ # cgi_puts [WPurl null "" $vardesc "" onClick=$js]
+ # cgi_submit_button varhelp=$vardesc class=lnkbt
+ cgi_puts [cgi_font class=cfvn $vardesc]
+ }
+ }
+ cgi_table_data valign=top {
+ cgi_image_button "hlp.$varname=[WPimg cf_help]" alt="Help for $vardesc"
+ }
+ cgi_table_data align=left colspan=2 width=50% {
+ switch -- $vartype {
+ listbox {
+ cgi_select $varname align=left {
+ foreach tmpvt $vtvals {
+ set tmpvttxt [lindex $tmpvt 0]
+ set tmpvtval $tmpvttxt
+ if {[llength $tmpvt] > 1} {
+ set tmpvtval [lindex $tmpvt 1]
+ }
+ if {[string compare $tmpvtval [lindex $varvals 0]]} {
+ if {[llength $tmpvt] > 1} {
+ cgi_option "${tmpvttxt}" "value=${tmpvtval}"
+ } else {
+ cgi_option "${tmpvttxt}" "value=${tmpvttxt}"
+ }
+ } else {
+ if {[llength $tmpvt] > 1} {
+ cgi_option "$tmpvttxt" "value=${tmpvtval}" selected
+ } else {
+ cgi_option "$tmpvttxt" selected
+ }
+ }
+ }
+ }
+ }
+ textarea {
+ cgi_table border=0 cellpadding=0 cellspacing=0 {
+ set addfield 0
+ set tiwidth 30
+ foreach varval $varvals {
+ if {[string length $varval] > [expr {[info exists maxwidth] ? $maxwidth : 0}]} {
+ set maxwidth [string length $varval]
+ incr maxwidth 5
+ }
+ }
+ if {[info exists maxwidth]} {
+ set tiwidth $maxwidth
+ }
+ if {$tiwidth < 20} {
+ set tiwidth 20
+ } elseif {$tiwidth > 50} {
+ set tiwidth 50
+ }
+ cgi_table_row {
+ cgi_table_data colspan=4 {
+ cgi_image_button vla.$varname=[WPimg cf_add] alt="Add Value"
+ }
+ }
+ if {[string compare $vlavar $varname] == 0} {
+ set addfield 1
+ cgi_table_row {
+ cgi_table_data {
+ cgi_text "varlistadd=$varname" type=hidden notab
+ cgi_text "$varname-add=" type=text size=$tiwidth
+ }
+ cgi_table_data colspan=3 {
+ cgi_puts [cgi_font class=cfntc "(The value entered here will be added.)"]
+ }
+ }
+ }
+ set i 0
+ set vvsz [llength $varvals]
+ foreach varval $varvals {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_text vle.$varname.$i=$varval type=text size=$tiwidth
+ }
+ cgi_table_data {
+ cgi_image_button vld.$varname.$i=[WPimg cf_delete] alt="Delete Value"
+ }
+ cgi_table_data {
+ if {$i < [expr {$vvsz - 1}]} {
+ cgi_image_button vlsd.$varname.$i=[WPimg cf_shdown] alt="Shuffle Down"
+ } else {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ cgi_table_data width=50% {
+ if {$i || $addfield} {
+ cgi_image_button vlsu.$varname.$i=[WPimg cf_shup] alt="Shuffle Up"
+ } else {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+ incr i
+ }
+ cgi_text "$varname-sz=$i" type=hidden notab
+ }
+ }
+ default {
+ set size [string length [lindex $varvals 0]]
+ if {$size == 0} {
+ set size 20
+ } else {
+ incr size 5
+ }
+ cgi_text "$varname=[lindex $varvals 0]" type=text size=$size tableindex=1
+ }
+ }
+ }
+ }
+ }
+ feat {
+ cgi_table_row {
+ cgi_table_data align=right width=50% {
+ if {[info exists varname]} {
+ # cgi_submit_button feathelp=$vardesc class=lnkbt
+ cgi_puts [cgi_font class=cfvn $vardesc]
+ }
+ }
+ cgi_table_data {
+ cgi_image_button "hlp.$varname=[WPimg cf_help]" alt="Help for $vardesc"
+ }
+ cgi_table_data align=left colspan=3 width=50% {
+ if {[lsearch $setfeatures $varname] >= 0} {
+ cgi_checkbox $varname checked class=dialog
+ } else {
+ cgi_checkbox $varname class=dialog
+ }
+ }
+ }
+
+ }
+ special {
+ switch -- $varname {
+ wp-columns {
+ cgi_table_row {
+ cgi_table_data align=right valign=top nowrap {
+ cgi_puts [cgi_font class=cfvn $vardesc]
+ }
+ cgi_table_data valign=top {
+ cgi_image_button "hlp.${varname}=[WPimg cf_help]" alt="Help for $vardesc"
+ }
+ cgi_table_data align=left colspan=2 {
+ set cols [WPCmd PEConfig columns]
+ cgi_select columns align=left {
+ for {set i 20} {$i <= 128} {incr i 4} {
+ if {$i == $cols} {
+ cgi_option $i "value=$i" selected
+ } else {
+ cgi_option $i "value=$i"
+ }
+ }
+ }
+ }
+ }
+ }
+ left-column-folders {
+ cgi_table_row {
+ cgi_table_data align=right valign=top nowrap {
+ cgi_puts [cgi_font class=cfvn $vardesc]
+ }
+ cgi_table_data valign=top {
+ cgi_puts [cgi_nbspace]
+ }
+ cgi_table_data align=left colspan=2 {
+ if {[catch {WPSessionState left_column_folders} cols]} {
+ set cols $_wp(fldr_cache_def)
+ }
+
+ cgi_select fcachel align=left {
+ for {set i 0} {$i <= $_wp(fldr_cache_max)} {incr i} {
+ if {$i == $cols} {
+ cgi_option $i "value=$i" selected
+ } else {
+ cgi_option $i "value=$i"
+ }
+ }
+ }
+ }
+ }
+ }
+ signature {
+ cgi_table_row {
+ cgi_table_data colspan=4 align=center {
+ cgi_puts "<fieldset>"
+ cgi_puts "<legend>Signature</legend>"
+
+ set rawsig [join [WPCmd PEConfig rawsig] "\n"]
+ cgi_textarea signature=$rawsig rows=8 cols=80 wrap=off
+
+ cgi_puts "</fieldset>"
+ }
+ }
+
+ }
+ filters -
+ scores -
+ indexcolor -
+ collections {
+ set flt 0
+ set cll 0
+ switch $varname {
+ filters {
+ set flt 1
+ set descsing "Filter"
+ set filts [WPCmd PEConfig filters]
+ set lvals $filts
+ set varhelp 1
+ }
+ scores {
+ set flt 1
+ set descsing "Scores"
+ set filts [WPCmd PEConfig scores]
+ set lvals $filts
+ set varhelp 1
+ }
+ indexcolor {
+ set flt 1
+ set descsing "Index Colors"
+ set filts [WPCmd PEConfig indexcolors]
+ set lvals $filts
+ set varhelp 1
+ }
+ default {
+ set cll 1
+ set descsing "Collection"
+ set colls [WPCmd PEConfig collections]
+ set lvals $colls
+ }
+ }
+ set tasize [llength $lvals]
+ cgi_table_row {
+ cgi_table_data align=center colspan=4 width=50% {
+ cgi_table border=0 cellpadding=3 cellspacing=0 width=100% {
+ cgi_table_row {
+ cgi_table_data width=50% {
+ cgi_puts [cgi_bold $vardesc]
+ }
+ if {[info exists varhelp]} {
+ cgi_table_data valign=top {
+ cgi_image_button "hlp.$varname=[WPimg cf_help]" alt="Help for $vardesc"
+ }
+ }
+ cgi_table_data "style=\"padding-left: 10px\"" {
+ cgi_image_button vla.$varname=[WPimg cf_add] alt="Add $descsing"
+ }
+ }
+ set i 0
+ foreach lval $lvals {
+ cgi_table_row {
+ cgi_table_data "style=\"padding-left: 8px\"" {
+ if {$flt} {
+ cgi_puts [cgi_font class=cfvn "[cgi_nbspace]$lval"]
+ } else {
+ cgi_puts "[cgi_font class=cfvn [lindex $lval 0]]<br>[cgi_span class=cfval "style=margin-left: 8px" [lindex $lval 1]]"
+ }
+ }
+
+ cgi_table_data "style=\"padding-left: 10px\"" valign=top width=30% {
+ cgi_unbreakable {
+ cgi_image_button vle.$varname.$i=[WPimg cf_edit] alt="Edit $descsing"
+
+ cgi_image_button vld.$varname.$i=[WPimg cf_delete] alt="Delete $descsing"
+
+ if {$i < [expr {$tasize - 1}]} {
+ cgi_image_button vlsd.$varname.$i=[WPimg cf_shdown] alt="Shuffle Down"
+ } else {
+ cgi_puts [cgi_img [WPimg dot2] width=18]
+ }
+
+ if {$i} {
+ cgi_image_button vlsu.$varname.$i=[WPimg cf_shup] alt="Shuffle Up"
+ }
+ }
+ }
+ }
+ incr i
+ }
+ cgi_text "$varname-sz=$i" type=hidden notab
+ }
+ }
+ }
+ }
+ index-format {
+ cgi_table_row {
+ cgi_table_data align=left colspan=4 {
+ cgi_puts "<fieldset style=\"margin-left:1%; margin-right:1%\">"
+ #set helpbut [cgi_buffer {cgi_image_button "hlp.$varname=[WPimg cf_help]" alt="Help for $vardesc"}]
+ cgi_puts "<legend>Message Line Format</legend>"
+
+ set varval [WPCmd PEConfig varget $varname]
+ if {[llength [lindex $varval 0]]} {
+ set fmt ""
+ foreach fms [lindex [lindex $varval 0] 0] {
+ if {[regexp {^([a-zA-Z]+[0-9]*)\(([0-9]+[%]?)\)$} $fms dummy f w]} {
+ lappend fmt [list $f $w]
+ } elseif {[regexp {^([a-zA-Z]+[0-9]*)$} $fms dummy f]} {
+ lappend fmt [list $f ""]
+ }
+ }
+ } else {
+ set fmt [WPCmd PEMailbox indexformat]
+ }
+
+ cgi_text "index-format=$fmt" type=hidden notab
+
+ cgi_table cellpadding=0 cellspacing=0 width=100% align=center "bgcolor=#999999" "style=\"border: 1px solid black \"" border=0 {
+ cgi_table_row "bgcolor=#999999" {
+ if {[WPCmd PEInfo feature enable-aggregate-command-set]} {
+ cgi_td [cgi_img [WPimg dot2]]
+ cgi_td width=1 [cgi_img [WPimg dot2] width=1]
+ }
+
+ foreach fme $fmt {
+ set f [lindex $fme 0]
+ set w [lindex $fme 1]
+ cgi_td xcolspan=3 [cgi_span "style=font-size: 10px; color: white;" $f]
+ if {[regexp {[0123456789]+[%]} $w]} {
+ cgi_td xcolspan=2 align=right [cgi_span "style=font-size: 10px; color: white; padding-right: 4" "(${w})"]
+ } else {
+ cgi_td width=1 [cgi_img [WPimg dot2] width=1]
+ }
+
+ cgi_td width=1 [cgi_img [WPimg dot2] width=1]
+ }
+ }
+
+ cgi_table_row {
+ if {[WPCmd PEInfo feature enable-aggregate-command-set]} {
+ cgi_table_data background="[WPimg bg_index]" align=center valign=middle "style=\"padding-left: 4; padding-right: 4\"" {
+ cgi_checkbox bogus
+ }
+
+ cgi_td width=1 [cgi_img [WPimg dot2] width=1]
+ }
+
+ foreach fme $fmt {
+ set f [lindex $fme 0]
+ set w [lindex $fme 1]
+
+ switch -regexp $w {
+ [0123456789]+[%] {
+ set width width=$w
+ }
+ "" {
+ set r [WPTFIndexWidthRatio $fmt $f]
+ switch $r {
+ 1 { set width "" }
+ default {
+ set width "width=[expr {round((100/[llength $fmt]) * $r)}]%"
+ }
+ }
+ }
+ }
+
+ set align ""
+ set class ""
+ switch [string toupper [lindex $f 0]] {
+ TO {
+ set varval [WPCmd PEConfig varget personal-name]
+ if {[string length [lindex $varval 0]]} {
+ set ftext "To: [lindex $varval 0]"
+ } else {
+ set ftext "To: <sender@foo.bar.com>"
+ }
+ }
+ FROM -
+ FROMORTO {
+ set varval [WPCmd PEConfig varget personal-name]
+ if {[string length [lindex $varval 0]]} {
+ set ftext [lindex $varval 0]
+ } else {
+ set ftext "<sender@foo.bar.com>"
+ }
+ }
+ FULLSTATUS -
+ IMAPSTATUS -
+ STATUS {
+ set ftext "+N"
+ set align "align=center"
+ }
+ MSGNO {
+ set ftext [WPcomma [WPCmd PEMailbox messagecount]]
+ set align "align=center"
+ }
+ SIZE {
+ set ftext [cgi_span class=isize "(1234)"]
+ set class class=isize
+ set align "align=center"
+ }
+ KSIZE {
+ set ftext [cgi_span class=isize "(1K)"]
+ set class class=isize
+ set align "align=center"
+ }
+ SIZECOMMA {
+ set ftext [cgi_span class=isize "(1,234)"]
+ set class class=isize
+ set align "align=center"
+ }
+ DESCRIPSIZE {
+ set ftext "(short+)"
+ set align "align=center"
+ }
+ SIZENARROW {
+ set ftext (1K)
+ }
+ DATE {
+ set ftext [clock format [clock seconds] -format "%b %d"]
+ set align "align=center"
+ }
+ DATEISO {
+ set ftext [clock format [clock seconds] -format "%Y-%m-%d"]
+ set align "align=center"
+ }
+ SHORTDATE1 {
+ set ftext [clock format [clock seconds] -format "%m/%d/%y"]
+ set align "align=center"
+ }
+ SHORTDATE2 {
+ set ftext [clock format [clock seconds] -format "%d/%m/%y"]
+ set align "align=center"
+ }
+ SHORTDATE3 {
+ set ftext [clock format [clock seconds] -format "%d.%m.%y"]
+ set align "align=center"
+ }
+ SHORTDATE4 {
+ set ftext [clock format [clock seconds] -format "%y.%m.%d"]
+ set align "align=center"
+ }
+ SHORTDATEISO {
+ set ftext [clock format [clock seconds] -format "%y-%m-%d"]
+ set align "align=center"
+ }
+ SMARTTIME -
+ SMARTDATETIME -
+ TIME12 {
+ regsub {^0*(.*)$} [string tolower [clock format [clock seconds] -format "%I:%M%p"]] {\1} ftext
+ set align "align=center"
+ }
+ TIME24 {
+ set ftext [clock format [clock seconds] -format "%H:%M"]
+ set align "align=center"
+ }
+ TIMEZONE {
+ set ftext [clock format [clock seconds] -format "%z"]
+ set align "align=center"
+ }
+ SUBJECT {
+ set ftext "Re: Config changes..."
+ }
+ ATT {
+ set ftext "1"
+ }
+ CC {
+ set ftext "user@domain"
+ }
+ FROMORTONOTNEWS {
+ set ftext "news.group"
+ }
+ LONGDATE {
+ set ftext [clock format [clock seconds] -format "%b %d, %Y"]
+ set align "align=center"
+ }
+ MONTHABBREV {
+ set ftext [clock format [clock seconds] -format "%b"]
+ set align "align=center"
+ }
+ NEWS {
+ set ftext "news.group"
+ }
+ SENDER -
+ RECIPS -
+ NEWSANDTO -
+ RECIPSANDNEWS -
+ NEWSANDRECIPS {
+ set ftext "user@domain"
+ }
+ SCORE {
+ set ftext "50"
+ }
+ SMARTDATE {
+ set ftext "Today"
+ }
+ TOANDNEWS {
+ set ftext TOANDNEWS
+ }
+ default {
+ set ftext [lindex $f 0]
+ }
+ }
+ cgi_td $align $class $width nowrap height=34 colspan=2 "style=\"padding-right: 4; padding-left: 4\"" background="[WPimg bg_index]" $ftext
+ cgi_td width=1 [cgi_img [WPimg dot2] width=1]
+ }
+ }
+
+ cgi_table_row {
+ if {[WPCmd PEInfo feature enable-aggregate-command-set]} {
+ cgi_table_data "bgcolor=#ffffff" {
+ cgi_put [cgi_img [WPimg dot2]]
+ }
+
+ cgi_td width=1 [cgi_img [WPimg dot2] width=1]
+
+ set cols 2
+ } else {
+ set cols 0
+ }
+
+ set fmturl "wp.tcl?page=conf_process&wv=msgl&adjust=Change&cid=[WPCmd PEInfo key]&oncancel=$oncancel&index-format=[WPPercentQuote $fmt]"
+ foreach fme $fmt {
+ cgi_table_data colspan=2 nowrap "bgcolor=#ffffff" align=center valign=middle {
+ set cellurl "${fmturl}&ifield=[lindex $fme 0]"
+ cgi_puts [cgi_url [cgi_img [WPimg if_left] border=0 "alt=Move Field Left" height=11 width=11] "${cellurl}&iop=left" target=_top]
+ cgi_puts [cgi_url [cgi_img [WPimg if_wider] border=0 "alt=Widen Field" height=11 width=11] "${cellurl}&iop=widen" target=_top]
+ cgi_puts [cgi_url [cgi_img [WPimg if_remove] border=0 "alt=Remove Field" height=11 width=11] "${cellurl}&iop=remove" target=_top]
+ cgi_puts [cgi_url [cgi_img [WPimg if_narrow2] border=0 "alt=Narrow Field" height=11 width=11] "${cellurl}&iop=narrow" target=_top]
+ cgi_puts [cgi_url [cgi_img [WPimg if_right] border=0 "alt=Move Field Right" height=11 width=11] "${cellurl}&iop=right" target=_top]
+ }
+
+ cgi_td width=1 [cgi_img [WPimg dot2] width=1]
+ }
+ }
+ }
+
+ if {[catch {WPCmd PEConfig indextokens} tokens] == 0} {
+ cgi_division align=center {style="margin-top: 16; margin-bottom: 10"} {
+ cgi_submit_button "indexadd=Add Field"
+ cgi_image_button "hlp.index_tokens=[WPimg cf_help]" alt="Help for $vardesc"
+ cgi_select indexaddfield {
+ cgi_option {[ Choose Field to Insert ]} "value="
+
+ foreach af [lsort -dictionary $tokens] {
+ if {[lsearch $fmt $af] < 0} {
+ if {[string compare $af MSGNO]} {
+ cgi_option $af "value=$af"
+ } else {
+ cgi_option $af "value=$af" selected
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_puts "</fieldset>"
+ }
+ }
+ }
+ view-colors {
+ cgi_table_row {
+ cgi_table_data colspan=4 {
+ cgi_puts "<fieldset style=\"margin-left:1%; margin-right:1%\">"
+ #set helpbut [cgi_buffer {cgi_image_button "hlp.$varname=[WPimg cf_help]" alt="Help for $vardesc"}]
+ cgi_puts "<legend>Color Settings </legend>"
+
+ cgi_division class=instr "style=\"padding-bottom: 6\"" {
+ cgi_put [cgi_span "style=padding: 2; background-color: #ffcc66; border: 1px solid black" "1"]
+ cgi_put " Choose text below to color, or[cgi_nbspace]enter[cgi_nbspace]field[cgi_nbspace]"
+ cgi_text newfield= class=instr size=12 maxlength=32
+ cgi_put "[cgi_nbspace]to[cgi_nbspace]"
+ cgi_submit_button "addfield=add to colored headers"
+ }
+
+ set std_hdrs [list Date From To Cc Subject]
+ set samp_hdrs $std_hdrs
+ set samp_text [list normal quote1 quote2 quote3]
+ set colors {}
+
+ foreach goodkolor $samp_text {
+ set tcolor [WPCmd PEConfig colorget "${goodkolor}"]
+ lappend colors [list $goodkolor [lindex $tcolor 0] [lindex $tcolor 1]]
+ }
+
+ set hcolors [WPCmd PEConfig colorget "viewer-hdr-colors"]
+ set hi 0
+ foreach hcolor $hcolors {
+ set i 0
+ set dhdr 0
+ foreach samp_hdr $samp_hdrs {
+ if {[string compare [string tolower [lindex $hcolor 0]] [string tolower [lindex $samp_hdr 0]]] == 0} {
+ if {[string length [lindex $hcolor 3]] == 0} {
+ switch -- $samp_hdr {
+ Date {
+ set samptxt [clock format [clock seconds] -format "%a, %d %b %Y %H:%M:%S %Z"]
+ }
+ From {
+ set samptxt [WPCmd PECompose from]
+ }
+ Subject {
+ set samptxt "Your colors are Fabulous!"
+ }
+ default {
+ set samptxt Sample
+ }
+ }
+ lappend samp_hdr [list [lindex $hcolor 1] [lindex $hcolor 2] $samptxt "" $hi]
+ set samp_hdrs [lreplace $samp_hdrs $i $i $samp_hdr]
+ set dhdr 1
+ break
+ } else {
+ lappend samp_hdr [list [lindex $hcolor 1] [lindex $hcolor 2] [lindex $hcolor 3] [lindex $hcolor 3] $hi]
+ set samp_hdrs [lreplace $samp_hdrs $i $i $samp_hdr]
+ set dhdr 1
+ break
+ }
+ }
+ incr i
+ }
+ if {$dhdr == 0} {
+ set smptxt "Sample"
+ if {[string compare "" [lindex $hcolor 3]]} {
+ set smptxt [lindex $hcolor 3]
+ }
+ lappend samp_hdrs [list [lindex $hcolor 0] [list [lindex $hcolor 1] [lindex $hcolor 2] $smptxt [lindex $hcolor 3] $hi]]
+ }
+ incr hi
+ }
+
+ set dfgc "ffffff"
+ set dbgc "000000"
+ set dq1fgc "ffffff"
+ set dq1bgc "000000"
+ set dq2fgc "ffffff"
+ set dq2bgc "000000"
+ set dq3fgc "ffffff"
+ set dq3bgc "000000"
+
+ foreach color $colors {
+ switch -- [lindex $color 0] {
+ normal {
+ set dfgc [lindex $color 1]
+ set dbgc [lindex $color 2]
+ }
+ quote1 {
+ set dq1fgc [lindex $color 1]
+ set dq1bgc [lindex $color 2]
+ }
+ quote2 {
+ set dq2fgc [lindex $color 1]
+ set dq2bgc [lindex $color 2]
+ }
+ quote3 {
+ set dq3fgc [lindex $color 1]
+ set dq3bgc [lindex $color 2]
+ }
+ }
+
+ set colarr([lindex $color 0]) [list [lindex $color 1] [lindex $color 2]]
+ }
+
+ foreach hcolor $hcolors {
+ set colarr([lindex $color 0]) [list [lindex $color 1] [lindex $color 2]]
+ }
+
+ set butno -1
+ if {[catch {WPCmd PEInfo set config_defground} defground] || ![string length $defground]} {
+ set defground f
+ }
+
+ if {[catch {WPCmd PEInfo set config_deftext} deftext] || ![string length $deftext]} {
+ set deftext normal
+ }
+
+ # paint example text
+ cgi_table cellpadding=0 cellspacing=0 width=100% align=center border=0 {
+ cgi_table_row {
+ cgi_table_data align=center {
+
+ cgi_table border=0 cellpadding=0 cellspacing=0 width=100% align=center bgcolor=#${dbgc} "style=\"border-right: 1px solid black\"" {
+
+ cgi_table_row {
+ cgi_td class=dialog [cgi_img [WPimg dot2]]
+ cgi_td height=1 "bgcolor=#000000" [cgi_img [WPimg dot2] height=1]
+ }
+
+ foreach samp_hdr $samp_hdrs {
+ set field [string tolower [lindex $samp_hdr 0]]
+ incr butno
+ cgi_table_row {
+ cgi_table_data class=dialog align=center nowrap {
+ cgi_radio_button text=hdr.${field} [button_checked $deftext ${field}]
+ if {[llength $samp_hdr] == 1} {
+ set hdrfg $dfgc
+ set hdrbg $dbgc
+ } else {
+ set cp [lindex $samp_hdr end]
+ set hdrfg [lindex $cp 0]
+ set hdrbg [lindex $cp 1]
+ }
+
+ cgi_text "dfg.${field}=$hdrfg" type=hidden notab
+ cgi_text "dbg.${field}=$hdrbg" type=hidden notab
+ }
+
+ cgi_table_data class=vtext "style=\"color: #${dfgc}\; background-color: #${dbgc};\"" {
+ cgi_put "[lindex $samp_hdr 0]: "
+
+ if {[llength $samp_hdr] == 1} {
+ switch -- [lindex $samp_hdr 0] {
+ Date {
+ set samptxt [clock format [clock seconds] -format "%a, %d %b %Y %H:%M:%S %Z"]
+ }
+ From {
+ set samptxt [WPCmd PECompose from]
+ }
+ default {
+ set samptxt Sample
+ }
+ }
+
+ button_text text $butno $dfgc $dbgc [cgi_quote_html $samptxt]
+ cgi_text "add.${field}=1" type=hidden notab
+ } else {
+ cgi_text "hi.${field}=[lindex [lindex $samp_hdr end] end]" type=hidden notab
+
+ set pref ""
+ foreach cp [lrange $samp_hdr 1 end] {
+ button_text text $butno $hdrfg $hdrbg [cgi_quote_html "${pref}[lindex $cp 2]"]
+ set pref ", "
+ }
+ }
+ }
+ }
+ }
+
+ if {0} {
+ cgi_table_row {
+ cgi_td class=dialog [cgi_nbspace]
+ cgi_table_data {
+ cgi_text newfield= class=vtext
+ cgi_submit_button "addfield=Add New Header Field" class=vtext
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_td class=dialog [cgi_nbspace]
+ cgi_td class=vtext [cgi_nbspace]
+ }
+
+ cgi_table_row {
+ cgi_table_data class=dialog align=center {
+ incr butno
+ cgi_radio_button text=normal [button_checked $deftext normal]
+ cgi_text "dfg.normal=$dfgc" type=hidden notab
+ cgi_text "dbg.normal=$dbgc" type=hidden notab
+ }
+
+ cgi_table_data class=vtext "style=\"color: #${dfgc}\; background-color: #${dbgc}\"" {
+ button_text text $butno $dfgc $dbgc "This is a rather silly message."
+ }
+ }
+
+ cgi_table_row {
+ cgi_td class=dialog [cgi_nbspace]
+ cgi_td class=vtext [cgi_nbspace]
+ }
+
+ cgi_table_row {
+ cgi_td class=dialog [cgi_img [WPimg dot2]]
+ cgi_table_data colspan=2 class=vtext "style=\"color: #${dfgc}\; background-color: #${dbgc}\"" {
+ cgi_put "On Apr 1, 2001, Sample wrote:</a>"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data class=dialog align=center {
+ incr butno
+ cgi_radio_button text=quote3 [button_checked $deftext quote3]
+ cgi_text "dfg.quote3=[lindex $colarr(quote3) 0]" type=hidden notab
+ cgi_text "dbg.quote3=[lindex $colarr(quote3) 1]" type=hidden notab
+ }
+
+ cgi_table_data class=vtext "style=\"color: #${dfgc}\; background-color: #${dbgc}\"" {
+ cgi_put [cgi_span "style=color: #[lindex $colarr(quote1) 0]; background-color: #[lindex $colarr(quote1) 1]" "&gt; "]
+ cgi_put [cgi_span "style=color: #[lindex $colarr(quote2) 0]; background-color: #[lindex $colarr(quote2) 1]" "&gt; "]
+ button_text text $butno [lindex $colarr(quote3) 0] [lindex $colarr(quote3) 1] "&gt; This is an example of text that is quoted 3 times"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data class=dialog align=center {
+ incr butno
+ cgi_radio_button text=quote2 [button_checked $deftext quote2]
+ cgi_text "dfg.quote2=[lindex $colarr(quote2) 0]" type=hidden notab
+ cgi_text "dbg.quote2=[lindex $colarr(quote2) 1]" type=hidden notab
+ }
+
+ cgi_table_data class=vtext "style=\"color: #${dfgc}\; background-color: #${dbgc}\"" {
+ cgi_put [cgi_span "style=color: #[lindex $colarr(quote1) 0]; background-color: #[lindex $colarr(quote1) 1]" "&gt; "]
+ button_text text $butno [lindex $colarr(quote2) 0] [lindex $colarr(quote2) 1] "&gt; This is an example of text that is quoted 2 times"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data class=dialog align=center {
+ incr butno
+ cgi_radio_button text=quote1 [button_checked $deftext quote1]
+ cgi_text "dfg.quote1=[lindex $colarr(quote1) 0]" type=hidden notab
+ cgi_text "dbg.quote1=[lindex $colarr(quote1) 1]" type=hidden notab
+ }
+ cgi_table_data class=vtext "style=\"color: #${dfgc}\; background-color: #${dbgc}\"" {
+ button_text text $butno [lindex $colarr(quote1) 0] [lindex $colarr(quote1) 1] "&gt; This is an example of text that is quoted 1 time"
+ }
+ }
+
+ if {[llength [WPCmd PEInfo signature]]} {
+ cgi_table_row "style=\"border-right: 1px solid black\"" {
+ cgi_td class=dialog [cgi_img [WPimg dot2]]
+ cgi_table_data class=vtext "style=\"color: #${dfgc}\; background-color: #${dbgc}\"" {
+ foreach i [WPCmd PEInfo signature] {
+ cgi_puts "$i[cgi_nl]"
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_td class=dialog [cgi_img [WPimg dot2]]
+ cgi_td height=1 "bgcolor=#000000" [cgi_img [WPimg dot2] height=1]
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center "style=\"padding-top: 16\"" {
+ cgi_table width=100% border=0 {
+
+ cgi_table_row colspan=2 {
+ cgi_td valign=top align=left xrowspan=3 class=instr "style=\"padding-right: 4; background-color: #ffcc66; border: 1px solid black\"" [cgi_span "style=padding: 2;" "2"]
+ cgi_td width=30% colspan=2 valign=top class=instr "Choose fore- or background..."
+ cgi_td rowspan=3 width=3% [cgi_img [WPimg dot2]]
+ cgi_td valign=top align=left xrowspan=3 class=instr "style=\"padding-right: 4; background-color: #ffcc66; border: 1px solid black\"" [cgi_span "style=padding: 2;" "3"]
+ cgi_table_data valign=middle class=instr nowrap {
+ cgi_put "Choose item's color below, or[cgi_nbspace]"
+ cgi_submit_button "reset=restore its default colors"
+ }
+ }
+
+ cgi_table_row {
+ cgi_td rowspan=2 [cgi_img [WPimg dot2]]
+ cgi_table_data align=right {
+ if {[string compare $defground f] == 0} {
+ set checked checked
+ } else {
+ set checked ""
+ }
+
+ cgi_radio_button ground=f $checked
+ }
+
+ cgi_table_data "style=\"font-size: 10pt\"" {
+ button_text ground 0 "" "" Foreground
+ }
+
+ cgi_td rowspan=2 [cgi_img [WPimg dot2]]
+ cgi_table_data rowspan=2 {
+ cgi_image_button "colormap=[WPimg nondither10x10]" alt="Color Pattern" "style=\"border: 1px solid black\""
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=right {
+ if {[string compare $defground b] == 0} {
+ set checked checked
+ } else {
+ set checked ""
+ }
+
+ cgi_radio_button ground=b $checked
+ }
+
+ cgi_table_data "style=\"font-size: 10pt\"" {
+ button_text ground 1 "" "" [cgi_span "style=color: black; background-color: #FFCC66; padding: 4" "Background"]
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data colspan=2 align=center class=instr nowrap "style=\"padding-top: 16; padding-bottom: 10;\"" {
+ cgi_puts "Alternatively, you can also "
+ cgi_submit_button "reset=Restore All Color Defaults"
+ }
+ }
+
+ if {0} {
+ cgi_table_row {
+ cgi_table_data class=instr nowrap "style=\"padding-top: 16; padding-bottom: 10;\"" {
+ cgi_put [cgi_span "style=padding: 2; background-color: #ffcc66; border: 1px solid black" "OR"]
+ cgi_put " Enter header name[cgi_nbspace]"
+ cgi_text newfield= class=vtext
+ cgi_put "[cgi_nbspace]to[cgi_nbspace]"
+ cgi_submit_button "addfield=Add to Those Being Colored"
+ }
+ }
+ }
+ }
+
+ cgi_puts "</fieldset>"
+ }
+ }
+ }
+ }
+ }
+ }
+ incr icnt
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/1.0/view.tcl b/web/cgi/alpine/1.0/view.tcl
new file mode 100755
index 00000000..cf290e43
--- /dev/null
+++ b/web/cgi/alpine/1.0/view.tcl
@@ -0,0 +1,920 @@
+# $Id: view.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# view.tcl
+#
+# Purpose: CGI script to generate html output associated
+# with a message's particular text displayed in
+# the "body" frame
+
+# Input:
+set view_vars {
+ {message {} 0}
+ {first {} 1}
+ {top {} 0}
+ {bod_first {} 0}
+ {bod_prev {} 0}
+ {bod_next {} 0}
+ {bod_last {} 0}
+ {fullhdr {} ""}
+ {reload {} 0}
+ {uid {} 0}
+ {cid {} 0}
+ {goto {} ""}
+ {gonum {} 0}
+ {save {} ""}
+ {f_name {} ""}
+ {f_colid {} 0}
+ {takecancel {} ""}
+ {savecancel {} 0}
+ {auths {} 0}
+ {user {} ""}
+ {pass {} ""}
+ {create {} 0}
+ {flipdelete {} 0}
+ {delete {} ""}
+ {undelete {} ""}
+ {replyall {} ""}
+ {replytext {} ""}
+ {submitted {} 0}
+ {printable {} 0}
+ {op {} ""}
+ {showimg {} ""}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+#set use_icon_for_status 1
+
+set hacktoken __URL__TEXT__
+
+## read vars
+foreach item $view_vars {
+ if {[catch {cgi_import [lindex $item 0].x}]} {
+ if {[catch {eval WPImport $item} errstr]} {
+ error [list _action "Impart Variable" $errstr]
+ }
+ } else {
+ set [lindex $item 0] 1
+ }
+}
+
+if {[catch {WPCmd PEInfo key} webpine_key]} {
+ error [list _action "command ID" $webpine_key]
+}
+
+# make sure message to be "viewed" is still available
+catch {unset errstr}
+if {[catch {WPCmd PEMailbox messagecount} messagecount]} {
+ set errstr $messagecount
+} elseif {$uid > 0 && [catch {WPCmd PEMessage $uid number} message]} {
+ set errstr $message
+} elseif {$message > 0 && $message <= $messagecount && [catch {WPCmd PEMailbox uid $message} uid]} {
+ set errstr $uid
+} elseif {!($message && $uid)} {
+ set errstr "Unknown message number"
+}
+
+if {[info exists errstr]} {
+ switch $op {
+ Reply -
+ Forward {
+ catch {WPCmd set wp_spec_script fr_view.tcl}
+ catch {WPCmd set uid $uid}
+ source [WPTFScript main]
+ }
+ default {
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPHtmlHdrReload "$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=view"
+ WPStyleSheets
+ }
+
+ cgi_body bgcolor=#ffffff {
+ cgi_table border=0 width="100%" height="100%" {
+ cgi_table_row {
+ cgi_table_data width="20%" {
+ cgi_put [cgi_img [WPimg dot2] border=0 height=1]
+ }
+ cgi_table_data bgcolor=#ffffff class=notice {
+ cgi_puts "\[[cgi_nbspace]"
+ if {[string first "PEMessage: UID " $errstr] >= 0} {
+ cgi_puts "The message referred to is no"
+ cgi_puts "longer available."
+ cgi_p
+ cgi_puts "An error has been detected that indicates you may"
+ cgi_puts "have WebPine running in multiple browser windows."
+ cgi_p
+ cgi_puts "Please close all other windows that are displaying"
+ cgi_puts "WebPine pages."
+ } else {
+ cgi_puts "Message Unavailable: $errstr."
+ }
+ cgi_p
+ cgi_puts "Click \"[cgi_url [WPCmd PEMailbox mailboxname] fr_index.tcl target=spec]\" in the column on the left to return to the updated Message List.[cgi_nbspace]\]"
+ }
+ cgi_table_data width="20%" {
+ cgi_put [cgi_img [WPimg dot2] border=0 height=1]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+} else {
+
+ # make sure any caching doesn't screw this setting
+ catch {WPCmd set wp_spec_script fr_view.tcl}
+
+ set zoomed [WPCmd PEMailbox zoom]
+
+ set onload "onLoad="
+ set onunload "onUnload="
+
+ if {[info exists _wp(exitonclose)]} {
+ set closescript [cgi_buffer WPExitOnClose]
+ append onload "wpLoad();"
+ append onunload "wpUnLoad();"
+ }
+
+ # perform any requested actions
+ if {$flipdelete == 1} {
+ if {$cid != $webpine_key} {
+ lappend newmail [list "Can't Delete: Invalid command ID!"]
+ } elseif {[WPCmd PEMessage $uid flag deleted]} {
+ if {[catch {WPCmd PEMessage $uid flag deleted 0} result]} {
+ lappend newmail [list "Error UNdeleting $message: $result"]
+ }
+ } else {
+ if {[catch {WPCmd PEMessage $uid flag deleted 1} result]} {
+ lappend newmail [list "Error deleting $message: $result"]
+ } else {
+ # bug: handle delete-skips-deleted
+ set message [WPCmd PEMailbox next [WPCmd PEMessage $uid number]]
+ set uid [WPCmd PEMailbox uid $message]
+ }
+ }
+ } elseif {[string compare "report spam" [string tolower $op]] == 0} {
+ if {[info exists _wp(spamaddr)] && [string length $_wp(spamaddr)]} {
+ if {$cid != $webpine_key} {
+ lappend newmail [list "Can't Spamify: Invalid command ID!"]
+ } else {
+ if {[info exists _wp(spamfolder)] && [string length $_wp(spamfolder)]
+ && [catch {
+ set savedef [WPCmd PEMailbox savedefault]
+ if {[WPCmd PEFolder exists [lindex $savedef 0] $_wp(spamfolder)] == 0} {
+ WPCmd PEFolder create [lindex $savedef 0] $_wp(spamfolder)
+ }
+
+ WPCmd PEMessage $uid save [lindex $savedef 0] $_wp(spamfolder)
+ } result]} {
+ lappend newmail [list "Error spamifying message $message: $result"]
+ } elseif {[catch {WPCmd PEMessage $uid flag deleted 1} result]} {
+ lappend newmail [list "Error spamifying message $message: $result"]
+ } else {
+ set n [WPCmd PEMessage $uid number]
+ if {[info exists _wp(spamsubj)]} {
+ set subj $_wp(spamsubj)
+ } else {
+ set subj ""
+ }
+
+ if {[catch {WPCmd PEMessage $uid spam $_wp(spamaddr) $subj} result]} {
+ lappend newmail [list "Can't Report Spam: $result"]
+ } else {
+ lappend newmail [list "Message $n reported as Spam and flagged for deletion"]
+ }
+ }
+ }
+ }
+ } elseif {$delete == 1 || [string compare delete [string tolower $op]] == 0} {
+ if {$cid != $webpine_key} {
+ lappend newmail [list "Can't Delete: Invalid command ID!"]
+ } elseif {[catch {WPCmd PEMessage $uid flag deleted 1} result]} {
+ lappend newmail [list "Error deleting message $message: $result"]
+ } else {
+ set n [WPCmd PEMessage $uid number]
+ # lappend newmail [list "Message $n deleted"]
+ # bug: handle delete-skips-deleted
+ set message [WPCmd PEMailbox next $n]
+ set uid [WPCmd PEMailbox uid $message]
+ lappend newmail [list "Message $n flagged for deletion"]
+ }
+ } elseif {$delete == 0 || $undelete == 1 || [string compare undelete [string tolower $op]] == 0} {
+ if {$cid != $webpine_key} {
+ catch {WPCmd PEInfo statmsg "Invalid command ID!"}
+ } elseif {[catch {WPCmd PEMessage $uid flag deleted 0}]} {
+ lappend newmail [list "Error UNdeleting message $message"]
+ } else {
+ lappend newmail [list "Deletion mark for message [WPCmd PEMessage $uid number] removed"]
+ }
+ } elseif {[string length $goto]} {
+ if {[regexp {^([0-9]+)$} $gonum n]} {
+ if {$n > 0 && $n <= [WPCmd PEMailbox last]} {
+ set message $n
+ set uid [WPCmd PEMailbox uid $message]
+ } else {
+ lappend newmail [list "Jump value out of range: $gonum"]
+ }
+ } else {
+ if {[string length $gonum]} {
+ lappend newmail [list "Unrecognized Jump value: $gonum"]
+ } else {
+ lappend newmail [list "Enter message number, then click 'Jump'"]
+ }
+ }
+ } elseif {$savecancel == 1 || [string compare cancel [string tolower $savecancel]] == 0} {
+ lappend newmail [list "Save cancelled. Folder not created."]
+ } elseif {[string compare browse [string tolower $op]] == 0} {
+ _cgi_set_uservar onselect main
+ _cgi_set_uservar oncancel main
+ _cgi_set_uservar controls 2
+ source [WPTFScript savebrowse]
+ set nopage 1
+ } elseif {[string compare take [string tolower $op]] == 0} {
+ source [WPTFScript take]
+ set nopage 1
+ } elseif {[string compare "take address" [string tolower $op]] == 0} {
+ _cgi_set_uservar take 1
+ set addrs ""
+ if {[catch {cgi_import taList}] == 0} {
+ foreach ta $taList {
+ if {[catch {cgi_import_as ${ta}p xp}]} {
+ set xp ""
+ }
+
+ if {[catch {cgi_import_as ${ta}m xm}]} {
+ set xm ""
+ }
+
+ if {[catch {cgi_import_as ${ta}h xh}]} {
+ set xh ""
+ }
+
+ lappend alist [list $xp $xm $xh]
+ }
+
+ switch [llength $alist] {
+ 0 {
+ _cgi_set_uservar addrs ""
+ }
+ 1 {
+ set a [lindex $alist 0]
+ _cgi_set_uservar fn [lindex $a 0]
+ _cgi_set_uservar addrs [WPPercentQuote "[lindex $a 1]@[lindex $a 2]"]
+ }
+ default {
+ set addrs ""
+ foreach a $alist {
+ if {[string length $addrs]} {
+ append addrs ","
+ }
+
+ append addrs [WPPercentQuote "[lindex $a 0] <[lindex $a 1]@[lindex $a 2]>"]
+ }
+
+ _cgi_set_uservar addrs $addrs
+ }
+ }
+
+ source [WPTFScript takeedit]
+ } else {
+ WPCmd PEInfo statmsg "Take Address cancelled. No addresses selected."
+ source [WPTFScript main]
+ }
+
+ set nopage 1
+ } elseif {[string compare cancel [string tolower $takecancel]] == 0} {
+ source [WPTFScript main]
+ set nopage 1
+ } elseif {[string compare forward [string tolower $op]] == 0} {
+ _cgi_set_uservar style Forward
+ source [WPTFScript compose]
+ set nopage 1
+ } elseif {[string compare reply [string tolower $op]] == 0} {
+ _cgi_set_uservar style Reply
+ _cgi_set_uservar repqstr [WPCmd PEMessage $uid replyquote]
+ source [WPTFScript compose]
+ set nopage 1
+ } elseif {[string compare save [string tolower $op]] == 0} {
+ if {[catch {WPCmd PEMessage $uid save $f_colid $f_name} reason]} {
+ #statmsg "Save failed: $reason"
+ lappend newmail [list "Save failed: $reason"]
+ } else {
+ set savedef [WPTFSaveDefault $uid]
+ if {[lindex $savedef 0] == $f_colid} {
+ WPTFAddSaveCache $f_name
+ }
+
+ if {[WPCmd PEInfo feature save-will-not-delete] == 0} {
+ if {[catch {WPCmd PEMessage $uid flag deleted 1} reason]} {
+ # statmsg "Cannot delete saved message: $reason"
+ lappend newmail [list "Cannot delete saved message: $reason"]
+ }
+ }
+ }
+
+ } elseif {$bod_first} {
+ set u $uid
+ set message [WPCmd PEMailbox first]
+ set uid [WPCmd PEMailbox uid $message]
+ if {$zoomed && $u == $uid} {
+ lappend newmail [list "Already on first of the Marked messages"]
+ }
+ } elseif {$bod_prev} {
+ set u $uid
+ set message [WPCmd PEMailbox next [WPCmd PEMessage $uid number] -1]
+ set uid [WPCmd PEMailbox uid $message]
+ if {$zoomed && $u == $uid} {
+ lappend newmail [list "Already on first of the Marked messages"]
+ }
+ } elseif {$bod_next} {
+ set u $uid
+ set message [WPCmd PEMailbox next [WPCmd PEMessage $uid number]]
+ set uid [WPCmd PEMailbox uid $message]
+ if {$zoomed && $u == $uid} {
+ lappend newmail [list "Already on last of the Marked messages"]
+ }
+ } elseif {$bod_last} {
+ set u $uid
+ set message [WPCmd PEMailbox last]
+ set uid [WPCmd PEMailbox uid $message]
+ if {$zoomed && $u == $uid} {
+ lappend newmail [list "Already on last of the Marked messages"]
+ }
+ }
+
+ if {![info exists nopage]} {
+ switch -exact -- [WPCmd PEMailbox state] {
+ readonly {
+ lappend newmail [list [cgi_span "style=color: black; margin: 2 ; border: 1px solid red; background-color: pink; font-weight: bold" "Deleted messages may reapper because [WPCmd PEMailbox mailboxname] is Read Only"]]
+ }
+ closed {
+ lappend newmail [list [cgi_span "style=color: black; border: 1px solid red; background-color: pink; font-weight: bold" "Message body may be blank because [WPCmd PEMailbox mailboxname] is Closed"]]
+ }
+ ok -
+ default {}
+ }
+
+ if {[catch {WPNewMail $reload ""} newmailmsg]} {
+ error [list _action "new mail" $newmailmsg]
+ } else {
+ foreach i $newmailmsg {
+ lappend newmail $i
+ }
+
+ if {[info exists newmail] == 0} {
+ set newmail ""
+ }
+ }
+
+ if {$uid <= 0} {
+ lappend newmail [list "Message $message has UID 0!"]
+ }
+
+ if {[WPCmd PEInfo feature enable-full-header-cmd]} {
+ if {[string length $fullhdr]} {
+ if {[WPCmd PEInfo mode full-header-mode]} {
+ if {$fullhdr == 0 || [string compare $fullhdr "off"] == 0} {
+ WPCmd PEInfo mode full-header-mode 0
+ }
+ } else {
+ if {$fullhdr == 1 || [string compare $fullhdr "on"] == 0} {
+ WPCmd PEInfo mode full-header-mode 2
+ }
+ }
+ }
+
+ if {[WPCmd PEInfo mode full-header-mode]} {
+ set hmode "fullhdr=off"
+ set text [cgi_imglink nofullhdr]
+ } else {
+ set hmode "fullhdr=on"
+ set text [cgi_imglink fullhdr]
+ }
+
+ set hmode_url [cgi_url $text "wp.tcl?page=body&$hmode" name=hmode target=body style=vertical-align:middle]
+ }
+
+ if {$uid} {
+ # preserve any new uid val
+ WPCmd set uid $uid
+ }
+
+ if {[catch {WPCmd PEMessage $uid charset} charset]
+ || [string length $charset] == 0
+ || [string compare us-ascii [string tolower $charset]] == 0} {
+ set charset "ISO-8859-1"
+ }
+
+ catch {fconfigure stdout -encoding binary}
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=$charset"
+ }
+
+ cgi_html {
+ cgi_head {
+
+ cgi_http_equiv Content-Type "text/html; charset=$charset"
+
+ set normalreload [cgi_buffer {WPHtmlHdrReload "$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=body&uid=$uid"}]
+ if {[info exists _wp(exitonclose)]} {
+ cgi_puts $closescript
+
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_put "function viewReloadTimer(t){"
+ cgi_put " reloadtimer = window.setInterval('wpLink(); window.location.replace(\\'[cgi_root]/$_wp(appdir)/$_wp(ui1dir)/wp.tcl?page=body&reload=1\\')', t * 1000);"
+ cgi_puts "}"
+ }
+
+ append onload "viewReloadTimer($_wp(refresh));"
+ cgi_noscript {
+ cgi_puts $normalreload
+ }
+ } else {
+ cgi_puts $normalreload
+ }
+
+ if {[info exists _wp(timing)]} {
+ cgi_script type="text/javascript" language="JavaScript" {
+ cgi_puts "var loadtime = new Date();"
+ cgi_puts "var submitted = $submitted;"
+ cgi_puts "function fini() {var now = new Date(); window.status = 'Page loaded in '+(now.getTime() - loadtime.getTime())/1000+' seconds';}"
+ }
+
+ append onload "fini();"
+ }
+
+ WPStyleSheets
+
+ if {$_wp(keybindings)} {
+ set kequiv {
+ {{?} {top.location = 'wp.tcl?page=help'}}
+ {{l} {top.location = 'wp.tcl?page=folders'}}
+ {{a} {top.location = 'wp.tcl?page=addrbook'}}
+ {{n} {top.spec.body.location = 'wp.tcl?page=view&bod_next=1'}}
+ {{p} {top.spec.body.location = 'wp.tcl?page=view&bod_prev=1'}}
+ {{i} {top.spec.location = 'fr_index.tcl'}}
+ {{s} {top.spec.cmds.document.saveform.f_name.focus()}}
+ {{d} {top.spec.cmds.document.delform.op[0].click()}}
+ {{u} {top.spec.cmds.document.delform.op[1].click()}}
+ {{r} {top.spec.cmds.document.replform.op.click()}}
+ {{f} {top.spec.cmds.document.forwform.op.click()}}
+ }
+
+ lappend kequiv [list {c} "top.location = 'wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key]'"]
+
+ if {[info exists hmode_url]} {
+ lappend kequiv [list {h} "top.spec.body.location = 'wp.tcl?page=view&$hmode'"]
+ }
+
+ append onload [WPTFKeyEquiv $kequiv]
+ }
+ }
+
+ set fgcolor [set normal_fgcolor [WPCmd PEInfo foreground]]
+ set bgcolor [WPCmd PEInfo background]
+
+ cgi_body bgcolor=white $onload $onunload {
+ catch {WPCmd set help_context view}
+
+ set infont 0
+ set inurl 0
+
+ if {[llength $newmail]} {
+ cgi_division align=center "style=\"border: 1px solid black; background: $_wp(bordercolor)\"" {
+ WPTFStatusTable $newmail 1 "style=\"padding: 6px 0\""
+ }
+ }
+
+ cgi_table width="100%" border=0 cellpadding=2 cellspacing=0 {
+
+ # Context
+ cgi_table_row {
+ if {$zoomed} {
+ set marked " [cgi_bold marked]"
+ set c $zoomed
+ } else {
+ set marked ""
+ set c $messagecount
+ }
+
+ cgi_table_data align=left valign=middle class=context {
+ # write message number
+
+ if {[catch {WPCmd PEMailbox messagecount before [WPCmd PEMessage $uid number]} prior]} {
+ set prior 0
+ }
+
+ if {[catch {WPCmd PEMailbox messagecount after [WPCmd PEMessage $uid number]} remaining]} {
+ set remaining 0
+ }
+
+ if {$c == 1} {
+ set msgnotext "Only${marked} Message in [WPCmd PEMailbox mailboxname]"
+ } elseif {$remaining == 0} {
+ set msgnotext "[cgi_bold Last] of [WPcomma $c]${marked} message[WPplural $c]"
+ } elseif {$prior == 0} {
+ set msgnotext "[cgi_bold First] of [WPcomma $c]${marked} message[WPplural $c]"
+ } else {
+ if {[string length $marked]} {
+ append marked " messages"
+ set n [expr {$zoomed - $remaining}]
+ set msgnotext "Message [WPcomma $message] ($n of [WPcomma $c] [cgi_bold marked] messages)"
+ } else {
+ set msgnotext "Message [WPcomma $message] of [WPcomma $c]"
+ }
+ }
+
+ if {[info exists use_icon_for_status]} {
+ set staticon "[WPStatusImg $uid] "
+ set stattext ""
+ } else {
+ set staticon ""
+ switch -regexp [lindex [WPStatusIcon $uid] 0] {
+ del {
+ set stattext " (Deleted)"
+ }
+ new {
+ set stattext " (New)"
+ }
+ default {
+ set stattext ""
+ }
+ }
+ }
+
+ cgi_put "${staticon}${msgnotext}${stattext}"
+ }
+
+ if {$printable} {
+ cgi_table_data align=right valign=top bgcolor=#bfbfbf class=context {
+ cgi_puts "Folder: [WPCmd PEMailbox mailboxname]"
+ }
+ } else {
+ if {[info exists common_goto_in_view_specific_frame]} {
+ cgi_table_data align=right valign=top bgcolor=#bfbfbf class=context {
+ cgi_form $_wp(appdir)/$_wp(ui1dir)/wp method=get target=body {
+ cgi_text "page=view" type=hidden notab
+ cgi_text gonum= type=text size=4 maxlength=4 class=navtext
+ cgi_submit_button "goto=Jump to Msg" class=navtext
+ cgi_put [cgi_nbspace]
+ }
+ }
+ }
+
+ cgi_table_data align=right valign=top bgcolor=#bfbfbf class=context {
+ cgi_put [cgi_url [cgi_img [WPimg printer2] border=0 style=vertical-align:baseline] wp.tcl?page=view&uid=$uid&printable=1 target=_blank "onClick=if(window.print){window.print();return false;}else return true;"]
+ cgi_put [cgi_img [WPimg dot2] height=1 width=4]
+ if {[info exists hmode_url]} {
+ cgi_put $hmode_url
+ } else {
+ cgi_put [cgi_imglink dot]
+ }
+ }
+ }
+ }
+
+
+ cgi_table_row {
+ cgi_table_data valign=top bgcolor=#${bgcolor} class=view width="100%" colspan=2 {
+ cgi_preformatted "style=\"color:#$normal_fgcolor\"" {
+ #cgi_division "style=\"color: #$normal_fgcolor; font-family: courier\""
+
+ set msgtext [WPCmd PEMessage $uid text]
+
+ # pre-scan message text for anything interesting
+ foreach i $msgtext {
+ foreach j $i {
+ switch -exact [lindex $j 0] {
+ img {
+ if {![info exists showimages]} {
+ # ONLY IMG tags in HTML text that reference ATTACHED IMAGE files are allowed
+ if {[catch {WPCmd PEMessage $uid cid "<[lindex [lindex $j 1] 0]>"} cidpart] == 0
+ && [string length $cidpart]
+ && [catch {WPCmd PEMessage $uid attachinfo $cidpart} attachinfo] == 0
+ && [string compare [string tolower [lindex $attachinfo 1]] image] == 0} {
+
+ if {[catch {WPCmd PEMessage $uid fromaddr} fromaddr]} {
+ set fromaddr ""
+ } elseif {$showimg == 0} {
+ if {[catch {WPSessionState allow_cid_images} friends] == 0} {
+ while {[set findex [lsearch -exact $friends $fromaddr]] >= 0} {
+ set friends [lreplace $friends $findex $findex]
+ if {[catch {WPSessionState allow_cid_images $friends} friends]} {
+ catch {WPCmd PEInfo statmsg "Cannot forget image sender: $friends"}
+ break;
+ }
+ }
+ }
+
+ set showimg {}
+ }
+
+ if {[string length $showimg]
+ || ([catch {WPSessionState allow_cid_images} friends] == 0
+ && [lsearch -exact $friends $fromaddr] >= 0)} {
+
+ set showimages 1
+
+ if {[string length $fromaddr]} {
+ set bodyleadin "\[ Attached images ARE being displayed \]"
+ if {$showimg == 1} {
+ append bodyleadin "[cgi_nl]\[ Always show images from [cgi_url "$fromaddr" "wp.tcl?page=body&showimg=[WPPercentQuote $fromaddr]"] \]"
+ } else {
+ append bodyleadin "[cgi_nl]\[ Never show images from [cgi_url "$fromaddr" "wp.tcl?page=body&showimg=0"] \]"
+
+ if {[catch {WPSessionState allow_cid_images} friends] || [llength $friends] == 0} {
+ set friends $fromaddr
+ } elseif {[lsearch -exact $friends $fromaddr] < 0} {
+ lappend friends $fromaddr
+ }
+
+ if {[catch {WPSessionState allow_cid_images $friends} friends]} {
+ catch {WPCmd PEInfo statmsg "Cannot remember image sender: $friends"}
+ }
+ }
+ }
+ } else {
+
+ set showimages 0
+
+ set bodyleadin "\[ Attached images are NOT being displayed \]"
+ append bodyleadin "[cgi_nl]\[ Show images [cgi_url "below" "wp.tcl?page=body&showimg=1"]"
+ if {[string length $fromaddr]} {
+ append bodyleadin ", or always show images from [cgi_url "$fromaddr" "wp.tcl?page=body&showimg=[WPPercentQuote $fromaddr]"] \]"
+ } else {
+ append bodyleadin " \]"
+ }
+
+ }
+ }
+ }
+ }
+ default {}
+ }
+ }
+ }
+
+ set inbody 0
+ foreach i $msgtext {
+
+ if {!$inbody
+ && [llength $i] == 1
+ && [lindex [lindex $i 0] 0] == "t"
+ && 0 == [string length [lindex [lindex $i 0] 1]]} {
+ set inbody 1
+ if {[info exists bodyleadin]} {
+ cgi_puts $bodyleadin
+ }
+ }
+
+ foreach j $i {
+ set ttype [lindex $j 0]
+ set tdata [lindex $j 1]
+
+ # write anchors by hand
+ switch -- $ttype {
+ urlstart {
+ set href [lindex $tdata 0]
+ set name [lindex $tdata 1]
+
+ # build links by hand since we don't know where
+ # they'll terminate
+ set linktext "<a "
+ switch -- [lindex [split $href :] 0] {
+ XXX_mailto {
+ append linktext "href=\"null.tcl\" onClick=\"composeMsg('mailto','[lindex [split $href :] 1]','$webpine_key'); return false;\""
+ }
+ default {
+ if {[regexp -- "^\[a-zA-Z\]+:" $href ]} {
+ append linktext "href=\"$href\" target=_blank"
+ } ;# no relative links for security
+
+ if {[string length $name]} {
+ append linktext "name=\"$name\""
+ }
+ }
+ }
+
+ cgi_put "${linktext}>"
+ set inurl 1
+ }
+ urlend {
+ if {$inurl} {
+ cgi_put "</a>"
+ }
+ }
+ attach {
+ set attachuid [lindex $tdata 0]
+ set part [lindex $tdata 1]
+ set mimetype [lindex $tdata 2]
+ set mimesubtype [lindex $tdata 3]
+ if {[string length [lindex $tdata 4]]} {
+ set file [lindex $tdata 4]
+ } else {
+ if {[string length [lindex $tdata 5]]} {
+ set file "attachment.[lindex $tdata 5]"
+ } else {
+ set file "unknown.txt"
+ }
+ }
+
+ set attachurl "detach.tcl?uid=${attachuid}&part=${part}"
+ set saveurl "${attachurl}&download=1"
+ if {0 == [string compare -nocase $mimetype "text"]
+ && 0 == [string compare -nocase $mimesubtype "html"]} {
+ append attachurl "&download=1"
+ }
+
+ set attachexp "View ${mimetype}/${mimesubtype} Attachment"
+
+ if {0 == [string compare message [string tolower ${mimetype}]]
+ && 0 == [string compare rfc822 [string tolower ${mimesubtype}]]} {
+ set attmsgurl "wp.tcl?page=compose&oncancel=main.tcl&cid=[WPCmd PEInfo key]&uid=${attachuid}&part=${part}&style="
+ cgi_put [cgi_url [cgi_font size=-1 Fwd] "${attmsgurl}Forward" target=_top]
+ cgi_put "|[cgi_url [cgi_font size=-1 Reply] "${attmsgurl}Reply&reptext=1&repall=1&repqstr=[WPPercentQuote [WPCmd PEMessage $uid replyquote]]" target=_top]"
+
+ } else {
+ cgi_put [cgi_url [cgi_font size=-1 View] $attachurl target=_blank]
+ cgi_put "|[cgi_url [cgi_font size=-1 Save] $saveurl]"
+ }
+
+ if {[info exists attachurl]} {
+ set attachtext [WPurl $attachurl {} $hacktoken $attachexp target=_blank]
+ }
+ }
+ img {
+ if {[info exists showimages] && $showimages == 1
+ && [catch {WPCmd PEMessage $uid cid "<[lindex [lindex $j 1] 0]>"} cidpart] == 0
+ && [string length $cidpart]
+ && [catch {WPCmd PEMessage $uid attachinfo $cidpart} attachinfo] == 0
+ && [string compare [string tolower [lindex $attachinfo 1]] image] == 0} {
+ cgi_put [cgi_img detach.tcl?uid=${uid}&part=${cidpart} "alt=\[[lindex $tdata 1]\]"]
+ } else {
+ cgi_put "\[[lindex $tdata 1]\]"
+ }
+ }
+ fgcolor {
+ if {$infont} {
+ cgi_put "</font>"
+ set infont 0
+ }
+
+ if {[string compare $tdata $fgcolor]} {
+ set fgcolor $tdata
+ if {[string compare $fgcolor $normal_fgcolor]} {
+ cgi_put "<font color=#${tdata}>"
+ set infont 1
+ }
+ }
+ }
+ bgcolor {
+ if {$infont} {
+ cgi_put "</font>"
+ set infont 0
+ }
+
+ if {[string compare $tdata $bgcolor]} {
+ cgi_put "<font style=\"background: #${tdata}\">"
+ set bgcolor $tdata
+ set infont 1
+ }
+ }
+ color {
+ if {$infont} {
+ cgi_put "</font>"
+ set infont 0
+ }
+
+ if {[string compare [lindex $tdata 0] $fgcolor] || [string compare [lindex $tdata 1] $bgcolor]} {
+ cgi_put "<font color=#[lindex $tdata 0] style=\"background: #[lindex $tdata 1]\">"
+ set bgcolor $tdata
+ set infont 1
+ }
+ }
+ italic {
+ switch $tdata {
+ on { cgi_put "<i>" }
+ off { cgi_put "</i>" }
+ }
+ }
+ bold {
+ switch $tdata {
+ on { cgi_put "<b>" }
+ off { cgi_put "</b>" }
+ }
+ }
+ underline {
+ switch $tdata {
+ on { cgi_put "<u>" }
+ off { cgi_put "</u>" }
+ }
+ }
+ strikethru {
+ switch $tdata {
+ on { cgi_put "<s>" }
+ off { cgi_put "</s>" }
+ }
+ }
+ bigfont {
+ switch $tdata {
+ on { cgi_put "<font size=\"+1\">" }
+ off { cgi_put "</font>" }
+ }
+ }
+ smallfont {
+ switch $tdata {
+ on { cgi_put "<font size=\"-1\">" }
+ off { cgi_put "</font>" }
+ }
+ }
+ default {
+ if {[info exists attachtext] && [set ht [string first $hacktoken $attachtext]] >= 0} {
+ set firstbit [string range $attachtext 0 [expr {$ht - 1}]]
+ set lastbit [string range $attachtext [expr {$ht + [string length $hacktoken]}] end]
+ cgi_put " $firstbit[cgi_quote_html [string trimleft $tdata]]$lastbit"
+ unset attachtext
+ } else {
+ cgi_put [cgi_quote_html $tdata]
+ }
+ }
+ }
+ }
+
+ cgi_puts ""
+ }
+ }
+ }
+ }
+
+ if {![info exists attachuid]} {
+ if {!([catch {WPCmd PEMessage $uid attachinfo 1} typing]
+ || [string compare [string tolower [lindex $typing 1]] text]
+ || [string compare [string tolower [lindex $typing 2]] html])} {
+ cgi_table_row {
+ cgi_table_data align=center {
+ cgi_puts [cgi_font font-family=fixed "\[Note: you may also [cgi_url view "detach.tcl?uid=${uid}&part=1" target=_blank] HTML message directly in your browser\]"]
+ }
+ }
+ }
+ }
+ }
+
+ if {$infont} {
+ cgi_put "</font>"
+ }
+
+ if {$inurl} {
+ cgi_put "</a>"
+ }
+
+ if {[info exists _wp(cumulative)]} {
+ set l [string length $_wp(cumulative)]
+ if {$l < 6} {
+ set sl "."
+ while {$l < 6} {
+ append sl "0"
+ incr l
+ }
+ append sl $_wp(cumulative)
+ } else {
+ set sl "[string range $_wp(cumulative) 0 [expr $l - 7]].[string range $_wp(cumulative) [expr $l - 6] end]"
+ }
+
+ set servlettime "servlet = $sl"
+
+ if {[info exists wp_global_loadtime]} {
+ set clickdiff [expr {[clock clicks] - $wp_global_loadtime}]
+ # 500165 clicks/second
+ set st [expr ([string range $clickdiff 0 [expr [string length $clickdiff] - 4]] * 1000) / 500]
+ set l [string length $st]
+ set scripttime "tcl = [string range $st 0 [expr $l - 4]].[string range $st [expr $l - 3] end], "
+ } else {
+ set scripttime ""
+ }
+
+ cgi_puts [cgi_font size=-2 "style=font-family:sans-serif;font-weight:bold" "\[time: ${scripttime}${servlettime}\]"]
+ }
+ }
+ }
+ }
+ } \ No newline at end of file
diff --git a/web/cgi/alpine/1.0/wp.tcl b/web/cgi/alpine/1.0/wp.tcl
new file mode 100755
index 00000000..f649ca0a
--- /dev/null
+++ b/web/cgi/alpine/1.0/wp.tcl
@@ -0,0 +1,135 @@
+#!./tclsh
+# $Id: wp.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# wp.tcl
+#
+# Purpose: CGI script to serve as the frame-work for including
+# supplied script snippets that generate the various
+# javascript-free webpine pages
+#
+# Input:
+set wp_vars {
+ {page {} "main"}
+ {uidList {} ""}
+ {uidpage {} ""}
+}
+
+set wp_global_loadtime [clock clicks]
+
+# inherit global config
+source ./alpine.tcl
+source cmdfunc.tcl
+
+proc sortname {name {current 0}} {
+ global rev me
+
+ switch -- $name {
+ Number { set newname "#" }
+ OrderedSubj { set newname "Ordered Subject" }
+ Arrival { set newname Arv }
+ Status { set newname "&nbsp;" }
+ default { set newname $name }
+ }
+
+ if {$current} {
+ if {$rev > 0} {
+ set text [cgi_imglink increas]
+ set args rev=0
+ } else {
+ set text [cgi_imglink decreas]
+ set args rev=1
+ }
+
+ append newname [cgi_url $text "wp.tcl?page=body&sortrev=1" "title=Reverse $newname ordering" target=body]
+ }
+
+ return $newname
+}
+
+proc linecolor {linenum} {
+ global color
+
+ if {$linenum % 2} {
+ return $color(line1)
+ } else {
+ return $color(line2)
+ }
+}
+
+proc lineclass {linenum} {
+ if {$linenum % 2} {
+ return i0
+ } else {
+ return i1
+ }
+}
+
+proc uid_framed {u mv} {
+ foreach m $mv {
+ if {$u == [lindex $m 1]} {
+ return 1
+ }
+ }
+ return 0
+}
+
+WPEval $wp_vars {
+
+ # Resolve checked uidList
+ foreach uid [split $uidpage ","] {
+ WPCmd PEMessage $uid select [expr [lsearch $uidList $uid] >= 0]
+ }
+
+ # sourced "page" get's CGI parms from environment
+ if {[catch {WPTFScript $page} source]} {
+ switch -regexp -- $page {
+ addredit {
+ set source fr_addredit.tcl
+ }
+ addrsave {
+ set source addrsave.tcl
+ }
+ addrpick {
+ set source addrpick.tcl
+ }
+ ldappick {
+ set source ldappick.tcl
+ }
+ post {
+ set source post.tcl
+ }
+ prune {
+ set source prune.tcl
+ }
+ noop {
+ cgi_html {
+ cgi_head
+ cgi_body {}
+ }
+ unset source
+ }
+ default {
+ WPInfoPage "Web Alpine Error" [font size=+2 "Unknown WebPine page reference: $page."] \
+ "Please complain to the [cgi_link Admin]. Click Back button to return to previous page."
+ }
+ }
+
+ if {[info exists source]} {
+ set source [file join $_wp(cgipath) $_wp(appdir) $_wp(ui1dir) $source]
+ }
+ }
+
+ if {[info exists source]} {
+ source $source
+ }
+}
diff --git a/web/cgi/alpine/2.0/.htaccess b/web/cgi/alpine/2.0/.htaccess
new file mode 100644
index 00000000..dd9da02d
--- /dev/null
+++ b/web/cgi/alpine/2.0/.htaccess
@@ -0,0 +1,7 @@
+# set up default page
+DirectoryIndex ./browse
+
+# extensionless files are scripts
+<FilesMatch "^([^\.]+)$">
+ SetHandler cgi-script
+</FilesMatch>
diff --git a/web/cgi/alpine/2.0/alpine.tcl b/web/cgi/alpine/2.0/alpine.tcl
new file mode 120000
index 00000000..5ad8d42f
--- /dev/null
+++ b/web/cgi/alpine/2.0/alpine.tcl
@@ -0,0 +1 @@
+../alpine.tcl \ No newline at end of file
diff --git a/web/cgi/alpine/2.0/browse b/web/cgi/alpine/2.0/browse
new file mode 100755
index 00000000..9669fd8c
--- /dev/null
+++ b/web/cgi/alpine/2.0/browse
@@ -0,0 +1,336 @@
+#!./tclsh
+# $Id: browse 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# browse
+#
+# Purpose: CGI script that generates a page displaying a message
+# list of the indicated folder.
+#
+# Input: PATH_INFO: [/<col_number>]/<folder_name>[/<uid_of_first_msg>
+# along with possible search parameters:
+set browse_args {
+ {u {} 0}
+ {pageFirst {} ""}
+ {pagePrev {} ""}
+ {pageNext {} ""}
+ {pageLast {} ""}
+ {sort {} ""}
+ {rev {} ""}
+}
+
+# inherit global config
+source ./alpine.tcl
+source ./common.tcl
+source ./foldercache.tcl
+
+# default browse state
+set c 0
+set f INBOX
+
+# TEST:
+proc cgi_suffix {args} {
+ return ""
+}
+
+# for inserting debug comments at end of page
+set dmsgs ""
+proc dm {s} {
+ global dmsgs
+ lappend dmsgs $s
+}
+
+WPEval $browse_args {
+ # grok PATH_INFO for collection, 'c', and folder 'f'
+ if {[info exists env(PATH_INFO)] && [string length $env(PATH_INFO)]} {
+ if {![regexp {^/([0-9]+)/(.*)$} $env(PATH_INFO) dummy c f]} {
+ WPCmd PEInfo statmsg "Cannot open invalid path: $env(PATH_INFO)"
+ set c 0
+ set f INBOX
+ }
+ } elseif {[catch {WPCmd PEFolder current} curf]
+ || [lindex $curf 0] != 0
+ || [string compare -nocase [lindex $curf 1] inbox]} {
+ WPCmd PEInfo statmsg "No Folder Specified, opening INBOX"
+ }
+
+ # verify or visit specified collection/folder
+
+ if {[catch {setCurrentFolder c f u} result]} {
+ set authlist [wpHandleAuthException $result [list $c "open folder $f"] $f]
+ if {0 == [llength $authlist]} {
+ WPCmd PEInfo statmsg "$result"
+ set c 0
+ set f INBOX
+ } else {
+ set opening_folder 1
+ }
+ }
+
+ if {[info exists opening_folder]} {
+ set n 1
+ set u 0
+ } else {
+ # move anything deleted to Trash
+ if {[catch {WPCmd PEMailbox trashdeleted current} result]} {
+ WPCmd PEInfo statmsg "Trash move Failed: $result"
+ }
+
+ # set uid to "current" message?
+ if {$u <= 0 && 0 == [catch {WPCmd PEMailbox current} cm]} {
+ set u [lindex $cm 1]
+ }
+ }
+
+ # get default sort
+ if {[catch {WPCmd PEMailbox sort} cursort]} {
+ set sort date
+ set rev 1
+ }
+
+ # load index drawing routine for this session
+ # save perpage source, proc overhead
+ # call to reinstall during debugging:
+ #catch {WPCmd rename drawMessageList {}}
+ if {0 == [llength [WPCmd info commands drawMessageList]]} {
+ set cgidir [file join $_wp(cgipath) $_wp(appdir) $_wp(ui2dir)]
+ if {[catch {
+ WPCmd source "$_wp(confdir)/alpine.tcl"
+ WPCmd source "${cgidir}/common.tcl"
+ WPCmd source "${cgidir}/messagelist.tcl"
+ WPCmd source "${cgidir}/messageview.tcl"
+ WPCmd rename WPCmd {}
+ WPCmd rename WPEval {}
+ WPCmd rename WPGetInputAndID {}
+ WPCmd rename WPCmdEval WPCmd
+ } result]} {
+ error [list _action browse "cannot load index lister: $result"]
+ }
+ }
+
+ # current context or folder changed?
+ if {$c == 0 && 0 == [string compare -nocase $f inbox]} {
+ set f INBOX
+ }
+
+ # gain situational awareness, UID and number of message that must be on page
+ if {[catch {WPCmd PEMailbox focus} focused]} {
+ set mc 0
+ set focused 0
+ } elseif {$focused > 0} {
+ set mc $focused
+ } else {
+ set mc [WPCmd PEMailbox messagecount]
+ }
+
+ if {$u == 0} {
+ # non given, set to first message in folder
+ set n 1
+ if {[catch {WPCmd PEMailbox uid 1} u]} {
+ set n 0
+ set u 0
+ }
+ } elseif {[catch {WPCmd PEMessage $u number} n]} {
+ set n 0
+ set u 0
+ }
+
+ # lines per page
+ if {[catch {WPCmd PEInfo indexlines} ppg] || $ppg <= 0} {
+ set ppg $_wp(indexlines)
+ } elseif {$ppg > $_wp(indexlinesmax)} {
+ set ppg $_wp(indexlinesmax)
+ }
+
+ # look for image button clicks
+ foreach item $browse_args {
+ if {0 == [catch {cgi_import [lindex $item 0].x}]} {
+ set [lindex $item 0] 1
+ }
+ }
+
+ # preform actions specfied in browse_args
+ # NOTE: basic stuff only to be executed in absense of JS
+ if {[string length $pageFirst]} {
+ set n 1
+ set u [WPCmd PEMailbox uid 1]
+ } elseif {[string length $pagePrev]} {
+ if {$ppg >= $n} {
+ set n 1
+ } else {
+ set n [expr {$n - $ppg}]
+ }
+
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ set u 0
+ }
+ } elseif {[string length $pageNext]} {
+ if {($n + $ppg) <= $mc} {
+ incr n $ppg
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ set u 0
+ }
+ }
+ } elseif {[string length $pageLast]} {
+ set n $mc
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ set u 0
+ }
+ } elseif {[string length $sort]} {
+ switch $rev {
+ 0 -
+ 1 {
+ }
+ default {
+ set rev [lindex $cursort 1]
+ }
+ }
+
+ if {[catch {WPCmd PEMailbox sort $sort $rev} cursort]} {
+ WPCmd PEInfo statmsg "Cannot set sort: $cursort"
+ set cursort [list nonsense 0]
+ } else {
+ # store result
+ WPCmd set sort [list $sort $rev]
+ }
+ }
+
+ # page framing
+ if {[catch {
+ set nm [WPCmd PEMailbox flagcount [list unseen undeleted]]
+ set defcol [WPCmd PEFolder defaultcollection]
+ wpInitPageFraming u n mc ppg pn pt
+ }]} {
+ set pn 1
+ set pt 0
+ set nm 0
+ set defcol 0
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=UTF-8"
+ }
+
+ cgi_html {
+ cgi_head {
+ # WPStdHttpHdrs "text/html; charset=UTF-8"
+ cgi_title [wpPageTitle "$f, $pn of $pt ($nm)"]
+ cgi_base "href=$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)/"
+ cgi_stylesheet css/menu.css
+ cgi_stylesheet css/cbn/screen.css
+ cgi_stylesheet css/cbn/folderdialog.css
+ cgi_stylesheet $_wp(yui)/build/container/assets/container-core.css
+ cgi_stylesheet $_wp(yui)/build/menu/assets/skins/sam/menu.css
+ cgi_stylesheet $_wp(yui)/build/button/assets/skins/sam/button.css
+ # YahooUI libraries
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/utilities/utilities.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/container/container-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/datasource/datasource-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/menu/menu-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/button/button-min.js" {}
+ # local libraries
+ cgi_script type=text/javascript language="JavaScript" src="lib/common.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="lib/mailbox.js" {}
+ # page specfic JS
+ cgi_javascript {
+ cgi_puts "YAHOO.alpine.cgi_root = '$_wp(serverpath)';"
+ cgi_puts "YAHOO.alpine.app_root = '$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)';"
+ cgi_puts "YAHOO.alpine.current.c = $c;"
+ cgi_puts "YAHOO.alpine.current.f = \"$f\";"
+ cgi_puts "YAHOO.alpine.current.u = $u;"
+ cgi_puts "YAHOO.alpine.current.page = $pn;"
+ cgi_puts "YAHOO.alpine.current.count = $mc;"
+ if {[catch {
+ set mb_sel [WPCmd PEMailbox selected]
+ set mb_srch [WPCmd PEMailbox searched]
+ }]} {
+ set mb_sel 0
+ set mb_srch 0
+ }
+
+ cgi_puts "YAHOO.alpine.current.selected = $mb_sel;"
+ cgi_puts "YAHOO.alpine.current.searched = $mb_srch;"
+ cgi_puts "YAHOO.alpine.current.focused = $focused;"
+ cgi_puts "function bodyOnLoad(){"
+ cgi_puts " initMenus();"
+ cgi_puts " initMorcButton('listMorcButton');"
+ cgi_puts " initSelection();"
+ cgi_puts " if(YAHOO.env.ua.gecko > 0){ sizeVPHeight(); window.onresize = resizeVPHeight; }"
+ wpSetMessageListNewMailCheck
+ wpStatusAndNewmailJavascript
+ wpSaveMenuJavascript "browse" $c $f $defcol morcInBrowseDone
+ cgi_puts " if(self.loadDDElements) loadDDElements();"
+
+ if {[info exists authlist]} {
+ cgi_puts "YAHOO.alpine.resubmitRequest = function(){ window.location.href = 'browse/$c/$f'; };"
+ cgi_puts "YAHOO.alpine.cancelRequest = function(){ window.location.href = 'browse/0/INBOX'; };"
+ reportAuthException $authlist
+ }
+ cgi_puts "}"
+ cgi_puts "browserDetect();"
+ }
+ }
+
+ cgi_body class="wap" "onLoad=bodyOnLoad()" {
+ cgi_division id="skip" {
+ cgi_put [cgi_url "Skip to Next Page" "\#" "onClick=return newMessageList({control:this,parms:{op:'next'}});"]
+ cgi_put [cgi_url "Skip to Folders" "folders"]
+ cgi_put [cgi_url "Skip to Compose" "compose"]
+ }
+
+ cgi_division id=msgDragProxy {
+ cgi_put "<b class=b1></b><b class=b2></b><b class=b3></b><b class=b4></b><div id=msgDragProxyText></div><b class=b4></b><b class=b3></b><b class=b2></b><b class=b1></b>"
+ }
+
+ if {$focused} {
+ set context "Search Results in [cgi_quote_html $f]"
+ } else {
+ set context [cgi_quote_html $f]
+ }
+ wpCommonPageLayout browse $c $f $u $context [list [cgi_cgi "$_wp(appdir)/$_wp(ui2dir)/browse/${c}/${f}"] "$f" 1 mailboxSearch()] "" {
+ cgi_division class=hdrBtns {
+ cgi_javascript {
+ cgi_put "if(window.print) document.write('[cgi_buffer {cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi1" ""][cgi_span "class=hdrBtnText" Print]" "print" "onClick=return printContent()"]}]');"
+ }
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi2" ""][cgi_span "class=hdrBtnText" Settings]" "settings"]
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi3" ""][cgi_span "class=hdrBtnText" Help]" \# "onClick=return openMailboxHelp();" class=wap]
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi4" ""][cgi_span "class=hdrBtnText" "Sign out"]" "../../session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=${sessid}"]
+ }
+ } {
+ cgi_division id=listTopMenubar {
+ cgi_puts [WPCmd cgi_buffer "drawTopListMenuBar $c {$f}"]
+ }
+ cgi_division id=viewTopMenubar "style=\"display: none;\"" {
+ cgi_puts [WPCmd cgi_buffer "drawTopViewMenuBar $c {$f} $u $n"]
+ }
+ } {
+ if {[info exists opening_folder]} {
+ cgi_puts "Opening $f..."
+ } else {
+ cgi_puts [WPCmd cgi_buffer "drawMessageList $c {$f} $n $ppg"]
+ }
+ } {
+ cgi_division id=listBottomMenubar {
+ cgi_puts [WPCmd cgi_buffer "drawBottomListMenuBar $c {$f} $pn $pt $mc"]
+ }
+ cgi_division id=viewBottomMenubar "style=\"display: none;\"" {
+ cgi_puts [WPCmd cgi_buffer "drawBottomViewMenuBar $c {$f} $u $n $mc"]
+ }
+ }
+
+ foreach dmsg $dmsgs {
+ cgi_html_comment "DEBUG: $dmsg"
+ cgi_puts ""
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/2.0/common.tcl b/web/cgi/alpine/2.0/common.tcl
new file mode 100644
index 00000000..41e58a7a
--- /dev/null
+++ b/web/cgi/alpine/2.0/common.tcl
@@ -0,0 +1,905 @@
+# $Id: common 391 2007-01-25 03:53:59Z mikes@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# common.tcl
+#
+# Purpose: TCL script snippets that the various CGI script generating pages
+# have in common
+#
+
+proc wpSelectedClass {seld unread defclass} {
+ set class $defclass
+ if {[expr $seld]} {
+ append class " sel"
+ }
+
+ if {$unread} {
+ append class " bld"
+ }
+
+ return $class
+}
+
+proc wpPageTitle {page} {
+ return "$page - Web Alpine 2.0"
+}
+
+proc current_context {page c f cc cf} {
+ set ct {[lsearch {browse view} $page] >= 0 && }
+ if {0 == $cc && 0 == [string compare -nocase inbox $cf]} {
+ append ct {0 == $c && 0 == [string compare -nocase inbox $f]}
+ } else {
+ append ct {$cc == $c && 0 == [string compare $cf $f]}
+ }
+
+ set current [expr $ct]
+}
+
+proc folder_link {current page c f u unread {ficon ""}} {
+ set url "browse/$c/[WPPercentQuote $f {/}]"
+ set clickurl $url
+ set urlid ""
+ set fclass ""
+ set fid ""
+ if {$current} {
+ set urlid "id=\"gFolder\""
+ set urid "id=\"unreadCurrent\""
+ set fid "id=\"fCurrent\""
+ set onclick "onClick=return newMessageList({parms:{op:'unfocus',page:'new'}});"
+ } elseif {[string length $ficon]} {
+ set fq [cgi_quote_html $f]
+ set urid "id=\"unread${fq}\""
+ set fid "id=\"f${fq}\""
+ set onclick [onClick $clickurl]
+ } else {
+ set urid ""
+ set onclick ""
+ }
+
+ if {$unread} {
+ set fclass "class=bld"
+ set urc " ($unread)"
+ } elseif {[string length $ficon] || $current} {
+ set urc ""
+ }
+
+ if {[info exists urc]} {
+ set urt [cgi_span "class=wap unrd" $urid $urc]
+ } else {
+ set urt ""
+ }
+
+ if {![string length $ficon]} {
+ set ficon [cgi_span "class=sp splc splc7" ""]
+ }
+
+ if {[string length $f] > 20} {
+ set f "...[string range $f end-18 end]"
+ }
+
+ return "[cgi_url "$ficon[cgi_span $fid $fclass [cgi_quote_html $f]]" $url class=wap $urlid $onclick]$urt"
+}
+
+proc empty_link {current falias c} {
+ if {$current} {
+ set emptyfunc emptyCurrent
+ } else {
+ switch $falias {
+ Trash { set emptyfunc emptyTrash}
+ Junk { set emptyfunc emptyJunk }
+ }
+ }
+ if {[info exists emptyfunc]} {
+ return "\[[cgi_url "Empty" "#" "onClick=panelConfirm('Are you sure you want to permanently delete the contents of the $falias folder?<p>Deleted messages are gone forever.',{text:'Empty $falias',fn:$emptyfunc}); return false;" title="Permanently delete all messages in the $falias folder" class=wap]\]"
+ }
+
+ return ""
+}
+
+proc context_class {current focus} {
+ if {$current != 0 && $focus == 0} {
+ return "fld sel"
+ }
+
+ return "fld"
+}
+
+proc div_folder {page c f u cc cf unread focus {ficon ""}} {
+ set current [current_context $page $c $f $cc $cf]
+ cgi_division class="[context_class $current $focus]" {
+ cgi_put [folder_link $current $page $cc $cf $u $unread $ficon]
+ }
+}
+
+proc wpStatusAndNewmailJavascript {} {
+ foreach sm [WPCmd PEInfo statmsgs] {
+ regsub -all {'} $sm {\'} sm
+ cgi_puts " addStatusMessage('$sm',15);"
+ }
+
+ if {[catch {WPCmd PESession mailcheck 0} newmail]} {
+ regsub -all {'} $newmail {\'} newmail
+ cgi_puts " addStatusMessage('New Mail Error: $newmail',10);"
+ } else {
+ foreach nm $newmail {
+ set text [lindex $nm 2]
+ regsub -all {'} $text {\'} text
+ if {[string length $text]} {
+ cgi_puts " addStatusMessage('${text}',10);"
+ }
+ }
+ }
+
+ cgi_puts " displayStatusMessages();"
+ catch {WPCmd PEMailbox newmailreset}
+}
+
+proc wpSetMessageListNewMailCheck {} {
+ cgi_puts " setCheckMailFunction('gCheck', function(){ newMailCheck(0,'newMessageList()'); });"
+ cgi_puts " setNewMailCheckInterval([WPCmd PEInfo inputtimeout], 'newMessageList()');"
+}
+
+set clicktest ""
+
+proc onClick {dest} {
+ global clicktest
+
+ if {[string length $clicktest]} {
+ return "onClick=[$clicktest $dest]"
+ }
+
+ return ""
+}
+
+proc var_value {var} {
+ set varval [WPCmd PEConfig varget $var]
+ switch [lindex $varval 1] {
+ textarea {
+ return [join [lindex $varval 0] "\n"]
+ }
+ listbox {
+ return [lindex $varval 0]
+ }
+ default {
+ return [lindex [lindex $varval 0] 0]
+ }
+ }
+
+ return ""
+}
+
+# table representing common overall page layout
+#
+# NOTES: bodyform doesn't flow thru cgi.tcl,but it keeps menu bar's
+# easier for caller to keep stright
+#
+proc wpCommonPageLayout {curpage c f u context searchform leavetest cmds menubar_top content menubar_bottom} {
+ global _wp clicktest
+
+ set thispage [lindex $curpage 0]
+
+ set clicktest $leavetest
+
+ if {[catch {WPCmd PEMailbox focus} focused]} {
+ set focused 0
+ }
+
+ # various positioned elements
+
+ # busy cue
+ cgi_division id="bePatient" {
+ cgi_put "Working..."
+ }
+
+ cgi_table class="page" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+
+ cgi_table_row {
+ cgi_table_data class="spc" colspan="3" {
+ cgi_put [cgi_span "class=sp trans" "style=height:1px;width:2px;" [cgi_span " "]]
+ }
+ }
+
+ # CONTEXT
+ cgi_table_row {
+ cgi_table_data class="wap topHdr" {
+ cgi_division id=hdrLogo {
+ cgi_puts [cgi_img "img/cbn/alpinelogo.gif" name="logo" class="logo" "title=Web Alpine [WPCmd PEInfo version]" class=wap]
+ cgi_puts [cgi_span "class=logo wap" "v [WPCmd PEInfo version].[WPCmd PEInfo revision]"]
+ }
+ }
+
+ cgi_table_data class="topHdr" {
+ cgi_put [cgi_span "class=sp trans" "style=height:2px;width:5px;" " "]
+ }
+
+ cgi_table_data class="wap topHdr" {
+ cgi_division class=hdrContent {
+ # RSS INFO STREAM
+ if {[catch {WPCmd PERss news} news]} {
+ cgi_put [cgi_nbspace]
+ cgi_html_comment "RSS FAILURE: $news"
+ } else {
+ if {[llength $news] > 0} {
+ set style ""
+ set n 0
+ foreach item $news {
+ cgi_put [cgi_span class=RSS $style "[cgi_span "class=sp newsImg" "onClick=\"return rotateNews(this);\"" ""][cgi_url [lindex $item 0] [lindex $item 1] "onClick=this.blur();" id=newsItem$n target=_blank]"]
+ set style "style=display: none;"
+ }
+ } else {
+ cgi_put [cgi_nbspace]
+ }
+ }
+
+ # STATUS LINE
+ cgi_division class=wbar id=statusMessage {
+ cgi_division class=status {
+ cgi_division "class=\"flt edge\"" {
+ cgi_put [cgi_span "class=sp spsm sm1" ""]
+ }
+ cgi_division "class=\"frt cap\"" {}
+ cgi_division "class=\"frt edge\"" {
+ cgi_put [cgi_url [cgi_span "class=sp spsm sm2" ""] "" class=wap "onClick=hideStatusMessage(); return false;"]
+ }
+ cgi_division class=center id=statusMessageText {}
+ }
+ }
+
+ # WEATHER/USAGE/STATUS
+ cgi_division class=wbar id=weatherBar {
+ # RSS WEATHER
+ cgi_division class=weather id=rssWeather {
+ if {[catch {WPCmd PERss weather} weather]} {
+ cgi_html_comment "RSS FAILURE: $weather"
+ cgi_put [cgi_nbspace]
+ } else {
+ if {[llength $weather] > 0} {
+ set item [lindex $weather 0]
+ cgi_put [cgi_url [lindex $item 0] [lindex $item 1] "onClick=this.blur();" target=_blank]
+ } else {
+ cgi_put [cgi_nbspace]
+ }
+ }
+ }
+ if {[info exists _wp(usage)]
+ && 0 == [catch {exec -- $_wp(usage) [WPCmd set env(WPUSER)]} usage]
+ && [regexp {^([0-9]+)[ ]+([0-9]+)$} $usage dummy use_current use_total]
+ && $use_total > 0
+ && $use_current <= $use_total} {
+ cgi_division class=usage {
+ cgi_table width="180px" cellpadding="0" cellspacing="0" {
+ cgi_table_row {
+ cgi_table_data class=wap width="1%" align=right {
+ cgi_put [cgi_nbspace]
+ }
+ cgi_table_data class=wap width="98%" {
+
+ set useperc [expr {($use_current * 100) / $use_total}]
+
+ cgi_table border=0 width="100%" height="12px" cellspacing=0 cellpadding=0 align=right {
+ set percentage [expr {($use_current * 100)/$use_total}]
+ cgi_table_row {
+ cgi_table_data class=wap align=right "style=\"border: 1px solid black; border-right: 0; background-color: #408040;\"" width="$useperc%" {
+ cgi_put [cgi_span "class=sp trans" "style=height:1px;width:1px;" [cgi_span " "]]
+ }
+ cgi_table_data class=wap align=right "style=\"border: 1px solid black; background-color: #ffffff;\"" width="[expr {100 - $useperc}]%" {
+ cgi_put [cgi_span "class=sp trans" "style=height:1px;width:1px;" [cgi_span " "]]
+ }
+ }
+ }
+ }
+ cgi_table_data class=wap width="1%" align=right {
+ set units MB
+ if {[info exists _wp(usage_link)]} {
+ set txt [cgi_url $use_total $_wp(usage_link) "onClick=this.blur();" title="Detailed usage report" target="_blank"]
+ } else {
+ set txt $use_total
+ }
+
+ cgi_put [cgi_span "style=margin-left: .25em" $txt]
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_division class=pageTitle id=pageTitle {
+ cgi_put $context
+ }
+
+ cgi_division class=commands {
+ uplevel 1 $cmds
+ }
+ }
+ }
+ }
+ cgi_noscript {
+ cgi_table_row {
+ cgi_table_data class=noscript colspan="3" {
+ cgi_put "This version of Web Alpine requires Javascript. Please enable Javascript, or use the [cgi_url "HTML Version" "$_wp(serverpath)/$_wp(appdir)/$_wp(ui1dir)/wp.tcl"] of Web Alpine"
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data id=leftColumn class="wap checkMailandCompose" {
+ cgi_table class="toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_put "<tbody>"
+ cgi_table_row {
+ cgi_table_data class="wap" {
+ set nUrl "browse/"
+ if {0 == [regexp {^[0-9]+$} $c]} {
+ append nUrl "/0'"
+ } else {
+ append nUrl "/$c'"
+ }
+
+ if {0 == [string length $f]} {
+ append nUrl "/INBOX'"
+ } else {
+ append nUrl "/[WPPercentQuote $f]"
+ }
+
+ set nUrl "browse/$c/$f"
+ cgi_put [cgi_url [cgi_span "class=sp spmbi spmb15" "Check Mail"] $nUrl title="Check for New Mail" id=gCheck "onClick=this.blur(); return false;"]
+ }
+ cgi_table_data class="wap dv1" {
+ cgi_puts [cgi_span "class=sp spmb spmb3" ""]
+ }
+ cgi_table_data class="wap" {
+ set cUrl compose
+ if {[string compare compose $thispage]} {
+ switch $thispage {
+ browse { append cUrl "?pop=browse/$c/$f" }
+ view { append cUrl "?pop=view/$c/$f/$u" }
+ default { append cUrl "?pop=$thispage" }
+ }
+ }
+
+ cgi_put [cgi_url [cgi_span "class=sp spmbi spmb16" "Compose"] $cUrl id=composeLink title="Compose New Message" [onClick $cUrl]]
+ }
+ }
+ cgi_put "</tbody>"
+ }
+
+ cgi_division class=searchFormDiv {
+ cgi_form [lindex $searchform 0] id=searchForm method=post enctype=multipart/form-data {
+ if {[string length [lindex $searchform 3]]} {
+ set sclick [lindex $searchform 3]
+ } else {
+ set sclick "showStatusMessage('Search is NOT implemented yet',3)"
+ }
+
+ cgi_text "searchText=Search in [lindex $searchform 1]" class=wap id=searchField title="Click here to search" "onBlur=recallTextField(this, 'Search in [lindex $searchform 1]')" "onClick=\"clearTextField(this, 'Search in [lindex $searchform 1]')\"" "onKeyPress=\"return searchOnEnter(event,'searchButton');\"" maxlength="256"
+ cgi_put "<input alt=\"Search\" name=\"search\" class=\"sp searchBtn\" type=\"submit\" value=\"\" src=\"\" id=\"searchButton\" onClick=\"${sclick}; this.blur(); return false;\" />"
+
+ set srclass "fld"
+ set searched 0
+ if {[lsearch {browse view} $thispage] >= 0 && 0 == [catch {WPCmd PEMailbox searched} searched] && $searched} {
+ set style ""
+ if {$focused} {
+ append srclass " sel"
+ }
+ } else {
+ set style "display:none;"
+ }
+
+ cgi_division id="searchRefine" style=\"$style\" {
+ cgi_select scope id=searchScope {
+ cgi_option "Search within Results" value=narrow
+ cgi_option "Add to Search Results" value=broad
+ cgi_option "New Search" value=new selected
+ }
+ }
+ }
+ }
+
+ if {[lindex $searchform 2]} {
+ cgi_division id=searchAdvance {
+ cgi_puts [cgi_url "Advanced Search" "browse/$c/$f?search=1" class="wap" "onClick=return advanceSearch();"]
+ }
+ cgi_division id=searchClear style=$style {
+ cgi_puts "\[[cgi_url Clear # class="wap" "onClick=return newMessageList({parms:{op:'search',type:'none',page:'new'}});"]\]"
+ }
+ }
+
+ cgi_division class=searchFormDiv {cgi_puts [cgi_nbspace]}
+
+ cgi_division id=searchResult class="$srclass" style=\"$style\" {
+ cgi_puts [cgi_url "[cgi_span "class=sp splc splc9" ""][cgi_span class=bld id=searchResultText [cgi_quote_html "Search Result ($searched)"]]" browse/$c/$f?search=1 class=wap "onClick=return listSearchResults();"]
+ }
+
+ if {0 == [string compare [lindex $curpage 0] settings]} {
+ uplevel 1 [lindex $curpage 1]
+ } else {
+ cgi_division class="folderPane" {
+ cgi_anchor_name folders
+ cgi_division class=folderList {
+ set defc [WPCmd PEFolder defaultcollection]
+
+ cgi_javascript {
+ cgi_puts "function emptyCurrent(){"
+ cgi_puts " doEmpty(null,'all');"
+ cgi_puts "}"
+ cgi_puts "function emptyTrash(){"
+ cgi_puts " emptyFolder('$defc','[var_value trash-folder]','all',{status:true,fn:'fixupUnreadCount(\"Trash\",0)'});"
+ cgi_puts "}"
+ if {[info exists _wp(spamfolder)]} {
+ cgi_puts "function emptyJunk(){"
+ cgi_puts " emptyFolder('$defc','$_wp(spamfolder)','all',{status:true,fn:'fixupUnreadCount(\"Junk\",0)'});"
+ cgi_puts "}"
+ }
+ }
+
+ set current [current_context $thispage $c $f 0 INBOX]
+ cgi_division class="[context_class $current $focused]" id=targetInbox {
+ cgi_put [folder_link $current $thispage 0 INBOX $u [WPCmd PEFolder unread 0 INBOX] [cgi_span "class=sp splc splc1" ""]]
+ if {0 == [string compare browse $thispage] && [string compare -nocase inbox $f]} {
+ lappend ddtargets [list targetInbox 0 INBOX]
+ }
+ }
+
+ set draftf [var_value postponed-folder]
+ if {0 == [catch {WPCmd PEFolder exists $defc $draftf} result] && $result} {
+ div_folder $thispage $c $f $u $defc Drafts [WPCmd PEFolder unread $defc $draftf] $focused [cgi_span "class=sp splc splc2" ""]
+ }
+
+ div_folder $thispage $c $f $u $defc Sent [WPCmd PEFolder unread $defc [var_value default-fcc]] $focused [cgi_span "class=sp splc splc3" ""]
+
+ if {[info exists _wp(spamfolder)]} {
+ set current [current_context $thispage $c [wpSpecialFolder $c $f] $defc Junk]
+ cgi_division class="[context_class $current $focused]" {
+ cgi_put [cgi_span "xclass=left" [folder_link $current $thispage $defc Junk $u [WPCmd PEFolder unread $defc $_wp(spamfolder)] [cgi_span "class=sp splc splc4" ""]]]
+ cgi_put [cgi_span "class=right" [empty_link $current Junk $defc]]
+ }
+ }
+
+ set current [current_context $thispage $c [wpSpecialFolder $c $f] $defc Trash]
+ cgi_division class="[context_class $current $focused]" id=targetTrash {
+ set trashf [var_value trash-folder]
+ cgi_put [cgi_span class=left [folder_link $current $thispage $defc Trash $u [WPCmd PEFolder unread $defc $trashf] [cgi_span "class=sp splc splc5" id=targetTrashIcon [cgi_span [cgi_nbspace]]]]]
+ cgi_put [cgi_span class=right [empty_link $current Trash $defc]]
+ if {0 == [string compare browse $thispage] && [string compare Trash $f]} {
+ lappend ddtargets [list targetTrash $defc $trashf]
+ }
+ }
+ cgi_division class="wap fld" {
+ cgi_put [cgi_nbspace]
+ }
+
+ cgi_division class="[wpSelectedClass "0 == [string compare $thispage contacts]" 0 "fld"]" id=targetContacts {
+ set cUrl contacts
+ cgi_put [cgi_url "[cgi_span "class=sp splc splc6" ""][cgi_span Contacts]" $cUrl title="Contact List" class=wap [onClick $cUrl]]
+ if {0 == [string compare browse $thispage]} {
+ if {0 == [catch {WPCmd PEAddress books} booklist]} {
+ set tAFargs "\{books:\["
+ set comma ""
+ foreach b $booklist {
+ regsub -all {'} [lindex $b 1] {\'} bname
+ append tAFargs "${comma}\{book:[lindex $b 0],name:'$bname'\}"
+ set comma ","
+ }
+
+ append tAFargs "\]\}"
+ } else {
+ set tAFargs {{}}
+ }
+
+ # pass address book list
+ cgi_puts "<script>setDragTarget('targetContacts',takeAddressFrom,$tAFargs);</script>"
+ }
+ }
+ cgi_division class="fld" {
+ cgi_put [cgi_nbspace]
+ }
+ cgi_division class="ftitle bld" {
+ cgi_put "Recent Folders"
+ }
+
+ if {[catch {WPSessionState left_column_folders} fln]} {
+ set fln $_wp(fldr_cache_def)
+ }
+
+ set nfl 0
+
+ foreach fce [getFolderCache] {
+ set fccol [lindex $fce 0]
+ set fcname [lindex $fce 1]
+ if {0 == [catch {WPCmd PEFolder exists $fccol $fcname} result] && $result} {
+ set current [current_context $thispage $c $f $fccol $fcname]
+ set folderID target$nfl
+ cgi_division class="[context_class $current $focused]" id=$folderID {
+ cgi_put [folder_link $current $thispage $fccol $fcname $u [WPCmd PEFolder unread $fccol $fcname] [cgi_span "class=sp splc splc7" id=${folderID}Icon [cgi_span [cgi_nbspace]]]]
+ if {0 == [string compare browse $thispage] && !($c == $fccol && 0 == [string compare $f $fcname])} {
+ lappend ddtargets [list $folderID $fccol $fcname]
+ }
+ }
+ }
+
+ if {[incr nfl] >= $fln} {
+ break
+ }
+ }
+
+ cgi_division class="wap fld" {
+ cgi_put [cgi_nbspace]
+ }
+ cgi_division class="[wpSelectedClass "0 == [string compare $thispage folders]" 0 "fld"]" {
+ set fUrl "folders"
+ cgi_put [cgi_url "[cgi_span "class=sp splc splc8" ""][cgi_span "View/Manage Folders..."]" $fUrl title="View, Create, Rename, and Delete Folders" class=wap [onClick $fUrl]]
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_data class="spc" rowspan="2" {
+ cgi_put [cgi_span "class=sp trans" "style=height:2px;width:5px;" [cgi_span " "]]
+ }
+
+ cgi_table_data width="100%" valign="top" {
+ cgi_table class="wap content" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data id=topToolbar class=wap {
+ cgi_anchor_name toolbar
+ uplevel 1 $menubar_top
+ }
+ }
+
+ # display page content
+ cgi_table_row {
+ cgi_table_data height="100%" valign="top" {
+ cgi_division id=alpineContent {
+ uplevel 1 $content
+ }
+ }
+ }
+
+ cgi_puts "</tbody>"
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table class="toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data class="wap txt" {
+ cgi_put "[cgi_span id=blankyblank "[cgi_nbspace]"]"
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ }
+
+ cgi_table_data id=bottomToolbar class=wap valign="bottom" {
+ uplevel 1 $menubar_bottom
+ }
+ }
+ cgi_table_row {
+ cgi_table_data id=ftrContent colspan="3" class="wap footer" align="center" {
+ set ft "Powered by [cgi_url Alpine "http://www.washington.edu/alpine/" target="_blank"] - [cgi_copyright] 2007 University of Washington"
+ if {0 == [string compare browse $thispage]} {
+ append ft " - [cgi_url "HTML Version" "$_wp(serverpath)/$_wp(appdir)/$_wp(ui1dir)/wp.tcl"]"
+ }
+
+ if {[info exists _wp(comments)] && [lsearch {browse view} $thispage] >= 0} {
+ append ft " - [cgi_url "Comments?" "mailto?to=$_wp(comments)&pop=browse/$c/[WPPercentQuote $f]"]"
+ }
+
+ cgi_puts $ft
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+
+ if {[info exists ddtargets]} {
+ cgi_puts "<script>"
+ foreach t $ddtargets {
+ regsub -all {'} [lindex $t 2] {\'} fn
+ cgi_puts "setDragTarget('[lindex $t 0]',dragOntoFolder,{c:'[lindex $t 1]',f:'$fn'});"
+ }
+ cgi_puts "</script>"
+ }
+}
+
+proc setCurrentFolder {_c _f _u} {
+ global _wp
+
+ upvar 1 $_c c
+ upvar 1 $_f f
+ upvar 1 $_u u
+
+ # verify current collection/folder
+ if {[catch {WPCmd PEFolder current} curfold]} {
+ set curc -1
+ set curf ""
+ } else {
+ set curc [lindex $curfold 0]
+ set curf [lindex $curfold 1]
+ }
+
+ # "current" folder's context
+ if {$c < 0} {
+ set c $curc
+ }
+
+ # "current" folder
+ if {0 == [string length $f]} {
+ set f $curf
+ }
+
+ if {[catch {WPCmd PEFolder defaultcollection} defc]} {
+ set defc 0
+ }
+
+ # open a different folder?
+ if {!($c == $curc && 0 == [string compare $f $curf])} {
+ # weed out special use folders
+ if {0 == $c && 0 == [string compare -nocase $f inbox]} {
+ set f INBOX
+ set truef INBOX
+ } else {
+ if {$c == $defc} {
+ switch -regexp -- $f {
+ {^Drafts$} {
+ set mode draft
+ catch {WPCmd set pre_draft_folder [WPCmd PEFolder current]}
+ set pf [var_value postponed-folder]
+ if {[string compare $curf $pf]} {
+ set truef $pf
+ if {[catch {
+ if {[WPCmd PEFolder exists $c $pf] <= 0} {
+ WPCmd PEFolder create $c $pf
+ }
+ } result]} {
+ WPCmd PEInfo statmsg $result
+ }
+ }
+ }
+ {^Trash$} {
+ set mode trash
+ set pf [var_value trash-folder]
+ if {[string compare $curf $pf]} {
+ set truef $pf
+ if {[catch {
+ if {[WPCmd PEFolder exists $c "$pf"] <= 0} {
+ WPCmd PEFolder create $c "$pf"
+ }
+ } result]} {
+ WPCmd PEInfo statmsg $result
+ }
+ }
+ }
+ {^Junk$} {
+ if {[info exists _wp(spamfolder)]} {
+ set mode junk
+ set pf $_wp(spamfolder)
+ if {[string compare $curf $pf]} {
+ set truef $pf
+ if {[catch {
+ if {[WPCmd PEFolder exists $c $pf] <= 0} {
+ WPCmd PEFolder create $c $pf
+ }
+ } result]} {
+ WPCmd PEInfo statmsg $result
+ }
+ }
+ } else {
+ set truef $f
+ }
+ }
+ {^Sent$} {
+ set mode sent
+ set pf [var_value default-fcc]
+ if {[string compare $curf $pf]} {
+ set truef $pf
+ if {[catch {
+ if {[WPCmd PEFolder exists $c $pf] <= 0} {
+ WPCmd PEFolder create $c $pf
+ }
+ } result]} {
+ WPCmd PEInfo statmsg $result
+ }
+ }
+ }
+ default {
+ set truef $f
+ }
+ }
+ } else {
+ set truef $f
+ }
+ }
+
+ if {[info exists truef]} {
+ if {[catch {eval WPCmd PEMailbox open [list $c $truef]} reason]} {
+ error $reason
+ } else {
+ # do_broach handled this: WPCmd PEInfo statmsg "$f opened with [WPCmd PEMailbox messagecount] messages"
+
+ if {![info exists mode]} {
+ addFolderCache $c $f
+ }
+
+ if {[catch {WPCmd PEMailbox trashdeleted current} result]} {
+ WPCmd PEInfo statmsg "Detete FAILURE: $result"
+ }
+ }
+ }
+ } else {
+ # verify $c $f (and $u if present) exists
+ if {!($c == 0 && 0 == [string compare -nocase inbox $f])} {
+ if {[catch {WPCmd PEFolder exists $c $f} result]} {
+ WPCmd PEInfo statmsg "Cannot test $f for existance: $result"
+ } elseif {$result <= 0} {
+ WPCmd PEInfo statmsg "Folder $f in collection $c does not exist"
+ }
+ }
+
+ if {$u > 0 && [catch {WPCmd PEMessage $u number} result]} {
+ WPCmd PEInfo statmsg "Message $u does not exist: $result"
+ }
+ }
+}
+
+proc wpFolderMode {c f} {
+ if {$c == [WPCmd PEFolder defaultcollection]} {
+ switch -exact -- $f {
+ Drafts { return draft }
+ Sent { return sent }
+ Junk { return junk }
+ Trash { return trash }
+ }
+ }
+
+ return ""
+}
+
+proc wpInitPageFraming {_u _n _mc _ppg _pn _pt} {
+ upvar 1 $_u u
+ upvar 1 $_n n
+ upvar 1 $_mc mc
+ upvar 1 $_ppg ppg
+ upvar 1 $_pn pn
+ upvar 1 $_pt pt
+
+ if {[catch {WPCmd PEMailbox trashdeleted current} result]} {
+ WPCmd PEInfo statmsg "Deleted move to Trash failed: $result"
+ }
+
+ if {[catch {WPCmd PEMailbox focus} focused]} {
+ set focused 0
+ }
+
+ if {$n > 0} {
+ set pt [expr {$mc / $ppg}]
+
+ if {$pt < 1} {
+ set pt 1
+ } elseif {$mc % $ppg} {
+ incr pt
+ }
+
+ if {$focused} {
+ set nth [WPCmd PEMailbox messagecount before $n]
+ incr nth
+ } else {
+ set nth $n
+ }
+
+ if {$nth > $ppg} {
+ set pn [expr {$nth / $ppg}]
+ if {$nth % $ppg} {
+ incr pn
+ }
+
+ set n [expr {(($pn - 1) * $ppg) + 1}]
+ if {$focused} {
+ set n [WPCmd PEMailbox next [WPCmd PEMailbox first] $n]
+ }
+ } else {
+ set pn 1
+ set n [WPCmd PEMailbox first]
+ }
+
+ set u [WPCmd PEMailbox uid $n]
+ } else {
+ set mc 0
+ set pt 1
+ set pn 1
+ }
+}
+
+proc wpHandleAuthException {err c {f ""}} {
+ global _wp
+
+ if {[regexp {^CERTQUERY ([^+]+)\+\+(.*)$} $err dummy server reason]} {
+ return "code:'CERTQUERY',server:\"${server}\",reason:\"${reason}\""
+ } elseif {[regexp {^CERTFAIL ([^+]+)\+\+(.*)$} $err dummy server reason]} {
+ return "code:'CERTFAIL',server:\"${server}\",reason:\"${reason}\""
+ } elseif {[regexp {^NOPASSWD (.*)$} $err dummy server]} {
+ return "code:'NOPASSWD',c:[lindex $c 0],f:\"${f}\",server:\"{${server}/tls}\",reason:\"[lindex $c 1]\",sessid:\"$_wp(sessid)\""
+ } elseif {[regexp {^BADPASSWD (.*)$} $err dummy server]} {
+ return "code:'BADPASSWD',c:[lindex $c 0],f:\"${f}\",server:\"{${server}/tls}\",reason:\"[lindex $c 1]\",sessid:\"$_wp(sessid)\""
+ }
+
+ return {}
+}
+
+proc reportAuthException {exp} {
+ cgi_put "processAuthException(\{$exp\});"
+}
+
+proc wpSaveMenuJavascript {p c f dc onDone {df ""}} {
+ set nn 0;
+ cgi_put "updateSaveCache(\"$p\",$c,\"$f\",$dc,$onDone,\["
+ foreach {oname oval} [getSaveCache $df] {
+ if {[incr nn] > 1} {
+ cgi_put ","
+ }
+
+ cgi_put "{fn:\"$oname\",fv:\"$oval\"}"
+ }
+ cgi_puts "\]);"
+}
+
+proc wpLiteralFolder {c f} {
+ global _wp
+
+ if {$c == [WPCmd PEFolder defaultcollection]} {
+ switch -exact -- $f {
+ Draft {
+ return [var_value postponed-folder]
+ }
+ Sent {
+ return [var_value default-fcc]
+ }
+ Junk {
+ if {[info exists _wp(spamfolder)]} {
+ return $_wp(spamfolder)
+ }
+ }
+ Trash {
+ return [var_value trash-folder]
+ }
+ }
+ }
+
+ return $f
+}
+
+proc wpSpecialFolder {c f} {
+ global _wp
+
+ if {$c == [WPCmd PEFolder defaultcollection]} {
+ if {0 == [string compare $f [var_value postponed-folder]]} {
+ return Draft
+ }
+
+ if {0 == [string compare $f [var_value default-fcc]]} {
+ return Sent
+ }
+ if {[info exists _wp(spamfolder)]} {
+ if {0 == [string compare $f $_wp(spamfolder)]} {
+ return Junk
+ }
+ }
+ if {0 == [string compare $f [var_value trash-folder]]} {
+ return Trash
+ }
+ }
+
+ return $f
+}
diff --git a/web/cgi/alpine/2.0/compose b/web/cgi/alpine/2.0/compose
new file mode 100755
index 00000000..bf6ce9ec
--- /dev/null
+++ b/web/cgi/alpine/2.0/compose
@@ -0,0 +1,817 @@
+#!./tclsh
+# $Id: compose 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# compose
+#
+# Purpose: CGI script template for Web Alpine 2.0 pages
+#
+# Input: PATH_INFO: [/<col_number>]/<folder_name>[/<uid_of_viewed_msg>
+# along with possible search parameters:
+set compose_args {
+ {pop {} browse/0/INBOX}
+ {repqstr "" "_NONE_SET_"}
+ {contacts "" ""}
+}
+
+# inherit global config
+source ./alpine.tcl
+source ./foldercache.tcl
+source ./common.tcl
+
+set script_base "$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)/"
+
+# TEST
+proc cgi_suffix {args} {
+ return ""
+}
+
+if {[info exists debugging]} {
+ # WHILE TESTING/DEBUGGING
+ set dmsgs ""
+ proc dm {s} {
+ global dmsgs
+
+ lappend dmsgs $s
+ }
+}
+
+# On input failure, redirect to home page "browse"
+proc browse_redirect {} {
+ cgi_http_head {
+ cgi_redirect browse
+ }
+}
+
+proc url {d} {
+ global _wp
+
+ return [file join / $_wp(urlprefix) $_wp(appdir) $_wp(ui2dir) $d]
+}
+
+proc leave_test {d} {
+ return "return cancelComposition('[url $d]');"
+}
+
+proc fieldname {name} {
+ regsub -all -- {-} [string tolower $name] {_} fieldname
+ return $fieldname
+}
+
+proc default_fcc {itemval} {
+ global fccdefault f_name f_colid
+
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ set collections ""
+ }
+
+ # fcc's itemval should be a list of collection-id and folder-name
+ if {[llength $itemval] == 2} {
+ set fcccol [lindex $itemval 0]
+ set fccname [lindex $itemval 1]
+ } elseif {[info exists f_name] && [string length $f_name]} {
+ set fcccol $f_colid
+ set fccname $f_name
+ } elseif {[info exists fccdefault] || [catch {WPCmd PECompose fccdefault} fccdefault] == 0} {
+ set fcccol [lindex $fccdefault 0]
+ set fccname [lindex $fccdefault 1]
+ unset fccdefault
+ } else {
+ set fccname sent-mail
+ if {[llength $collections] > 1} {
+ set fcccol 1
+ } else {
+ set fcccol 0
+ }
+ }
+
+ return [list $fccname $fcccol $collections]
+}
+
+set firstheader 1
+proc rowfield {item itemval} {
+ global _wp addrheaders firstheader compose_mode
+
+ if {0 == [string compare [string tolower $item] attach]} {
+ return
+ }
+
+ set isaddr [lsearch -exact $addrheaders [string tolower $item]]
+
+ cgi_table_row {
+ cgi_table_data class="spc" colspan="3" {}
+ }
+ cgi_table_row {
+ cgi_table_data class="wap lbl" {
+ cgi_anchor_name "to"
+ if {$isaddr >= 0} {
+ cgi_button "${item}..." title="Select email addresses from Contacts or Directory" "onClick=return pickContact('$item','field${item}');"
+ } elseif {0 == [string compare [string tolower $item] fcc]} {
+ cgi_button "Fcc..." title="Carbon Copy to Folder" "onClick=this.blur(); return pickFolder('folderList','Set Fcc','[WPCmd PEFolder defaultcollection]',pickFccDone);"
+ } else {
+ cgi_put "<label for=\"[string tolower $item]\">$item:</label>"
+
+ }
+ }
+ cgi_table_data class="wap mid" {
+ if {$isaddr >= 0} {
+ cgi_textarea [string tolower $item]=$itemval class="mid" id="field$item"
+ cgi_division id="container$item" class="yui-skin-sam" {}
+ } else {
+ switch -- [string tolower $item] {
+ fcc {
+ set deffcc [default_fcc $itemval]
+
+ set fccname [lindex $deffcc 0]
+ set fcccol [lindex $deffcc 1]
+
+ cgi_text "[fieldname $item]=$fccname" id="field$item" class="mid" "onBlur=fccExists(false);"
+ cgi_text "colid=$fcccol" type=hidden "notab" id="fieldFccCollection"
+ }
+ default {
+ cgi_text "[fieldname $item]=$itemval" id="field$item" class="mid"
+ }
+ }
+ }
+ }
+ cgi_table_data class="wap rgt" {
+ if {$firstheader} {
+ set firstheader 0
+ cgi_put "[cgi_span id="moreComposeHeaderText" [cgi_url "More Headers" "#" "onClick=showMoreComposeHeaders(); return false;" title="Show Bcc:, Fcc:, ..."]]"
+ cgi_put "[cgi_span id="lessComposeHeaderText" [cgi_url "Fewer Headers" "#" "onClick=showLessComposeHeaders(); return false;"]]"
+ }
+ if {0 && 0 == [string compare [string tolower $item] fcc]} {
+ cgi_puts [cgi_url "[cgi_nbspace]Select Folder" "#" "onClick=this.blur(); pickFolder('folderList','Set Fcc','[WPCmd PEFolder defaultcollection]',pickFccDone); return false;"]
+ } elseif {0 == [string compare [string tolower $item] subject]} {
+ if {[string compare -nocase rich $compose_mode]} {
+ set flipto Rich
+ } else {
+ set flipto Plain
+ }
+ cgi_put [cgi_url "$flipto Text" "" id=flipRich "onClick=return flipRichText();"]
+ }
+ }
+ }
+}
+
+set c -1
+set f ""
+set u 0
+set p ""
+set body ""
+set defaultheaders {to cc subject}
+set addrheaders {to cc bcc}
+set entryfocus fieldTo
+set title Compose
+
+WPEval $compose_args {
+
+ set compose_mode plain
+
+ # figure out compose mode and collect necessary stuff
+ if {[regexp {/(reply|replyall|forward|resume|mailto)$} $env(SCRIPT_NAME) dummy mode]} {
+ if {0 == [string compare resume $mode]} {
+ if {[info exists env(PATH_INFO)]} {
+ if {[regexp {^/([0-9]+)$} $env(PATH_INFO) dummy u]} {
+ set title "Resume Draft"
+ set c [WPCmd PEFolder defaultcollection]
+ set f Drafts
+ if {[catch {WPCmd PEPostpone extract $u {html}} postponed]} {
+ WPCmd PEInfo statmsg "Cannot get Draft: $postponed"
+ } else {
+ foreach h [lindex $postponed 0] {
+ append hdrvals([fieldname [lindex $h 0]]) [lindex $h 1]
+ }
+
+ # return to message's edit mode
+ set compose_mode plain
+
+ foreach opt [lindex $postponed 3] {
+ switch [lindex $opt 0] {
+ charset {
+ set charset [lindex $opt 1]
+ }
+ subtype {
+ if {0 == [string compare -nocase [lindex $opt 1] html]} {
+ set compose_mode rich
+ }
+ }
+ }
+ }
+
+ set body [join [lindex $postponed 1] "\r\n"]
+ set attachments [lindex $postponed 2]
+
+ unset postponed
+
+ catch {WPCmd set help_context compose}
+ if {[catch {WPCmd set pre_draft_folder} curfold]} {
+ set pop "browse/0/INBOX"
+ } else {
+ set pop "browse/[lindex $curfold 0]/[wpSpecialFolder [lindex $curfold 0] [lindex $curfold 1]]"
+ }
+ }
+ } else {
+ WPCmd PEInfo statmsg "Invalid Draft UID: $env(PATH_INFO)"
+ browse_redirect
+ cgi_exit
+ }
+ } else {
+ WPCmd PEInfo statmsg "Missing Draft UID"
+ browse_redirect
+ cgi_exit
+ }
+ } elseif {0 == [string compare mailto $mode]} {
+ set title "Compose"
+
+ if {[catch {cgi_import to}] == 0} {
+ set hdrvals(to) $to
+ }
+
+ if {[catch {cgi_import cc}] == 0} {
+ set hdrvals(to) $cc
+ }
+
+ if {[catch {cgi_import subject}] == 0} {
+ set hdrvals(subject) $subject
+ }
+
+ catch {cgi_import body}
+ } else {
+ if {!([info exists env(PATH_INFO)] && [regexp {^/([0-9]+)/(.+)/([0-9]+)[/]?([\.0-9]*)*} $env(PATH_INFO) dummy c f u p])} {
+ WPCmd PEInfo statmsg "Invalid Invocation: $env(SCRIPT_NAME) (info = $env(PATH_INFO)"
+ browse_redirect
+ cgi_exit
+ }
+
+ # process action specfied by compose_args
+ switch $mode {
+ reply -
+ replyall {
+ set title "Reply to Message [WPCmd PEMessage $u number]"
+ if {[string length $p]} {
+ append title ", part $p"
+ }
+
+ foreach h [WPCmd PEMessage $u replyheaders $p] {
+ set hdrvals([fieldname [lindex $h 0]]) [lindex $h 1]
+ }
+
+ if {[string compare $mode replyall]} {
+ catch {unset hdrvals(cc)}
+ }
+
+ if {[WPCmd PEInfo feature quell-format-flowed] == 0} {
+ set flowed 1
+ }
+
+ if {0 == [string compare $repqstr "_NONE_SET_"]} {
+ set repqstr [WPCmd PEMessage $u replyquote]
+ }
+
+ set replytext [WPCmd PEMessage $u replytext $repqstr $p]
+
+ if {[string compare $compose_mode plain]} {
+ set replytext [cgi_quote_html $replytext]
+ set body [join [lindex $replytext 0] "<br />"]
+ } else {
+ set body [join [lindex $replytext 0] "\n"]
+ }
+
+ if {[WPCmd PEInfo feature include-attachments-in-reply]} {
+ set attachments [lindex $replytext 1]
+ }
+
+ catch {WPCmd set help_context reply}
+ set cuid $u
+ set entryfocus composeText
+ }
+ forward {
+ set title "Forward [WPCmd PEMessage $u number]"
+ if {[string length $p]} {
+ append title ", part $p"
+ }
+
+ foreach h [WPCmd PEMessage $u forwardheaders $p] {
+ set hdrvals([fieldname [lindex $h 0]]) [lindex $h 1]
+ }
+
+ foreach line [WPCmd PEInfo signature] {
+ append body "$line\r\n"
+ }
+
+ if {[WPCmd PEInfo feature quell-format-flowed] == 0} {
+ set flowed 1
+ }
+
+ set forwardtext [WPCmd PEMessage $u forwardtext $p]
+
+ if {[string compare $compose_mode plain]} {
+ set forwardtext [cgi_quote_html $forwardtext]
+ append body [join [lindex $forwardtext 0] "<br />"]
+ } else {
+ append body [join [lindex $forwardtext 0] "\r\n"]
+ }
+
+ set attachments [lindex $forwardtext 1]
+ catch {WPCmd set help_context forward}
+ set cuid $u
+ }
+ }
+ }
+ } else {
+ foreach line [WPCmd PEInfo signature] {
+ append body "$line\r\n"
+ }
+
+ if {[string length $contacts] && [regexp {^[0-9\.,]+$} $contacts]} {
+ set hdrvals(to) ""
+ foreach c [split $contacts ","] {
+ if {[regexp {^([0-9]+)\.([0-9]+)$} $c dummy abook aindex]} {
+ # compose to address book entry
+ if {0 == [catch {WPCmd PEAddress entry $abook "" $aindex} entryval]} {
+ if {[string length $hdrvals(to)]} {
+ append hdrvals(to) ", "
+ }
+
+ append hdrvals(to) [lindex $entryval 0]
+ set newfcc [lindex $entryval 1]
+ if {[string length $newfcc]} {
+ global fccdefault
+ if {[string compare $newfcc "\"\""] == 0} {
+ set newfcc ""
+ }
+ if {[catch {WPCmd PEFolder collections} collections]} {
+ set collections ""
+ }
+ set fccdefault [list [expr {[llength $collections] > 1 ? 1 : 0}] $newfcc]
+ }
+ }
+ }
+ }
+ }
+
+ WPCmd PECompose noattach
+ }
+
+ if {[catch {WPCmd PECompose userhdrs} headers]} {
+ error [list _action "Header Retrieval Failure" $headers]
+ }
+
+ if {![info exists charset]} {
+ set charset UTF-8
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=\"$charset\""
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_http_equiv Content-Type "text/html; charset=$charset"
+ cgi_title [wpPageTitle "$title"]
+ cgi_base "href=$script_base"
+ # yui css
+ cgi_stylesheet "$_wp(yui)/build/autocomplete/assets/skins/sam/autocomplete.css"
+ cgi_stylesheet "$_wp(yui)/build/tabview/assets/tabview-core.css"
+ cgi_stylesheet "$_wp(yui)/build/button/assets/skins/sam/button.css"
+ cgi_stylesheet "$_wp(yui)/build/container/assets/skins/sam/container.css"
+ cgi_stylesheet "$_wp(yui)/build/editor/assets/skins/sam/simpleeditor.css"
+ # local css
+ cgi_stylesheet css/cbn/screen.css
+ cgi_stylesheet css/menu.css
+ cgi_stylesheet css/cbn/folderdialog.css
+ cgi_stylesheet css/cbn/contactdialog.css
+ cgi_puts "<style type='text/css'>"
+ cgi_puts ".yui-skin-sam .yui-ac-content{ width:70%; }"
+ cgi_puts ".yui-navset .yui-nav li { margin-right:0.16em; padding-top:1px; zoom:1; }"
+ cgi_puts ".yui-navset .yui-nav .selected { margin-bottom:-1px; }"
+ cgi_puts ".yui-navset .yui-nav a { background:#dadbdb url($_wp(yui)/build/assets/skins/sam/sprite.png) repeat-x; border:solid #a3a3a3; border-width:0 1px; color:#000; text-decoration:none; }"
+ cgi_puts ".yui-navset .yui-nav li a em { border-top:solid 1px #a3a3a3; border-bottom:0; cursor:hand; padding:0.2em 0.5em; top:-1px; position:relative; }"
+ cgi_puts ".yui-navset .yui-nav .selected a, .yui-navset .yui-nav a:focus, .yui-navset .yui-nav a:hover { background:#214197 url($_wp(yui)/build/assets/skins/sam/sprite.png) repeat-x left -1400px; color:#fff; }"
+ cgi_puts ".yui-navset .yui-nav .selected a em { padding:0.3em 0.5em; }"
+ cgi_puts ".yui-navset .yui-nav .selected a, .yui-navset .yui-nav a:hover, .yui-navset .yui-nav a:focus { border-color:#243356; }"
+ cgi_puts ".yui-navset .yui-nav a:hover em, .yui-navset .yui-nav a:focus em, .yui-navset .yui-nav .selected a em { border-color:#233356 #406ed9; }"
+ cgi_puts ".yui-navset .yui-nav { border-bottom:1px solid #243356; position:relative; zoom:1; }"
+ cgi_puts ".yui-navset .yui-content { border-top:5px solid #214095; }"
+ cgi_puts "</style>"
+ # Yahoo UI Libraries
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/utilities/utilities.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/container/container-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/datasource/datasource-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/get/get-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/autocomplete/autocomplete-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/button/button-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/tabview/tabview-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/editor/simpleeditor-min.js" {}
+ # local libraries
+ cgi_script language="JavaScript" src="lib/common.js" {}
+ cgi_script language="JavaScript" src="lib/compose.js" {}
+ # page/content specific
+ cgi_javascript {
+ cgi_puts "YAHOO.alpine.cgi_root = '$_wp(serverpath)';"
+ cgi_puts "YAHOO.alpine.cgi_base = '$script_base';"
+ if {0 == [catch {WPCmd PEFolder current} curfold]} {
+ cgi_puts "YAHOO.alpine.current.c = [lindex $curfold 0];"
+ cgi_puts "YAHOO.alpine.current.f = \"[lindex $curfold 1]\";"
+ }
+ cgi_puts "var gRichState = ('$compose_mode' == 'rich');"
+ cgi_puts "var gRichtextEditor, gRichtextRendered = false;"
+ cgi_puts "var gFieldHeight = 0;"
+ cgi_puts "var gDefCol = [WPCmd PEFolder defaultcollection];"
+ cgi_puts "var gDraftFolder = '[var_value postponed-folder]';"
+
+ # set up contacts dialog
+ set markup [cgi_buffer {
+ cgi_division id="contactsDialogFramework" {
+ set dirs [catch {WPCmd PELdap directories} directories]
+ if {0 == $dirs} {
+ set class "class=yui-navset"
+ } else {
+ set class ""
+ }
+
+ cgi_division id="contactDialog" $class {
+ if {0 == $dirs} {
+ cgi_bullet_list class="yui-nav" {
+ cgi_li class="selected" [cgi_url [cgi_emphasis Contacts] "#contactList" "onClick=this.blur();"]
+ cgi_li [cgi_url [cgi_emphasis Directory] "#directoryQuery" "onClick=this.blur();"]
+ }
+ cgi_division class=yui-content {
+ cgi_division id="contactList" class="contactContent" {
+ cgi_put "Loading..."
+ }
+ cgi_division id="directoryQuery" class=contactContent {
+ cgi_division class="clistContext" "style=\"text-align: center;\"" {
+ cgi_form $_wp(appdir)/$_wp(ui2dir)/conduit/query.tcl method=get target=formResponse {
+ if {[llength $directories] > 1} {
+ cgi_select dir class=wap {
+ for {set i 0} {$i < [llength $directories]} {incr i} {
+ set dname [lindex [lindex $directories $i] 0]
+ if {0 == [string length $dname]} {
+ set dname "Directory [expr {$i + 1}]"
+ }
+ cgi_option $dname value=$i
+ }
+ }
+ } else {
+ if {[string length [lindex [lindex $directories 0] 0]]} {
+ cgi_put [cgi_span [lindex [lindex $directories 0] 0]]
+ }
+
+ cgi_text "dir=0" type=hidden "notab"
+ }
+
+ cgi_text "query=" size="20" length="40" id="dirQuery"
+ cgi_submit_button go=Search
+ }
+ }
+ cgi_division id="dirResult" class="clistContacts" {
+ cgi_put [cgi_span "Search results appear here..."]
+ }
+ }
+ }
+ } else {
+ cgi_division id="contactList" class="contactContent" {
+ cgi_put "Loading..."
+ }
+ }
+ }
+ }
+ }]
+
+ regsub -all {'} $markup {\'} markup
+ regsub -all {\n} $markup {} markup
+ cgi_puts "YAHOO.alpine.pickcontact.markup = '$markup';"
+ cgi_puts "function bodyOnLoad() {"
+ cgi_puts " initMenus();"
+ cgi_puts " if(gRichState){ initSimpleEditor([expr {0 == [string compare $entryfocus composeText]}]); if(gRichtextEditor){ gRichtextEditor.render(); gRichtextRendered = true; }}"
+ cgi_puts " autoSizeAddressField('fieldTo');"
+ cgi_puts " autoSizeAddressField('fieldCc');"
+ cgi_puts " autoSizeAddressField('fieldBcc');"
+ cgi_puts " setCheckMailFunction('gCheck', newMailCheck);"
+ cgi_puts " setNewMailCheckInterval([WPCmd PEInfo inputtimeout]);"
+ if {[info exists _wp(autodraft)]} {
+ cgi_puts " setAutoDraftInterval($_wp(autodraft));"
+ }
+ wpStatusAndNewmailJavascript
+ cgi_puts " setCursorPosition('$entryfocus',0);"
+ cgi_puts " fccExists(true);"
+ cgi_puts "}"
+
+ cgi_puts "browserDetect();"
+ }
+ }
+
+ cgi_body class="wap" "onLoad=bodyOnLoad()" {
+ cgi_division id="skip" {
+ cgi_put [cgi_url "Skip to Compose Body" "#to"]
+ cgi_put [cgi_url "Skip to Message List" "browse#messages"]
+ cgi_put [cgi_url "Skip to Folders" "#folders"]
+ }
+
+ cgi_puts {<iframe name="formResponse" id="formResponse" src="img/cbn/spritelib.gif"></iframe>}
+
+ wpCommonPageLayout compose "$c" "$f" "$u" \
+ $title \
+ [list [cgi_cgi "$_wp(appdir)/$_wp(ui2dir)/browse/${c}/${f}"] Composition 0] \
+ leave_test\
+ {
+ cgi_division class=hdrBtns {
+ cgi_javascript {
+ cgi_put "if(window.print) document.write('[cgi_buffer {cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi1" ""][cgi_span "class=hdrBtnText" Print]" "print" "onClick=return printContent()"]}]');"
+ }
+
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi3" ""][cgi_span "class=hdrBtnText" Help]" "javascript:openHelpWindow('compose.html');" class=wap]
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi4" ""][cgi_span "class=hdrBtnText" "Sign out"]" "" "onClick=[leave_test "../../session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=${sessid}"]"]
+ }
+ } {
+ cgi_anchor_name "toolbar"
+ cgi_table class="toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data class="wap" {
+ cgi_put [cgi_url [cgi_span "class=sp spmbi spmb9" "Send"] "post" "onClick=return sendComposition();"]
+ }
+ cgi_table_data class="wap" {
+ cgi_put [cgi_url [cgi_span "class=sp spmbi spmb11" "Attach File"] "" "onClick=this.blur(); return addAttachField();"]
+ }
+ cgi_table_data class="wap" {
+ cgi_put [cgi_url [cgi_span "class=sp spmbi spmb10" "Save Draft"] post/draft "onClick=return saveDraft();"]
+ }
+ cgi_table_data class="wap dv1" {
+ cgi_put [cgi_img "img/cbn/div.gif"]
+ }
+ cgi_table_data class="wap yui-skin-sam yuimenu" id="priorityButtonContainer" {
+ cgi_bullet_list class="wap menu" {
+ cgi_put "<li class=\"menuHdr\">[cgi_url "Priority [cgi_img "img/cbn/menu.gif" class="wap menuDn menuImg"]" "#" "onClick=return false;"]"
+ cgi_division {
+ cgi_bullet_list class=priority {
+ cgi_li [cgi_url "[cgi_span "class=sp spfcl blank" ""]Highest" "" id="pri5" "onClick=return setPriority(this,'highest')"]
+ cgi_li [cgi_url "[cgi_span "class=sp spfcl blank" ""]High" "" id="pri4" "onClick=return setPriority(this,'high')"]
+ cgi_li [cgi_url "[cgi_span "class=sp spfcl blank" ""]Normal" "" id="pri3" "onClick=return setPriority(this,'normal')"]
+ cgi_li [cgi_url "[cgi_span "class=sp spfcl blank" ""]Low" "" id="pri2" "onClick=return setPriority(this,'low')"]
+ cgi_li [cgi_url "[cgi_span "class=sp spfcl blank" ""]Lowest" "" id="pri1" "onClick=return setPriority(this,'lowest')"]
+ cgi_li "<hr />[cgi_url "[cgi_span "class=sp spfcl spfcl3" ""]No[cgi_nbspace]Priority" "" id="pri0" "onClick=return setPriority(this,'')"]"
+ }
+ }
+ cgi_put "</li>"
+ }
+ }
+ cgi_table_data class="wap dv1" {
+ cgi_put [cgi_img "img/cbn/div.gif"]
+ }
+ cgi_table_data class="wap" {
+ cgi_put [cgi_url [cgi_span "class=sp spmbi spmb12" "Cancel"] "$pop" "onClick=return cancelComposition('[url $pop]');" title="Cancel Compose and lose unsaved changes"]
+ }
+ cgi_table_data class="wap" width="100%" {
+ cgi_put [cgi_nbspace]
+ }
+ cgi_table_data class="wap tbPad" align="right" {
+ cgi_put [cgi_nbspace]
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ } {
+ cgi_form $_wp(appdir)/$_wp(ui2dir)/conduit/post.tcl "enctype=multipart/form-data" id=composeForm target=formResponse {
+ cgi_table width="100%" height="100%" cellpadding="0" cellspacing="0" id=compositionBody {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table class="compose" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data class="spc" colspan="3" {
+ # various bits of what we need to pass on
+ cgi_text "cid=[WPCmd PEInfo key]" type=hidden "notab"
+ cgi_text "sessid=$sessid" type=hidden "notab"
+ cgi_text "postpost=$pop" type=hidden "notab"
+ cgi_text "subtype=plain" type=hidden id=contentSubtype notab
+ cgi_text "priority=0" type=hidden id=priority "notab"
+
+ # TEST stuff we have to feed post.tcl to get it working
+ cgi_text "action=OK" type=hidden "notab"
+ cgi_text "send=1" type=hidden "notab"
+ cgi_text "sendop=send" type=hidden id=sendOp notab
+ cgi_text "autodraftuid=0" type=hidden id=autoDraftUid notab
+
+ if {[string length $repqstr]} {
+ cgi_text "repqstr=$repqstr" type=hidden "notab"
+ }
+
+ if {[info exists flowed]} {
+ cgi_text "form_flowed=yes" type=hidden "notab"
+ }
+
+ foreach field [WPCmd PECompose syshdrs] {
+ set hdr [fieldname [lindex $field 0]]
+ if {[info exists hdrvals($hdr)]} {
+ cgi_text "${hdr}=$hdrvals($hdr)" type=hidden "notab"
+ }
+ }
+ }
+ }
+
+ set extrahdrs {}
+
+ foreach field $headers {
+ set item [lindex $field 0]
+
+ if {[string length $item] == 0} {
+ continue
+ }
+
+ set itemvaldef [lindex $field 1]
+ set litem [string tolower $item]
+ set fn [fieldname $item]
+
+ if {[info exists hdrvals($fn)]} {
+ set itemval $hdrvals($fn)
+ } elseif {[info exists $litem] && [string length [subst $$litem]]} {
+ set itemval [subst $$litem]
+ } elseif {[string length $itemvaldef]} {
+ set itemval $itemvaldef
+ } else {
+ set itemval ""
+ }
+
+ if {[catch {WPCmd PECompose composehdrs} h] == 0 && [llength $h] > 0} {
+ set display_headers [string tolower $h]
+ } else {
+ set display_headers $defaultheaders
+ }
+
+ if {![info exists extrahdrs]} {
+ if {[info exists postoption(fcc-set-by-addrbook)]} {
+ if {[lsearch -exact $display_headers fcc] < 0} {
+ lappend display_headers fcc
+ }
+ }
+ }
+
+ if {[lsearch -exact $display_headers [string tolower $item]] >= 0} {
+ rowfield $item $itemval
+ } elseif {[info exists extrahdrs]} {
+ lappend extrahdrs [list $item $itemval]
+ } else {
+ switch -- [string tolower $item] {
+ fcc {
+ set deffcc [default_fcc $itemval]
+
+ set fccname [lindex $deffcc 0]
+ set fcccol [lindex $deffcc 1]
+
+ cgi_text [fieldname $item]=$fccname type=hidden "notab"
+ cgi_text "colid=$fcccol" type=hidden "notab"
+ }
+ default {
+ cgi_text "[fieldname $item]=$itemval" type=hidden "notab"
+ }
+ }
+ }
+ }
+
+ cgi_puts "</tbody>"
+ }
+
+ if {[info exists extrahdrs]} {
+ cgi_division id="moreComposeHeaders" {
+ cgi_table class="wap compose" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+
+ foreach pb $extrahdrs {
+ rowfield [lindex $pb 0] [lindex $pb 1]
+ }
+
+ cgi_puts "</tbody>"
+ }
+ }
+ }
+
+ cgi_division id="composeAttachments" {
+ cgi_table class="wap compose" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data class="wap spc" colspan="2" {}
+ }
+ cgi_table_row {
+ cgi_table_data class="wap lbl" {
+ cgi_puts "<label>Attachments: </label>"
+ }
+ cgi_table_data class="wap attach" {
+ cgi_text "attachments=" type=hidden id=attachments notab
+ cgi_division id=attachList {
+ }
+ cgi_division id=fileUpload {
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="wap spc" colspan="2" {
+
+ if {[info exists postoption(fcc-without-attachments)]} {
+ if {$postoption(fcc-without-attachments)} {
+ set checked ""
+ } else {
+ set checked checked
+ }
+ } elseif {[WPCmd PEInfo feature "fcc-without-attachments"]} {
+ set checked ""
+ } else {
+ set checked checked
+ }
+
+ cgi_checkbox fccattach=1 $checked id="fcc_attachment"
+ cgi_puts "<label for='fcc_attachment'>Include attachments in copy of message saved to Fcc (i.e. sent-mail)</label>"
+ }
+ }
+ }
+ }
+ cgi_javascript {
+ if {[info exists attachments]} {
+ set comma ""
+ cgi_puts "drawAttachmentList({attachments:\["
+ foreach a $attachments {
+ # {4137457288 bunny.gif 2514 Image/GIF}
+ cgi_puts "${comma}{id:'[lindex $a 0]',fn:'[lindex $a 1]',size:'[lindex $a 2]',type:'[lindex $a 3]'}"
+ set comma ","
+ }
+ cgi_puts "\]});"
+ }
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data height="100%" {
+ cgi_table class="composeBody" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data class="yui-skin-sam textBody" {
+ cgi_textarea body=$body id=composeText title="Message Body" rows="25"
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ }
+ } {
+ cgi_table class="wap toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data id=lastAutoDraft class="wap pageText" {
+ }
+ cgi_table_data class=wap width="100%" {
+ cgi_put [cgi_nbspace]
+ }
+ cgi_table_data class="wap tbPad" align="right" {
+ cgi_put [cgi_nbspace]
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ }
+
+ # autosize and autocompletion
+ cgi_javascript {
+ cgi_puts "var gACDataServer = '$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)/conduit/complete.tcl';"
+ cgi_puts {
+ gACDataSource = new YAHOO.widget.DS_XHR(gACDataServer,['Result','Email','Nickname','Fcc']);
+ gACDataSource.responseType = YAHOO.widget.DS_XHR.TYPE_XML;
+ }
+ if {[info exists cuid] || [regexp {view/.*/([0-9]+)$} $pop dummy cuid]} {
+ cgi_puts " gACDataSource.scriptQueryAppend = 'uid=$cuid';"
+ }
+ cgi_puts {
+ var gAutoCompleteTo = new YAHOO.widget.AutoComplete('fieldTo','containerTo',gACDataSource);
+ autoCompleteDefaults(gAutoCompleteTo);
+ var gAutoCompleteCc = new YAHOO.widget.AutoComplete('fieldCc','containerCc',gACDataSource);
+ autoCompleteDefaults(gAutoCompleteCc);
+ var gAutoCompleteBcc = new YAHOO.widget.AutoComplete('fieldBcc','containerBcc',gACDataSource);
+ autoCompleteDefaults(gAutoCompleteBcc);
+ }
+ }
+
+ if {[info exists debugging]} {
+ # any debugging info to insert?
+
+ foreach dmsg $dmsgs {
+ cgi_html_comment "DEBUG: $dmsg"
+ cgi_puts ""
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/2.0/conduit/apply.tcl b/web/cgi/alpine/2.0/conduit/apply.tcl
new file mode 100755
index 00000000..d93ab0d7
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/apply.tcl
@@ -0,0 +1,76 @@
+#!./tclsh
+# $Id: apply.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# apply
+#
+# Purpose: CGI script generating response to xmlHttpRequest
+#
+# Input:
+#
+set apply_args {
+ {f {} ""}
+ {s {} ""}
+}
+
+# inherit global config
+source ../alpine.tcl
+
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid}]} {
+ return
+}
+
+# grok parameters
+foreach item $apply_args {
+ if {[catch {eval WPImport $item} errstr]} {
+ WPInfoPage "Web Alpine Error" [font size=+2 $errstr] "Please close this window."
+ exit
+ }
+}
+
+switch -- $f {
+ {new} -
+ {imp} -
+ {del} {
+ set flag $f
+ }
+ default {
+ }
+}
+
+switch -- $s {
+ ton -
+ not {
+ set state $s
+ }
+ default {
+ }
+}
+
+cgi_puts "Content-type: text/html; charset=\"UTF-8\""
+cgi_puts ""
+if {[catch {
+ if {[info exists flag] && [info exists state]} {
+ if {[catch {WPCmd PEMailbox apply flag $state $flag} result]} {
+ error "Apply $state ${flag}: $result"
+ } else {
+ set response "$result [WPCmd PEMailbox selected] [WPCmd PEMailbox messagecount]"
+ cgi_puts $response
+ }
+ } else {
+ WPCmd PEInfo statmsg "Unknown flag ($f) or state ($s)"
+ }
+} result]} {
+ cgi_puts "failed: $result"
+}
diff --git a/web/cgi/alpine/2.0/conduit/attach.tcl b/web/cgi/alpine/2.0/conduit/attach.tcl
new file mode 100755
index 00000000..924fd148
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/attach.tcl
@@ -0,0 +1,101 @@
+#!./tclsh
+# $Id: attach.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# attach.tcl
+#
+# Purpose: CGI script to handle attaching attachment
+# to composition via queryattach generated form
+#
+# Input:
+set attach_vars {
+ {file "" ""}
+ {description "" ""}
+ {op "" ""}
+ {id "" 0}
+}
+
+# Output:
+
+# inherit global config
+source ../alpine.tcl
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid}]} {
+ return
+}
+
+# grok parameters
+foreach item $attach_vars {
+ if {[catch {eval WPImport $item} errstr]} {
+ lappend errs $errstr
+ }
+}
+
+if {[string length $file] && [string length [lindex $file 1]]} {
+
+ # "file" is a list: local_file remote_file content-type/content-subtype
+ # trim path from file name on remote system
+ # since we can't be certain what the delimiter is,
+ # try the usual suspects
+ set delims [list "\\" "/" ":"]
+ set native [lindex $file 1]
+ if {[string length $native]} {
+ foreach delim $delims {
+ if {[set crop [string last $delim $native]] >= 0} {
+ set native [string range $native [expr {$crop + 1}] [string length $native]]
+ break;
+ }
+ }
+
+ regsub -all "'" $native "\\'" jsnative
+
+ if {0 == [string length [lindex $file 2]]} {
+ set conttype [list text plain]
+ } else {
+ set conttype [split [lindex $file 2] "/"]
+ }
+
+ set id [WPCmd PECompose attach [lindex $file 0] [lindex $conttype 0] [lindex $conttype 1] $native $description]
+ } else {
+ lappend errs "Requested attachment does not exist"
+ }
+} elseif {![string compare delete $op]} {
+ if {[catch {WPCmd PECompose unattach $id} result]} {
+ lappend errs $result
+ }
+}
+
+
+
+# return attachment list
+puts stdout "Content-type: text/html;\n\n<html><head><script>window.parent.drawAttachmentList(\{"
+if {0 == [catch {WPCmd PECompose attachments} attachments]} {
+ puts stdout "attachments:\["
+ set comma ""
+ foreach a $attachments {
+ # {4137457288 bunny.gif 2514 Image/GIF}
+ puts stdout "${comma}\{id:\"[lindex $a 0]\",fn:\"[lindex $a 1]\",size:\"[lindex $a 2]\",type:\"[lindex $a 3]\"\}"
+ set comma ","
+ }
+ puts stdout "\]"
+ set comma ","
+} else {
+ set comma ""
+ lappend errs $attachments
+}
+
+if {[info exists errs]} {
+ puts stdout "${comma}error:\"[join $errs {, }]\""
+}
+
+puts stdout "\});</script></head><body></body></html>"
diff --git a/web/cgi/alpine/2.0/conduit/cert.tcl b/web/cgi/alpine/2.0/conduit/cert.tcl
new file mode 100755
index 00000000..a3a4a28c
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/cert.tcl
@@ -0,0 +1,48 @@
+#!./tclsh
+# $Id: cert.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# cert.tcl
+#
+# Purpose: CGI script generating response to xmlHttpRequest
+#
+# Input:
+#
+set cert_args {
+ {server {} ""}
+ {accept {} "no"}
+}
+
+# inherit global config
+source ../alpine.tcl
+
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid}]} {
+ return
+}
+
+# grok parameters
+foreach item $cert_args {
+ if {[catch {eval WPImport $item} errstr]} {
+ WPInfoPage "Web Alpine Error" [font size=+2 $errstr] "Please close this window."
+ return
+ }
+}
+
+cgi_puts "Content-type: text/html; charset=\"UTF-8\"\n"
+set answer "Server certificate declined"
+if {[string compare $accept yes] || [catch {WPCmd PESession acceptcert $server} answer]} {
+ cgi_puts "PROBLEM: $answer"
+} else {
+ cgi_puts "$answer"
+}
diff --git a/web/cgi/alpine/2.0/conduit/complete.tcl b/web/cgi/alpine/2.0/conduit/complete.tcl
new file mode 100755
index 00000000..1fd009a0
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/complete.tcl
@@ -0,0 +1,54 @@
+#!./tclsh
+# $Id: complete.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# complete
+#
+# Purpose: CGI script to supply data to YUI AutoComplete
+#
+# Input:
+# along with possible search parameters:
+set complete_args {
+ {param {} ""}
+ {query {} ""}
+ {uid {} 0}
+}
+
+# inherit global config
+source ../alpine.tcl
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid}]} {
+ return
+}
+
+# grok parameters
+foreach item $complete_args {
+ if {[catch {eval WPImport $item} errstr]} {
+ error $errstr
+ }
+}
+
+if {[catch {WPCmd PEAddress complete $query $uid} result]} {
+ error "complete: $result"
+}
+
+puts stdout "Content-type: text/xml; charset=\"UTF-8\""
+puts stdout ""
+puts stdout {<?xml version="1.0" encoding="UTF-8"?>}
+puts stdout "<ResultSet totalResultsAvailable=\"[llength $result]\">"
+if {[string length $query]} {
+ foreach abe $result {
+ puts stdout "<Result><Nickname>[cgi_quote_html [lindex $abe 0]]</Nickname><Email>[cgi_quote_html [lindex $abe 1]]</Email><Fcc>[cgi_quote_html [lindex $abe 2]]</Fcc></Result>"
+ }
+}
+puts stdout {</ResultSet>}
diff --git a/web/cgi/alpine/2.0/conduit/contactlist.tcl b/web/cgi/alpine/2.0/conduit/contactlist.tcl
new file mode 100755
index 00000000..efac458b
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/contactlist.tcl
@@ -0,0 +1,306 @@
+#!./tclsh
+# $Id: contactlist.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# contactlist.tcl
+#
+# Purpose: CGI script that generates a page displaying a
+# list of contacts in the requested address book
+#
+# Input: PATH_INFO: /booknumber
+# along with possible search parameters:
+set contactlist_args {
+ {op {} "noop"}
+ {book "" 0}
+ {ai "" -1}
+ {entryList "" ""}
+ {contactNick "" ""}
+ {origNick "" ""}
+ {contactName "" ""}
+ {contactEmail "" ""}
+ {contactFcc "" ""}
+ {contactNotes "" ""}
+ {hdr {} "off"}
+ {sendto {} "off"}
+ {canedit {} "off"}
+}
+
+# inherit global config
+source ../alpine.tcl
+source ../common.tcl
+
+# TEST
+proc cgi_suffix {args} {
+ return ""
+}
+
+proc deleteByBook {_delbooks} {
+ upvar 1 $_delbooks delbooks
+ foreach dbn [array names delbooks] {
+ foreach dbi [lsort -integer -decreasing $delbooks($dbn)] {
+ if {[catch {WPCmd PEAddress delete $dbn "" $dbi} result]} {
+ error "Address Delete Failure: $result"
+ }
+ }
+ }
+}
+
+proc newContactJSObject {} {
+ uplevel 1 {
+ set json {}
+
+ foreach k {hdr sendto canedit} {
+ set v [subst $$k]
+
+ if {[string length $json]} {
+ append json ","
+ }
+
+ if {[string length $v]} {
+ append json "${k}:'${v}'"
+ }
+ }
+
+ return "\{${json}\}"
+ }
+}
+
+if {[info exists env(PATH_INFO)] && [string length $env(PATH_INFO)]} {
+ if {[regexp {^/([0-9]+|-1)$} $env(PATH_INFO) dummy abook]} {
+ # Import data validate it and get session id
+ if {[catch {WPGetInputAndID sessid}]} {
+ set harderr "No Session ID: $sessid"
+ } else {
+ # grok parameters
+ foreach item $contactlist_args {
+ if {[catch {eval WPImport $item} importerr]} {
+ set harderr "Cannot init session: $importerr"
+ break
+ }
+ }
+ }
+ } else {
+ set harderr "Bad Address Book Request: $env(PATH_INFO)"
+ }
+} else {
+ set harderr "No Address Book Specified"
+}
+
+puts stdout "Content-type: text/html; charset=\"UTF-8\"\n"
+
+if {[info exists harderr]} {
+ puts stdout "<b>ERROR: $harderr</b>"
+ exit
+}
+
+switch -- $op {
+ delete {
+ set result ""
+ # grok delete format: \[(book)index\],
+ if {[regexp {^[0-9\.,]+$} $entryList]} {
+ # collect by book
+ set entryList [split $entryList ","]
+ foreach e $entryList {
+ if {[regexp {^([0-9]+)\.([0-9]+)} $e dummy eb ei]} {
+ lappend delbooks($eb) $ei
+ }
+ }
+
+ # delete by book in DECREASING index order
+ if {[catch {deleteByBook delbooks} result] || [string length $result]} {
+ WPCmd PEInfo statmsg "$result"
+ } else {
+ if {[llength $entryList] > 1} {
+ WPCmd PEInfo statmsg "Contacts Deleted"
+ } else {
+ WPCmd PEInfo statmsg "Contact Deleted"
+ }
+ }
+ } else {
+ WPCmd PEInfo statmsg "Invalid entry list format: >>>>$entryList<<<<"
+ }
+ }
+ add {
+ if {[catch {WPCmd PEAddress edit $book $contactNick $ai $contactName $contactEmail $contactFcc $contactNotes 1} result]} {
+ WPCmd PEInfo statmsg "Add failed: $result"
+ }
+ }
+ change {
+ if {[catch {WPCmd PEAddress edit $book $contactNick $ai $contactName $contactEmail $contactFcc $contactNotes 0 $origNick} result]} {
+ WPCmd PEInfo statmsg "Change failed: $result"
+ }
+ }
+ noop {
+ }
+ default {
+ WPCmd PEInfo statmsg "Unrecognized option: $op"
+ }
+}
+
+# remainder is director to list
+if {[catch {WPCmd PEAddress books} booklist]} {
+ WPCmd PEInfo statmsg "Cannot get list of Addressbooks"
+} else {
+ set books [llength $booklist]
+ if {$abook < 0} {
+ cgi_division class="clistContext" {
+ cgi_put "[cgi_span "class=sp spfcl spfcl1" [cgi_span "style=display:none;" "Contacts: "]][cgi_span "Contact Lists"]"
+ }
+ cgi_division class=clistContacts id=clistContacts {
+ cgi_table cellspacing="0" cellpadding="0" class="clt" {
+ for {set i 0} {$i < $books} {incr i} {
+ set thisbook [lindex $booklist $i]
+ cgi_table_row {
+ cgi_table_data class="cli" {
+ cgi_puts [cgi_url [cgi_span "class=sp spfcl spfcl1" "style=border-bottom: 1px solid #003399;" [cgi_span "style=display:none;" [cgi_gt]]] "contacts/${i}/" title="View Contacts in [lindex $thisbook 1]" "onClick=newContactList(YAHOO.alpine.containers.contactlist,null,[lindex $thisbook 0],[newContactJSObject]); return false;"]
+ }
+ cgi_table_data class="cln" {
+ cgi_put [lindex $thisbook 1]
+ }
+ }
+ }
+ }
+ }
+ } else {
+ for {set i 0} {$i < $books} {incr i} {
+ if {$i == $abook} {
+ set thisbook [lindex $booklist $i]
+ if {[catch {WPCmd PEAddress format [lindex $thisbook 0]} format]} {
+ WPCmd PEInfo statmsg "Cannot get Contacts format: $format"
+ }
+
+ if {[catch {WPCmd PEAddress list [lindex $thisbook 0]} clist]} {
+ WPCmd PEInfo statmsg "Cannot get Contacts list: $clist"
+ }
+
+ break
+ }
+ }
+
+ if {[info exists thisbook]} {
+ cgi_division class="clistContext" {
+ if {$books == 1} {
+ cgi_put "[cgi_span "class=sp spfcl spfcl1" [cgi_span "style=display:none;" "Contacts: "]][cgi_span "Contact List"]"
+ } else {
+ cgi_put "[cgi_span "class=sp spfcl spfcl1" "style=border-bottom: 1px solid #003399;" "title=\"Show All Contact Lists\"" "onClick=\"newContactList(YAHOO.alpine.containers.contactlist,null,-1,[newContactJSObject]);\"" [cgi_span "style=display:none;" "Contacts: "]]"
+ cgi_put [cgi_span id=clistName [lindex $thisbook 1]]
+ }
+ }
+
+ cgi_division class=clistContacts id=clistContacts {
+ cgi_table cellspacing="0" cellpadding="0" "class=\"listTbl divider\"" {
+ cgi_puts "<tbody>"
+ if {![string compare $hdr on]} {
+ cgi_table_row "class=\"contactHeader\"" {
+ cgi_table_head "class=\"wap colHdr\"" {}
+ foreach field $format {
+ cgi_table_head "class=\"wap colHdr lt\"" {
+ switch -- [lindex $field 0] {
+ nick {
+ cgi_puts "Nickname"
+ }
+ full {
+ cgi_puts "Display Name"
+ if {0 == [string compare $canedit on]} {
+ cgi_puts " (click to edit)"
+ }
+ }
+ addr {
+ cgi_put "Email"
+ if {0 == [string compare $sendto on]} {
+ cgi_puts " (click email to send)"
+ }
+ }
+ default {
+ cgi_puts [index $field 0]
+ }
+ }
+ }
+ }
+ }
+ }
+
+ set aindex 0
+ foreach contact $clist {
+ cgi_table_row "class=\"clr\"" {
+ set nfields [llength $format]
+
+ cgi_table_data class=wap {
+ set label "ab${abook}.${aindex}"
+ cgi_checkbox "nickList=$abook.$aindex.[lindex [lindex $contact 0] 0]" id=$label "onclick=\"return boxChecked(this);\""
+ }
+
+ for {set i 0} {$i < $nfields} {incr i} {
+ set field [lindex $format $i]
+ set data [lindex $contact [expr $i + 1]]
+
+ cgi_table_data "class=\"wap clcd\"" {
+ switch -- [lindex $field 0] {
+ addr {
+ switch -- [lindex [lindex $contact 0] 1] {
+ single {
+ set addr [cgi_quote_html $data]
+ if {0 == [string compare $sendto on]} {
+ cgi_puts [cgi_url $addr compose?contacts=${abook}.${aindex} class=wap]
+ } else {
+ cgi_puts "<label for=$label>$addr</label>"
+ }
+ }
+ list {
+ foreach addr $data {
+ set addr [cgi_quote_html $addr]
+ if {0 == [string compare $sendto on]} {
+ cgi_puts "[cgi_url $addr compose?contacts=${abook}.${aindex} class=wap][cgi_nl]"
+ }
+ }
+ }
+ default {
+ cgi_puts "Unknown contact type"
+ }
+ }
+ }
+ full {
+ if {[string length $data]} {
+ if {0 == [string compare $canedit on]} {
+ cgi_puts [cgi_url [cgi_quote_html $data] \# "onClick=return editContact({book:${abook},index:${aindex}});" class=wap]
+ } else {
+ cgi_puts "<label for=$label>[cgi_quote_html $data]</label>"
+ }
+ } else {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ default {
+ if {[string length $data]} {
+ cgi_puts "<label for=$label>[cgi_quote_html $data]</label>"
+ } else {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+ }
+ }
+ }
+ incr aindex
+ }
+ cgi_puts "</tbody>"
+ }
+ }
+ } else {
+ WPCmd PEInfo statmsg "Unknown Address Book"
+ }
+ }
+}
+cgi_puts "<script>"
+wpStatusAndNewmailJavascript
+cgi_puts "if(window.updateContactCount) updateContactCount('$books','[llength $clist]');"
+cgi_puts "</script>"
diff --git a/web/cgi/alpine/2.0/conduit/empty.tcl b/web/cgi/alpine/2.0/conduit/empty.tcl
new file mode 100755
index 00000000..f30864fe
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/empty.tcl
@@ -0,0 +1,73 @@
+#!./tclsh
+# $Id: empty.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# empty.tcl
+#
+# Purpose: CGI script generating response to xmlHttpRequest
+#
+# Input:
+#
+set empty_args {
+ {c "Unspecified Collection"}
+ {f "Unspecified Folder"}
+ {u "" 0}
+}
+
+# inherit global config
+source ../alpine.tcl
+source ../common.tcl
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid}]} {
+ return
+}
+
+# grok parameters
+foreach item $empty_args {
+ if {[catch {eval WPImport $item} errstr]} {
+ WPInfoPage "Web Alpine Error" [font size=+2 $errstr] "Please close this window."
+ exit
+ }
+}
+
+
+cgi_puts "Content-type: text/html; charset=\"UTF-8\""
+cgi_puts ""
+
+# ONLY ever empty Junk, Trash or Drafts
+set defc [WPCmd PEFolder defaultcollection]
+
+set tf [lindex [WPCmd PEConfig varget trash-folder] 0]
+set df [lindex [WPCmd PEConfig varget postponed-folder] 0]
+set f [wpLiteralFolder $c $f]
+if {$c == $defc
+ && (([info exists _wp(spamfolder)] && 0 == [string compare $f $_wp(spamfolder)])
+ || ([string length $tf] && 0 == [string compare $f $tf])
+ || ([string length $tf] && 0 == [string compare $f $df]))} {
+ if {[catch {
+ switch -regexp $u {
+ ^([0-9]+)$ -
+ ^selected$ -
+ ^all$ {
+ cgi_puts [WPCmd PEFolder empty $c $f $u]
+ }
+ default {
+ error "Unknown option"
+ }
+ }
+ } result]} {
+ cgi_puts "$result"
+ }
+} else {
+ cgi_puts "Empty $f NOT permitted"
+}
diff --git a/web/cgi/alpine/2.0/conduit/exists.tcl b/web/cgi/alpine/2.0/conduit/exists.tcl
new file mode 100755
index 00000000..9f5c2168
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/exists.tcl
@@ -0,0 +1,65 @@
+#!./tclsh
+# $Id: exists.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# exists
+#
+# Purpose: CGI script generating response to xmlHttpRequest
+#
+# Input:
+#
+set exists_args {
+ {c {} ""}
+ {f {} ""}
+ {create {} "no"}
+}
+
+# inherit global config
+source ../alpine.tcl
+
+puts stdout "Content-type: application/json\n"
+
+if {[catch {WPGetInputAndID sessid}]} {
+ set harderr "No Session ID: $sessid"
+} else {
+ # grok parameters
+ foreach item $exists_args {
+ if {[catch {eval WPImport $item} importerr]} {
+ set harderr "Cannot init session: $importerr"
+ break
+ }
+ }
+}
+
+if {[info exists harderr]} {
+ puts -nonewline stdout "{error: '$harderr'}"
+} elseif {![regexp {^([0-9]+)$} $c]} {
+ puts -nonewline stdout "{error: 'Missing collection ID: $c'}"
+} elseif {[string length $f] <= 0} {
+ puts -nonewline stdout "{error: 'Missing folder name'}"
+} elseif {0 == [catch {WPCmd PEFolder exists $c $f} result]} {
+ if {1 == $result} {
+ puts -nonewline stdout "{exists:1}"
+ } else {
+ if {0 == [string compare $create yes]} {
+ if {0 == [catch {WPCmd PEFolder create $c $f} result]} {
+ puts -nonewline stdout "{exists:1}"
+ } else {
+ puts -nonewline stdout "{error: '$result'}"
+ }
+ } else {
+ puts -nonewline stdout "{exists:0}"
+ }
+ }
+} else {
+ puts -nonewline stdout "{error: '$result'}"
+}
diff --git a/web/cgi/alpine/2.0/conduit/expand.tcl b/web/cgi/alpine/2.0/conduit/expand.tcl
new file mode 100755
index 00000000..4599a984
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/expand.tcl
@@ -0,0 +1,84 @@
+#!./tclsh
+# $Id: expand.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# expand.tcl
+#
+# Purpose: CGI script to supply data to composer
+#
+# Input:
+# along with possible search parameters:
+set expand_args {
+ {book {} -1}
+ {index {} -1}
+ {addrs {} ""}
+}
+
+# inherit global config
+source ../alpine.tcl
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid} result]} {
+ error "expand.tcl: $result"
+}
+
+# grok parameters
+foreach item $expand_args {
+ if {[catch {eval WPImport $item} result]} {
+ error "expand.tcl: $result"
+ }
+}
+
+catch (unset errstr}
+set errlist {}
+set expaddr {}
+
+if {[regexp {^[0-9]*$} $book] && [regexp {^[0-9,]*$} $index]} {
+ foreach i [split $index ","] {
+ if {[catch {WPCmd PEAddress entry $book "" $i} entry]} {
+ lappend errlist $entry
+ } else {
+ regsub -all "'" [lindex $entry 0] "\\'" resaddr
+ lappend expaddr $resaddr
+ set fcc ""
+ }
+ }
+} elseif {[string length $addrs]} {
+ if {[catch {WPCmd PEAddress expand $addrs [lindex [WPCmd PECompose fccdefault] 1]} result]} {
+ set errstr $result
+ } else {
+ set expaddr [list [lindex $result 0]]
+ set fcc [lindex $result 2]
+ }
+} else {
+ set errstr "Unknown expand options"
+}
+
+puts stdout "Content-type: text/xml; charset=\"UTF-8\"\n"
+puts stdout {<?xml version="1.0" encoding="UTF-8"?>}
+
+if {[info exists errstr] && [string length $errstr]} {
+ puts stdout "<ResultSet totalResultsAvailable=\"1\"><Result>"
+ puts stdout "<Error>$errstr</Error>"
+ puts stdout "</Result></ResultSet>"
+} else {
+ puts stdout "<ResultSet totalResultsAvailable=\"[expr {[llength $expaddr] + [llength $errlist]}]\">"
+ foreach e $errlist {
+ puts stdout "<Result><Error>[cgi_quote_html $e]</Error></Result>"
+ }
+
+ foreach a $expaddr {
+ puts stdout "<Result><Address>[cgi_quote_html $a]</Address><Fcc>[cgi_quote_html $fcc]</Fcc></Result>"
+ }
+
+ puts stdout "</ResultSet>"
+}
diff --git a/web/cgi/alpine/2.0/conduit/export b/web/cgi/alpine/2.0/conduit/export
new file mode 100755
index 00000000..42a9f82b
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/export
@@ -0,0 +1,168 @@
+#!./tclsh
+# $Id: export 391 2007-01-25 03:53:59Z mikes@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# export
+#
+# Purpose: CGI script to download exported folder
+#
+# Input:
+set export_vars {
+}
+
+#set export_via_ip_address 1
+#set export_via_local_hostname 1
+
+# inherit global config
+source ../alpine.tcl
+
+set mailextension ".mbx"
+
+proc WPServerIP {} {
+ global _wp
+
+ catch {
+ set ip 127.0.0.1
+ set sid [socket -async [info hostname] [expr {([string length $_wp(serverport)]) ? $_wp(serverport) : 80}]]
+ set ip [lindex [ fconfigure $sid -sockname ] 0]
+ close $sid
+ }
+
+ return $ip
+}
+
+
+WPEval $export_vars {
+ # grok PATH_INFO for collection 'c' and folder 'f' uid 'u' and part 'p'
+ if {!([info exists env(PATH_INFO)] && [string length $env(PATH_INFO)]
+ && [regexp {^/([0-9]+)/(.*)$} $env(PATH_INFO) dummy c f])} {
+ WPCmd PEInfo statmsg "Invalid Detach: $env(SCRIPT_NAME)"
+ cgi_exit
+ }
+
+ # generate filenames to hold exported folder and control file
+ for {set n 0} {1} {incr n} {
+
+ set rhandle [WPCmd PESession random 64]
+ set cfile [file join $_wp(fileroot) $_wp(detachpath) detach.${rhandle}-control]
+ set dfile [file join $_wp(fileroot) $_wp(detachpath) detach.${rhandle}-data]
+
+ if {[file exists $cfile] == 0 && [file exists $dfile] == 0} {
+ if {[catch {open $cfile {RDWR CREAT EXCL} [cgi_tmpfile_permissions]} cfd]
+ || [catch {open $dfile {RDWR CREAT EXCL} [cgi_tmpfile_permissions]} dfd]} {
+ if {[info exists dfd]} {
+ catch {close $cfd}
+ catch {file delete -force $cfile}
+ set errstr $dfd
+ } else {
+ set errstr $cfd
+ }
+
+ error [list _action Export "Cannot create command/control files: [cgi_quote_html $errstr]" "Please close this window"]
+ } else {
+ close $dfd
+ break
+ }
+ } elseif {$n > 4} {
+ error [list _action Export "Command file creation limit" "Please close this window"]
+ }
+ }
+
+ catch {file delete $dfile}
+
+ if {[catch {WPCmd PEFolder export $c $f $dfile} result]} {
+ WPCmd PEInfo statmsg $result
+ } else {
+ if {[set dfilesize [file size $dfile]] > 0
+ && ([info exists _wp(uplim_bytes)] && $_wp(uplim_bytes) > 0)
+ && $dfilesize > $_wp(uplim_bytes)} {
+ if {$_wp(uplim_bytes) > (1000000)} {
+ set dfs [format {%s.%.2s MB} [WPcomma [expr {$dfilesize / 1000000}]] [expr {$dfilesize % 1000000}]]
+ set esl [format {%s.%.2s MB} [WPcomma [expr {$_wp(uplim_bytes) / 1000000}]] [expr {$_wp(uplim_bytes) % 1000000}]]
+ } else {
+ set dfs "[WPcomma $dfs] KB"
+ set esl "[WPcomma $_wp(uplim_bytes)] KB"
+ }
+
+ WPCmd PEInfo statmsg "Exported folder size ($dfs) exceeds the maximum ($esl) size that can be imported.<br>If you wish to import this folder back into Web Alpine at a later time,<br>you should break it up into smaller folders"
+ }
+
+ if {[info exists export_via_ip_address]} {
+ if {[regsub {^(http[s]?://)[A-Za-z0-9\\-\\.]+(.*)$} "[cgi_root]/pub/getach.tcl" "\\1\[[WPServerIP]\]\\2" redirect] != 1} {
+ WPCmd PEInfo statmsg "Cannot determine server address"
+ catch {unset redirect}
+ }
+ } elseif {[info exists export_via_local_hostname]} {
+ if {[regsub {^(http[s]?://)[A-Za-z0-9\\-\\.]+(.*)$} "[cgi_root]/pub/getach.tcl" "\\1\[[info hostname]\]\\2" redirect] != 1} {
+ WPCmd PEInfo statmsg "Cannot determine server address"
+ catch {unset redirect}
+ }
+ } else {
+ set redirect "[cgi_root]/pub/getach.tcl"
+ }
+
+ set givenname "[file tail $f]${mailextension}"
+ set safegivenname $givenname
+ regsub -all {[/]} $safegivenname {-} safegivenname
+ regsub -all {[ ]} $safegivenname {_} safegivenname
+ regsub -all {[\?]} $safegivenname {X} safegivenname
+ regsub -all {[&]} $safegivenname {X} safegivenname
+ regsub -all {[#]} $safegivenname {X} safegivenname
+ regsub -all {[=]} $safegivenname {X} safegivenname
+ set safegivenname "/$safegivenname"
+
+ puts $cfd "Content-type: Application/X-Mail-Folder"
+ puts $cfd "Content-Disposition: attachment; filename=\"$givenname\""
+
+ # side-step the cgi_xxx stuff in this special case because
+ # we don't want to buffer up the downloading attachment...
+
+ puts $cfd "Content-Length: $dfilesize"
+ puts $cfd "Expires: [clock format [expr {[clock seconds] + 3600}] -f {%a, %d %b %Y %H:%M:%S GMT} -gmt true]"
+ puts $cfd "Cache-Control: max-age=3600"
+ puts $cfd ""
+
+ puts $cfd $dfile
+
+ # exec chmod [cgi_tmpfile_permissions] $dfile
+
+ close $cfd
+
+ exec /bin/chmod [cgi_tmpfile_permissions] $cfile
+ exec /bin/chmod [cgi_tmpfile_permissions] $dfile
+ }
+
+ # prepare to clean up if the brower never redirects
+ if {[info exists redirect]} {
+ set redirect "${redirect}${safegivenname}?h=${rhandle}"
+ } else {
+ set redirect "[cgi_root]/$_wp(appdir)/$_wp(ui2dir)/folders/"
+ }
+
+ cgi_http_head {
+ # redirect to the place we stuffed the export info. use the ip address
+ # to foil spilling any session cookies or the like
+
+ if {[info exists env(SERVER_PROTOCOL)] && [regexp {[Hh][Tt][Tt][PP]/([0-9]+)\.([0-9]+)} $env(SERVER_PROTOCOL) m vmaj vmin] && $vmaj >= 1 && $vmin >= 1} {
+ cgi_puts "Status: 303 Temporary Redirect"
+ } else {
+ cgi_puts "Status: 302 Redirected"
+ }
+
+ cgi_puts "URI: $redirect"
+ cgi_puts "Location: $redirect"
+ }
+
+ cgi_body {}
+
+ exec echo $rhandle | [file join $_wp(cgipath) [WPCmd PEInfo set wp_ver_dir] whackatch.tcl] >& /dev/null &
+}
diff --git a/web/cgi/alpine/2.0/conduit/flag.tcl b/web/cgi/alpine/2.0/conduit/flag.tcl
new file mode 100755
index 00000000..63018125
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/flag.tcl
@@ -0,0 +1,77 @@
+#!./tclsh
+# $Id: flag.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# flag
+#
+# Purpose: CGI script generating response to xmlHttpRequest
+#
+# Input:
+#
+set flag_args {
+ {u {} ""}
+ {f {} ""}
+ {s {} ""}
+}
+
+# inherit global config
+source ../alpine.tcl
+
+WPEval $flag_args {
+ cgi_body {
+ switch -- $f {
+ {new} -
+ {imp} {
+ set flag $f
+ }
+ default {
+ }
+ }
+
+ switch -- $s {
+ ton -
+ not {
+ set state $s
+ }
+ default {
+ }
+ }
+
+ if {[info exists flag] && [info exists state]} {
+ regsub -all {,} $u { } u
+ if {[regexp {^[ 0123456789]*$} $u]} {
+ switch $state {
+ ton { set state 1 }
+ not { set state 0 }
+ }
+ switch $flag {
+ imp { set flag important }
+ }
+
+ foreach eu $u {
+ if {[catch {WPCmd PEMessage $eu flag $flag $state} result]} {
+ set result "FALURE: setting $eu to $setting : $result"
+ break
+ }
+ }
+ } elseif {0 == [string compare $u all]} {
+ if {[catch {WPCmd PEMailbox flag $state $flag} result]} {
+ set result "FAILURE: flag $state $flag : $result"
+ }
+ }
+ } else {
+ set result "FAILURE: unkown flag ($f) or state ($s)"
+ }
+
+ cgi_puts $result
+ }
+}
diff --git a/web/cgi/alpine/2.0/conduit/folderlist.tcl b/web/cgi/alpine/2.0/conduit/folderlist.tcl
new file mode 100755
index 00000000..c8e73d2d
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/folderlist.tcl
@@ -0,0 +1,255 @@
+#!./tclsh
+# $Id: folderlist.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# folderlist.tcl
+#
+# Purpose: CGI script that generates a page snippet that displays
+# the XHR requested folder list
+#
+# Input: PATH_INFO: [/<col_number>]/<directory_path>
+# along with possible search parameters:
+set folderlist_args {
+ {op {} "noop"}
+}
+
+# inherit global config
+source ../alpine.tcl
+source ../foldercache.tcl
+source ../common.tcl
+
+
+# default folderlist.tcl state
+set c 0
+
+# TEST
+proc cgi_suffix {args} {
+ return ""
+}
+
+if {[info exists env(PATH_INFO)] && [string length $env(PATH_INFO)]} {
+ if {0 == [string compare $env(PATH_INFO) "/"] || 0 == [string compare $env(PATH_INFO) "//"]} {
+ set c -1
+ set dir ""
+ }
+
+ if {$c < 0 || [regexp {^/([0-9]+)/(([^/]*/)*)$} $env(PATH_INFO) dummy c dir]} {
+ # Import data validate it and get session id
+ if {[catch {WPGetInputAndID sessid} result]} {
+ set harderr "Cannot init session: $result"
+ } else {
+ # grok parameters
+ foreach item $folderlist_args {
+ if {[catch {eval WPImport $item} result]} {
+ set harderr "Cannot read input: $result"
+ break
+ }
+ }
+ }
+ } else {
+ set harderr "BOTCH: Invalid Request: $env(PATH_INFO)"
+ }
+} else {
+ set harderr "BOTCH: No Folder Specified"
+}
+cgi_puts "Content-type: text/html; charset=\"UTF-8\"\n"
+
+if {[info exists harderr]} {
+ cgi_puts "<b>ERROR: $harderr</b>"
+ exit
+}
+
+set cs [WPCmd PEFolder collections]
+
+if {$c < 0} {
+ cgi_division class="flistContext" {
+ cgi_put "[cgi_span "class=sp spfcl spfcl2" [cgi_span "style=display:none;" "Folders: "]][cgi_span "Folder Collections"]"
+ set folderpath ""
+ }
+
+ cgi_division class=flistFolders {
+ cgi_table cellspacing="0" cellpadding="0" class="flt" {
+ foreach col $cs {
+ set ci [lindex $col 0]
+ set onclick "onClick=return newFolderList(this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode,null,$ci);"
+ cgi_table_row {
+ cgi_table_data class="fli" {
+ cgi_puts [cgi_url [cgi_span "class=sp spfl spfl1" [cgi_span "style=display:none;" [cgi_gt]]] "list/${ci}/" title="View folders in collection." $onclick]
+ }
+ cgi_table_data class="fln" {
+ cgi_puts "[lindex $col 1]"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data colspan=2 class="flcd" {
+ cgi_puts "[cgi_span class=flcd [lindex $col 2]]"
+ }
+ }
+ }
+ }
+ }
+ cgi_puts "<script>"
+ cgi_puts "updateElementValue('pickFolderCollection', '-1');"
+ cgi_puts "updateElementValue('pickFolderPath', '/');"
+ wpStatusAndNewmailJavascript
+ cgi_puts "setPanelBodyWidth('flistFolders');"
+ cgi_puts "</script>"
+} else {
+ set delim [WPCmd PEFolder delimiter $c]
+
+ switch -- $op {
+ delete {
+ if {0 == [catch {cgi_import_as f delf}]} {
+ if {0 == [string length $dir] && 0 == [string compare -nocase inbox $delf]} {
+ WPCmd PEInfo statmsg "Cannot delete INBOX"
+ } else {
+ regsub -all "${delim}" $dir { } deld
+ if {[catch [concat WPCmd PEFolder delete $c $deld \"$delf\"] result]} {
+ WPCmd PEInfo statmsg "Cannot delete $result"
+ } else {
+ WPCmd PEInfo statmsg "Folder \"$delf\" permanently deleted"
+ removeFolderCache $c [join [list $dir $delf] $delim]
+ }
+ }
+ } else {
+ WPCmd PEInfo statmsg "Delete which folder???"
+ }
+ }
+ add {
+ if {0 == [catch {cgi_import_as f addf}]} {
+ if {0 == [string length $dir] && 0 == [string compare -nocase inbox $delf]} {
+ WPCmd PEInfo statmsg "Cannot add INBOX"
+ } else {
+ regsub -all "${delim}" $dir { } addd
+ if {[catch [concat WPCmd PEFolder create $c $addd \"$addf\"] result]} {
+ WPCmd PEInfo statmsg "Folder Cannot add: $result"
+ } else {
+ WPCmd PEInfo statmsg "Folder \"$addf\" added"
+ }
+ }
+ } else {
+ WPCmd PEInfo statmsg "No foldername provided"
+ }
+ }
+ rename {
+ if {0 == [catch {cgi_import sf}] && 0 == [catch {cgi_import df}]} {
+ if {[string compare -nocase inbox $sf] && [string compare -nocase inbox $df]} {
+ if {[catch {WPCmd PEFolder rename $c [join [list $dir $sf] $delim] [join [list $dir $df] $delim]} result]} {
+ WPCmd PEInfo statmsg "Cannot rename: $result"
+ } else {
+ WPCmd PEInfo statmsg "Renamed \"$sf\" to \"$df\""
+ }
+ } else {
+ WPCmd PEInfo statmsg "Cannot rename INBOX"
+ }
+ } else {
+ WPCmd PEInfo statmsg "Foldernames not provided"
+ }
+ }
+ noop {
+ }
+ default {
+ WPCmd PEInfo statmsg "Unrecognized option: $op"
+ }
+ }
+
+ if {0 == [string length $dir] || 0 == [string compare $dir {/}]} {
+ if {[catch {WPCmd PEFolder list $c} flist]} {
+ set authlist [wpHandleAuthException $flist [list [lindex [lindex $cs $c] 0] "list folders in collection [lindex [lindex $cs $c] 1]"] INBOX]
+ if {0 == [llength $authlist]} {
+ WPCmd PEInfo statmsg $flist
+ }
+ }
+ } else {
+ if {[catch {WPCmd PEFolder list $c $dir} flist]} {
+ set col [lindex [lindex $cs $c] 1]
+
+ set authlist [wpHandleAuthException $flist [list [lindex [lindex $cs $c] 0] "list folders in collection [lindex [lindex $cs $c] 1]"] INBOX]
+ if {0 == [llength $authlist]} {
+ WPCmd PEInfo statmsg $flist
+ }
+ }
+ }
+
+ cgi_division class="flistContext" {
+
+ if {[llength $cs] > 1} {
+ cgi_put "[cgi_span "class=sp spfcl spfcl2" "style=border-bottom: 1px solid #003399;" "title=\"Show Folder Collections\"" "onClick=\"newFolderList(this.parentNode.parentNode,null,'');\"" [cgi_span "style=display:none;" "Folders: "]]"
+ } else {
+ cgi_put [cgi_span "class=sp spfcl spfcl2" [cgi_span "style=display:none;" "Folders: "]]
+ }
+
+ set dp ""
+ set col [lindex [lindex $cs $c] 1]
+
+ if {[regexp {^(.*)/$} $dir dummy folderpath]} {
+ cgi_puts [cgi_url $col "list/$c/" title="List folders in this directory" "onClick=return newFolderList(this.parentNode.parentNode,null,$c);"]
+ set ds [split $folderpath {/}]
+ for {set i 0} {$i < [llength $ds]} {incr i} {
+ set d [lindex $ds $i]
+ if {[string length $d]} {
+ lappend dp $d
+ set path [join $dp {/}]
+ if {$i < ([llength $ds] - 1)} {
+ set d [cgi_url "${d}" "list/$c/$path/" title="List subfolders" "onClick=return newFolderList(this.parentNode.parentNode,null,$c,'$path');"]
+ } else {
+ set d [span class=flistFolder $d]
+ }
+
+ cgi_puts "[cgi_span "&raquo;"]$d"
+ }
+ }
+ } else {
+ set folderpath ""
+ cgi_puts [cgi_span $col]
+ }
+ }
+
+ cgi_division class=flistFolders id=flistFolders {
+ cgi_table cellspacing="0" cellpadding="0" class="flt" {
+ foreach f $flist {
+ set t [lindex $f 0]
+ set fn [lindex $f 1]
+ set onclick "onClick=return newFolderList(this.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode,null,${c},'[file join ${folderpath} ${fn}]');"
+ cgi_table_row class="flr" {
+ cgi_table_data class="fli" {
+ if {[string first D $t] >= 0} {
+ cgi_puts [cgi_url [cgi_span "class=sp spfl spfl1" [cgi_span "style=display:none;" [cgi_gt]]] "folders/${c}/[WPPercentQuote "${dir}${fn}" {/}]/" title="List subfolders" $onclick]
+ } else {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ cgi_table_data class="fln" {
+ set hfn [cgi_quote_html $fn]
+ if {[string first F $t] >= 0} {
+ cgi_puts [cgi_url "$hfn" "browse/${c}/[WPPercentQuote "${dir}${fn}" {/}]" class="fln" title="Click to select. Double-click to view messages." "onClick=return flistPick(this,'[WPPercentQuote $fn]');" "onDblClick=return flistPickPick(this);"]
+ } else {
+ cgi_puts "$hfn"
+ }
+ }
+ }
+ }
+ }
+ }
+ cgi_puts "<script>"
+ if {$c >= 0} {
+ cgi_puts "YAHOO.alpine.current.incoming = [WPCmd PEFolder isincoming $c];"
+ }
+ cgi_puts "updateElementValue('pickFolderCollection', '$c');"
+ cgi_puts "updateElementValue('pickFolderPath', '$folderpath');"
+ wpStatusAndNewmailJavascript
+ cgi_puts "setPanelBodyWidth('flistFolders');"
+ if {[info exists authlist]} {
+ reportAuthException $authlist
+ }
+ cgi_puts "</script>"
+}
diff --git a/web/cgi/alpine/2.0/conduit/getcontact.tcl b/web/cgi/alpine/2.0/conduit/getcontact.tcl
new file mode 100755
index 00000000..f859a21d
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/getcontact.tcl
@@ -0,0 +1,53 @@
+#!./tclsh
+# $Id: getcontact.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# getcontact.tcl
+#
+# Purpose: CGI script to handle saving new/edited contacts
+#
+# Input:
+set contact_vars {
+ {book "" 0}
+ {index "" -1}
+}
+
+# Output:
+
+# inherit global config
+source ../alpine.tcl
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid} result]} {
+ error "getcontact.tcl $result"
+}
+
+# grok parameters
+foreach item $contact_vars {
+ if {[catch {eval WPImport $item} result]} {
+ error "getcontact.tcl $result"
+ }
+}
+
+if {[catch {WPCmd PEAddress fullentry $book "" $index} addrinfo]} {
+ error "getcontact.tcl $addrinfo"
+}
+
+puts stdout "Content-type: text/xml; charset=\"UTF-8\"\n"
+puts stdout {<?xml version="1.0" encoding="UTF-8"?>}
+puts stdout "<ResultSet totalResultsAvailable=\"1\"><Result>"
+puts stdout "<Nickname>[cgi_quote_html [lindex $addrinfo 0]]</Nickname>"
+puts stdout "<Personal>[cgi_quote_html [lindex $addrinfo 1]]</Personal>"
+puts stdout "<Mailbox>[cgi_quote_html [join [lindex $addrinfo 2] ", "]]</Mailbox>"
+puts stdout "<Fcc>[cgi_quote_html [lindex $addrinfo 3]]</Fcc>"
+puts stdout "<Note>[cgi_quote_html [lindex $addrinfo 4]]</Note>"
+puts stdout "</Result></ResultSet>"
diff --git a/web/cgi/alpine/2.0/conduit/import b/web/cgi/alpine/2.0/conduit/import
new file mode 100755
index 00000000..04326b14
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/import
@@ -0,0 +1,73 @@
+#!./tclsh
+# $Id: import 391 2007-01-25 03:53:59Z mikes@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# import
+#
+# Purpose: CGI script that generates a page displaying a message
+# list of the indicated folder.
+#
+# Input: PATH_INFO: [/<col_number>]/<directory_path>
+# along with possible search parameters:
+set import_args {
+}
+
+# inherit global config
+source ../alpine.tcl
+
+# TEST
+proc cgi_suffix {args} {
+ return ""
+}
+
+WPEval $import_args {
+
+ # grok PATH_INFO for collection 'c' and folder path 'p'
+ if {!([info exists env(PATH_INFO)] && [string length $env(PATH_INFO)]
+ && [regexp {^/([0-9]+)/(.*)$} $env(PATH_INFO) dummy c p])} {
+ WPCmd PEInfo statmsg "Invalid Detach: $env(SCRIPT_NAME)"
+ cgi_exit
+ }
+
+ if {[catch {WPImport file "Missing File Upload"} result] == 0} {
+ set local_file [lindex $file 0]
+ if {[catch {WPImport newFolder "import name"} result] == 0} {
+ set iname [string trim $newFolder]
+ if {[string length $iname]} {
+ set fldr [eval "file join $p $iname"]
+ if {[catch {WPCmd PEFolder import $local_file $c $fldr} result] == 0} {
+ WPCmd PEInfo statmsg "Imported folder $iname"
+ } else {
+ WPCmd PEInfo statmsg "Can't Import File: $result"
+ }
+ } else {
+ WPCmd PEInfo statmsg "Must provide uploaded folder name"
+ }
+ } else {
+ WPCmd PEInfo statmsg "No Import Folder Name: $result"
+ }
+
+ catch {file delete -force $local_file}
+ } else {
+ WPCmd PEInfo statmsg "Cannot Import: $result"
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_javascript {
+ cgi_puts "window.parent.hideLoading();"
+ cgi_puts "window.parent.redrawFolderList();"
+ }
+ }
+ cgi_body {}
+ }
+}
diff --git a/web/cgi/alpine/2.0/conduit/mark.tcl b/web/cgi/alpine/2.0/conduit/mark.tcl
new file mode 100755
index 00000000..2ac5a2d7
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/mark.tcl
@@ -0,0 +1,77 @@
+#!./tclsh
+# $Id: mark.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# mark.tcl
+#
+# Purpose: CGI script generating response to xmlHttpRequest
+#
+# Input:
+#
+set mark_args {
+ {u {} ""}
+ {mark {} ""}
+}
+
+# inherit global config
+source ../alpine.tcl
+
+WPEval $mark_args {
+ cgi_body {
+ switch -- $mark {
+ false {
+ set setting 0
+ }
+ true {
+ set setting 1
+ }
+ default {
+ }
+ }
+
+ if {[info exists setting]} {
+ regsub -all {,} $u { } u
+ if {[regexp {^[ 0123456789]*$} $u]} {
+ foreach eu $u {
+ if {[catch {WPCmd PEMessage $eu select $setting} result]} {
+ set result "FAILURE: setting $eu to $setting : $result"
+ break
+ }
+ }
+ } elseif {0 == [string compare $u all]} {
+ if {$setting} {
+ set setting all
+ } else {
+ set setting none
+ }
+
+ if {[catch {WPCmd PEMailbox select $setting} result]} {
+ set result "FAILURE: $result"
+ }
+ } elseif {0 == [string compare $u searched]} {
+ if {$setting} {
+ set setting searched
+ } else {
+ set setting unsearched
+ }
+
+ if {[catch {WPCmd PEMailbox select $setting} result]} {
+ set result "FAILURE: $result"
+ }
+ }
+ } else {
+ set reult "FAILURE: Unknown mark value: $mark"
+ }
+
+ cgi_puts $result
+ }
+}
diff --git a/web/cgi/alpine/2.0/conduit/newmail.tcl b/web/cgi/alpine/2.0/conduit/newmail.tcl
new file mode 100755
index 00000000..cecd3466
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/newmail.tcl
@@ -0,0 +1,56 @@
+#!./tclsh
+# $Id: newmail.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# newmail.tcl
+#
+# Purpose: CGI script generating response to xmlHttpRequest
+#
+# Input:
+#
+set newmail_args {
+ {reload {} 0}
+}
+
+# inherit global config
+source ../alpine.tcl
+
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid}]} {
+ return
+}
+
+# grok parameters
+foreach item $newmail_args {
+ if {[catch {eval WPImport $item} errstr]} {
+ WPInfoPage "Web Alpine Error" [font size=+2 $errstr] "Please close this window."
+ return
+ }
+}
+
+puts stdout "Content-type: application/json\n"
+
+if {[catch {WPCmd PESession mailcheck $reload} newmail]} {
+ puts -nonewline stdout "{error: '$newmail'}"
+} else {
+ puts -nonewline "\["
+ set comma ""
+ foreach nm $newmail {
+ set text [lindex $nm 2]
+ regsub -all {'} $text {\'} text
+ puts -nonewline "${comma}\{newcount:[lindex $nm 0],uid:[lindex $nm 1],verbiage:'${text}'\}"
+ set comma ","
+ }
+
+ puts -nonewline "\]"
+}
diff --git a/web/cgi/alpine/2.0/conduit/post.tcl b/web/cgi/alpine/2.0/conduit/post.tcl
new file mode 100755
index 00000000..9757baca
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/post.tcl
@@ -0,0 +1,333 @@
+#!./tclsh
+# $Id: post.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# post.tcl
+#
+# Purpose: CGI script to do the job of posting message supplied by compose form
+#
+
+# Input:
+set post_vars {
+ {cid "Missing Command ID"}
+ {check {} 0}
+ {sendop {} ""}
+ {extrahdrs {} ""}
+ {fccattach {} 0}
+ {form_flowed {} ""}
+ {subtype {} "plain"}
+ {priority {} ""}
+ {autodraftuid {} 0}
+}
+
+# inherit global config
+source ../alpine.tcl
+source ../common.tcl
+
+# Output: HTML containing javascript calls to functions of parent window
+#
+
+
+proc fieldname {name} {
+ regsub -all -- {-} [string tolower $name] {_} fieldname
+ return $fieldname
+}
+
+proc removeAutoDraftMsg {uid} {
+ if {$uid != 0} {
+ if {[regexp {^[0-9]+$} $uid]} {
+ if {[catch {WPCmd PEPostpone delete $uid} result]} {
+ catch {WPCmd PEInfo statmsg "Stale autodraft UID: $result"}
+ }
+ } else {
+ catch {WPCmd PEInfo statmsg "Invalid autodraft uid: $uid"}
+ }
+ }
+}
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid}]} {
+ return
+}
+
+# grok parameters
+foreach item $post_vars {
+ if {[catch {eval WPImport $item} errstr]} {
+ lappend errs $errstr
+ }
+}
+
+
+# collect message data
+
+# For now the input headers have to match the postheaders
+# list. Any outside the list are ignored (and probably should
+# be to avoid hostile input). Note, postheaders is a
+# super-set of composeheaders as not all headers are meant
+# to be shown the user for composition
+if {[catch {WPCmd PECompose userhdrs} headers]} {
+ error [list _action "User Headers" $headers "Click browser's Back button to try again."]
+}
+
+if {[catch {WPCmd PECompose syshdrs} otherhdrs]} {
+ error [list _action "System Headers" $otherhdrs "Click browser's Back button to try again."]
+} else {
+ eval "lappend headers $otherhdrs"
+}
+
+foreach field $headers {
+ set hdr [string tolower [lindex $field 0]]
+ regsub -all -- {-} $hdr {_} hdr
+ WPLoadCGIVarAs $hdr val
+ switch -- $hdr {
+ attach {
+ # disregard: u/i convenience (attachments marshalled below)
+ }
+ fcc {
+ if {[string length $val]} {
+ WPLoadCGIVar colid
+ set has_fcc [list $colid $val]
+ lappend msgdata [list Fcc $has_fcc]
+ }
+ }
+ default {
+ if {[string length $val] || [lsearch -exact {subject} $hdr] >= 0} {
+ # join lines
+ regsub -all {\n} $val { } val
+ if {[lsearch -exact {to cc bcc} $hdr] >= 0} {
+ # strip trailing whitespace and commas
+ regsub {[ ,]*$} $val {} val
+ set has_$hdr 1
+ }
+ lappend msgdata [list [lindex $field 0] $val]
+ }
+ }
+ }
+}
+
+if {[info exists env(REMOTE_ADDR)]} {
+ lappend msgdata [list x-auth-received "from \[$env(REMOTE_ADDR)\] by [info hostname] via HTTP; [clock format [clock seconds] -format "%a, %d %b %Y %H:%M:%S %Z"]"]
+}
+
+if {[catch {cgi_import attachments}] == 0} {
+ foreach id [split $attachments ","] {
+ lappend msgdata [list attach $id]
+ }
+}
+
+cgi_import body
+
+# pass body text options, dress as necessary
+if {0 == [string compare -nocase $subtype html]} {
+ lappend msgdata [list postoption [list subtype html]]
+ set body "<html><head><title></title></head>\n<body>\n${body}\n</body></html>"
+ set compose_mode rich
+} else {
+ set compose_mode plain
+ if {[string length $form_flowed]} {
+ lappend msgdata [list postoption [list flowed yes]]
+ }
+}
+
+if {[regexp {^(lowest|low|normal|high|highest)$} $priority]} {
+ lappend msgdata [list postoption [list priority $priority]]
+}
+
+lappend msgdata [list body [split $body "\n"]]
+
+switch -exact -- $fccattach {
+ 0 -
+ 1 {
+ lappend msgdata [list postoption [list fcc-without-attachments [expr {!$fccattach}]]]
+ }
+}
+
+lappend msgdata [list postoption [list charset "utf-8"]]
+
+# figure out what to do with data
+if {[string compare $sendop send] == 0} {
+ if {[info exists has_to] || [info exists has_cc] || [info exists has_bcc] || [info exists has_fcc]} {
+ # expand any nicknames
+ if {[catch {
+ set fccdef [WPCmd PECompose fccdefault]
+ for {set i 0} {$i < [llength $msgdata]} {incr i} {
+ if {[string length [lindex [lindex $msgdata $i] 1]]} {
+ set fld [lindex $msgdata $i]
+ set fn [string tolower [lindex $fld 0]]
+ switch -- $fn {
+ [Ff]cc {
+ if {[string length [lindex [lindex $fld 1] 1]]} {
+ # setup for send confirmation
+ set colidval [lindex [lindex $fld 1] 0]
+ set fccval [lindex [lindex $fld 1] 1]
+ }
+ }
+ to -
+ cc -
+ bcc -
+ reply-to {
+ set expaddr [WPCmd PEAddress expand [lindex $fld 1] {}]
+ if {[string compare [lindex $expaddr 0] [lindex $fld 1]]} {
+ set msgdata [lreplace $msgdata $i $i [list [lindex $fld 0] [lindex $expaddr 0]]]
+
+ # if expanded, update fcc?
+ if {[string compare to $fn] == 0 && [string length $fn]} {
+ set expanded_fcc [lindex $expaddr 2]
+ }
+ }
+ }
+ body {
+ if {[string length $form_flowed]} {
+ set ws "\[ \t]"
+ set nws "\[^ \t]"
+
+ set nextline [lindex [lindex $fld 1] 0]
+ for {set j 1} {$j <= [llength [lindex $fld 1]]} {incr j} {
+ set line $nextline
+ # space stuff?
+ if {[regexp "^${ws}+" $line]} {
+ set line " $line"
+ }
+
+ set nextline [lindex [lindex $fld 1] $j]
+ if {[regexp {^-- $} $line] == 0} {
+ catch {unset linetext}
+ # trim trailing WS from lines preceding those with LWS (space-stuff as needed)
+ if {[string length $nextline] == 0 || [regexp "^${ws}+(${nws}?.*)\$" $nextline dummy linetext]} {
+ set line [string trimright $line]
+ if {[info exists linetext] == 0 || [string length $linetext] == 0} {
+ set nextline ""
+ }
+ }
+
+ # break overly long lines in a flowed way
+ if {[regexp {^[^>]} $line] && [string length $line] > 1000} {
+ while {[regexp "^(${ws}*${nws}+${ws}+)$nws" [string range $line 900 end] dummy linex]} {
+ set cliplen [expr {900 + [string length $linex]}]
+ lappend newbody [string range $line 0 [expr {$cliplen - 1}]]
+ set line [string range $line $cliplen end]
+ }
+ }
+ }
+
+ lappend newbody $line
+ }
+
+ set msgdata [lreplace $msgdata $i $i [list body $newbody]]
+ }
+ }
+ default {
+ }
+ }
+ }
+ }
+ } result]} {
+ set reportfunc sendFailure
+ set postresult "Address problem: $result"
+ } else {
+ # update fcc?
+ if {[info exists expanded_fcc]
+ && (![info exists has_fcc] || 0 == [string compare [lindex $fccdef 1] [lindex $has_fcc 1]])} {
+ for {set j 0} {$j < [llength $msgdata]} {incr j} {
+ if {[string compare fcc [fieldname [lindex [lindex $msgdata $j] 0]]] == 0} {
+ set fcc_index $j
+ break
+ }
+ }
+
+ set colid [lindex $fccdef 0]
+ if {[info exists fcc_index]} {
+ set msgdata [lreplace $msgdata $fcc_index $fcc_index [list Fcc [list $colid $expanded_fcc]]]
+ } else {
+ lappend msgdata [list Fcc [list $colid $expanded_fcc]]
+ }
+ }
+
+ removeAutoDraftMsg $autodraftuid
+
+ # do the sending...
+ set verb Send
+ set verbpast Sent
+ set postcmd PECompose
+ set postcmdopt post
+ if {[info exists compose_mode]} {
+ catch {WPSessionState compose_mode $compose_mode}
+ }
+ }
+ } else {
+ set reportfunc sendFailure
+ set postresult "Send MUST include Recipients (To, Cc, Bcc, or Fcc)"
+ }
+} elseif {[string compare $sendop postpone] == 0} {
+ removeAutoDraftMsg $autodraftuid
+ set verb "Save to Drafts"
+ set verbpast "Saved to Drafts"
+ set postcmd PEPostpone
+ set postcmdopt append
+} elseif {[string compare $sendop autodraft] == 0} {
+ removeAutoDraftMsg $autodraftuid
+
+ set verb "Save to Drafts"
+ set verbpast "Saved to Drafts"
+ set postcmd PEPostpone
+ set postcmdopt draft
+ set reportfunc reportAutoDraft
+} else {
+ set reportfunc sendFailure
+ set postresult "Unrecognized Action"
+}
+
+#do what was asked
+if {[info exists postcmd]} {
+ if {[info exists msgdata]} {
+ if {[catch {WPCmd $postcmd $postcmdopt $msgdata} postresult]} {
+ set auth [wpHandleAuthException $postresult [list 0 "send"]]
+ if {[string length $auth]} {
+ set reportcall "processPostAuthException(\{${auth}\});"
+ } else {
+ set reportfunc sendFailure
+ }
+ } elseif {0 == [string compare $postcmd PECompose]} {
+ WPCmd PEInfo statmsg "Message $verbpast"
+ }
+ } else {
+ WPCmd PEInfo statmsg "No Message $verbpast!"
+ }
+
+ if {[info exists delete_me]} {
+ foreach i $delete_me {
+ catch {file delete $i}
+ }
+ }
+}
+
+puts stdout "Content-type: text/html;\n\n<html><head><script>"
+
+if {[info exists reportfunc]} {
+ puts stdout "window.parent.${reportfunc}(\"${postresult}\");"
+ foreach sm [WPCmd PEInfo statmsgs] {
+ regsub -all {'} $sm {\'} sm
+ puts stdout "window.parent.sendFailure(\"${sm}\");"
+ }
+} elseif {[info exists reportcall]} {
+ puts stdout "window.parent.${reportcall};"
+ foreach sm [WPCmd PEInfo statmsgs] {
+ regsub -all {'} $sm {\'} sm
+ if {0 == [regexp {Authentication cancelled} $sm]} {
+ puts stdout "window.parent.sendFailure(\"${sm}\");"
+ }
+ }
+} else {
+ puts stdout "window.parent.sendSuccess(\"${postresult}\");"
+}
+
+puts stdout "</script></head><body></body></html>"
diff --git a/web/cgi/alpine/2.0/conduit/query.tcl b/web/cgi/alpine/2.0/conduit/query.tcl
new file mode 100755
index 00000000..eba4ee77
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/query.tcl
@@ -0,0 +1,83 @@
+#!./tclsh
+# $Id: query.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# query.tcl
+#
+# Purpose: CGI script to handle querying LDAP directory
+#
+# Input:
+set query_vars {
+ {dir "" "0"}
+ {query "" ""}
+}
+
+# Output:
+
+# inherit global config
+source ../alpine.tcl
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid}]} {
+ return
+}
+
+# grok parameters
+foreach item $query_vars {
+ if {[catch {eval WPImport $item} errstr]} {
+ lappend errs $errstr
+ }
+}
+
+set qresult ""
+
+# return attachment list
+puts stdout "Content-type: text/html;\n\n<html><head><script>window.parent.drawLDAPResult({"
+if {[string length $query]} {
+ if {[catch {WPCmd PELdap query $dir $query ""} qn]} {
+ regsub -all {'} $qn {\'} qn
+ puts stdout "error:'Search failed: $qn'"
+ } else {
+ switch $qn {
+ 0 { puts stdout "error:'Search found no matching entries'" }
+ default {
+ if {[catch {WPCmd PELdap results $qn} results]} {
+ regsub -all {'} $results {\'} results
+ puts stdout "error:'Problem with results: $results'"
+ } else {
+ puts stdout "results:\["
+ foreach result $results {
+ set res [lindex $result 1]
+ set comma ""
+ foreach r $res {
+ regsub -all {'} $r {\'} r
+ puts -nonewline stdout "${comma}{personal:'[lindex $r 0]',email:\["
+ set comma2 ""
+ foreach a [lindex $r 4] {
+ puts -nonewline stdout "$comma2'$a'"
+ set comma2 ","
+ }
+ puts -nonewline stdout "\]}"
+ set comma ","
+ }
+ }
+
+ puts stdout "\]"
+ }
+ }
+ }
+ }
+} else {
+ puts stdout "error:'Empty search request'"
+}
+
+puts stdout "});</script></head><body></body></html>"
diff --git a/web/cgi/alpine/2.0/conduit/settings.tcl b/web/cgi/alpine/2.0/conduit/settings.tcl
new file mode 100755
index 00000000..f4f30922
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/settings.tcl
@@ -0,0 +1,184 @@
+#!./tclsh
+# $Id: settings.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# settings.tcl
+#
+# Purpose: CGI script to do the job of updating submitted settings
+#
+
+# Input:
+set settings_vars {
+ {restore "" false}
+}
+
+# inherit global config
+source ../alpine.tcl
+source ../common.tcl
+
+# Output: HTML containing javascript calls to functions of parent window
+#
+
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid}]} {
+ return
+}
+
+foreach item $settings_vars {
+ if {[catch {eval WPImport $item} result]} {
+ regsub -all {"} $result {\"} errstr
+ break
+ }
+}
+
+set response "Settings Updated"
+
+# feature settings
+if {0 == [string compare restore $restore]} {
+ WPCmd PEConfig reset pinerc
+ set response "Default Settings Restored"
+} elseif {[catch {
+ WPCmd PEConfig newconf
+
+ # collect feature settings
+ set setfeatures [WPCmd PEConfig featuresettings]
+ foreach feature {
+ include-header-in-reply
+ include-attachments-in-reply
+ signature-at-bottom
+ strip-from-sigdashes-on-reply
+ fcc-without-attachments
+ auto-move-read-msgs
+ enable-msg-view-urls
+ feature enable-msg-view-web-hostnames
+ enable-msg-view-addresses
+ render-html-internally
+ quell-server-after-link-in-html
+ quell-flowed-text
+ } {
+ if {[catch {cgi_import_as $feature setting}]} {
+ if {[lsearch $setfeatures $feature] >= 0} {
+ WPCmd PEConfig feature $feature 0
+ }
+ } else {
+ if {[lsearch $setfeatures $feature] < 0} {
+ WPCmd PEConfig feature $feature 1
+ }
+ }
+ }
+
+ # collect single-line text variable settings
+ foreach variable {
+ wp-indexlines
+ default-fcc
+ personal-name
+ user-domain
+ sort-key
+ incoming-startup-rule
+ posting-character-set
+ reply-leadin
+ reply-indent-string
+ postponed-folder
+ trash-folder
+ inbox-path
+ rss-news
+ rss-weather
+ read-message-folder
+ } {
+ set varvals [WPCmd PEConfig varget $variable]
+ set varvalue [lindex $varvals 0]
+ cgi_import_as $variable value
+ set value [split $value "\n"]
+ if {[string compare $varvalue $value]} {
+ WPCmd PEConfig varset $variable $value
+ }
+ }
+
+ # collect list-style variable settings
+ foreach {variable handle} {
+ alt-addresses altAddr
+ viewer-hdrs viewerHdr
+ default-composer-hdrs composeHdr
+ smtp-server smtpServer
+ ldap-servers ldapServer
+ } {
+ if {0 == [catch {cgi_import_as ${handle}s lcount}]} {
+ set l {}
+ for {set i 1} {$i <= $lcount} {incr i} {
+ if {0 == [catch {cgi_import_as ${handle}${i} value}] && [string length $value]} {
+ lappend l $value
+ }
+ }
+
+ WPCmd PEConfig varset $variable $l
+ }
+ }
+
+ # special-case variable settings
+ if {0 == [catch {cgi_import customHdrFields}]} {
+ set hdrs {}
+ for {set i 1} {$i <= $customHdrFields} {incr i} {
+ if {0 == [catch {cgi_import_as customHdrField${i} field}]} {
+ set hdr "${field}:"
+ if {0 == [catch {cgi_import_as customHdrData${i} value}]} {
+ append hdr " $value"
+ }
+
+ lappend hdrs $hdr
+ }
+ }
+
+ if {[llength $hdrs]} {
+ WPCmd PEConfig varset customized-hdrs $hdrs
+ }
+ }
+
+ cgi_import wrapColumn
+ WPCmd PEConfig columns $wrapColumn
+
+ cgi_import folderCache
+ WPSessionState left_column_folders $folderCache
+
+ cgi_import forwardAs
+ if {0 == [string compare attached $forwardAs]} {
+ if {[lsearch $setfeatures $feature] < 0} {
+ WPCmd PEConfig feature forward-as-attachment 1
+ }
+ } else {
+ if {[lsearch $setfeatures $feature] >= 0} {
+ WPCmd PEConfig feature forward-as-attachment 0
+ }
+ }
+
+ cgi_import signature
+ set cursig [string trimright [join [WPCmd PEConfig rawsig] "\n"]]
+ set signature [string trimright $signature]
+ if {[string compare $cursig $signature]} {
+ WPCmd PEConfig rawsig [split $signature "\n"]
+ }
+
+ WPCmd PEConfig saveconf
+} result]} {
+ regsub -all {"} $result {\"} errstr
+}
+
+puts stdout "Content-type: text/html;\n\n<html><head><script>"
+
+if {[info exists errstr]} {
+ puts stdout "window.parent.settingsFailure(\"${errstr}\");"
+} else {
+ WPCmd PEInfo statmsg $response
+ puts stdout "window.parent.settingsSuccess();"
+}
+
+puts stdout "</script></head><body></body></html>"
diff --git a/web/cgi/alpine/2.0/conduit/storecontact.tcl b/web/cgi/alpine/2.0/conduit/storecontact.tcl
new file mode 100755
index 00000000..36836f54
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/storecontact.tcl
@@ -0,0 +1,67 @@
+#!./tclsh
+# $Id: storecontact.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# storecontact.tcl
+#
+# Purpose: CGI script to handle saving new/edited contacts
+#
+# Input:
+set store_vars {
+ {book "" 0}
+ {ai "" -1}
+ {contactNick "" ""}
+ {contactName "" ""}
+ {contactEmail "" ""}
+ {contactFcc "" ""}
+ {contactNotes "" ""}
+}
+
+# Output:
+
+# inherit global config
+source ../alpine.tcl
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid}]} {
+ return
+}
+
+# grok parameters
+foreach item $store_vars {
+ if {[catch {eval WPImport $item} errstr]} {
+ lappend errs $errstr
+ }
+}
+
+if {[string length $contactNick] || [string length $contactName] || [string length $contactEmail]} {
+ set result ""
+ if {[catch {WPCmd PEAddress edit $book $contactNick $ai $contactName $contactEmail $contactFcc $contactNotes 1} result]} {
+ lappend status "Address Set Failure: $result"
+ } elseif {[string length $result]} {
+ lappend status "$result"
+ } else {
+ lappend status "Contact Added"
+ }
+} else {
+ lappend status "No Contact Added: Must contain Display Name, Address or Nickname"
+}
+
+# return response text
+puts stdout "Content-type: text/xml; charset=\"UTF-8\"\n"
+puts stdout {<?xml version="1.0" encoding="UTF-8"?>}
+puts stdout "<ResultSet totalResultsAvailable=\"[llength $status]\">"
+foreach sm $status {
+ regsub {'} $sm {\'} sm
+ puts stdout "<Result><StatusText>$sm</StatusText></Result>"
+}
+puts stdout "</ResultSet>"
diff --git a/web/cgi/alpine/2.0/conduit/take.tcl b/web/cgi/alpine/2.0/conduit/take.tcl
new file mode 100755
index 00000000..4f5f1342
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/take.tcl
@@ -0,0 +1,84 @@
+#!./tclsh
+# $Id: take.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# take.tcl
+#
+# Purpose: CGI script to supply data to YUI AutoTake
+#
+# Input:
+# along with possible search parameters:
+set take_args {
+ {op {} "noop"}
+ {u {} 0}
+}
+
+# inherit global config
+source ../alpine.tcl
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid}]} {
+ error "take.tcl $result"
+}
+
+# grok parameters
+foreach item $take_args {
+ if {[catch {eval WPImport $item} result]} {
+ set errstr $result
+ break;
+ }
+}
+
+switch -- $op {
+ from {
+ if {[catch {WPCmd PEMessage $u takefrom} result]} {
+ set errstr $result
+ }
+ }
+ all {
+ if {[catch {WPCmd PEMessage $u takeaddr} result]} {
+ set errstr $result
+ }
+ }
+ default {
+ set errstr "Unrecognized Take option: $op"
+ }
+}
+
+puts stdout "Content-type: text/xml; charset=\"UTF-8\"\n"
+puts stdout {<?xml version="1.0" encoding="UTF-8"?>}
+puts stdout "<ResultSet totalResultsAvailable=\"[llength $result]\">"
+if {[info exists errstr]} {
+ puts -nonewline stdout "<Result><Error>$errstr</Error></Result>"
+} else {
+ foreach r $result {
+ set ar [lindex $r 1]
+ set sr [lindex $r 2]
+ if {[string length [lindex $sr 0]] > 0
+ || [string length [lindex $sr 2]] > 0
+ || [string length [lindex $sr 3]] > 0} {
+ set type "edit"
+ } else {
+ set type "add"
+ }
+ # there is also an addrbook Fullname in sr 1
+ puts -nonewline stdout "<Result>"
+ puts -nonewline stdout "<Type>[cgi_quote_html $type]</Type>"
+ puts -nonewline stdout "<Nickname>[cgi_quote_html [lindex $sr 0]]</Nickname>"
+ puts -nonewline stdout "<Personal>[cgi_quote_html [lindex $ar 0]]</Personal>"
+ puts -nonewline stdout "<Email>[cgi_quote_html "[lindex $ar 1]@[lindex $ar 2]"]</Email>"
+ puts -nonewline stdout "<Fcc>[cgi_quote_html [lindex $sr 2]]</Fcc>"
+ puts -nonewline stdout "<Note>[cgi_quote_html [lindex $sr 3]]</Note>"
+ puts stdout "</Result>"
+ }
+}
+puts stdout {</ResultSet>}
diff --git a/web/cgi/alpine/2.0/conduit/tclsh b/web/cgi/alpine/2.0/conduit/tclsh
new file mode 120000
index 00000000..385fc6c6
--- /dev/null
+++ b/web/cgi/alpine/2.0/conduit/tclsh
@@ -0,0 +1 @@
+../tclsh \ No newline at end of file
diff --git a/web/cgi/alpine/2.0/contacts b/web/cgi/alpine/2.0/contacts
new file mode 100755
index 00000000..1cbec957
--- /dev/null
+++ b/web/cgi/alpine/2.0/contacts
@@ -0,0 +1,201 @@
+#!./tclsh
+# $Id: contacts 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# view.tcl
+#
+# Purpose: CGI script contacts for Web Alpine 2.0 pages
+#
+# Input: PATH_INFO: [/<col_number>]/<folder_name>[/<uid_of_viewed_msg>
+# along with possible search parameters:
+set contacts_args {
+}
+
+# inherit global config
+source ./alpine.tcl
+source ./foldercache.tcl
+source ./common.tcl
+
+# TEST
+proc cgi_suffix {args} {
+ return ""
+}
+
+# WHILE TESTING/DEBUGGING
+proc noimp {s} {
+ return "onClick=return noImp('${s}');"
+}
+
+set dmsgs ""
+proc dm {s} {
+ global dmsgs
+
+ lappend dmsgs $s
+}
+
+
+WPEval $contacts_args {
+ # verify current collection/folder
+ if {[catch {WPCmd PEFolder current} curfold]} {
+ error [list _action browse "cannot determine default folder: $curfold"]
+ } else {
+ set c [lindex $curfold 0]
+ set f [lindex $curfold 1]
+ }
+
+ set charset "UTF-8"
+ set u 0
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=$charset"
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_content_type "text/html; charset=$charset"
+ # WPStdHttpHdrs "text/html; charset=$charset"
+ cgi_title [wpPageTitle "Contacts"]
+ cgi_base "href=$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)/"
+
+ cgi_stylesheet css/menu.css
+ cgi_stylesheet css/cbn/screen.css
+ cgi_stylesheet css/cbn/contacts.css
+ # Yahoo Styles
+ cgi_stylesheet $_wp(yui)/build/container/assets/container-core.css
+ cgi_stylesheet $_wp(yui)/build/menu/assets/skins/sam/menu.css
+ cgi_stylesheet $_wp(yui)/build/button/assets/skins/sam/button.css
+ # YahooUI libraries
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/utilities/utilities.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/button/button-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/container/container.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/datasource/datasource-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/menu/menu-min.js" {}
+ # local libraries
+ cgi_script language="JavaScript" src="lib/common.js" {}
+ cgi_script language="JavaScript" src="lib/contacts.js" {}
+
+ cgi_javascript {
+ cgi_puts "var gCurrentAbook = 0;"
+ cgi_puts "YAHOO.alpine.current.c = '$c';"
+ cgi_puts "YAHOO.alpine.current.f = '$f';"
+ cgi_puts "YAHOO.alpine.current.u = $u;"
+ cgi_puts "function updateContactCount(nBooks,nContacts){"
+ cgi_puts " var el = document.getElementById('contactCount');"
+ cgi_puts " if(el) el.innerHTML = nContacts + ' Contacts';"
+ cgi_puts "}"
+ cgi_puts "function bodyOnLoad() {"
+ cgi_puts " initMenus();"
+ cgi_puts " if(YAHOO.env.ua.gecko > 0){ sizeVPHeight(); window.onresize = resizeVPHeight; }"
+ cgi_puts " setCheckMailFunction('gCheck', newMailCheck);"
+ cgi_puts " setNewMailCheckInterval([WPCmd PEInfo inputtimeout]);"
+ cgi_puts " drawContactList('alpineContent',gCurrentAbook,{hdr:'on',sendto:'on',canedit:'on'});"
+ cgi_puts "}"
+
+ # WHILE TESTING/DEBUGGING
+ cgi_puts "var impi = new Array(); function noImp(m){ var sm; if(impi\[m\]) {impi\[m\]++; if(impi\[m\] > 4) sm = '<b>Seriously,</b> ' + m + ' will <b>never</b> get implemented if you keep bothering me!'; else sm = m + ' is <b>still</b> not implemented!'; } else { sm = m + ' is not implemented yet!' ; impi\[m\] = 1 ;} showStatusMessage(sm,3); return false; }"
+
+ cgi_puts "browserDetect();"
+ }
+ }
+
+ cgi_body class=wap "onLoad=bodyOnLoad()" {
+
+ wpCommonPageLayout contacts "$c" "$f" "$u" "Contacts" [list [cgi_cgi "$_wp(appdir)/$_wp(ui2dir)/contacts"] Contacts 0 searchContent('contacts','clistContacts')] "" {
+ # CONTEXT COMMANDS
+ cgi_division class=hdrBtns {
+ cgi_javascript {
+ cgi_put "if(window.print) document.write('[cgi_buffer {cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi1" ""][cgi_span "class=hdrBtnText" Print]" "print" "onClick=return printContent()"]}]');"
+ }
+
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi2" ""][cgi_span "class=hdrBtnText" Settings]" "settings"]
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi3" ""][cgi_span "class=hdrBtnText" Help]" "javascript:openHelpWindow('contacts.html');" class=wap]
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi4" ""][cgi_span "class=hdrBtnText" "Sign out"]" "../../session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=${sessid}"]
+ }
+ } {
+ # TO MENUBAR
+ cgi_anchor_name "toolbar"
+ cgi_table class="toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table class="toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url [cgi_span "class=sp spmbi spmb13" "New Contact"] "contacts/new" title="Create new contact" "onClick=return contactEditor({which:'add'},storeNewContact);"]
+
+ }
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url [cgi_span "class=sp spmbi spmb14" "New Group"] "contacts/new/group" title="Create new group contact" "onClick=return contactEditor({which:'add',group:true},storeNewContact);"]
+ }
+ cgi_table_data class="dv1" {
+ cgi_puts [cgi_img "img/cbn/div.gif"]
+ }
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url [cgi_span "class=sp spmbi spmb9" "Send Email"] "send" title="Send email to selected contact" "onClick=return sendToContact();"]
+ }
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url "[cgi_img "img/cbn/edit.gif" class=wap] Edit" "#" title="Edit selected contact" "onClick=return editCheckedContact();"]
+ }
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url "[cgi_img "img/cbn/delete.gif" class=wap] Delete" "#" title="Delete selected contact" "onClick=return contactDelete();"]
+ }
+ cgi_table_data class="dv1" {
+ cgi_puts [cgi_img "img/cbn/div.gif"]
+ }
+ cgi_table_data class=wap {
+ cgi_bullet_list class="menu" {
+ cgi_put "<li class=\"menuHdr\">[cgi_url "More Actions [cgi_img "img/cbn/menu.gif" class="wap menuDn menuImg"]" "#" "onClick=return false;"]<div>"
+ cgi_bullet_list {
+ cgi_li [cgi_url "Import vCards" "#" [noimp "vCard import"]]
+ cgi_li [cgi_url "Export vCards" "#" [noimp "vCard export"]]
+ }
+ cgi_puts "</div></li>"
+ }
+ }
+ cgi_table_data width="100%" {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ } {
+ # MAIN PAGE CONTENT
+ cgi_puts "Loading..."
+ } {
+ # BOTTOM MENUBAR
+ cgi_table class="wap toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data class="wap pageText" id=contactCount {
+ cgi_puts ""
+ }
+ cgi_table_data width="100%" {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ }
+
+ # any debugging info to insert?
+ foreach dmsg $dmsgs {
+ cgi_html_comment "DEBUG: $dmsg"
+ cgi_puts ""
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/2.0/css/cbn/contactdialog.css b/web/cgi/alpine/2.0/css/cbn/contactdialog.css
new file mode 100644
index 00000000..8f9d64c9
--- /dev/null
+++ b/web/cgi/alpine/2.0/css/cbn/contactdialog.css
@@ -0,0 +1,108 @@
+/*
+ * $Id: contactdialog.css 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+ * ========================================================================
+ * Copyright 2006-2008 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+div#contactsDialogFramework
+{
+ display: none;
+}
+
+div#contactDialog
+{
+ overflow: hidden;
+}
+
+div.clistInstructions
+{
+ padding: 15px 5px 20px 5px;
+ text-align: center;
+}
+
+div.contactContent
+{
+ font-size: .8em;
+ height: 14.5em;
+ border: 1px solid #aaaaaa;
+}
+
+div.clistContext
+{
+ border-bottom: 1px solid #36c;
+ padding: .5em 0;
+ font-weight: bold;
+ color: #003399;
+ background-color: #e7f0ff;
+ overflow: hidden;
+}
+
+div.clistContext *
+{
+ margin-left: 5px;
+}
+
+div.clistContext img
+{
+ vertical-align: text-bottom;
+}
+
+div.clistContext a
+{
+ color: #003399;
+}
+
+span.clistContact
+{
+ color: black;
+}
+
+div.clistContacts
+{
+ overflow: auto;
+ height: 12em;
+}
+
+input#dirQuery
+{
+ padding: 0 2px;
+}
+
+div.clistContacts table tr td
+{
+ padding: none;
+ border: none;
+ font-size: .8em;
+ white-space: nowrap;
+/* width: 100%;
+*/
+}
+
+td.fli
+{
+ width: 24px;
+ text-align: center;
+}
+
+tr#flPick, tr#flPick a
+{
+ color: #ffffff;
+ background-color: #417bd9;
+}
+
+a.fln
+{
+ text-decoration: none;
+}
+
+td.clcd
+{
+}
diff --git a/web/cgi/alpine/2.0/css/cbn/contacts.css b/web/cgi/alpine/2.0/css/cbn/contacts.css
new file mode 100644
index 00000000..29a1148e
--- /dev/null
+++ b/web/cgi/alpine/2.0/css/cbn/contacts.css
@@ -0,0 +1,87 @@
+/*
+ * $Id: contacts.css 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+ * ========================================================================
+ * Copyright 2006-2008 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+div.clistInstructions
+{
+ padding: 15px 5px 20px 5px;
+ text-align: center;
+}
+
+div#alpineContent
+{
+ font-size: .9em;
+}
+
+div.clistContext
+{
+ border-bottom: 1px solid #36c;
+ padding: .5em 0;
+ font-weight: bold;
+ color: #003399;
+ background-color: #e7f0ff;
+ overflow: auto;
+}
+
+div.clistContext *
+{
+ margin-left: 5px;
+}
+
+div.clistContext img
+{
+ vertical-align: text-bottom;
+}
+
+div.clistContext a
+{
+ color: #003399;
+}
+
+div.clistContacts
+{
+ width: 100%;
+ padding-top: 3px;
+ overflow-y: auto;
+}
+
+div.clistContacts table
+{
+ width: 100%;
+ padding: none;
+ border: none;
+}
+
+div.clistContacts table tbody
+{
+ border-bottom: 1px solid #D4D4D4;
+}
+
+div.clistContacts table tbody tr
+{
+ border-bottom: 1px solid #36c;
+}
+
+table.clt
+{
+}
+
+td.cli
+{
+ width: 12mm;
+ padding: 5mm 0 5mm 10mm;
+}
+
+td.cln
+{
+} \ No newline at end of file
diff --git a/web/cgi/alpine/2.0/css/cbn/folderdialog.css b/web/cgi/alpine/2.0/css/cbn/folderdialog.css
new file mode 100644
index 00000000..9f09c647
--- /dev/null
+++ b/web/cgi/alpine/2.0/css/cbn/folderdialog.css
@@ -0,0 +1,96 @@
+/*
+ * $Id: folderdialog.css 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+ * ========================================================================
+ * Copyright 2006-2008 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+div.flistInstructions
+{
+ padding: 15px 5px 20px 5px;
+ text-align: center;
+}
+
+div#folderList
+{
+ font-size: .8em;
+ height: 14.5em;
+ border: 1px solid #aaaaaa;
+}
+
+div.flistContext
+{
+ border-bottom: 1px solid #36c;
+ padding: .5em 0;
+ font-weight: bold;
+ color: #003399;
+ background-color: #e7f0ff;
+}
+
+div.flistContext *
+{
+ margin-left: 5px;
+}
+
+div.flistContext img
+{
+ vertical-align: text-bottom;
+}
+
+div.flistContext a
+{
+ color: #003399;
+}
+
+span.flistFolder
+{
+ color: black;
+}
+
+div.flistFolders
+{
+ overflow: auto;
+ height: 12em;
+}
+
+div.flistFolders a
+{
+ font-size: .8em;
+}
+
+table.flt
+{
+ border: none;
+ width: 100%;
+}
+
+td.fli
+{
+ width: 24px;
+ text-align: center;
+}
+
+tr#flPick, tr#flPick a
+{
+ color: #ffffff;
+ background-color: #417bd9;
+}
+
+a.fln
+{
+ text-decoration: none;
+}
+
+td.flcd
+{
+ font-size: .9em;
+ padding-left: 3em;
+ padding-bottom: 1.5em;
+}
diff --git a/web/cgi/alpine/2.0/css/cbn/folders.css b/web/cgi/alpine/2.0/css/cbn/folders.css
new file mode 100644
index 00000000..5c190f75
--- /dev/null
+++ b/web/cgi/alpine/2.0/css/cbn/folders.css
@@ -0,0 +1,99 @@
+/*
+ * $Id: folders.css 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+ * ========================================================================
+ * Copyright 2006-2008 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+div.flistInstructions
+{
+ padding: 15px 5px 20px 5px;
+ text-align: center;
+}
+
+div#alpineContent
+{
+ font-size: .9em;
+}
+
+div.flistContext
+{
+ border-bottom: 1px solid #36c;
+ padding: .5em 0;
+ font-weight: bold;
+ color: #003399;
+ background-color: #e7f0ff;
+ overflow: auto;
+}
+
+div.flistContext *
+{
+ margin-left: 5px;
+}
+
+div.flistContext img
+{
+ vertical-align: text-bottom;
+}
+
+div.flistContext a
+{
+ color: #003399;
+}
+
+span.flistFolder
+{
+ color: black;
+ vertical-align: middle;
+}
+
+div.flistFolders
+{
+ padding-top: 3px;
+ overflow-y: auto;
+}
+
+table.flt
+{
+ padding: none;
+ border: none;
+ width: 100%;
+}
+
+td.fli
+{
+ width: 24px;
+ text-align: center;
+ padding-left: 12px;
+}
+
+tr.flr
+{
+ border-bottom: 1px solid #36c;
+}
+
+tr#flPick, tr#flPick a
+{
+ color: #ffffff;
+ background-color: #417bd9;
+}
+
+.fln
+{
+ text-decoration: none;
+ font-size: .9em;
+}
+
+td.flcd
+{
+ font-size: .9em;
+ padding-left: 3em;
+ padding-bottom: 1.5em;
+}
diff --git a/web/cgi/alpine/2.0/css/cbn/screen.css b/web/cgi/alpine/2.0/css/cbn/screen.css
new file mode 100644
index 00000000..ec2107aa
--- /dev/null
+++ b/web/cgi/alpine/2.0/css/cbn/screen.css
@@ -0,0 +1,2084 @@
+/*
+ * $Id: screen.css 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+ * ========================================================================
+ * Copyright 2006-2008 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+/*** GLOBAL ***/
+body.wap
+{
+ font-family: Tahoma, Helvetica, sans-serif;
+ margin: 0 0;
+}
+form.wap
+{
+ display: inline;
+}
+select.wap, input.wap, textarea.wap, button.wap, label.wap
+{
+ font-family: Tahomaf, Helvetica, sans-serif;
+ font-size: 1.0em; /* required by IE */
+}
+td.wap, th.wap, div.wap
+{
+ white-space: nowrap;
+ font-size: .7em;
+}
+h1.wap
+{
+ display: inline;
+ font-weight: normal;
+ font-size: 1.0em;
+}
+h2.wap, h3.wap, h4.wap, h5.wap, h6.wap
+{
+ display: inline;
+}
+a.wap
+{
+ color: #003399;
+ text-decoration: none;
+}
+a.wap:hover
+{
+ text-decoration: underline;
+}
+img.wap
+{
+ border-style: none;
+}
+.rt
+{
+ text-align: right;
+}
+.lt
+{
+ text-align: left;
+}
+.frt
+{
+ float: right;
+}
+.flt
+{
+ float: left;
+}
+.right
+{
+ padding-right: 10px;
+ float: right;
+}
+.left
+{
+ float: left;
+}
+.bld
+{
+ font-weight: bold;
+}
+.top
+{
+ vertical-align: top;
+}
+.black
+{
+ color: black;
+}
+span.sp, input.sp
+{
+ background: url(../../img/cbn/spritelib.gif) no-repeat;
+}
+span.sp span
+{
+ display: none;
+}
+span.trans
+{
+ display: block;
+ width: 24px;
+ height: 24px;
+}
+
+/*** STATUS MESSAGES ***/
+div#statusMessage
+{
+ display: none;
+ position: relative;
+}
+div.status
+{
+
+ color: black;
+ margin: 0 10mm 0 20mm;
+ height: 15px;
+ overflow: hidden;
+ vertical-align: middle;
+ background: #ffffa6 url(../../img/cbn/spritelib.gif) no-repeat 0 -1104px;
+}
+
+div.status div.center
+{
+ text-align: center;
+ margin-left: 36px;
+ margin-right: 36px;
+}
+
+div.status div.edge
+{
+ text-align: left;
+ width: 32px;
+ height: 15px;
+}
+
+div.status div.cap
+{
+ width: 1px;
+ height: 15px;
+ background: #ffffa6 url(../../img/cbn/spritelib.gif) no-repeat 0 -1104px;
+}
+
+a#statuslink
+{
+ color: black;
+ text-decoration: none;
+}
+a#statuslink:hover
+{
+ text-decoration: underline;
+}
+
+/*** STATUS MESSAGE ICONS ***/
+span.spsm
+{
+ display: block;
+ width: 12px;
+ height: 12px;
+ overflow: hidden;
+ margin: 1px 0 0 10px;
+}
+span.sm1
+{
+ background-position: 0 -1056px;
+}
+span.sm2
+{
+ background-position: 0 -1080px;
+}
+
+/*** MESSAGE PRIORITY STYLES ***/
+span.prioHigh
+{
+ font-weight: bold;
+ color: #DD0000;
+}
+span.prioNorm
+{
+ color: #008800;
+}
+span.prioLow
+{
+ color: #000088;
+}
+
+/*** SKIP TO MESSAGE LIST (for screen readers and mobility impaired) ***/
+#skip a, #skip a:visited
+{
+ position: absolute;
+ top: 0;
+ left: -999px;
+ padding: 0 5px 1px 5px;
+ margin: 2px 0 0 1px;
+}
+
+#ie6Fix:active, #skip a:active, #skip a:focus, #skip a:hover
+{
+ position: absolute;
+ top: 0;
+ left: 0;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ color: #00FF00;
+ background-color: #000000;
+}
+
+/*** PAGE LAYOUT ***/
+table.page
+{
+ background-color: #FFFFFF;
+ width: 100%;
+ height: 100%;
+}
+table.page td.checkMailandCompose
+{
+ height: 100%;
+ vertical-align: top;
+}
+table.page td.spc
+{
+ background-color: #000000;
+ width: 5px;
+}
+table.page td.topHdr
+{
+ vertical-align: bottom;
+ background: #000000 url(../../img/cbn/btnbg.gif) repeat;
+}
+table.content
+{
+ width: 100%;
+ height: 100%;
+}
+div.contentBody
+{
+ width: 100%;
+}
+div.contentBodyHTML
+{
+ padding: 6px;
+}
+div.contentDeadSession
+{
+ margin-top: 1.75em;
+ text-align: center;
+ font-size: 1.75em;
+ font-weight: bold;
+}
+table.page img.logo
+{
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 182px;
+ height: 72px;
+ margin-bottom: 5px;
+}
+table.page span.logo
+{
+ position: absolute;
+ top: 50px;
+ left: 14px;
+ color: white;
+ font-size: .8em;
+}
+
+/*** NO SCRIPT WARNING ***/
+.noscript
+{
+ text-align: center;
+ font-size: .8em;
+ line-height: 2em;
+ background-color: #ffffa6;
+ border-left: 1px solid black;
+ border-right: 1px solid black;
+}
+
+
+/*** HEADER BUTTONS ***/
+div.hdrBtns
+{
+ float: right;
+}
+span.hdrBtnText
+{
+ display: block;
+ float: left;
+ cursor: pointer;
+}
+span.hdrBtnImg
+{
+ display: block;
+ float: left;
+ height: 16px;
+ width: 16px;
+ margin: 0 6px 0 14px;
+ cursor: pointer;
+}
+span.hbi1 { background-position: 0 -768px; }
+span.hbi2 { background-position: 0 -792px; }
+span.hbi3 { background-position: 0 -816px; }
+span.hbi4 { background-position: 0 -840px; }
+
+span.newsImg
+{
+ display: block;
+ float: left;
+ height: 16px;
+ width: 16px;
+ margin-top: 3px;
+ margin-right: 6px;
+ cursor: pointer;
+ background-position: 0 -1800px;
+}
+
+/*** SEARCH ***/
+.searchFormDiv
+{
+ padding: 2mm 2mm 0 2mm;
+ margin-top: 0;
+ margin-bottom: 0;
+}
+#searchForm
+{
+ margin-bottom: 0;
+ margin-top: 0;
+}
+#searchField
+{
+ width: 80%;
+}
+input.searchBtn
+{
+ width: 19px;
+ height: 19px;
+ margin-left: 2mm;
+ border: none;
+ background-position: 0 -1152px;
+}
+#searchAdvance
+{
+ float: left;
+ padding-top: 1mm;
+ padding-left: 2mm;
+}
+#searchClear
+{
+ float: right;
+ width: 2em;
+ padding-top: 1mm;
+ padding-right: 4mm;
+}
+#searchRefine
+{
+ clear: both;
+ padding-top: 1.5mm;
+ text-align: left;
+}
+#searchResult
+{
+ clear: both;
+ padding-left: 10px;
+ padding-top: 3px;
+}
+
+span.searchMatch
+{
+ background-color: yellow;
+ font-size: larger;
+}
+
+/*** TOOLBAR ***/
+div.toolBar
+{
+ border: 1px solid yellow;
+ height: 3em;
+ background: #000000 url(../../img/cbn/btnbg.gif) repeat;
+ color: #ffffff;
+ float: left;
+ padding: 0 0 1px 0;
+}
+span.toolBarText
+{
+ display: block;
+ float: left;
+ margin: .75em 4px 0 4px;
+}
+span.toolBarImg
+{
+ display: inline-block;
+ height: 24px;
+ width: 24px;
+}
+span.toolBarBtn
+{
+ float: left;
+ margin-top: .4em;
+ margin-left: .4em;
+}
+.toolBarBtnLeft
+{
+ margin-left: 1mm;
+}
+.toolBarBtnRight
+{
+ position: absolute;
+ right: 0;
+}
+span.toolBarNav
+{
+ float: right;
+ cursor: pointer;
+ margin-top: .4em;
+}
+span.toolBarSep
+{
+ display: block;
+ height: 24px;
+ margin: 4px 2px 0 2px;
+}
+span.toolBarSepBtn
+{
+ float: left;
+}
+span.toolBarSepNav
+{
+ float: right;
+}
+div.toolBar a
+{
+ height: 3em;
+ display: block;
+ float: left;
+ color: #FFFFFF;
+}
+div.toolBar a:hover
+{
+ cursor: pointer;
+ text-decoration: none;
+ background: #000000 url(../../img/cbn/btnhi.gif) repeat;
+ color: #FFFFFF;
+}
+div.toolBarMenu
+{
+ float: left;
+}
+
+span.tbi1 { background-position: 0 -120px; }
+span.tbi2 { background-position: 0 -312px; }
+span.tbi3 { background-position: 0 -336px; }
+span.tbi4 { background-position: 0 -864px; }
+span.tbi5 { background-position: 0 -888px; }
+
+
+table.toolbarTbl
+{
+ background: #000000 url(../../img/cbn/btnbg.gif) repeat;
+ border-left: 1px solid #777777;
+ border-top: 1px solid #777777;
+ height: 38px;
+ width: 100%;
+}
+table.toolbarTbl td
+{
+ border-bottom: 1px solid #777777;
+}
+table.toolbarTbl a
+{
+ color: #FFFFFF;
+ margin: 0 0;
+}
+table.toolbarTbl a:hover
+{
+ text-decoration: none;
+ background: #000000 url(../../img/cbn/btnhi.gif) repeat;
+ color: #FFFFFF;
+}
+table.toolbarTbl td.tbPad
+{
+ border-right: 1px solid #777777;
+ padding: 0;
+ vertical-align: top;
+}
+table.toolbarTbl a
+{
+ display: block;
+ padding: 3px 8px 4px 0;
+ text-decoration: none;
+}
+table.toolbarTbl a img
+{
+ vertical-align: middle;
+}
+table.toolbarTbl td.pageText
+{
+ color: #ffffff;
+ padding-left: 5px;
+}
+table.toolbarTbl td.pageBtns
+{
+ color: #ffffff;
+}
+table.toolbarTbl td.pageBtns a, table.toolbarTbl td.pageBtns a img
+{
+ padding: 0;
+ margin: 0;
+}
+table.toolbarTbl td.pageBtns a:hover
+{
+ background: inherit;
+}
+
+
+/**** Header Context ****/
+div.wapContext {
+ height: 5em;
+}
+
+/**** Menu Bars ****/
+div.wapMenuLeft
+{
+ float: left;
+ width: 14em; /* sidebar width */
+}
+
+div.wapMenuRight
+{
+ height: 100%;
+ margin-left: 14em;
+ border-left: 4px solid black;
+}
+
+/*** LEFT COLUMN ***/
+table.leftColumn
+{
+ clear: left;
+ width: 100%;
+}
+
+/*** Sidebar ***/
+div.wapSidebar
+{
+ float: left;
+ width: 14em; /* sidebar width */
+}
+
+/*** FOLDER PANE ***/
+div.folderPane
+{
+ margin: 5px 0;
+ padding: 10px 0;
+ border-top: thin groove;
+ border-bottom: thin groove;
+ overflow: hidden;
+}
+div.folderList div
+{
+ clear: both;
+}
+div.fld
+{
+ height: 20px;
+ line-height: 18px;
+ padding-left: 10px;
+ margin-top: 3px;
+}
+
+div.ftitle
+{
+ padding: 0 0 4px 12px;
+ font-weight: bold;
+}
+div.fld span
+{
+ color: #000000;
+}
+div.fld span.unrd
+{
+ color: #707070;
+}
+div.sel span.unrd, div.sel span, div.sel span a
+{
+ color: #ffffff;
+}
+div.sel
+{
+ color: #ffffff;
+ background: #dae7fc url(../../img/cbn/spritelib.gif) repeat-x 0 -912px;
+}
+div.sel a, div.sel a span, div.sel a:hover
+{
+ color: #ffffff;
+}
+div.folderList span.left /* requires .left class */
+{
+ text-align: left;
+}
+div.folderList span.right /* requires .right class */
+{
+ font-weight: normal;
+}
+div.folderList span.right a /* requires .right class */
+{
+ color: #003399;
+}
+div.folderList div.lnk a
+{
+ color: #003399;
+}
+
+/*** SIMPLE LIST ***/
+table.listTbl
+{
+ width: 100%;
+}
+table.listTbl td, table.listTbl th
+{
+ padding: 0 3px;
+}
+table.listTbl td img, table.listTbl th img
+{
+ vertical-align: middle;
+ width: 17px;
+ height: 17px;
+}
+table.listTbl tr.unread, h1.unread
+{
+ font-weight: bold;
+}
+table.listTbl tr.ac, table.listTbl tr.ac a
+{
+ background-color: #f4f6f8;
+}
+table.listTbl tr#sd, table.listTbl tr#sd a, tr.choice
+{
+ color: #ffffff;
+ background-color: #417bd9;
+}
+table.listTbl tbody
+{
+ overflow: hidden;
+}
+table.listTbl th.colHdr
+{
+ border-top: 0;
+ height: 17px;
+ background: #f3f3f3 url(../../img/cbn/spritelib.gif) repeat-x 0 -936px;
+}
+table.listTbl th.selColHdr a
+{
+ color: #000000;
+}
+table.listTbl th.colHdr a
+{
+ color: #000000;
+}
+table.listTbl th a:hover
+{
+ text-decoration: none;
+}
+table.listTbl th.selColHdr
+{
+ border-top: 0px;
+ height: 17px;
+ background: #d4d4d4 url(../../img/cbn/spritelib.gif) repeat-x 0 -960px;
+}
+table.listTbl th.selColHdr img.selectedDn
+{
+ width: 8px;
+ height: 8px;
+ vertical-align: middle;
+}
+table.foldermgmt td, table.foldermgmt th
+{
+ border-bottom: 1px solid #eeeeee;
+}
+table.foldermgmt a
+{
+ font-weight: bold;
+}
+table.foldermgmt td.parent a
+{
+ font-weight: normal;
+}
+table.foldermgmt img
+{
+ padding-right: 5px;
+}
+table.divider td, table.divider th
+{
+ border-bottom: 1px solid #eeeeee;
+}
+table.listTbl td.nodivider
+{
+ border-bottom: none;
+}
+
+/*** FOOTER ***/
+table.page td.footer
+{
+ color: #FFFFFF;
+ background-color: #000000;
+ height: 30px;
+}
+table.page td.footer img
+{
+ margin-right: 6px;
+ vertical-align: bottom;
+}
+table.page td.footer a
+{
+ color: white;
+}
+
+/*** MESSAGE VIEW ***/
+
+table.msgHead
+{
+ background-color: #f9f9f9;
+ border-left: 1px solid #aaaaaa;
+ border-right: 1px solid #aaaaaa;
+ border-bottom: 1px solid #aaaaaa;
+ width: 100%;
+}
+table.msgHead td.subText
+{
+ padding: 5px 0 0 6px;
+ font-size: 1.1em;
+ font-weight: normal;
+}
+table.msgHead span.right
+{
+ font-weight: normal;
+}
+table.msgHead span.right a
+{
+ color: #003399;
+}
+table.msgHead td.hdrLabel
+{
+ padding: 4px 0 0 6px;
+ /* breaks on IE if width is set to 90px or less */
+ width: 100px;
+ vertical-align: top;
+ font-weight: bold;
+}
+table.msgHead td.hdrText
+{
+ width: 100%;
+ padding: 4px 0 0 4px;
+ text-align: left;
+ white-space: normal;
+}
+table.msgHead td.hdrText span.return img
+{
+ vertical-align: top;
+}
+table.msgHead td.hdrText span.return a
+{
+ font-weight: bold;
+}
+table.msgHead td.hdrText span.contactAddr
+{
+ float: left;
+ padding-right: 5px;
+}
+
+td.contentBody
+{
+ white-space: normal;
+ padding: 10px 0 0 6px;
+}
+table.msgHead a.addContact
+{
+ color: #003399;
+ padding-left: 10px;
+ vertical-align: text-top;
+}
+table.msgHead a.addContact img
+{
+ vertical-align: text-top;
+}
+table.msgHead span.emailAddr, table.msgHead span.attach
+{
+ white-space: nowrap;
+}
+table.msgHead span.attach img
+{
+ vertical-align: middle;
+}
+table.msgHead span.attach a
+{
+ text-decoration: underline;
+ float: left;
+ padding-right: 10px;
+}
+td.msgRawHead
+{
+ font-family: courier, monospace;
+}
+
+
+
+/*** COMPOSE ***/
+table.compose
+{
+ padding: 0px 10px;
+ background-color: #f9f9f9;
+ border-left: 1px solid #aaaaaa;
+ border-right: 1px solid #aaaaaa;
+ width: 100%;
+}
+table.compose td.spc
+{
+ background-color: #f9f9f9;
+ height: 6px;
+ width: 100%;
+}
+table.compose td.spc *
+{
+ vertical-align: middle;
+}
+table.compose td.lbl
+{
+ padding-right: 5px;
+ vertical-align: top;
+ width: 1%;
+}
+table.compose td.lbl input
+{
+ width: 40px;
+}
+table.compose td.lbl label
+{
+ padding-left: 2px;
+}
+table.compose td.lbl *
+{
+ vertical-align: top;
+}
+table.compose td.mid
+{
+ width: 100%;
+ padding: 0px;
+}
+table.compose td.mid *
+{
+ vertical-align: top;
+}
+table.compose td.mid textarea, table.compose td.mid input
+{
+ border: 1px solid #aaaaaa;
+ margin: 0;
+ padding: 1px 3px 1px 3px;
+ xheight: 1.7em;
+ width: 100%;
+ overflow-y: auto;
+ word-wrap: break-word;
+}
+textarea.mid, input.mid
+{
+ height: 1.7em;
+}
+table.compose td.rgt
+{
+ padding-left: 5px;
+ vertical-align: top;
+ width: 1%;
+}
+table.compose td.rgt *
+{
+ vertical-align: top;
+}
+table.compose td.attach *
+{
+ vertical-align: middle;
+}
+table.compose img.attachment
+{
+ width: 17px;
+ height: 17px;
+}
+table.compose img.rmAttach
+{
+ vertical-align: top;
+ width: 15px;
+ height: 15px;
+}
+table.composeBody
+{
+ background-color: #f9f9f9;
+ border-left: 1px solid #aaaaaa;
+ border-right: 1px solid #aaaaaa;
+ width: 100%;
+ height: 100%;
+}
+table.composeBody td.textBody
+{
+ height: 100%;
+ padding: 10px 6px 0 6px;
+ vertical-align: top;
+}
+table.composeBody td.textBody textarea
+{
+ border: 1px solid #aaaaaa;
+ width: 100%;
+ height: 98%;
+ padding: 4px 6px;
+ word-wrap: break-word;
+}
+span#lessComposeHeaderText
+{
+ display: none;
+}
+div#moreComposeHeaders
+{
+ display: none;
+}
+div#composeAttachments
+{
+ display: none;
+}
+span.attachmentName
+{
+ white-space: nowrap;
+ padding-right: .25em;
+}
+
+/*** GENERAL FIELDS (e.g. settings, advance search, contact details, etc.) ***/
+table.fields
+{
+ font-size: .7em;
+ width: 95%;
+ margin: 10px 20px;
+}
+table.fields td.title
+{
+ width: 20%;
+ font-weight: bold;
+ vertical-align: top;
+ color: #555555;
+}
+table.fields td.body
+{
+ vertical-align: top;
+ width: 80%;
+}
+table.fields td.body *
+{
+ vertical-align: middle;
+}
+table.fields td.title, table.fields td.body
+{
+ padding: 8px 0;
+ border-bottom: 1px solid #CCCCCC;
+}
+table.fields td.nodivider
+{
+ border-bottom: none;
+}
+table.fields td span.label
+{
+ font-weight: bold;
+}
+table.fields td a
+{
+ font-weight: normal;
+}
+table.fields td *
+{
+ vertical-align: bottom;
+}
+table.fields span.tips
+{
+ color: #000000;
+ font-weight: normal;
+}
+
+
+/*** SETTINGS (requires "fields" class) ***/
+table.settings td.title, table.settings td.body
+{
+ padding: 12px 12px 12px 0;
+}
+
+div#advancedSettings
+{
+ display: none;
+}
+
+/*** CONTACTS (requires "fields" class) ***/
+table.contacts *.contactText
+{
+ width: 90%;
+}
+
+/*** CONTACTS EDITOR ***/
+form.contactEditor
+{
+ color: #555555;
+ font-size: .7em;
+ padding: 0 12px;
+}
+form.contactEditor div.contactSection
+{
+ overflow: auto;
+ padding: 8px 0;
+ border-bottom: 1px solid silver;
+}
+form.contactEditor div.context
+{
+ font-size: 1.7em;
+ font-weight: bold;
+ padding-bottom: 8px;
+}
+form.contactEditor div.contactField
+{
+ float: left;
+ font-weight: bold;
+ width: 10em;
+}
+form.contactEditor input, form.contactEditor select
+{
+ width: 370px;
+}
+form.contactEditor textarea
+{
+ height: 6em;
+ width: 370px;
+}
+
+/*** ADVANCED SEARCH ***/
+form.advanceSearch
+{
+ color: #555555;
+ font-size: .7em;
+ padding: 0 12px;
+}
+form.advanceSearch div.searchSection
+{
+ overflow: auto;
+ padding: 8px 0;
+ border-bottom: 1px solid silver;
+}
+form.advanceSearch div.context
+{
+ font-size: 1.7em;
+ font-weight: bold;
+ padding-bottom: 8px;
+}
+form.advanceSearch div.scope
+{
+ text-align: center;
+ padding: 6px 0;
+}
+form.advanceSearch div div.searchField
+{
+ line-height: 2em;
+ font-weight: bold;
+ float: left;
+ width: 8em;
+}
+form.advanceSearch div div.searchType
+{
+ float: left;
+ padding-right: 10px;
+}
+form.advanceSearch div div.searchType select
+{
+ width: 12em;
+}
+form.advanceSearch div div.searchTerm
+{
+ height: 2em;
+ line-height: 2em;
+}
+form.advanceSearch div div.searchTerm input
+{
+ width: 18em;
+}
+
+/*** CONTACTS (requires "fields" class) ***/
+div.attachfiles
+{
+ margin: 20px 20px;
+}
+div.attachfiles td
+{
+ vertical-align: middle;
+ padding: 3px 0;
+}
+
+
+/*** MAIN HEADER (i.e. RSS news feed, weather bar, storage meter) ***/
+div.hdrContent
+{
+ overflow: hidden;
+}
+div.hdrContent, div.hdrContent a
+{
+ text-decoration: none;
+ color: #FFFFFF;
+}
+div.hdrContent a:hover
+{
+ text-decoration: underline;
+}
+div.hdrContent span.RSS
+{
+ line-height: 2em;
+ clear: both;
+}
+div.wbar
+{
+ height: 15px;
+ line-height: 15px;
+ padding-left: 5px;
+ padding-right: 5px;
+ background: #000000 url(../../img/cbn/spritelib.gif) repeat-x 0 -1128px;
+
+}
+div.wbar div.weather
+{
+ text-align: center;
+ float: left;
+ padding-left: 20em;
+}
+div.wbar div.usage
+{
+ float: right;
+ width: 18em;
+}
+div.hdrContent div.pageTitle
+{
+ width: 55%;
+ float: left;
+ clear: left;
+ text-align: left;
+ color: #FFFFFF;
+ font-size: 1.8em;
+ font-weight: normal;
+ padding: 4px 0 4px 5px;
+}
+div.hdrContent div.commands
+{
+ float: right;
+ margin: 8px 7px 0 0;
+}
+
+/*** INLINE MESSAGES ***/
+div#bannerConfirm
+{
+ font-weight: bold;
+ text-align: center;
+ padding: 3px 5px;
+ color: #000000;
+ background-color: #ffecda;
+ border-bottom: 1px solid #aaaaaa;
+}
+div#bannerConfirm img
+{
+ vertical-align: middle;
+}
+
+div#bannerError
+{
+ font-weight: bold;
+ text-align: center;
+ padding: 3px 5px;
+ color: #ffffff;
+ background-color: #ff0000;
+ border-bottom: 1px solid #aaaaaa;
+}
+div#bannerError img
+{
+ vertical-align: middle;
+}
+
+div.bannerPrivacy
+{
+ font-weight: bold;
+ line-height: 1.4em;
+ padding: 3px 5px;
+ background-color: #ffffd2;
+ border-bottom: 1px solid #aaaaaa;
+}
+div.bannerPrivacy a
+{
+ font-weight: normal;
+}
+div.bannerPrivacy img
+{
+ padding-right: 8px;
+ float: left;
+}
+
+
+div.bannerSearch
+{
+ text-align: center;
+ padding: 5px 60px 5px 5px;
+ background-color: #eeeeee;
+ border-bottom: 1px solid #aaaaaa;
+}
+div.bannerSearch *
+{
+ vertical-align: middle;
+}
+div.bannerSearch input.text
+{
+ width: 15em;
+}
+
+
+div#bannerSelection
+{
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: .7em;
+ display: none;
+ text-align: center;
+ padding: 4px 5px;
+ color: #000000;
+ border-bottom: 1px solid #aaaaaa;
+}
+
+
+table.bannerFolderSearch
+{
+ width: 100%;
+ padding: 5px 5px 5px 5px;
+ background-color: #e7f0ff;
+ border-bottom: 1px solid #aaaaaa;
+}
+table.bannerFolderSearch td.title
+{
+ text-align: left;
+}
+table.bannerFolderSearch td.body
+{
+ text-align: right;
+}
+table.bannerFolderSearch img
+{
+ margin-right: 5px;
+ vertical-align: middle;
+}
+table.bannerFolderSearch a
+{
+ color: #003399;
+ font-weight: bold;
+ text-decoration: underline;
+}
+
+
+/*** MOVE/COPY TO FOLDER UI ***/
+.moveToFolder *
+{
+ vertical-align: middle;
+}
+.moveToFolder input
+{
+ width: .9em;
+ height: .9em;
+}
+.moveToFolder input
+{
+ margin-top: 2px; /* fix for IE */
+}
+.moveToFolder label
+{
+ padding-right: 4px;
+ color: #FFFFFF;
+}
+.moveToFolder select
+{
+ position: relative;
+ bottom: 8px;
+}
+
+.attachFiles
+{
+ margin: 15px;
+}
+
+.attachFiles input[type="button"]
+{
+ margin-left: 5px;
+}
+
+div.attachInput
+{
+ margin: 2px 2px 2px 0;
+}
+div.attachInput form
+{
+ margin-bottom: 0;
+}
+
+div.drop
+{
+ background-color: #66ffff;
+}
+
+/*** Loading Notification ***/
+div#bePatient
+{
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: .6em;
+ font-weight: bold;
+ background-color: #ffffa6;
+ color: #000000;
+ padding: 4px 5px;
+ border-bottom: 2px solid black;
+ border-right: 2px solid black;
+ left: -999px;
+ top: -999px;
+ margin-left: -1px;
+ position: absolute;
+}
+
+/*** Normal Message Text ***/
+.messageText
+{
+ margin: 10px 0 0 6px;
+ font-family: monospace;
+ white-space: pre;
+}
+
+/*** Tool Tip ***/
+div#tipDrag {
+ border: 1px solid black;
+ padding: 1px 3px;
+ background-color: #fffacd;
+ font-size: 0.7em;
+}
+
+/*** Panel Framework ***/
+/*#panel_c.yui-panel-container.shadow .underlay
+{
+ left:3px;
+ right:-3px;
+ top:3px;
+ bottom:-3px;
+ position:absolute;
+ background-color:#000;
+ opacity:0.12;
+ filter:alpha(opacity=12);
+}*/
+
+.yui-panel
+{
+ position:relative;
+ border:none;
+ overflow:visible;
+ background:transparent url(../../img/cbn/border-rt.gif) repeat-y top right;
+}
+
+.yui-panel .container-close
+{
+ position:absolute;
+ top:5px;
+ right:10px;
+ height:14px;
+ width:14px;
+ background:url(../../img/cbn/spritelib.gif) no-repeat 0 -1224px;
+}
+
+.yui-panel .hd
+{
+ border:none;
+ background:url(../../img/cbn/spritelib.gif) repeat-x 0 -1248px;
+ color:#FFF;
+ height:24px;
+ margin: 0 4px;
+ text-align:left;
+ vertical-align:middle;
+ overflow:visible;
+}
+
+.yui-panel .bd
+{
+ overflow:hidden;
+ padding: 10px;
+ border:none;
+ background:#FFF url(../../img/cbn/border-lt.gif) repeat-y;
+ margin-right:4px;
+}
+
+.yui-panel .ft
+{
+ background:url(../../img/cbn/spritelib.gif) repeat-x 0 -1272px;
+ font-size:4px;
+ height:4px;
+ padding:0px 10px;
+ border:none
+}
+
+.yui-panel .hd span
+{
+ padding-left: 4px;
+ line-height:24px;
+ vertical-align:middle;
+ font-weight:bold;
+}
+
+.yui-panel .hd .tl
+{
+ width:4px;
+ height:24px;
+ top:0;
+ left:0;
+ background:url(../../img/cbn/spritelib.gif) no-repeat 0 -1296px;
+ position:absolute;
+}
+
+.yui-panel .hd .tr
+{
+ width:4px;
+ height:24px;
+ top:0;
+ right:0;
+ background:url(../../img/cbn/spritelib.gif) no-repeat 0 -1320px;
+ position:absolute;
+}
+
+.yui-panel .ft .bl
+{
+ width:4px;
+ height:4px;
+ bottom:0;
+ left:0;
+ background:url(../../img/cbn/spritelib.gif) no-repeat 0 -1344px;
+ position:absolute;
+}
+
+.yui-panel .ft .br
+{
+ width:4px;
+ height:4px;
+ bottom:0;
+ right:0;
+ background:url(../../img/cbn/spritelib.gif) no-repeat 0 -1348px;
+ position:absolute;
+}
+
+/*** Internal Panel Elements ***/
+div.dialogIcon
+{
+ width: 60px;
+ height:60px;
+ float: left;
+}
+
+div.alert
+{
+ background:url(../../img/cbn/alert.gif) no-repeat top center;
+}
+
+div.prompt
+{
+ background:url(../../img/cbn/question2.jpg) no-repeat top center;
+}
+
+div.dialog
+{
+ background:url(../../img/cbn/question2.jpg) no-repeat center top;
+}
+
+div#alertBody
+{
+ margin-left: 60px;
+ padding: 5px;
+}
+
+div#promptBody
+{
+ margin-left: 60px;
+ padding: 5px;
+}
+
+div#dialogBody
+{
+ margin-left: 60px;
+ width: 540px;
+ padding: 5px;
+ overflow: auto;
+}
+
+div.dialogButtons
+{
+ padding-top: 10px;
+ background-color: #ffffff;
+ text-align:right;
+}
+
+div.panelExplanation
+{
+ width: 80%;
+ text-align: center;
+ padding: 1em 0;
+}
+
+div.panelInput
+{
+ text-align: center;
+ overflow: auto;
+}
+
+div.panelInput input
+{
+ padding: 0 2px;
+ margin-left: 8px;
+}
+
+/*** Viewport Height Limiter ***/
+div#alpineContent
+{
+ height: 100%;
+ overflow: auto;
+}
+
+/*** Compose Checkpoint Result ***/
+#formResponse
+{
+ position: absolute;
+ top: 0;
+ left: -999px;
+}
+
+/*** Sprite based images ****/
+
+/* left column icons */
+span.splci
+{
+ display:block;
+ line-height: 24px;
+ padding-left: 30px;
+ margin-left: 4px;
+ cursor: pointer;
+}
+
+span.splcs
+{
+ display:block;
+ line-height: 20px;
+ padding-left: 30px;
+ margin-left: 4px;
+ cursor: pointer;
+}
+
+span.splc
+{
+ width: 17px;
+ height: 17px;
+ float: left;
+ margin-right: 8px;
+ margin-top: 1px;
+}
+
+span.splc1
+{
+ background-position: 0 -24px;
+}
+
+span.splc2
+{
+ background-position: 0 -48px;
+}
+
+span.splc3
+{
+ background-position: 0 -72px;
+}
+
+span.splc4
+{
+ background-position: 0 -96px;
+}
+
+span.splc5
+{
+ background-position: -4px -122px;
+}
+
+span.splc6
+{
+ background-position: -3 -146px;
+}
+
+span.splc7
+{
+ background-position: 0 -168px;
+}
+
+span.splc8
+{
+ background-position: 0 -192px;
+}
+
+span.splc9
+{
+ background-position: 0 -1632px;
+}
+
+span.splc10
+{
+ background-position: 0 -1656px;
+}
+span.splc11
+{
+ background-position: 0 -1680px;
+}
+span.splc12
+{
+ background-position: 0 -1776px;
+}
+
+/* menu bar icons */
+span.spmb
+{
+ display: block;
+ width: 24px;
+ height: 24px;
+ cursor: pointer;
+}
+
+span.spmbi
+{
+ display:block;
+ line-height: 28px;
+ padding-left: 28px;
+ margin-left: 4px;
+ cursor: pointer;
+}
+
+span.spmbf
+{
+ background-position: 0 -216px;
+}
+
+span.spmbp
+{
+ background-position: 0 -240px;
+}
+
+span.spmbn
+{
+ background-position: 0 -264px;
+}
+
+span.spmbl
+{
+ background-position: 0 -288px;
+}
+
+span.spmbu
+{
+ background-position: 0 -1008px;
+}
+
+span.spmbd
+{
+ background-position: 0 -1032px;
+}
+
+span.spmb1
+{
+ margin-left: 6px;
+ background-position: 0 -312px;
+}
+
+span.spmb2
+{
+ background-position: 0 -336px;
+}
+
+span.spmb3
+{
+ width: 1px;
+ background-position: 0 -360px;
+}
+span.spmb4
+{
+ background-position: 0 -1368px;
+}
+span.spmb5
+{
+ background-position: 0 -1392px;
+}
+span.spmb6
+{
+ background-position: 0 -1416px;
+}
+span.spmb7
+{
+ background-position: 0 -116px;
+}
+span.spmb7
+{
+ background-position: 0 -116px;
+}
+span.spmb8
+{
+ background-position: 0 -1438px;
+}
+span.spmb9
+{
+ background-position: 0 -1462px;
+}
+span.spmb10
+{
+ background-position: 0 -1486px;
+}
+span.spmb11
+{
+ background-position: 0 -570px;
+}
+span.spmb12
+{
+ background-position: 0 -1510px;
+}
+span.spmb13
+{
+ background-position: 0 -140px;
+}
+span.spmb14
+{
+ background-position: 0 -1172px;
+}
+span.spmb15
+{
+ background-position: 0 -310px;
+}
+span.spmb16
+{
+ background-position: 0 -334px;
+}
+span.spmb17
+{
+ background-position: 0 -884px;
+}
+span.spmb18
+{
+ background-position: 0 -1534px;
+}
+span.spmb19
+{
+ background-position: 0 -1556px;
+}
+span.spmb20
+{
+ background-position: 0 -1582px;
+}
+span.spmb21
+{
+ background-position: 0 -1752px;
+}
+
+span.rof
+{
+ display: block;
+ float: right;
+}
+
+/*** Priority Radio Button ***/
+
+/* radio button icons */
+span.sprb
+{
+ width: 20px;
+ height: 20px;
+ display: block;
+ float: left;
+ padding-right: .3em;
+ background-position: 0 -384px;
+}
+
+span.prbc
+{
+ background-position: 0 -408px;
+}
+
+/* message list icons */
+span.spml
+{
+ display: block;
+ width: 17px;
+ height: 17px;
+}
+
+span.blank, a.mlstat span.nostar
+{
+ background-position: 0 0;
+}
+
+span.spml1
+{
+ background-position: 0 -456px;
+}
+
+span.spml2
+{
+ background-position: 0 -480px;
+}
+
+span.spml3
+{
+ background-position: 0 -504px;
+}
+
+span.spml4
+{
+ background-position: 0 -528px;
+}
+
+span.spml5
+{
+ background-position: 0 -552px;
+}
+
+span.spml6
+{
+ background-position: 0 -576px;
+}
+
+span.spml7
+{
+ background-position: 0 -600px;
+}
+
+a.mlstat:hover
+{
+ background-position: 0 0;
+}
+
+span.spml8, a.mlstat:hover span.nostar, a.mlstat:hover span.prihi, a.mlstat:hover span.prihier
+{
+ background-position: 0 -624px;
+}
+
+span.spml9, span.star
+{
+ background-position: 0 -648px;
+}
+
+span.spml10, a.mlstat span.prihi
+{
+ background-position: 0 -672px;
+}
+
+span.spml11, a.mlstat span.prihier
+{
+ background-position: 0 -696px;
+}
+
+span.spml12
+{
+ background-position: 0 -720px;
+}
+
+span.spml13
+{
+ background-position: 0 -744px;
+}
+
+/* message view icons */
+span.spmv
+{
+ display: block;
+ width: 15px;
+ height: 15px;
+}
+span.spmv1
+{
+ float: left;
+ background-position: 0 -984px;
+}
+span.spmv2
+{
+ float: left;
+ margin: 0 5px 0 5px;
+ background-position: 0 -576px;
+}
+span.spmv3
+{
+ margin-left: 3px;
+ display: inline-block;
+ background-position: 0 -1704px;
+}
+
+/* folderlist icons */
+span.spfl
+{
+ display:block;
+ height: 18px;
+ width: 18px;
+ margin-left: 4px;
+}
+span.spfl1
+{
+ background-position: 0 -1608px;
+}
+
+ul.priority li
+{
+ width: 10em;
+}
+
+/*** Folder/Contacts List Context Banner ***/
+span.spfcl
+{
+ display: block;
+ width: 20px;
+ height: 20px;
+ float: left;
+ margin-right: 8px;
+ margin-top: 1px;
+ cursor: pointer;
+}
+
+span.spfcl1
+{
+ background-position: 0 -1176px;
+}
+
+span.spfcl2
+{
+ background-position: 0 -1200px;
+}
+
+span.spfcl3
+{
+ background-position: 0 -1728px;
+}
+
+ul.sortList li
+{
+ width: 13em;
+}
+
+div.getAuth div
+{
+ padding: 6px 30px 26px 30px;
+}
+
+div.getAuth span
+{
+ width:40%;
+ display: block;
+ float: left;
+ clear: left;
+ padding-right: 10px;
+ text-align: right;
+}
+
+div.getAuth hr
+{
+ color: #ffffff;
+ background-color: #ffffff;
+ border: 0 none;
+}
+
+div.getAuth input
+{
+ width:50%;
+ display: block;
+ clear: right;
+ width: 12em;
+ text-align: left;
+}
+
+/*** Message Drag Proxy ***/
+#msgDragProxy
+{
+ position: absolute;
+ visibility: hidden;
+ font-size: .7em;
+ top: -100px;
+ cursor: move;
+ filter:alpha(opacity=80);
+ -moz-opacity: 0.8;
+ opacity: 0.8;
+}
+#msgDragProxy div
+{
+ padding: 0 6px;
+ background-color: #d8d8d8;
+ white-space: nowrap;
+}
+.b1, .b2, .b3, .b4
+{
+ background-color: #d8d8d8;
+ font-size: 1px;
+ display:block;
+ overflow:hidden;
+}
+.b1
+{
+ height: 1px;
+ margin: 0 5px;
+}
+.b2
+{
+ height: 1px;
+ margin: 0 3px;
+}
+.b3
+{
+ height: 1px;
+ margin: 0 2px;
+}
+.b4
+{
+ height: 2px;
+ margin: 0 1px;
+}
+
+/*** Take Dialog ***/
+div.takeInstructions
+{
+ padding: 15px 5px 20px 5px;
+ text-align: center;
+}
+
+div.takeList
+{
+ font-size: .8em;
+ height: 14.5em;
+ border: 1px solid #aaaaaa;
+ overflow: auto;
+}
+
+
+/*** PRINTER FORMATTING ***/
+.printInfo
+{
+ display: none;
+}
+
+.fullHdrBtn
+{
+ vertical-align: top;
+ padding-right: 10px;
+ float: right;
+}
+
+@media print
+{
+ #leftColumn,
+ #toolBar,
+ .hdrContent,
+ #hdrLogo,
+ #ftrContent,
+ .toolbarTbl,
+ .fullHdrBtn,
+ .addContact,
+ .spc,
+ div.bannerPrivacy
+ {
+ display: none;
+ }
+ div.printInfo
+ {
+ background-color: grey;
+ border-bottom: 2px groove black;
+ display: block;
+ }
+ div#alpineContent
+ {
+ height: 100% !important;
+ overflow: visible;
+ }
+ table.msgHead
+ {
+ background-color: #f9f9f9;
+ border: 1px solid #aaaaaa;
+ width: 100%;
+ }
+}
diff --git a/web/cgi/alpine/2.0/css/help.css b/web/cgi/alpine/2.0/css/help.css
new file mode 100644
index 00000000..240e5d44
--- /dev/null
+++ b/web/cgi/alpine/2.0/css/help.css
@@ -0,0 +1,119 @@
+/* ========================================================================
+ * Copyright 2006-2008 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+* {
+ font-family: Tahoma, Helvetica, sans-serif;
+ font-size: 1em;
+ text-align: justify;
+}
+tt {
+ font-family: Courier, "Courier New";
+}
+body {
+ background: #fff;
+ font-size: 0.7em;
+ margin: 0.9em;
+}
+#header {
+ height: 4.0em;
+ position: relative;
+}
+#header .logo {
+ background: url(../img/cbn/logo.gif) left center no-repeat;
+ height: 4.0em;
+ width: 230px;
+}
+#header .nav {
+ position: absolute;
+ right: .815em;
+ top: 4.537em;
+}
+#header .nav a {
+ color: #00f;
+ font-weight: bold;
+ text-decoration: none;
+}
+#header .nav a:hover {
+ color: #00f;
+ text-decoration: underline;
+}
+h2 {
+ background: #ccc;
+ border-color: #ddd #999 #999 #ddd;
+ border-style: solid;
+ border-width: 1px;
+ margin: 0 0 .9em 0;
+ padding: .181em .725em;
+}
+dl {
+ margin: 0;
+ padding: 0;
+}
+dt {
+ font-weight: bold;
+ margin: 0 0 0.3em 0;
+}
+dd {
+ border-bottom: dotted 1px #ccc;
+ margin: 0 0 .9em 0;
+ padding-bottom: .9em;
+}
+ul, ol {
+ margin: 0;
+ padding: 0;
+}
+ul.wide li, ol.wide li {
+ margin-top: 1em;
+}
+ul {
+ list-style: square;
+}
+ul li {
+ margin-left: 1.5em;
+}
+ol {
+ list-style: decimal;
+}
+ol li {
+ margin-left: 2.5em;
+}
+a {
+ color: #00f;
+ text-decoration: none;
+}
+a:hover {
+ color: #00f;
+ text-decoration: underline;
+}
+div.also, div.note {
+ border-style: solid;
+ border-width: 1px;
+ padding: .7em;
+}
+div.also {
+ background: #ddd;
+ border-color: #eee #aaa #aaa #eee;
+}
+div.note {
+ background: #ffa;
+ border-color: #eef #aaf #aaf #eef;
+}
+div.note h4, div.also h4 {
+ float: left;
+ margin: 0;
+}
+div.note div {
+ margin-left: 3em;
+}
+div.also ul {
+ margin-left: 5em;
+}
diff --git a/web/cgi/alpine/2.0/css/help_popup.css b/web/cgi/alpine/2.0/css/help_popup.css
new file mode 100644
index 00000000..11be8213
--- /dev/null
+++ b/web/cgi/alpine/2.0/css/help_popup.css
@@ -0,0 +1,114 @@
+/* ========================================================================
+ * Copyright 2006-2008 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+* {
+ font-family: Tahoma, Helvetica, sans-serif;
+ font-size: 1em;
+ text-align: justify;
+}
+tt {
+ font-family: Courier, "Courier New";
+}
+body {
+ background: #fff;
+ font-size: 0.7em;
+ margin: 0.9em;
+}
+#header {
+ height: 0em;
+ position: relative;
+}
+#header .nav {
+ position: absolute;
+ right: .815em;
+ top: 0.3em;
+}
+#header .nav a {
+ color: #00f;
+ font-weight: bold;
+ text-decoration: none;
+}
+#header .nav a:hover {
+ color: #00f;
+ text-decoration: underline;
+}
+h2 {
+ background: #ccc;
+ border-color: #ddd #999 #999 #ddd;
+ border-style: solid;
+ border-width: 1px;
+ margin: 0 0 .9em 0;
+ padding: .181em .725em;
+}
+dl {
+ margin: 0;
+ padding: 0;
+}
+dt {
+ font-weight: bold;
+ margin: 0 0 0.3em 0;
+}
+dd {
+ border-bottom: dotted 1px #ccc;
+ margin: 0 0 .9em 0;
+ padding-bottom: .9em;
+}
+ul, ol {
+ margin: 0;
+ padding: 0;
+}
+ul.wide li, ol.wide li {
+ margin-top: 1em;
+}
+ul {
+ list-style: square;
+}
+ul li {
+ margin-left: 1.5em;
+}
+ol {
+ list-style: decimal;
+}
+ol li {
+ margin-left: 2.5em;
+}
+a {
+ color: #00f;
+ text-decoration: none;
+}
+a:hover {
+ color: #00f;
+ text-decoration: underline;
+}
+div.also, div.note {
+ border-style: solid;
+ border-width: 1px;
+ padding: .7em;
+}
+div.also {
+ background: #ddd;
+ border-color: #eee #aaa #aaa #eee;
+}
+div.note {
+ background: #ffa;
+ border-color: #eef #aaf #aaf #eef;
+}
+div.note h4, div.also h4 {
+ float: left;
+ margin: 0;
+}
+div.note div {
+ margin-left: 3em;
+}
+div.also ul {
+ margin-left: 5em;
+}
diff --git a/web/cgi/alpine/2.0/css/menu.css b/web/cgi/alpine/2.0/css/menu.css
new file mode 100644
index 00000000..ecf01ee6
--- /dev/null
+++ b/web/cgi/alpine/2.0/css/menu.css
@@ -0,0 +1,71 @@
+/* ========================================================================
+ * Copyright 2006-2008 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+.menu a, .menu a:link, .menu a:visited {
+ white-space: nowrap;
+ color: #ffffff;
+ display: block;
+ margin: 0;
+ padding: 0 8px;
+ line-height: 34px;
+ text-decoration: none;
+}
+
+.menu a img
+{
+ border: none;
+ margin: 10px 0;
+}
+
+.menu a span
+{
+ margin-top: 10px;
+}
+
+.menu a:focus, .menu a:hover, .menu a:active {
+ background-color: #555555;
+ color: #ffffff;
+}
+
+.menu li {
+ list-style: none;
+}
+
+.menu li hr {
+ margin: 2px 0;
+}
+
+.menu li:focus ul, .menu li:hover ul, .menu li:active ul, .menu li.sfhover ul {
+ left: auto;
+ top: auto;
+ z-index: 99;
+}
+
+.menu ul {
+ background-color: #333333;
+ left: -999px;
+ top: -999px;
+ margin-left: -1px;
+ position: absolute;
+}
+
+.menu ul li {
+ border: 0 none;
+ clear: left;
+ margin-right: 0;
+}
+
+.menu, .menu ul {
+ color: #ffffff;
+ margin: 0;
+ padding: 0;
+}
diff --git a/web/cgi/alpine/2.0/css/print.css b/web/cgi/alpine/2.0/css/print.css
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/web/cgi/alpine/2.0/css/print.css
diff --git a/web/cgi/alpine/2.0/detach b/web/cgi/alpine/2.0/detach
new file mode 100755
index 00000000..780560cd
--- /dev/null
+++ b/web/cgi/alpine/2.0/detach
@@ -0,0 +1,172 @@
+#!./tclsh
+# $Id: detach 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006-2007 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# detach
+#
+# Purpose: CGI script to retrieve requested attachment
+#
+# Input: PATH_INFO: /<col_number>/<folder_name>/<uid_of__msg>/<part_of_msg>
+# along with possible search parameters:
+set detach_vars {
+ {download "" 0}
+}
+
+#set detach_via_ip_address 1
+#set detach_via_local_hostname 1
+
+# inherit global config
+source ./alpine.tcl
+
+proc WPServerIP {} {
+ global _wp
+
+ catch {
+ set ip 127.0.0.1
+ set sid [socket -async [info hostname] [expr {([string length $_wp(serverport)]) ? $_wp(serverport) : 80}]]
+ set ip [lindex [ fconfigure $sid -sockname ] 0]
+ close $sid
+ }
+
+ return $ip
+}
+
+WPEval $detach_vars {
+ # grok PATH_INFO for collection 'c' and folder 'f' uid 'u' and part 'p'
+ if {!([info exists env(PATH_INFO)] && [string length $env(PATH_INFO)]
+ && [regexp {^/([0-9]+)/(.*)/([0-9]+)/([\.0-9]+)$} $env(PATH_INFO) dummy c f u p])} {
+ WPCmd PEInfo statmsg "Invalid Detach: $env(SCRIPT_NAME)"
+ cgi_exit
+ }
+
+ # generate big random string to reference the thing
+
+ # generate filenames to hold detached data and control file
+ for {set n 0} {1} {incr n} {
+
+ set rhandle [WPCmd PESession random 64]
+ set cfile [file join $_wp(fileroot) $_wp(detachpath) detach.${rhandle}-control]
+ set dfile [file join $_wp(fileroot) $_wp(detachpath) detach.${rhandle}-data]
+
+ if {[file exists $cfile] == 0 && [file exists $dfile] == 0} {
+ if {[catch {open $cfile {RDWR CREAT EXCL} [cgi_tmpfile_permissions]} cfd]} {
+ error [list _action Detach "Cannot create control file: [cgi_quote_html $cfd]" "Please close this window"]
+ } else {
+ exec echo ${rhandle}-control | [file join $_wp(cgipath) $_wp(appdir) whackatch.tcl] >& /dev/null &
+ }
+
+ if {[catch {open $dfile {RDWR CREAT EXCL} [cgi_tmpfile_permissions]} dfd]} {
+ catch {close $cfd}
+ error [list _action Detach "Cannot create command file: [cgi_quote_html $dfd]" "Please close this window"]
+ } else {
+ exec echo ${rhandle}-data | [file join $_wp(cgipath) $_wp(appdir) whackatch.tcl] >& /dev/null &
+ }
+
+ # exec chmod [cgi_tmpfile_permissions] $cfile
+ # exec chmod [cgi_tmpfile_permissions] $dfile
+ break
+ } elseif {$n > 4} {
+ error [list _action Detach "Command file creation limit" "Please close this window"]
+ }
+ }
+
+ if {[catch {WPCmd PEMessage $u detach $p $dfile} attachdata]} {
+ error [list _action Detach $attachdata "Please close this window"]
+ }
+
+ if {[info exists detach_via_ip_address]} {
+ if {[regsub {^(http[s]?://)[A-Za-z0-9\\-\\.]+(.*)$} "[cgi_root]/pub/getach.tcl" "\\1\[[WPServerIP]\]\\2" redirect] != 1} {
+ error [list _action Detach "Cannot determine server address" "Please close this window"]
+ }
+ } elseif {[info exists detach_via_local_hostname]} {
+ if {[regsub {^(http[s]?://)[A-Za-z0-9\\-\\.]+(.*)$} "[cgi_root]/pub/getach.tcl" "\\1\[[info hostname]\]\\2" redirect] != 1} {
+ error [list _action Detach "Cannot determine server address" "Please close this window"]
+ }
+ } else {
+ set redirect "[cgi_root]/pub/getach.tcl"
+ }
+
+ set mimetype [lindex $attachdata 0]
+ set mimesubtype [lindex $attachdata 1]
+ set contentlength [lindex $attachdata 2]
+ set givenname [lindex [lindex $attachdata 3] 0]
+ set tmpfile [lindex $attachdata 4]
+
+ if {[string compare $tmpfile $dfile]} {
+ set straytmp "&straytmp=1"
+ } else {
+ set straytmp ""
+ }
+
+ if {![string length $givenname]} {
+ set givenname "attachment"
+ switch -regexp $mimetype {
+ ^[Tt][Ee][Xx][Tt]$ {
+ switch -regexp $mimesubtype {
+ ^[Pp][Ll][Aa][Ii][Nn]$ {
+ set givenname "attached.txt"
+ }
+ ^[Hh][Tt][Mm][Ll]$ {
+ set givenname "attached.html"
+ }
+ }
+ }
+ }
+ }
+
+ set safegivenname $givenname
+ regsub -all {[/]} $safegivenname {-} safegivenname
+ regsub -all {[ ]} $safegivenname {_} safegivenname
+ regsub -all {[\?]} $safegivenname {X} safegivenname
+ regsub -all {[&]} $safegivenname {X} safegivenname
+ regsub -all {[#]} $safegivenname {X} safegivenname
+ regsub -all {[=]} $safegivenname {X} safegivenname
+ set safegivenname "/[WPPercentQuote $safegivenname {.}]"
+
+ if {$download == 1} {
+ puts $cfd "Content-type: Application/X-Download"
+ puts $cfd "Content-Disposition: attachment; filename=\"$givenname\""
+ } else {
+ puts $cfd "Content-type: ${mimetype}/${mimesubtype}"
+ }
+
+ # side-step the cgi_xxx stuff in this special case because
+ # we don't want to buffer up the downloading attachment...
+
+ puts $cfd "Content-Length: $contentlength"
+ puts $cfd "Expires: [clock format [expr {[clock seconds] + 3600}] -f {%a, %d %b %Y %H:%M:%S GMT} -gmt true]"
+ puts $cfd "Cache-Control: max-age=3600"
+ puts $cfd ""
+
+ puts $cfd $tmpfile
+
+ # exec chmod [cgi_tmpfile_permissions] $tmpfile
+
+ close $cfd
+
+ # prepare to clean up if the brower never redirects
+
+ cgi_http_head {
+ # redirect to the place we stuffed the detach info. use the ip address
+ # to foil spilling any session cookies or the like
+ #cgi_redirect ${redirect}${safegivenname}?h=${rhandle}
+
+ if {[info exists env(SERVER_PROTOCOL)] && [regexp {[Hh][Tt][Tt][PP]/([0-9]+)\.([0-9]+)} $env(SERVER_PROTOCOL) m vmaj vmin] && $vmaj >= 1 && $vmin >= 1} {
+ cgi_puts "Status: 303 Temporary Redirect"
+ } else {
+ cgi_puts "Status: 302 Redirected"
+ }
+
+ cgi_puts "URI: ${redirect}${safegivenname}?h=${rhandle}${straytmp}"
+ cgi_puts "Location: ${redirect}${safegivenname}?h=${rhandle}${straytmp}"
+ }
+}
diff --git a/web/cgi/alpine/2.0/foldercache.tcl b/web/cgi/alpine/2.0/foldercache.tcl
new file mode 100644
index 00000000..a491d5d5
--- /dev/null
+++ b/web/cgi/alpine/2.0/foldercache.tcl
@@ -0,0 +1,177 @@
+# Web Alpine folder cache routines
+# $Id$
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+
+
+
+proc saveDefault {{uid 0}} {
+ # "size" rather than "number" to work around temporary alpined bug
+ if {$uid == 0
+ || [catch {WPCmd PEMessage $uid size} n]
+ || $n == 0
+ || [catch {WPCmd PEMessage $uid savedefault} savedefault]} {
+ if {[WPCmd PEFolder isincoming 0]} {
+ set colid 1
+ } else {
+ set colid 0
+ }
+
+ return [list $colid [lindex [WPCmd PEConfig varget default-saved-msg-folder] 0]]
+ }
+
+ return $savedefault
+}
+
+# add given folder name to the cache of saved-to folders
+proc addSaveCache {f_name} {
+ global _wp
+
+ if {[catch {WPSessionState save_cache} flist] == 0} {
+ if {[set i [lsearch -exact $flist $f_name]] < 0} {
+ set flist [lrange $flist 0 [expr {$_wp(save_cache_max) - 2}]]
+ } else {
+ set flist [lreplace $flist $i $i]
+ }
+
+ set flist [linsert $flist 0 $f_name]
+ } else {
+ set flist [list $f_name]
+ }
+
+ catch {WPSessionState save_cache $flist}
+}
+
+# return the list of cached saved-to folders and make sure given
+# default is somewhere in the list
+proc getSaveCache {{def_name ""}} {
+
+ if {![string length $def_name]} {
+ set savedef [saveDefault 0]
+ set def_name [lindex $savedef 1]
+ }
+
+ set seen ""
+
+ if {[catch {WPSessionState save_cache} flist] == 0} {
+ foreach f $flist {
+ if {[string compare $def_name $f] == 0} {
+ set def_listed 1
+ }
+
+ if {[string length $f] && [lsearch -exact $seen $f] < 0} {
+ lappend options $f
+ lappend options $f
+ lappend seen $f
+ }
+ }
+ }
+
+ if {!([info exists options] && [info exists def_listed])} {
+ lappend options $def_name
+ lappend options $def_name
+ }
+
+ if {[catch {WPCmd set wp_cache_folder} wp_cache_folder]
+ || [string compare $wp_cache_folder [WPCmd PEMailbox mailboxname]]} {
+ # move default to top on new folder
+ switch -- [set x [lsearch -exact $options $def_name]] {
+ 0 { }
+ default {
+ if {$x > 0} {
+ set options [lreplace $options $x [expr {$x + 1}]]
+ }
+
+ set options [linsert $options 0 $def_name]
+ set options [linsert $options 0 $def_name]
+ }
+ }
+
+ catch {WPCmd set wp_cache_folder [WPCmd PEMailbox mailboxname]}
+ }
+
+ return $options
+}
+
+# add given folder name to the visited folder cache
+proc addFolderCache {f_col f_name} {
+ global _wp
+
+ if {$f_col != 0 || [string compare [string tolower $f_name] inbox]} {
+ if {0 == [catch {WPSessionState folder_cache} flist]} {
+
+ if {[catch {WPSessionState left_column_folders} fln]} {
+ set fln $_wp(fldr_cache_def)
+ }
+
+ for {set i 0} {$i < [llength $flist]} {incr i} {
+ set f [lindex $flist $i]
+ if {$f_col == [lindex $f 0] && 0 == [string compare [lindex $f 1] $f_name]} {
+ break
+ }
+ }
+
+ if {$i >= [llength $flist]} {
+ set flist [lrange $flist 0 $fln]
+ } else {
+ set flist [lreplace $flist $i $i]
+ }
+
+ set flist [linsert $flist 0 [list $f_col $f_name]]
+ # let users of data know it's changed (cheaper than hash)
+ WPScriptVersion common 1
+ } else {
+ catch {unset flist}
+ lappend flist [list $f_col $f_name] [list [saveDefault 0]]
+ # ditto
+ WPScriptVersion common 1
+ }
+
+ catch {WPSessionState folder_cache $flist}
+ }
+}
+
+proc removeFolderCache {f_col f_name} {
+ global _wp
+
+ if {$f_col != 0 || [string compare [string tolower $f_name] inbox]} {
+ if {0 == [catch {WPSessionState folder_cache} flist]} {
+
+ if {[catch {WPSessionState left_column_folders} fln]} {
+ set fln $_wp(fldr_cache_def)
+ }
+
+ for {set i 0} {$i < [llength $flist]} {incr i} {
+ set f [lindex $flist $i]
+ if {$f_col == [lindex $f 0] && 0 == [string compare [lindex $f 1] $f_name]} {
+ set flist [lreplace $flist $i $i]
+ WPScriptVersion common 1
+ catch {WPSessionState folder_cache $flist}
+ return
+ }
+ }
+ }
+ }
+}
+
+# return the list of cached visited folders and make sure given
+# default is somewhere in the list
+proc getFolderCache {} {
+ if {[catch {WPSessionState folder_cache} flist]} {
+ catch {unset flist}
+ lappend flist [saveDefault 0]
+ catch {WPSessionState folder_cache $flist}
+ }
+
+ return $flist
+}
+
diff --git a/web/cgi/alpine/2.0/folders b/web/cgi/alpine/2.0/folders
new file mode 100755
index 00000000..e98197ff
--- /dev/null
+++ b/web/cgi/alpine/2.0/folders
@@ -0,0 +1,240 @@
+#!./tclsh
+# $Id: folders 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# view.tcl
+#
+# Purpose: CGI script folders for Web Alpine 2.0 pages
+#
+# Input: PATH_INFO: [/<col_number>]/<folder_name>[/<uid_of_viewed_msg>
+# along with possible search parameters:
+set folders_args {
+}
+
+# inherit global config
+source ./alpine.tcl
+source ./foldercache.tcl
+source ./common.tcl
+
+# TEST
+proc cgi_suffix {args} {
+ return ""
+}
+
+# WHILE TESTING/DEBUGGING
+proc noimp {s} {
+ return "onClick=return noImp('${s}');"
+}
+
+set dmsgs ""
+proc dm {s} {
+ global dmsgs
+
+ lappend dmsgs $s
+}
+
+# default location state
+set c -1
+set f ""
+
+# grok PATH_INFO for collection 'c' and folder 'f'
+if {[info exists env(PATH_INFO)] && [string length $env(PATH_INFO)]} {
+ # look for collection number, c
+ if {[regexp {^/([0-9]+)(/.*)} $env(PATH_INFO) dummy c r]} {
+ if {![string length $r]} {
+ set f $c
+ set c -1
+ }
+ } else {
+ set r $env(PATH_INFO)
+ }
+
+ # look for folder name (f) in remainder, r
+ if {[regexp {^/([^/]+)((/.*)|$)} $r dummy f r]} {
+ # look for uid of page's top message, u
+ if {[regexp {^/([0-9a-fA-F]+)} $r dummy u]} {
+ } else {
+ }
+ } else {
+ if {[string length $r]} {
+ # can't grok, reset context
+ set c -1
+ }
+ }
+}
+
+WPEval $folders_args {
+ # verify current collection/folder
+ if {[catch {WPCmd PEFolder current} curfold]} {
+ error [list _action browse "cannot determine default folder: $curfold"]
+ } else {
+ set curc [lindex $curfold 0]
+ set curf [lindex $curfold 1]
+ }
+
+ # "current" folder's context
+ if {$c < 0} {
+ set c $curc
+ }
+
+ # "current" folder
+ if {0 == [string length $f]} {
+ set f $curf
+ }
+
+ # open a different folder?
+ if {$c != $curc || [string compare $f $curf]} {
+ # BUG: validate $u?
+
+ error [list _action browse "NOT PREPARED TO OPEN NEW FOLDER $f YET"]
+ if {[catch {eval WPCmd PEMailbox open [list $c $f]} reason]} {
+ } else {
+ # STATUS: Opened Folder $f
+ }
+ }
+
+ set defc [WPCmd PEFolder defaultcollection]
+ set cols [WPCmd PEFolder collections]
+
+ set charset "UTF-8"
+ set u 0
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=$charset"
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_content_type "text/html; charset=$charset"
+ cgi_title [wpPageTitle "Folder Management"]
+ cgi_base "href=$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)/"
+ cgi_stylesheet css/menu.css
+ cgi_stylesheet css/cbn/screen.css
+ cgi_stylesheet css/cbn/folders.css
+ # Yahoo Styles
+ cgi_stylesheet $_wp(yui)/build/container/assets/container-core.css
+ cgi_stylesheet $_wp(yui)/build/menu/assets/skins/sam/menu.css
+ cgi_stylesheet $_wp(yui)/build/button/assets/skins/sam/button.css
+ # YahooUI libraries
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/utilities/utilities.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/container/container-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/datasource/datasource-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/menu/menu-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/button/button-min.js" {}
+ # local libraries
+ cgi_script language="JavaScript" src="lib/common.js" {}
+ cgi_script language="JavaScript" src="lib/folders.js" {}
+ cgi_javascript {
+ cgi_puts "YAHOO.alpine.cgi_root = '$_wp(serverpath)';"
+ cgi_puts "YAHOO.alpine.current.incoming = [WPCmd PEFolder isincoming $c];"
+ cgi_puts "YAHOO.alpine.current.c = $c;"
+ cgi_puts "YAHOO.alpine.current.f = \"$f\";"
+ foreach col $cols {
+ regsub {'} [lindex $col 1] {\'} colname
+ lappend colnames "'$colname'"
+ }
+ cgi_puts "YAHOO.alpine.current.u = $u;"
+ cgi_puts "YAHOO.alpine.current.collections = \[[join $colnames {,}]\];"
+ cgi_puts "function bodyOnLoad() {"
+ cgi_puts " initMenus();"
+ cgi_puts " if(YAHOO.env.ua.gecko > 0){ sizeVPHeight(); window.onresize = resizeVPHeight; }"
+ cgi_puts " setCheckMailFunction('gCheck', newMailCheck);"
+ cgi_puts " setNewMailCheckInterval([WPCmd PEInfo inputtimeout]);"
+ cgi_puts " drawFolderList('alpineContent',$defc);"
+ cgi_puts "}"
+
+ # WHILE TESTING/DEBUGGING
+ cgi_puts "var impi = new Array(); function noImp(m){ var sm; if(impi\[m\]) {impi\[m\]++; if(impi\[m\] > 4) sm = '<b>Seriously,</b> ' + m + ' will <b>never</b> get implemented if you keep bothering me!'; else sm = m + ' is <b>still</b> not implemented!'; } else { sm = m + ' is not implemented yet!' ; impi\[m\] = 1 ;} showStatusMessage(sm,3); return false; }"
+
+ cgi_puts "browserDetect();"
+ }
+ }
+
+ cgi_body class=wap "onLoad=bodyOnLoad()" {
+ cgi_puts {<iframe name="formResponse" id="formResponse" src="img/cbn/spritelib.gif"></iframe>}
+ wpCommonPageLayout folders "$c" "$f" "$u" "View and Manage Folders" [list [cgi_cgi "$_wp(appdir)/$_wp(ui2dir)/browse/${c}/${f}"] "Folder List" 0 searchContent('folders','flistFolders')] "" {
+ # CONTEXT COMMANDS
+ cgi_division class=hdrBtns {
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi1" ""][cgi_span "class=hdrBtnText" Print]" "print" "onClick=return printContent()"]
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi2" ""][cgi_span "class=hdrBtnText" Settings]" "settings"]
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi3" ""][cgi_span "class=hdrBtnText" Help]" "javascript:openHelpWindow('folders.html');" class=wap]
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi4" ""][cgi_span "class=hdrBtnText" "Sign out"]" "../../session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=${sessid}"]
+ }
+ } {
+ # TO MENUBAR
+ cgi_anchor_name "toolbar"
+ cgi_table class="toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table class="toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url [cgi_span "class=sp spmbi spmb18" "New Folder"] "#" title="Create new folder in this folder" "onClick=return addFolder();"]
+ }
+ cgi_table_data class="dv1" {
+ cgi_puts [cgi_img "img/cbn/div.gif" class=wap]
+ }
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url [cgi_span "class=sp spmbi spmb19" "View Messages"] "#" title="View Messages in selected folder" id=butChoose "onClick=return doOpen();"]
+ }
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url [cgi_span "class=sp spmbi spmb7" "Delete"] "#" title="Delete selected folder" "onClick=return queryDelete();"]
+ }
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url [cgi_span "class=sp spmbi spmb20" "Rename"] "#" title="Rename selected folder" "onClick=return renameFolder();"]
+ }
+ cgi_table_data class="dv1" {
+ cgi_puts [cgi_img "img/cbn/div.gif" class=wap]
+ }
+ cgi_table_data class=wap {
+ cgi_bullet_list class="menu" {
+ cgi_put "<li class=\"menuHdr\">[cgi_url "More Actions [cgi_img "img/cbn/menu.gif" class="wap menuDn menuImg"]" "#" "onClick=this.blur(); return false;"]<div>"
+ cgi_bullet_list {
+ cgi_li [cgi_url "Import Email into Folder" "#" "onClick=return importFolder();"]
+ cgi_li [cgi_url "Export Email from Folder" "#" "onClick=return exportFolder();"]
+ }
+ cgi_puts "</div></li>"
+ }
+ }
+ cgi_table_data width="100%" {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ } {
+ cgi_puts "Loading..."
+ } {
+ # BOTTOM MENUBAR
+ cgi_table class="wap toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody><tr><td>&nbsp;</td></tr></tbody>"
+ }
+ }
+
+ cgi_text "pickFolderCollection=$defc" type=hidden id=pickFolderCollection notab
+ cgi_text "pickFolderPath=" type=hidden id=pickFolderPath notab
+ cgi_text "pickFolderName=" type=hidden id=pickFolderName notab
+
+ # any debugging info to insert?
+ foreach dmsg $dmsgs {
+ cgi_html_comment "DEBUG: $dmsg"
+ cgi_puts ""
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/2.0/forward b/web/cgi/alpine/2.0/forward
new file mode 120000
index 00000000..872d4cb2
--- /dev/null
+++ b/web/cgi/alpine/2.0/forward
@@ -0,0 +1 @@
+compose \ No newline at end of file
diff --git a/web/cgi/alpine/2.0/help/alpha-index.html b/web/cgi/alpine/2.0/help/alpha-index.html
new file mode 100644
index 00000000..40380c77
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/alpha-index.html
@@ -0,0 +1,225 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
+<link type="text/css" rel="stylesheet" href="../css/help.css">
+<title>Alpine Help Index</title></head>
+<body>
+<div id="header">
+ <div class="logo"> </div>
+ <div class="nav"><a href="topic-list.html">All Help Topics</a> &nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:history.back()">Go Back</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:self.close();">Close</a></div>
+</div>
+
+<div id="content">
+
+<h2>Alpine Help Index</h2>
+
+<div class="noprint"><a href="#A">A</a> <a href="#B">B</a> <a href="#C">C</a>
+<a href="#D">D</a> <a href="#E">E</a> <a href="#F">F</a> <a href="#G">G</a> <a href="#H">H</a> <a href="#I">I</a> <a href="#L">L</a> <a href="#M">M</a> <a href="#N">N</a> <a href="#O">O</a> <a href="#P">P</a> <a href="#Q">Q</a> <a href="#R">R</a> <a href="#S">S</a> <a href="#T">T</a> <a href="#U">U</a> <a href="#W">W</a> <a href="#X">X</a> <a href="#Y">Y</a> <a href="#Z">Z</a></div>
+
+<p><strong><a name="A" id="A"></a>A</strong></p>
+<p>address book, see <a href="contacts.html">Contacts</a></p>
+<p><a href="settings.html#msgview">addresses as links</a> (Settings)</p>
+<p><a href="settings.html#personal">Alternate Addresses</a> (Settings)</p>
+<p><a href="settings.html#msgview">Anti-phishing option</a> (Settings)</p>
+<p><a href="settings.html#fcc">archive sent mail</a> (Settings)</p>
+<p>attachments</p>
+<ul>
+ <li><a href="settings.html#reply">including in replies</a> (Settings)</li>
+ <li><a href="compose.html#attachments">including with messages</a></li>
+ <li><a href="read.html#attachments">viewing and downloading</a></li>
+</ul>
+
+<p><strong><a name="B" id="B"></a>B</strong></p>
+
+<p><strong><a name="C" id="C"></a>C</strong></p>
+<p><a href="settings.html#compose">compose encoding</a> (Settings)</p>
+
+<p><a href="compose.html">Compose</a> (sending mail)</p>
+<ul>
+ <li><a href="compose.html#attachments">attachments</a></li>
+ <li><a href="compose.html#autosave">automatic saves</a></li>
+ <li><a href="settings.html#compose">Compose Headers</a> (Settings)</li>
+ <li><a href="compose.html#headers">headers</a></li>
+ <li><a href="compose.html#resuming">resuming drafts</a></li>
+ <li><a href="compose.html#sending">saving drafts</a></li>
+ <li><a href="compose.html#sending">sending</a></li>
+ <li><a href="compose.html#writing">writing messages</a></li>
+</ul>
+
+<p><a href="contacts.html">Contacts</a> (address book)</p>
+<ul>
+ <li><a href="contacts.html#add">adding</a></li>
+ <li><a href="contacts.html#edit">editing</a></li>
+ <li><a href="contacts.html#group">group contacts</a></li>
+ <li><a href="contacts.html#remove">removing</a></li>
+</ul>
+
+<p><a href="settings.html#compose">Custom Headers</a> (Settings)</p>
+<p><a href="settings.html">customizing Alpine</a></p>
+
+<p><strong><a name="D" id="D"></a>D</strong></p>
+<p><a href="inbox.html#delete">deleting messages</a></p>
+<p><a href="settings.html#dirservers">Directory Server</a> (Settings)</p>
+<p><a href="settings.html#display">Display</a> (Settings)</p>
+<p><a href="settings.html#msgview">Display Deaders</a> (Settings)</p>
+<p><a href="settings.html#personal">Display Name</a> (Settings)</p>
+<p><a href="settings.html#foldernames">Draft Folder</a> (Settings)</p>
+<p><a href="inbox.html#drag">drag and drop shortcuts</a></p>
+
+<p><strong><a name="E" id="E"></a>E</strong></p>
+<p><a href="settings.html#personal">Email Signature</a> (Settings)</p>
+<p><a href="quick-start.html#trash">Emptying trash</a> (how to)</p>
+<p><a href="settings.html#foldernames">Emptying Trash</a> (Settings)</p>
+<p><a href="settings.html#compose">Encoding of outgoing messages</a> (Settings)</p>
+
+<p><strong><a name="F" id="F"></a>F</strong></p>
+<p><a href="settings.html#fcc">Fcc (sent mail folder)</a> (Settings)</p>
+<p><a href="settings.html#compose">Flowed Text Handling</a> (Settings)</p>
+
+<p><a href="folders.html">Folders</a></p>
+<ul>
+ <li><a href="folders.html#add">adding</a></li>
+ <li><a href="folders.html#delete">deleting</a></li>
+ <li><a href="folders.html#rename">renaming</a></li>
+ <li><a href="folders.html#route">routing mail to</a></li>
+ <li><a href="inbox.html#folder">saving messages to</a></li>
+ <li><a href="settings.html#folders">settings</a></li>
+ <li><a href="folders.html#view">viewing a list of</a></li>
+ <li><a href="folders.html#viewing">viewing messages in</a></li>
+</ul>
+
+<p><a href="read.html#forward">forwarding mail</a></p>
+<p><a href="settings.html#forward">forwarding options</a> (Settings)</p>
+
+<p><strong><a name="G" id="G"></a>G</strong></p>
+
+<p><strong><a name="H" id="H"></a>H</strong></p>
+<p><a href="compose.html#headers">headers</a> (for sending mail)</p>
+<p><a href="read.html#full">headers, full</a> (in received messages)</p>
+<p><a href="settings.html#reply">headers in replies</a> (Settings)</p>
+<p><a href="settings.html#newsweather">Headline News</a> (Settings)</p>
+
+<p><strong><a name="I" id="I"></a>I</strong></p>
+<p><a href="settings.html#mailservers">Inbox Server</a> (Settings)</p>
+<p><a href="inbox.html#icons">index icons</a></p>
+
+<p><strong><a name="J" id="J"></a>J</strong></p>
+
+<p><strong><a name="K" id="K"></a>K</strong></p>
+
+<p><strong><a name="L" id="L"></a>L</strong></p>
+<p><a href="settings.html#dirservers">LDAP Server</a> (Settings)</p>
+<p><a href="settings.html#display">lines per page in index</a> (Settings)</p>
+<p><a href="settings.html#msgview">links, display</a> (Settings)</p>
+
+<p><strong><a name="M" id="M"></a>M</strong></p>
+<p><a href="inbox.html#stars">marking messages with a star</a></p>
+<p><a href="settings.html#compose">Message Encoding</a> (Settings)</p>
+
+<p><strong><a name="N" id="N"></a>N</strong></p>
+<p><a href="quick-start.html#check">new mail check</a></p>
+<p><a href="settings.html#newsweather">news</a> (Settings)</p>
+
+<p><strong><a name="O" id="O"></a>O</strong></p>
+
+<p><strong><a name="P" id="P"></a>P</strong></p>
+<p><a href="settings.html#personal">personal name</a> (Settings)</p>
+<p>preferences, see <a href="settings.html">Settings</a></p>
+
+<p><strong><a name="Q" id="Q"></a>Q</strong></p>
+<p><a href="quick-start.html">Quick Start</a></p>
+
+<p><strong><a name="R" id="R"></a>R</strong></p>
+<p><a href="read.html">reading mail</a></p>
+<ul>
+ <li><a href="read.html#contacts">adding contacts</a></li>
+ <li><a href="read.html#delete">deleting</a></li>
+ <li><a href="read.html#header">displaying full headers</a></li>
+ <li><a href="read.html#forward">forwarding</a></li>
+ <li><a href="inbox.html#stars">marking with stars</a></li>
+ <li><a href="read.html#print">printing</a></li>
+ <li><a href="read.html#reply">replying</a></li>
+ <li><a href="inbox.html#spam">reporting a message as spam</a></li>
+ <li><a href="read.html#folder">saving to a folder</a></li>
+ <li><a href="inbox.html#sort">sorting</a></li>
+ <li><a href="read.html#view">viewing a message</a></li>
+ <li><a href="read.html#attachments">viewing and downloading attachments</a></li>
+</ul>
+
+<p><a href="settings.html#msglist">read messages, automove </a> (Settings)</p>
+<p><a href="settings.html#folders">recent folders displayed</a> (Settings)</p>
+<p><a href="read.html#reply">replying</a></p>
+<p><a href="settings.html#compose">Reply intro string</a> (Settings)</p>
+<p><a href="settings.html#reply">Reply Options</a> (Settings)</p>
+<p><a href="settings.html#compose">Reply prefix</a> (Settings)</p>
+<p><a href="settings.html#msgview">Rich Text Display</a> (Settings)</p>
+
+<p><strong><a name="S" id="S"></a>S</strong></p>
+<p><a href="inbox.html#folder">saving messages to a folder</a></p>
+<p><a href="settings.html#save">Save Sent</a> (Settings)</p>
+<p><a href="compose.html">sending mail</a></p>
+<p><a href="search.html">Search</a></p>
+<ul>
+ <li><a href="search.html#inbox">Basic Index Search</a></li>
+ <li><a href="search.html#advanced">Advanced Index Search</a></li>
+ <li><a href="search.html#example">Example</a></li>
+ <li><a href="search.html#other">searching Contacts and Folder List</a></li>
+</ul>
+
+<p><a href="settings.html">Settings</a></p>
+<ul>
+ <li><a href="settings.html#compose">Compose</a></li>
+ <li><a href="settings.html#dirservers">Directory Servers</a></li>
+ <li><a href="settings.html#folders">Folders</a></li>
+ <li><a href="settings.html#foldernames">Folder Names</a></li>
+ <li><a href="settings.html#forward">Forwarding options</a></li>
+ <li><a href="settings.html#mailservers">Mail Servers</a></li>
+ <li><a href="settings.html#display">Message Display</a></li>
+ <li><a href="settings.html#msglist">Message List</a></li>
+ <li><a href="settings.html#msgview">Message View</a></li>
+ <li><a href="settings.html#newsweather">News and Weather</a></li>
+ <li><a href="settings.html#personal">Personal preferences</a></li>
+ <li><a href="settings.html#reply">Reply Options</a></li>
+ <li><a href="settings.html#fcc">Sent Message Options</a></li>
+</ul>
+
+<p><a href="settings.html#fcc">Sent mail folder</a> (Settings)</p>
+<p><a href="settings.html#personal">signature content</a> (Settings)</p>
+<p><a href="settings.html#reply">signature options</a> (Settings)</p>
+<p><a href="settings.html#mailservers">SMTP Server</a> (Settings)</p>
+<p><a href="inbox.html#spam">spam</a> (reporting)</p>
+<p><a href="settings.html#msglist">Sort Order, default</a> (Settings)</p>
+<p><a href="inbox.html#sort">sorting message index</a></p>
+<p><a href="inbox.html#stars">star</a></p>
+<p><a href="settings.html#msglist">Start display at</a> (Settings)</p>
+
+<p><strong><a name="T" id="T"></a>T</strong></p>
+<p>trash</p>
+<ul>
+ <li><a href="quick-start.html#trash">emptying, deleting, and recovering</a> (how to)</li>
+ <li><a href="inbox.html#trash">Emptying</a></li>
+ <li><a href="settings.html#foldernames">Trash Folder</a> (Settings)</li>
+</ul>
+
+<p><strong><a name="U" id="U"></a>U</strong></p>
+<p><a href="settings.html#msgview">URLs as links</a> (Settings)</p>
+
+<p><strong><a name="V" id="V"></a>V</strong></p>
+<p><a href="inbox.html#view">viewing messages</a></p>
+
+<p><strong><a name="W" id="W"></a>W</strong></p>
+<p><a href="settings.html#newsweather">Weather Bar</a> (Settings)</p>
+<p><a href="settings.html#msgview">web hostnames as links</a> (Settings)</p>
+<p><a href="settings.html#display">Wrap Plain Text column</a> (Settings)</p>
+
+<p><strong><a name="X" id="X"></a>X</strong></p>
+
+<p><strong><a name="Y" id="Y"></a>Y</strong></p>
+
+<p><strong><a name="Z" id="Z"></a>Z</strong></p>
+
+<p>&nbsp;</p>
+</div>
+</body>
+</html>
diff --git a/web/cgi/alpine/2.0/help/compose.html b/web/cgi/alpine/2.0/help/compose.html
new file mode 100644
index 00000000..6a2b7f78
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/compose.html
@@ -0,0 +1,102 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
+<link type="text/css" rel="stylesheet" href="../css/help.css">
+<title>Compose: sending mail</title>
+</head>
+<body>
+<div id="header">
+ <div class="logo"> </div>
+ <div class="nav"><a href="topic-list.html">All Help Topics</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="alpha-index.html">Index</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="javascript:self.close();">Close</a></div>
+</div>
+<div id="content">
+
+
+
+<h2>Compose: sending mail</h2>
+
+<ul>
+ <li><a href="#writing">Writing messages</a></li>
+ <li><a href="#attachments">Including attachments</a></li>
+ <li><a href="#sending">Sending, canceling, and saving drafts</a></li>
+ <li><a href="#resuming">Resuming drafts</a></li>
+ <li><a href="#headers">Headers</a></li>
+ <li><a href="#autosave">Automatic saves</a></li>
+</ul>
+
+<p>The <strong>Compose</strong> screen is where you write and send messages. The <strong>Compose</strong> screen is divided into two sections:</p>
+<ul>
+ <li>The <em>header</em> section is at the top. You use the header section to address the mail and control the text format.</li>
+ <li>The <em>message</em> section is below the header. The message section is where you enter and format the message text.</li>
+<br /><br /></ul>
+<h2><a name="writing" id="writing"></a>Writing messages</h2>
+
+<ol>
+ <li>On the menu bar, click <strong>Compose</strong> (or <strong>Reply</strong> or <strong>Forward</strong>).</li>
+ <li>In the header section, enter the addressing information. By default, the headers displayed are the <strong>To</strong>, <strong>Cc</strong>, and <strong>Subject</strong> fields. For information on displaying more header fields, see <a href="#headers">Headers</a>.</li>
+ <li>To enter rich-text click on <strong>Rich Text</strong> to the right of the Subject header. Click <strong>Plain Text</strong> to toggle this back to plain text.</li>
+ <li>In the message section, enter your message text. If you are entering Rich Text, a <em>formatting toolbar</em> at the top of the message section allows you to apply rich-text formatting to message text. You can also insert links and graphics using the formatting toolbar.</li>
+ <li>If desired, you can mark your message with a priority level. On the menu bar, point to <strong>Priority</strong>, and then select the level that you want for this message.</li>
+<br /><br /></ol>
+<h2><a name="attachments" id="attachments"></a>Including attachments</h2>
+<ol>
+ <li>On the menu bar, click <strong>Attach File</strong>.</li>
+ <li>Enter the path and file name for the file that you want to attach, or click <strong>Browse</strong> to browse for the file and select it.</li>
+<br /><br /></ol>
+<h2><a name="sending" id="sending"></a>Sending, canceling, and saving drafts</h2>
+
+<p><strong>To send mail</strong></p>
+<ul>
+ <li>On the menu bar, click <strong>Send</strong>.</li>
+</ul>
+
+<p><strong>To cancel an editing session</strong></p>
+<ol>
+ <li>On the menu bar, click <strong>Cancel</strong>, or click any item in the left pane, such as your <strong>Inbox</strong>.</li>
+ <li>Click <strong>Discard</strong> to confirm. The <strong>Compose</strong> screen closes and your <strong>Inbox</strong> appears.</li>
+</ol>
+<p><strong>To save a draft of a message</strong></p>
+<ul>
+ <li>On the menu bar, click <strong>Save Draft</strong>. A copy of the message is saved to the Drafts folder. The <strong>Compose</strong> screen closes and you are returned to the screen that was displayed before the editing session began.</li><br /><br />
+</ul>
+<div class="note">
+<h4>Note:</h4>
+<div> If you open a previously saved draft, make more changes, and then cancel the editing session and discard changes, the entire draft is deleted, not just the most recent changes. </div>
+</div>
+
+<br /><br />
+<h2><a name="resuming" id="resuming"></a>Resuming drafts</h2>
+<p>To resume editing a draft message that you previously saved go to the <strong>Drafts</strong> folder by clicking on <strong>Drafts</strong> in the left pane. Find the message you want to resume in the list and click on its Subject to resume composing.
+<h2><a name="headers" id="headers"></a>Headers</h2>
+<p> The header section is where you enter addressing information. By default, the header displays the <strong>To</strong>, <strong>Cc</strong>, and <strong>Subject</strong> fields. </p>
+<p><strong>To display all headers</strong></p>
+<ul>
+ <li>To the right of the <strong>To</strong> field, click <strong>More Headers</strong>.</li>
+</ul>
+<p><strong>To display only the default headers</strong></p>
+<ul>
+ <li>To the right of the <strong>To</strong> field, click <strong>Fewer Headers</strong>.</li>
+</ul>
+<h3>Header fields</h3>
+<p>The following header fields are available:</p>
+<ul>
+ <li><strong>To.</strong> Use this field to specify email recipients:
+ <ul>
+ <li> Type the full email address of the recipient. Separate multiple addresses with commas.</li>
+ <li> Type a name or nickname specified in your contact list and click. Alpine expands the name or nickname to the full address. Separate multiple addresses with commas.</li>
+ <li>Click <strong>To</strong> to display to your contact list and select an address or to select an address from the directory server.</li>
+ </ul>
+ </li>
+ <li><strong>Attachments.</strong> Lists any files that have been attached to the message.</li>
+ <li> <strong>Subject.</strong> Enter a brief phrase describing the topic of the message. </li>
+ <li><strong>Cc</strong> (Carbon copy). Similar to the <strong>To</strong> field. Enter one or more addresses to receive a copy of the message. These addresses are seen by all message recipients.</li>
+ <li> <strong>Bcc</strong> (Blind carbon copy). Similar to the <strong>To</strong> and <strong>Cc</strong> fields. Enter one or more addresses to receive a copy of the message. The Bcc header does not show up in the sent mail so these addresses are hidden from other recipients.</li>
+ <li><strong>Fcc</strong> (File carbon copy). Specifies a folder to which a copy of your outgoing message is saved. You can control whether messages are saved with or without attachments. For more information, see <a href="settings.html#fcc">Settings</a>.</li>
+<br /><br /></ul>
+
+<h2><a name="autosave" id="autosave"></a>Automatic saves</h2>
+<p>Alpine saves a draft every 5 minutes, overwriting the draft each time, so that only the most recent saved version is preserved. </p>
+</div>
+</body>
+</html>
diff --git a/web/cgi/alpine/2.0/help/contacts.html b/web/cgi/alpine/2.0/help/contacts.html
new file mode 100644
index 00000000..690dd76c
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/contacts.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
+<link type="text/css" rel="stylesheet" href="../css/help.css">
+<title>Contacts: your address book</title>
+</head>
+<body>
+<div id="header">
+ <div class="logo"> </div>
+ <div class="nav"><a href="topic-list.html">All Help Topics</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="alpha-index.html">Index</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="javascript:self.close();">Close</a></div>
+</div>
+<div id="content">
+
+<h1>Contacts: your address book</h1>
+
+<ul>
+ <li><a href="#add">Adding a contact</a></li>
+ <li><a href="#remove">Removing a contact</a></li>
+ <li><a href="#edit">Editing a contact</a></li>
+ <li><a href="#group">Creating a group contact</a></li>
+<br /><br /></ul>
+
+<p>Contacts allow you to store names, email addresses, and other information in a contact list, which serves as an address book. You can quickly send mail to a contact by retreiving information from your contact list.</p>
+
+<h2><a name="add" id="add"></a>Adding a contact</h2>
+
+<p><strong>To add a contact</strong></p>
+<ol>
+ <li>In the left pane, click <strong>Contacts</strong>. Your contact list appears in the right pane.</li>
+ <li>On the menu bar, click <strong>New Contact</strong>.</li>
+ <li>Fill in the contact information:</li>
+ <ul>
+ <li><strong>Nickname.</strong> A short name that you can use for quick addressing. If you type the nickname instead of the full display name or email address, Alpine will offer a list of matching choices from your contacts list and the University of Washington directory. You can select the contact from the list.</li>
+ <li><strong>Display Name.</strong> The name that appears in the message header.</li>
+ <li><strong>Email.</strong> The contact's email address.</li>
+ <li><strong>Notes.</strong> Any text you want. Used only by you.</li>
+ <li><strong>Fcc Folder.</strong> A folder that will receive copies of all messages that you send directly to this contact.</li>
+ </ul>
+ <li>Click <strong>Add</strong>.</li>
+<br /><br /></ol>
+<p><strong>To add a contact from a message</strong></p>
+<ul>
+<li>Drag the contact's email address from the<strong> From</strong> field to the <strong>Contacts</strong> folder.
+<p><em>or</em></p></li>
+<li>To the right of the <strong>From</strong> field, click <strong>Add</strong>.</li>
+<br /><br /></ul>
+<p><strong>To add multiple contacts from a message</strong></p>
+<ul>
+ <li>On the menu bar, click <strong>More Actions</strong>, and then select <strong>Extract</strong>. Alpine extracts everything in the message that is in the format of an email address and presents a list of contacts. You can confirm each contact.</li>
+<br /><br /></ul>
+<h2><a name="remove" id="remove"></a>Removing a contact</h2>
+<ol>
+ <li>In the left pane, click <strong>Contacts</strong>. Your contact list appears in the right pane.</li>
+ <li>Select the contacts you wish to remove by checking the boxes to the left of the Display Names.</li>
+ <li>On the menu bar, click <strong>Delete</strong>.</li>
+ <li>Confirm that you want to <strong>Delete</strong> the contacts <strong>Forever</strong>.</li>
+<br /><br /></ol>
+
+<h2><a name="edit" id="edit"></a>Editing a contact</h2>
+
+<p><strong>To edit a contact</strong></p>
+<ol>
+ <li>In the left pane, click <strong>Contacts</strong>. Your contact list appears in the right pane.</li>
+ <li>Click on the <strong>Display Name</strong> to edit the corresponding entry.</li>
+<br /><br /></ol>
+
+<h2><a name="group" id="group"></a>Creating a group contact</h2>
+<p>A group contact is simply a contact with more than one email address.</p>
+<p><strong>To add a group contact</strong></p>
+<ol>
+ <li>In the left pane, click <strong>Contacts</strong>. Your contact list appears in the right pane.</li>
+ <li>On the menu bar, click <strong>New Group</strong>.</li>
+ <li>Fill in the contact information like you would for a regular contact, except</li>
+ <li><strong>Group Email.</strong> Enter all of the addresses or nicknames separated by commas.</li>
+ <li>Click <strong>Add</strong>.</li>
+<br /><br /></ol>
+</div>
+</body>
+</html>
diff --git a/web/cgi/alpine/2.0/help/folders.html b/web/cgi/alpine/2.0/help/folders.html
new file mode 100644
index 00000000..dc05df0b
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/folders.html
@@ -0,0 +1,96 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
+<link type="text/css" rel="stylesheet" href="../css/help.css">
+<title>Folders: organizing your mail</title>
+</head>
+<body>
+<div id="header">
+ <div class="logo"> </div>
+ <div class="nav"><a href="topic-list.html">All Help Topics</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="alpha-index.html">Index</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="javascript:self.close();">Close</a></div>
+</div>
+<div id="content">
+
+<h2>Folders: organizing your mail</h2>
+
+<ul>
+ <li><a href="#view">Viewing your list of folders</a></li>
+ <li><a href="#viewing">Viewing the messages in a folder</a></li>
+ <li><a href="#add">Adding folders</a></li>
+ <li><a href="#delete">Deleting folders</a></li>
+ <li><a href="#rename">Renaming folders</a></li>
+ <li><a href="#route">Routing mail to folders</a></li>
+</ul>
+
+<p>You can organize your mail into folders. Folders are displayed in the left pane. Some folders are provided by default:</p>
+<ul>
+ <li><strong>Inbox.</strong> Stores and displays your mail messages when they arrive, unless you have routed messages to another folder. You can drag and drop messages from the Inbox to other folders.</li>
+ <li><strong>Drafts.</strong> Stores any messages that have been saved during an editing session.</li>
+ <li><strong>Sent.</strong> By default, stores copies of all of your sent mail.</li>
+ <li><strong>Junk.</strong> Stores messages that have been caught by spam filtering and messages that you add by clicking <strong>Report Spam</strong> on the menu bar. On a weekly basis, Alpine deletes everything in the Junk folder that is dated before the previous week.</li>
+ <li><strong>Trash.</strong> Stores deleted messages, where thay can be recovered until they are permanently removed. For more information, see <a href="quick-start.html#trash">Trash</a>.</li>
+ <li><strong>Recent Folders.</strong> This is a listing of the folders that you have opened recently. You can set the number of recent folders displayed in the left pane. For more information, see <a href="settings.html#folders">Settings</a>.<br />
+ </li><br />
+ </ul>
+<div class="note">
+<h4>Note:</h4>
+<div> When viewed in the folder list displayed by clicking <strong>View/Manage Folders</strong>, the default folders named Junk and Sent in the left pane appear under the names sent-mail and junk-mail.</div>
+</div>
+
+<br />
+
+<h2><a name="view" id="view"></a>Viewing your list of folders</h2>
+<ul>
+ <li>In the left pane, click <strong>View/Manage Folders</strong>. A list of your folders appears in the right pane.</li><br /><br />
+</ul>
+<h2><a name="viewing" id="viewing"></a>Viewing the messages in a folder</h2>
+<p><strong>To view the messages contained in a folder</strong></p>
+<ol>
+ <li>In the left pane, click <strong>View/Manage Folders</strong>. A list of your folders appears in the right pane.</li>
+ <li>Select the folder that you want to view by clicking its name. On the menu bar, click <strong>View Messages</strong>.</li>
+ <li>Alternatively, double click the folder name.</li>
+<br /><br /></ol>
+<h2><a name="add" id="add"></a>Adding folders</h2>
+<ol>
+ <li>In the left pane, click <strong>View/Manage Folders</strong>. A list of your folders appears in the right pane.</li>
+ <li>On the menu bar, click <strong>New Folder</strong>.</li>
+ <li>Enter a name for the new folder and click <strong>New Folder</strong>. If you want this new folder to be a subfolder within an existing folder, enter the name of the parent folder, followed by a slash ( / ), followed by the new folder name. For example, <strong>subdir/foldername</strong>.</li>
+ <li>The new folder appears in the list.</li>
+<br /><br /></ol>
+<h2><a name="delete" id="delete"></a>Deleting folders</h2>
+<div class="note">
+<h4>Note:</h4>
+<div>Unlike deleted <strong>messages</strong>, deleted <strong>folders</strong> are not moved to the Trash, and they cannot be retrieved.</div>
+</div>
+<p><strong>To delete a folder</strong></p>
+<ol>
+ <li>In the left pane, click <strong>View/Manage Folders</strong>. A list of your folders appears in the right pane.</li>
+ <li>Click the folder that you want to delete. On the menu bar, click <strong>Delete</strong>.</li>
+ <li>Click <strong>Delete Forever</strong> to confirm.</li>
+<br /><br /></ol>
+<h2><a name="rename" id="rename"></a>Renaming folders</h2>
+
+<ol>
+ <li>In the left pane, click <strong>View/Manage Folders</strong>. A list of your folders appears in the right pane.</li>
+ <li>Click the folder that you want to rename. On the menu bar, click <strong>Rename</strong>.</li>
+ <li>Enter the new name.</li>
+ <li>Click <strong>Rename Folder</strong> to confirm.</li>
+<br /><br /></ol>
+
+<h2><a name="route" id="route"></a>Routing mail to folders</h2>
+
+<p>You can set up Alpine to route incoming and outgoing messages to designated folders.</p>
+<p><strong>To route a copy of an outgoing message to a folder</strong></p>
+<ul>
+ <li>Enter the folder name in the <strong>Fcc</strong> field in the composer.</li>
+</ul>
+
+<p><strong>To route incoming messages to a folder</strong></p>
+<ul>
+ <li>See <a href="settings.html">Settings</a>. </li>
+<br /><br /></ul>
+
+</div>
+</body>
+</html>
diff --git a/web/cgi/alpine/2.0/help/graphics/attach_sm.gif b/web/cgi/alpine/2.0/help/graphics/attach_sm.gif
new file mode 100644
index 00000000..cdf108cc
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/graphics/attach_sm.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/help/graphics/compose.gif b/web/cgi/alpine/2.0/help/graphics/compose.gif
new file mode 100644
index 00000000..608eb4fb
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/graphics/compose.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/help/graphics/fwd.gif b/web/cgi/alpine/2.0/help/graphics/fwd.gif
new file mode 100644
index 00000000..546ff6a3
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/graphics/fwd.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/help/graphics/new.gif b/web/cgi/alpine/2.0/help/graphics/new.gif
new file mode 100644
index 00000000..abc16be0
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/graphics/new.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/help/graphics/parts.gif b/web/cgi/alpine/2.0/help/graphics/parts.gif
new file mode 100644
index 00000000..90fbb390
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/graphics/parts.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/help/graphics/replied.gif b/web/cgi/alpine/2.0/help/graphics/replied.gif
new file mode 100644
index 00000000..8ff06835
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/graphics/replied.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/help/graphics/replied_and_fwd.gif b/web/cgi/alpine/2.0/help/graphics/replied_and_fwd.gif
new file mode 100644
index 00000000..b3dd5a1b
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/graphics/replied_and_fwd.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/help/graphics/screen-header.gif b/web/cgi/alpine/2.0/help/graphics/screen-header.gif
new file mode 100644
index 00000000..f8c95dee
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/graphics/screen-header.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/help/graphics/star.gif b/web/cgi/alpine/2.0/help/graphics/star.gif
new file mode 100644
index 00000000..5a89f298
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/graphics/star.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/help/help_home.htm b/web/cgi/alpine/2.0/help/help_home.htm
new file mode 100644
index 00000000..559591a1
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/help_home.htm
@@ -0,0 +1,46 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
+<link type="text/css" rel="stylesheet" href="../css/help.css">
+<title>Help: WebMail</title>
+</head>
+<body>
+<div id="header">
+ <div class="logo"> </div>
+ <div class="nav"><a href="help_index.htm">Index</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="javascript:self.close();">Close</a></div>
+</div>
+<div id="content">
+ <h2>WebMail Help</h2>
+ <dl>
+ <dd>Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonnumy nibh eeuismod tempor inci dunt ut labore et dolore magna ali quam erat volupat. <br>
+ <br>
+ <div class="note">
+ <h4>Note</h4>
+ <div>Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonnumy nibh eeuismod tempor inci dunt ut labore et dolore magna ali quam erat volupat.</div>
+ </div>
+ </dd>
+ <dt>Message List (e.g. INBOX)</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ <dt>Folders</dt>
+ <dd>Con sectetuer adipiscing elit, sed diam nonnumy nibh.</dd>
+ <dt>Compose</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ <dt>Print</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ <dt>Search</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ <dt>News and Weather</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ </dl>
+</div>
+<div class="also">
+ <h4>See also</h4>
+ <ul>
+ <li><a href="#">View/Manage Folders</a></li>
+ <li><a href="#">Contacts</a></li>
+ <li><a href="#">Settings</a></li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/web/cgi/alpine/2.0/help/help_index.htm b/web/cgi/alpine/2.0/help/help_index.htm
new file mode 100644
index 00000000..ee694f73
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/help_index.htm
@@ -0,0 +1,67 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
+<link type="text/css" rel="stylesheet" href="../css/help.css">
+<title>Help: Index</title>
+</head>
+<body>
+<div id="header">
+ <div class="logo"> </div>
+ <div class="nav"><a href="javascript:history.back()">Go Back</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="javascript:self.close();">Close</a></div>
+</div>
+<div id="content">
+ <h2>Index</h2>
+ <dl>
+ <dt>Message List: your inbox</dt>
+ <dd>
+ <ul>
+ <li><a href="#">INBOX</a></li>
+ <li><a href="#">Message Threading</a></li>
+ <li><a href="#">Magna Ali Quam</a></li>
+ </ul>
+ </dd>
+ <dt>Message View: reading email</dt>
+ <dd>
+ <ul>
+ <li><a href="#">Nonnumy Nibh</a></li>
+ <li><a href="#">Labore et Dolore</a></li>
+ <li><a href="#">Magna Ali Quam</a></li>
+ </ul>
+ </dd>
+ <dt>Compose: writing email</dt>
+ <dd>
+ <ul>
+ <li><a href="#">Nonnumy Nibh</a></li>
+ <li><a href="#">Labore et Dolore</a></li>
+ <li><a href="#">Magna Ali Quam</a></li>
+ </ul>
+ </dd>
+ <dt>Folders: organizing email</dt>
+ <dd>
+ <ul>
+ <li><a href="#">Nonnumy Nibh</a></li>
+ <li><a href="#">Labore et Dolore</a></li>
+ <li><a href="#">Magna Ali Quam</a></li>
+ </ul>
+ </dd>
+ <dt>Contacts: your address book</dt>
+ <dd>
+ <ul>
+ <li><a href="#">Nonnumy Nibh</a></li>
+ <li><a href="#">Labore et Dolore</a></li>
+ <li><a href="#">Magna Ali Quam</a></li>
+ </ul>
+ </dd>
+ <dt>Settings: customizing your webmail</dt>
+ <dd>
+ <ul>
+ <li><a href="#">Nonnumy Nibh</a></li>
+ <li><a href="#">Labore et Dolore</a></li>
+ <li><a href="#">Magna Ali Quam</a></li>
+ </ul>
+ </dd>
+ </dl>
+</div>
+</body>
+</html>
diff --git a/web/cgi/alpine/2.0/help/help_settings.htm b/web/cgi/alpine/2.0/help/help_settings.htm
new file mode 100644
index 00000000..46cab725
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/help_settings.htm
@@ -0,0 +1,66 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
+<link type="text/css" rel="stylesheet" href="../css/help.css">
+<title>Help: Settings</title>
+</head>
+<body>
+<div id="header">
+ <div class="logo"> </div>
+ <div class="nav"><a href="help_index.htm">Index</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="javascript:self.close();">Close</a></div>
+</div>
+<div id="content">
+ <h2>Settings: General Preferences </h2>
+ <dl>
+ <dd>Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonnumy nibh eeuismod tempor inci dunt ut labore et dolore magna ali quam erat volupat. <br>
+ <br>
+ <div class="note">
+ <h4>Note:</h4>
+ <div>You <b>must</b> save your changes before going to another section.</div>
+ </div>
+ <div class="note">
+ <h4>Note:</h4>
+ <div>The "Reset to Default Settings" button, found at the bottom of some pages, will reset your setting to the default settings.</div>
+ </div>
+ </dd>
+ <dt>Display</dt>
+ <dd>Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonnumy nibh eeuismod tempor inci dunt ut labore et dolore magna ali quam.</dd>
+ <dt>Folders</dt>
+ <dd>Con sectetuer adipiscing elit, sed diam nonnumy nibh.</dd>
+ <dt>Compose Encoding</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ <dt>Reply Options</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ <dt>Forwarding Options</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ <dt>Flag Personal Email</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ <dt>New Mail Notification</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ <dt>Auto-Contacts</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ <dt>Save Sent</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ <dt>Archive Sent</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ <dt>Emptying Trash</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ <dt>Fcc Options</dt>
+ <dd>Set whether to save with or without attachments when auto-saving messages to the Fcc (Folder carbon copy) folder.</dd>
+ <dt>Keyboard Shortcuts</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ </dl>
+</div>
+<div class="also">
+ <h4>See also</h4>
+ <ul>
+ <li><a href="#">Personal Information</a></li>
+ <li><a href="#">News and Weather Bar</a></li>
+ <li><a href="#">Spam Filter</a></li>
+ <li><a href="#">Vacation Auto-Reply</a></li>
+ <li><a href="#">Advanced Settings</a></li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/web/cgi/alpine/2.0/help/inbox.html b/web/cgi/alpine/2.0/help/inbox.html
new file mode 100644
index 00000000..716a19f1
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/inbox.html
@@ -0,0 +1,145 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
+<link type="text/css" rel="stylesheet" href="../css/cbn/screen.css">
+<link type="text/css" rel="stylesheet" href="../css/help.css">
+<title>Your Inbox</title>
+</head>
+<body>
+<div id="header">
+ <div class="logo"> </div>
+ <div class="nav"><a href="topic-list.html">All Help Topics</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="alpha-index.html">Index</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="javascript:self.close();">Close</a></div>
+</div>
+<div id="content">
+
+
+<h2>Your Inbox</h2>
+
+<ul>
+ <li><a href="#view">Viewing messages</a></li>
+ <li><a href="#sort">Sorting messages</a></li>
+ <li><a href="#delete">Deleting messages</a></li>
+ <li><a href="#folder">Saving messages to a folder</a></li>
+ <li><a href="#icons">Icons</a></li>
+ <li><a href="#stars">Marking messages with stars</a></li>
+ <li><a href="#spam">Reporting messages as spam</a></li>
+ <li><a href="#trash">Emptying trash</a></li>
+ <li><a href="#drag">Drag and Drop Shortcuts</a></li>
+</ul>
+
+<p>When you first log in to your mail account, you see your Inbox. Your Inbox stores and displays your mail messages.</p>
+<p>The main body of the display consists of one line per message. By default, your Inbox displays 25 messages on each page. Use the arrows at the right end of the menu bar or at the bottom of the browser window to move from page to page in the list.</p>
+<p>To change the number of messages displayed per page, see <a href="settings.html#display">Settings</a>.</p>
+<p>There is a checkbox at the start of each message line. To select a set of messages on which to perform an action (for example, Deleting) click in the checkbox. The checkbox at the top of the column selects/unselects all of the messages on the page.</p>
+<h2><a name="view" id="view"></a>Viewing messages</h2>
+<p><strong>To read a message</strong></p>
+<ul>
+ <li>Click the <b>Subject</b> of the message.</li>
+</ul>
+<p><strong>To read messages in other folders</strong></p>
+<ul>
+ <li>Click the desired folder in the left pane.</li>
+<br /><br /></ul>
+<h2><a name="sort" id="sort"></a>Sorting messages</h2>
+<p>By default the message index is sorted by <strong>Date</strong>, with the most recent messages coming first and the oldest messages at the bottom of the index. You can change this default sort order in <a href="settings.html">Settings</a></p>
+<ul>
+ <li><strong>Sort by columns on the list.</strong> Click a column heading, such as <strong>From</strong>, <strong>Subject</strong>, or <strong>Date</strong> to sort by that field. Click on the small triangle next to the sort heading to reverse the sort order.</li>
+
+ <li><strong>Group by Thread.</strong> Groups all messages in the same conversation together, in a a tree view. This option is available in the <strong>Arrange</strong> menu bar above the column headings.</li>
+
+ <li><strong>Group by Subject.</strong> Groups all messages with the same subject together. This option is also only available in the <strong>Arrange</strong> menu.</li>
+
+ <li><strong>Sort by Arrival.</strong> Sometimes it is convenient to sort in the order that the messages were added to the folder instead of by the Date, which is usually similar but a little different. Select this option from the <strong>Arrange</strong> menu.</li>
+<br /><br /></ul>
+
+<h2><a name="delete" id="delete"></a>Deleting messages</h2>
+<ol>
+ <li>Select the messages you wish to delete by checking the boxes to the left of the messages.</li>
+ <li>On the menu bar, click <strong>Delete</strong>.</li>
+</ol>
+
+<p>When you click <strong>Delete</strong>, the selected messages are moved to the Trash<a href="#trash"></a>, where you can delete them later. </p>
+
+<h2><a name="folder" id="folder"></a>Saving messages to a folder</h2>
+<p>You can move or copy messages from the Inbox to a folder. Moving a message removes it from the Inbox while creating a copy in the designated folder. Copying a message leaves the message in the Inbox while creating a copy in the designated folder.</p>
+<ol>
+ <li>Select the box to the left of the message or messages that you wish to put in a folder.</li>
+ <li>On the menu bar, locate the <strong>Move</strong> or <strong>Copy</strong> button. Skip this step if the one you want is already displayed. If necessary, click the button and pull down the menu to select <strong>Move</strong> or <strong>Copy</strong>.</li>
+ <li>On the menu bar, click <strong>to Folder</strong> and select the target folder from the list, or select <strong>More Folders</strong> to see a list of all folders. If you select <strong>More Folders</strong>, click the target folder in the list, and then click <strong>Copy</strong> or <strong>Move</strong>.</li>
+<br /><br /></ol>
+
+<h2><a name="icons" id="icon"></a>Icons</h2>
+<p>Several informative icons may appear to the left of the <strong>From</strong> column.</p>
+
+<table border="1">
+ <tr>
+ <th width="15%" >Icon</th>
+ <th width="80%" >Meaning</th>
+ </tr>
+ <tr>
+ <td><span class="sp spml spml1">&nbsp;</span></div></td>
+ <td>New message</td>
+ </tr>
+ <tr>
+ <td><span class="sp spml spml6">&nbsp;</span></div></td>
+ <td>The message includes an attachment</td>
+ </tr>
+ <tr>
+ <td><span class="sp spml spml2">&nbsp;</span></div></td>
+ <td>You have replied to the message</td>
+ </tr>
+ <tr>
+ <td><span class="sp spml spml3">&nbsp;</span></div></td>
+ <td>You have forwarded the message</td>
+ </tr>
+ <tr>
+ <td><span class="sp spml spml4">&nbsp;</span></div></td>
+ <td>The message is addressed directly to you</td>
+ </tr>
+ <tr>
+ <td><span class="sp spml spml5">&nbsp;</span></div></td>
+ <td>The message is cc'd to you</td>
+ </tr>
+</table>
+<p>In addition, messages that have not been read are displayed in bold text.</p>
+<h2><a name="stars" id="stars"></a>Marking messages with stars</h2>
+<p>You can mark messages with stars &nbsp;<img src="graphics/star.gif" alt="Star" width="17" height="17" />&nbsp; that appear in the far right column of the list. The stars can indicate anything that you like. For example, you might mark the most important messages with a star.</p>
+
+<p><strong>To mark a message with a star</strong></p>
+<ul>
+ <li>Click in the rightmost column of the list on the row for that message or select <strong>Set Star</strong> from the <strong>More Actions</strong> menu in the menu bar.</li>
+<br /><br /></ul>
+<h2><a name="spam" id="spam"></a>Reporting messages as spam</h2>
+<p>If you get a message that you think should have been identified by the spam detection processes but wasn't, you may submit it for review, which may help improve the effectiveness of spam detection. </p>
+<p><strong>To report spam</strong></p>
+<ol>
+ <li>Select the message or messages that you wish to report as spam by checking the boxes in the left column.</li>
+ <li>On the menu bar, click <strong>Report Spam</strong>. A copy of the message is sent to the University of Washington spam detection process and the message is moved to your <strong>Junk</strong> folder.</li>
+<br /><br /></ol>
+<h2><a name="trash" id="trash"></a>Emptying trash</h2>
+<p>When messages are deleted they are actually moved to the <strong>Trash</strong> folder and not immediately deleted. To permanently remove the messages you must empty the trash.</p>
+<p><strong>To empty the entire contents of the trash</strong></p>
+<ul>
+ <li>Find the <strong>Trash</strong> folder in the left pane. If there are messages in the Trash folder you may click on the word <strong>Empty</strong> next to the Trash folder to empty it. This is also true of the <strong>Junk</strong> folder, which may be emptied in the same way.</li>
+</ul>
+<p><strong>To permanently delete selected messages from the trash</strong></p>
+<ol>
+ <li>In the left pane, click <strong>Trash</strong>.</li>
+ <li>Select the box to the left of the messages that you want to delete.</li>
+ <li>On the menu bar, click <strong>Delete Forever</strong>. Be sure that you have selected the right messages; there is no confirmation screen for this action.</li>
+</ol>
+<p><strong>To recover messages from the trash</strong></p>
+<ol>
+ <li>In the left pane, click Trash.</li>
+ <li>Select the box to the left of the messages that you want to recover.</li>
+ <li>On the menu bar, locate the <strong>Move</strong> or <strong>Copy</strong> button. Skip this step if the one you want is already dislayed. If necessary, click the button and pull down the menu to select <strong>Move</strong> or <strong>Copy</strong>.</li>
+ <li>On the menu bar, click <strong>to Folder</strong> and select the target folder from the list, or select <strong>More Folders</strong> to see a list of all folders. If you select <strong>More Folders</strong>, click the target folder in the list, and then click <strong>Copy</strong> or <strong>Move</strong>.</li>
+<br /><br /></ol>
+<h2><a name="drag" id="drag"></a>Drag and Drop Shortcuts</h2>
+<p>You may grab a message by its From field and drag it over a folder in the left pane in order to move it to the folder. Alternatively, if you drag it to the Contacts list in the left pane and drop it there the From address will be added to your list of Contacts.</p>
+
+
+</div>
+</body>
+</html>
diff --git a/web/cgi/alpine/2.0/help/popup/_notes/dwsync.xml b/web/cgi/alpine/2.0/help/popup/_notes/dwsync.xml
new file mode 100644
index 00000000..e659193f
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/popup/_notes/dwsync.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<dwsync>
+<file name="help_set_display.htm" local="128395568460000000" remote="128413808830000000" testing="0" />
+</dwsync> \ No newline at end of file
diff --git a/web/cgi/alpine/2.0/help/popup/help_set_display.htm b/web/cgi/alpine/2.0/help/popup/help_set_display.htm
new file mode 100644
index 00000000..574ba8db
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/popup/help_set_display.htm
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
+<link type="text/css" rel="stylesheet" href="../../css/help_popup.css">
+<title>Help: WebMail</title>
+</head>
+<body>
+<div id="header">
+ <div class="nav"><a href="javascript:self.close();">Close</a></div>
+</div>
+<div id="content">
+ <h2>Settings: Display</h2>
+ <dl>
+ <dd>Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonnumy nibh eeuismod tempor inci dunt ut labore et dolore magna ali quam erat volupat. <br>
+ <br>
+ <div class="note">
+ <h4>Note</h4>
+ <div>Lorem ipsum dolor sit amet, con sectetuer adipiscing elit, sed diam nonnumy nibh eeuismod tempor inci dunt ut labore et dolore magna ali quam erat volupat.</div>
+ </div>
+ </dd>
+ <dt>Themes</dt>
+ <dd>Ut wisi enim ad minim veniam.</dd>
+ <dt>Number of messages per page</dt>
+ <dd>Con sectetuer adipiscing elit, sed diam nonnumy nibh.</dd>
+ </dl>
+</div>
+<div class="also">
+ <h4>See also</h4>
+ <ul>
+ <li><a href="#">Lorem ipsum dolor sit</a></li>
+ <li><a href="#">con sectetuer</a></li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/web/cgi/alpine/2.0/help/quick-start.html b/web/cgi/alpine/2.0/help/quick-start.html
new file mode 100644
index 00000000..68ce79b3
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/quick-start.html
@@ -0,0 +1,136 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
+<link type="text/css" rel="stylesheet" href="../css/help.css">
+<title>Alpine Help Pages</title>
+</head>
+<body>
+<div id="header">
+ <div class="logo"> </div>
+ <div class="nav"><a href="topic-list.html">All Help Topics</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="alpha-index.html">Index</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="javascript:self.close();">Close</a></div>
+</div>
+<div id="content">
+
+
+<h2>Alpine Quick Start</h2>
+
+
+<p>This page provides a quick overview of basic Alpine features and how to access them.</p>
+<ul>
+ <li><a href="#main">Main parts of the Alpine screen</a></li>
+ <li><a href="#compose">Parts of the Compose window</a></li>
+ <li><a href="#basic">Basic Alpine Features</a></li><br /><br />
+</ul>
+<h2><a name="main" id="main"></a>Main parts of the Alpine screen</h2>
+<p>The following figure shows a portion of the Alpine screen with the main parts identified. </p>
+<p><img src="graphics/parts.gif" alt="Main parts of the screen" width="426" height="186" /></p>
+<h3>Screen header<br /><br /><hr /></h3>
+<p><img src="graphics/screen-header.gif" alt="Screen header" width="445" height="54" /></p>
+<ul>
+ <li>The top portion provides links to University of Washington news and local weather. The top portion also displays error messages and comfirmation messages, such as confirming that you have moved or copied a message to a folder.</li>
+ <li>The right side provides a bar graph representing the portion of your account's disk space allocation that is currently used.</li>
+ <li>Below the bar graph are links for Settings (for customizing your mail), Help (for displaying this Help system), and Sign out.</li>
+</ul>
+<h3>Menu bar<br /><br /><hr /></h3>
+<p>The menu bar provides commands needed for each Alpine screen. The two leftmost commands, <a href="#check">Check Mail</a> and <a href="compose.html">Compose</a>, are the same in all Alpine screens. The other commands change according to which Alpine screen is dislayed.</p>
+<h3>Left pane<br /><br /><hr /></h3>
+<p>The left pane displays:</p>
+<ul>
+ <li><strong>Search.</strong> For a basic search, type a word in the search box and click the search icon. For more search options, click Advanced Search.</li>
+ <li><strong>Inbox and other default folders.</strong> Your inbox contains your mail as it arrives, you can use other folders to organize your mail.</li>
+ <li><strong>Contacts.</strong> Click to view and manage your contacts.</li>
+ <li><strong>Recent Folders.</strong> A list of the folders that you have recently accessed. You can control how many recent folders are listed (see Settings).</li>
+ <li><strong>View/Manage Folders.</strong> Click to view a list of all of your folders. From this list, you can add, delete, and rename folders.</li>
+ </ul>
+ <h3>Right pane<br /><br /><hr />
+ </h3>
+
+
+<p>Depending on what you are doing, the right pane displays one of five things:</p>
+<ul>
+ <li> <strong><a name="mlists" id="mlists"></a>Message lists.</strong> Display the contents of the folders in the left pane: Inbox, Drafts, Sent, and so forth. The message lists share a common format that allows you to view and manage your messages.</li>
+ <li><strong>The Compose window.</strong> Allows you to write and reply to messages.</li>
+ <li><strong>Your folder list</strong>. A list of all Alpine folders, both the standard Alpine folders such as Inbox, and any folders that you create. You can manage your folders from this list.</li>
+ <li><strong>Your contacts list.</strong> A list of all of the contacts that you have created. The contacts list functions as your address book.</li>
+ <li><strong>The Settings window.</strong> Allows you to customize the appearance and behavior of Alpine for your account.</li><br /><br />
+</ul>
+
+<h2><a name="compose" id="compose"></a>Parts of the Compose window</h2>
+<p>In the Compose window, you can write, send, and reply to messages. The following figure shows the main parts of the Compose window. </p>
+<p><img src="graphics/compose.gif" alt="Compose screen" /></p>
+<ul>
+ <li> <strong>Header section</strong> (at the top). You use the header section to address the mail and control the text format. </li>
+
+ <li><strong>Message section</strong> (below the header). The message section is where you enter and format message text. </li><br /><br />
+
+</ul>
+<h2><a name="basic" id="basic"></a>Basic Alpine Features</h2>
+<h3>Viewing messages<br /><hr /></h3>
+<p>When you first log in, your Inbox is displayed in the right pane, showing a list of your mail messages. </p>
+<ul>
+ <li>By default, the list contains 25 messages per page. Click the arrows on the right side of the menu bar to move from page to page.</li>
+ <li>You can sort messages in the list by clicking the column headings.</li>
+ <li>You can drag and drop messages from the right pane to the folders in the left pane or to your contacts: click and hold on the name or email address in the From column to drag a message.</li>
+ </ul>
+<p>For more information, see <a href="inbox.html">Your Inbox</a>.</p>
+<h3>Reading mail<br /><hr /></h3>
+
+<p>To read a message, click on its <strong>Subject</strong>. For more information, see <a href="read.html">Reading mail</a>.</p>
+
+<h3>Sending mail<br /><hr /></h3>
+
+To send a message, click <strong>Compose</strong> (or <strong>Reply</strong> or <strong>Forward</strong>) on the menu bar. For more information, see <a href="compose.html">Compose: sending mail</a>.
+
+<h3>Search<br /><hr /></h3>
+
+<p>To search for a message, type a search string in the <strong>Search</strong> box, at the top of the <a href="#main">left pane</a>. Click <strong>Advanced Search</strong> for more search options. For more information, see <a href="search.html">Search</a>.</p>
+
+<h3>Folders<br /><hr /></h3>
+
+<p>Folders help you keep your mail organized. Default folders, such as <strong>Inbox</strong> and <strong>Junk</strong>, are always there. You can also create your own folders by clicking <strong>View/Manage Folders</strong>. For more information, see <a href="folders.html">Folders</a>.</p>
+
+
+<h3>Contacts<br /><hr /></h3>
+
+<p>You can create a contact list,which is a list of addresses that are important or that you frequently use. Click <strong>Contacts</strong> to add items to your contact list. For more information, click <a href="contacts.html">Contacts</a>.</p>
+
+
+<h3><a name="check" id="check"></a>Checking for new mail<br /><hr /></h3>
+
+<p>You can check for new mail from any Alpine window or folder without returning to your Inbox.</p>
+
+<p><strong>To check for new mail </strong></p>
+<ul>
+ <li>On the menu bar, click <strong>Check Mail</strong>. Alpine checks for new mail. If you have any new mail, a message appears in the middle of the <a href="#main">screen header</a>.</li>
+ </ul>
+
+<h3>Settings<br /><hr /></h3>
+<p>You can control the appearance and behavior of many parts of the Alpine screen. For more information, see <a href="settings.html">Settings</a>.</p>
+<ul>
+
+</ul>
+<h3><a name="trash" id="trash"></a>Trash<br /><hr /></h3>
+<p>When you delete a message, it is moved to the trash. When you empty the trash or delete selected messages from the trash, they are removed permanently. You can also recover messages from the trash.</p>
+<p><strong>To empty the entire contents of the trash</strong></p>
+<ol>
+ <li>In the left pane, next to <strong>Trash</strong>, click <strong>[Empty]</strong>. </li>
+ <li>Click <strong>Empty Trash</strong> to confirm.</li>
+</ol>
+<p>This permanently deletes all of the messages in the trash.</p>
+<p><strong>To permanently delete selected messages from the trash</strong></p>
+<ol>
+ <li>In the left pane, click <strong>Trash</strong>.</li>
+ <li>Select the box to the left of the messages that you want to delete.</li>
+ <li>On the menu bar, click <strong>Delete Forever</strong>. Be sure that you have selected the right messages; there is no confirmation screen for this action.</li>
+</ol>
+<p><strong>To recover messages from the trash</strong></p>
+<ol>
+ <li>In the left pane, click Trash.</li>
+ <li>Select the box to the left of the messages that you want to recover.</li>
+ <li>On the menu bar, locate the <strong>Move</strong> or <strong>Copy</strong> button. Skip this step if the one you want is already dislayed. If necessary, click the button and pull down the menu to select <strong>Move</strong> or <strong>Copy</strong>.</li>
+ <li>On the menu bar, click <strong>to Folder</strong> and select the target folder from the list, or select <strong>More Folders</strong> to see a list of all folders. If you select <strong>More Folders</strong>, click the target folder in the list, and then click <strong>Copy</strong> or <strong>Move</strong>.</li>
+</ol>
+</div>
+</body>
+</html>
diff --git a/web/cgi/alpine/2.0/help/read.html b/web/cgi/alpine/2.0/help/read.html
new file mode 100644
index 00000000..155f4caf
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/read.html
@@ -0,0 +1,145 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
+<link type="text/css" rel="stylesheet" href="../css/help.css">
+<title>Reading mail</title>
+</head>
+<body>
+<div id="header">
+ <div class="logo"> </div>
+ <div class="nav"><a href="topic-list.html">All Help Topics</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="alpha-index.html">Index</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="javascript:self.close();">Close</a></div>
+</div>
+<div id="content">
+<h2>Reading mail</h2>
+
+<ul>
+ <li><a href="#view">Viewing a message</a></li>
+ <li><a href="#attachments">Viewing and downloading attachments</a></li>
+ <li><a href="#full">Displaying full headers</a></li>
+ <li><a href="#reply">Replying </a></li>
+ <li><a href="#forward">Forwarding </a></li>
+ <li><a href="#contacts">Adding contacts</a></li>
+ <li><a href="#folder">Saving messages to a folder</a></li>
+ <li><a href="#print">Printing </a></li>
+ <li><a href="#delete">Deleting a message</a></li>
+ <li><a href="#spam">Reporting a message as spam</a></li>
+ <br /><br />
+</ul>
+
+
+
+<h2><a name="view" id="view"></a>Viewing a message</h2>
+ <p><strong>To view a message</strong></p>
+<ul>
+
+ <li>Click its <strong>Subject</strong> in the list of messages.</li>
+<br /><br /></ul>
+<h2><a name="attachments" id="attachments"></a>Viewing and downloading attachments</h2>
+
+<p>Attachments are listed in the header area at the top of the message. Attachments are marked with the paper clip &nbsp;<img src="graphics/attach_sm.gif" alt="Attachment" width="17" height="17" />&nbsp; icon.</p>
+<p><strong>To open an attachment</strong></p>
+<ul>
+ <li>Click the file name.</li>
+</ul>
+<p><strong>To download an attachment</strong></p>
+<ol>
+ <li>Open the attachment.</li>
+ <li>In the application that opens the attachment, save a copy of the attachment to your computer.</li>
+ <br /><br />
+</ol>
+
+<h2><a name="full" id="header"></a>Displaying full headers</h2>
+<p>When you are viewing a message, the header section at the top of the message displays a standard set of headers including the message Subject, From, To, Cc, Date, and Attachments (if there are any). It is possible to show the full set of headers in the message, which includes a complete list of all routing from the message source to your Inbox, along with all other headers. These full headers may be useful in troubleshooting.</p>
+<p><strong>To display full headers</strong></p>
+<ul>
+ <li>In the top right corner of the message, click <strong>Show Full Headers</strong>. </li>
+</ul>
+<p><strong>To cancel full headers</strong></p>
+<ul>
+ <li>In the top right corner of the message, click <strong>Show Filtered Headers</strong>. </li>
+<br /><br /></ul>
+<h2><a name="reply" id="reply"></a>Replying </h2>
+<ol>
+ <li>On the menu bar, click <strong>Reply</strong> or <strong>Reply All</strong>.
+ <ul>
+ <li><strong>Reply.</strong> Sends a reply to the address or addresses in the To field.<br />
+ or</li>
+ <li><strong>Reply All.</strong> Sends a reply to the addresses in the <strong>To</strong> and <strong>Cc</strong> fields.</li>
+ <br /></ul>
+ </li>
+ <li>Proceed as for <a href="compose.html">sending mail</a><strong></strong>.</li>
+ </ol>
+
+<p>In either case the reply is not sent immediately. Instead, you are placed in the message composer with the addresses filled in.</p>
+<p>You can control the message format and other features of your replies. The <a href="settings.html#reply">Reply settings</a> allow you to select:</p>
+<ul>
+ <li>Whether or not to include headers</li>
+ <li>Whether or not to include attachments</li>
+ <li>Whether to place your signature above or below the replied to text</li>
+ <li>Whether or not to remove the signature from the replied to text</li>
+ <br />
+ <br />
+
+</ul>
+<h2><a name="forward" id="forward"></a>Forwarding </h2>
+<ol>
+ <li>On the menu bar, click <strong>Forward</strong>.</li>
+ <li>Proceed as for <a href="compose.html">sending mail</a>.</li>
+ </ol>
+
+<p>You can control whether to forward messages as inline text or as attachments. For more information, see <a href="settings.html#forward">Settings</a>.</p>
+
+<h2><a name="contacts" id="contacts"></a>Adding contacts</h2>
+<p>When you are reading a message, you can add the sender to your list of contacts.</p>
+
+<p><strong>To add a contact</strong></p>
+
+<ul>
+<li>Drag the contact's email address from the <strong>From</strong> field to the <strong>Contacts</strong> folder.
+<p><em>or</em></p></li>
+<li>To the right of the <strong>From</strong> field, click <strong>Add</strong>.</li>
+<br /><br /></ul>
+<p><strong>To add multiple contacts from a message</strong></p>
+<ul>
+ <li>On the menu bar, click <strong>More Actions</strong>, and then select <strong>Extract</strong>. Alpine extracts everything in the message that is in the format of an email address and presents a list of contacts. You can confirm each contact.</li>
+<br /><br /></ul>
+<p><strong>To finish adding a contact</strong></p>
+<ol>
+ <li>Enter the contact information:
+ <ul>
+ <li><strong>Nickname.</strong> A short name that you can use for quick addressing. If you type the nickname instead of the full display name or email address, Alpine will offer a list of matching choices from your contacts list and the University of Washington directory. You can select the contact from the list.</li>
+ <li><strong>Display Name.</strong> The name that appears in the message header.</li>
+ <li><strong>Email.</strong> The contact's email address.</li>
+ <li><strong>Notes.</strong> Any text you want. Used only by you.</li>
+ <li><strong>Fcc folder.</strong> A folder that will receive copies of all messages that you send directly to this contact.</li>
+ <br /></ul>
+ </li>
+ <li>Click <strong>Add</strong> to commit the contact to your address book.</li>
+<br /><br /></ol>
+<h2><a name="folder" id="folder"></a>Saving messages to a folder</h2>
+<p>You can move or copy messages to folders. Moving a message removes it from the Inbox while creating a copy in the designated folder. Copying a message leaves the message in the Inbox while creating a copy in the designated folder.</p>
+<ol>
+ <li>On the menu bar, locate the <strong>Move</strong> or <strong>Copy</strong> button. Skip this step if the one you want is already displayed. If necessary, click the button and pull down the menu to select <strong>Move</strong> or <strong>Copy</strong>.</li>
+ <li>On the menu bar, click <strong>to Folder</strong> and select the target folder from the list, or select <strong>More Folders</strong> to see a list of all folders. If you select <strong>More Folders</strong>, click the target folder in the list, and then click <strong>Copy</strong> or <strong>Move</strong>.</li>
+<br /><br /></ol>
+<h2><a name="print" id="print"></a>Printing</h2>
+<p><strong>To print a message</strong></p>
+<ul>
+ <li>In the area above the menu bar on the right click <strong>Print</strong>.</li>
+</ul>
+<h2><a name="delete" id="delete"></a>Deleting a message</h2>
+<ol>
+ <li>On the menu bar, click <strong>Delete</strong>.</li>
+</ol>
+
+<p>When you click <strong>Delete</strong>, the message you are viewing is moved to the Trash folder and you will be viewing the next message in your Inbox.</p>
+<h2><a name="spam" id="spam"></a>Reporting a message as spam</h2>
+<p>If you are reading a message that you think should have been identified by the spam detection processes but wasn't, you may submit it for review, which may help improve the effectiveness of spam detection. </p>
+<p><strong>To report spam</strong></p>
+<ol>
+ <li>On the menu bar, click <strong>Report Spam</strong>. A copy of the message is sent to the University of Washington spam detection process and the message is moved to your <strong>Junk</strong> folder.</li>
+<br /><br /></ol>
+</div>
+</body>
+</html>
diff --git a/web/cgi/alpine/2.0/help/search.html b/web/cgi/alpine/2.0/help/search.html
new file mode 100644
index 00000000..3518058e
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/search.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
+<link type="text/css" rel="stylesheet" href="../css/help.css">
+<title>Search</title>
+</head>
+<body>
+<div id="header">
+ <div class="logo"> </div>
+ <div class="nav"><a href="topic-list.html">All Help Topics</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="alpha-index.html">Index</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="javascript:self.close();">Close</a></div>
+</div>
+<div id="content">
+<h2>Search</h2>
+
+<ul>
+ <li><a href="#inbox">Basic Index Search</a></li>
+ <li><a href="#advanced">Advanced Index Search</a></li>
+ <li><a href="#example">Example</a></li>
+ <li><a href="#other">Other Searches (Contacts and Folder List)</a></li>
+<br /><br /></ul>
+
+<p>The <strong>Search</strong> area is in the upper portion of the left pane, just below the menu bar. At a minimum, there will be a text box for you to enter text to be searched for. If the right pane contains an index of messages there will also be an <strong>Advanced Search</strong> button. If you've already completed an index search and the right pane contains the Search Results then there are some additional button available. These are described below.</p>
+
+<h2><a name="search" id="search"></a>Basic Index Search</h2>
+
+<p>You may perform a basic search of all the messages in the index by typing some text into the search text box and clicking the search icon next to the box. This will be a search of the entire text of the messages, not just the Subject.</p>
+
+<p><strong>To search for messages</strong></p>
+<ul>
+ <li>Find the <strong>Search</strong> text box in the upper part of the left pane and click in it.</li>
+ <li>Type the search text into the box.</li>
+</ul>
+
+<p>The result of the search will be a message index containing only the subset of messages that match the search criterion. A message about the number of matches will be displayed in the Screen Header area and the heading will change from <strong>INBOX</strong> to <strong>Search Results in INBOX</strong> to show you that you are viewing a subset of the messages. Near the bottom of the page the total number of messages in the Search Result will be shown instead of the total number of messages in the INBOX.</p>
+
+<p>There will be a couple new items in the Search area of the screen. The highlighted <em>folder</em> in the search area will be called <strong>Search Results</strong>. You may go back and forth between the INBOX and the Search Results by clicking on the INBOX or on the Search Results. There will be a new button next to Advanced Search labeled <strong>Clear</strong>. Clicking that will clear the results of the search.</p>
+
+<p>You can start a brand new search by typing in more text and searching again. As long as the menu in the search area says <strong>New Search</strong> you will be searching the entire INBOX again, just like with the initial search. However, you also have the option of refining the search you have done so far by setting the menu to either <strong>Search within Results</strong> or <strong>Add to Search Results</strong>. A <strong>Search within Results</strong> search will reduce the size of the Search Results, showing you the subset of the current Search Results that also match your new search. An <strong>Add to Search Results</strong> search will increase the size of the Search Results, adding all of the new matches to the existing Search Results.</p>
+
+<p>If you are refining your Search Results and there are no matches, the Search Results will remain the same instead of showing nothing, so that you won't lose the previous results. A message in the Screen Header will say <strong>No messages matched your search</strong>.</p>
+
+<h2><a name="advanced" id="advanced"></a>Advanced Index Search</h2>
+<p>Clicking on <strong>Advanced Search</strong> allows you to more tightly control the method of searching for matching messages. For example, you could search for all messages where the Subject contains (or doesn't contain) a certain word. If you fill in more than one of the criteria they all have to match. For example, if you fill in some text that the Subject must contain <strong>and</strong> also type in some text in that the From must contain; the <strong>Search Results</strong> will only contain messages that both have a matching From and have a matching Subject.</p>
+
+<p>At the top of the <strong>Advanced Search</strong> panel is a menu similar to the one in the Basic search area where you say what sort of refinement on the current search you want to perform. This can be either a brand new search, a narrowing down of the current Search Results (<strong>search within</strong>), or a widening of the current Search Results (<strong>add results</strong>).</p>
+
+<h2><a name="example" id="example"></a>Example</h2>
+<p>Searching is often done iteratively, a step at a time, until you locate the message you are looking for.</p>
+<p>You might start out looking for a message that you can recall contains the word <strong>firefox</strong>.</p>
+
+<ul>
+ <li>Type <strong>firefox</strong> in the search text box click to search.</li>
+</ul>
+
+<p>You got way more matches than you expected so you try to think of some way to refine the search. You remember that the message also contains the word <strong>awesome</strong>.</p>
+
+<ul>
+ <li>Set the search menu to <strong>Search within Results</strong>.</li>
+ <li>Type <strong>awesome</strong> in the search text box and click to search.</li>
+</ul>
+
+<p>Maybe you see your message now or maybe you need to refine further. Suppose you know the message came within the past week.</p>
+
+<ul>
+ <li>Click <strong>Advanced Search</strong>.
+ <li>Be sure the choice at the top of the Search panel is set to <strong>Perform this search within current search results</strong>.
+ <li>Set the <strong>Date</strong> menu to <strong>Past week</strong>.
+ <li>Click <strong>Search</strong>.</li>
+<br /><br /></ul>
+
+<h2><a name="other" id="other"></a>Other Searches (Contacts and Folder List)</h2>
+<p>You can also perform basic searches while viewing your Folder List and while viewing your Contacts. In both cases, the search is a simple text search to match what you type, and only the text that is displayed on the screen is searched. The results are simply highlighted on the screen. You have to look for them yourself in order to use them.</p>
+
+</div>
+</body>
+</html>
diff --git a/web/cgi/alpine/2.0/help/settings.html b/web/cgi/alpine/2.0/help/settings.html
new file mode 100644
index 00000000..04dfa616
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/settings.html
@@ -0,0 +1,124 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
+<link type="text/css" rel="stylesheet" href="../css/help.css">
+<title>Settings</title>
+</head>
+<body>
+<div id="header">
+ <div class="logo"> </div>
+ <div class="nav"><a href="topic-list.html">All Help Topics</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="alpha-index.html">Index</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="javascript:self.close();">Close</a></div>
+</div>
+<div id="content">
+
+<h2>Settings: customizing Alpine</h2>
+
+<ul>
+ <li><a href="#display">Message Display</a></li>
+ <li><a href="#folders">Folders</a></li>
+ <li><a href="#reply">Reply Options</a></li>
+ <li><a href="#forward">Forwarding Options</a></li>
+ <li><a href="#fcc">Sent Message Options</a></li>
+ <li><a href="#personal">Personal Preferences</a></li>
+ <li><a href="#newsweather">News and Weather</a></li>
+ <li><a href="#msglist">Message List</a></li>
+ <li><a href="#msgview">Message View</a></li>
+ <li><a href="#foldernames">Folder Names</a></li>
+ <li><a href="#compose">Compose</a></li>
+ <li><a href="#mailservers">Mail Servers</a></li>
+ <li><a href="#dirservers">Directory Servers</a></li>
+</ul>
+
+
+<p>The settings pages allow you to customize the behavior and appearance of Alpine.</p>
+<p><a name="show" id="show"></a><strong>To display the Settings pages</strong></p>
+<ul><li>In the upper right-corner of the screen, above the menu bar, click <strong>Settings</strong>.</li>
+<br /><br />
+</ul>
+
+<h2><a name="display" id="display"></a>Message Display</h2>
+<ul>
+ <li><strong>Display ___ messages per page.</strong> Controls the number of messages displayed on each page.</li>
+ <li> <strong>Wrap Plain Text message at ___ characters.</strong> Controls the overall width of the text block in plain text messages.</li>
+<br /><br /></ul>
+<h2><a name="folders" id="folders"></a>Folders</h2>
+<ul>
+ <li><strong>Display ___ recent folders in left column.</strong> Controls how many folders are displayed under <strong>Recent Folders</strong> in the left pane. <strong>Recent Folders</strong> are the folders that you have recently accessed, listed with the most recent at the top.</li>
+<br /><br /></ul>
+<h2><a name="reply" id="reply"></a>Reply Options</h2>
+<ul>
+ <li><strong>Include headers in replies.</strong> Includes the header section of the original message in the reply.</li>
+ <li><strong>Include attachments in replies.</strong> The recipient of the reply gets the attachments as well as the original message.</li>
+ <li><strong>Append signature below reply text.</strong> Adds your signature to the bottom of the reply instead of the top.</li>
+ <li><strong>Strip signatures when replying.</strong> Removes the signature that was in the message being replied to (if it can be identified).</li>
+<br /><br /></ul>
+<h2><a name="forward" id="forward"></a>Forwarding Options</h2>
+<ul>
+ <li> <strong>Forward messages inline.</strong> The recipient gets an ordinary text message.</li>
+ <li><strong>Forward messages as attachments.</strong> The recipient gets a message with the forwarded message attached.</li>
+<br /><br /></ul>
+<h2><a name="fcc" id="fcc"></a>Sent Message Options</h2>
+<ul>
+ <li><strong>Name of your Sent mail folder.</strong> Save messages you send to this folder (default is sent-mail). To disable the saving of sent mail set this to double double quotes ("").</li>
+ <li><strong>Save sent messages to Sent folder without attachments.</strong> Remove any attachments being sent before saving the message in your Sent mail folder.</li>
+<br /><br /></ul>
+<h2><a name="personal" id="personal"></a>Personal Preferences</h2>
+<ul>
+ <li><strong>Display Name.</strong> This is your full name (e.g., Fred Flintstone). It will be included as part of your From address in outgoing mail.</li>
+ <li><strong>Email Signature.</strong> This signature is automatically included in messages you compose. You will have the opportunity to edit it before sending.</li>
+ <li><strong>Alternate Addresses.</strong> You may enter a list of alternate addresses so that Alpine can tell when an address is you. This will affect the index display (messages will be marked with an icon showing it is to you when it is addressed to one of your addresses), the From address displayed in the index display (when the From address is one of your addresses the To address will be shown instead), and the <strong>Reply All</strong> command (addresses listed here will not be included).</li>
+</ul>
+<p><strong>To add Alternate Addresses</strong></p>
+<ul><li>On the Personal Preferences page find the <strong>Alternate Addresses</strong> option. Type alternate addresses into the text field. The <strong>Add</strong> button can be used to add additional addresses and the <strong>X</strong> buttons can be used to remove addresses. The addresses you enter should be the actual email address part of an address without the fullname or brackets. For example, <strong>user@example.com</strong>. The matching is not sensitive to upper or lower case differences, all will match. For the advanced user, a regular expression may be entered.</li>
+<br /><br />
+</ul>
+<h2><a name="newsweather" id="newsweather"></a>News and Weather</h2>
+<ul>
+ <li><strong>Headline News.</strong> RSS URL for news.</li>
+ <li><strong>Weather Bar.</strong> RSS URL for weather.</li>
+<br /><br /></ul>
+<h2><a name="msglist" id="msglist"></a>Message List</h2>
+<ul>
+ <li><strong>Default Sort Order.</strong> Sets the default sort order for the Message List. By default the sort order is set to <strong>Date/Reverse</strong>. The <strong>/Reverse</strong> part means that the newest messages will be at the top. It is also possible to temporarily change the sort order in the message list screen itself.</li>
+ <li><strong>Start display at.</strong> This just tells Alpine where to start in the index of messages. The message you specify here will be included in the first page of messages you see.</li>
+ <li><strong>Automatically Move Read Messages.</strong> Automatically move read messages to a Read Messages folder.</li>
+<br /><br /></ul>
+
+<h2><a name="msgview" id="msgview"></a>Message View</h2>
+<ul>
+ <li><strong>Display Headers.</strong> Specify which headers are to be displayed in the Message View. If you specify any headers here you must list all of the headers you wish to have displayed, not just the additional headers.</li>
+ <li><strong>Display complete URLs as links.</strong> URLs contained in a message are shown as active links when viewing the message.</li>
+ <li><strong>Display hostnames and incomplete URLs as links.</strong> Hostnames that begin with <strong>www</strong> and incomplete URLs contained in a message are shown as active links when viewing the message.</li>
+ <li><strong>Display email addresses as links.</strong> Email addresses contained in a message are displayed as active links that can be used for sending mail.</li>
+ <li><strong>Rich Text Display.</strong> Turning on this option will cause rich text messages to be shown as plain text.</li>
+ <li><strong>Anti-phishing.</strong> Usually the real hostname is displayed after links to make it easier to see if the link looks suspicious or not. Turning on this option will hide that information and is not recommended.</li>
+<br /><br /></ul>
+<h2><a name="foldernames" id="foldernames"></a>Folder Names</h2>
+<ul>
+ <li><strong>Draft Folder.</strong> Actual name of the folder that is usually referred to in Alpine as the <strong>Drafts</strong> folder. The default is <strong>postponed-msgs</strong>.</li>
+ <li><strong>Trash Folder.</strong> Actual name of the folder that is usually referred to in Alpine as the <strong>Trash</strong> folder. The default is <strong>Trash</strong>.</li>
+<br /><br /></ul>
+<h2><a name="compose" id="compose"></a>Compose</h2>
+<ul>
+ <li><strong>Compose Headers.</strong> You can control which headers you want visible when composing outgoing email using this option. You can specify any of the regular set, any of the Headers you see with More Headers, or any Customized Headers that you have already defined. If you use this setting at all, you must specify all the headers you want to see, you can't just add to the regular header set. The default set is To:, Cc:, and Subject:.</li>
+ <li><strong>Custom Headers.</strong> You may add your own custom headers to outgoing messages. Each header you specify here must include the header tag (Reply-To:, Approved:, etc.) and may optionally include a value for that header. If you want to see these custom headers each time you compose a message, you must add them to your Compose Headers list, otherwise they become part of the rich header set that you only see when you press the More Headers command. (If you are looking for a way to change which headers are displayed when you view a message, take a look at the Display Headers option in the Message View section instead.)</li>
+ <li><strong>Message Encoding.</strong> Send messages using the character encoding you set here.</li>
+ <li><strong>Reply intro string.</strong> This option is used to customize the content of the introduction line that is included when replying to a message and including the original message in the reply. It is not yet described here.</li>
+ <li><strong>Reply prefix.</strong> When a message is replied to and the text of the message is included, the included text usually has the text &quot;> &quot; prepended to each line, to indicate it is quoted text. It is recommended that you leave this option set to that value since that is a standard that other email reading programs will recognize and treat specially.</li>
+ <li><strong>Flowed Text Handling.</strong> Normally, when sending a message, Alpine generates flowed text where possible. The method for generating flowed text is defined in RFC 3676, the benefit of doing so is to send message text that can properly be viewed both on normal width displays and on displays with smaller or larger than normal screen widths. This feature turns off the generation of flowed text, as it might be desired to more tightly control how a message is displayed on the receiving end.</li>
+<br /><br /></ul>
+<h2><a name="mailservers" id="mailservers"></a>Mail Servers</h2>
+<ul>
+ <li><strong>Inbox Server.</strong> Technical name of the folder that is your <strong>INBOX</strong> folder. This will usually have to be set for you. An example is <strong>{example.com}inbox</strong>. The server name comes inside the brackets and the folder name comes after the brackets.</li>
+ <li><strong>SMTP Server.</strong> A list (usually a list of size one) consisting of the names of your SMTP servers. An SMTP server is used for sending mail. This is a domainname such as<strong>smtp.example.com</strong> and it may contain some options after the hostname. The options are introduced with a slash (/) and the name of the option. To use the submit port append <strong>/submit</strong> after the hostname. To use authentication append <strong>/user=username</strong> where <strong>username</strong> is the name you use to authenticate to the server. A more complicated example might look something like <strong>smtp.example.com/submit/user=myusername</strong>.<li>
+<br /><br /></ul>
+<h2><a name="dirservers" id="dirservers"></a>Directory Servers</h2>
+<ul>
+ <li><strong>LDAP Server.</strong> This option is currently too complicated to be set from within Web Alpine. The value it is looking for has the format of a raw ldap-servers config string found in an Alpine pinerc configuration file.</li>
+<br /><br /></ul>
+
+<p>&nbsp;</p>
+</div>
+</body>
+</html>
diff --git a/web/cgi/alpine/2.0/help/topic-list.html b/web/cgi/alpine/2.0/help/topic-list.html
new file mode 100644
index 00000000..6b75bf07
--- /dev/null
+++ b/web/cgi/alpine/2.0/help/topic-list.html
@@ -0,0 +1,101 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1">
+<link type="text/css" rel="stylesheet" href="../css/help.css">
+<title>All Help Topics</title>
+</head>
+<body>
+<div id="header">
+ <div class="logo"> </div>
+ <div class="nav"><a href="alpha-index.html">Index</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="javascript:history.back()">Go Back</a> &nbsp;&nbsp;| &nbsp;&nbsp;<a href="javascript:self.close();">Close</a></div>
+</div>
+<div id="content">
+
+
+ <h2>All Help Topics</h2>
+ <dl>
+ <dt><a href="quick-start.html">Alpine Quick Start</a></dt>
+ <dd>
+ <a href="quick-start.html#main">Main parts of the Alpine screen</a> -
+ <a href="quick-start.html#compose">Parts of the Compose window</a> -
+ <a href="quick-start.html#basic">Basic Alpine Features</a></li>
+ </dd>
+ <dt><a href="inbox.html">Your Inbox</a></dt>
+ <dd><a href="inbox.html#view">Viewing messages</a> -
+ <a href="inbox.html#sort">Sorting messages</a> -
+ <a href="inbox.html#delete">Deleting messages</a> -
+ <a href="inbox.html#folder">Saving messages to a folder</a> -
+ <a href="inbox.html#icons">Icons</a> -
+ <a href="inbox.html#stars">Marking messages with stars</a> -
+ <a href="inbox.html#spam">Reporting messages as spam</a> -
+ <a href="inbox.html#trash">Emptying trash</a> -
+ <a href="inbox.html#drag">Drag and Drop Shortcuts</a>
+ </dd>
+ <dt><a href="read.html">Reading mail</a></dt>
+ <dd>
+
+ <a href="read.html#view">Viewing a message</a> -
+ <a href="read.html#attachments">Viewing and downloading attachments</a> -
+ <a href="read.html#full">Displaying full headers</a> -
+ <a href="read.html#reply">Replying </a> -
+ <a href="read.html#forward">Forwarding </a> -
+ <a href="read.html#contacts">Adding contacts</a> -
+ <a href="read.html#folder">Saving messages to a folder</a> -
+ <a href="read.html#print">Printing </a> -
+ <a href="read.html#delete">Deleting a message </a> -
+ <a href="read.html#spam">Reporting a message as spam</a>
+ </dd>
+ <dt><a href="compose.html">Compose: sending mail</a></dt>
+ <dd>
+
+ <a href="compose.html#writing">Writing messages</a> -
+ <a href="compose.html#attachments">Including attachments</a> -
+ <a href="compose.html#sending">Sending, canceling, and saving drafts</a> -
+ <a href="compose.html#resuming">Resuming drafts</a> -
+ <a href="compose.html#headers">Headers</a> -
+ <a href="compose.html#autosave">Automatic saves</a>
+
+ </dd>
+ <dt><a href="search.html">Search</a></dt>
+ <dd>
+
+ <a href="search.html#inbox">Basic Index Search</a> -
+ <a href="search.html#advanced">Advanced Index Search</a> -
+ <a href="search.html#example">Example</a> -
+ <a href="search.html#other">Other Searches (Contacts and Folder List)</a>
+
+ </dd>
+ <dt><a href="folders.html">Folders: organizing your mail</a></dt>
+ <dd>
+
+ <a href="folders.html#view">Viewing your list of folders</a> -
+ <a href="folders.html#viewing">Viewing the messages in a folder</a> -
+ <a href="folders.html#add">Adding folders</a> -
+ <a href="folders.html#delete">Deleting folders</a> -
+ <a href="folders.html#rename">Renaming folders</a> -
+ <a href="folders.html#route">Routing mail to folders</a>
+
+ </dd>
+<dt><a href="settings.html">Settings: customizing Alpine</a></dt>
+ <dd>
+ <a href="settings.html#display">Message Display</a> -
+ <a href="settings.html#folders">Folders</a> -
+ <a href="settings.html#reply">Reply Options</a> -
+ <a href="settings.html#forward">Forwarding Options</a> -
+ <a href="settings.html#fcc">Sent Message Options</a> -
+ <a href="settings.html#personal">Personal Preferences</a> -
+ <a href="settings.html#newsweather">News and Weather</a> -
+ <a href="settings.html#msglist">Message List</a> -
+ <a href="settings.html#msgview">Message View</a> -
+ <a href="settings.html#folders">Folders</a> -
+ <a href="settings.html#compose">Compose</a> -
+ <a href="settings.html#mailservers">Mail Servers</a> -
+ <a href="settings.html#dirservers">Direcory Servers</a>
+ </dd>
+<dt><a href="alpha-index.html">Index</a></dt>
+ <dd>&nbsp; </dd>
+ </dl>
+</div>
+</body>
+</html>
diff --git a/web/cgi/alpine/2.0/img/cbn/Thumbs.db b/web/cgi/alpine/2.0/img/cbn/Thumbs.db
new file mode 100644
index 00000000..1c7332e2
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/Thumbs.db
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/_notes/dwsync.xml b/web/cgi/alpine/2.0/img/cbn/_notes/dwsync.xml
new file mode 100644
index 00000000..a15e49fc
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/_notes/dwsync.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<dwsync>
+<file name="addcontact_sm.gif" local="128322025280000000" remote="128413808870000000" testing="0" />
+<file name="addfolder.gif" local="128324595100000000" remote="128413808870000000" testing="0" />
+<file name="attach.gif" local="128408549140000000" remote="128413808880000000" testing="0" />
+<file name="attach_sm.gif" local="128285018180000000" remote="128413808880000000" testing="0" />
+<file name="base.gif" local="126795687600000000" remote="128413808890000000" testing="0" />
+<file name="btnbg.gif" local="128149620340000000" remote="128413808890000000" testing="0" />
+<file name="btnhi.gif" local="128322774920000000" remote="128413808890000000" testing="0" />
+<file name="checkmail.gif" local="128408580420000000" remote="128413808900000000" testing="0" />
+<file name="close.gif" local="128287413900000000" remote="128413808900000000" testing="0" />
+<file name="col.gif" local="128282447240000000" remote="128413808900000000" testing="0" />
+<file name="colsel.gif" local="128407627840000000" remote="128413808910000000" testing="0" />
+<file name="compose.gif" local="128408546020000000" remote="128413808910000000" testing="0" />
+<file name="contacts.gif" local="128408580180000000" remote="128413808910000000" testing="0" />
+<file name="dawg.gif" local="128346358620000000" remote="128413808920000000" testing="0" />
+<file name="delete.gif" local="128408543180000000" remote="128413808920000000" testing="0" />
+<file name="detach.gif" local="128291071260000000" remote="128413808930000000" testing="0" />
+<file name="div.gif" local="128242883360000000" remote="128413808930000000" testing="0" />
+<file name="div2.gif" local="128242883360000000" remote="128413808930000000" testing="0" />
+<file name="dn.gif" local="128311444180000000" remote="128413808940000000" testing="0" />
+<file name="edit.gif" local="128408579240000000" remote="128413808940000000" testing="0" />
+<file name="fldsel.gif" local="128329923120000000" remote="128413808940000000" testing="0" />
+<file name="folder.gif" local="126795687600000000" remote="128413808950000000" testing="0" />
+<file name="folderopen.gif" local="126795687600000000" remote="128413808950000000" testing="0" />
+<file name="forward.gif" local="128408538380000000" remote="128413808950000000" testing="0" />
+<file name="fwd.gif" local="128297060120000000" remote="128413808960000000" testing="0" />
+<file name="f_contacts.gif" local="128408575980000000" remote="128413808960000000" testing="0" />
+<file name="f_delete.gif" local="128335113800000000" remote="128413808970000000" testing="0" />
+<file name="f_drafts.gif" local="128285005940000000" remote="128413808970000000" testing="0" />
+<file name="f_folder.gif" local="128335113040000000" remote="128413808970000000" testing="0" />
+<file name="f_inbox.gif" local="128408820000000000" remote="128413808980000000" testing="0" />
+<file name="f_manage.gif" local="128286587360000000" remote="128413808980000000" testing="0" />
+<file name="f_minus.gif" local="128408616920000000" remote="128413808990000000" testing="0" />
+<file name="f_plus.gif" local="128408615620000000" remote="128413808990000000" testing="0" />
+<file name="f_search.gif" local="128348118840000000" remote="128413808990000000" testing="0" />
+<file name="f_sent.gif" local="128408819900000000" remote="128413809000000000" testing="0" />
+<file name="f_spam.gif" local="128284929720000000" remote="128413809000000000" testing="0" />
+<file name="group_contact.gif" local="128408576620000000" remote="128413809010000000" testing="0" />
+<file name="help.gif" local="128408588340000000" remote="128413809010000000" testing="0" />
+<file name="help_sm.gif" local="128395563540000000" remote="128413809010000000" testing="0" />
+<file name="high.gif" local="128397216540000000" remote="128413809020000000" testing="0" />
+<file name="highest.gif" local="128397216560000000" remote="128413809020000000" testing="0" />
+<file name="inbox.gif" local="128408627500000000" remote="128413809020000000" testing="0" />
+<file name="info.gif" local="128285031840000000" remote="128413809030000000" testing="0" />
+<file name="infomsg.gif" local="126795687600000000" remote="128413809030000000" testing="0" />
+<file name="lo.gif" local="128242883560000000" remote="128413809040000000" testing="0" />
+<file name="logo.gif" local="128268543280000000" remote="128413809040000000" testing="0" />
+<file name="logo.png" local="128268542820000000" remote="128413809040000000" testing="0" />
+<file name="lookup.gif" local="128408547020000000" remote="128413809050000000" testing="0" />
+<file name="low.gif" local="128287410740000000" remote="128413809050000000" testing="0" />
+<file name="menu.gif" local="128294434100000000" remote="128413809060000000" testing="0" />
+<file name="musicfolder.gif" local="126795687600000000" remote="128413809060000000" testing="0" />
+<file name="navbg.gif" local="128149620340000000" remote="128413809070000000" testing="0" />
+<file name="new.gif" local="128297901460000000" remote="128413809070000000" testing="0" />
+<file name="page.gif" local="126795687600000000" remote="128413809070000000" testing="0" />
+<file name="parent.gif" local="128334255560000000" remote="128413809080000000" testing="0" />
+<file name="partly.gif" local="128286602780000000" remote="128413809080000000" testing="0" />
+<file name="pg_down.gif" local="128296919540000000" remote="128413809080000000" testing="0" />
+<file name="pg_first.gif" local="128296917000000000" remote="128413809090000000" testing="0" />
+<file name="pg_last.gif" local="128296918820000000" remote="128413809090000000" testing="0" />
+<file name="pg_next.gif" local="128296918060000000" remote="128413809100000000" testing="0" />
+<file name="pg_prev.gif" local="128296917260000000" remote="128413809100000000" testing="0" />
+<file name="pg_up.gif" local="128296920120000000" remote="128413809100000000" testing="0" />
+<file name="print.gif" local="128408544200000000" remote="128413809110000000" testing="0" />
+<file name="remove.gif" local="128390294960000000" remote="128413809110000000" testing="0" />
+<file name="rename.gif" local="128408558040000000" remote="128413809110000000" testing="0" />
+<file name="replied.gif" local="128297052960000000" remote="128413809120000000" testing="0" />
+<file name="replied_and_fwd.gif" local="128315874020000000" remote="128413809120000000" testing="0" />
+<file name="reply.gif" local="128408531760000000" remote="128413809130000000" testing="0" />
+<file name="replyall.gif" local="128408531880000000" remote="128413809130000000" testing="0" />
+<file name="return.gif" local="128348041200000000" remote="128413809130000000" testing="0" />
+<file name="rt.gif" local="128354170440000000" remote="128413809140000000" testing="0" />
+<file name="save.gif" local="128408602740000000" remote="128413809140000000" testing="0" />
+<file name="search.gif" local="128346326260000000" remote="128413809150000000" testing="0" />
+<file name="send.gif" local="128408579860000000" remote="128413809150000000" testing="0" />
+<file name="settings.gif" local="128322068820000000" remote="128413809160000000" testing="0" />
+<file name="sound.gif" local="128359185200000000" remote="128413809160000000" testing="0" />
+<file name="spam.gif" local="128408542660000000" remote="128413809160000000" testing="0" />
+<file name="spell.gif" local="128287375540000000" remote="128413809170000000" testing="0" />
+<file name="star.gif" local="128407651700000000" remote="128413809180000000" testing="0" />
+<file name="starred.gif" local="128408642720000000" remote="128413809180000000" testing="0" />
+<file name="sunny.gif" local="128286601840000000" remote="128413809180000000" testing="0" />
+<file name="trans.gif" local="128242883360000000" remote="128413809190000000" testing="0" />
+<file name="up.gif" local="128311446360000000" remote="128413809190000000" testing="0" />
+<file name="uw.gif" local="128268544420000000" remote="128413809190000000" testing="0" />
+<file name="uwlogo.gif" local="128300589020000000" remote="128413809200000000" testing="0" />
+<file name="wbar.gif" local="128285214500000000" remote="128413809200000000" testing="0" />
+<file name="msglist.gif" local="128408824100000000" remote="128413809060000000" testing="0" />
+<file name="spam2.gif" local="128408777680000000" remote="128413809170000000" testing="0" />
+</dwsync> \ No newline at end of file
diff --git a/web/cgi/alpine/2.0/img/cbn/addcontact_sm.gif b/web/cgi/alpine/2.0/img/cbn/addcontact_sm.gif
new file mode 100644
index 00000000..cda1baf5
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/addcontact_sm.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/addfolder.gif b/web/cgi/alpine/2.0/img/cbn/addfolder.gif
new file mode 100644
index 00000000..81b5c230
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/addfolder.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/alert.gif b/web/cgi/alpine/2.0/img/cbn/alert.gif
new file mode 100644
index 00000000..e5726c12
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/alert.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/alpinelogo.gif b/web/cgi/alpine/2.0/img/cbn/alpinelogo.gif
new file mode 100644
index 00000000..bb68de83
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/alpinelogo.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/attach.gif b/web/cgi/alpine/2.0/img/cbn/attach.gif
new file mode 100644
index 00000000..ea0829a2
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/attach.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/attach_sm.gif b/web/cgi/alpine/2.0/img/cbn/attach_sm.gif
new file mode 100644
index 00000000..cdf108cc
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/attach_sm.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/base.gif b/web/cgi/alpine/2.0/img/cbn/base.gif
new file mode 100644
index 00000000..eb129763
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/base.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/blank.gif b/web/cgi/alpine/2.0/img/cbn/blank.gif
new file mode 100644
index 00000000..e565824a
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/blank.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/border-bl.gif b/web/cgi/alpine/2.0/img/cbn/border-bl.gif
new file mode 100644
index 00000000..0e27a994
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/border-bl.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/border-br.gif b/web/cgi/alpine/2.0/img/cbn/border-br.gif
new file mode 100644
index 00000000..494e4fdd
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/border-br.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/border-ft.gif b/web/cgi/alpine/2.0/img/cbn/border-ft.gif
new file mode 100644
index 00000000..201d1be3
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/border-ft.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/border-lt-2.gif b/web/cgi/alpine/2.0/img/cbn/border-lt-2.gif
new file mode 100644
index 00000000..445d1984
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/border-lt-2.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/border-lt.gif b/web/cgi/alpine/2.0/img/cbn/border-lt.gif
new file mode 100644
index 00000000..765c028e
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/border-lt.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/border-rt-2.gif b/web/cgi/alpine/2.0/img/cbn/border-rt-2.gif
new file mode 100644
index 00000000..93d40267
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/border-rt-2.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/border-rt.gif b/web/cgi/alpine/2.0/img/cbn/border-rt.gif
new file mode 100644
index 00000000..dc2f5661
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/border-rt.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/border-tl.gif b/web/cgi/alpine/2.0/img/cbn/border-tl.gif
new file mode 100644
index 00000000..64c223e9
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/border-tl.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/border-tr.gif b/web/cgi/alpine/2.0/img/cbn/border-tr.gif
new file mode 100644
index 00000000..10ce91ed
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/border-tr.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/btnbg.gif b/web/cgi/alpine/2.0/img/cbn/btnbg.gif
new file mode 100644
index 00000000..3cbf352a
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/btnbg.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/btnhi.gif b/web/cgi/alpine/2.0/img/cbn/btnhi.gif
new file mode 100644
index 00000000..ac407ae2
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/btnhi.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/but_back.gif b/web/cgi/alpine/2.0/img/cbn/but_back.gif
new file mode 100644
index 00000000..899f9832
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/but_back.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/ccme.gif b/web/cgi/alpine/2.0/img/cbn/ccme.gif
new file mode 100644
index 00000000..3b6de47f
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/ccme.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/check2.gif b/web/cgi/alpine/2.0/img/cbn/check2.gif
new file mode 100644
index 00000000..5f1149ae
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/check2.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/checkmail.gif b/web/cgi/alpine/2.0/img/cbn/checkmail.gif
new file mode 100644
index 00000000..41c37d5c
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/checkmail.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/close.gif b/web/cgi/alpine/2.0/img/cbn/close.gif
new file mode 100644
index 00000000..69183a09
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/close.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/close2.gif b/web/cgi/alpine/2.0/img/cbn/close2.gif
new file mode 100644
index 00000000..8ac7e070
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/close2.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/close3.gif b/web/cgi/alpine/2.0/img/cbn/close3.gif
new file mode 100644
index 00000000..b8d46aa4
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/close3.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/col.gif b/web/cgi/alpine/2.0/img/cbn/col.gif
new file mode 100644
index 00000000..674de394
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/col.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/colsel.gif b/web/cgi/alpine/2.0/img/cbn/colsel.gif
new file mode 100644
index 00000000..fab172f2
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/colsel.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/compose.gif b/web/cgi/alpine/2.0/img/cbn/compose.gif
new file mode 100644
index 00000000..97adb285
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/compose.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/contacts.gif b/web/cgi/alpine/2.0/img/cbn/contacts.gif
new file mode 100644
index 00000000..3992f1d1
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/contacts.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/dawg.gif b/web/cgi/alpine/2.0/img/cbn/dawg.gif
new file mode 100644
index 00000000..7d8fd606
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/dawg.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/dbar.gif b/web/cgi/alpine/2.0/img/cbn/dbar.gif
new file mode 100644
index 00000000..95bcde54
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/dbar.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/delete.gif b/web/cgi/alpine/2.0/img/cbn/delete.gif
new file mode 100644
index 00000000..2a160927
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/delete.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/detach.gif b/web/cgi/alpine/2.0/img/cbn/detach.gif
new file mode 100644
index 00000000..939f8fb1
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/detach.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/div.gif b/web/cgi/alpine/2.0/img/cbn/div.gif
new file mode 100644
index 00000000..51d339b5
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/div.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/div2.gif b/web/cgi/alpine/2.0/img/cbn/div2.gif
new file mode 100644
index 00000000..c4982c4a
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/div2.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/dn.gif b/web/cgi/alpine/2.0/img/cbn/dn.gif
new file mode 100644
index 00000000..0274736c
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/dn.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/edit.gif b/web/cgi/alpine/2.0/img/cbn/edit.gif
new file mode 100644
index 00000000..d2ecc2ef
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/edit.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/exclaim.gif b/web/cgi/alpine/2.0/img/cbn/exclaim.gif
new file mode 100644
index 00000000..e67522cd
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/exclaim.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/f_contacts.gif b/web/cgi/alpine/2.0/img/cbn/f_contacts.gif
new file mode 100644
index 00000000..a85a8ea2
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/f_contacts.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/f_delete.gif b/web/cgi/alpine/2.0/img/cbn/f_delete.gif
new file mode 100644
index 00000000..9c0de43a
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/f_delete.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/f_drafts.gif b/web/cgi/alpine/2.0/img/cbn/f_drafts.gif
new file mode 100644
index 00000000..23a6219d
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/f_drafts.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/f_folder.gif b/web/cgi/alpine/2.0/img/cbn/f_folder.gif
new file mode 100644
index 00000000..6e44b4e8
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/f_folder.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/f_inbox.gif b/web/cgi/alpine/2.0/img/cbn/f_inbox.gif
new file mode 100644
index 00000000..609c6be7
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/f_inbox.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/f_manage.gif b/web/cgi/alpine/2.0/img/cbn/f_manage.gif
new file mode 100644
index 00000000..b242c8a9
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/f_manage.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/f_minus.gif b/web/cgi/alpine/2.0/img/cbn/f_minus.gif
new file mode 100644
index 00000000..7071aa5a
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/f_minus.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/f_plus.gif b/web/cgi/alpine/2.0/img/cbn/f_plus.gif
new file mode 100644
index 00000000..1d35602f
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/f_plus.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/f_search.gif b/web/cgi/alpine/2.0/img/cbn/f_search.gif
new file mode 100644
index 00000000..6193a3b3
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/f_search.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/f_sent.gif b/web/cgi/alpine/2.0/img/cbn/f_sent.gif
new file mode 100644
index 00000000..8812a3f3
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/f_sent.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/f_spam.gif b/web/cgi/alpine/2.0/img/cbn/f_spam.gif
new file mode 100644
index 00000000..db33fe25
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/f_spam.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/fldsel.gif b/web/cgi/alpine/2.0/img/cbn/fldsel.gif
new file mode 100644
index 00000000..2d0181b7
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/fldsel.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/folder.gif b/web/cgi/alpine/2.0/img/cbn/folder.gif
new file mode 100644
index 00000000..eb129763
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/folder.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/folderopen.gif b/web/cgi/alpine/2.0/img/cbn/folderopen.gif
new file mode 100644
index 00000000..c5c31102
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/folderopen.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/foldersopen.gif b/web/cgi/alpine/2.0/img/cbn/foldersopen.gif
new file mode 100644
index 00000000..43ce5978
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/foldersopen.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/forward.gif b/web/cgi/alpine/2.0/img/cbn/forward.gif
new file mode 100644
index 00000000..aa513040
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/forward.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/fwd.gif b/web/cgi/alpine/2.0/img/cbn/fwd.gif
new file mode 100644
index 00000000..546ff6a3
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/fwd.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/group_contact.gif b/web/cgi/alpine/2.0/img/cbn/group_contact.gif
new file mode 100644
index 00000000..fe47f2b9
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/group_contact.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/help.gif b/web/cgi/alpine/2.0/img/cbn/help.gif
new file mode 100644
index 00000000..8eea6cbe
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/help.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/help_sm.gif b/web/cgi/alpine/2.0/img/cbn/help_sm.gif
new file mode 100644
index 00000000..97c369c7
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/help_sm.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/high.gif b/web/cgi/alpine/2.0/img/cbn/high.gif
new file mode 100644
index 00000000..a4d52bf4
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/high.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/highest.gif b/web/cgi/alpine/2.0/img/cbn/highest.gif
new file mode 100644
index 00000000..79df8035
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/highest.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/inbox.gif b/web/cgi/alpine/2.0/img/cbn/inbox.gif
new file mode 100644
index 00000000..dcf5e684
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/inbox.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/info.gif b/web/cgi/alpine/2.0/img/cbn/info.gif
new file mode 100644
index 00000000..9fdf8503
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/info.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/infomsg.gif b/web/cgi/alpine/2.0/img/cbn/infomsg.gif
new file mode 100644
index 00000000..5fa3d9ca
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/infomsg.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/lo.gif b/web/cgi/alpine/2.0/img/cbn/lo.gif
new file mode 100644
index 00000000..817eaeb2
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/lo.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/logo.gif b/web/cgi/alpine/2.0/img/cbn/logo.gif
new file mode 100644
index 00000000..ea072725
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/logo.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/logo.png b/web/cgi/alpine/2.0/img/cbn/logo.png
new file mode 100644
index 00000000..e2ba8952
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/logo.png
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/logoff.gif b/web/cgi/alpine/2.0/img/cbn/logoff.gif
new file mode 100644
index 00000000..cf1fba05
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/logoff.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/lookup.gif b/web/cgi/alpine/2.0/img/cbn/lookup.gif
new file mode 100644
index 00000000..a9ab6dcb
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/lookup.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/low.gif b/web/cgi/alpine/2.0/img/cbn/low.gif
new file mode 100644
index 00000000..f2924496
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/low.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/menu.gif b/web/cgi/alpine/2.0/img/cbn/menu.gif
new file mode 100644
index 00000000..f763c448
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/menu.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/msglist.gif b/web/cgi/alpine/2.0/img/cbn/msglist.gif
new file mode 100644
index 00000000..ad7c9b47
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/msglist.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/msglist.gif.bak b/web/cgi/alpine/2.0/img/cbn/msglist.gif.bak
new file mode 100644
index 00000000..ed77a81f
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/msglist.gif.bak
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/musicfolder.gif b/web/cgi/alpine/2.0/img/cbn/musicfolder.gif
new file mode 100644
index 00000000..f620789f
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/musicfolder.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/navbg.gif b/web/cgi/alpine/2.0/img/cbn/navbg.gif
new file mode 100644
index 00000000..3cbf352a
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/navbg.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/new.gif b/web/cgi/alpine/2.0/img/cbn/new.gif
new file mode 100644
index 00000000..abc16be0
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/new.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/page.gif b/web/cgi/alpine/2.0/img/cbn/page.gif
new file mode 100644
index 00000000..42d7318c
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/page.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/parent.gif b/web/cgi/alpine/2.0/img/cbn/parent.gif
new file mode 100644
index 00000000..48e54a65
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/parent.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/partly.gif b/web/cgi/alpine/2.0/img/cbn/partly.gif
new file mode 100644
index 00000000..858c6dca
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/partly.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/pg_down.gif b/web/cgi/alpine/2.0/img/cbn/pg_down.gif
new file mode 100644
index 00000000..9fba9e1b
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/pg_down.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/pg_first.gif b/web/cgi/alpine/2.0/img/cbn/pg_first.gif
new file mode 100644
index 00000000..fdd4784c
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/pg_first.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/pg_last.gif b/web/cgi/alpine/2.0/img/cbn/pg_last.gif
new file mode 100644
index 00000000..10f45d49
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/pg_last.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/pg_next.gif b/web/cgi/alpine/2.0/img/cbn/pg_next.gif
new file mode 100644
index 00000000..15a3b5fd
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/pg_next.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/pg_prev.gif b/web/cgi/alpine/2.0/img/cbn/pg_prev.gif
new file mode 100644
index 00000000..7db4db96
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/pg_prev.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/pg_up.gif b/web/cgi/alpine/2.0/img/cbn/pg_up.gif
new file mode 100644
index 00000000..e9f48410
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/pg_up.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/print.gif b/web/cgi/alpine/2.0/img/cbn/print.gif
new file mode 100644
index 00000000..69f75b53
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/print.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/question.gif b/web/cgi/alpine/2.0/img/cbn/question.gif
new file mode 100644
index 00000000..90d5be3e
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/question.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/question.jpg b/web/cgi/alpine/2.0/img/cbn/question.jpg
new file mode 100644
index 00000000..a62edb48
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/question.jpg
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/question.png b/web/cgi/alpine/2.0/img/cbn/question.png
new file mode 100644
index 00000000..82f3c144
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/question.png
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/question2.jpg b/web/cgi/alpine/2.0/img/cbn/question2.jpg
new file mode 100644
index 00000000..0a36fe45
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/question2.jpg
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/remove.gif b/web/cgi/alpine/2.0/img/cbn/remove.gif
new file mode 100644
index 00000000..fb1a338a
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/remove.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/rename.gif b/web/cgi/alpine/2.0/img/cbn/rename.gif
new file mode 100644
index 00000000..3cedb691
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/rename.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/replied.gif b/web/cgi/alpine/2.0/img/cbn/replied.gif
new file mode 100644
index 00000000..8ff06835
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/replied.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/replied_and_fwd.gif b/web/cgi/alpine/2.0/img/cbn/replied_and_fwd.gif
new file mode 100644
index 00000000..b3dd5a1b
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/replied_and_fwd.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/reply.gif b/web/cgi/alpine/2.0/img/cbn/reply.gif
new file mode 100644
index 00000000..c51ca60b
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/reply.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/replyall.gif b/web/cgi/alpine/2.0/img/cbn/replyall.gif
new file mode 100644
index 00000000..88d840ec
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/replyall.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/return.gif b/web/cgi/alpine/2.0/img/cbn/return.gif
new file mode 100644
index 00000000..0c04ee77
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/return.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/rt.gif b/web/cgi/alpine/2.0/img/cbn/rt.gif
new file mode 100644
index 00000000..bff6423d
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/rt.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/save.gif b/web/cgi/alpine/2.0/img/cbn/save.gif
new file mode 100644
index 00000000..5f3ef2c7
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/save.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/search.gif b/web/cgi/alpine/2.0/img/cbn/search.gif
new file mode 100644
index 00000000..1bef6fac
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/search.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/send.gif b/web/cgi/alpine/2.0/img/cbn/send.gif
new file mode 100644
index 00000000..2c140bdf
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/send.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/settings.gif b/web/cgi/alpine/2.0/img/cbn/settings.gif
new file mode 100644
index 00000000..9889b4fd
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/settings.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/sound.gif b/web/cgi/alpine/2.0/img/cbn/sound.gif
new file mode 100644
index 00000000..b9bd62aa
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/sound.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/spam.gif b/web/cgi/alpine/2.0/img/cbn/spam.gif
new file mode 100644
index 00000000..6bef9cea
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/spam.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/spam2.gif b/web/cgi/alpine/2.0/img/cbn/spam2.gif
new file mode 100644
index 00000000..569183a1
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/spam2.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/spell.gif b/web/cgi/alpine/2.0/img/cbn/spell.gif
new file mode 100644
index 00000000..79e7a1d3
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/spell.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/spritelib.gif b/web/cgi/alpine/2.0/img/cbn/spritelib.gif
new file mode 100644
index 00000000..56be9494
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/spritelib.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/spritelib.png b/web/cgi/alpine/2.0/img/cbn/spritelib.png
new file mode 100644
index 00000000..4b067efd
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/spritelib.png
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/star.gif b/web/cgi/alpine/2.0/img/cbn/star.gif
new file mode 100644
index 00000000..5a89f298
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/star.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/starred.gif b/web/cgi/alpine/2.0/img/cbn/starred.gif
new file mode 100644
index 00000000..c2622b01
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/starred.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/statbak.gif b/web/cgi/alpine/2.0/img/cbn/statbak.gif
new file mode 100644
index 00000000..a10a496f
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/statbak.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/statbakend.gif b/web/cgi/alpine/2.0/img/cbn/statbakend.gif
new file mode 100644
index 00000000..577c4ad8
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/statbakend.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/statbakl.gif b/web/cgi/alpine/2.0/img/cbn/statbakl.gif
new file mode 100644
index 00000000..4a95ed64
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/statbakl.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/statbakr.gif b/web/cgi/alpine/2.0/img/cbn/statbakr.gif
new file mode 100644
index 00000000..595f6177
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/statbakr.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/sunny.gif b/web/cgi/alpine/2.0/img/cbn/sunny.gif
new file mode 100644
index 00000000..285e7826
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/sunny.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/tome.gif b/web/cgi/alpine/2.0/img/cbn/tome.gif
new file mode 100644
index 00000000..11472f78
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/tome.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/trans.gif b/web/cgi/alpine/2.0/img/cbn/trans.gif
new file mode 100644
index 00000000..93b42998
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/trans.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/up.gif b/web/cgi/alpine/2.0/img/cbn/up.gif
new file mode 100644
index 00000000..0d3f5df5
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/up.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/uw.gif b/web/cgi/alpine/2.0/img/cbn/uw.gif
new file mode 100644
index 00000000..a3834ce8
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/uw.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/uwlogo.gif b/web/cgi/alpine/2.0/img/cbn/uwlogo.gif
new file mode 100644
index 00000000..2f636710
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/uwlogo.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/img/cbn/wbar.gif b/web/cgi/alpine/2.0/img/cbn/wbar.gif
new file mode 100644
index 00000000..73885025
--- /dev/null
+++ b/web/cgi/alpine/2.0/img/cbn/wbar.gif
Binary files differ
diff --git a/web/cgi/alpine/2.0/lib/INSTALL b/web/cgi/alpine/2.0/lib/INSTALL
new file mode 100644
index 00000000..1c8f3bdf
--- /dev/null
+++ b/web/cgi/alpine/2.0/lib/INSTALL
@@ -0,0 +1,3 @@
+
+Before running, the Yahoo U/I Library has to be installed
+so the "yui" link will work.
diff --git a/web/cgi/alpine/2.0/lib/common.js b/web/cgi/alpine/2.0/lib/common.js
new file mode 100644
index 00000000..89587f3a
--- /dev/null
+++ b/web/cgi/alpine/2.0/lib/common.js
@@ -0,0 +1,1586 @@
+/* $Id: common.js 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+ * ========================================================================
+ * Copyright 2008 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+
+// Globals
+YAHOO.namespace('alpine');
+YAHOO.alpine.current = { c:0, f:null, u:0 };
+YAHOO.alpine.mailcheck = { interval:null, timer:null };
+YAHOO.alpine.status = { timeout:null, message:[] };
+YAHOO.alpine.panel = { count: 0, width: 0 };
+YAHOO.alpine.containers = {};
+
+
+// INIT
+function browserDetect() {
+ if (YAHOO.env.ua.webkit > 0) {
+ document.write("<style type='text/css'> body {font-family:Helvetica,Tahoma,Sans Serif;} td,th {font-size:.75em;} </style>");
+ }
+}
+
+// GENERAL
+
+function clearTextField(txt, promptText) {
+ if (txt.value == promptText) {
+ txt.value = "";
+ }
+}
+
+function recallTextField(txt, promptText) {
+ if (txt.value == "") {
+ txt.value = promptText;
+ }
+}
+
+function showDisplayDiv(id) {
+ YAHOO.util.Dom.setStyle(id,'display','block');
+}
+
+function hideDisplayDivOrSpan(id) {
+ YAHOO.util.Dom.setStyle(id,'display','none');
+}
+
+function showDisplaySpan(id) {
+ YAHOO.util.Dom.setStyle(id,'display','inline');
+}
+
+function showLoading(){
+ var bp = document.getElementById("bePatient");
+ if(bp){
+ bp.style.top = "auto";
+ bp.style.left = "auto";
+ }
+}
+
+function hideLoading(){
+ var bp = document.getElementById("bePatient");
+ if(bp){
+ bp.style.top = "-999px";
+ bp.style.left = "-999px";
+ }
+}
+
+// MENU
+function menuSwap() {
+ this.className = "sfhover";
+}
+
+function menuBack() {
+ this.className = "menuHdr";
+}
+
+function menuFocus() {
+ this.parentNode.parentNode.parentNode.className = "sfhover";
+}
+
+function menuBlur() {
+ this.parentNode.parentNode.parentNode.className = "menuHdr";
+}
+
+function initMenus() {
+ if (document.getElementById) {
+ var LI = document.getElementsByTagName("li");
+ var zLI = LI.length;
+ for (var i = 0; i < zLI; i++) {
+ if (LI[i].parentNode.parentNode.className == "menuHdr") {
+ if (LI[i].firstChild.href) {
+ LI[i].firstChild.onfocus = menuFocus;
+ LI[i].firstChild.onblur = menuBlur;
+ }
+ }
+ if (LI[i].className == "menuHdr") {
+ LI[i].onmouseover = menuSwap;
+ LI[i].onmouseout = menuBack;
+ }
+ }
+ }
+}
+
+function updateElementHtml(id,html){
+ var el = document.getElementById(id);
+ if(el){
+ el.innerHTML = html;
+ return true;
+ }
+
+ return false;
+}
+
+function updateElementHref(id,href){
+ var el = document.getElementById(id);
+ if(el) el.href = href;
+}
+
+function updateElementValue(id,value){
+ var el = document.getElementById(id);
+ if(el) el.value = value;
+}
+
+function quoteHtml(s){
+ return s.replace(/</g, '&lt;').replace(/>/g, '&gt;');
+}
+
+// SETTINGS
+
+function showAdvancedSettings() {
+ hideDisplayDivOrSpan('normalSettings');
+ showDisplayDiv('advancedSettings');
+ return false;
+}
+
+function showNormalSettings() {
+ hideDisplayDivOrSpan('advancedSettings');
+ showDisplayDiv('normalSettings');
+ return false;
+}
+
+// COMPOSE
+
+function showMoreComposeHeaders() {
+ hideDisplayDivOrSpan('moreComposeHeaderText');
+ showDisplaySpan('lessComposeHeaderText');
+ showDisplayDiv('moreComposeHeaders');
+ return false;
+}
+
+function showLessComposeHeaders() {
+ hideDisplayDivOrSpan('lessComposeHeaderText');
+ showDisplaySpan('moreComposeHeaderText');
+ hideDisplayDivOrSpan('moreComposeHeaders');
+ return false;
+}
+
+// URI encode folder
+
+function encodeURIFolderPath(path) {
+ return encodeURIComponent(path).replace(/%2F/g,'/');
+}
+
+// HELP
+function openMailboxHelp(){
+ var d = YAHOO.util.Dom.getStyle('listTopMenubar','display');
+ if(d && d == 'none') openHelpWindow('read.html');
+ else openHelpWindow('inbox.html');
+ return(false);
+}
+
+function openHelpWindow(url) {
+ var top = 30;
+ var left = Math.floor(screen.availWidth * 0.66) - 10;
+ var width = Math.min(Math.floor(screen.availWidth * 0.33), 400);
+ var height = Math.floor(screen.availHeight * 0.8) - 30;
+ var win = window.open(document.getElementsByTagName('base')[0].href + "help/" + url, "helpwindow", "top=" + top + ",left=" + left + ",width=" + width + ",height=" + height + ",resizable=yes,scrollbars=yes,statusbar=no");
+ win.focus();
+}
+
+// NEW MAIL CHECK FUNCTIONS
+function setCheckMailFunction(elem,f){
+ var event = YAHOO.util.Event;
+ event.removeListener(elem,'click');
+ event.addListener(elem, 'click', function(e,o){ o.f(); }, { f:f });
+}
+
+function setNewMailCheckInterval(interval,onNewMail){
+ YAHOO.alpine.mailcheck.interval = interval;
+ startNewMailTimer(onNewMail);
+}
+
+function startNewMailTimer(onNewMail){
+ stopNewMailTimer();
+ var nmc = "newMailCheck(1,'"+onNewMail+"')";
+ YAHOO.alpine.mailcheck.timer = window.setTimeout(nmc, YAHOO.alpine.mailcheck.interval * 1000);
+}
+
+function stopNewMailTimer(){
+ if(YAHOO.alpine.mailcheck.timer){
+ window.clearTimeout(YAHOO.alpine.mailcheck.timer);
+ YAHOO.alpine.mailcheck.timer = null;
+ }
+}
+
+function newMailCheck(r,onNewMail){
+ stopNewMailTimer();
+ if(!r) r = 0;
+ YAHOO.util.Connect.asyncRequest('GET',
+ 'conduit/newmail.tcl' + encodeURI('?reload=' + r) + urlSalt('&'),
+ {
+ customevents:{
+ onStart:function(eventType){ showLoading(); },
+ onComplete:function(eventType){ hideLoading(); }
+ },
+ success: function(o){
+ eval('var objNM = '+o.responseText);
+ if(objNM.error){
+ addStatusMessage('Mail Check Error: ' + objNM.error,2);
+ }
+ else if(objNM.length > 0){
+ for(var i = 0; i < objNM.length; i++)
+ addStatusMessage(objNM[i].verbiage,10);
+
+ if(onNewMail && onNewMail.length) eval(onNewMail);
+ }
+ else if(!r)
+ addStatusMessage('No new mail has arrived',2);
+
+ displayStatusMessages();
+ },
+ failure: function(o){
+ addStatusMessage('newMailCheck Failure: '+o.statusText,15);
+ displayStatusMessages();
+ }
+ });
+
+ startNewMailTimer(onNewMail);
+ return false;
+}
+
+// STATUS MESSAGES
+
+function showStatusMessage(smText,smTimeout){
+ if(updateElementHtml('statusMessageText', smText)){
+ var dom = YAHOO.util.Dom;
+ dom.setStyle('statusMessage','display','block');
+ dom.setStyle('weatherBar','display','none');
+
+ clearStatusMessageTimeout();
+ // number arg to setTimeout is how long status messages are displayed
+ YAHOO.alpine.status.timeout = window.setTimeout('flipStatusMessages(hideStatusMessageOnInput)', ((smTimeout > 0) ? smTimeout : 10) * 1000);
+ }
+}
+
+function clearStatusMessageLine(){
+ var dom = YAHOO.util.Dom;
+ dom.setStyle('statusMessage','display','none');
+ dom.setStyle('weatherBar','display','block');
+}
+
+function actuallyHideStatusMessage(){
+ var event = YAHOO.util.Event;
+ event.removeListener(window,'click');
+ event.removeListener(window,'keydown');
+ clearStatusMessageLine();
+}
+
+function hideStatusMessageOnInput(){
+ var event = YAHOO.util.Event;
+ event.addListener(window,'keydown',actuallyHideStatusMessage);
+ event.addListener(window,'click',actuallyHideStatusMessage);
+}
+
+function flipStatusMessages(fn){
+ clearStatusMessageTimeout();
+ // nothing else to display, then restore original content
+ if(!displayStatusMessages()) fn();
+}
+
+function hideStatusMessage(){
+ flipStatusMessages(clearStatusMessageLine);
+}
+
+function clearStatusMessageTimeout(){
+ var t = YAHOO.alpine.status.timeout;
+ if(t){
+ window.clearTimeout(t);
+ t = null;
+ }
+}
+
+function displayStatusMessages(){
+ var smq = YAHOO.alpine.status.message;
+ if(smq.length){
+ var statusMessage = smq[0];
+ smq.splice(0,1);
+ showStatusMessage(statusMessage.text,statusMessage.timeout);
+ return true;
+ }
+
+ return false;
+}
+
+function addStatusMessage(smText,smTimeout){
+ if(smText){
+ var smEntry = {};
+ var smq = YAHOO.alpine.status.message;
+ if(typeof smText == 'object') smEntry.text = smText.html;
+ else smEntry.text = smText.replace(/</g,'&lt;');
+ if(smTimeout) smEntry.timeout = smTimeout;
+ smq[smq.length] = smEntry;
+ }
+}
+
+// LIST SELECTION
+function markAll(o,listId,mark) {
+ var chk = document.getElementsByName(listId);
+ var isChecked = o.checked;
+ if (chk) {
+ if (isNaN(chk.length)) {
+ chk.checked = isChecked;
+ mark(chk);
+ }
+ else {
+ for(var i = 0; i < chk.length; i++) {
+ chk[i].checked = isChecked;
+ mark(chk[i]);
+ }
+ }
+ }
+}
+
+function markOne(o) {
+ var elTR = o.parentNode.parentNode;
+ if(elTR.tagName == 'TR'){
+ var dom = YAHOO.util.Dom;
+ if(o.checked){
+ if(!dom.hasClass(elTR, 'choice')) dom.addClass(elTR, 'choice');
+ }
+ else{
+ if(dom.hasClass(elTR, 'choice')) dom.removeClass(elTR, 'choice');
+ }
+ }
+}
+
+// SCRIPT EVAL
+function evalScripts(htmlText){
+ var reScript = '<script[^>]*>([\\S\\s]*?)<\/script>';
+ var scriptOuter = new RegExp(reScript,'img');
+ var scriptInner = new RegExp(reScript,'im');
+ var scripts = htmlText.match(scriptOuter);
+ if(scripts)
+ for(var si = 0; si < scripts.length; si++){
+ var script = scripts[si].match(scriptInner);
+ if(script) eval(script[1]);
+ }
+}
+
+// MAINTAIN UNREAD COUNT
+function incUnreadCount(fl,n){
+ var unreadObj = document.getElementById('unread' + fl);
+ if(unreadObj){
+ var unreadMatch = unreadObj.innerHTML.match(/ \((\d+)\)/m);
+ if(unreadMatch && unreadMatch[1]){
+ var unreadCount = unreadMatch[1];
+ while(n-- > 0) unreadCount++;
+ if(unreadCount > 0) unreadObj.innerHTML = ' (' + unreadCount + ')';
+ else unreadObj.innerHTML = '';
+ }
+ else if(n > 0){
+ unreadObj.innerHTML = ' (' + n + ')';
+ }
+ }
+}
+
+function decUnreadCount(fl,n){
+ var unreadObj = document.getElementById('unread' + fl);
+ if(unreadObj){
+ var unreadMatch = unreadObj.innerHTML.match(/ \((\d+)\)/m);
+ if(unreadMatch && unreadMatch[1]){
+ var unreadCount = unreadMatch[1];
+ while(n-- > 0 && unreadCount > 0) unreadCount--;
+ if(unreadCount > 0) unreadObj.innerHTML = ' (' + unreadCount + ')';
+ else unreadObj.innerHTML = '';
+ }
+ }
+}
+
+function urlSalt(conjunction){
+ var now = new Date();
+ return conjunction + 'salt=' + now.getTime();
+}
+
+// EMPTY TRASH
+function emptyFolder(c,f,u,oDone) {
+ var eUrl = 'conduit/empty.tcl?c=' + encodeURIComponent(c) + '&f=' + encodeURIFolderPath(f);
+ if(u) eUrl += '&u=' + encodeURIComponent(u);
+ YAHOO.util.Connect.asyncRequest('GET',
+ eUrl + urlSalt('&'),
+ {
+ customevents:{
+ onStart:function(eventType){ showLoading(); },
+ onComplete:function(eventType){ hideLoading(); }
+ },
+ success: function(o) {
+ // valid response is "<numApplied> <numSelected> <numTotalMsgs>"
+ var matchResult;
+ if((matchResult = o.responseText.match(/^(\d+)$/m)) == null){
+ showStatusMessage('Error: ' + o.responseText, 10);
+ }
+ else if(oDone){
+ if(oDone.status){
+ showStatusMessage(matchResult[1] + ' messages from ' + f + ' deleted forever', 3);
+ YAHOO.alpine.current.count -= matchResult[1];
+ if(u == 'selected' && matchResult[1] > 0){
+ YAHOO.alpine.current.selected -= matchResult[1];
+ hideSelectAllInfo();
+ }
+ }
+ if(oDone.fn) eval(oDone.fn);
+ }
+ },
+ failure: function(o) { showStatusMessage('Request Failure: ' + o.statusText + '. Please report this.', 10)}
+ });
+ return false;
+}
+
+// ALERTS AND DIALOGS
+function newPanel(width){
+ var dom = YAHOO.util.Dom;
+ YAHOO.alpine.panel.count++;
+ var panelId = 'panel' + YAHOO.alpine.panel.count;
+ var panel = new YAHOO.widget.Panel(panelId,
+ {
+ //fixedcenter: true,
+ xy:[210,120],
+ underlay: 'none',
+ width:width,
+ visible: false,
+ modal:true,
+ dragOnly:true,
+ close: true,
+ constraintoviewport: true
+ });
+
+ // common footer
+ var pFoot = document.createDocumentFragment();
+ var div = document.createElement('div');
+ dom.addClass(div,'bl');
+ pFoot.appendChild(div);
+ div = document.createElement('div');
+ dom.addClass(div,'br');
+ pFoot.appendChild(div);
+ panel.setFooter(pFoot);
+ return(panel);
+}
+
+function closePanel(panel){
+ YAHOO.alpine.panel.button = null;
+ if(YAHOO.alpine.panel.keylistener){
+ YAHOO.alpine.panel.keylistener.disable();
+ YAHOO.alpine.panel.keylistener = null;
+ }
+
+ panel.hide();
+ panel.destroy();
+}
+
+function panelHeader(content){
+ var dom = YAHOO.util.Dom;
+ var pHead = document.createDocumentFragment();
+
+ var el = document.createElement('div');
+ dom.addClass(el,'tl');
+ pHead.appendChild(el);
+
+ el = document.createElement('span');
+ el.innerHTML = content;
+ pHead.appendChild(el);
+
+ el = document.createElement('div');
+ dom.addClass(el,'tr');
+ pHead.appendChild(el);
+
+ return pHead;
+}
+
+function panelBody(kind,content,buttons){
+ var frag, div;
+ var dom = YAHOO.util.Dom;
+
+ var frag = document.createDocumentFragment();
+
+ div = document.createElement('div');
+ dom.addClass(div,'dialogIcon');
+ dom.addClass(div,kind);
+ frag.appendChild(div);
+
+ div = document.createElement('div');
+ div.setAttribute('id',kind+'Body');
+ dom.addClass(div,'dialogBody');
+ if(content.html) div.innerHTML = content.html;
+ else if(content.frag) div.appendChild(content.frag);
+
+ frag.appendChild(div);
+
+ div = document.createElement('div');
+ dom.addClass(div,'yui-skin-sam');
+ dom.addClass(div,'dialogButtons');
+ frag.appendChild(div);
+ if(buttons){
+ for(var n = 0; n < buttons.length; n++){
+ var butCont = document.createElement('span');
+ butCont.setAttribute('id','pb' + (n + 1));
+ dom.addClass(butCont,'yuibutton');
+ div.appendChild(butCont);
+ var oButAtt = buttons[n];
+ oButAtt.container = butCont.id;
+ var b = new YAHOO.widget.Button(oButAtt);
+ if(oButAtt.disabled){
+ YAHOO.alpine.panel.button = b;
+ YAHOO.alpine.panel.keylistener = oButAtt.keylistener;
+ }
+ }
+ }
+
+ return frag;
+}
+
+function panelAlert(s,f){
+ var buttons = [{ id:'butClose',type:'button',label:'OK',onclick:{ fn: function(){ closePanel(panel); }}}];
+ var panel = newPanel('26em');
+ panel.setHeader(panelHeader('Alert!'));
+ if(f) buttons[0].onclick = function(){ f(); closePanel(panel); };
+ panel.setBody(panelBody('alert',{html:s},buttons));
+ panel.render(document.body);
+ getPanelBodyWidth('alert');
+ panel.show();
+ return false;
+}
+
+function panelConfirm(s,oYes,oNo){
+ var buttons = [{id:'butYes',type:'button',label:'OK'},{id:'butClose',label:'Cancel',onclick:{ fn:function(){ closePanel(panel); }}}];
+ var panel = newPanel('30em');
+ panel.setHeader(panelHeader('Confirm'));
+ if(oYes){
+ if(oYes.text) buttons[0].label = oYes.text;
+ if(oYes.url){
+ buttons[0].type = 'link';
+ buttons[0].href = oYes.url;
+ }
+ else if(oYes.fn){
+ buttons[0].type = 'button';
+ buttons[0].onclick = { fn: function() { oYes.fn(oYes.args) ; closePanel(panel); }};
+ }
+ }
+
+ if(oNo){
+ if(oNo.text) buttons[1].label = oNo.text;
+ if(oNo.fn) buttons[1].onclick = { fn: function(){ closePanel(panel); oNo.fn(); }};
+ }
+
+ panel.setBody(panelBody('prompt',{html:s},buttons));
+ panel.render(document.body);
+ panel.show();
+ getPanelBodyWidth('prompt');
+ return false;
+}
+
+function panelDialog(title,body,done,onClose){
+ var buttons = [];
+ var panel = newPanel('640px');
+ panel.setHeader(panelHeader(title));
+ if(done && done.fn){
+ var i = buttons.length;
+ buttons[i] = {
+ type:'button',
+ id:done.label.replace(/ /g,'_').toLowerCase(),
+ label:done.label,
+ disabled:done.disabled,
+ onclick:{
+ fn: function(){
+ done.fn();
+ closePanel(panel);
+ }
+ }
+ };
+
+ if(done.doonreturn){
+ buttons[i].keylistener = new YAHOO.util.KeyListener(document, { keys:13 },
+ {
+ fn:function() { done.fn(); closePanel(panel) },
+ scope:panel,
+ correctScope: true
+ });
+
+ if(!done.disabled) panel.cfg.queueProperty("keylisteners", buttons[i].keylistener);
+ }
+
+ if(done.buttonId) buttons[i].id = done.butId;
+ }
+
+ buttons[buttons.length] = {
+ id:'butClose',
+ type:'button',
+ label:'Cancel',
+ onclick:{ fn: function(){ if(onClose) onClose(); closePanel(panel); } }
+ };
+
+ panel.setBody(panelBody('dialog',{frag:body},buttons));
+ panel.render(document.body);
+ panel.show();
+ getPanelBodyWidth('dialog');
+ return false;
+}
+
+function drawFolderList(idContainer,defCollection){
+ if(idContainer && idContainer.length){
+ var el = document.getElementById(idContainer);
+ if(el){
+ newFolderList(el,null,defCollection);
+ YAHOO.alpine.containers.folderlist = el;
+ }
+ }
+}
+
+function newFolderList(elContainer,controlObj,collection,path,objParm){
+ var alp = YAHOO.alpine;
+ alp.resubmitRequest = function(){ newFolderList(elContainer,controlObj,collection,path,objParm); };
+ alp.cancelRequest = function(){ newFolderList(elContainer,controlObj,alp.current.c,"",objParm); };
+ if(elContainer){
+ var nUrl = 'conduit/folderlist.tcl/' + collection + '/';
+ if(path && path.length) nUrl += encodeURIFolderPath(path) + '/';
+ var conj = '?';
+ var prop, parms = '';
+ if(objParm){
+ for(prop in objParm){
+ parms += conj + prop + '=' + encodeURIComponent(objParm[prop]);
+ conj = '&';
+ }
+ }
+ YAHOO.util.Connect.asyncRequest('GET',
+ nUrl + parms + urlSalt(conj),
+ {
+ customevents:{
+ onStart:function(eventType){ showLoading(); },
+ onComplete:function(eventType){ hideLoading(); }
+ },
+ success: function(o){
+ elContainer.innerHTML = o.responseText;
+ evalScripts(o.responseText);
+ window.scrollTo(0,0);
+ },
+ failure: function(o) { showStatusMessage('Error getting list: '+o.statusText,10); },
+ argument: [elContainer]
+ });
+ if(controlObj) controlObj.blur();
+ }
+
+ return false;
+}
+
+function processAuthException(o){
+ switch(o.code){
+ case 'CERTQUERY' :
+ panelConfirm('The SSL/TLS certificate for the server<p><center>' + o.server + '</center><br>cannot be validated.<p>The problem is: ' + o.reason,
+ {text:'Accept Certificate',fn:acceptCert,args:{server:o.server}},{fn:YAHOO.alpine.cancelRequest});
+ break;
+ case 'CERTFAIL' :
+ panelAlert('The security certificate on server ' + o.server +' is not acceptable<p>The problem is: ' + o.reason);
+ break;
+ case 'NOPASSWD' :
+ getCredentials(o);
+ break;
+ case 'BADPASSWD' :
+ getCredentials(o);
+ break;
+ default :
+ addStatusMessage('Unknown Authorization Code: ' + o.code, 15);
+ displayStatusMessages();
+ break;
+ }
+}
+
+function acceptCert(o){
+ YAHOO.util.Connect.asyncRequest('GET',
+ 'conduit/cert.tcl?server=' + encodeURIComponent(o.server) + '&accept=yes' + urlSalt('&'),
+ {
+ customevents:{
+ onStart:function(eventType){ showLoading(); },
+ onComplete:function(eventType){ hideLoading(); }
+ },
+ success: function(o){ if(YAHOO.alpine.resubmitRequest) YAHOO.alpine.resubmitRequest(); },
+ failure: function(o){
+ addStatusMessage('Certificate Acceptance Failure: '+o.statusText,15);
+ displayStatusMessages();
+ }
+ });
+}
+
+function getCredentials(o){
+ var dom = YAHOO.util.Dom;
+ var alp = YAHOO.alpine;
+
+ var div = document.createElement('div');
+ dom.addClass(div,'getAuth');
+
+ var d = document.createElement('div');
+ var tail = (o.server) ? ' to '+ o.server + '.' : '...';
+ var e = document.createTextNode('Authorization is required to ' + o.reason + '. Please login'+tail);
+ d.appendChild(e);
+ div.appendChild(d);
+
+ e = document.createElement('span');
+ e.innerHTML = 'Username:';
+ div.appendChild(e);
+ var u = createInputElement('text','u');
+ div.appendChild(u);
+
+ e = document.createElement('hr');
+ div.appendChild(e);
+
+ e = document.createElement('span');
+ e.innerHTML = 'Password:';
+ div.appendChild(e);
+ var p = createInputElement('password','p');
+ div.appendChild(p);
+
+ hideLoading();
+
+ panelDialog('Login',
+ div,
+ {
+ label:'Login',
+ doonreturn: true,
+ fn:function(){
+ YAHOO.util.Connect.asyncRequest('POST',
+ alp.cgi_root + '/session/setauth2.tcl',
+ {
+ customevents:{
+ onStart:function(eventType){ showLoading(); },
+ onComplete:function(eventType){ hideLoading(); }
+ },
+ success: function(o){ if(alp.resubmitRequest) alp.resubmitRequest(); },
+ failure: function(o){
+ addStatusMessage('Login Failure: '+o.statusText,15);
+ displayStatusMessages();
+ }
+ },
+ 'auths=Login&user=' + encodeURIComponent(u.value) + '&pass=' + encodeURIComponent(p.value) + '&c=' + encodeURIComponent(o.c) + '&f=' + encodeURIComponent(o.server) + '&sessid=' + encodeURIComponent(o.sessid)+ urlSalt('&'));
+ }
+ },
+ alp.cancelRequest);
+
+ u.focus();
+ return false;
+}
+
+function getSmimePassphrase(o){
+ var dom = YAHOO.util.Dom;
+ var alp = YAHOO.alpine;
+
+ var div = document.createElement('div');
+ dom.addClass(div,'getAuth');
+
+ var d = document.createElement('div');
+ var addr = (o.addr) ? ' for '+ o.addr : '';
+ var e = document.createTextNode('Passphrase is required'+addr+' to decrypt.');
+ d.appendChild(e);
+ div.appendChild(d);
+
+ e = document.createElement('span');
+ e.innerHTML = 'Passphrase:';
+ div.appendChild(e);
+ var p = createInputElement('password','p');
+ div.appendChild(p);
+
+ hideLoading();
+
+ panelDialog('Enter S/MIME Passphrase',
+ div,
+ {
+ label:'Done',
+ fn:function(){
+ YAHOO.util.Connect.asyncRequest('POST',
+ alp.cgi_root + '/session/setpassphrase.tcl',
+ {
+ customevents:{
+ onStart:function(eventType){ showLoading(); },
+ onComplete:function(eventType){ hideLoading(); }
+ },
+ success: function(o){newMessageText(o);},
+ failure: function(o){}
+ },
+ 'auths=Smime&pass=' + encodeURIComponent(p.value) + '&sessid=' + encodeURIComponent(o.sessid)+ urlSalt('&'));
+ }
+ });
+
+ return false;
+}
+
+
+function flistPick(elChoice,fn){
+ elChoice.blur();
+ var el = document.getElementById('flPick');
+ if(el) el.removeAttribute('id');
+ elChoice.parentNode.parentNode.setAttribute('id','flPick');
+ updateElementValue('pickFolderName', decodeURIComponent(fn));
+ panelDialogEnableButton(true);
+ return false;
+}
+
+function flistPickPick(elChoice){
+ var el = document.getElementById('butChoose');
+ if(el){ // two contexts for this element: View/Manage, cp/mv dialog
+ if('A' == el.nodeName) window.location.href = elChoice.href;
+ else if('SPAN' == el.nodeName) el.firstChild.firstChild.click();
+ }
+ return false;
+}
+
+function panelDialogEnableButton(tf){
+ if(YAHOO.alpine.panel.button) YAHOO.alpine.panel.button.set('disabled',!tf);
+ if(YAHOO.alpine.panel.keylistener){
+ if(tf)
+ YAHOO.alpine.panel.keylistener.enable();
+ else
+ YAHOO.alpine.panel.keylistener.disable();
+ }
+}
+
+function panelDialogInputChange(e){
+ panelDialogEnableButton(YAHOO.util.Event.getTarget(e).value.length > 0);
+}
+
+function showFolderList(e){
+ hideDisplayDivOrSpan('showFolderList');
+ showDisplaySpan('hideFolderList');
+ showDisplayDiv('folderList');
+ YAHOO.util.Event.preventDefault(e);
+}
+
+function hideFolderList(e){
+ hideDisplayDivOrSpan('hideFolderList');
+ showDisplaySpan('showFolderList');
+ hideDisplayDivOrSpan('folderList');
+ YAHOO.util.Event.preventDefault(e);
+}
+
+function pickFolder(containerID,label,defCollection,onDone){
+ var dom = YAHOO.util.Dom;
+ var dbody = document.createDocumentFragment();
+ var div = document.createElement('div');
+ dom.addClass(div,'flistInstructions');
+ div.innerHTML = label + ' to: '
+
+ var elFolderName = createInputElement('text','pickFolderName');
+ elFolderName.setAttribute('id','pickFolderName');
+ elFolderName.value = '';
+ div.appendChild(elFolderName);
+ YAHOO.util.Event.addListener(elFolderName,'keyup',panelDialogInputChange);
+
+ el = document.createTextNode(' ');
+ div.appendChild(el);
+
+ var elFolderCollection = createInputElement('hidden','folderCollection');
+ elFolderCollection.value = defCollection;
+ elFolderCollection.setAttribute('id','pickFolderCollection');
+ div.appendChild(elFolderCollection);
+
+ var elFolderPath = createInputElement('hidden','pickFolderPath');
+ elFolderPath.setAttribute('id','pickFolderPath');
+ div.appendChild(elFolderPath);
+
+ dbody.appendChild(div);
+ div = document.createElement('div');
+ div.setAttribute('id',containerID);
+ div.innerHTML = 'Loading...';
+ dbody.appendChild(div);
+
+ panelDialog(label,
+ dbody,
+ {
+ buttonId:'butChoose',
+ label:label,
+ disabled: true,
+ doonreturn: true,
+ fn: function(){
+ var fc = elFolderCollection.value;
+ var fp = elFolderPath.value;
+ var fn = elFolderName.value;
+ if(fp && fp.length) fn = fp + '/' + fn;
+ if(fc >= 0 && fn && fn.length) onDone({c:fc,f:fn});
+ else showStatusMessage('No folder name provided. No messages moved or copied.',5);
+ }
+ });
+
+ elFolderName.focus();
+ drawFolderList(containerID,defCollection);
+ return false;
+}
+
+function getPanelBodyWidth(panelType){
+ var region = YAHOO.util.Dom.getRegion(panelType+'Body');
+ YAHOO.alpine.panel.width = region.right - region.left - 12;
+}
+
+function setPanelBodyWidth(className){
+ if(YAHOO.env.ua.ie > 0 && YAHOO.alpine.panel.width){
+ var dom = YAHOO.util.Dom;
+ var elArray = dom.getElementsByClassName(className,'div');
+ if(elArray){
+ for(var i = 0; i < elArray.length; i++){
+ dom.setStyle(elArray[i],'width', YAHOO.alpine.panel.width);
+ }
+ }
+ }
+}
+
+// CONTACTS EDITOR
+function contactEditor(oMode,onDone){
+ var dom = YAHOO.util.Dom;
+ var form, input, div, label, el;
+
+ function newField(fieldName,input,inputId,defaultValue){
+ var div = document.createElement('div');
+ dom.addClass(div,'contactSection');
+ var el = document.createElement('div');
+ div.appendChild(el);
+ dom.addClass(el,'contactField');
+ el.innerHTML = fieldName +':';
+ input.setAttribute('id',inputId);
+ if(defaultValue) input.value = defaultValue;
+ div.appendChild(input);
+ return(div);
+ }
+
+ function validateFields(){
+ var n = 0;
+ var fields = {book:'',ai:'',contactNick:'',contactName:'',contactEmail:'',contactNotes:'',contactFcc:''};
+
+ for(var f in fields) {
+ var el = document.getElementById(f);
+ if(el && el.value && el.value.length){
+ var val = el.value.replace(/\n/g, '').replace(/^[ \t]*/, '').replace(/[ \t]*$/, '');
+ if(val.length){
+ fields[f] = val;
+ n++;
+ }
+ }
+ }
+
+ return((n > 0) ? fields : null);
+ }
+
+ if(oMode.which == 'add'){
+ label = 'Add';
+ }
+ else if(oMode.which == 'edit'){
+ label = 'Change';
+ }
+ else return false;
+
+ form = document.createElement('form');
+ dom.addClass(form,'contactEditor');
+
+ if(oMode.books == null){
+ el = createInputElement('hidden','book');
+ form.appendChild(el);
+ el.setAttribute('id','book');
+ el.value = (oMode.book > 0) ? oMode.book : 0;
+ }
+
+ el = createInputElement('hidden','ai');
+ form.appendChild(el);
+ el.setAttribute('id','ai');
+ el.value = (oMode.index) ? oMode.index : -1;
+
+ el = createInputElement('hidden','origNick');
+ form.appendChild(el);
+ el.setAttribute('id','origNick');
+ if(oMode.nickname) el.value = oMode.nickname;
+
+ el = document.createElement('div');
+ form.appendChild(el);
+ dom.addClass(el,'context');
+ el.innerHTML = label + ' Contact';
+
+ input = createInputElement('text','contactNick');
+ form.appendChild(newField('Nickname',input,'contactNick',oMode.nickname));
+ form.appendChild(newField('Display Name',createInputElement('text','contactName'),'contactName',oMode.personal));
+
+ if(oMode.group){
+ var elEmail = createNameValueElement('textarea', 'name', 'contactEmail');
+ form.appendChild(newField('Group Email',elEmail,'contactEmail',oMode.email));
+ if(oMode.which){
+ var checked = contactsChecked();
+ if(checked.length){
+ var comma = '';
+ for(var i = 0; i < checked.length; i++){
+ getContact({ book:checked[i].book, index:checked[i].index, f:function(c){ elEmail.value += comma + c.email ; comma = ',\n'; } });
+ }
+ }
+ }
+ }
+ else
+ form.appendChild(newField('Email',createInputElement('text', 'contactEmail'),'contactEmail',oMode.email));
+
+ form.appendChild(newField('Notes',createNameValueElement('textarea', 'name', 'contactNotes'),'contactNotes',oMode.note));
+ form.appendChild(newField('Fcc Folder',createInputElement('text','contactFcc'),'contactFcc',oMode.fcc));
+
+ if(oMode.books != null){
+ var sel = document.createElement('select');
+ sel.setAttribute('name','book');
+ sel.setAttribute('id','book');
+ for(var i = 0; i < oMode.books.length; i++){
+ var opt = new Option(oMode.books[i].name,oMode.books[i].book);
+ sel.options[sel.options.length] = opt;
+ }
+
+ sel.selectedIndex = 0;
+ form.appendChild(newField('Address Book',sel,'book'));
+ }
+
+ if(!onDone) onDone = storeContact;
+ panelDialog(label, form, { label:label, fn: function(){ onDone(validateFields()); }});
+ input.focus();
+ return false;
+}
+
+function getContact(o){
+ o.which = 'edit';
+ var takeDS = new YAHOO.util.DataSource('conduit/getcontact.tcl?book=' + o.book + '&index=');
+ takeDS.responseType = YAHOO.util.DataSource.TYPE_XML;
+ takeDS.responseSchema = {
+ resultNode: 'Result',
+ fields: ['Nickname','Personal','Mailbox','Fcc','Note']
+ };
+ takeDS.sendRequest(o.index,
+ {
+ success: function(oReq,oResp,oPayload){
+ if(oResp.results.length == 1){
+ o.nickname = oResp.results[0].Nickname;
+ o.personal = oResp.results[0].Personal;
+ o.email = oResp.results[0].Mailbox;
+ if(o.email.search(/,/) >= 0) o.group = true;
+ o.note = oResp.results[0].Note;
+ o.fcc = oResp.results[0].Fcc;
+ o.f(o);
+ }
+ else showStatusMessage('Too many entries to Edit', 10);
+ },
+ failure: function(oReq,oResp,oPayload){
+ showStatusMessage('Error Taking Address: ' + oResp.responseText, 10);
+ },
+ scope: this,
+ argument:[o]
+ });
+ return(false);
+}
+
+function storeContact(oFields){
+ if(oFields){
+ var sUrl = 'conduit/storecontact.tcl?';
+ for(var f in oFields) sUrl += '&' + f + '=' + encodeURIComponent(oFields[f]);
+ storeDS = new YAHOO.util.DataSource(sUrl);
+ storeDS.responseType = YAHOO.util.DataSource.TYPE_XML;
+ storeDS.responseSchema = {
+ resultNode: 'Result',
+ fields: ['StatusText']
+ };
+ // bug: if present, store parts should be passed in draw request
+ storeDS.sendRequest('',
+ {
+ success: function(oReq,oResp,oPayload){
+ for(var i = 0; i < oResp.results.length; i++) addStatusMessage(oResp.results[i].StatusText, 10);
+ displayStatusMessages();
+ },
+ failure: function(oReq,oResp,oPayload){
+ showStatusMessage('Error Taking Address: ' + oResp.responseText, 10);
+ },
+ scope: this
+ });
+ }
+}
+
+
+function contactsChecked(gripe){
+ var chkd = [];
+ var i, entry, l = document.getElementsByName('nickList');
+ if(l){
+ for(i = 0; i < l.length; i++){
+ if(l[i].checked){
+ entry = l[i].value.match(/^(\d+)\.(\d+)\.(.*)$/);
+ if(entry) chkd[chkd.length] = { book:entry[1], index:entry[2], nick:entry[3] };
+ }
+ }
+ }
+
+ if(gripe != undefined && 0 == chkd.length){
+ var t = 'No Contacts Selected<p>Choose contacts by clicking checkbox to left of contact.';
+ if(gripe.length) t += 'Then press ' + gripe;
+ panelAlert(t);
+ }
+
+ return(chkd);
+}
+
+// LOAD From: INTO CONTACT EDITOR
+function takeAddressFrom(uid,o){
+ var books = (o) ? o.books : null;
+ // get personal and email based on uid
+ takeDSRequest = 'conduit/take.tcl?op=from&u=';
+ takeDS = new YAHOO.util.DataSource(takeDSRequest);
+ takeDS.responseType = YAHOO.util.DataSource.TYPE_XML;
+ takeDS.responseSchema = {
+ resultNode: 'Result',
+ fields: ['Type','Email','Personal','Nickname','Fcc','Note']
+ };
+ takeDS.sendRequest(uid,
+ {
+ customevents:{
+ onStart:function(eventType){ showLoading(); },
+ onComplete:function(eventType){ hideLoading(); }
+ },
+ success: function(oReq,oResp,oPayload){
+ if(oResp.results.length == 1){
+ var o = {
+ which:oResp.results[0].Type,
+ nickname:oResp.results[0].Nickname,
+ personal:oResp.results[0].Personal,
+ email:oResp.results[0].Email,
+ fcc:oResp.results[0].Fcc,
+ note:oResp.results[0].Note
+ };
+ if(books) o.books = books;
+ contactEditor(o);
+ }
+ else showStatusMessage('Too many From addresses, Use Take', 10);
+ },
+ failure: function(oReq,oResp,oPayload){
+ showStatusMessage('Error Taking Address: ' + oResp.responseText, 10);
+ },
+ scope: this,
+ arguments:[books]
+ });
+
+ return true;
+}
+
+// CONTACT LISTER
+
+function newContactList(elContainer,controlObj,idBook,objParm){
+ if(elContainer){
+ var nUrl = 'conduit/contactlist.tcl/' + idBook;
+ var conj = '?';
+ var prop, parms = '';
+ if(objParm){
+ for(prop in objParm){
+ parms += conj + prop + '=' + encodeURIComponent(objParm[prop]);
+ conj = '&';
+ }
+ }
+ YAHOO.util.Connect.asyncRequest('GET',
+ nUrl + parms + urlSalt(conj),
+ {
+ customevents:{
+ onStart:function(eventType){ showLoading(); },
+ onComplete:function(eventType){ hideLoading(); }
+ },
+ success: function(o){
+ elContainer.innerHTML = o.responseText;
+ evalScripts(o.responseText);
+ setPanelBodyWidth('clistContacts');
+ window.scrollTo(0,0);
+ },
+ failure: function(o){
+ showStatusMessage('Cannot build list: '+o.statusText,10);
+ },
+ argument: [elContainer]
+ });
+ if(controlObj) controlObj.blur();
+ }
+ return false;
+}
+
+function drawContactList(idContainer,idBook,objParm){
+ if(idContainer && idContainer.length){
+ var el = document.getElementById(idContainer);
+ if(el){
+ newContactList(el,null,idBook,objParm);
+ YAHOO.alpine.containers.contactlist = el;
+ }
+ }
+}
+
+// Search within Content
+function searchContent(context,treeId){
+ var elSearch = document.getElementById('searchField');
+ if(elSearch && elSearch.value && elSearch.value.length){
+ var dom = YAHOO.util.Dom;
+ var i, j, node, nodeParent;
+ var oldMatches = dom.getElementsByClassName('searchMatch','span',treeId);
+ for(i = 0; i < oldMatches.length; i++){
+ // BUG: coalesce node's text and prev/next sibling's text into single node
+ node = oldMatches[i];
+ nodeParent = node.parentNode;
+ for(j = 0; j < node.childNodes.length; j++) nodeParent.insertBefore(node.childNodes[j].cloneNode(true),node);
+ nodeParent.removeChild(node);
+ }
+
+ var lcSearch = elSearch.value.toLowerCase();
+ var nodeText, matchOffset, found = {n:0};
+ var removeNodes = [];
+ var nodeArray = function(root){
+ var textNodes = [];
+
+ function appendTextNodes(el){
+ for(var o = el.firstChild; o; o = o.nextSibling){
+ switch(o.nodeType){
+ case 3 : textNodes[textNodes.length] = o; break;
+ case 1 : appendTextNodes(o); break;
+ }
+ }
+ }
+
+ appendTextNodes(root);
+ return(textNodes);
+ }(document.getElementById(treeId));
+
+ var nodeBefore, nodeAfter, span;
+ for(i = 0; i < nodeArray.length; i++){
+ node = nodeArray[i];
+ nodeText = node.nodeValue;
+ matchOffset = nodeText.toLowerCase().indexOf(lcSearch);
+ if(matchOffset >= 0){
+ parentNode = node.parentNode;
+ nodeBefore = document.createTextNode(nodeText.substr(0,matchOffset));
+ nodeAfter = document.createTextNode(nodeText.substr(matchOffset+lcSearch.length));
+ matchText = nodeText.substr(matchOffset, lcSearch.length);
+ span = document.createElement("span");
+ dom.addClass(span,'searchMatch');
+ span.appendChild(document.createTextNode(matchText));
+ parentNode.insertBefore(nodeBefore,node);
+ parentNode.insertBefore(span,node);
+ parentNode.insertBefore(nodeAfter,node);
+ removeNodes[removeNodes.length] = {child: node, parent: parentNode};
+ found.n++;
+ if(!found.o) found.o = parentNode;
+ }
+ }
+
+ for(i = 0; i < removeNodes.length; i++){
+ node = removeNodes[i];
+ node.parent.removeChild(node.child)
+ }
+ }
+
+ if(found.n > 0){
+ var plural = (found.n > 1) ? 'es' : '';
+ showStatusMessage(found.n + ' match' + plural + ' found', 3);
+ found.o.scrollIntoView();
+ }
+ else showStatusMessage('No ' + context + ' found matching your seach', 3);
+
+ return(false);
+}
+
+// Advanced search
+function advanceSearch(){
+ var dom = YAHOO.util.Dom;
+ var i, d, form, el, span, dates;
+ var elScope, elWhichAddr, elWhichAddrText, elWhichSubj, elWhichSubjText, elWhichBody, elWhichBodyText, elWhichStatus, elWhichDate, elMonth, elDay, elYear;
+ function newSearchDiv(cl,el){
+ var div = document.createElement('div');
+ dom.addClass(div,cl);
+ if(el) div.appendChild(el);
+ return(div);
+ }
+
+ function newSearch(title,elSelect,elCriteria){
+ var div = document.createElement('div');
+ dom.addClass(div,'searchSection');
+ div.appendChild(newSearchDiv('searchField',document.createTextNode(title + ':')));
+ div.appendChild(newSearchDiv('searchType',elSelect));
+ div.appendChild(newSearchDiv('searchTerm',elCriteria));
+ return(div);
+ }
+
+ function newSelect(id,opts,onchange){
+ var elSel = document.createElement('select');
+ elSel.setAttribute('name',id);
+ elSel.setAttribute('id',id);
+ if(onchange) YAHOO.util.Event.addListener(elSel,'change',onchange);
+ for(var i = 0; i < opts.length; i++) elSel.options[elSel.options.length] = new Option(opts[i],i);
+ return elSel;
+ }
+
+ function newInput(id){
+ var el = createInputElement('text',id);
+ el.setAttribute('id',id);
+ YAHOO.util.Event.addListener(el,'keypress',searchOnEnter,'_search_');
+ return(el);
+ }
+
+ form = document.createElement('form');
+ dom.addClass(form,'advanceSearch');
+
+ el = document.createElement('div');
+ form.appendChild(el);
+ dom.addClass(el,'context');
+ el.innerHTML = 'Search in ' + quoteHtml(YAHOO.alpine.current.f);
+
+ el = document.getElementById('searchRefine');
+ if(el){
+ d = dom.getStyle(el,'display');
+ if(d && d != 'none'){
+ el = document.createElement('div');
+ form.appendChild(el);
+ dom.addClass(el,'scope');
+ elScope = newSelect('searchScope',['Perform this search within current search results','Add results of this search to current results','Perform a fresh search, abandoning the current results']);
+ el.appendChild(elScope);
+ }
+ }
+
+ elWhichAddr = newSelect('whichAddr',['From:','To:','Cc:','From:, Cc:','From:, To:, Cc:']);
+ elWhichAddrText = newInput('textAddr');
+ form.appendChild(newSearch('Address',elWhichAddr,elWhichAddrText));
+ elWhichSubj = newSelect('whichSubj',['Contains','Does Not Contain']);
+ elWhichSubjText = newInput('textSubj');
+ form.appendChild(newSearch('Subject',elWhichSubj,elWhichSubjText));
+ elWhichBody = newSelect('whichBody',['Contains','Does Not Contain']);
+ elWhichBodyText = newInput('textBody');
+ form.appendChild(newSearch('Message Text',elWhichBody,elWhichBodyText));
+
+ // prep date fields
+ span = document.createElement('span');
+ span.setAttribute('id','searchDates');
+ dom.setStyle(span,'display','none');
+ elMonth = newSelect('searchMonth',['------','January','February','March','April','May','June','July','August','September','October','November','December']);
+ span.appendChild(elMonth);
+ dates = ['--'];
+ for(i = 1; i < 32; i++) dates[dates.length] = i;
+ elDay = newSelect('searchDay', dates);
+ span.appendChild(elDay);
+ el= document.createTextNode(', ');
+ span.appendChild(el);
+ dates = ['----'];
+ d = new Date();
+ for(i = d.getFullYear(); i > 1970; i--) dates[dates.length] = i;
+ elYear = newSelect('searchYear',dates);
+ span.appendChild(elYear);
+ elWhichDate = newSelect('whichDate',['Anytime','Today','Past week','Past month','On','Since','Before'],advanceSearchDate);
+ form.appendChild(newSearch('Date',elWhichDate,span));
+
+ // empty searchTerm
+ elWhichStatus = newSelect('whichStatus',['All Messages','Unread Messages','Read Messages','Starred Messages','Unstarred Messages']);
+ form.appendChild(newSearch('Status',elWhichStatus));
+
+ panelDialog('Advanced Search',
+ form,
+ {
+ label:' Search ',
+ doonreturn: true,
+ fn: function() {
+ var scope = 'new', criteria = '';
+
+ if(elScope){
+ scope = ['narrow','broad'][elScope.selectedIndex];
+ }
+
+ if(elWhichAddrText.value.length){
+ criteria += '{text ton ' + ['from','to','cc','recip','partic'][elWhichAddr.selectedIndex] + ' {' + elWhichAddrText.value + '}} ';
+ }
+
+ if(elWhichSubjText.value.length){
+ criteria += '{text ';
+ criteria += (elWhichSubj.selectedIndex > 0) ? 'not' : 'ton';
+ criteria += ' subj {' + elWhichSubjText.value + '}} ';
+ }
+
+ if(elWhichBodyText.value.length){
+ criteria += '{text ';
+ criteria += (elWhichBody.selectedIndex > 0) ? 'not' : 'ton';
+ criteria += ' body {' + elWhichBodyText.value + '}} ';
+ }
+
+ if(elWhichDate.selectedIndex > 0 && elMonth.selectedIndex > 0 && elDay.selectedIndex > 0 && elYear.selectedIndex > 0){
+ criteria += '{date ' + ['','on','since','since','on','since','before'][elWhichDate.selectedIndex];
+ criteria += ' ' + elYear.options[elYear.selectedIndex].text;
+ criteria += ' ' + elMonth.options[elMonth.selectedIndex].text.substring(0,3).toLowerCase();
+ criteria += (elDay.selectedIndex < 10) ? ' 0' : ' ';
+ criteria += elDay.selectedIndex;
+ criteria += '} ';
+ }
+
+ if(elWhichStatus.selectedIndex > 0){
+ criteria += '{status ' + ['','ton new','not new','ton imp','not imp'][elWhichStatus.selectedIndex] + '} ';
+ }
+
+ newMessageList({parms:{op:'search',type:'compound',scope:scope,criteria:criteria,page:'new'}});
+ }
+ });
+
+ return false;
+}
+
+function advanceSearchDate(e){
+ var y, d = new Date();
+
+ function setSelect(id,i){
+ var el = document.getElementById(id);
+ if(el) el.selectedIndex = i;
+ }
+
+ function setSearchDate(m,d,y){
+ setSelect('searchMonth',m);
+ setSelect('searchDay',d);
+ setSelect('searchYear',y);
+ }
+
+ switch(YAHOO.util.Event.getTarget(e).selectedIndex){
+ case 0 :
+ hideDisplayDivOrSpan('searchDates');
+ setSearchDate(0,0,0);
+ break;
+ case 1:
+ hideDisplayDivOrSpan('searchDates');
+ setSearchDate(d.getMonth() + 1, d.getDate(), 1);
+ break;
+ case 2 :
+ hideDisplayDivOrSpan('searchDates');
+ y = d.getFullYear();
+ d.setDate(d.getDate() - 7);
+ setSearchDate(d.getMonth() + 1,d.getDate(),(y - d.getFullYear()) + 1);
+ break;
+ case 3 :
+ hideDisplayDivOrSpan('searchDates');
+ y = d.getFullYear();
+ if(d.getMonth()) d.setMonth(d.getMonth() - 1); else d.setMonth(11);
+ setSearchDate(d.getMonth() + 1, d.getDate(),(y - d.getFullYear()) + 1);
+ break;
+ default :
+ showDisplaySpan('searchDates');
+ setSearchDate(d.getMonth() + 1, d.getDate(), 1);
+ break;
+ }
+}
+
+function searchOnEnter(e,btn){
+ if(YAHOO.util.Event.getCharCode(e) == 13){
+ var el = document.getElementById(btn);
+ if(el){
+ // dig thru any decoration to find button
+ while(el && !el.click) el = el.firstChild;
+ if(el && el.click){
+ el.click();
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+function rotateNews(el){
+ if(el.parentNode){
+ var dom = YAHOO.util.Dom;
+ var node = el.parentNode;
+
+ dom.setStyle(node, 'display', 'none');
+ if(node.nextSibling && node.nextSibling.tagName == 'SPAN'){
+ node = node.nextSibling;
+ }
+ else{
+ for(var node = el.parentNode; node.previousSibling && node.previousSibling.tagName == 'SPAN'; node = node.previousSibling)
+ ;
+ }
+
+ dom.setStyle(node,'display','inline');
+ }
+
+ return false;
+}
+
+function printContent(){
+ window.print();
+ return false;
+}
+
+// Test to see if a folder exists, create if asked
+function folderExists(o){
+ var eUrl = 'conduit/exists.tcl' + encodeURI('?c=' + o.c + '&f=' + o.f);
+
+ function onYes(o){
+ folderExists(o);
+ if(o.onDone) o.onDone();
+ }
+
+ if (o.create != undefined)
+ eUrl += '&create=' + o.create;
+
+ YAHOO.util.Connect.asyncRequest('GET',
+ eUrl + urlSalt('&'),
+ {
+ success: function(retObj) {
+ eval('var exObj = '+retObj.responseText);
+ if(exObj.exists != undefined){
+ if(!exObj.exists){
+ o.create = 'yes';
+ panelConfirm('Folder does not exist. Create it?',{text:'Create',fn:onYes,args:o},{fn:o.oncancel});
+ }
+ else if(o.onDone){
+ o.onDone();
+ }
+ }
+ else{
+ if(exObj.error != undefined)
+ alert('ERROR: '+exObj.error);
+ else
+ alert('INCONCLUSIVE: '+retObj.responseText);
+ }
+ },
+ failure: function(retObj) { newStatusMessage('Request Failure: ' + retObj.statusText); }
+ });
+}
+
+// Hacks to work around IE
+function createInputElement(type,name){
+ if(YAHOO.env.ua.ie > 0){
+ return(document.createElement('<input type="' + type + '" type="' + name + '" name="' + name + '">'));
+ }
+
+ var el = document.createElement('input');
+ el.setAttribute('type',type);
+ el.setAttribute('id',name);
+ el.setAttribute('name',name);
+ return(el);
+}
+
+function createNameValueElement(tag, name, nameAttr){
+ if(YAHOO.env.ua.ie > 0){
+ return(document.createElement('<' + tag + ' ' + name + '="' + nameAttr + '">'));
+ }
+
+ var el = document.createElement(tag);
+ el.setAttribute(name,nameAttr);
+ return(el);
+}
+
+// HACKS TO MAINTAIN FIX DIV IN VIEWPORT
+function sizeVPHeight(){
+ // force msg txt container to fit in viewport
+ var dom = YAHOO.util.Dom;
+ var docHeight = dom.getDocumentHeight();
+ var topToolbarY = dom.getY('topToolbar');
+ var alpineContentY = dom.getY('alpineContent');
+ var bottomToolbarY = dom.getY('bottomToolbar');
+ var bottomHeight = docHeight - bottomToolbarY;
+ var contentHeight = dom.getViewportHeight() - (alpineContentY + bottomHeight);
+ var leftColumnHeight = contentHeight + (alpineContentY - topToolbarY);
+ if(contentHeight > 0){
+ dom.setStyle('alpineContent','height', Math.round(contentHeight));
+ dom.setStyle('leftColumn','height', Math.round(leftColumnHeight));
+ }
+}
+
+function resizeVPHeight(){
+ var dom = YAHOO.util.Dom;
+ dom.setStyle('alpineContent','height', 'auto');
+ dom.setStyle('leftColumn','height', 'auto');
+ sizeVPHeight();
+}
+
+// DEBUGGING
+function dumpProp(o){
+ var s = '';
+ for(p in o) s += p + ' = ' + o[p] + '\n';
+ return s;
+}
diff --git a/web/cgi/alpine/2.0/lib/compose.js b/web/cgi/alpine/2.0/lib/compose.js
new file mode 100644
index 00000000..52eddea9
--- /dev/null
+++ b/web/cgi/alpine/2.0/lib/compose.js
@@ -0,0 +1,833 @@
+/* $Id: compose.js 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+ * ========================================================================
+ * Copyright 2008 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+// globals in our namespace
+YAHOO.alpine.autodraft = { timeout:0, timer:null, reporttimer:null };
+YAHOO.alpine.pickcontact = { tabs:null, markup:null };
+YAHOO.alpine.uploading = 0;
+YAHOO.alpine.expandaddress = 1;
+
+
+function initSimpleEditor(focus){
+ var dom = YAHOO.util.Dom;
+ var edRegion = dom.getRegion('composeText');
+ var textareaHeight = edRegion.bottom - edRegion.top;
+ var textareaWidth = edRegion.right - edRegion.left - 10;
+ if(edRegion){
+ var editAttrib = {
+ height:textareaHeight,
+ width: textareaWidth,
+ toolbar: {
+ draggable: false,
+ buttons: [
+ { group: 'fontstyle', label: 'Font Name and Size',
+ buttons: [
+ { type: 'select', label: 'Arial', value: 'fontname', disabled: true,
+ menu: [
+ { text: 'Arial', checked: true },
+ { text: 'Arial Black' },
+ { text: 'Comic Sans MS' },
+ { text: 'Courier New' },
+ { text: 'Lucida Console' },
+ { text: 'Tahoma' },
+ { text: 'Times New Roman' },
+ { text: 'Trebuchet MS' },
+ { text: 'Verdana' }
+ ]
+ },
+ { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true }
+ ]
+ },
+ { type: 'separator' },
+ { group: 'textstyle', label: 'Font Style',
+ buttons: [
+ { type: 'push', label: 'Bold', value: 'bold' },
+ { type: 'push', label: 'Italic', value: 'italic' },
+ { type: 'push', label: 'Underline', value: 'underline' },
+ { type: 'separator' },
+ { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true },
+ { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true }
+ ]
+ },
+ { type: 'separator' },
+ { group: 'indentlist', label: 'Lists',
+ buttons: [
+ { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' },
+ { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' }
+ ]
+ },
+ { type: 'separator' },
+ { group: 'alignment', label: 'Alignment',
+ buttons: [
+ { type: 'push', label: 'Align Left', value: 'justifyleft' },
+ { type: 'push', label: 'Align Center', value: 'justifycenter' },
+ { type: 'push', label: 'Align Right', value: 'justifyright' },
+ { type: 'push', label: 'Justify', value: 'justifyfull' }
+ ]
+ },
+ { type: 'separator' },
+ { group: 'insertitem', label: 'Insert Item',
+ buttons: [
+ { type: 'push', label: 'Insert/Edit HTML Link', value: 'createlink', disabled: true },
+ { type: 'push', label: 'Insert Image', value: 'insertimage' }
+ ]
+ }
+ ]
+ }
+ };
+ if(focus){
+ editAttrib.focusAtStart = true;
+ }
+ gRichtextEditor = new YAHOO.widget.SimpleEditor('composeText', editAttrib);
+ gRichtextEditor.textareaHeight = textareaHeight;
+ gRichtextEditor.textareaWidth = textareaWidth;
+ }
+}
+
+
+function flipRichText(){
+ var dom = YAHOO.util.Dom;
+ if(gRichState){
+ gRichState = 0;
+ gRichtextEditor.saveHTML();
+ var stripHTML = /<\S[^><]*>/g;
+ gRichtextEditor.get('textarea').value = gRichtextEditor.get('textarea').value.replace(/<br>/gi, '\n').replace(stripHTML, '').replace(/&lt;/g,'<').replace(/&gt;/g,'>');
+ dom.setStyle(gRichtextEditor.get('element_cont').get('firstChild'), 'position', 'absolute');
+ dom.setStyle(gRichtextEditor.get('element_cont').get('firstChild'), 'top', '-9999px');
+ dom.setStyle(gRichtextEditor.get('element_cont').get('firstChild'), 'left', '-9999px');
+ gRichtextEditor.get('element_cont').removeClass('yui-editor-container');
+ dom.setStyle(gRichtextEditor.get('element'), 'visibility', 'visible');
+ dom.setStyle(gRichtextEditor.get('element'), 'top', '');
+ dom.setStyle(gRichtextEditor.get('element'), 'left', '');
+ dom.setStyle(gRichtextEditor.get('element'), 'height', gRichtextEditor.textareaHeight);
+ dom.setStyle(gRichtextEditor.get('element'), 'width', gRichtextEditor.textareaWidth);
+ dom.setStyle(gRichtextEditor.get('element'), 'position', 'static');
+ document.getElementById('flipRich').innerHTML = 'Rich Text';
+ }
+ else{
+ if(!gRichtextRendered){
+ // fixup initial text
+ var t = document.getElementById('composeText').value.replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\n/g, '<br>');
+ document.getElementById('composeText').value = t;
+ initSimpleEditor(1);
+ gRichtextEditor.render();
+ gRichtextRendered = true;
+ }
+ gRichState = 1;
+ dom.setStyle(gRichtextEditor.get('element_cont').get('firstChild'), 'position', 'static');
+ dom.setStyle(gRichtextEditor.get('element_cont').get('firstChild'), 'top', '0');
+ dom.setStyle(gRichtextEditor.get('element_cont').get('firstChild'), 'left', '0');
+ dom.setStyle(gRichtextEditor.get('element'), 'visibility', 'hidden');
+ dom.setStyle(gRichtextEditor.get('element'), 'top', '-9999px');
+ dom.setStyle(gRichtextEditor.get('element'), 'left', '-9999px');
+ dom.setStyle(gRichtextEditor.get('element'), 'position', 'absolute');
+ gRichtextEditor.get('element_cont').addClass('yui-editor-container');
+ gRichtextEditor._setDesignMode('on');
+ if(gRichtextEditor.get('textarea')) gRichtextEditor.setEditorHTML(gRichtextEditor.get('textarea').value.replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\n/g, '<br>'));
+ document.getElementById('flipRich').innerHTML = 'Plain Text';
+ }
+
+ return false;
+}
+
+function autoSizeThis(e){
+ if(e.keyCode == 13 || e.keyCode == 10) YAHOO.util.Event.preventDefault(e);
+ else autoSize(this);
+}
+
+function autoSize(el){
+ var dom = YAHOO.util.Dom;
+ var r = dom.getRegion(el)
+ var th = r.bottom - r.top;
+ var maxh = 3 * gFieldHeight;
+ if(!el.value.length){
+ dom.setStyle(el,'height',(gFieldHeight + 4)+'px');
+ }
+ else if(th < maxh){
+ if(el.scrollHeight > gFieldHeight){
+ var h = (2 * (gFieldHeight));
+ if(el.scrollHeight > h) h += gFieldHeight;
+ dom.setStyle(el,'height',h + 'px');
+ }
+ }
+}
+
+function autoSizeAddressField(id){
+ var el = document.getElementById(id);
+ if(el){
+ if(!gFieldHeight){
+ var r = YAHOO.util.Dom.getRegion(el);
+ gFieldHeight = r.bottom - r.top - 4;
+ }
+
+ YAHOO.util.Event.addListener(el,'keypress',autoSizeThis);
+ autoSize(el);
+ }
+}
+
+function autoCompleteDefaults(o){
+ if(o){
+ o.delimChar = ',';
+ o.maxResultsDisplayed = 12;
+ o.minQueryLength = 2;
+ o.queryDelay = 0.25;
+ o.autoHighlight = true;
+ o.animSpeed = 0.1;
+ o.formatResult = function(aResults, sQuery) {
+ var r, where;
+ // highlight matching substrings
+ var oREHilite = new RegExp(sQuery,'ig');
+ var sEmail = aResults[0].replace(/[<]/,'&lt;')
+ var sNick = aResults[1].replace(/[<]/,'&lt;')
+ r = sEmail.replace(oREHilite,'<b>$&</b>');
+ where = sNick.replace(oREHilite,'<b>$&</b>');
+ if(where.length) r += ' (' + where + ')';
+ return r;
+ };
+
+ o.textboxBlurEvent.subscribe(function(oSelf){
+ var el = o.getInputEl();
+ if(el.value.length) validateAddressField(el);
+ });
+ o.containerCollapseEvent.subscribe(function(oSelf){
+ var el = o.getInputEl();
+ if(el.value.length) validateAddressField(el);
+ });
+ }
+}
+
+function actuallySend(o){
+ YAHOO.alpine.resubmitRequest = function(){ actuallySend(o); };
+
+ if(YAHOO.alpine.disablePost) return;
+
+ stopAutoDrafting();
+
+ document.getElementById('sendOp').value = o.op;
+
+ if(gRichtextEditor && gRichState){
+ gRichtextEditor.saveHTML();
+ document.getElementById('contentSubtype').value = 'HTML';
+ }
+
+ showLoading();
+
+ while(YAHOO.alpine.uploading > 0)
+ panelAlert('Finishing attachment upload before sending...');
+
+ document.getElementById('composeForm').submit();
+}
+
+function sendSuccess(m){
+ var alp = YAHOO.alpine;
+ alp.disablePost = true;
+ window.location.replace(alp.cgi_base + 'browse/' + alp.current.c + '/' + alp.current.f);
+}
+
+function sendFailure(m){
+ addStatusMessage('Send Failure: ' + m, 10);
+ displayStatusMessages();
+ hideLoading();
+}
+
+function processPostAuthException(o){
+ YAHOO.alpine.cancelRequest = null;
+ processAuthException(o);
+}
+
+function cancelComposition(dest){
+ stopAutoDrafting();
+ var changes = 0;
+ var el, changeFields = ['fieldTo','fieldCc','fieldBcc','fieldSubject'];
+ for (f in changeFields){
+ el = document.getElementById(changeFields[f]);
+ changes += el.value.length;
+ }
+
+ if(!changes){
+ if(gRichState){
+ changes += gRichtextEditor.getEditorHTML().length;
+ }
+ else{
+ el = document.getElementById('composeText');
+ if(el) changes += el.value.length;
+ }
+ }
+
+ if(changes) panelConfirm('You have unsaved changes.<br><br>Click <b>Discard</b> to abandon your text and exit Compose.<br>Click <b>Cancel</b> to continue editing.',{text:'Discard',fn:abandonComposition,args:{url:dest}},{fn:startAutoDrafting});
+ else abandonComposition({url:dest});
+
+ return false;
+}
+
+function sendComposition(){
+ stopAutoDrafting();
+
+ if(!(document.getElementById('fieldTo').value.length
+ || document.getElementById('fieldCc').value.length
+ || document.getElementById('fieldBcc').value.length
+ || document.getElementById('fieldFcc').value.length)){
+ panelAlert('Message must contain at least one To, Cc, Bcc, or Fcc recipient!', startAutoDrafting);
+ }
+ else{
+ //panelConfirm('Are you sure you want to send this message?',{text:'Send',fn:actuallySend,args:{op:'send'}},{fn:startAutoDrafting});
+ actuallySend({op:'send'});
+ }
+
+ return false;
+}
+
+function saveDraft(){
+ actuallySend({op:'postpone'});
+ return false;
+}
+
+function setAutoDraftInterval(iTimeOut){
+ YAHOO.alpine.autodraft.timeout = iTimeOut;
+ startAutoDrafting();
+}
+
+function startAutoDrafting(){
+ var aa = YAHOO.alpine.autodraft;
+ if(aa.timeout) aa.timer = window.setTimeout('autoDraft();', aa.timeout * 1000);
+}
+
+function stopAutoDrafting(){
+ var aa = YAHOO.alpine.autodraft;
+ if(aa.timer) clearTimeout(aa.timer);
+ aa.timer = null;
+}
+
+function autoDraft(){
+ var form = document.getElementById('composeForm');
+ var formTarget = form.getAttribute('target');
+ form.setAttribute('target','formResponse');
+ actuallySend({op:'autodraft'});
+ form.setAttribute('target', formTarget);
+ startAutoDrafting();
+ var date = new Date();
+ YAHOO.alpine.autodraft.drafted = date.getTime();
+}
+
+function reportAutoDraftUpdate(){
+ var aa = YAHOO.alpine.autodraft;
+ var nn = new Date();
+ var drafted = new Date(aa.drafted);
+ var delt = Math.floor((nn.getTime() - aa.drafted) / 60000);
+ var hours = ( drafted.getHours() % 12 );
+ var minutes = drafted.getMinutes();
+ var ispm = ( drafted.getHours() > 12 );
+ if(hours < 1) hours = 12;
+ if(minutes < 10) minutes = '0' + minutes;
+ var t = 'Copy saved to Drafts at ' + hours + ':' + minutes + ' ';
+ if(ispm)
+ t += 'PM';
+ else
+ t += 'AM';
+
+ if(delt > 0){
+ t += ' (' + delt + ' minute';
+ if(delt > 1) t += 's';
+ t += ' ago)';
+ }
+
+ document.getElementById('lastAutoDraft').innerHTML = t;
+}
+
+function reportAutoDraft(result){
+ if(result.match(/^[0-9]+$/)){
+ var aa = YAHOO.alpine.autodraft;
+ var date = new Date();
+ document.getElementById('autoDraftUid').value = result;
+ var drafted = new Date(aa.drafted);
+ var minutes = drafted.getMinutes();
+ if(minutes < 10) minutes = '0' + minutes;
+ document.getElementById('lastAutoDraft').innerHTML = 'Copy saved to Drafts at ' + ( drafted.getHours() % 12 ) + ':' + minutes + ' (less than one minute ago)';
+ if(aa.reporttimer) clearInterval(aa.reporttimer);
+ aa.reporttimer = setInterval('reportAutoDraftUpdate();', + 60000);
+ }
+ else{
+ document.getElementById('lastAutoDraft').innerHTML = 'Copy save to Drafts FAILED: ' + result;
+ addStatusMessage('Copy autosave to Drafts failed: ' + result, 10);
+ displayStatusMessages();
+ }
+}
+
+function abandonComposition(o){
+ var u = document.getElementById('autoDraftUid').value;
+ if(u.match(/^\d+$/) && u > 0){
+ emptyFolder(gDefCol, gDraftFolder, u, {fn:'window.location.href="' + o.url + '"'});
+ }
+ else{
+ window.location.href = o.url;
+ }
+}
+
+function drawAttachmentList(o){
+ var dom = YAHOO.util.Dom;
+ var el, attachList = document.getElementById('attachList');
+ var idList = '';
+ var comma = '';
+ hideLoading();
+ while(attachList.childNodes.length) attachList.removeChild(attachList.childNodes[0]);
+ if(o){
+ if(o.error){
+ addStatusMessage('Attach Error: ' + o.error, 10);
+ displayStatusMessages();
+ }
+
+ if(o.attachments && o.attachments.length){
+ var frag = document.createDocumentFragment();
+ var delim = '', len, size, bytes;
+ for(var i = 0; i < o.attachments.length; i++){
+ idList += comma + o.attachments[i].id;
+
+ if(delim.length){
+ el = document.createTextNode(delim);
+ frag.appendChild(el);
+ }
+
+ el = document.createElement('img');
+ el.setAttribute('src','img/cbn/attach_sm.gif');
+ frag.appendChild(el);
+
+ l = o.attachments[i].size.length;
+ if(l > 6){
+ size = o.attachments[i].size.substr(0, l - 6);
+ bytes = 'MB';
+ }
+ else if(o.attachments[i].size.length > 3){
+ size = o.attachments[i].size.substr(0, l - 3);
+ bytes = 'KB';
+ }
+ else{
+ size = o.attachments[i].size;
+ bytes = 'B';
+ }
+
+ el = document.createElement('span');
+ dom.addClass(el,'attachmentName');
+ el.innerHTML = o.attachments[i].fn + ' ' + '(' + size + ' ' + bytes + ')';
+ frag.appendChild(el);
+
+ el = document.createElement('a');
+ el.setAttribute('href','#');
+ YAHOO.util.Event.addListener(el,'click',removeAttachment,{id:o.attachments[i].id});
+ var img = document.createElement('img');
+ img.setAttribute('src','img/cbn/remove.gif');
+ dom.addClass(img,'wap');
+ el.appendChild(img);
+ frag.appendChild(el);
+
+ delim = ': ';
+ comma = ',';
+ }
+
+ attachList.appendChild(frag);
+ dom.setStyle('composeAttachments','display','block');
+ }
+ else{
+ dom.setStyle('composeAttachments','display','none');
+ if(el) el.innerHTML = '';
+ }
+ }
+
+ el = document.getElementById('attachments');
+ if(el) el.setAttribute('value',idList);
+}
+
+function attachFile(e){
+ var target = YAHOO.util.Event.getTarget(e);
+ if(target.value.length){
+ var elRemove = target.parentNode.parentNode;
+ var elParent = elRemove.parentNode;
+ YAHOO.util.Connect.setForm(target.parentNode,true);
+ YAHOO.alpine.uploading++;
+ YAHOO.util.Connect.asyncRequest('POST','conduit/attach.tcl', {
+ upload: function(response){
+ YAHOO.alpine.uploading--;
+ elParent.removeChild(elRemove);
+ }
+ });
+ }
+ else
+ panelAlert('No File Attached');
+
+ return false;
+}
+
+function addAttachField(){
+ var event = YAHOO.util.Event;
+ var dom = YAHOO.util.Dom;
+
+ dom.setStyle('composeAttachments','display','block');
+
+ var parentDiv = document.getElementById('fileUpload');
+ if(parentDiv.childNodes.length < 20){
+ var div = document.createElement('div');
+ parentDiv.appendChild(div);
+ dom.addClass(div,'attachInput');
+
+ var form = document.createElement('form');
+ div.appendChild(form);
+
+ form.setAttribute('action','conduit/attach.tcl');
+ form.setAttribute('method','POST');
+ form.setAttribute('enctype','multipart/form-data');
+ form.setAttribute('target','formResponse');
+ dom.generateId(form);
+
+ var input = createInputElement('file','file');
+ form.appendChild(input);
+ input.setAttribute('accept','*/*');
+ event.addListener(input,'change',attachFile);
+
+ /*
+ var el = createInputElement('button','Attach')
+ div.appendChild(el);
+ el.setAttribute('value','Attach');
+ event.addListener(el,'click',attachFile);
+ */
+ }
+
+ return false;
+}
+
+function removeAttachment(e,o){
+ var form = document.createElement('form');
+ this.parentNode.appendChild(form);
+ YAHOO.util.Dom.setStyle(form,'display','none');
+ form.setAttribute('action','conduit/attach.tcl');
+ form.setAttribute('method','GET');
+ form.setAttribute('target','formResponse');
+
+ var input = createInputElement('hidden','op');
+ input.setAttribute('value','delete');
+ form.appendChild(input);
+
+ input = createInputElement('hidden','id');
+ input.setAttribute('value',o.id);
+ form.appendChild(input);
+
+ form.submit();
+
+ YAHOO.util.Event.preventDefault(e);
+}
+
+function setCursorPosition(inputId, cursorOffset) {
+ var inputEl = document.getElementById(inputId);
+ if(inputEl){
+ if (inputEl.setSelectionRange) {
+ inputEl.focus();
+ inputEl.setSelectionRange(cursorOffset, cursorOffset);
+ } else if (inputEl.createTextRange) {
+ var range = inputEl.createTextRange();
+ range.collapse(true);
+ range.moveEnd('character', cursorOffset);
+ range.moveStart('character', cursorOffset);
+ range.select();
+ }
+ }
+}
+
+function pickFccDone(o){
+ updateElementValue('fieldFcc', o.f);
+ return false;
+}
+
+function fccExists(force){
+ var elF = document.getElementById('fieldFcc');
+ var elC = document.getElementById('fieldFccCollection');
+ var o = {
+ c:elC.value,
+ f:elF.value,
+ oncancel: function(){
+ elF.focus();
+ elF.select()
+ }
+ };
+
+ if(force)
+ o.create = 'yes';
+
+ if(elF && elC && elF.value.length && elC.value.length)
+ folderExists(o);
+}
+
+function expandAddress(expObj){
+ var eUrl = 'conduit/expand.tcl?';
+ if(expObj.book){
+ eUrl += 'book=' + expObj.book;
+ eUrl += '&index=' + expObj.ai;
+ }
+ else if(expObj.addrs){
+ eUrl += 'addrs=' + encodeURIComponent(expObj.addrs);
+ }
+ else
+ return;
+
+ var expandDS = new YAHOO.util.DataSource(eUrl);
+ expandDS.responseType = YAHOO.util.DataSource.TYPE_XML;
+ expandDS.responseSchema = {
+ resultNode: 'Result',
+ fields: ['Error','Address','Fcc']
+ };
+ expandDS.sendRequest('',
+ {
+ success: function(oReq,oResp,oPayload){
+ var errs = false;
+ if(expObj.addrs && oResp.results[0] && !oResp.results[0].Error) updateElementValue(expObj.fieldId, '');
+ for(var i = 0; i < oResp.results.length; i++){
+ if(oResp.results[i].Error){
+ addStatusMessage('Address Error: '+oResp.results[i].Error, 10);
+ errs++;
+ }
+ else if(oResp.results[i].Address){
+ appendAddress(expObj.fieldId, oResp.results[i].Address);
+ if(expObj.fieldId == 'fieldTo' && oResp.results[i].Fcc && oResp.results[i].Fcc.length) updateElementValue('fieldFcc', oResp.results[i].Fcc);
+ }
+ }
+ if(errs){
+ displayStatusMessages();
+ var el = document.getElementById(expObj.fieldId);
+ if(el) el.focus();
+ }
+ },
+ failure: function(oReq,oResp,oPayload){
+ showStatusMessage('Error expanding Field: ' + oResp.responseText, 10);
+ },
+ scope: this,
+ argument:[expObj]
+ });
+
+}
+
+function donePickContact(fieldId){
+ switch (YAHOO.alpine.pickcontact.tabs.get('activeIndex')){
+ case 0 :
+ var l = document.getElementsByName('nickList');
+ if(l){
+ var i, ai = contactsChecked('Add');
+ for(i in ai) expandAddress({book:ai[i].book,ai:ai[i].index,fieldId:fieldId});
+ }
+ break;
+ case 1 :
+ var l = document.getElementsByName('qrList');
+ if(l){
+ var i, el, addrs = '';
+ for(i = 0; i < l.length; i++){
+ if(l[i].checked){
+ if(addrs.length) addrs += ', ';
+ el = document.getElementById('qrPers'+l[i].value);
+ if(el){
+ var specials = el.innerHTML.match(/[()<>@,;:\\\".\[\]]/);
+ if(specials) addrs += '"' + el.innerHTML + '"';
+ else addrs += el.innerHTML;
+ }
+ el = document.getElementById('qrAddr'+l[i].value);
+ if(el) addrs += ' <' + el.innerHTML + '>';
+ }
+ }
+
+ appendAddress(fieldId,addrs);
+ }
+ break;
+ }
+}
+
+function appendAddress(fieldId, addrs){
+ if(addrs.length){
+ var el = document.getElementById(fieldId);
+ if(el){
+ if(el.value.length) el.value += ', ';
+ el.value += addrs;
+ }
+ }
+}
+
+function validateAddressField(o){
+ if(YAHOO.alpine.expandaddress){
+ if(o.value.length) expandAddress({addrs:o.value,fieldId:o.id});
+ }
+ return(false);
+}
+
+function pickContact(fieldName, fieldId, objParm, markUp){
+ var dom = YAHOO.util.Dom;
+ var alp = YAHOO.alpine.pickcontact;
+ if (alp.markup){
+ var div = document.createElement('div');
+ div.innerHTML = alp.markup;
+ document.body.appendChild(div);
+
+ var contactDialog = document.getElementById('contactDialog');
+ if(contactDialog){
+ alp.tabs = new YAHOO.widget.TabView('contactDialog');
+ alp.tabs.subscribe('activeTabChange',
+ function(e){
+ if(alp.tabs.getTabIndex(e.newValue) == 1){
+ boxChecked(null); // set action button
+ var el = document.getElementById('dirQuery');
+ el.focus();
+ el.select();
+ }
+ });
+ }
+ else contactDialog = document.getElementById('contactList');
+
+ var objDone = {
+ label:'Add ' + fieldName + ' Address',
+ disabled: true,
+ fn: function(){ donePickContact(fieldId); },
+ doonreturn:true
+ };
+
+ panelDialog('Add ' + fieldName + ' Address', contactDialog, objDone);
+ setPanelBodyWidth('clistContacts');
+ drawContactList('contactList',0,objParm);
+ }
+
+ return false;
+}
+
+
+function drawLDAPResult(objResult){
+ var dom = YAHOO.util.Dom;
+ var el = document.getElementById('dirResult');
+ if(el){
+ var elResult;
+ if(objResult.error){
+ elResult = document.createElement('span');
+ elResult.innerHTML = objResult.error;
+ }
+ else if(objResult.results){
+ var o, n, t, qrPers, elTR, elTD, elCB, resId, elLabel;
+ elResult = document.createElement('table');
+ elResult.setAttribute('width','100%');
+ elResult.setAttribute('cellSpacing','0');
+ elResult.setAttribute('cellPadding','0');
+ for(var i = 0; i < objResult.results.length; i++){
+ o = objResult.results[i];
+ n = (o.email) ? o.email.length : 0;
+ if(n){
+ elTR = elResult.insertRow(elResult.rows.length);
+ elTD = elTR.insertCell(elTR.cells.length);
+
+ elCB = createInputElement('checkbox','qrList');
+ elCB.setAttribute('value',elResult.rows.length);
+ resId = 'dirEnt' + elResult.rows.length;
+ elCB.setAttribute('id',resId);
+
+ YAHOO.util.Event.addListener(elCB,'click',boxClicked);
+ elTD.appendChild(elCB);
+
+ elTD = elTR.insertCell(elTR.cells.length);
+ dom.addClass(elTD,'wap');
+ if(o.personal){
+ qrPers = o.personal;
+ }
+ else
+ qrPers = '';
+
+ elLabel = createNameValueElement('label','for',resId);
+ elTD.appendChild(elLabel);
+ elLabel.setAttribute('id','qrPers'+elResult.rows.length);
+ elLabel.innerHTML = o.personal;
+
+
+ for(var j = 0; j < n; j++){
+ if(j > 0){
+ elTR = elResult.insertRow(elResult.rows.length);
+ elTD = elTR.insertCell(elTR.cells.length);
+ elCB = createInputElement('checkbox','qrList');
+ elCB.setAttribute('value',elResult.rows.length);
+ resId = 'dirEnt' + elResult.rows.length;
+ elCB.setAttribute('id',resId);
+
+ YAHOO.util.Event.addListener(elCB,'click',boxClicked);
+ elTD.appendChild(elCB);
+ elTD = elTR.insertCell(elTR.cells.length);
+ dom.addClass(elTD,'wap');
+
+
+ elLabel = createNameValueElement('label','for',resId);
+ elTD.appendChild(elLabel);
+ elLabel.setAttribute('id','qrPers'+elResult.rows.length);
+ elLabel.innerHTML = qrPers;
+ }
+ elTD = elTR.insertCell(elTR.cells.length);
+ dom.addClass(elTD,'wap');
+
+ elLabel = createNameValueElement('label','for',resId);
+ elTD.appendChild(elLabel);
+ elLabel.setAttribute('id','qrAddr'+elResult.rows.length);
+ elLabel.innerHTML = o.email[j];
+ }
+ }
+ }
+ }
+
+ el.replaceChild(elResult,el.firstChild);
+ el = document.getElementById('dirQuery');
+ if(el) el.focus();
+ }
+}
+
+function boxClicked(e){
+ boxChecked(YAHOO.util.Event.getTarget(e));
+}
+
+function boxClear(){
+ var l = (YAHOO.alpine.pickcontact.tabs.get('activeIndex') == 0) ? 'nickList' : 'qrList';
+ var el = document.getElementsByName(l);
+ if(el){
+ for(var i = 0; i < el.length; i++) el[i].checked = false;
+ }
+
+ panelDialogEnableButton(false);
+}
+
+function boxChecked(o){
+ if(o) markOne(o);
+ var l = (YAHOO.alpine.pickcontact.tabs.get('activeIndex') == 0) ? 'nickList' : 'qrList';
+ var el = document.getElementsByName(l);
+ if(el){
+ for(var i = 0; i < el.length; i++){
+ if(el[i].checked){
+ panelDialogEnableButton(true);
+ return;
+ }
+ }
+ }
+
+ panelDialogEnableButton(false);
+}
+
+function setPriority(elClick,priority){
+ var el, pos, dom = YAHOO.util.Dom;
+ for(var i = 0; i <= 5; i++){
+ el = document.getElementById('pri'+i);
+ if(dom.hasClass(el.firstChild,'spfcl3')){
+ dom.removeClass(el.firstChild,'spfcl3');
+ dom.addClass(el.firstChild,'blank');
+ break;
+ }
+ }
+
+ dom.removeClass(elClick.firstChild,'blank');
+ dom.addClass(elClick.firstChild,'spfcl3');
+ el = document.getElementById('priority');
+ el.value = priority;
+ elClick.blur();
+ return false;
+}
diff --git a/web/cgi/alpine/2.0/lib/contacts.js b/web/cgi/alpine/2.0/lib/contacts.js
new file mode 100644
index 00000000..c4d13be1
--- /dev/null
+++ b/web/cgi/alpine/2.0/lib/contacts.js
@@ -0,0 +1,121 @@
+/* $Id: contacts.js 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+ * ========================================================================
+ * Copyright 2008 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+
+function boxChecked(o){
+ if(o) markOne(o);
+}
+
+function editContact(o){
+ getContact({ book:o.book, index:o.index, f:function(c){ contactEditor(c,storeEditedContact); }});
+ return(false);
+}
+
+function editCheckedContact(){
+ var checked = contactsChecked('');
+ switch (checked.length){
+ case 1 :
+ getContact({ book:checked[0].book, index:checked[0].index, f:function(c){ contactEditor(c,storeEditedContact); }});
+ break;
+ default :
+ panelAlert('Choose just one contact to Edit');
+ case 0 :
+ break;
+ }
+
+ return(false);
+}
+
+function contactDelete(){
+ var checked = contactsChecked('');
+ var plural = (checked.length > 1) ? 's' : '';
+ var count = (checked.length > 1) ? '<b>' + checked.length + '</b> ' : '';
+ if(checked.length) panelConfirm('Are you sure you want to permanently delete the ' + count + 'selected contact' + plural + '?',{text:'Delete Forever',fn:doContactDelete});
+ return false;
+}
+
+function doContactDelete(o){
+ var checked = contactsChecked('');
+ if(checked.length){
+ var el = YAHOO.alpine.containers.contactlist;
+ var elist = '';
+ for(var i = 0; i < checked.length; i++){
+ if(elist.length) elist += ',';
+ elist += checked[i].book + '.' + checked[i].index;
+ }
+
+ if(el && elist.length){
+ var o = {
+ hdr:'on',
+ sendto:'on',
+ canedit:'on',
+ op:'delete',
+ entryList:elist
+ }
+
+ newContactList(el,null,gCurrentAbook,o);
+ }
+ }
+}
+
+function storeEditedContact(oFields){
+ var el = YAHOO.alpine.containers.contactlist;
+ if(el){
+ var o = {
+ hdr:'on',
+ sendto:'on',
+ canedit:'on',
+ op:'change'
+ }
+
+ for(var f in oFields){
+ o[f] = oFields[f];
+ }
+
+ newContactList(el,null,gCurrentAbook,o);
+ }
+}
+
+function storeNewContact(oFields){
+ var el = YAHOO.alpine.containers.contactlist;
+ if(el){
+ var o = {
+ hdr:'on',
+ sendto:'on',
+ canedit:'on',
+ op:'add'
+ }
+
+ for(var f in oFields){
+ o[f] = oFields[f];
+ }
+
+ newContactList(el,null,gCurrentAbook,o);
+ }
+}
+
+function sendToContact(){
+ var checked = contactsChecked('Send Email');
+ if(checked.length){
+ var cUrl = 'compose?contacts=';
+ var comma = '';
+ for(var i = 0; i < checked.length; i++){
+ cUrl += comma + checked[i].book + '.' + checked[i].index;
+ comma = ',';
+ }
+
+ window.location.href = cUrl;
+ }
+
+ return(false);
+}
diff --git a/web/cgi/alpine/2.0/lib/folders.js b/web/cgi/alpine/2.0/lib/folders.js
new file mode 100644
index 00000000..4f6b9d24
--- /dev/null
+++ b/web/cgi/alpine/2.0/lib/folders.js
@@ -0,0 +1,258 @@
+/* $Id: folders.js 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+ * ========================================================================
+ * Copyright 2008 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+
+function doOpen(){
+ var fce = document.getElementById('pickFolderCollection');
+ var fc = (fce) ? fce.value : null;
+ var fpe = document.getElementById('pickFolderPath');
+ var fp = (fpe && fpe.value && fpe.value.length) ? '/' + fpe.value + '/' : '/';
+ var fne = document.getElementById('pickFolderName');
+ var fn = (fne && fne.value && fne.value.length) ? fne.value : null;
+ if(fc && fp && fn) location.href = 'browse/'+ fc + fp + encodeURIComponent(fn);
+ else panelAlert('Which folder would you like to View?<p>Click a folder\'s name to select it, then click <b>View&nbsp;Messages</b>.');
+ return false;
+}
+
+function doDelete(o){
+ var el = document.getElementById('alpineContent');
+ newFolderList(el,null,o.c,o.path,{op:'delete',f:o.folder});
+ var fne = document.getElementById('pickFolderName');
+ if(fne) fne.value = '';
+ var base, link;
+ if((base = document.getElementsByTagName('base')) && base.length) link = base[0].getAttribute('href');
+ else link = '';
+ link += 'browse/'+o.c+'/'+o.path+encodeURIComponent(o.folder);
+ for(var i = 0; i < 20 ; i++){// 20 > fldr_cache_max
+ var target = 'target' + i;
+ el = document.getElementById(target);
+ if(!el) break;
+ if(el.firstChild.href == link){
+ YAHOO.util.Dom.setStyle(target,'display','none');
+ break;
+ }
+ }
+}
+
+function queryDelete(){
+ if(YAHOO.alpine.current.incoming){
+ showStatusMessage('Cannot delete Incoming Folders yet',5);
+ return false;
+ }
+
+ var fc = document.getElementById('pickFolderCollection').value;
+ var fp = document.getElementById('pickFolderPath').value;
+ var fn = document.getElementById('pickFolderName').value;
+ if(fn.length) panelConfirm('Are you sure you want to permanently delete the folder <b>' + fn + '</b> and its contents?<p>Deleted folders are gone forever.',{text:'Delete Forever',fn:doDelete,args:{c:fc,path:fp,folder:fn}});
+ else panelAlert('Which folder would you like to Delete?<p>Click a folder\'s name to select it, then click <b>Delete</b>.');
+
+ return false;
+}
+
+function addFolder(){
+ if(YAHOO.alpine.current.incoming){
+ showStatusMessage('Cannot add new Incoming Folders yet',5);
+ return false;
+ }
+
+ var dom = YAHOO.util.Dom;
+ var fp = document.getElementById('pickFolderPath').value;
+ var fc = document.getElementById('pickFolderCollection').value;
+ if(fc >= 0){
+ var dbody = document.createDocumentFragment();
+ var div = document.createElement('div');
+ dom.addClass(div,'panelExplanation');
+ var lc = 'in', l = 'Name of Folder to create. To create the folder within a subdirectory, simply prepend the subdirectory\'s name.';
+ var el = document.createTextNode(l);
+ div.appendChild(el);
+ dbody.appendChild(div);
+
+ // Folder Name
+ div = document.createElement('div');
+ dom.addClass(div,'panelInput');
+ div.innerHTML = 'Folder Name:';
+ var input = createInputElement('text','');
+ div.appendChild(input);
+ YAHOO.util.Event.addListener(input,'keyup',panelDialogInputChange);
+ dbody.appendChild(div);
+ panelDialog('New Folder',
+ dbody,
+ {
+ label:"New Folder",
+ disabled: true,
+ doonreturn: true,
+ fn: function(){
+ if(input.value.length) newFolderList(document.getElementById('alpineContent'),null,fc,fp,{op:'add',f:input.value});
+ else showStatusMessage('No folder name provided. No folder added.',5);
+ var fne = document.getElementById('pickFolderName');
+ if(fne) fne.value = '';
+ }
+ });
+ input.focus();
+ }
+
+ return false;
+}
+
+function renameFolder(){
+ if(YAHOO.alpine.current.incoming){
+ showStatusMessage('Cannot rename Incoming Folders yet',5);
+ return false;
+ }
+
+ var dom = YAHOO.util.Dom;
+ var fc = document.getElementById('pickFolderCollection').value;
+ var fp = document.getElementById('pickFolderPath').value;
+ var fn = document.getElementById('pickFolderName').value;
+ if(fc >= 0 && fn.length){
+ var dbody = document.createDocumentFragment();
+ var div = document.createElement('div');
+ dom.addClass(div,'panelExplanation');
+ var lc = 'in', l = 'Rename folder ';
+ if(fp.length){
+ l += 'in directory ' + fp + ' ';
+ lc = 'of';
+ }
+ if(YAHOO.alpine.current.collections[fc]) l += lc+' collection ' + YAHOO.alpine.current.collections[fc];
+ div.innerHTML = l;
+ dbody.appendChild(div);
+
+ // Folder Name Input
+ div = document.createElement('div');
+ dom.addClass(div,'panelInput');
+ div.innerHTML = 'New Folder Name:';
+
+ var input = createInputElement('text','');
+ var fnt = fn.match(/[\/]?([^\/]*)$/);
+ input.setAttribute('value',fnt[1]);
+ div.appendChild(input);
+
+ //YAHOO.util.Event.addListener(el,'keyup',panelDialogInputChange);
+ dbody.appendChild(div);
+
+ panelDialog('Rename Folder',
+ dbody,
+ {
+ label:"Rename Folder",
+ doonreturn: true,
+ fn: function(){
+ if(fc >= 0 && fn.length && input.value.length){
+ if(fn != input.value){
+ var el = document.getElementById('alpineContent');
+ newFolderList(el,null,fc,fp,{op:'rename',sf:fn,df:input.value});
+ var fne = document.getElementById('pickFolderName');
+ if(fne) fne.value = '';
+ }
+ else showStatusMessage('Folder name unchanged.',5);
+ }
+ else showStatusMessage('Folder name unchanged.',5);
+ }
+ });
+
+ input.select();
+ }
+ else panelAlert('Which folder would you like to rename?<p>Click a folder\'s name to select it, then click <b>Rename</b>.');
+
+ return false;
+}
+
+function exportFolder(){
+ var dom = YAHOO.util.Dom;
+ var fc = document.getElementById('pickFolderCollection').value;
+ var fp = document.getElementById('pickFolderPath').value;
+ var fn = document.getElementById('pickFolderName').value;
+ var t;
+ if(fc >= 0 && fn.length){
+ var url = 'conduit/export/' + fc + '/';
+ if(fp.length) url += encodeURIFolderPath(fp) + '/';
+ url += encodeURIComponent(fn);
+ window.location.href = document.getElementsByTagName('base')[0].href + url;
+ t = '<h3>Export Email</h3>Web Alpine is preparing folder <b>'+fn+'</b> for download. &nbsp;';
+ t += 'Your browser\'s File Open dialog should appear momentarily.<p>';
+ t += 'The exported file will be in a format compatible with many desktop mail programs. &nbsp;';
+ t += 'You can also use <i>Import Email</i> to copy the folder back into Web Alpine.<p>';
+ t += 'If the download completes without error, you may delete the folder from Web Alpine.<p>';
+ }
+ else
+ t = 'Which folder would you like to export?<p>Click a folder\'s name to select it, then click <b>Export&nbsp;Email...</b>.'
+
+ panelAlert(t);
+ return false;
+}
+
+function redrawFolderList(){
+ var fc = document.getElementById('pickFolderCollection').value;
+ var fp = document.getElementById('pickFolderPath').value;
+ if(fc >= 0){
+ var el = document.getElementById('alpineContent');
+ newFolderList(el,null,fc,fp,{op:'noop'});
+ }
+}
+
+function importFolder(){
+ if(YAHOO.alpine.current.incoming){
+ showStatusMessage('Cannot import Incoming Folders yet',5);
+ return false;
+ }
+
+ var dom = YAHOO.util.Dom;
+ var event = YAHOO.util.Event;
+ var fc = document.getElementById('pickFolderCollection').value;
+ var fp = document.getElementById('pickFolderPath').value;
+ var form = document.createElement('form');
+ form.setAttribute('action','conduit/import/' + fc + '/' + encodeURIFolderPath(fp));
+ form.setAttribute('method','POST');
+ form.setAttribute('enctype','multipart/form-data');
+ form.setAttribute('target','formResponse');
+
+ var div = document.createElement('div');
+ dom.addClass(div,'panelExplanation');
+ div.innerHTML = 'Folder Import copies a mail folder, typically created by the <i>Export</i> command, from the computer your browser is running on into a new Web Alpine folder. Successful Import consists of three steps.<p>First, enter the path and filename of the folder below. Use the Browse button to help choose the file.';
+ form.appendChild(div);
+
+ div = document.createElement('div');
+ dom.addClass(div,'panelInput');
+ var input0 = createInputElement('file','file');
+ event.addListener(input0,'keypress',panelDialogInputChange);
+ event.addListener(input0,'change',panelDialogInputChange);
+ div.appendChild(input0);
+ form.appendChild(div);
+
+ div = document.createElement('div');
+ div.innerHTML = 'Second, provide a <b>unique</b> name to give the uploaded folder';
+ if(YAHOO.alpine.current.collections[fc]) div.innerHTML += ' within the '+ YAHOO.alpine.current.collections[fc]+' collection.';
+ dom.addClass(div,'panelExplanation');
+ form.appendChild(div);
+
+ div = document.createElement('div');
+ dom.addClass(div,'panelInput');
+ div.innerHTML = 'Name the folder:';
+ var input = createInputElement('text','newFolder');
+ div.appendChild(input);
+ form.appendChild(div);
+
+ div = document.createElement('div');
+ div.innerHTML = 'Finally, click <b>Import&nbsp;Folder</b> to copy the folder into Web Alpine.';
+ dom.addClass(div,'panelExplanation');
+ form.appendChild(div);
+
+
+ panelDialog('Import Folder', form,
+ {
+ label:'Import Folder',
+ disabled: true,
+ fn: function(){ showLoading(); form.submit(); }
+ });
+ input0.focus();
+ return false;
+}
diff --git a/web/cgi/alpine/2.0/lib/mailbox.js b/web/cgi/alpine/2.0/lib/mailbox.js
new file mode 100644
index 00000000..9879137f
--- /dev/null
+++ b/web/cgi/alpine/2.0/lib/mailbox.js
@@ -0,0 +1,1076 @@
+/* $Id: mailbox.js 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+ * ========================================================================
+ * Copyright 2008 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+/*
+ * Scripts common to mailbox viewing: browse and view
+ */
+
+// Globals
+YAHOO.alpine.morcButton = [];
+YAHOO.alpine.select = { all:false, bannerId:'bannerSelection' };
+
+
+// BROWSE FUNCTIONS
+
+/* priority column display is overloaded. Uses el.title to store state. */
+/* changes to link titles in that column MUST be coordinated with this stuff. */
+/* Tricky */
+var gLabelStarred = 'Starred';
+var gLabelPriHi = 'High Priority';
+var gLabelPriHier = 'Highest Priority';
+
+
+function applyFlag(ctrlObj,flagName,flagState) {
+ switch (flagName) { // validate
+ case 'new' : break; // read (New) flag
+ case 'imp' : break; // important flag
+ case 'del' : break; // delete flag
+ default : return false;
+ }
+ YAHOO.util.Connect.asyncRequest('GET',
+ 'conduit/apply.tcl' + encodeURI('?u=all&f=' + flagName + '&s=' + flagState) + urlSalt('&'),
+ {
+ customevents: {
+ onStart:function(eventType){ showLoading(); },
+ onComplete:function(eventType){ hideLoading(); }
+ },
+ success: function(o) {
+ // valid response is "<numApplied> <numSelected> <numTotalMsgs>"
+ var matchResult;
+ if((matchResult = o.responseText.match(/^(\d+) (\d+) (\d+)$/m)) == null){
+ showStatusMessage('Error: ' + o.responseText, 10);
+ }
+ else{
+ var plural = (matchResult[1] > 1) ? 's' : '';
+ if(flagName == 'del'){
+ showStatusMessage(matchResult[1] + ' message' + plural + ' deleted', 3);
+ YAHOO.alpine.current.selected = matchResult[2];
+ YAHOO.alpine.current.count = matchResult[3];
+ hideSelectAllInfo();
+ }
+ else{
+ var chk = document.getElementsByName('uidList');
+ var sm;
+ if(flagName == 'imp'){
+ var act = (flagState == 'not') ? 'Cleared' : 'Set';
+ sm = act + ' Star on ' + matchResult[1] + ' message' + plural;
+ }
+ else{
+ sm = 'Marked ' + matchResult[1] + ' message' + plural + ' as ';
+ if(flagState == 'not'){
+ decUnreadCount('Current' ,matchResult[1]);
+ sm += 'Read';
+ }
+ else{
+ incUnreadCount('Current',matchResult[1]);
+ sm += 'Unread';
+ }
+ }
+ showStatusMessage(sm, 3);
+ for(var i = 0; i < chk.length; i++){
+ if(chk[i].checked){
+ var dom = YAHOO.util.Dom;
+ if(flagName == 'imp'){
+ var offset = 0;
+ var m = document.getElementById('star'+chk[i].value);
+ if(m){
+ var classAdd = '', classDel = '', newtitle = '';
+ if(flagState == 'not'){
+ classAdd = 'nostar';
+ classDel = 'star';
+ if(m.title.substr(0,gLabelStarred.length) == gLabelStarred){
+ if(m.title.length > gLabelStarred.length){
+ newtitle = m.title.substr(gLabelStarred.length + 5);
+ if(newtitle == gLabelPriHi){
+ classAdd = 'prihi';
+ }
+ else if(newtitle == gLabelPriHier){
+ classAdd = 'prihier';
+ }
+ }
+ else{
+ newtitle = 'Set ' + gLabelStarred;
+ }
+ }
+ }
+ else{
+ classAdd = 'star';
+ switch (m.title) {
+ case 'Set ' + gLabelStarred :
+ newtitle = gLabelStarred;
+ classDel = 'nostar';
+ break;
+ case gLabelPriHi :
+ classDel = 'prihi';
+ newtitle = gLabelStarred + ' and ' + gLabelPriHi;
+ break;
+ case gLabelPriHier :
+ classDel = 'prihier';
+ newtitle = gLabelStarred + ' and ' + gLabelPriHier;
+ break;
+ default :
+ break;
+ }
+ }
+
+ if(!dom.hasClass(m.firstChild,classAdd)) dom.addClass(m.firstChild,classAdd);
+ if(classDel.length && dom.hasClass(m.firstChild,classDel)) dom.removeClass(m.firstChild,classDel);
+ if(newtitle.length) m.title = newtitle;
+ }
+ }
+ else if(flagName == 'new'){
+ var hid = 'h1'+chk[i].value;
+ var mnode = chk[i].parentNode.parentNode;
+ if(flagState == 'not'){
+ if(dom.hasClass(hid,'unread')) dom.removeClass(hid,'unread');
+ if(dom.hasClass(mnode,'unread')) dom.removeClass(mnode,'unread');
+ }
+ else{
+ if(!dom.hasClass(hid,'unread')) dom.addClass(hid,'unread');
+ if(!dom.hasClass(mnode,'unread')) dom.addClass(mnode,'unread');
+ }
+ }
+ }
+ }
+ showSelectAllInfo();
+ }
+ }
+ },
+ failure: function(o) { showStatusMessage('Request Failure: ' + o.statusText + '. Please report this.', 10)}
+ });
+
+ if(ctrlObj) ctrlObj.blur();
+ return false;
+}
+
+
+//
+// SELECTION (e.g. SELECT ALL)
+//
+
+function initSelection() {
+ var ac = YAHOO.alpine.current;
+ if (ac.selected > 0) {
+ if (ac.selected == ac.count) {
+ showSelectAllInfo(4);
+ } else if (ac.selected) {
+ showSelectAllInfo(2);
+ }
+ }
+ else hideSelectAllInfo();
+}
+
+function hideSelectAllInfo() {
+ var banner = document.getElementById(YAHOO.alpine.select.bannerId);
+ if(banner) YAHOO.util.Dom.setStyle(banner,'display','none');
+}
+
+function showSelectAllInfo(num) {
+ var banner = document.getElementById(YAHOO.alpine.select.bannerId);
+ if (banner){
+ setSelectAllInfoText(num);
+ YAHOO.util.Dom.setStyle(banner,'display','block');
+ }
+}
+
+function setSelectAllInfoText(state) {
+ // NOTE: "\u00a0" is the unicode equivalent of no-break space character
+ var ac = YAHOO.alpine.current;
+ var banner = document.getElementById(YAHOO.alpine.select.bannerId);
+ if (!banner) return;
+ var msg;
+ var pluralSelected = (ac.selected > 1) ? 's' : '';
+ var predSelected = (ac.selected > 1) ? 'are' : 'is';
+ var pluralTotal = (ac.count > 1) ? 's' : '';
+ var groupName = (ac.focused) ? 'Search Results' : ac.f;
+ switch (state) {
+ case 1:
+ banner.innerHTML = "All <b>" + ac.selected + "<\/b> message" + pluralSelected + " in " + groupName + " " + predSelected + " selected.";
+ banner.style.backgroundColor = "#ffffa6";
+ break;
+ case 2:
+ banner.innerHTML = "<b>" + ac.selected + "<\/b> message" + pluralSelected + " in " + groupName + " " + predSelected + " selected. \u00a0\u00a0\u00a0\u00a0\u00a0 [<a href='browse/" + ac.c + "/" + ac.f + "/" + ac.u + "?select=all' onClick='return selectAllInFolder();'>Select All <b>" + ac.count + " <\/b> Message" + pluralTotal + " in " + groupName + "<\/a>] \u00a0\u00a0 [<a href='browse/" + ac.c + "/" + ac.f + "/" + ac.u + "?select=none' onClick='return unSelectAllInFolder();'>Unselect All<\/a>]";
+ banner.style.backgroundColor = "#ffffa6";
+ break;
+ case 3:
+ banner.innerHTML = "All <b>" + ac.selected + "<\/b> message" + pluralSelected + " on this page " + predSelected + " selected. \u00a0\u00a0\u00a0\u00a0\u00a0 [<a href='browse/" + ac.c + "/" + ac.f + "/" + ac.u + "?select=all' onClick='return selectAllInFolder();'>Select All <b>" + ac.count + " <\/b> Message" + pluralTotal + " in " + groupName + "<\/a>]";
+ banner.style.backgroundColor = "#ffffa6";
+ break;
+ case 4:
+ banner.innerHTML = "<b>All <u>" + ac.count + "<\/u> message" + pluralTotal + " in " + groupName + " " + predSelected + " selected.<\/b> \u00a0\u00a0\u00a0\u00a0\u00a0 [<a href='browse/" + ac.c + "/" + ac.f + "/" + ac.u + "?select=none' onClick='return unSelectAllInFolder();'>Unselect All<\/a>]";
+ banner.style.backgroundColor = "#ffdebf";
+ break;
+ case 5:
+ banner.innerHTML = "<b>Selection Cleared - No messages selected in " + groupName + ".<\/b>";
+ banner.style.backgroundColor = "#ffdebf";
+ break;
+ }
+}
+
+
+function markMessage(msg) {
+ var ac = YAHOO.alpine.current;
+ var chk = document.getElementsByName('uidList');
+ var selectAll = document.getElementById('selectall');
+ var numCheckbox = isNaN(chk.length) ? 1 : chk.length;
+ msg.parentNode.parentNode.id = msg.checked ? "sd" : "";
+ if (YAHOO.alpine.select.all) {
+ YAHOO.alpine.select.all = false;
+ }
+ if (!msg.checked) {
+ --ac.selected;
+ if (ac.selected) {
+ setSelectAllInfoText(2);
+ } else {
+ hideSelectAllInfo();
+ }
+ selectAll.checked = false;
+ } else {
+ ++ac.selected;
+ if (ac.count <= numCheckbox) {
+ setSelectAllInfoText(1);
+ } else {
+ setSelectAllInfoText(2);
+ }
+ }
+ updateMessageState(msg.value, msg.checked);
+}
+
+function markAllMessages() {
+ var ac = YAHOO.alpine.current;
+ var chk = document.getElementsByName('uidList');
+ var isChecked = document.getElementById('selectall').checked;
+ var numChanged = 0;
+ var numCheckbox;
+ var markedUidList = '';
+ if (chk) {
+ hideDisplayDivOrSpan("bannerConfirm"); // remove any confirmation banner from page
+ numCheckbox = isNaN(chk.length) ? 0 : chk.length;
+ var selectedClass = isChecked ? "sd" : "";
+ for (var i = 0; i < numCheckbox; i++) {
+ if (chk[i].checked != isChecked) {
+ ++numChanged;
+ }
+ chk[i].checked = isChecked;
+ chk[i].parentNode.parentNode.id = selectedClass;
+ markedUidList += ',' + chk[i].value;
+ }
+
+ if (isChecked) { // if Select all
+ ac.selected += numChanged;
+ if (ac.selected > numCheckbox) {
+ showSelectAllInfo(2);
+ } else if (ac.count > numCheckbox) {
+ showSelectAllInfo(3);
+ }
+ } else { // if UNselect all
+ ac.selected -= numChanged;
+ if (ac.selected) {
+ showSelectAllInfo(2);
+ } else {
+ hideSelectAllInfo();
+ }
+ }
+ updateMessageState(markedUidList, isChecked);
+ }
+}
+
+function selectAllInFolder() {
+ var alp = YAHOO.alpine;
+ var chk = document.getElementsByName('uidList');
+ document.getElementById('selectall').checked = true;
+ var numCheckbox;
+ if (chk) {
+ hideDisplayDivOrSpan("bannerConfirm"); // remove any confirmation banner from page
+ numCheckbox = isNaN(chk.length) ? 1 : chk.length;
+ if (numCheckbox == 1) {
+ chk.checked = true;
+ chk.parentNode.parentNode.id = "sd";
+ } else {
+ for (var i = 0; i < chk.length; i++) {
+ chk[i].checked = true;
+ chk[i].parentNode.parentNode.id = "sd";
+ }
+ }
+
+ var all = (alp.current.focused) ? 'searched' : 'all';
+ alp.current.selected = (alp.current.focused) ? alp.current.focused : alp.current.count;
+ updateMessageState(all,'true');
+ }
+ showSelectAllInfo(4);
+ YAHOO.alpine.select.all = (alp.current.focused == 0);
+ return false;
+}
+
+function unSelectAllInFolder() {
+ var alp = YAHOO.alpine;
+ var chk = document.getElementsByName('uidList');
+ var numCheckbox;
+ if (chk) {
+ numCheckbox = isNaN(chk.length) ? 1 : chk.length;
+ YAHOO.alpine.current.selected = 0;
+ // setSelectAllInfoText(5);
+ document.getElementById('selectall').checked = false;
+ if (numCheckbox == 1) {
+ chk.checked = false;
+ chk.parentNode.parentNode.id = "";
+ } else {
+ for (var i = 0; i < chk.length; i++) {
+ chk[i].checked = false;
+ chk[i].parentNode.parentNode.id = "";
+ }
+ }
+
+ var all = (alp.current.focused) ? 'searched' : 'all';
+ alp.select.all = false;
+ updateMessageState(all,'false');
+ }
+ hideSelectAllInfo();
+ return false;
+}
+
+function numCheckedOnPage() {
+ var chk = document.getElementsByName('uidList');
+ var numCheckbox;
+ var numChecked=0;
+ if (chk) {
+ numCheckbox = isNaN(chk.length) ? 1 : chk.length;
+ if ((numCheckbox==1) && (chk.checked)) {
+ numChecked = 1;
+ } else {
+ for (var i = 0; i < chk.length; i++) {
+ if (chk[i].checked) {
+ ++numChecked;
+ }
+ }
+ }
+ }
+
+ return numChecked;
+}
+
+
+// Communicate state changes to server
+function updateMessageState(u,m){
+ YAHOO.util.Connect.asyncRequest('GET',
+ 'conduit/mark.tcl' + encodeURI('?u=' + u + '&mark=' + m) + urlSalt('&'),
+ {
+ success: function(o) {},
+ failure: function(o) {
+ newStatusMessage('Request Failure: ' + o.statusText);
+ }
+ });
+}
+
+// Mailbox Search
+function mailboxSearch(){
+ var elField = document.getElementById('searchField');
+ if(elField && elField.value && elField.value.length){
+ var elScope = document.getElementById('searchScope');
+ var scope = (elScope) ? elScope.options[elScope.selectedIndex].value : 'new';
+ newMessageList({parms:{op:'search',type:'any',scope:scope,criteria:elField.value}});
+ }
+}
+
+// Confirm Toolbar Actions based on Selection
+function confirmDelete() {
+ var ac = YAHOO.alpine.current;
+ var plural = (ac.selected > 1) ? 's' : '';
+ if (ac.selected != numCheckedOnPage())
+ panelConfirm("Move " + ac.selected + " message" + plural + " from " + ac.f + " to the Trash?<p>Some selected messages are on other pages.",{fn:actuallyDelete},'Delete');
+ else
+ actuallyDelete();
+
+ return(false);
+}
+
+function confirmSpam() {
+ var ac = YAHOO.alpine.current;
+ var plural = (ac.selected > 1) ? 's' : '';
+ if (ac.selected != numCheckedOnPage())
+ panelConfirm("Report " + ac.selected + " message" + plural + " as Spam?<p>Some selected messages are on other pages.",{fn:actuallySpam},'Report Spam');
+ else
+ actuallySpam();
+
+ return(false);
+}
+
+// Confirm Toolbar Actions based on Selection
+function deleteForeverString() {
+ if (YAHOO.alpine.current.selected != numCheckedOnPage()) {
+ return confirm( + " forever?\nSome selected messages are on other pages.");
+ }
+
+ return(YAHOO.alpine.current.selected > 0);
+}
+
+// Complain if no messages are selected for Toolbar Action
+function anySelected(act) {
+ if (YAHOO.alpine.current.selected <= 0){
+ panelAlert('No messages selected to ' + act + '.<p>Select one or more messages by checking the box on the line of each desired message.');
+ return false;
+ }
+
+ return true;
+}
+
+function flipStar(el) {
+ var dom = YAHOO.util.Dom;
+ var u = el.id.substring(4);
+ var flagState = '', iClass = '', iTitle = '', iUnClass = '';
+ if(el.title.substr(0,7) == gLabelStarred){
+ flagState = 'not';
+ iUnClass = 'star';
+ if(el.title.length > 7){
+ switch (el.title.substr(12)){
+ case gLabelPriHi :
+ iClass = 'prihi';
+ iTitle = gLabelPriHi;
+ break;
+ case gLabelPriHier :
+ iClass = 'prihier';
+ iTitle = gLabelPriHier;
+ break;
+ default :
+ return false;
+ }
+ }
+ else{
+ iClass = 'nostar';
+ iTitle = 'Set '+ gLabelStarred;
+ }
+ }
+ else{
+ flagState = 'ton';
+ iClass = 'star';
+ switch(el.title){
+ case 'Set ' + gLabelStarred :
+ iUnClass = 'nostar';
+ iTitle = gLabelStarred;
+ break;
+ case gLabelPriHi :
+ iUnClass = 'prihi';
+ iTitle = gLabelStarred + ' and ' + gLabelPriHi;
+ break;
+ case gLabelPriHier :
+ iUnClass = 'prihier';
+ iTitle = gLabelStarred + ' and ' + gLabelPriHier;
+ break;
+ default : return false;
+ }
+ }
+
+ setStar(u,flagState,function(){ if(iTitle.length) el.title = iTitle; if(iUnClass.length) dom.removeClass(el.firstChild,iUnClass); dom.addClass(el.firstChild,iClass); });
+ return false;
+}
+
+function setStar(u,flagState,onDone){
+ if(u < 0) u = YAHOO.alpine.current.u;
+ YAHOO.util.Connect.asyncRequest('GET',
+ 'conduit/flag.tcl?u=' + u + '&f=imp&s=' + flagState + urlSalt('&'),
+ {
+ success: function(o) { if(onDone) onDone(); },
+ failure: function(o) { showStatusMessage('Request Failure: ' + o.statusText + '. Please report this.', 10)}
+ });
+ return false;
+}
+
+// replace message list/view text
+function updateDivText(div, url){
+ YAHOO.util.Connect.asyncRequest('GET', url,
+ {
+ customevents:{
+ onStart:function(eventType){ showLoading(); },
+ onComplete:function(eventType){ hideLoading(); }
+ },
+ success:function(aro){
+ div.innerHTML = aro.responseText;
+ div.scrollTop = 0;
+ evalScripts(aro.responseText);
+ },
+ failure: function(aro) { showStatusMessage('Request Failure: ' + aro.statusText, 10) },
+ argument: [div]
+ });
+ return false;
+}
+
+// Load next message list for viewing relative to current list
+function newMessageList(o){
+ var div = document.getElementById('alpineContent');
+ if(div){
+ var url = 'newlist.tcl/' + YAHOO.alpine.current.c + '/' + encodeURIFolderPath(YAHOO.alpine.current.f);
+ var conj = '?';
+ if(o && o.parms){
+ for(var prop in o.parms){
+ url += conj + prop + '=' + encodeURIComponent(o.parms[prop]);
+ conj = '&';
+ }
+ }
+ else{
+ url += '?op=noop';
+ conj = '&';
+ }
+
+ url += urlSalt(conj);
+
+ updateDivText(div, url);
+
+ if(o && o.control && o.control.blur) o.control.blur();
+ }
+ return false;
+}
+
+function actuallyDelete()
+{
+ if(numCheckedOnPage()) newMessageList({parms:{'op':'delete'}});
+ else applyFlag(null,'del','ton');
+}
+
+function actuallySpam()
+{
+ newMessageList({parms:{'op':'spam'}});
+}
+
+function doEmpty(ctrlObj,listOption){
+ if(listOption == 'all'){
+ newMessageList({control:ctrlObj,parms:{'op':'trashall'}});
+ }
+ else if(listOption == 'message'){
+ newMessageText({control:ctrlObj,parms:{op:'trash'}});
+ }
+ else{
+ var ac = YAHOO.alpine.current;
+ if(listOption == 'selected' && anySelected('Delete Forever')){
+ var plural = (ac.selected > 1) ? 's' : '';
+ var t = "Delete " + ac.selected + " message" + plural + " from " + ac.f + ' forever?';
+ if(ac.selected != numCheckedOnPage()) t += '<p>Some selected messages are on other pages.';
+ panelConfirm(t,
+ {
+ text:'Delete Forever',
+ fn:function(){ newMessageList({control:ctrlObj,parms:{'op':'trash'}}); }
+ });
+ }
+ }
+
+ if(ctrlObj) ctrlObj.blur();
+ return false;
+}
+
+function doSpam(ctrlObj){
+ if(anySelected('Report as Spam')) confirmSpam();
+ if(ctrlObj) ctrlObj.blur();
+ return false;
+}
+
+// Drag Drop Support
+function hiliteDrop(id,on){
+ var dom = YAHOO.util.Dom;
+ if(on){
+ if(!dom.hasClass(id,'drop'))
+ dom.addClass(id, 'drop');
+
+ if(dom.hasClass(id + 'Icon','splc5')){
+ dom.removeClass(id + 'Icon','splc5');
+ dom.addClass(id + 'Icon','splc10');
+ }
+ else if(dom.hasClass(id + 'Icon','splc7')){
+ dom.removeClass(id + 'Icon','splc7');
+ dom.addClass(id + 'Icon','splc11');
+ }
+ }
+ else{
+ if(dom.hasClass(id,'drop'))
+ dom.removeClass(id, 'drop');
+
+ if(dom.hasClass(id + 'Icon','splc10')){
+ dom.removeClass(id + 'Icon','splc10');
+ dom.addClass(id + 'Icon','splc5');
+ }
+ else if(dom.hasClass(id + 'Icon','splc11')){
+ dom.removeClass(id + 'Icon','splc11');
+ dom.addClass(id + 'Icon','splc7');
+ }
+ }
+}
+
+function dragOntoFolder(uid,o){
+ newMessageList({parms:{'op':'movemsg','df':o.c+'/'+o.f,'uid':uid}});
+ return false;
+}
+
+function canDragit(id,uid,tt){
+ var dom = YAHOO.util.Dom;
+ var dd = new YAHOO.util.DDProxy(id,
+ 'message',
+ {
+ dragElId:'msgDragProxy',
+ resizeFrame: false
+ });
+ dd.isTarget = false;
+ dd.b4MouseDown = function(e){
+ var s = '<b>' + this.getEl().innerHTML + '</b>';
+ var r = dom.getRegion(this.getEl());
+ var w = r.right - r.left;
+ var el = document.getElementById('ml'+uid);
+ r = dom.getRegion(el);
+ w = Math.max(w, (r.right - r.left));
+ if(el && el.innerHTML.length) s += '<br>' + el.innerHTML;
+ el = document.getElementById('msgDragProxyText');
+ el.innerHTML = s;
+ dom.setStyle('msgDragProxy','width',w + 12);
+ return true;
+ };
+ dd.endDrag = function(){
+ dom.setStyle('msgDragProxy','visibility','hidden')
+ };
+ dd.onDragEnter = function(e,id){ hiliteDrop(id,true); };
+ dd.onDragOut = function(e,id){ hiliteDrop(id,false); };
+ dd.onDragDrop = function(e,id){
+ hiliteDrop(id,false);
+ var o = dom.get(id);
+ if(o) o.f(uid,o.args);
+ }
+ if(tt){
+ dd.onMouseDown = function(e){
+ tt.hide();
+ tt.cfg.setProperty('disabled',true);
+ };
+ dd.onMouseUp = function(e){
+ tt.cfg.setProperty('disabled',false);
+ };
+ }
+}
+
+function setDragTarget(id,fHandler,oArgs){
+ if(id && id.length){
+ var o = document.getElementById(id);
+ if(o){
+ o.ddObj = new YAHOO.util.DDTarget(id,'message');
+ o.f = fHandler;
+ o.args = oArgs;
+ }
+ }
+}
+
+function cursor(style){
+ document.body.style.cursor = style;
+}
+
+
+// VIEW FUNCTIONS
+
+function newMessageText(o){
+ var div = document.getElementById('alpineContent');
+ var ac = YAHOO.alpine.current;
+ if(div){
+ var uid = (o.uid) ? o.uid : ac.u;
+ var url = 'newview.tcl/' + ac.c + '/' + encodeURIFolderPath(ac.f) + '/' + uid;
+ var conj = '?';
+ if(o && o.parms){
+ for(var prop in o.parms){
+ url += conj + prop + '=' + encodeURIComponent(o.parms[prop]);
+ conj = '&';
+ }
+ }
+
+ updateDivText(div, url);
+
+ if(o && o.control && o.control.blur) o.control.blur();
+ }
+ return false;
+}
+
+// Move or Copy support
+
+function initMorcButton(morcButton){
+ if(YAHOO.alpine.morcButton[morcButton] == null){
+ YAHOO.alpine.morcButton[morcButton] = new YAHOO.widget.Button({
+ type:'menu',
+ label:'Move',
+ id:morcButton+'Choice',
+ menu:[{ text:'Copy', value:'morc', onclick:{ fn:morcClick, obj:{morcButton:morcButton}} }],
+ container:morcButton
+ });
+ }
+}
+
+function morcWhich(morcButton){
+ return YAHOO.alpine.morcButton[morcButton].get('label');
+}
+
+function morcClick(p_sType,p_aArgs,p_oItem){
+ var morc, morcOpt;
+ var button = YAHOO.alpine.morcButton[p_oItem.morcButton];
+ if('copy' == YAHOO.util.Event.getTarget(p_aArgs[0]).innerHTML.toLowerCase()){
+ morc = 'Copy';
+ morcOpt = 'Move';
+ }
+ else{
+ morc = 'Move';
+ morcOpt = 'Copy';
+ }
+
+ button.set('label',morc);
+ button.getMenu().getItem(0).cfg.setProperty('text',morcOpt);
+}
+
+function saveCacheClick(e,o){
+ var event = YAHOO.util.Event;
+ event.getTarget(e).blur();
+ o.onDone(o);
+ event.preventDefault(e);
+}
+
+function updateSaveCache(p,c,f,dc,od,sca){
+ var event = YAHOO.util.Event;
+ var li = document.getElementById(p+'SaveCache');
+ if(li){
+ var cn = li.childNodes;
+ var i, j, node, s = '';
+ for(i = 0; i < cn.length && i < sca.length; i++){
+ node = cn[i].childNodes[0];
+ if(node.tagName.toLowerCase() == 'hr') break;
+ node.href = p + '/' + c + '/' + f + '?save=' + dc + '/' + sca[i].fv;
+ node.innerHTML = sca[i].fn.replace(/</g,'&lt;');
+ event.removeListener(node,'click');
+ event.addListener(node,'click',saveCacheClick,{c:dc,f:sca[i].fv,onDone:od});
+ }
+ for(j = i; j < sca.length; j++){
+ var nli = document.createElement('li');
+ var a = document.createElement('a');
+ a.href = p + '/' + c + '/' + f + '?save=' + dc + '/' + sca[j].fv;
+ a.innerHTML = sca[j].fn.replace(/</g,'&lt;');
+ event.addListener(a,'click',saveCacheClick,{c:dc,f:sca[j].fv,onDone:od});
+ nli.appendChild(a);
+ li.insertBefore(nli,cn[i++]);
+ }
+ }
+}
+
+
+// Move or Copy in mailbox list browse
+function morcInBrowseDone(o){
+ if(anySelected('Move or Copy')){
+ var mvorcp = morcWhich('listMorcButton').toLowerCase();
+ folderExists({c: o.c,
+ f: o.f,
+ onDone: function() { newMessageList({parms:{'op':mvorcp,'df':o.c+'/'+o.f}}) },
+ cancel: function(){
+ addStatusMessage(mvorcp + ' cancelled',4);
+ displayStatusMessages();
+ }
+ });
+ }
+
+ return false;
+}
+
+// Move or Copy in mailbox message view
+function morcInViewDone(o){
+ var mvorcp = morcWhich('viewMorcButton').toLowerCase();
+ folderExists({c: o.c,
+ f: o.f,
+ onDone: function() { newMessageText({parms:{'op':mvorcp,'df':o.c+'/'+o.f}}); },
+ cancel: function(){
+ addStatusMessage(mvorcp + ' cancelled',4);
+ displayStatusMessages();
+ }
+ });
+
+ return false;
+}
+
+function takeAddress(){
+ var dom = YAHOO.util.Dom;
+ var dbody = document.createDocumentFragment();
+ var div = document.createElement('div');
+ dbody.appendChild(div);
+ dom.addClass(div,'takeInstructions');
+ div.innerHTML = 'Choose extracted addresses and save to a new Contact'
+
+ div = document.createElement('div');
+ dbody.appendChild(div);
+ div.setAttribute('id','takeList');
+ dom.addClass(div,'takeList');
+ div.innerHTML = 'Loading...';
+
+ panelDialog('Extract Addresses',
+ dbody,
+ {
+ buttonId:'butChoose',
+ label:'Add to Contacts',
+ disabled: true,
+ doonreturn: true,
+ fn: function(){
+ var o = { which:'add', nickname:'', personal:'', email:'', note:'', fcc:'' };
+ var l = document.getElementsByName('taList');
+ if(l){
+ var i, el;
+ for(i = 0; i < l.length; i++){
+ if(l[i].checked){
+ if(o.email.length){
+ o.email += ',\n';
+ o.group = true;
+ }
+ el = document.getElementById('taPers'+l[i].value);
+ if(el){
+ var specials = el.innerHTML.match(/[()<>@,;:\\\".\[\]]/);
+ if(specials) o.email += '"' + el.innerHTML + '"';
+ else o.email += el.innerHTML;
+ }
+ el = document.getElementById('taEmail'+l[i].value);
+ if(el) o.email += ' <' + el.innerHTML + '>';
+ }
+ }
+
+ contactEditor(o);
+ }
+ }
+ });
+
+ setPanelBodyWidth('takeList');
+ drawExtractedAddresses(div);
+ return false;
+}
+
+function drawExtractedAddresses(elContainer){
+ var takeDS = new YAHOO.util.DataSource('conduit/take.tcl?op=all&u=');
+ takeDS.responseType = YAHOO.util.DataSource.TYPE_XML;
+ takeDS.responseSchema = {
+ resultNode: 'Result',
+ fields: ['Type', 'Nickname','Personal','Email','Fcc','Note','Error']
+ };
+ takeDS.sendRequest(YAHOO.alpine.current.u,
+ {
+ success: function(oReq,oResp,oPayload){
+ var dom = YAHOO.util.Dom;
+ if(oResp.results.length == 1 && oResp.Error){
+ showStatusMessage('Error Taking Address: ' + oResp.Error, 10);
+ }
+ else {
+ var id, el, elTD, elTR, elTable = document.createElement('table');
+ elTable.setAttribute('width','100%');
+ elTable.setAttribute('cellSpacing','0');
+ elTable.setAttribute('cellPadding','0');
+ for(var i = 0; i < oResp.results.length; i++){
+ var o = oResp.results[i];
+ n = (o.Email) ? o.Email.length : 0;
+ if(n){
+ elTR = elTable.insertRow(elTable.rows.length);
+ elTD = elTR.insertCell(elTR.cells.length);
+
+ el = createInputElement('checkbox','taList');
+ el.setAttribute('value',elTable.rows.length);
+ id = 'takeAddr' + elTable.rows.length;
+ el.setAttribute('id',id);
+
+ YAHOO.util.Event.addListener(el,'click',boxClicked);
+ elTD.appendChild(el);
+
+ elTD = elTR.insertCell(elTR.cells.length);
+ dom.addClass(elTD,'wap');
+ el = createNameValueElement('label','for',id);
+ elTD.appendChild(el);
+ el.setAttribute('id','taPers'+elTable.rows.length);
+ el.innerHTML = (o.Personal) ? o.Personal : '';
+
+ elTD = elTR.insertCell(elTR.cells.length);
+ dom.addClass(elTD,'wap');
+ el = createNameValueElement('label','for',id);
+ elTD.appendChild(el);
+ el.setAttribute('id','taEmail'+elTable.rows.length);
+ el.innerHTML = o.Email;
+ }
+
+ //if(oResp.results[i].Nickname) ;
+ //if(oResp.results[i].Note) ;
+ //if(oResp.results[i].Fcc) ;
+ }
+
+ elContainer.replaceChild(elTable, elContainer.firstChild);
+ }
+ },
+ failure: function(oReq,oResp,oPayload){
+ showStatusMessage('Error Taking Address: ' + oResp.responseText, 10);
+ },
+ scope: this,
+ argument:[elContainer]
+ });
+ return(false);
+}
+
+function boxClicked(e){
+ var o = YAHOO.util.Event.getTarget(e);
+
+ if(o) markOne(o);
+ var el = document.getElementsByName('taList');
+ if(el){
+ for(var i = 0; i < el.length; i++){
+ if(el[i].checked){
+ panelDialogEnableButton(true);
+ return;
+ }
+ }
+ }
+
+ panelDialogEnableButton(false);
+}
+
+function boxClear(){
+ var el = document.getElementsByName('taList');
+ if(el){
+ for(var i = 0; i < el.length; i++) el[i].checked = false;
+ }
+
+ panelDialogEnableButton(false);
+}
+
+// focus message list on search results
+function listSearchResults(){
+ newMessageList({parms:{op:'focus',page:'new'}});
+ return false;
+}
+
+function fixupUnreadCount(id,n) {
+ var idObj;
+ if(n) updateElementHtml('unread' + id, ' (' + n + ')');
+ else updateElementHtml('unread' + id, '');
+}
+
+
+// Pagewise Context updaters
+function showBrowseMenus(){
+ var dom = YAHOO.util.Dom;
+ dom.setStyle('viewTopMenubar','display','none');
+ dom.setStyle('listTopMenubar','display','block');
+ dom.setStyle('viewBottomMenubar','display','none');
+ dom.setStyle('listBottomMenubar','display','block');
+}
+
+function updateBrowseLinksAndSuch(o){
+ var dom = YAHOO.util.Dom;
+ var alp = YAHOO.alpine;
+ if(o.u) alp.current.u = o.u;
+ alp.current.count = o.count;
+ alp.current.selected = o.selected;
+ alp.current.searched = o.searched;
+ alp.current.focused = o.focused;
+ if(o.selected != numCheckedOnPage()) showSelectAllInfo(2);
+ if(!o.page || o.page < 1) o.page = 1;
+ if(!o.pages || o.pages < 1) o.pages = 1;
+ document.title = alp.current.f + ', ' + o.page + ' of ' + o.pages + ' (' + o.unread + ') - Web Alpine 2.0';
+ fixupUnreadCount('Current',o.unread);
+ if(o.trashed > 0) incUnreadCount('Trash',o.trashed);
+ else if(o.trashed < 0) decUnreadCount('Trash',(o.trashed * -1));
+ else if(o.cpmv){
+ if(o.cpmv.n > 0) incUnreadCount(o.cpmv.f,o.cpmv.n);
+ else if(o.cpmv.n < 0) decUnreadCount(o.cpmv.f,(o.cpmv.n * -1));
+ }
+ updateElementHtml('listContext', 'Page ' + o.page + ' of ' + o.pages + ' &nbsp;(' + o.count + ' Total Messages)&nbsp;');
+ var bUrl = 'browse/' + alp.current.c + '/' + alp.current.f;
+ updateElementHref('gFolder', bUrl);
+ updateElementHref('composeLink', 'compose?pop=' + bUrl);
+ if(o.sort){
+ var ea = document.getElementsByTagName('span');
+ for(var i = 0; i < ea.length; i++){
+ if(dom.hasClass(ea[i],'spfcl3')){
+ dom.removeClass(ea[i],'spfcl3');
+ break;
+ }
+ }
+
+ var el = document.getElementById('sort'+o.sort);
+ if(el) dom.addClass(el.firstChild,'spfcl3')
+ }
+ if(o.searched > 0){
+ dom.setStyle('searchResult','display','block');
+ dom.setStyle('searchRefine','display','block');
+ dom.setStyle('searchClear','display','block');
+ if(o.focused > 0){
+ updateElementHtml('pageTitle', 'Search Results in ' + quoteHtml(alp.current.f));
+ updateElementHtml('searchResultText', 'Search Results (' + o.focused + ')');
+ if(!dom.hasClass('searchResult','sel')) dom.addClass('searchResult','sel');
+ var el = document.getElementById('gFolder');
+ if(el && dom.hasClass(el.parentNode,'sel')) dom.removeClass(el.parentNode,'sel');
+ }
+ else{
+ updateElementHtml('pageTitle', quoteHtml(alp.current.f));
+ if(dom.hasClass('searchResult','sel')) dom.removeClass('searchResult','sel');
+ var el = document.getElementById('gFolder');
+ if(el && !dom.hasClass(el.parentNode,'sel')) dom.addClass(el.parentNode,'sel');
+ }
+ }
+ else{
+ updateElementHtml('pageTitle', quoteHtml(alp.current.f));
+ dom.setStyle('searchResult','display','none');
+ if(dom.hasClass('searchResult','sel')) dom.removeClass('searchResult','sel');
+ var el = document.getElementById('gFolder');
+ if(el && !dom.hasClass(el.parentNode,'sel')) dom.addClass(el.parentNode,'sel');
+ dom.setStyle('searchRefine','display','none');
+ dom.setStyle('searchClear','display','none');
+ document.getElementById('searchScope').selectedIndex = 2;
+ }
+ if(YAHOO.env.ua.gecko > 0){
+ sizeVPHeight();
+ window.onresize = resizeVPHeight;
+ }
+}
+
+function showViewMenus(){
+ var dom = YAHOO.util.Dom;
+ dom.setStyle('listTopMenubar','display','none');
+ dom.setStyle('viewTopMenubar','display','block');
+ dom.setStyle('listBottomMenubar','display','none');
+ dom.setStyle('viewBottomMenubar','display','block');
+}
+
+function updateViewLinksAndSuch(o){
+ var alp = YAHOO.alpine;
+ var ac = alp.current;
+ if(o.u == 0){
+ window.location = alp.app_root + '/browse/' + ac.c + '/' + ac.f;
+ return;
+ }
+
+ ac.u = o.u;
+ ac.count = o.count;
+ ac.selected = o.selected;
+ fixupUnreadCount('Current',o.unread);
+ var thisFldr = '/' + ac.c + '/' + ac.f + '/';
+ var thisFldrUrl = '/' + ac.c + '/' + encodeURIComponent(ac.f).replace(/%2F/g,'/');
+ var viewUrl = 'view' + thisFldr;
+ var browseUrl = 'browse' + thisFldrUrl;
+ var context = 'Message ' + o.n + ' of ' + o.count;
+ var fullcontext = ac.f + ', ' + context;
+ document.title = context + ' (' + o.unread + ') - Web Alpine 2.0';
+ updateElementHtml('viewContext', context);
+ updateElementHtml('pageTitle', '<a href="' + viewUrl + '" onClick="return newMessageList({parms:{op:\'noop\',page:\'new\'}});">' + quoteHtml(fullcontext) + '');
+ updateElementHref('gFolder', browseUrl);
+ updateElementHref('gCheck', viewUrl + ac.u);
+ updateElementHref('gExtract', 'extract/' + ac.c + '/' + ac.f + '/' + ac.u);
+ updateElementHref('gDelete', viewUrl + o.unext + '?delete=' + ac.u);
+ updateElementHref('gSpam', viewUrl + o.unext + '?spam=' + ac.u);
+ updateElementHref('gUnread', viewUrl + o.unext + '?unread=' + ac.u);
+ updateElementHref('gDecrypt', viewUrl + ac.u);
+ var compUrl = thisFldrUrl + '/' + ac.u + '?pop=view' + thisFldrUrl + '/' + ac.u;
+ updateElementHref('gReply', 'reply' + compUrl);
+ updateElementHref('gReplyAll', 'replyall' + compUrl);
+ updateElementHref('gForward', 'forward' + compUrl);
+ updateElementHref('composeLink', 'compose?pop=view' + compUrl);
+ var oForm = document.getElementById('searchForm');
+ oForm.action = oForm.action.replace(/\/[\d]+$/,'/' + ac.u);
+ if(YAHOO.env.ua.gecko > 0){
+ sizeVPHeight();
+ window.onresize = resizeVPHeight;
+ }
+}
diff --git a/web/cgi/alpine/2.0/lib/settings.js b/web/cgi/alpine/2.0/lib/settings.js
new file mode 100644
index 00000000..2df78d3a
--- /dev/null
+++ b/web/cgi/alpine/2.0/lib/settings.js
@@ -0,0 +1,183 @@
+/* $Id: settings.js 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+ * ========================================================================
+ * Copyright 2008 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+
+function settingsPage(el){
+ var dom = YAHOO.util.Dom;
+ for(var i = 1; i <= 20; i++){
+ dom.setStyle('settingsPage' + i,'display','none');
+ var elPage = document.getElementById('Page' + i);
+ if (elPage) dom.removeClass(elPage.parentNode,'sel');
+ }
+
+ dom.setStyle('settings' + el.id,'display','block');
+ dom.addClass(el.parentNode,'sel');
+ el.blur();
+ return false;
+}
+
+function toggleAdvance(el){
+ var dom = YAHOO.util.Dom;
+ var s = dom.getStyle('advancedSettings','display');
+ if(s && s == 'block'){
+ dom.setStyle('advancedSettings','display','none');
+ el.firstChild.src = 'img/cbn/f_plus.gif'
+ }
+ else{
+ dom.setStyle('advancedSettings','display','block');
+ el.firstChild.src = 'img/cbn/f_minus.gif'
+ }
+
+ el.blur();
+ return false;
+}
+
+function validFieldName(e){
+ var ev = YAHOO.util.Event;
+ var cc = ev.getCharCode(e);
+ if((cc >= 32 & cc < 127) && !(cc == 45 || (cc >= 65 && cc <= 90) || (cc >= 97 && cc <= 122))) ev.stopEvent(e);
+}
+
+function customHdrAdd(idTable){
+ var frag = document.createDocumentFragment();
+ var div = document.createElement('div');
+ frag.appendChild(div);
+ div.setAttribute('align','center');
+ div.innerHTML = '<p>Add a new custom header by entering the new header name on the left and an optional value on the left<p>';
+
+ div = document.createElement('div');
+ frag.appendChild(div);
+ div.setAttribute('align','center');
+
+ var elName = createInputElement('text','field');
+ div.appendChild(elName);
+ elName.setAttribute('size','12');
+ elName.setAttribute('maxlength','36');
+ YAHOO.util.Event.addListener(elName,'keypress',validFieldName);
+ YAHOO.util.Event.addListener(elName,'keyup',panelDialogInputChange);
+ el = document.createTextNode(' : ');
+ div.appendChild(el);
+ var elValue = createInputElement('text','value');
+ div.appendChild(elValue);
+ elValue.setAttribute('size','40');
+
+ panelDialog('New Custom Field',
+ frag,
+ {
+ label:' Add ',
+ disabled: true,
+ fn: function() {
+ var elTD, elTR, elTable = document.getElementById(idTable);
+ var el = document.getElementById('customHdrFields');
+ var n = (el.value - 0) + 1;
+ el.value = n;
+ if(elTable && elName.value.length){
+ elTR = elTable.insertRow(elTable.rows.length);
+
+ elTD = elTR.insertCell(elTR.cells.length);
+ el = document.createTextNode(elName.value +':');
+ elTD.appendChild(el);
+ el = createInputElement('hidden','customHdrField'+n);
+ elTD.appendChild(el);
+ el.setAttribute('value',elName.value);
+
+ elTD = elTR.insertCell(elTR.cells.length);
+ el = createInputElement('text','customHdrData' + n);
+ elTD.appendChild(el);
+ el.setAttribute('value',elValue.value);
+ el.setAttribute('size','45');
+
+ el = document.createElement('a');
+ elTD.appendChild(el);
+ el.setAttribute('href','#');
+ YAHOO.util.Event.addListener(el,'click',removeTableRowEvent);
+ var img = document.createElement('img');
+ img.setAttribute('src','img/cbn/remove.gif');
+ YAHOO.util.Dom.addClass(img,'wap');
+ el.appendChild(img);
+ }
+ }
+ });
+
+ elName.focus();
+ return false;
+}
+
+function removeTableRow(el){
+ if(el){
+ var iRow = el.parentNode.parentNode.rowIndex;
+ el.parentNode.parentNode.parentNode.parentNode.deleteRow(iRow);
+ }
+ return false;
+}
+
+function removeTableRowEvent(e){
+ var ev = YAHOO.util.Event;
+ removeTableRow(ev.getTarget(e).parentNode);
+ ev.stopEvent(e);
+}
+
+function listAdd(idTable,listName){
+ var elTD, elTR, elTable = document.getElementById(idTable);
+ var el = document.getElementById(listName+'s');
+ var n = el.value - 0;
+ el.value = ++n;
+ if(elTable.rows.length < 12){
+ if(elTable){
+ elTR = elTable.insertRow(elTable.rows.length);
+ elTD = elTR.insertCell(elTR.cells.length);
+
+ el = createInputElement('text',listName + n);
+ elTD.appendChild(el);
+ el.setAttribute('size','45');
+
+ el = document.createElement('a');
+ elTD.appendChild(el);
+ el.setAttribute('href','#');
+ YAHOO.util.Event.addListener(el,'click',removeTableRowEvent);
+ var img = document.createElement('img');
+ img.setAttribute('src','img/cbn/remove.gif');
+ YAHOO.util.Dom.addClass(img,'wap');
+ el.appendChild(img);
+ }
+ }
+
+ return false;
+}
+
+function saveSettings(){
+ showLoading();
+ document.getElementById('settingsForm').submit();
+ return false;
+}
+
+function restoreDefaultSettings(){
+ var el = document.getElementById('restore');
+ if(el){
+ el.value = 'restore';
+ showLoading();
+ document.getElementById('settingsForm').submit();
+ }
+ return false;
+}
+
+function settingsSuccess(){
+ var alp = YAHOO.alpine;
+ window.location.href = alp.cgi_base + 'browse/' + alp.current.c + '/' + alp.current.f;
+}
+
+function settingsFailure(m){
+ hideLoading();
+ addStatusMessage('Settings Failure: ' + m, 10);
+ displayStatusMessages();
+}
diff --git a/web/cgi/alpine/2.0/lib/yui b/web/cgi/alpine/2.0/lib/yui
new file mode 120000
index 00000000..7f792d58
--- /dev/null
+++ b/web/cgi/alpine/2.0/lib/yui
@@ -0,0 +1 @@
+yui-2.7.0 \ No newline at end of file
diff --git a/web/cgi/alpine/2.0/mailto b/web/cgi/alpine/2.0/mailto
new file mode 120000
index 00000000..872d4cb2
--- /dev/null
+++ b/web/cgi/alpine/2.0/mailto
@@ -0,0 +1 @@
+compose \ No newline at end of file
diff --git a/web/cgi/alpine/2.0/messagelist.tcl b/web/cgi/alpine/2.0/messagelist.tcl
new file mode 100644
index 00000000..9f1306ce
--- /dev/null
+++ b/web/cgi/alpine/2.0/messagelist.tcl
@@ -0,0 +1,622 @@
+# Web Alpine message list painting support
+# $Id$
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# messagelist
+#
+# Purpose: TCL procedure to produce HTML-based message list of given
+# folder's contents
+#
+# Input:
+#
+
+proc sort_class {cursort sort} {
+ if {[string compare $sort [lindex $cursort 0]]} {
+ return blank
+ } else {
+ return spfcl3
+ }
+}
+
+proc navListButtons {c f} {
+ cgi_table_data class="wap pageBtns" {
+ cgi_puts [cgi_url [cgi_span "class=sp spmb spmbf" [cgi_span "<<"]] "browse/$c/$f" class=wap title="First Page" "onClick=return newMessageList({control:this,parms:{op:'first'}});"]
+ }
+ cgi_table_data class="pageBtns" {
+ cgi_puts [cgi_url [cgi_span "class=sp spmb spmbp" [cgi_span "<"]] "browse/$c/$f" class=wap title="Previous Page" "onClick=return newMessageList({control:this,parms:{op:'prev'}});"]
+ }
+ cgi_table_data class="dv1" {
+ cgi_puts [cgi_span "class=sp spmb spmb3" ""]
+ }
+ cgi_table_data class="pageBtns" {
+ cgi_puts [cgi_url [cgi_span "class=sp spmb spmbn" [cgi_span ">"]] "browse/$c/$f" class=wap title="Next Page" "onClick=return newMessageList({control:this,parms:{op:'next'}});"]
+ }
+ cgi_table_data class="pageBtns" {
+ cgi_puts [cgi_url [cgi_span "class=sp spmb spmbl" [cgi_span ">>"]] "browse/$c/$f" class=wap title="Last Page" "onClick=return newMessageList({control:this,parms:{op:'last'}});"]
+ }
+}
+
+proc drawTopListMenuBar {c f} {
+ global _wp
+
+ set mode [wpFolderMode $c $f]
+
+ cgi_table class="toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_put "<tbody>"
+ cgi_table_row {
+ if {[info exists mode] && [lsearch [list trash junk] $mode] >= 0} {
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url [cgi_span "class=sp spmbi spmb7" "Delete Forever"] "empty/$c/$f" "onClick=return doEmpty(this,'selected');" "title=Permanently remove messages from $f" class=wap]
+ }
+ cgi_table_data class="wap dv1" {
+ cgi_puts [cgi_span "class=sp spmb spmb3" ""]
+ }
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url [cgi_span "class=sp spmbi spmb17" "Move to INBOX"] "inbox" "onClick=if(anySelected('Move to INBOX')) newMessageList({control:this,parms:{op:'move',df:'0/INBOX'}}); return false;" class=wap]
+ }
+ } else {
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url [cgi_span "class=sp spmbi spmb7" "Delete"] "delete" "onClick= if(anySelected('Delete')) confirmDelete(); this.blur(); return false;" "title=Move message to Trash" class=wap]
+ }
+ if {(![info exists mode] || [lsearch [list junk draft sent] $mode] < 0) && [info exists _wp(spamfolder)] && [string compare [string tolower $f] $_wp(spamfolder)]} {
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url [cgi_span "class=sp spmbi spmb8" "Report Spam"] "spam" "onClick=return doSpam(this);" class=wap]
+ }
+ }
+ cgi_table_data class="wap dv1" {
+ cgi_puts [cgi_span "class=sp spmb spmb3" ""]
+ }
+ cgi_table_data class=wap {
+ cgi_bullet_list class="menu" {
+ cgi_put "<li class=menuHdr>[cgi_url "More Actions [cgi_img "img/cbn/menu.gif" "class=menuDn menuImg"]" "" "onClick=return false;"]<div>"
+ cgi_bullet_list {
+ if {![info exists mode] || 0 == [string length $mode]} {
+ cgi_li [cgi_url "Mark as Read" "read" "onClick=if(anySelected('Mark as Read')) return applyFlag(this,'new','not'); else return false;"]
+ cgi_li [cgi_url "Mark as Unread" "unread" "onClick=if(anySelected('Mark as Unread')) return applyFlag(this,'new','ton'); else return false;"]
+ set hr "<hr />"
+ } else {
+ set hr ""
+ }
+
+ cgi_li "${hr}[cgi_url "Set Star" "star" "onClick=if(anySelected('Set Star')) return applyFlag(this,'imp','ton'); else return false;"]"
+ cgi_li [cgi_url "Clear Star" "unstar" "onClick=if(anySelected('Clear Star')) return applyFlag(this,'imp','not'); else return false;"]
+ cgi_li "<hr />[cgi_url "Select All" "browse/$c/$f?select=all" "onClick=return selectAllInFolder();"]"
+ cgi_li [cgi_url "Clear All" "browse/$c/$f?select=none" "onClick=return unSelectAllInFolder();"]
+ }
+ cgi_put "</div></li>"
+ }
+ }
+ }
+ if {![info exists mode] || 0 == [string length $mode]} {
+ cgi_table_data class="wap dv1" {
+ cgi_puts [cgi_span "class=sp spmb spmb3" ""]
+ }
+ cgi_table_data class=wap {
+ cgi_bullet_list class="wap menu" {
+ cgi_put "<li class=menuHdr>[cgi_url "Arrange [cgi_img "img/cbn/menu.gif" "class=menuDn menuImg"]" "" "onClick=return false;"]<div>"
+ cgi_bullet_list class=sortList {
+ if {[catch {PEMailbox sort} cursort]} {
+ set cursort [list Arrival 0]
+ set rev ""
+ } elseif {[lindex $cursort 1]} {
+ set rev Rev
+ } else {
+ set rev ""
+ }
+
+ cgi_li [cgi_url "[cgi_span "class=sp spfcl [sort_class $cursort From]" [cgi_span [cgi_nbspace]]]Sort by From" "#" id=sortFrom "onClick=return newMessageList({control:this,parms:{op:'sort${rev}From'}});"]
+ cgi_li [cgi_url "[cgi_span "class=sp spfcl [sort_class $cursort Subject]" [cgi_span [cgi_nbspace]]]Sort by Subject" "#" id=sortSubject "onClick=return newMessageList({control:this,parms:{op:'sort${rev}Subject'}});"]
+ cgi_li [cgi_url "[cgi_span "class=sp spfcl [sort_class $cursort Date]" [cgi_span [cgi_nbspace]]]Sort by Date" "#" id=sortDate "onClick=return newMessageList({control:this,parms:{op:'sort${rev}Date'}});"]
+ cgi_li [cgi_url "[cgi_span "class=sp spfcl [sort_class $cursort siZe]" [cgi_span [cgi_nbspace]]]Sort by Size" "#" id=sortsiZe "onClick=return newMessageList({control:this,parms:{op:'sort${rev}Size'}});"]
+ cgi_li [cgi_url "[cgi_span "class=sp spfcl [sort_class $cursort Arrival]" [cgi_span [cgi_nbspace]]]Sort by Arrival" "#" id=sortArrival "onClick=return newMessageList({control:this,parms:{op:'sort${rev}Arrival'}});"]
+ cgi_li [cgi_url "[cgi_span "class=sp spfcl [sort_class $cursort tHread]" [cgi_span [cgi_nbspace]]]Group by Thread" "#" id=sorttHread "onClick=return newMessageList({control:this,parms:{op:'sortThread'}});"]
+ cgi_li [cgi_url "[cgi_span "class=sp spfcl [sort_class $cursort OrderedSubj]" [cgi_span [cgi_nbspace]]]Group by Subject" "#" id=sortOrderedSubj "onClick=return newMessageList({control:this,parms:{op:'sortOrderedsubj'}});"]
+ }
+ cgi_put "</div></li>"
+ }
+ }
+ }
+ cgi_table_data class="wap dv1" {
+ cgi_puts [cgi_span "class=sp spmb spmb3" ""]
+ }
+
+ # move/cp FOLDER LIST
+ cgi_table_data id=listMorcButton class="wap yui-skin-sam yuimenu" {}
+ cgi_table_data class=wap {
+ cgi_bullet_list class="menu" {
+ cgi_put "<li class=menuHdr>[cgi_url "to Folder [cgi_img "img/cbn/menu.gif" "class=menuDn menuImg"]" "" "onClick=return false;"]<div>"
+ cgi_bullet_list id=browseSaveCache {
+ cgi_li "<hr />[cgi_url "More Folders..." "save/$c/$f" "onClick=if(anySelected('Move or Copy')){ pickFolder('folderList',morcWhich('listMorcButton'),'[PEFolder defaultcollection]',morcInBrowseDone) }; return false;"]"
+ }
+ cgi_put "</div></li>"
+ }
+ }
+
+ cgi_table_data width="100%" {
+ cgi_put [cgi_nbspace]
+ }
+
+ cgi_puts [navListButtons $c $f]
+
+ cgi_table_data class="tbPad" align="right" {
+ cgi_put [cgi_nbspace]
+ }
+ }
+ cgi_put "</tbody>"
+ }
+}
+
+proc drawBottomListMenuBar {c f pn pt mc} {
+ cgi_table class="toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_put "<tbody>"
+ cgi_table_row {
+ cgi_table_data id=listContext class="wap pageText" {
+ cgi_put "Page $pn of $pt [cgi_nbspace]($mc Total Messages)[cgi_nbspace]"
+ }
+ cgi_table_data width="100%" {
+ cgi_put [cgi_nbspace]
+ }
+
+ cgi_puts [navListButtons $c $f]
+
+ cgi_table_data class="tbPad" align="right" {
+ cgi_put [cgi_nbspace]
+ }
+ }
+ cgi_put "</tbody>"
+ }
+}
+
+proc drawMessageList {c f n ppg} {
+ # remember message number at top of list
+ if {$n > 0 && [catch {PEMailbox current number $n} cm]} {
+ set n 1
+ }
+
+ if {[catch {PEMailbox nextvector $n $ppg [list indexparts indexcolor status statuslist]} nv]} {
+ set nv {}
+ set mv {}
+ } else {
+ set mv [lindex $nv 0]
+ }
+
+ cgi_division id="bannerSelection" {}
+
+ # message list header
+ # cells below MUST be reconciled with drawMessageList
+ cgi_table class="listTbl" cellpadding="0" cellspacing="0" {
+
+ set columns 0
+
+ # index header line
+ cgi_put "<thead>"
+ cgi_table_row {
+ incr columns
+ cgi_table_head class="wap colHdr" align="left" {
+ set nchk 0
+ foreach x $mv {
+ if {[lsearch -exact [lindex [lindex $x 2] 3] selected] >= 0} {
+ incr nchk
+ }
+ }
+
+ if {$ppg == $nchk} {
+ set allchecked checked
+ } else {
+ set allchecked ""
+ }
+
+ cgi_checkbox selectall= "onClick=markAllMessages();" $allchecked id=selectall title="Select/Unselect All Messages on this page"
+ cgi_put [cgi_nbspace]
+ }
+
+ if {0 == [catch {PEMailbox sort} sort]} {
+ set cursort [lindex $sort 0]
+ set revsort [lindex $sort 1]
+ } else {
+ set cursort nonsense
+ set revsort 0
+ }
+
+ set iformat [PEMailbox indexformat]
+ foreach fmt $iformat {
+ set iname [lindex $fmt 0]
+ set iwidth [lindex $fmt 1]
+ set idname [lindex $fmt 2]
+
+ if {0 == [string compare -nocase $iname priority]} {
+ continue
+ }
+
+ # cell defaults
+ set align "left"
+ if {[string compare -nocase $iname $cursort]} {
+ set class "wap colHdr"
+ if {$revsort} {
+ set rev "Rev"
+ } else {
+ set rev ""
+ }
+ set sorturl "browse/$c/[WPPercentQuote $f {/}]?sort=[string tolower $iname]&rev=$revsort"
+ set onclick "onClick=return newMessageList({control:this,parms:{'op':'sort${rev}[string tolower $iname]'}});"
+ set sortextra ""
+ } else {
+ set class "wap selColHdr"
+ if {0 == $revsort} {
+ set rev "Rev"
+ set revbin 1
+ } else {
+ set rev ""
+ set revbin 0
+ }
+ set sorturl "browse/$c/[WPPercentQuote $f {/}]?sort=[string tolower $cursort]&rev=$revbin"
+ set onclick "onClick=return newMessageList({control:this,parms:{'op':'sort${rev}[string tolower $cursort]'}});"
+ if {$revsort} {
+ set sortimg "img/cbn/up.gif"
+ #set sortclass "spml13"
+ set sortimgt "Descending"
+ } else {
+ set sortimg "img/cbn/dn.gif"
+ #set sortclass "spml12"
+ set sortimgt "Increasing"
+ }
+
+ set sortextra "[cgi_nbspace][cgi_nbspace][cgi_nbspace][cgi_img $sortimg class="wap selectedDn" title="$sortimgt"][cgi_nbspace][cgi_nbspace]"
+ }
+
+ if {[string length $iwidth]} {
+ set width width="$iwidth"
+ } else {
+ set width ""
+ }
+
+ switch -- [string tolower $iname] {
+ number {
+ set cd "#"
+ }
+ status {
+ set align center
+ #set cd [cgi_img "img/cbn/info.gif" title="Message Information" "alt=Message Information" class=wap]
+ set cd [cgi_span "class=sp spml spml7" "[cgi_nbspace]"]
+ }
+ attachments {
+ set align center
+ #set cd [cgi_img "img/cbn/attach_sm.gif" title="Attachments" "alt=Attachments" class=wap]
+ set cd [cgi_span "class=sp spml spml6" "[cgi_nbspace]"]
+ }
+ subject {
+ if {0 == [string compare $f Drafts]} {
+ append sortextra "[cgi_nbspace][cgi_nbspace](click to resume composition)"
+ }
+ set cd [cgi_url "${iname}[cgi_nbspace]${sortextra}" $sorturl title="Sort by ${iname}" class=wap $onclick]
+ }
+ default {
+ set cd [cgi_url "${iname}[cgi_nbspace]${sortextra}" $sorturl title="Sort by ${iname}" class=wap $onclick]
+ }
+ }
+
+ incr columns
+ cgi_table_head class="$class" align="$align" $width {
+ cgi_put $cd
+ }
+ }
+
+ # fixed priority header
+ incr columns
+ cgi_table_head class="colHdr rt" align="center" {
+ cgi_put [cgi_span "class=sp spml spml8" "[cgi_nbspace]"]
+ }
+ }
+
+ cgi_put "</thead><tbody>"
+ set listaction "view/$c/[WPPercentQuote $f {/}]/"
+ set viewonclick "onClick=return newMessageText({uid:\$ilu,parms:{page:'new'}});"
+ if {$c == [PEFolder defaultcollection] && 0 == [string compare $f Drafts]} {
+ set listaction "resume/"
+ set viewonclick ""
+ }
+
+ if {[set mvl [llength $mv]]} {
+ # write index lines
+ for {set i 0} {$i < $ppg} {incr i} {
+ if {$i >= $mvl} {
+ if {($i % 2) == 0} {
+ set class "class=ac"
+ } else {
+ set class ""
+ }
+
+ cgi_table_row $class {
+ cgi_table_data colspan=$columns {
+ cgi_put [cgi_nbspace]
+ }
+ }
+
+ continue
+ }
+
+ set v [lindex $mv $i]
+
+ set iln [lindex $v 0]
+ set ilu [lindex $v 1]
+ set msg [lindex [lindex $v 2] 0]
+ set linecolor [lindex [lindex $v 2] 1]
+ set stat [lindex [lindex $v 2] 2]
+ set statlist [lindex [lindex $v 2] 3]
+
+ # set background/bolding
+ if {[lsearch -exact $statlist new] < 0} {
+ set class ""
+ set unread 0
+ } else {
+ set class "unread"
+ set unread 1
+ }
+
+ # alternating gray lines
+ if {($i % 2) == 0} {
+ if {[string length $class]} {
+ append class " ac"
+ } else {
+ set class "ac"
+ }
+ }
+
+ if {[string length $class]} {
+ set rc class="$class"
+ } else {
+ set rc ""
+ }
+
+ if {[lsearch -exact $statlist selected] >= 0} {
+ set checked checked
+ set rid "id=sd"
+ } else {
+ set checked ""
+ set rid "id=line$i"
+ }
+
+ cgi_table_row $rc $rid {
+ cgi_table_data class=wap {
+ cgi_checkbox uidList=$ilu $checked "onClick=markMessage(this);"
+ }
+
+ for {set j 0} {$j < [llength $iformat]} {incr j} {
+
+ set iname [lindex [lindex $iformat $j] 0]
+
+ set class wap
+ set align left
+ set cd [cgi_nbspace]
+
+ catch {unset dragit}
+ catch {unset priority}
+
+ switch -- [string tolower $iname] {
+ from -
+ to -
+ cc -
+ sender -
+ recipients -
+ to {
+ set fstr [lindex [lindex [lindex $msg $j] 0] 0]
+ set flen 20
+ if {[string length $fstr] > $flen} {
+ set fstr "[string range $fstr 0 $flen]..."
+ }
+
+ set cd [cgi_quote_html $fstr]
+ set dragit $ilu
+ }
+ subject {
+ if {$i == 0} {
+ cgi_anchor_name messages
+ }
+
+ set st [lindex $msg $j]
+
+ if {[llength $st]} {
+ set sstr ""
+ foreach sts $st {
+ # do something with type info, [lindex $sts 2], like threadinfo, HERE
+ append sstr [lindex $sts 0]
+ }
+
+ set slen 50
+ if {[set sl [string length [string trim $sstr]]]} {
+
+ if {$sl > $slen} {
+ set subtext "[string range $sstr 0 $slen]..."
+ } else {
+ set subtext $sstr
+ }
+ } else {
+ set subtext {[Empty Subject]}
+ }
+ } else {
+ set subtext {[Empty Subject]}
+ }
+
+ if {$unread} {
+ set h1c "class=\"wap unread\""
+ } else {
+ set h1c "class=wap"
+ }
+
+ set cd [cgi_buffer {cgi_h1 $h1c id=h1$ilu [cgi_url [cgi_quote_html $subtext] ${listaction}$ilu id=ml$ilu class=wap [subst $viewonclick]]}]
+ }
+ status {
+ set align center
+ catch {unset statclass}
+ if {[lsearch -exact $statlist recent] >= 0 && [lsearch -exact $statlist new] >= 0} {
+ set staticon "new"
+ set statclass spml1
+ set stattitle "New Mail"
+ set statalt "New Mail"
+ } elseif {[lsearch -exact $statlist answered] >= 0} {
+ set staticon "replied"
+ set statclass spml2
+ set stattitle "Replied to Sender"
+ set statalt "Replied"
+ } elseif {[lsearch -exact $statlist forwarded] >= 0} {
+ set staticon "fwd"
+ set statclass spml3
+ set stattitle "Forwarded"
+ set statalt "Forwarded"
+ } elseif {[lsearch -exact $statlist to_us] >= 0} {
+ set staticon "tome"
+ set statclass spml4
+ set stattitle "Addressed to you"
+ set statalt "Addressed to you"
+ } elseif {[lsearch -exact $statlist cc_us] >= 0} {
+ set staticon "ccme"
+ set statclass spml5
+ set stattitle "Cc'd to you"
+ set statalt "Cc'd to you"
+ } else {
+ set staticon "blank"
+ set stattitle ""
+ set statalt ""
+ }
+
+ if {[info exists statclass]} {
+ set cd [cgi_span "class=sp spml $statclass" "[cgi_nbspace]"]
+ } else {
+ set cd [cgi_nbspace]
+ }
+ }
+ attachments {
+ set align center
+ if {[regexp {^[0-9]+$} [lindex [lindex [lindex $msg $j] 0] 0]]} {
+ set cd [cgi_span "class=sp spml spml6" "[cgi_nbspace]"]
+ }
+ }
+ date {
+ set cd "[lindex [lindex [lindex $msg $j] 0] 0]"
+ }
+ size {
+ set sstr [lindex [lindex [lindex $msg $j] 0] 0]
+ regsub {^\(([^\)]+)\)$} $sstr {\1} sstr
+ set cd "[cgi_quote_html $sstr]"
+ }
+ number {
+ set cd [WPcomma $iln]
+ }
+ priority { ; # priority combined with "impotant"
+ set priority [lindex [lindex [lindex $msg $j] 0] 0]
+ unset cd
+ }
+ default {
+ set cd "[lindex [lindex [lindex $msg $j] 0] 0]"
+ }
+ }
+
+ if {[info exists cd]} {
+ if {[info exists dragit]} {
+ set ddid dd$ilu
+ set ddidid id=$ddid
+ set mouseover "onMouseOver=\"cursor('move');\""
+ set mouseout "onMouseOut=\"cursor('default');\""
+ } else {
+ set ddidid ""
+ set mouseover ""
+ set mouseout ""
+ }
+
+ cgi_table_data align="$align" class="$class" {
+ cgi_division $ddidid $mouseover $mouseout {
+ cgi_put $cd
+ }
+ }
+
+ if {[info exists dragit]} {
+ lappend ddlist "'$ddid':'$ilu'"
+ }
+ }
+ }
+
+ # fixed right column for combined important/priority
+ cgi_table_data class="wap rt" {
+ # WARNING: ititle STORES STATE, KEEP IN SYNC WITH lib/browse.js
+ set iclass nostar
+ set ititle ""
+
+ if {[info exists priority]} {
+ switch -regexp $priority {
+ ^2$ -
+ ^high$ {
+ set iclass prihi
+ set ititle "High Priority"
+ }
+ ^1$ -
+ ^highest$ {
+ set iclass prihier
+ set ititle "Highest Priority"
+ }
+ }
+ }
+
+ if {[lsearch -exact $statlist flagged] >= 0} {
+ set iclass star
+ if {[string length $ititle]} {
+ set ititle "Starred and $ititle"
+ } else {
+ set ititle "Starred"
+ }
+ }
+
+ if {0 == [string length $ititle]} {
+ set ititle "Set Starred"
+ }
+
+ cgi_put [cgi_url [cgi_span "class=sp spml $iclass" ""] "star/$c/$f/$ilu" class=mlstat id=star$ilu "title=$ititle" "onClick=return flipStar(this);"]
+ }
+ }
+ }
+ } else {
+ cgi_table_row {
+ cgi_table_data class=wap colspan=$columns align=center {
+ if {[catch {PEMailbox state} mbstate]} {
+ if {[string length $f]} {
+ set fn "Folder \"[cgi_quote_html $f]\""
+ } else {
+ set fn INBOX
+ }
+
+ cgi_put [cgi_span "style=font-size: large; font-weight: bold ; background-color: yellow;" "[cgi_nbspace]$fn cannot be opened[cgi_nbspace]"]
+ } else {
+ switch -- $mbstate {
+ closed {
+ cgi_put [cgi_span "style=font-size: large; font-weight: bold ; background-color: yellow;" "[cgi_nbspace]Folder \"[cgi_quote_html $f]\" is not opened[cgi_nbspace]"]
+ }
+ default {
+ cgi_put [cgi_span "style=font-size: large; font-weight: bold ; margin: 50px" "Folder \"[cgi_quote_html $f]\" contains no messages"]
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_put "</tbody>"
+ }
+ if {[info exists ddlist]} {
+ cgi_puts "<script>"
+ cgi_puts "function loadDDElements(){"
+ cgi_puts " var prop, ddList = { [join $ddlist ","] }, ddArray = \[\];"
+ cgi_puts " for(prop in ddList) ddArray\[ddArray.length\] = prop;"
+ cgi_puts " var tt = new YAHOO.widget.Tooltip('tipDrag', {context:ddArray, showdelay:500, text:'Drag over folder on left to move, Contacts to add'});"
+ cgi_puts " for(prop in ddList) canDragit(prop,ddList\[prop\],tt);"
+ cgi_puts "}"
+ cgi_puts "</script>"
+ }
+}
diff --git a/web/cgi/alpine/2.0/messageview.tcl b/web/cgi/alpine/2.0/messageview.tcl
new file mode 100644
index 00000000..13f660a2
--- /dev/null
+++ b/web/cgi/alpine/2.0/messageview.tcl
@@ -0,0 +1,731 @@
+# Web Alpine message text painting support
+# $Id$
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# messageview
+#
+# Purpose: TCL procedure to produce HTML-based view of a message's
+# header/body text
+#
+# Input:
+#
+
+proc email_addr {pers mailbox} {
+ if {[string length $pers]} {
+ return "[cgi_quote_html $pers] [cgi_lt][cgi_quote_html $mailbox][cgi_gt]"
+ } else {
+ return "[cgi_quote_html $mailbox]"
+ }
+}
+
+proc put_quoted {s} {
+ cgi_put [cgi_quote_html $s]
+}
+
+proc put_quoted_nl {s} {
+ cgi_put "[cgi_quote_html $s][cgi_nl]"
+}
+
+proc navViewButtons {c f u n} {
+ cgi_table_data class="wap pageBtns" {
+ if {[catch {PEMailbox uid [PEMailbox next $n -1]} uprev]} {
+ set prevurl "#"
+ } elseif {$u == $uprev} {
+ set prevurl "javascript:alert('Already viewing first message')"
+ } else {
+ set prevurl "view/$c/$f/$uprev"
+ }
+
+ cgi_put [cgi_url [cgi_span "class=sp spmb spmbu" [cgi_span "Prev"]] $prevurl "title=Previous Message" "onClick=return newMessageText({control:this,parms:{op:'prev'}});"]
+ }
+
+ cgi_table_data class="wap dv1" {
+ cgi_puts [cgi_span "class=sp spmb spmb3" ""]
+ }
+
+ cgi_table_data class="wap pageBtns" {
+ if {[catch {PEMailbox uid [PEMailbox next $n 1]} unext]} {
+ set nexturl "#"
+ } elseif {$u == $unext} {
+ set nexturl "javascript:alert('Already viewing last message')"
+ } else {
+ set nexturl "view/$c/$f/$unext"
+ }
+
+ cgi_put [cgi_url [cgi_span "class=sp spmb spmbd" [cgi_span "Next"]] $nexturl title="Next Message" class=wap "onClick=return newMessageText({control:this,parms:{op:'next'}});"]
+ }
+}
+
+proc drawTopViewMenuBar {c f u n} {
+ cgi_table id=toolBar class="toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ if {[lsearch -exact [list Junk Trash] $f] >= 0} {
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url "[cgi_img "img/cbn/delete.gif" class=wap] Delete Forever" "empty/$c/$f/$u" "onClick=return doEmpty(this,'message');" "title=Move message to Trash" class=wap]
+ }
+ cgi_table_data class="wap dv1" {
+ cgi_puts [cgi_span "class=sp spmb spmb3" ""]
+ }
+ cgi_table_data class=wap {
+ cgi_puts [cgi_url "[cgi_img img/cbn/inbox.gif class=wap] Move to INBOX" "move/$c/$f/$u?df=0/INBOX" "onClick=return newMessageText({control:this,parms:{op:'move',df:'0/INBOX'}});" class=wap]
+ }
+ } else {
+ cgi_table_data class=wap {
+ cgi_put [cgi_url [cgi_span "class=sp spmbi spmb4" "Reply"] "reply/$c/$f/$u?pop=view/$c/$f/$u" id=gReply class=wap]
+ }
+ cgi_table_data class=wap {
+ cgi_put [cgi_url [cgi_span "class=sp spmbi spmb5" "Reply All"] "replyall/$c/$f/$u?pop=view/$c/$f/$u" id=gReplyAll class=wap]
+ }
+ cgi_table_data class=wap {
+ cgi_put [cgi_url [cgi_span "class=sp spmbi spmb6" "Forward"] "forward/$c/$f/$u?pop=view/$c/$f/$u" id=gForward class=wap]
+ }
+ cgi_table_data class=wap {
+ if {[catch {PEMailbox uid [PEMailbox next $n 1]} unext]} {
+ set delurl "browse/$c/$f?u=$u"
+ } elseif {$u == $unext} {
+ set delurl "browse/$c/$f?u=${u}&delete=$u"
+ } else {
+ set delurl "view/$c/$f/$unext?delete=$u"
+ }
+ cgi_put [cgi_url [cgi_span "class=sp spmbi spmb7" "Delete"] $delurl title="Move message to Trash" class=wap id=gDelete "onClick=return newMessageText({control:this,parms:{op:'delete'}});"]
+ }
+ cgi_table_data class=wap {
+ cgi_put [cgi_url [cgi_span "class=sp spmbi spmb8" "Report Spam"] "view/$c/$f/$unext?spam=$u" title="Report as Spam and move message to Junk folder" class=wap id=gSpam "onClick=return newMessageText({control:this,parms:{op:'spam'}});"]
+ }
+ cgi_table_data class="wap dv1" {
+ cgi_puts [cgi_span "class=sp spmb spmb3" ""]
+ #cgi_put [cgi_img "img/cbn/div.gif" class=wap]
+ }
+ cgi_table_data class=wap {
+ cgi_bullet_list class="menu" {
+ cgi_put "<li class=menuHdr>[cgi_url "More Actions [cgi_img "img/cbn/menu.gif" class="wap menuDn menuImg"]" "#" class=wap "onClick=return false;"]<div>"
+ cgi_bullet_list {
+ cgi_li [cgi_url "Extract Addresses (Take)" "extract/$c/$f/$u" id="gExtract" "onClick=return takeAddress();"]
+ cgi_li "<hr />[cgi_url "Mark as Unread" "view/$c/$f/$unext?unread=$u" "onClick=return newMessageText({control:this,parms:{op:'unread'}});" id=gUnread]"
+ cgi_li [cgi_url "Set Star" "view/$c/$f/$u?star=1" "onClick=return setStar(-1,'ton');"]
+ cgi_li [cgi_url "Clear Star" "view/$c/$f/$u?star=0" "onClick=return setStar(-1,'not');"]
+ }
+ cgi_put "</div></li>"
+ }
+ }
+ }
+
+ cgi_table_data class="wap dv1" {
+ cgi_puts [cgi_span "class=sp spmb spmb3" ""]
+ }
+
+ # move/cp FOLDER LIST
+ cgi_table_data id=viewMorcButton class="wap yui-skin-sam yuimenu" {}
+ cgi_table_data class=wap {
+ cgi_bullet_list class="menu" {
+ cgi_put "<li class=menuHdr>[cgi_url "to Folder [cgi_img "img/cbn/menu.gif" class="menuDn menuImg wap"]" "#" "onClick=return false;"]<div>"
+ cgi_bullet_list id=viewSaveCache {
+ cgi_li "<hr />[cgi_url "More Folders..." "save/$c/$f" "onClick=pickFolder('folderList',morcWhich('viewMorcButton'),'[WPCmd PEFolder defaultcollection]',morcInViewDone); return false;"]"
+ }
+ cgi_put "</div></li>"
+ }
+ }
+
+ cgi_table_data class=wap width="100%" {
+ cgi_put [cgi_nbspace]
+ }
+
+ cgi_puts [navViewButtons $c $f $u $n]
+
+ cgi_table_data class="wap tbPad" align="right" {
+ cgi_put [cgi_nbspace]
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+}
+
+proc drawBottomViewMenuBar {c f u n mc} {
+ cgi_table class="wap toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data class="wap pageText" id=viewContext {
+ cgi_put "Message $n of $mc"
+ }
+ cgi_table_data class=wap width="100%" {
+ cgi_put [cgi_nbspace]
+ }
+
+ cgi_puts [navViewButtons $c $f $u $n]
+
+ cgi_table_data class="wap tbPad" align="right" {
+ cgi_put [cgi_nbspace]
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+}
+
+proc drawMessageText {c f u {showimg ""}} {
+ # before getting the list, move anything deleted to Trash
+ if {[catch {PEMailbox trashdeleted current} result]} {
+ PEInfo statmsg "Trash move Failed: $result"
+ }
+
+ # remember "current" message
+ if {$u > 0 && [catch {PEMailbox current uid $u} cm]} {
+ PEInfo statmsg "Set current failed: $cm"
+ set u 0
+ }
+
+ set wasnew [expr {[lsearch -exact [PEMessage $u status] New] >= 0}]
+ set html 0
+
+ catch {unset shownsubtype}
+ catch {unset bodyleadin}
+ catch {unset fromaddr}
+
+ # collect message parts
+ if {[catch {PEMessage $u header} hdrtext]} {
+ set hdrtext "Message Text Fetch Failure: $hdrtext"
+ } else {
+ # fish out From: address
+ foreach {ht hf hd} [join $hdrtext] {
+ if {0 == [string compare addr $ht]} {
+ if {0 == [string compare -nocase from $hf]} {
+ if {[llength $hd] == 1} {
+ set df [lindex [lindex $hd 0] 0]
+ if {0 == [string length $df]} {
+ set df [lindex [lindex $hd 0] 1]
+ }
+
+ set fromaddr [list $df [cgi_quote_html [lindex [lindex $hd 0] 0]] [lindex [lindex $hd 0] 1]]
+ }
+
+ break
+ }
+ }
+ }
+ }
+
+ set attachments 0
+ if {[catch {PEMessage $u attachments} attachmentlist]} {
+ # STATUS "Cannot get attachments: $attachments"
+ } else {
+ foreach att $attachmentlist {
+ # only an attachment if "shown" in multi/alt AND it has a filename
+ if {[string compare [lindex $att 1] shown]} {
+ if {[string length [lindex $att 4]]} {
+ incr attachments
+ }
+ } else {
+ # only use subtype if a single part is intended to be displayed
+ if {[info exists shownsubtype]} {
+ set shownsubtype ""
+ } else {
+ set shownsubtype [string tolower [lindex $att 3]]
+ }
+ }
+ }
+ }
+
+ set bodyopts {}
+ set showimages ""
+
+ if {[info exists shownsubtype] && 0 == [string compare $shownsubtype html]} {
+ if {[WPCmd PEInfo feature render-html-internally] == 0} {
+ set html 1
+ lappend bodyopts html
+ set image_set allow_images
+ } else {
+ set image_set allow_cid_images
+ }
+
+ switch -- $showimg {
+ 1 { ;# show images this once
+ lappend bodyopts images
+ set showimages 1
+ }
+ from { ;# always show images from sender
+ lappend bodyopts images
+ set showimages friend
+ if {[info exists fromaddr] && [string length [lindex $fromaddr 2]]} {
+ if {[catch {WPSessionState $image_set} friends]} { ;# no image_set yet?
+ if {[catch {WPSessionState $image_set [list [lindex $fromaddr 2]]} result]} {
+ catch {PEInfo statmsg "Cannot remember [lindex $fromaddr 2]: $result"}
+ }
+ } elseif {[lsearch -exact $friends [lindex $fromaddr 2]] < 0} {
+ lappend friends [lindex $fromaddr 2]
+ if {[catch {WPSessionState $image_set $friends} result]} {
+ catch {PEInfo statmsg "Cannot remember [lindex $fromaddr 2]: $result"}
+ }
+ }
+ }
+ }
+ 0 { ;# never show images from sender
+ if {[info exists fromaddr] && [catch {WPSessionState $image_set} friends] == 0} {
+ while {[set findex [lsearch -exact $friends [lindex $fromaddr 2]]] >= 0} {
+ set friends [lreplace $friends $findex $findex]
+ if {[catch {WPSessionState $image_set $friends} friends]} {
+ catch {PEInfo statmsg "Cannot forget image sender: $friends"}
+ break;
+ }
+ }
+ }
+ }
+ "" { ;# display if a friend
+ if {[info exists fromaddr]
+ && 0 == [catch {WPSessionState $image_set} friends]
+ && [lsearch -exact $friends [lindex $fromaddr 2]] >= 0} {
+ lappend bodyopts images
+ set showimages friend
+ }
+ }
+ }
+ }
+
+ if {[PEInfo mode full-header-mode] > 0} {
+ set put_tdata put_quoted
+ }
+
+ if {[catch {PEMessage $u body $bodyopts} bodytext]} {
+ set bodytext "Message Text Fetch Failure: $bodytext"
+ }
+
+ # prescan body for interesting stuff
+ foreach i $bodytext {
+ foreach j $i {
+ switch -exact [lindex $j 0] {
+ img { ;# digested HTML mode image
+ if {![info exists bodyleadin]
+ && [catch {PEMessage $uid cid "<[lindex [lindex $j 1] 0]>"} cidpart] == 0
+ && [string length $cidpart]
+ && [catch {PEMessage $uid attachinfo $cidpart} attachinfo] == 0
+ && [string compare [string tolower [lindex $attachinfo 1]] image] == 0} {
+ if {[string length $showimages]} {
+ set bodyleadin "\[ Attached images ARE being displayed \]"
+ if {[info exists fromaddr] && [string length [lindex $fromaddr 2]]} {
+ if {[string compare $showimages friend]} {
+ append bodyleadin "[cgi_nl]\[ Never show images from [cgi_url "[lindex $fromaddr 0]" "view/$c/$f/$u?showimg=0"] \]"
+ } else {
+ append bodyleadin "[cgi_nl]\[ Always show images from [cgi_url "[lindex $fromaddr 0]" "view/$c/$f/$u?showimg=from"] \]"
+ }
+ }
+ } else {
+ set bodyleadin "\[ Attached images are NOT being displayed \]"
+ append bodyleadin "[cgi_nl]\[ Show images [cgi_url "below" "view/$c/$f/$u?showimg=1" "onClick=return newMessageText({control:this,parms:{op:'noop',img:'1'}});"]"
+ if {[info exists fromaddr] && [string length [lindex $fromaddr 2]]} {
+ append bodyleadin ", or always show images from [cgi_url "[lindex $fromaddr 0]" "from/$c/$f/$u?showimg=from"] \]"
+ } else {
+ append bodyleadin " \]"
+ }
+ }
+ }
+ }
+ t {
+ if {$html && ![info exists bodyleadin] && [regexp {<[Ii][Mm][Gg](| ([^>]+))>} [lindex $j 1] dummy img]} {
+ set bodyleadin "[cgi_img "img/cbn/infomsg.gif"] Web-based images "
+ if {![string length $showimages]} {
+ append bodyleadin "have been blocked to to help protect your privacy and reduce spam.[cgi_nl][cgi_url "Display images below" "view/$c/$f/$u?showimg=1" "onClick=return newMessageText({control:this,parms:{op:'noop',img:'1'}});"]"
+ if {[info exists fromaddr] && [string length [lindex $fromaddr 2]]} {
+ append bodyleadin "[cgi_nbspace][cgi_nbspace][cgi_nbspace]-[cgi_nbspace][cgi_nbspace][cgi_nbspace][cgi_url "Display images and always trust email from [lindex $fromaddr 0]" "view/$c/$f/$u?showimg=from" "onClick=return newMessageText({control:this,parms:{op:'noop',img:'from'}});"]"
+ }
+ } else {
+ append bodyleadin "are being displayed below.[cgi_nl]"
+ if {[info exists fromaddr]} {
+ if {[string compare friend $showimages]} {
+ append bodyleadin "[cgi_nbspace][cgi_nbspace][cgi_url "Always display images and trust email from [lindex $fromaddr 0]" "view/$c/$f/$u?showimg=from" "onClick=return newMessageText({control:this,parms:{op:'noop',img:'from'}});"]"
+ } else {
+ append bodyleadin "[cgi_url "No longer automatically display images from [lindex $fromaddr 0]" "view/$c/$f/$u?showimg=0" "onClick=return newMessageText({control:this,parms:{op:'noop',img:'0'}});"]"
+ }
+ }
+ }
+ }
+ }
+ default {}
+ }
+ }
+ }
+
+ set infont 0
+ set inurl 0
+ set fgcolor [set normal_fgcolor [PEInfo foreground]]
+ set bgcolor [PEInfo background]
+
+ # Toss any informational panels up here
+ if {[info exists bodyleadin]} {
+ cgi_division class="wap bannerPrivacy" {
+ cgi_puts $bodyleadin
+ }
+ }
+
+ # put message pieces together
+ # first the header & attachment list
+ cgi_table class="wap msgHead" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+
+ # user headers are selectable, but we control the
+ # first two: subject, from and
+ # last two: date, attachments
+ if {1 == [llength $hdrtext] && 0 == [string compare -nocase raw [lindex [lindex $hdrtext 0] 0]]} {
+ # raw header
+ cgi_table_row {
+ cgi_table_data {
+ cgi_preformatted {
+ foreach hdrline [lindex [lindex $hdrtext 0] 2] {
+ foreach hdrlinepart $hdrline {
+ switch -- [lindex $hdrlinepart 0] {
+ t {
+ cgi_put [cgi_quote_html [lindex $hdrlinepart 1]]
+ }
+ default {
+ }
+ }
+ }
+
+ cgi_br
+ }
+ }
+
+ cgi_table_data "class=\"wap fullHdrBtn\"" {
+ if {[WPCmd PEMailbox focus]} {
+ set retf "Search Result"
+ } else {
+ set retf [cgi_quote_html $f]
+ }
+
+ cgi_put [cgi_url "Return[cgi_nbspace]to[cgi_nbspace]${retf}" "browse/$c/$f" class="wap" "onClick=return newMessageList({contol:this});"]
+ cgi_br
+ cgi_put [cgi_url "Show[cgi_nbspace]Filtered[cgi_nbspace]Headers" "view/$c/$f/$u" class="wap" "onClick=return newMessageText({contol:this,parms:{op:'hdroff'}});"]
+ }
+ }
+ }
+ } else {
+ set hdrmarkup ""
+ set datemarkup ""
+ foreach {ht hf hd} [join $hdrtext] {
+ switch -exact $ht {
+ text {
+ if {0 == [string compare -nocase subject $hf]} {
+ cgi_table_row {
+ cgi_table_data colspan=2 class="subText" {
+ cgi_put [cgi_quote_html $hd]
+ }
+ cgi_table_data "class=\"wap fullHdrBtn\"" {
+ if {[WPCmd PEMailbox focus]} {
+ set retf "Search Result"
+ } else {
+ set retf [cgi_quote_html $f]
+ }
+
+ cgi_put [cgi_url "Return[cgi_nbspace]to[cgi_nbspace]${retf}[cgi_span "class=sp spmv spmv3" [cgi_span [cgi_nbspace]]]" "browse/$c/$f" class="wap" "onClick=return newMessageList({contol:this,parms:{page:'new'}});"]
+ }
+ }
+ } elseif {0 == [string compare -nocase date $hf]} {
+ set datemarkup "<td class=\"wap hdrLabel\">$hf:</td><td class=\"wap hdrText\">[cgi_quote_html $hd]</td>"
+ } else {
+ append hdrmarkup "<td class=\"wap hdrLabel\">$hf:</td><td colspan=2 class=\"wap hdrText\">[cgi_quote_html $hd]</td>"
+ }
+ }
+ addr {
+ if {0 == [string compare -nocase from $hf]} { ;# From: always first
+ set addrs ""
+ if {0 == [catch {PEAddress books} booklist]} {
+ set tAFargs "\{books:\["
+ set comma ""
+ foreach b $booklist {
+ regsub -all {'} [lindex $b 1] {\'} bname
+ append tAFargs "${comma}\{book:[lindex $b 0],name:'$bname'\}"
+ set comma ","
+ }
+
+ append tAFargs "\]\}"
+ } else {
+ set tAFargs {{}}
+ }
+
+ foreach ma $hd {
+ lappend addrs [cgi_span class=emailAddr "[cgi_span "class=contactAddr" [email_addr [lindex $ma 0] [lindex $ma 1]]] [cgi_url "[cgi_span "class=sp spmv spmv1" ""]Add" "" "class=wap addContact" "onClick=takeAddressFrom('$u',$tAFargs); return false;" "title=Add Sender to Contacts"]"]
+ }
+
+ set hdrmarkup [linsert $hdrmarkup 0 "<td class=\"wap hdrLabel\">$hf:</td><td colspan=2 class=\"wap hdrText\">[join $addrs ",[cgi_nl]"]</td>"]
+ } else {
+ set addrs ""
+ foreach ma $hd {
+ lappend addrs [cgi_span class=emailAddr [email_addr [lindex $ma 0] [lindex $ma 1]]]
+ }
+
+ lappend hdrmarkup "<td class=\"wap hdrLabel\">$hf:</td><td colspan=2 class=\"wap hdrText\">[join $addrs ", "]</td>"
+ }
+ }
+ news -
+ rawaddr {
+ lappend hdrmarkup "<td class=\"wap hdrLabel\">$hf:</td><td colspan=2 class=\"wap hdrText\">[cgi_quote_html [join $hd ", "]]</td>"
+ }
+ default {
+ }
+ }
+ }
+
+ foreach hm $hdrmarkup {
+ cgi_table_row {
+ cgi_puts $hm
+ }
+ }
+
+ cgi_table_row {
+ cgi_puts $datemarkup
+ cgi_table_data "class=\"wap fullHdrBtn\"" {
+ cgi_put [cgi_url "Show[cgi_nbspace]Full[cgi_nbspace]Headers" "view/$c/$f/$u?headers=full" class="wap" "onClick=return newMessageText({control:this,parms:{op:'hdron'}});"]
+ }
+ }
+ }
+
+ if {$attachments} {
+ cgi_table_row {
+ cgi_table_data class="wap hdrLabel" {
+ cgi_put "Attachments:"
+ }
+ cgi_table_data class="wap hdrText" {
+ cgi_division "class=attach" {
+ set tail ""
+ foreach att $attachmentlist {
+ # !shown and has supplied file name
+ if {[string compare [lindex $att 1] shown] && [string length [lindex $att 4]]} {
+ if {[string length [lindex $att 4]]} {
+ set attitle [lindex $att 4]
+ } else {
+ set attitle "Attachment [lindex $att 0]"
+ }
+
+ cgi_put [cgi_span "class=attach" "[cgi_span "class=sp spmv spmv2" ""][cgi_url "$attitle" "detach/$c/$f/$u/[lindex $att 0]?download=1" title="Download $attitle"]"]
+ }
+
+ set tail ":[cgi_nbspace]"
+ }
+ }
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data colspan="3" class="hdrLabel" {
+ cgi_put [cgi_span "class=trans" "style=height:5px;width:2px;" [cgi_span " "]]
+ }
+ }
+
+ cgi_puts "</tbody>"
+ }
+
+ # start writing body
+ if {$html} {
+ set class ""
+ set class "class=\"contentBodyHTML\""
+ if {![info exists put_tdata]} {
+ set put_tdata cgi_put
+ }
+ } else {
+ set class "class=\"contentBody messageText\""
+ if {![info exists put_tdata]} {
+ set put_tdata put_quoted
+ }
+ }
+
+ cgi_division $class {
+ foreach i $bodytext {
+ foreach j $i {
+ set ttype [lindex $j 0]
+ set tdata [lindex $j 1]
+
+ # write anchors by hand
+ switch -- $ttype {
+ urlstart {
+ set href [lindex $tdata 0]
+ set name [lindex $tdata 1]
+
+ # build links by hand since we don't know where
+ # they'll terminate
+ set linktext "<a "
+ switch -- [lindex [split $href :] 0] {
+ mailto {
+ regsub {[?]} [lindex [split $href :] 1] {\&} maito
+ append linktext "href=mailto?to=[WPPercentQuote $maito {&=}]&pop=view/$c/[WPPercentQuote $f {/}]/$u"
+ }
+ default {
+ # no relative links, no javascript
+ if {[regexp -- "^(\[a-zA-Z\]+):" $href dummy scheme]
+ && [string compare -nocase $scheme javascript]} {
+ append linktext "href=\"$href\" target=\"_blank\" "
+ }
+
+ if {[string length $name]} {
+ append linktext "name=\"$name\""
+ }
+ }
+ }
+
+ cgi_put "${linktext}>"
+ set inurl 1
+ }
+ urlend {
+ if {$inurl} {
+ cgi_put "</a>"
+ }
+ }
+ attach {
+ set attachuid [lindex $tdata 0]
+ set part [lindex $tdata 1]
+ set mimetype [lindex $tdata 2]
+ set mimesubtype [lindex $tdata 3]
+ if {[string length [lindex $tdata 4]]} {
+ set file [lindex $tdata 4]
+ } else {
+ if {[string length [lindex $tdata 5]]} {
+ set file "attachment.[lindex $tdata 5]"
+ } else {
+ set file "unknown.txt"
+ }
+ }
+
+ set attachurl "detach.tcl?uid=${attachuid}&part=${part}"
+ set saveurl "${attachurl}&download=1"
+ if {0 == [string compare -nocase $mimetype "text"]
+ && 0 == [string compare -nocase $mimesubtype "html"]} {
+ set attachurl [append $attachurl "&download=1"]
+ }
+
+ set attachexp "View ${mimetype}/${mimesubtype} Attachment"
+
+ if {0 == [string compare message [string tolower ${mimetype}]]
+ && 0 == [string compare rfc822 [string tolower ${mimesubtype}]]} {
+ set attmsgurl "/$c/$f/$u/$part"
+ cgi_put [cgi_url [cgi_font size=-1 Fwd] "forward${attmsgurl}" target=_top]
+ cgi_put "|[cgi_url [cgi_font size=-1 Reply] "reply${attmsgurl}?reptext=1&repall=1" target=_top]"
+
+ } else {
+ cgi_put [cgi_url [cgi_font size=-1 View] $attachurl target="_blank"]
+ cgi_put "|[cgi_url [cgi_font size=-1 Save] $saveurl]"
+ }
+
+ if {[info exists attachurl]} {
+ set attachtext [WPurl $attachurl {} $hacktoken $attachexp target="_blank"]
+ }
+ }
+ img {
+ if {[info exists showimages] && [string length $showimages]
+ && [catch {PEMessage $uid cid "<[lindex [lindex $j 1] 0]>"} cidpart] == 0
+ && [string length $cidpart]
+ && [catch {PEMessage $uid attachinfo $cidpart} attachinfo] == 0
+ && [string compare [string tolower [lindex $attachinfo 1]] image] == 0} {
+ cgi_put [cgi_img detach/$c/$f/$u/${cidpart} "alt=\[[lindex $tdata 1]\]"]
+ } else {
+ cgi_put "\[[lindex $tdata 1]\]"
+ }
+ }
+ fgcolor {
+ if {$infont} {
+ cgi_put "</font>"
+ set infont 0
+ }
+
+ if {[string compare $tdata $fgcolor]} {
+ set fgcolor $tdata
+ if {[string compare $fgcolor $normal_fgcolor]} {
+ cgi_put "<font color=#${tdata}>"
+ set infont 1
+ }
+ }
+ }
+ bgcolor {
+ if {$infont} {
+ cgi_put "</font>"
+ set infont 0
+ }
+
+ if {[string compare $tdata $bgcolor]} {
+ cgi_put "<font style=\"background: #${tdata}\">"
+ set bgcolor $tdata
+ set infont 1
+ }
+ }
+ color {
+ if {$infont} {
+ cgi_put "</font>"
+ set infont 0
+ }
+
+ if {[string compare [lindex $tdata 0] $fgcolor] || [string compare [lindex $tdata 1] $bgcolor]} {
+ cgi_put "<font color=#[lindex $tdata 0] style=\"background: #[lindex $tdata 1]\">"
+ set bgcolor $tdata
+ set infont 1
+ }
+ }
+ italic {
+ switch $tdata {
+ on { cgi_put "<i>" }
+ off { cgi_put "</i>" }
+ }
+ }
+ bold {
+ switch $tdata {
+ on { cgi_put "<b>" }
+ off { cgi_put "</b>" }
+ }
+ }
+ underline {
+ switch $tdata {
+ on { cgi_put "<u>" }
+ off { cgi_put "</u>" }
+ }
+ }
+ strikethru {
+ switch $tdata {
+ on { cgi_put "<s>" }
+ off { cgi_put "</s>" }
+ }
+ }
+ bigfont {
+ switch $tdata {
+ on { cgi_put "<font size=\"+1\">" }
+ off { cgi_put "</font>" }
+ }
+ }
+ smallfont {
+ switch $tdata {
+ on { cgi_put "<font size=\"-1\">" }
+ off { cgi_put "</font>" }
+ }
+ }
+ default {
+ if {[info exists attachtext] && [set ht [string first $hacktoken $attachtext]] >= 0} {
+ set firstbit [string range $attachtext 0 [expr {$ht - 1}]]
+ set lastbit [string range $attachtext [expr {$ht + [string length $hacktoken]}] end]
+ cgi_put " $firstbit[cgi_quote_html [string trimleft $tdata]]$lastbit"
+ unset attachtext
+ } elseif {$html} {
+ $put_tdata "$tdata "
+ } else {
+ $put_tdata $tdata
+ }
+ }
+ }
+ }
+
+ if {!$html} {
+ cgi_br
+ }
+ }
+ }
+
+ cgi_division id="skip" {
+ cgi_put [cgi_url "Skip to Toolbar" "#toolbar"]
+ }
+
+ if {$wasnew} {
+ cgi_put "<script>decUnreadCount(1);</script>"
+ }
+}
diff --git a/web/cgi/alpine/2.0/newlist.tcl b/web/cgi/alpine/2.0/newlist.tcl
new file mode 100755
index 00000000..725a418b
--- /dev/null
+++ b/web/cgi/alpine/2.0/newlist.tcl
@@ -0,0 +1,477 @@
+#!./tclsh
+# $Id: newlist.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# newlist.tcl
+#
+# Purpose: CGI script that generates a page displaying a message
+# list of the indicated folder.
+#
+# Input: PATH_INFO: [/<col_number>]/<folder_name>[/<uid_of_first_msg>
+# along with possible search parameters:
+set newlist_args {
+ {op {} ""}
+ {df {} ""}
+ {uid {} ""}
+ {type {} ""}
+ {zoom {} ""}
+ {page {} ""}
+ {criteria {} ""}
+ {scope {} "new"}
+}
+
+# inherit global config
+source ./alpine.tcl
+source ./common.tcl
+source ./foldercache.tcl
+
+# default newlist state
+set c 0
+set f "INBOX"
+
+# TEST
+proc cgi_suffix {args} {
+ return ""
+}
+
+set dmsgs ""
+proc dm {s} {
+ global dmsgs
+
+ lappend dmsgs $s
+}
+
+proc focusOnResult {_focused} {
+ upvar 1 $_focused focused
+
+ if {[catch {WPCmd PEMailbox focus 1} focused]} {
+ WPCmd PEInfo statmsg "Cannot focus: $focused"
+ set focused 0
+ } else {
+ WPCmd PEInfo statmsg "Displaying $focused search results"
+ }
+}
+
+# grok PATH_INFO for collection, 'c', and folder 'f'
+if {[info exists env(PATH_INFO)] && [string length $env(PATH_INFO)]} {
+ if {[regexp {^/([0-9]+)/(.*)$} $env(PATH_INFO) dummy c f]} {
+ # Import data validate it and get session id
+ if {[catch {WPGetInputAndID sessid} result]} {
+ set harderr "Session Invalid: $result"
+ set deadsession 1
+ } else {
+ # grok parameters
+ foreach item $newlist_args {
+ if {[catch {eval WPImport $item} result]} {
+ set harderr "Cannot Read Input: $result"
+ break;
+ }
+ }
+
+ if {[catch {WPCmd PEMailbox messagecount} mc]} {
+ set harderr $mc
+ if {[regexp {[Ii]nactive [Ss]ession$} $mc]} {
+ set deadsession 1
+ }
+ }
+
+ }
+ } else {
+ set harderr "Invalid Folder: $env(PATH_INFO)"
+ }
+} else {
+ set harderr "No folder specified"
+}
+
+cgi_puts "Content-type: text/html; charset=\"UTF-8\"\n"
+
+if {[info exists harderr]} {
+ if {[info exists deadsession]} {
+ cgi_division class=contentDeadSession {
+ cgi_puts "This Web Alpine session is no longer active.<p>Click [cgi_url "here to restart your session." "$_wp(serverpath)/"] </div>"
+ }
+
+ exit
+ } else {
+ catch { WPCmd PEInfo statmsg "$harderr" }
+ set c 0
+ set f INBOX
+ }
+}
+
+set defc [WPCmd PEFolder defaultcollection]
+set focused [WPCmd PEMailbox focus]
+
+# set uid to "current" message?
+if {0 == [catch {WPCmd PEMailbox current} cm]} {
+ set n [lindex $cm 0]
+ set u [lindex $cm 1]
+} else {
+ if {$mc > 0} {
+ WPCmd PEInfo statmsg "BOTCH: No current message"
+ }
+
+ # non given, set to first message in folder
+ set n 1
+ if {[catch {
+ set n [WPCmd PEMailbox first]
+ set u [WPCmd PEMailbox uid $n]
+ } result]} {
+ if {$mc > 0} {
+ WPCmd PEInfo statmsg "No first message: $result"
+ }
+
+ set n 0
+ set u 0
+ }
+}
+
+# lines per page
+if {[catch {WPCmd PEInfo indexlines} ppg] || $ppg <= 0} {
+ set ppg $_wp(indexlines)
+} elseif {$ppg > $_wp(indexlinesmax)} {
+ set ppg $_wp(indexlinesmax)
+}
+
+# deal with page change
+if {$mc > 0} {
+ switch -regexp -- $op {
+ ^next$ {
+ set n [WPCmd PEMailbox next $n $ppg]
+
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ set n [WPCmd PEMailbox first]
+ set u [WPCmd PEMailbox uid $n]
+ }
+ }
+ ^prev$ {
+ if {$ppg >= $n} {
+ set n [WPCmd PEMailbox first]
+ } else {
+ set n [WPCmd PEMailbox next $n -$ppg]
+ }
+
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ set n [WPCmd PEMailbox first]
+ set u 0
+ }
+ }
+ ^first$ {
+ set n [WPCmd PEMailbox first]
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ set n 1
+ set u 0
+ }
+ }
+ ^last$ {
+ set n [WPCmd PEMailbox last]
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ set n 1
+ set u 0
+ }
+ }
+ ^delete$ {
+ if {[catch {WPCmd PEMailbox apply count new} trashed_new]} {
+ set trashed_new 0
+ }
+
+ if {[catch {WPCmd PEMailbox apply flag ton del} result]} {
+ WPCmd PEInfo statmsg "Delete failed: $result"
+ } else {
+ WPCmd PEInfo statmsg "$result message[WPplural $result] moved to Trash"
+ if {$trashed_new > 0} {
+ set trashed $trashed_new
+ }
+ }
+ }
+ ^trash$ {
+ if {[catch {WPCmd PEFolder empty $c [wpLiteralFolder $c $f] selected} result]} {
+ WPCmd PEInfo statmsg "Cannot Remove: $result"
+ } else {
+ WPCmd PEInfo statmsg "$result message[WPplural $result] deleted forever"
+ if {0 == [WPCmd PEMailbox messagecount]} {
+ set n 0
+ set u 0
+ }
+ set trashed [expr {$result * -1}]
+ }
+ }
+ ^trashall$ {
+ if {[catch {WPCmd PEFolder empty $c [wpLiteralFolder $c $f] all} result]} {
+ WPCmd PEInfo statmsg "Cannot Remove: $result"
+ } else {
+ WPCmd PEInfo statmsg "$result message[WPplural $result] deleted forever"
+ set n 0
+ set u 0
+ set trashed [expr {$result * -1}]
+ }
+ }
+ ^spam$ {
+ set numspam [WPCmd PEMailbox selected]
+ if {$numspam > 0} {
+ # aggregate save
+ if {[info exists _wp(spamsubj)] && [string length $_wp(spamsubj)]} {
+ set spamsubj $_wp(spamsubj)
+ } else {
+ set spamsubj "Spam Report"
+ }
+
+ # aggregate delete
+ if {[info exists _wp(spamfolder)] && [string length $_wp(spamfolder)]
+ && [catch {
+ if {[WPCmd PEFolder exists $defc $_wp(spamfolder)] == 0} {
+ WPCmd PEFolder create $defc $_wp(spamfolder)
+ }
+
+ WPCmd PEMailbox apply save $defc $_wp(spamfolder)
+ } result]} {
+ WPCmd PEInfo statmsg "Error Reporting Spam: $result"
+ } elseif {[info exists _wp(spamaddr)] && [string length $_wp(spamaddr)]
+ && [catch {WPCmd PEMailbox apply spam $_wp(spamaddr) $spamsubj} reason]} {
+ WPCmd PEInfo statmsg "Error Sending Spam Notice: $reason"
+ } elseif {[catch {WPCmd PEMailbox apply delete} reason]} {
+ WPCmd PEInfo statmsg "Error marking Spam Deleted: $reason"
+ } else {
+ WPCmd PEInfo statmsg "$numspam spam message[WPplural $numspam] reported"
+ }
+ }
+ }
+ ^copy$ {
+ if {[string length $df] && [regexp {^([0-9]+)/(.*)$} $df dummy dfc dfn] && [string length $dfn]} {
+ if {[catch {WPCmd PEMailbox apply count new} cpmv_new]} {
+ set cpmv_new 0
+ }
+
+ if {[catch {WPCmd PEMailbox apply copy $dfc $dfn} result]} {
+ WPCmd PEInfo statmsg "Cannot copy messages: $result"
+ } else {
+ if {$dfc == $defc
+ && !(([info exists _wp(spamfolder)] && 0 == [string compare $f $_wp(spamfolder)])
+ || 0 == [string compare $f Trash])} {
+ addSaveCache $dfn
+ set savecachechange $dfn
+ set cpmvdest [cgi_quote_html $dfn]
+ if {$result > 0 && $cpmv_new > 0} {
+ set cpmv $cpmv_new
+ }
+ }
+
+ WPCmd PEInfo statmsg "Copied $result message[WPplural $result] to $dfn"
+ }
+ } else {
+ WPCmd PEInfo statmsg "Cannot copy to $df"
+ }
+ }
+ ^move$ {
+ if {[string length $df] && [regexp {^([0-9]+)/(.*)$} $df dummy dfc dfn] && [string length $dfn]} {
+ if {[catch {WPCmd PEMailbox apply count new} cpmv_new]} {
+ set cpmv_new 0
+ }
+
+ if {[catch {WPCmd PEMailbox apply move $dfc $dfn} result]} {
+ WPCmd PEInfo statmsg "Move Failure: $result"
+ } else {
+ # if needed, empty what was moved
+ if {$c == [WPCmd PEFolder defaultcollection]
+ && (([info exists _wp(spamfolder)] && 0 == [string compare $f $_wp(spamfolder)])
+ || 0 == [string compare $f Trash])
+ && [catch {WPCmd PEFolder empty $c $f selected} result]} {
+ WPCmd PEInfo statmsg "Move Failure: $result"
+ } else {
+ if {$dfc == $defc
+ && !(([info exists _wp(spamfolder)] && 0 == [string compare $f $_wp(spamfolder)])
+ || 0 == [string compare $f Trash])} {
+ addSaveCache $dfn
+ set savecachechange $dfn
+ set cpmvdest [cgi_quote_html $dfn]
+ if {$result > 0 && $cpmv_new > 0} {
+ set cpmv $cpmv_new
+ }
+ }
+
+ # clean up moved messages so they don't get tossed in Trash as well
+ if {[catch {WPCmd PEMailbox expunge} blasted] || [string length $blasted]} {
+ WPCmd PEInfo statmsg "Move Failure: $blasted"
+ } else {
+ WPCmd PEInfo statmsg "Moved $result message[WPplural $result] to $dfn"
+ }
+ }
+ }
+ } else {
+ WPCmd PEInfo statmsg "Cannot move: to $df"
+ }
+ }
+ ^movemsg$ {
+ if {[regexp {^[0-9]+$} $uid] && $uid > 0 && [string length $df] && [regexp {^([0-9]+)/(.*)$} $df dummy dfc dfn] && [string length $dfn]} {
+ if {[catch {
+ # destination Trash? just delete and let regular delete process move it
+ if {$dfc == $defc && 0 == [string compare Trash $dfn]} {
+ WPCmd PEMessage $uid flag deleted 1
+ } else {
+ WPCmd PEMessage $uid move $dfc $dfn
+ }
+
+ # source is trash/junk, remove explicitly
+ if {$c == $defc
+ && (([info exists _wp(spamfolder)] && 0 == [string compare $f $_wp(spamfolder)])
+ || 0 == [string compare $f Trash])} {
+ WPCmd PEFolder empty $c $f $uid
+ }
+
+ WPCmd PEInfo statmsg "Moved message to $dfn"
+ set cpmvdest [cgi_quote_html $dfn]
+ if {0 != [WPCmd PEMessage $uid flag new]} {
+ set cpmv 1
+ }
+ } result]} {
+ WPCmd PEInfo statmsg "Move Failure: $result"
+ }
+ } else {
+ WPCmd PEInfo statmsg "Cannot move: to $df"
+ }
+ }
+ ^sort[A-Za-z]+$ {
+ if {[regexp {^sort([[Rr]ev|)(.*)$} $op dummy rev sname]} {
+ set sort [string tolower $sname]
+ set rval [expr {[string length $rev] > 0}]
+ if {[catch {WPCmd PEMailbox sort $sort $rval} cursort]} {
+ WPCmd PEInfo statmsg "Cannot set sort: $cursor"
+ set cursort [list nonsense 0]
+ } else {
+ # store result
+ WPCmd set sort [list $sort $rval]
+ }
+ } else {
+ WPCmd PEInfo statmsg "Unrecognized Sort: $op"
+ }
+ }
+ ^search$ {
+ if {![regexp {broad|narrow} $scope]} {
+ WPCmd PEMailbox focus 0
+ WPCmd PEMailbox search none
+ set scope broad
+ }
+
+ switch -- $type {
+ none {
+ WPCmd PEMailbox focus 0
+ WPCmd PEMailbox search none
+ }
+ any {
+ if {![string length $criteria]} {
+ WPCmd PEInfo statmsg "No search criteria provided"
+ } elseif {[catch {WPCmd PEMailbox search $scope text ton any $criteria} result]} {
+ WPCmd PEInfo statmsg "Search failed: $result"
+ } else {
+ if {$result == 0} {
+ WPCmd PEInfo statmsg "No messages matched your search"
+ cgi_html_comment "SCOPE: $scope"
+ if {0 == [string compare new $scope]} {
+ WPCmd PEMailbox focus 0
+ WPCmd PEMailbox search none
+ }
+ } else {
+ set n [WPCmd PEMailbox first]
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ set n 1
+ set u 0
+ }
+
+ focusOnResult focused
+ }
+ }
+ }
+ compound {
+ if {![string length $criteria]} {
+ WPCmd PEInfo statmsg "No search criteria provided"
+ } elseif {[catch {WPCmd PEMailbox search $scope compound $criteria} result]} {
+ WPCmd PEInfo statmsg "Search failed: $result"
+ } else {
+ if {$result == 0} {
+ WPCmd PEInfo statmsg "No messages matched your search"
+ if {0 == [string compare new $scope]} {
+ WPCmd PEMailbox focus 0
+ WPCmd PEMailbox search none
+ }
+ } else {
+ set n [WPCmd PEMailbox first]
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ set n 1
+ set u 0
+ }
+
+ focusOnResult focused
+ }
+ }
+ }
+ default {
+ WPCmd PEInfo statmsg "Unrecognized search: $type"
+ }
+ }
+ }
+ ^focus$ {
+ focusOnResult focused
+ }
+ ^unfocus$ {
+ if {[catch {WPCmd PEMailbox focus 0} result]} {
+ WPCmd PEInfo statmsg "Cannot unfocus: $result"
+ } elseif {$focused > 0} {
+ WPCmd PEInfo statmsg "All messages displayed"
+ set focused 0
+ }
+ }
+ noop -
+ ^$ {
+ }
+ default {
+ }
+ }
+}
+
+if {$focused} {
+ set mc $focused
+}
+
+# page framing (note maybe changed by actions above)
+wpInitPageFraming u n mc ppg pn pt
+
+cgi_puts [WPCmd cgi_buffer "drawMessageList $c {$f} $n $ppg"]
+
+cgi_puts "<script>"
+cgi_put "updateBrowseLinksAndSuch(\{"
+cgi_put "u:$u,selected:[WPCmd PEMailbox selected],"
+cgi_put "unread:[WPCmd PEMailbox flagcount [list unseen undeleted]],"
+cgi_put "page:$pn,pages:$pt,count:$mc,"
+cgi_put "searched:[WPCmd PEMailbox searched],focused:$focused,"
+cgi_put "sort:'[lindex [WPCmd PEMailbox sort] 0]'"
+if {[info exists trashed] && $trashed != 0} {
+ cgi_put ",trashed:$trashed"
+}
+if {[info exists cpmv] && $cpmv != 0} {
+ cgi_put ",cpmv:{f:'$cpmvdest',n:$cpmv}"
+}
+cgi_puts "\});"
+if {0 == [string compare $page new]} {
+ cgi_puts "showBrowseMenus();"
+ cgi_puts "initMenus();"
+ cgi_puts "initMorcButton('listMorcButton');"
+ cgi_puts "initSelection();"
+ wpSaveMenuJavascript "browse" $c $f [WPCmd PEFolder defaultcollection] morcInBrowseDone
+ wpSetMessageListNewMailCheck
+ cgi_puts "if(self.loadDDElements) loadDDElements();"
+}
+if {[info exists savecachechange]} {
+ wpSaveMenuJavascript browse $c $f $defc morcInBrowseDone $savecachechange
+}
+wpStatusAndNewmailJavascript
+cgi_puts "if(self.loadDDElements) loadDDElements();"
+cgi_puts "</script>"
diff --git a/web/cgi/alpine/2.0/newview.tcl b/web/cgi/alpine/2.0/newview.tcl
new file mode 100755
index 00000000..afcc2f0b
--- /dev/null
+++ b/web/cgi/alpine/2.0/newview.tcl
@@ -0,0 +1,306 @@
+#!./tclsh
+# $Id: newview.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# newview.tcl
+#
+# Purpose: CGI script that generates a page displaying a message
+# list of the indicated folder.
+#
+# Input: PATH_INFO: [/<col_number>]/<folder_name>[/<uid_of_first_msg>
+# along with possible search parameters:
+set newview_args {
+ {op {} ""}
+ {df {} ""}
+ {img {} 0}
+ {page {} ""}
+}
+
+# inherit global config
+source ./alpine.tcl
+source ./common.tcl
+source ./foldercache.tcl
+
+# default newview state
+set showimg ""
+
+# TEST
+proc cgi_suffix {args} {
+ return ""
+}
+
+proc next_message {_n _u {i 1}} {
+ upvar 1 $_n n
+ upvar 1 $_u u
+
+ if {[catch {WPCmd PEMailbox next $n $i} nnext]} {
+ WPCmd PEInfo statmsg "Cannot get next message: $nnext"
+ } else {
+ set n $nnext
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ WPCmd PEInfo statmsg "Message $nnext has no UID: $u"
+ set n 0
+ set u 0
+ }
+ }
+}
+
+# grok PATH_INFO for collection 'c' and folder 'f'
+if {[info exists env(PATH_INFO)] && [string length $env(PATH_INFO)]} {
+ if {[regexp {^/([0-9]+)/(.*)/([0-9]+)$} $env(PATH_INFO) dummy c f u]} {
+ # Import data validate it and get session id
+ if {[catch {WPGetInputAndID sessid} result]} {
+ set harderr "Invalid Session: $result"
+ set deadsession 1
+ } else {
+ # grok parameters
+ foreach item $newview_args {
+ if {[catch {eval WPImport $item} result]} {
+ set harderr "Cannot read input: $result"
+ break;
+ }
+ }
+
+ if {[catch {WPCmd PEMessage $u number} n]} {
+ set harderr "Message no longer exists in $f"
+ }
+ }
+ } else {
+ set harderr "Invalid path: $env(PATH_INFO)"
+ set nofolder 1
+ }
+} else {
+ set harderr "No Folder Specified!"
+ set nofolder 1
+}
+
+if {[info exists harderr]} {
+ if {[info exists deadsession]} {
+ cgi_puts "Content-type: text/html; charset=\"UTF-8\"\n"
+ cgi_puts "Your Web Alpine Session has been closed."
+ } else {
+ catch { WPCmd PEInfo statmsg "$harderr" }
+ unset harderr
+
+ if {[info exists nofolder]} {
+ set env(PATH_INFO) "/0/INBOX"
+ } else {
+ set env(PATH_INFO) "/${c}/${f}"
+ }
+
+ source newlist.tcl
+ }
+
+ exit
+}
+
+cgi_puts "Content-type: text/html; charset=\"UTF-8\"\n"
+
+if {[catch {WPCmd PEMessage $u number} n]} {
+ WPCmd PEInfo statmsg "Message access error: $n"
+ set n 0
+} else {
+ switch -regexp -- $op {
+ ^next$ {
+ next_message n u
+ }
+ ^prev$ {
+ next_message n u -1
+ }
+ ^hdron$ {
+ WPCmd PEInfo mode full-header-mode 2
+ }
+ ^hdroff$ {
+ WPCmd PEInfo mode full-header-mode 0
+ }
+ ^unread$ {
+ if {[catch {WPCmd PEMessage $u flag new 1} result]} {
+ WPCmd PEInfo statmsg "Delete of $u failed: $result"
+ } else {
+ next_message n u
+ }
+ }
+ ^delete$ {
+ if {[catch {WPCmd PEMessage $u flag deleted 1} result]} {
+ WPCmd PEInfo statmsg "Delete of $u failed: $result"
+ } else {
+ WPCmd PEInfo statmsg "Message moved to Trash"
+ if {$n == 1} {
+ next_message n u
+ set n 1
+ } elseif {$n == [WPCmd PEMailbox messagecount]} {
+ next_message n u -1
+ } else {
+ set nnext $n
+ next_message n u
+ set n $nnext
+ }
+ }
+ }
+ ^trash$ {
+ if {[catch {WPCmd PEFolder empty $c [wpLiteralFolder $c $f] $u} result]} {
+ WPCmd PEInfo statmsg "Cannot delete forever: $result"
+ } else {
+ WPCmd PEInfo statmsg "Message deleted forever"
+ set mc [WPCmd PEMailbox messagecount]
+ if {$mc == 0} {
+ set n 0
+ set u 0
+ } else {
+ if {$n > $mc} {
+ set n $mc
+ }
+
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ WPCmd PEInfo statmsg "Cannot get UID of $n: $u"
+ set n 0
+ set u 0
+ }
+ }
+ }
+ }
+ ^move$ -
+ ^copy$ {
+ if {[string length $df] && [regexp {^([0-9]+)/(.*)$} $df dummy dfc dfn] && [string length $dfn]} {
+ if {[catch {WPCmd PEMessage $u $op $dfc [wpLiteralFolder $dfc $dfn]} result]} {
+ WPCmd PEInfo statmsg "Cannot $op message $n: $result"
+ } else {
+ if {0 == [string compare $op move]} {
+ if {$c == [WPCmd PEFolder defaultcollection]
+ && (([info exists _wp(spamfolder)] && 0 == [string compare $f $_wp(spamfolder)])
+ || 0 == [string compare $f Trash])} {
+ if {[catch {WPCmd PEFolder empty $c $f $u} result]} {
+ WPCmd PEInfo statmsg "Cannot empty Trash: $result"
+ } else {
+ set mc [WPCmd PEMailbox messagecount]
+ if {$mc == 0} {
+ set n 0
+ set u 0
+ } else {
+ if {$n > $mc} {
+ set n $mc
+ }
+
+ if {[catch {WPCmd PEMailbox uid $n} u]} {
+ WPCmd PEInfo statmsg "Cannot get UID of $n: $u"
+ set n 0
+ set u 0
+ }
+ }
+ }
+ } else {
+ if {[catch {WPCmd PEMailbox expunge} blasted] || [string length $blasted]} {
+ WPCmd PEInfo statmsg "Move Problem: $blasted"
+ }
+
+ next_message n u
+ }
+ }
+
+ # feedback from alpined
+ if {[string compare -nocase inbox $dfn]} {
+ addSaveCache $dfn
+ set savecachechange $dfn
+ }
+ }
+ } else {
+ WPCmd PEInfo statmsg "Cannot $op to $df"
+ }
+ }
+ ^spam$ {
+ if {[info exists _wp(spamsubj)]} {
+ set spamsubj $_wp(spamsubj)
+ } else {
+ set spamsubj "Spam Report"
+ }
+
+ if {[info exists _wp(spamfolder)] && [string length $_wp(spamfolder)]
+ && [catch {
+ set defc [WPCmd PEFolder defaultcollection]
+ if {[WPCmd PEFolder exists $defc $_wp(spamfolder)] == 0} {
+ WPCmd PEFolder create $defc $_wp(spamfolder)
+ }
+
+ WPCmd PEMessage $u save $defc $_wp(spamfolder)
+ } result]} {
+ WPCmd PEInfo statmsg "Error spamifying message $message: $result"
+
+ } elseif {[info exists _wp(spamaddr)] && [string length $_wp(spamaddr)]
+ && [catch {WPCmd PEMessage $u spam $_wp(spamaddr) $spamsubj} result]} {
+ WPCmd PEInfo statmsg "Can't Report Spam: $result"
+ } elseif {[catch {WPCmd PEMessage $u flag deleted 1} result]} {
+ WPCmd PEInfo statmsg "Error spamifying message $message: $result"
+ } else {
+ WPCmd PEInfo statmsg "Message $n reported as Spam and flagged for deletion"
+ if {$n == 1} {
+ next_message n u
+ set n 1
+ } elseif {$n == [WPCmd PEMailbox messagecount]} {
+ next_message n u -1
+ } else {
+ set nnext $n
+ next_message n u
+ set n $nnext
+ }
+ }
+ }
+ ^$ -
+ ^noop$ {
+ # $img == 0 : remove current from from allow_cid_images list
+ # $img == 1 : allow images for this message this once
+ # $img == "from" : always allow images from this address
+ if {[regexp {0|1|from} $img]} {
+ set showimg $img
+ }
+ }
+ default {
+ WPCmd PEInfo statmsg "Unrecognized option: $op"
+ }
+ }
+}
+
+if {$n > 0} {
+ cgi_puts [WPCmd cgi_buffer "drawMessageText $c {$f} $u $showimg"]
+ cgi_puts "<script>"
+ if {0 == [catch {WPCmd PEMessage $u needpasswd}]} {
+ cgi_put "getSmimePassphrase({sessid:'$_wp(sessid)',control:this,parms:{op:'noop',page:'new'}});"
+ }
+ if {[catch {WPCmd PEMailbox next $n 1} nnext]} {
+ WPCmd PEInfo statmsg "Cannot get next message: $nnext"
+ } else {
+ if {[catch {WPCmd PEMailbox uid $nnext} unext]} {
+ WPCmd PEInfo statmsg "Message $nnext has no UID: $unext"
+ set unext 0
+ }
+ }
+ cgi_puts "updateViewLinksAndSuch(\{u:$u,n:$n,unext:$unext,unread:[WPCmd PEMailbox flagcount [list unseen undeleted]],count:[WPCmd PEMailbox messagecount],selected:[WPCmd PEMailbox selected]\});"
+ if {0 == [string compare new $page]} {
+ cgi_puts "showViewMenus();"
+ cgi_puts "initMenus();"
+ cgi_puts "initMorcButton('viewMorcButton');"
+ wpSaveMenuJavascript "view" $c $f [WPCmd PEFolder defaultcollection] morcInViewDone
+ }
+ if {[info exists savecachechange]} {
+ wpSaveMenuJavascript "view" $c $f [WPCmd PEFolder defaultcollection] morcInViewDone $savecachechange
+ }
+
+ cgi_puts "document.getElementById('alpineContent').scrollTop = 0;"
+ wpStatusAndNewmailJavascript
+ cgi_puts "setCheckMailFunction('gCheck', newMailCheck);"
+ cgi_puts "setNewMailCheckInterval([WPCmd PEInfo inputtimeout]);"
+ cgi_puts "</script>"
+} else {
+ cgi_puts "<script>"
+ cgi_puts "updateViewLinksAndSuch({});"
+ wpStatusAndNewmailJavascript
+ cgi_puts "</script>"
+}
diff --git a/web/cgi/alpine/2.0/reply b/web/cgi/alpine/2.0/reply
new file mode 120000
index 00000000..872d4cb2
--- /dev/null
+++ b/web/cgi/alpine/2.0/reply
@@ -0,0 +1 @@
+compose \ No newline at end of file
diff --git a/web/cgi/alpine/2.0/replyall b/web/cgi/alpine/2.0/replyall
new file mode 120000
index 00000000..872d4cb2
--- /dev/null
+++ b/web/cgi/alpine/2.0/replyall
@@ -0,0 +1 @@
+compose \ No newline at end of file
diff --git a/web/cgi/alpine/2.0/resume b/web/cgi/alpine/2.0/resume
new file mode 120000
index 00000000..872d4cb2
--- /dev/null
+++ b/web/cgi/alpine/2.0/resume
@@ -0,0 +1 @@
+compose \ No newline at end of file
diff --git a/web/cgi/alpine/2.0/settings b/web/cgi/alpine/2.0/settings
new file mode 100755
index 00000000..dc69487d
--- /dev/null
+++ b/web/cgi/alpine/2.0/settings
@@ -0,0 +1,734 @@
+#!./tclsh
+# $Id: settings 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# view.tcl
+#
+# Purpose: CGI script settings for Web Alpine 2.0 settings page
+#
+# Input:
+#
+set settings_args {
+}
+
+# inherit global config
+source ./alpine.tcl
+source ./foldercache.tcl
+source ./common.tcl
+
+set script_base "$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)/"
+
+# TEST
+proc cgi_suffix {args} {
+ return ""
+}
+
+set labels 0
+proc set_feature {feature desc} {
+ global labels
+ cgi_checkbox $feature=1 [set_checked [WPCmd PEInfo feature $feature]] id="label_[incr labels]"
+ cgi_put " <label for=\"label_${labels}\">$desc</label>"
+}
+
+proc set_checked {checked {token checked}} {
+ if {$checked > 0} {
+ return $token
+ }
+
+ return ""
+}
+
+proc set_variable {var {desc ""}} {
+ global labels
+ if {[string length $desc]} {
+ cgi_put "<label for=\"label_[incr labels]\">${desc}</label>"
+ }
+ cgi_text ${var}=[var_value $var] id="label_${labels}"
+}
+
+
+WPEval $settings_args {
+
+ if {0 == [catch {WPCmd PEFolder current} curfold]} {
+ set c [lindex $curfold 0]
+ set f [lindex $curfold 1]
+ } else {
+ set c 0
+ set f inbox
+ }
+
+ set charset "UTF-8"
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=$charset"
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_content_type "text/html; charset=$charset"
+ cgi_title [wpPageTitle "Settings"]
+ cgi_base "href=$script_base"
+ cgi_stylesheet css/cbn/screen.css
+ # Yahoo Styles
+ cgi_stylesheet $_wp(yui)/build/container/assets/container-core.css
+ cgi_stylesheet $_wp(yui)/build/menu/assets/skins/sam/menu.css
+ cgi_stylesheet $_wp(yui)/build/button/assets/skins/sam/button.css
+ # YahooUI libraries
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/utilities/utilities.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/container/container-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/datasource/datasource-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/menu/menu-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/button/button-min.js" {}
+ # local libraries
+ cgi_script language="JavaScript" src="lib/common.js" {}
+ cgi_script language="JavaScript" src="lib/settings.js" {}
+ cgi_javascript {
+ cgi_puts "YAHOO.alpine.cgi_root = '$_wp(serverpath)';"
+ cgi_puts "YAHOO.alpine.cgi_base = '$script_base';"
+ cgi_puts "YAHOO.alpine.current.incoming = [WPCmd PEFolder isincoming $c];"
+ cgi_puts "YAHOO.alpine.current.c = $c;"
+ cgi_puts "YAHOO.alpine.current.f = \"$f\";"
+ cgi_puts "function bodyOnLoad() {"
+ cgi_puts " if(YAHOO.env.ua.gecko > 0){ sizeVPHeight(); window.onresize = resizeVPHeight; }"
+ cgi_puts " setCheckMailFunction('gCheck', newMailCheck);"
+ cgi_puts " setNewMailCheckInterval([WPCmd PEInfo inputtimeout]);"
+ cgi_puts "}"
+ cgi_puts "browserDetect();"
+ }
+ }
+
+ cgi_body class=wap "onLoad=bodyOnLoad()" {
+ cgi_puts {<iframe name="formResponse" id="formResponse" src="img/cbn/spritelib.gif"></iframe>}
+ wpCommonPageLayout {settings {
+ cgi_hr
+ cgi_division {
+ cgi_put [cgi_url [cgi_span "class=sp splci tbi5" "Back to $f"] browse/$c/$f class=wap title="Return to $f without saving changes"]
+ }
+ cgi_hr
+ cgi_division class="ftitle bld" {
+ cgi_put "Basic Settings"
+ }
+ cgi_division "class=\"bld sel\"" {
+ cgi_put [cgi_url [cgi_span "class=sp splcs splc12" "General Preferences"] # class=wap id=Page1 "onClick=return settingsPage(this);"]
+ }
+ cgi_division class=bld {
+ cgi_put [cgi_url [cgi_span "class=sp splcs splc12" "Personal Preferences"] # class=wap id=Page2 "onClick=return settingsPage(this);"]
+ }
+ cgi_division class=bld {
+ cgi_put [cgi_url [cgi_span "class=sp splcs splc12" "News and Weather"] # class=wap id=Page3 "onClick=return settingsPage(this);"]
+ }
+ cgi_division class="ftitle bld" "style=\"margin-top: 2em;\"" {
+ cgi_put [cgi_url "[cgi_img img/cbn/f_plus.gif class=wap] Advanced Settings" # class=wap "onClick=return toggleAdvance(this);"]
+ }
+ cgi_division id=advancedSettings {
+ cgi_division class=bld {
+ cgi_put [cgi_url [cgi_span "class=sp splcs splc12" "Message List"] # class=wap id=Page4 "onClick=return settingsPage(this);"]
+ }
+ cgi_division class=bld {
+ cgi_put [cgi_url [cgi_span "class=sp splcs splc12" "Message View"] # class=wap id=Page5 "onClick=return settingsPage(this);"]
+ }
+ cgi_division class=bld {
+ cgi_put [cgi_url [cgi_span "class=sp splcs splc12" "Folders"] # class=wap id=Page8 "onClick=return settingsPage(this);"]
+ }
+ cgi_division class=bld {
+ cgi_put [cgi_url [cgi_span "class=sp splcs splc12" "Compose"] # class=wap id=Page6 "onClick=return settingsPage(this);"]
+ }
+ cgi_division class="ftitle bld" "style=\"margin-top: 2em;\"" {
+ cgi_put "Server Settings"
+ }
+ cgi_division class=bld {
+ cgi_put [cgi_url [cgi_span "class=sp splcs splc12" "Mail Servers"] # class=wap id=Page10 "onClick=return settingsPage(this);"]
+ }
+ cgi_division class=bld {
+ cgi_put [cgi_url [cgi_span "class=sp splcs splc12" "Directory Servers"] # class=wap id=Page9 "onClick=return settingsPage(this);"]
+ }
+ }
+ if {[info exists _wp(filter_link)] || [info exists _wp(vacation_link)]} {
+ cgi_division class="ftitle bld" "style=\"margin-top: 2em;\"" {
+ cgi_put "External Settings"
+ }
+ }
+ if {[info exists _wp(filter_link)]} {
+ cgi_division class=bld {
+ cgi_put [cgi_url [cgi_span "class=sp splcs splc12" "Message Filtering"] $_wp(filter_link) class=wap target=_blank]
+ }
+ }
+ if {[info exists _wp(vacation_link)]} {
+ cgi_division class=bld {
+ cgi_put [cgi_url [cgi_span "class=sp splcs splc12" "Vacation Auto-Reply"] $_wp(vacation_link) class=wap target=_blank]
+ }
+ }
+ }} "$c" "$f" 0 Settings \
+ [list [cgi_cgi "$_wp(appdir)/$_wp(ui2dir)/browse/${c}/${f}"] Settings 0 searchContent('settings','alpineContent')] "" {
+ # CONTEXT COMMANDS
+ cgi_division class=hdrBtns {
+ cgi_javascript {
+ cgi_put "if(window.print) document.write('[cgi_buffer {cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi1" ""][cgi_span "class=hdrBtnText" Print]" "print" "onClick=return printContent()"]}]');"
+ }
+
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi3" ""][cgi_span "class=hdrBtnText" Help]" "javascript:openHelpWindow('settings.html');" class=wap]
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi4" ""][cgi_span "class=hdrBtnText" "Sign out"]" "../../session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=${sessid}"]
+ }
+ } {
+ # TOP MENUBAR
+ cgi_anchor_name "toolbar"
+ cgi_table class="toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data {
+ cgi_table class="toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_table_row {
+ cgi_table_data class="wap" {
+ cgi_put [cgi_url [cgi_span "class=sp spmbi spmb10" "Save Settings"] "#" title="Save Settings Changes" "onClick=return saveSettings();"]
+ }
+ cgi_table_data class="wap" {
+ cgi_put [cgi_url [cgi_span "class=sp spmbi spmb21" "Reset to Default Settings"] "#" "onClick=panelConfirm('Restoring default settings will erase all custom settings.<p>Are you sure you want to restore default settings?',{text:'Restore Defaults',fn:restoreDefaultSettings}); return false;" title="Reset to Default Settings"]
+ }
+ cgi_table_data class="wap" {
+ cgi_put [cgi_url [cgi_span "class=sp spmbi spmb12" "Cancel"] "browse/$c/$f" title="Cancel Settings Changes"]
+ }
+ cgi_table_data width="100%" {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ } {
+ cgi_form $_wp(appdir)/$_wp(ui2dir)/conduit/settings.tcl "enctype=multipart/form-data" id=settingsForm target=formResponse {
+ cgi_text "restore=false" id=restore type=hidden notab
+ cgi_table id=settingsPage1 "class=\"fields settings\"" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_puts "<tr><td class=title colspan=2><h2>General Preferences</h2></td></tr>"
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_puts "Message Display"
+ #[cgi_br]<a href="#" title="more info..." onClick="help_popup1.showPopup('anchor1');return false;" name="anchor1" id="anchor1"><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ if {[info exists _wp(themes)]} {
+ cgi_put "Theme: "
+ cgi_select theme {
+ foreach theme $_wp(themes) {
+ cgi_option [lindex $theme 0] value=[lindex $theme 1]
+ }
+ }
+ cgi_br
+ }
+ cgi_put "Display "
+ set n [var_value wp-indexlines]
+ cgi_select wp-indexlines {
+ for {set i 10} {$i <= $_wp(indexlinesmax)} {incr i 5} {
+ cgi_option $i value=$i [set_checked [expr {$i == $n}] selected]
+ }
+ }
+ cgi_put " messages per page"
+ cgi_br
+ cgi_put "Wrap Plain Text message at "
+ set n [WPCmd PEConfig columns]
+ cgi_select wrapColumn {
+ for {set i 20} {$i < 130} {incr i 4} {
+ cgi_option $i value=$i [set_checked [expr {$i == $n}] selected]
+ }
+ }
+ cgi_put " characters"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Folders"
+ #[cgi_br]<a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ cgi_put "Display "
+ if {[catch {WPSessionState left_column_folders} n]} {
+ set n $_wp(fldr_cache_def)
+ }
+
+ cgi_select folderCache {
+ for {set i 5} {$i <= $_wp(fldr_cache_max)} {incr i} {
+ cgi_option $i value=$i [set_checked [expr {$i == $n}] selected]
+ }
+ }
+ cgi_put " recent folders in left column"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Reply[cgi_nbspace]Options"
+ #[cgi_br]<a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ set_feature include-header-in-reply "Include headers in replies"
+ cgi_br
+ set_feature include-attachments-in-reply "Include attachments in replies"
+ cgi_br
+ set_feature signature-at-bottom "Append signature below reply text"
+ cgi_br
+ set_feature strip-from-sigdashes-on-reply "Strip signatures when replying"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Forwarding[cgi_nbspace]Options"
+ #[cgi_br]<a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ set as_attach [WPCmd PEInfo feature forward-as-attachment]
+ cgi_radio_button forwardAs=inline id="forward_inline" [set_checked [expr {$as_attach == 0}]]
+ cgi_put " <label for=forward_inline>Forward messsages inline</label>"
+ cgi_br
+ cgi_radio_button forwardAs=attached id="forward_attachment" [set_checked $as_attach]
+ cgi_put " <label for=forward_attachment>Forward messsages as attachments</label>"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Sent[cgi_nbspace]Message[cgi_nbspace]Options"
+ cgi_put "<p><span class=tips><strong>Tip:</strong> Set folder blank to prevent saving of Sent messages</span>"
+ #[cgi_br]<a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+
+ }
+ cgi_table_data class="body" {
+ set_variable default-fcc "Name of your Sent mail folder (also called \"Fcc\"): "
+ cgi_br
+ set_feature fcc-without-attachments "Save sent messages to Sent folder without attachments"
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ cgi_table id=settingsPage2 "class=\"fields settings\"" "style=\"display: none;\"" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_puts "<tr><td class=title colspan=2><h2>Personal[cgi_nbspace]Information</h2></td></tr>"
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Display[cgi_nbspace]Name"
+ #<br><a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ set_variable personal-name
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "User[cgi_nbspace]Domain"
+ #<br><a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ set_variable user-domain
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Email[cgi_nbspace]Signature"
+ #<br><a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ #<input name="signature" id="no_sig" type="radio" checked />
+ #<label for="no_sig">No Signature</label><br>
+ #<input name="signature" id="use_sig" type="radio" />
+ #<label for="use_sig">Append Signature when composing messages</label><br>
+ cgi_textarea signature=[join [WPCmd PEInfo rawsig] "\n"] cols="72" rows="5" title=Signature
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Alternate[cgi_nbspace]Addresses"
+ cgi_put "<p><span class=tips><b>Tip:</b> List alternate email addresses "
+ cgi_put "you use. Reply All will not include"
+ cgi_put "these email addresses when replying.</span>"
+ #<br><a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ cgi_put "Add/Remove Addresses: <input type=button name=addCH value=Add onClick=\"return listAdd('altAddrTable','altAddr');\"/>"
+ set varval [WPCmd PEConfig varget alt-addresses]
+ cgi_text "altAddrs=[llength [lindex $varval 0]]" id=altAddrs type=hidden notab
+ cgi_table id=altAddrTable {
+ set n 0
+ foreach svr [lindex $varval 0] {
+ incr n
+ cgi_table_row {
+ cgi_table_data {
+ cgi_text altAddr${n}=[string trim $svr] size="45"
+ cgi_put [cgi_url [cgi_img img/cbn/remove.gif class=wap] # "onClick=return removeTableRow(this);"]
+ }
+ }
+ }
+ }
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ cgi_table id=settingsPage3 "class=\"fields settings\"" "style=\"display: none;\"" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_puts "<tr><td class=title colspan=2><h2>News[cgi_nbspace]and[cgi_nbspace]Weather</h2></td></tr>"
+
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Headline[cgi_nbspace]News"
+ #<br><a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ cgi_put "RSS URL: "
+ cgi_text rss-news=[var_value rss-news] size="45"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Weather[cgi_nbspace]Bar"
+ #<br><a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ cgi_put "RSS URL: "
+ cgi_text rss-weather=[var_value rss-weather] size="45"
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ cgi_table id=settingsPage4 "class=\"fields settings\"" "style=\"display: none;\"" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_puts "<tr><td class=title colspan=2><h2>Message[cgi_nbspace]List</h2></td></tr>"
+
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Message List"
+ }
+ cgi_table_data class="body" {
+ cgi_table {
+ cgi_put "<tbody>"
+ cgi_table_row {
+ cgi_table_data {
+ cgi_put "Sort Order (default): "
+ }
+ cgi_table_data {
+ set val [WPCmd PEConfig varget sort-key]
+ cgi_select sort-key {
+ foreach k [lindex $val 2] {
+ cgi_option $k value=$k [set_checked [expr {0 == [string compare -nocase $k [lindex $val 0]]}] selected]
+ }
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data {
+ cgi_put "Start display at:"
+ }
+ cgi_table_data {
+ set val [WPCmd PEConfig varget incoming-startup-rule]
+ cgi_select incoming-startup-rule {
+ foreach k [lindex $val 2] {
+ cgi_option $k value=$k [set_checked [expr {0 == [string compare -nocase $k [lindex $val 0]]}] selected]
+ }
+ }
+ }
+ }
+ cgi_put "</tbody>"
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Message[cgi_nbspace]Handling"
+ }
+ cgi_table_data class="body" {
+ set_variable read-message-folder "Name of the folder to hold your read messages: "
+ cgi_br
+ set_feature auto-move-read-msgs "Automatically Move Read Messages"
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ cgi_table id=settingsPage5 "class=\"fields settings\"" "style=\"display: none;\"" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_puts "<tr><td class=title colspan=2><h2>Message View</h2></td></tr>"
+
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Display[cgi_nbspace]Headers"
+ }
+ cgi_table_data class="body" {
+ cgi_put "Add/Remove Header Names: <input type=button name=addCH value=Add onClick=\"return listAdd('viewerHdrsTable','viewerHdr');\"/>"
+ set varval [WPCmd PEConfig varget viewer-hdrs]
+ cgi_text "viewerHdrs=[llength [lindex $varval 0]]" id=viewerHdrs type=hidden notab
+ cgi_table id=viewerHdrsTable {
+ set n 0
+ foreach svr [lindex $varval 0] {
+ incr n
+ cgi_table_row {
+ cgi_table_data {
+ cgi_text viewerHdr${n}=[string trim $svr] size="45"
+ cgi_put [cgi_url [cgi_img img/cbn/remove.gif class=wap] # "onClick=return removeTableRow(this);"]
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Display[cgi_nbspace]Links[cgi_nbspace]in[cgi_nbspace]Messages"
+ cgi_put "<p><span class=tips><b>Tip:</b> Applies only to plain text messages.</span>"
+ #<br><a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ cgi_table {
+ cgi_put "<tbody>"
+ cgi_table_row {
+ cgi_table_data {
+ set_feature enable-msg-view-urls "Display complete URLs as links"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data {
+ set_feature enable-msg-view-web-hostnames "Display hostnames and incomplete URLs as links"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data {
+ set_feature enable-msg-view-addresses "Display Email addresses as links"
+ }
+ }
+ cgi_put "</tbody>"
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Rich[cgi_nbspace]Text[cgi_nbspace]Display"
+ #<br><a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ set_feature render-html-internally "Show rich text messages as plain text"
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Anti-phishing"
+ cgi_put "<p><span class=tips><b>Tip:</b> This feature aids in identifying fake links. Applies only when rich text shown as plain text.</span>"
+ #<br><a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ set_feature quell-server-after-link-in-html "Hide appended real hostname after links"
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ cgi_table id=settingsPage6 "class=\"fields settings\"" "style=\"display: none;\"" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_puts "<tr><td class=title colspan=2><h2>Compose</h2></td></tr>"
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Compose[cgi_nbspace]Headers"
+ cgi_put "<p><span class=tips><b>Tip:</b> Default header fields displayed in Compose</span>"
+ }
+ cgi_table_data class="body" {
+ cgi_put "Add/Remove Header Names: <input type=button name=addCH value=Add onClick=\"return listAdd('composeHdrsTable','composeHdr');\"/>"
+ set varval [WPCmd PEConfig varget default-composer-hdrs]
+ cgi_text "composeHdrs=[llength [lindex $varval 0]]" id=composeHdrs type=hidden notab
+ cgi_table id=composeHdrsTable {
+ set n 0
+ foreach svr [lindex $varval 0] {
+ incr n
+ cgi_table_row {
+ cgi_table_data {
+ cgi_text composeHdr${n}=[string trim $svr] size="45"
+ cgi_put [cgi_url [cgi_img img/cbn/remove.gif class=wap] # "onClick=return removeTableRow(this);"]
+ }
+ }
+ }
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Custom[cgi_nbspace]Headers"
+ }
+ cgi_table_data class="body" {
+ cgi_put "Add/Remove Headers: <input type=button name=addhdr value=Add onClick=\"return customHdrAdd('customHdrTbl');\"/>"
+ set varval [WPCmd PEConfig varget customized-hdrs]
+ cgi_text "customHdrFields=[llength [lindex $varval 0]]" id=customHdrFields type=hidden notab
+ cgi_table id=customHdrTbl {
+ set nh 0
+ foreach hdr [lindex $varval 0] {
+ incr nh
+ cgi_table_row {
+ set n [string first {:} $hdr]
+ switch -- $n {
+ -1 -
+ 0 -
+ 1 {
+ cgi_table_data colspan=2 {
+ cgi_text "customHdrField${nh}=[cgi_quote_html $hdr]" type=hidden notab
+ cgi_put "$hdr"
+ }
+ }
+ default {
+ cgi_table_data {
+ set field_name [string range $hdr 0 [expr {$n - 1}]]
+ cgi_put $field_name
+ cgi_text "customHdrField${nh}=[cgi_quote_html $field_name]" type=hidden notab
+ }
+ cgi_table_data {
+ cgi_text customHdrData${nh}=[string trim [string range $hdr [incr n] end]] size="45"
+ cgi_put [cgi_url [cgi_img img/cbn/remove.gif class=wap] # "onClick=return removeTableRow(this);"]
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Message[cgi_nbspace]Encoding"
+ #[cgi_br]<a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ set_variable posting-character-set "Send messages using character encoding: "
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Reply[cgi_nbspace]Options"
+ #[cgi_br]<a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ set_variable reply-leadin "Reply intro string: "
+ cgi_br
+ set_variable reply-indent-string "Reply prefix: "
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Flowed[cgi_nbspace]Text[cgi_nbspace]Handling"
+ #[cgi_br]<a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ set_feature quell-flowed-text "Do not send text as Flowed Text"
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ cgi_table id=settingsPage7 "class=\"fields settings\"" "style=\"display: none;\"" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_puts "<tr><td class=title colspan=2><h2>Filters</h2></td></tr>"
+
+ cgi_puts "</tbody>"
+ }
+ cgi_table id=settingsPage8 "class=\"fields settings\"" "style=\"display: none;\"" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_puts "<tr><td class=title colspan=2><h2>Folders</h2></td></tr>"
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Draft[cgi_nbspace]Folder"
+ #[cgi_br]<a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ set_variable postponed-folder
+ }
+ }
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Trash[cgi_nbspace]Folder"
+ #[cgi_br]<a href="#" title="more info..."><img src="img/cbn/help_sm.gif"></a>
+ }
+ cgi_table_data class="body" {
+ set_variable trash-folder
+ }
+ }
+ cgi_puts "</tbody>"
+ }
+ if {0 == [catch {WPCmd PEConfig varget ldap-servers} varval]} {
+ cgi_table id=settingsPage9 "class=\"fields settings\"" "style=\"display: none;\"" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_puts "<tr><td class=title colspan=2><h2>Directory[cgi_nbspace]Servers</h2></td></tr>"
+
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "LDAP[cgi_nbspace]Server"
+ }
+ cgi_table_data class="body" {
+ cgi_put "Add/Remove Servers: <input type=button name=addldap value=Add onClick=\"return listAdd('ldapServerTable','ldapServer');\"/>"
+ cgi_text "ldapServers=[llength [lindex $varval 0]]" id=ldapServers type=hidden notab
+ cgi_table id=ldapServerTable {
+ set n 0
+ foreach svr [lindex $varval 0] {
+ incr n
+ cgi_table_row {
+ cgi_table_data {
+ cgi_text ldapServer${n}=[string trim $svr] size="45"
+ cgi_put [cgi_url [cgi_img img/cbn/remove.gif class=wap] # "onClick=return removeTableRow(this);"]
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_puts "</tbody>"
+ }
+ }
+ cgi_table id=settingsPage10 "class=\"fields settings\"" "style=\"display: none;\"" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody>"
+ cgi_puts "<tr><td class=title colspan=2><h2>Mail[cgi_nbspace]Servers</h2></td></tr>"
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "Inbox[cgi_nbspace]Server"
+ cgi_put "<p><span class=tips><b>Tip:</b> Server name inside brackets, folder name after</span>"
+ }
+ cgi_table_data class="body" {
+ cgi_text inbox-path=[var_value inbox-path] size="45"
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data class="title" {
+ cgi_put "SMTP[cgi_nbspace]Server"
+ }
+ cgi_table_data class="body" {
+ cgi_put "Add/Remove Servers: <input type=button name=addsmtp value=Add onClick=\"return listAdd('smtpServerTable','smtpServer');\"/>"
+ set varval [WPCmd PEConfig varget smtp-server]
+ cgi_text "smtpServers=[llength [lindex $varval 0]]" id=smtpServers type=hidden notab
+ cgi_table id=smtpServerTable {
+ set n 0
+ foreach svr [lindex $varval 0] {
+ incr n
+ cgi_table_row {
+ cgi_table_data {
+ cgi_text smtpServer${n}=[string trim $svr] size="45"
+ cgi_put [cgi_url [cgi_img img/cbn/remove.gif class=wap] # "onClick=return removeTableRow(this);"]
+ }
+ }
+ }
+ }
+ }
+ }
+
+ cgi_puts "</tbody>"
+ }
+ }
+ } {
+ # BOTTOM MENUBAR
+ cgi_table class="wap toolbarTbl" cellpadding="0" cellspacing="0" {
+ cgi_puts "<tbody><tr><td>&nbsp;</td></tr></tbody>"
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/2.0/tclsh b/web/cgi/alpine/2.0/tclsh
new file mode 120000
index 00000000..385fc6c6
--- /dev/null
+++ b/web/cgi/alpine/2.0/tclsh
@@ -0,0 +1 @@
+../tclsh \ No newline at end of file
diff --git a/web/cgi/alpine/2.0/view b/web/cgi/alpine/2.0/view
new file mode 100755
index 00000000..0466c2e2
--- /dev/null
+++ b/web/cgi/alpine/2.0/view
@@ -0,0 +1,237 @@
+#!./tclsh
+# $Id: view 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# view.tcl
+#
+# Purpose: CGI script generating page to display text of requested
+# message
+#
+# Input: PATH_INFO: [/<col_number>]/<folder_name>[/<uid_of_viewed_msg>
+# along with possible search parameters:
+set view_args {
+ {delete {} 0}
+ {spam {} 0}
+ {unread {} 0}
+ {star {} {}}
+ {showimg {} {}}
+ {hideimg {} {}}
+ {searchText {} {}}
+}
+
+
+# On input failure, redirect to home page "browse"
+proc view_redirect {} {
+ global _wp
+
+ cgi_http_head {
+ cgi_redirect "[cgi_root]/$_wp(appdir)/$_wp(ui2dir)/browse"
+ }
+}
+
+# inherit global config
+source ./alpine.tcl
+source ./common.tcl
+source ./foldercache.tcl
+source ./messageview.tcl
+
+# TEST
+proc cgi_suffix {args} {
+ return ""
+}
+
+# for inserting debug comments at end of page
+set dmsgs ""
+proc dm {s} {
+ global dmsgs
+ lappend dmsgs $s
+}
+
+
+WPEval $view_args {
+ # grok PATH_INFO for collection 'c' and folder 'f'
+ if {[info exists env(PATH_INFO)] && [string length $env(PATH_INFO)]} {
+ if {0 == [regexp {^/([0-9]+)/(.*)/([0-9]+)$} $env(PATH_INFO) dummy c f u]} {
+ WPCmd PEInfo statmsg "Cannot open invalid path: $env(PATH_INFO)"
+ error [list _redirect "[cgi_root]/$_wp(appdir)/$_wp(ui2dir)/browse/0/INBOX"]
+ }
+ } else {
+ WPCmd PEInfo statmsg "Cannot view unspecified folder"
+ error [list _redirect "[cgi_root]/$_wp(appdir)/$_wp(ui2dir)/browse/0/INBOX"]
+ }
+
+ # verify or visit specified collection/folder
+ if {[catch {setCurrentFolder c f u} result]} {
+ set authlist [wpHandleAuthException $result [list $c "folders in collection"] $f]
+ if {0 == [llength $authlist]} {
+ WPCmd PEInfo statmsg "$result"
+ error [list _redirect "$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)/browse/$c/$f"]
+ }
+ }
+
+ # load message drawing routine for this session
+ # save per-message source, proc overhead
+ # to reinstall on the fly:
+ #catch {WPCmd rename drawMessageText {}}
+ if {0 == [llength [WPCmd info commands drawMessageText]]} {
+ set cgidir [file join $_wp(cgipath) $_wp(appdir) $_wp(ui2dir)]
+ if {[catch {
+ WPCmd source "${cgidir}/messageview.tcl"
+ WPCmd source "${cgidir}/messagelist.tcl"
+ } result]} {
+ error [list _action browse "cannot load message viewer: $result"]
+ }
+ }
+
+ # process any actions specified by view_args
+ if {$delete > 0} {
+ if {0 == [catch [WPCmd PEMessage $delete number] dnum]} {
+
+ }
+ # ELSE already deleted, don't worry about it
+ } elseif {$spam > 0} {
+ if {0 == [catch [WPCmd PEMessage $spam number] snum]} {
+
+ }
+ # ELSE already reported, don't worry about it
+ } elseif {$unread > 0} {
+ if {[catch {WPCmd PEMessage $unread flag new 1} result]} {
+ # ERROR: Cannot set $u unread
+ }
+ } elseif {[string length $star]} {
+ switch -- $star {
+ 0 {
+ if {[catch {WPCmd PEMessage $u flag important 0} result]} {
+ # ERROR: Cannot set Star on message $u
+ }
+ }
+ 1 {
+ if {[catch {WPCmd PEMessage $u flag important 1} result]} {
+ # ERROR: Cannot set Star on message $u
+ }
+ }
+ default {}
+ }
+ }
+
+ if {[catch {WPCmd PEMessage $u charset} charset]
+ || [string length $charset] == 0
+ || [string compare us-ascii [string tolower $charset]] == 0} {
+ set charset "ISO-8859-1"
+ }
+
+ if {[catch {WPCmd PEMessage $u number} n]} {
+ WPCmd PEInfo statmsg "$n"
+ error [list _redirect "$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)/browse/$c/$f"]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs "text/html; charset=$charset"
+ }
+
+ # counts and so forth
+ set mc [WPCmd PEMailbox messagecount]
+
+ set unext [WPCmd PEMailbox uid [WPCmd PEMailbox next $n 1]]
+ set delim [WPCmd PEFolder delimiter $c]
+
+
+ cgi_html {
+ cgi_head {
+ cgi_content_type "text/html; charset=$charset"
+ cgi_title [wpPageTitle "Message $n of $mc in $f"]
+ cgi_base "href=$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)/"
+ cgi_stylesheet css/menu.css
+ cgi_stylesheet css/cbn/screen.css
+ cgi_stylesheet css/cbn/folderdialog.css
+ cgi_stylesheet $_wp(yui)/build/container/assets/container-core.css
+ cgi_stylesheet $_wp(yui)/build/menu/assets/skins/sam/menu.css
+ cgi_stylesheet $_wp(yui)/build/button/assets/skins/sam/button.css
+ # Yahoo UI libraries
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/utilities/utilities.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/container/container-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/datasource/datasource-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/menu/menu-min.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="$_wp(yui)/build/button/button-min.js" {}
+ # local libraries
+ cgi_script type=text/javascript language="JavaScript" src="lib/common.js" {}
+ cgi_script type=text/javascript language="JavaScript" src="lib/mailbox.js" {}
+ # page specfic JS
+ cgi_javascript {
+ cgi_puts "YAHOO.alpine.cgi_root = '$_wp(serverpath)';"
+ cgi_puts "YAHOO.alpine.app_root = '$_wp(serverpath)/$_wp(appdir)/$_wp(ui2dir)';"
+ cgi_puts "YAHOO.alpine.current.c = $c;"
+ cgi_puts "YAHOO.alpine.current.f = \"$f\";"
+ cgi_puts "YAHOO.alpine.current.u = $u;"
+ cgi_puts "YAHOO.alpine.current.count = $mc;"
+ cgi_puts "YAHOO.alpine.current.selected = [WPCmd PEMailbox selected];"
+ cgi_puts "YAHOO.alpine.current.searched = [WPCmd PEMailbox searched];"
+ cgi_puts "YAHOO.alpine.current.focused = [WPCmd PEMailbox focus];"
+ cgi_puts "function bodyOnLoad() {"
+ cgi_puts " initMenus();"
+ cgi_puts " initMorcButton('viewMorcButton');"
+ cgi_puts " if(YAHOO.env.ua.gecko > 0){ sizeVPHeight(); window.onresize = resizeVPHeight; }"
+ cgi_puts " setCheckMailFunction('gCheck', newMailCheck);"
+ cgi_puts " setNewMailCheckInterval([WPCmd PEInfo inputtimeout]);"
+ wpStatusAndNewmailJavascript
+ wpSaveMenuJavascript "view" $c $f [WPCmd PEFolder defaultcollection] morcInViewDone
+ cgi_puts "}"
+
+ cgi_puts "browserDetect();"
+ }
+ }
+
+ cgi_body class=wap "onLoad=bodyOnLoad()" {
+ cgi_division id="skip" {
+ cgi_put [cgi_url "Skip to Next Message" "#" "onClick=return newMessageText({control:this,parms:{op:'next'}});"]
+ cgi_put [cgi_url "Skip to Message List" "browse"]
+ cgi_put [cgi_url "Skip to Folders" "folders"]
+ cgi_put [cgi_url "Skip to Compose" "compose"]
+ }
+
+ wpCommonPageLayout view $c $f $u [cgi_url "[cgi_quote_html $f], Message $n of $mc" browse/$c/[WPPercentQuote $f $delim] id=gBigContext] [list [cgi_cgi "$_wp(appdir)/$_wp(ui2dir)/browse/${c}/${f}?u=${u}"] "$f" 1 mailboxSearch()] {} {
+ # CONTEXT COMMANDS
+ cgi_division class=hdrBtns {
+ cgi_javascript {
+ cgi_put "if(window.print) document.write('[cgi_buffer {cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi1" ""][cgi_span "class=hdrBtnText" Print]" "print" "onClick=return printContent()"]}]');"
+ }
+
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi2" ""][cgi_span "class=hdrBtnText" Settings]" "settings"]
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi3" ""][cgi_span "class=hdrBtnText" Help]" # "onClick=return openMailboxHelp();" class=wap]
+ cgi_put [cgi_url "[cgi_span "class=sp hdrBtnImg hbi4" ""][cgi_span "class=hdrBtnText" "Sign out"]" "../../session/logout.tcl?cid=[WPCmd PEInfo key]&sessid=${sessid}"]
+ }
+ } {
+ cgi_division id=listTopMenubar "style=\"display: none;\"" {
+ cgi_puts [WPCmd cgi_buffer "drawTopListMenuBar $c {$f}"]
+ }
+ cgi_division id=viewTopMenubar {
+ cgi_puts [WPCmd cgi_buffer "drawTopViewMenuBar $c {$f} $u $n"]
+ }
+ } {
+ cgi_puts [WPCmd cgi_buffer "drawMessageText $c {$f} $u $showimg"]
+ } {
+ cgi_division id=listBottomMenubar "style=\"display: none;\"" {
+ cgi_puts [WPCmd cgi_buffer "drawBottomListMenuBar $c {$f} 0 0 $mc"]
+ }
+ cgi_division id=viewBottomMenubar {
+ cgi_puts [WPCmd cgi_buffer "drawBottomViewMenuBar $c {$f} $u $n $mc"]
+ }
+ }
+
+ # any debugging info to insert?
+ foreach dmsg $dmsgs {
+ cgi_html_comment "DEBUG: $dmsg"
+ cgi_puts ""
+ }
+ }
+ }
+}
diff --git a/web/cgi/alpine/alpine.tcl b/web/cgi/alpine/alpine.tcl
new file mode 120000
index 00000000..5ad8d42f
--- /dev/null
+++ b/web/cgi/alpine/alpine.tcl
@@ -0,0 +1 @@
+../alpine.tcl \ No newline at end of file
diff --git a/web/cgi/alpine/farewell.tcl b/web/cgi/alpine/farewell.tcl
new file mode 100755
index 00000000..e9157bde
--- /dev/null
+++ b/web/cgi/alpine/farewell.tcl
@@ -0,0 +1,40 @@
+#!./tclsh
+# $Id: farewell.tcl 764 2007-10-23 23:44:49Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+
+# Input:
+set fw_vars {
+ {serverid {} 0}
+ {verdir {} "/"}
+}
+
+# Output:
+#
+
+# global config
+source ./alpine.tcl
+
+WPEval $fw_vars {
+ if {[catch {cgi_import logerr}] == 0} {
+ set parms "?logerr=$logerr"
+ } else {
+ set parms ""
+ }
+
+ cgi_http_head {
+ # clear cookies
+ cgi_cookie_set sessid=0 expires=now path=[file join / $verdir]
+
+ cgi_redirect $_wp(serverpath)/session/logout/logout.tcl${parms}
+ }
+}
diff --git a/web/cgi/alpine/tclsh b/web/cgi/alpine/tclsh
new file mode 120000
index 00000000..385fc6c6
--- /dev/null
+++ b/web/cgi/alpine/tclsh
@@ -0,0 +1 @@
+../tclsh \ No newline at end of file
diff --git a/web/cgi/alpine/whackatch.tcl b/web/cgi/alpine/whackatch.tcl
new file mode 100755
index 00000000..cca94724
--- /dev/null
+++ b/web/cgi/alpine/whackatch.tcl
@@ -0,0 +1,46 @@
+#!./tclsh
+# $Id: whackatch.tcl 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# whackatch.tcl
+#
+# Purpose: CGI script to cleanup requested attachment
+
+# Input:
+# ext - attachment file extension
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+
+# seconds to pause before rechecking for abandanded attachment files
+set abandoned 300
+
+# no dots allowed
+if {[gets stdin ext] >= 0 && [regexp {^[A-Za-z0-9\-]+$} $ext ext] == 1} {
+
+ set towhack [file join $_wp(fileroot) $_wp(detachpath) detach.${ext}]
+
+ while {1} {
+ set timein [clock seconds]
+
+ after [expr {$abandoned * 1000}]
+
+ if {[catch {file atime $towhack} atime] || ($timein - $atime) > $abandoned} {
+ break
+ }
+ }
+
+ catch {exec /bin/rm -f $towhack}
+}
diff --git a/web/cgi/detach b/web/cgi/detach
new file mode 120000
index 00000000..d1373a3e
--- /dev/null
+++ b/web/cgi/detach
@@ -0,0 +1 @@
+/tmp/webpine \ No newline at end of file
diff --git a/web/cgi/favicon.ico b/web/cgi/favicon.ico
new file mode 100755
index 00000000..2ed8ef56
--- /dev/null
+++ b/web/cgi/favicon.ico
Binary files differ
diff --git a/web/cgi/greeting.tcl b/web/cgi/greeting.tcl
new file mode 100755
index 00000000..c24a65a5
--- /dev/null
+++ b/web/cgi/greeting.tcl
@@ -0,0 +1,21 @@
+#!./tclsh
+
+# ========================================================================
+# Copyright 2006-2007 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+source ./alpine.tcl
+
+cgi_eval {
+
+ cgi_http_head {
+ cgi_redirect [cgi_root]/session/greeting.tcl
+ }
+}
diff --git a/web/cgi/images/Lavender_Chiffon.gif b/web/cgi/images/Lavender_Chiffon.gif
new file mode 100644
index 00000000..19e4d468
--- /dev/null
+++ b/web/cgi/images/Lavender_Chiffon.gif
Binary files differ
diff --git a/web/cgi/images/b_minus.gif b/web/cgi/images/b_minus.gif
new file mode 100644
index 00000000..7b54f750
--- /dev/null
+++ b/web/cgi/images/b_minus.gif
Binary files differ
diff --git a/web/cgi/images/b_plus.gif b/web/cgi/images/b_plus.gif
new file mode 100644
index 00000000..f39a3c01
--- /dev/null
+++ b/web/cgi/images/b_plus.gif
Binary files differ
diff --git a/web/cgi/images/barblank.gif b/web/cgi/images/barblank.gif
new file mode 100644
index 00000000..d98b7b2e
--- /dev/null
+++ b/web/cgi/images/barblank.gif
Binary files differ
diff --git a/web/cgi/images/barclose.gif b/web/cgi/images/barclose.gif
new file mode 100644
index 00000000..f1616283
--- /dev/null
+++ b/web/cgi/images/barclose.gif
Binary files differ
diff --git a/web/cgi/images/barclose_mid.gif b/web/cgi/images/barclose_mid.gif
new file mode 100644
index 00000000..41981b68
--- /dev/null
+++ b/web/cgi/images/barclose_mid.gif
Binary files differ
diff --git a/web/cgi/images/barmsg.gif b/web/cgi/images/barmsg.gif
new file mode 100644
index 00000000..b5d17e1f
--- /dev/null
+++ b/web/cgi/images/barmsg.gif
Binary files differ
diff --git a/web/cgi/images/baropen.gif b/web/cgi/images/baropen.gif
new file mode 100644
index 00000000..49cb3a9b
--- /dev/null
+++ b/web/cgi/images/baropen.gif
Binary files differ
diff --git a/web/cgi/images/baropen_mid.gif b/web/cgi/images/baropen_mid.gif
new file mode 100644
index 00000000..5c02ec12
--- /dev/null
+++ b/web/cgi/images/baropen_mid.gif
Binary files differ
diff --git a/web/cgi/images/barvert.gif b/web/cgi/images/barvert.gif
new file mode 100644
index 00000000..1eed6694
--- /dev/null
+++ b/web/cgi/images/barvert.gif
Binary files differ
diff --git a/web/cgi/images/barvertmsg.gif b/web/cgi/images/barvertmsg.gif
new file mode 100644
index 00000000..243b38b6
--- /dev/null
+++ b/web/cgi/images/barvertmsg.gif
Binary files differ
diff --git a/web/cgi/images/bg_index.gif b/web/cgi/images/bg_index.gif
new file mode 100644
index 00000000..5d0dfeab
--- /dev/null
+++ b/web/cgi/images/bg_index.gif
Binary files differ
diff --git a/web/cgi/images/blackdot.gif b/web/cgi/images/blackdot.gif
new file mode 100644
index 00000000..9e25328f
--- /dev/null
+++ b/web/cgi/images/blackdot.gif
Binary files differ
diff --git a/web/cgi/images/book.gif b/web/cgi/images/book.gif
new file mode 100644
index 00000000..70ce6d5c
--- /dev/null
+++ b/web/cgi/images/book.gif
Binary files differ
diff --git a/web/cgi/images/but_abook.gif b/web/cgi/images/but_abook.gif
new file mode 100644
index 00000000..5155f338
--- /dev/null
+++ b/web/cgi/images/but_abook.gif
Binary files differ
diff --git a/web/cgi/images/but_cancel.gif b/web/cgi/images/but_cancel.gif
new file mode 100644
index 00000000..6a4f7806
--- /dev/null
+++ b/web/cgi/images/but_cancel.gif
Binary files differ
diff --git a/web/cgi/images/but_create.gif b/web/cgi/images/but_create.gif
new file mode 100644
index 00000000..4bea057b
--- /dev/null
+++ b/web/cgi/images/but_create.gif
Binary files differ
diff --git a/web/cgi/images/but_folddel.gif b/web/cgi/images/but_folddel.gif
new file mode 100644
index 00000000..c44e23e7
--- /dev/null
+++ b/web/cgi/images/but_folddel.gif
Binary files differ
diff --git a/web/cgi/images/but_foldexp.gif b/web/cgi/images/but_foldexp.gif
new file mode 100644
index 00000000..64e8842c
--- /dev/null
+++ b/web/cgi/images/but_foldexp.gif
Binary files differ
diff --git a/web/cgi/images/but_foldren.gif b/web/cgi/images/but_foldren.gif
new file mode 100644
index 00000000..5374e9a2
--- /dev/null
+++ b/web/cgi/images/but_foldren.gif
Binary files differ
diff --git a/web/cgi/images/but_remove.gif b/web/cgi/images/but_remove.gif
new file mode 100644
index 00000000..d08ac475
--- /dev/null
+++ b/web/cgi/images/but_remove.gif
Binary files differ
diff --git a/web/cgi/images/but_resume.gif b/web/cgi/images/but_resume.gif
new file mode 100644
index 00000000..8b7df00c
--- /dev/null
+++ b/web/cgi/images/but_resume.gif
Binary files differ
diff --git a/web/cgi/images/but_rnd_block.gif b/web/cgi/images/but_rnd_block.gif
new file mode 100644
index 00000000..dae0aa9f
--- /dev/null
+++ b/web/cgi/images/but_rnd_block.gif
Binary files differ
diff --git a/web/cgi/images/but_rnd_first3.gif b/web/cgi/images/but_rnd_first3.gif
new file mode 100644
index 00000000..cf2e8bf6
--- /dev/null
+++ b/web/cgi/images/but_rnd_first3.gif
Binary files differ
diff --git a/web/cgi/images/but_rnd_last3.gif b/web/cgi/images/but_rnd_last3.gif
new file mode 100644
index 00000000..f21a5e14
--- /dev/null
+++ b/web/cgi/images/but_rnd_last3.gif
Binary files differ
diff --git a/web/cgi/images/but_rnd_next3.gif b/web/cgi/images/but_rnd_next3.gif
new file mode 100644
index 00000000..bb303abf
--- /dev/null
+++ b/web/cgi/images/but_rnd_next3.gif
Binary files differ
diff --git a/web/cgi/images/but_rnd_prev3.gif b/web/cgi/images/but_rnd_prev3.gif
new file mode 100644
index 00000000..54c5c5a8
--- /dev/null
+++ b/web/cgi/images/but_rnd_prev3.gif
Binary files differ
diff --git a/web/cgi/images/but_s_do.gif b/web/cgi/images/but_s_do.gif
new file mode 100644
index 00000000..5bfb78d9
--- /dev/null
+++ b/web/cgi/images/but_s_do.gif
Binary files differ
diff --git a/web/cgi/images/but_save.gif b/web/cgi/images/but_save.gif
new file mode 100644
index 00000000..ef80c73a
--- /dev/null
+++ b/web/cgi/images/but_save.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/allmsgs.gif b/web/cgi/images/buttons/silver/allmsgs.gif
new file mode 100644
index 00000000..6a8f6ecb
--- /dev/null
+++ b/web/cgi/images/buttons/silver/allmsgs.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/attach.gif b/web/cgi/images/buttons/silver/attach.gif
new file mode 100644
index 00000000..a99063e7
--- /dev/null
+++ b/web/cgi/images/buttons/silver/attach.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/cancel.gif b/web/cgi/images/buttons/silver/cancel.gif
new file mode 100644
index 00000000..80680cbc
--- /dev/null
+++ b/web/cgi/images/buttons/silver/cancel.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/compose.gif b/web/cgi/images/buttons/silver/compose.gif
new file mode 100644
index 00000000..98795bce
--- /dev/null
+++ b/web/cgi/images/buttons/silver/compose.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/compose8.gif b/web/cgi/images/buttons/silver/compose8.gif
new file mode 100644
index 00000000..99b3e233
--- /dev/null
+++ b/web/cgi/images/buttons/silver/compose8.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/config.gif b/web/cgi/images/buttons/silver/config.gif
new file mode 100644
index 00000000..3f2373fb
--- /dev/null
+++ b/web/cgi/images/buttons/silver/config.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/delete.gif b/web/cgi/images/buttons/silver/delete.gif
new file mode 100644
index 00000000..e7c87799
--- /dev/null
+++ b/web/cgi/images/buttons/silver/delete.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/delete2.gif b/web/cgi/images/buttons/silver/delete2.gif
new file mode 100644
index 00000000..a88a5443
--- /dev/null
+++ b/web/cgi/images/buttons/silver/delete2.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/done.gif b/web/cgi/images/buttons/silver/done.gif
new file mode 100644
index 00000000..fad888f7
--- /dev/null
+++ b/web/cgi/images/buttons/silver/done.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/exit.gif b/web/cgi/images/buttons/silver/exit.gif
new file mode 100644
index 00000000..31f406fb
--- /dev/null
+++ b/web/cgi/images/buttons/silver/exit.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/expunge.gif b/web/cgi/images/buttons/silver/expunge.gif
new file mode 100644
index 00000000..33c52f02
--- /dev/null
+++ b/web/cgi/images/buttons/silver/expunge.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/firstpage.gif b/web/cgi/images/buttons/silver/firstpage.gif
new file mode 100644
index 00000000..775203b0
--- /dev/null
+++ b/web/cgi/images/buttons/silver/firstpage.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/firstpage2.gif b/web/cgi/images/buttons/silver/firstpage2.gif
new file mode 100644
index 00000000..6f8e0b5b
--- /dev/null
+++ b/web/cgi/images/buttons/silver/firstpage2.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/firstpage4.gif b/web/cgi/images/buttons/silver/firstpage4.gif
new file mode 100644
index 00000000..6ea0c89a
--- /dev/null
+++ b/web/cgi/images/buttons/silver/firstpage4.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/folders.gif b/web/cgi/images/buttons/silver/folders.gif
new file mode 100644
index 00000000..abaeaac7
--- /dev/null
+++ b/web/cgi/images/buttons/silver/folders.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/forward.gif b/web/cgi/images/buttons/silver/forward.gif
new file mode 100644
index 00000000..c2196e6b
--- /dev/null
+++ b/web/cgi/images/buttons/silver/forward.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/lastpage.gif b/web/cgi/images/buttons/silver/lastpage.gif
new file mode 100644
index 00000000..23811d8b
--- /dev/null
+++ b/web/cgi/images/buttons/silver/lastpage.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/lastpage2.gif b/web/cgi/images/buttons/silver/lastpage2.gif
new file mode 100644
index 00000000..39d8a733
--- /dev/null
+++ b/web/cgi/images/buttons/silver/lastpage2.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/lastpage4.gif b/web/cgi/images/buttons/silver/lastpage4.gif
new file mode 100644
index 00000000..3f69c059
--- /dev/null
+++ b/web/cgi/images/buttons/silver/lastpage4.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/logout.gif b/web/cgi/images/buttons/silver/logout.gif
new file mode 100644
index 00000000..8a1fb6fd
--- /dev/null
+++ b/web/cgi/images/buttons/silver/logout.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/messages.gif b/web/cgi/images/buttons/silver/messages.gif
new file mode 100644
index 00000000..0e3543f2
--- /dev/null
+++ b/web/cgi/images/buttons/silver/messages.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/nextpage.gif b/web/cgi/images/buttons/silver/nextpage.gif
new file mode 100644
index 00000000..370aafc9
--- /dev/null
+++ b/web/cgi/images/buttons/silver/nextpage.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/nextpage2.gif b/web/cgi/images/buttons/silver/nextpage2.gif
new file mode 100644
index 00000000..971ba494
--- /dev/null
+++ b/web/cgi/images/buttons/silver/nextpage2.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/ok.gif b/web/cgi/images/buttons/silver/ok.gif
new file mode 100644
index 00000000..470db959
--- /dev/null
+++ b/web/cgi/images/buttons/silver/ok.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/prevpage.gif b/web/cgi/images/buttons/silver/prevpage.gif
new file mode 100644
index 00000000..2e312c3c
--- /dev/null
+++ b/web/cgi/images/buttons/silver/prevpage.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/prevpage2.gif b/web/cgi/images/buttons/silver/prevpage2.gif
new file mode 100644
index 00000000..2b8a1116
--- /dev/null
+++ b/web/cgi/images/buttons/silver/prevpage2.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/quit.gif b/web/cgi/images/buttons/silver/quit.gif
new file mode 100644
index 00000000..7add5b38
--- /dev/null
+++ b/web/cgi/images/buttons/silver/quit.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/reply.gif b/web/cgi/images/buttons/silver/reply.gif
new file mode 100644
index 00000000..2b8de31c
--- /dev/null
+++ b/web/cgi/images/buttons/silver/reply.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/replyall.gif b/web/cgi/images/buttons/silver/replyall.gif
new file mode 100644
index 00000000..16a352db
--- /dev/null
+++ b/web/cgi/images/buttons/silver/replyall.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/save.gif b/web/cgi/images/buttons/silver/save.gif
new file mode 100644
index 00000000..b09e5c0d
--- /dev/null
+++ b/web/cgi/images/buttons/silver/save.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/send.gif b/web/cgi/images/buttons/silver/send.gif
new file mode 100644
index 00000000..b4ccfb33
--- /dev/null
+++ b/web/cgi/images/buttons/silver/send.gif
Binary files differ
diff --git a/web/cgi/images/buttons/silver/undelete.gif b/web/cgi/images/buttons/silver/undelete.gif
new file mode 100644
index 00000000..0c585b63
--- /dev/null
+++ b/web/cgi/images/buttons/silver/undelete.gif
Binary files differ
diff --git a/web/cgi/images/caution.gif b/web/cgi/images/caution.gif
new file mode 100644
index 00000000..9d55a384
--- /dev/null
+++ b/web/cgi/images/caution.gif
Binary files differ
diff --git a/web/cgi/images/cf_add.gif b/web/cgi/images/cf_add.gif
new file mode 100644
index 00000000..c3c228a6
--- /dev/null
+++ b/web/cgi/images/cf_add.gif
Binary files differ
diff --git a/web/cgi/images/cf_delete.gif b/web/cgi/images/cf_delete.gif
new file mode 100644
index 00000000..7b3c9a39
--- /dev/null
+++ b/web/cgi/images/cf_delete.gif
Binary files differ
diff --git a/web/cgi/images/cf_edit.gif b/web/cgi/images/cf_edit.gif
new file mode 100644
index 00000000..094c4109
--- /dev/null
+++ b/web/cgi/images/cf_edit.gif
Binary files differ
diff --git a/web/cgi/images/cf_help.gif b/web/cgi/images/cf_help.gif
new file mode 100644
index 00000000..678d6d64
--- /dev/null
+++ b/web/cgi/images/cf_help.gif
Binary files differ
diff --git a/web/cgi/images/cf_shdown.gif b/web/cgi/images/cf_shdown.gif
new file mode 100644
index 00000000..162e93c9
--- /dev/null
+++ b/web/cgi/images/cf_shdown.gif
Binary files differ
diff --git a/web/cgi/images/cf_shup.gif b/web/cgi/images/cf_shup.gif
new file mode 100644
index 00000000..a2acbbd5
--- /dev/null
+++ b/web/cgi/images/cf_shup.gif
Binary files differ
diff --git a/web/cgi/images/decreas4.gif b/web/cgi/images/decreas4.gif
new file mode 100644
index 00000000..9ac0fedb
--- /dev/null
+++ b/web/cgi/images/decreas4.gif
Binary files differ
diff --git a/web/cgi/images/dot.gif b/web/cgi/images/dot.gif
new file mode 100644
index 00000000..a4f37d7e
--- /dev/null
+++ b/web/cgi/images/dot.gif
Binary files differ
diff --git a/web/cgi/images/dot2.gif b/web/cgi/images/dot2.gif
new file mode 100644
index 00000000..e565824a
--- /dev/null
+++ b/web/cgi/images/dot2.gif
Binary files differ
diff --git a/web/cgi/images/dotblink.gif b/web/cgi/images/dotblink.gif
new file mode 100644
index 00000000..500f0bc0
--- /dev/null
+++ b/web/cgi/images/dotblink.gif
Binary files differ
diff --git a/web/cgi/images/dstripe.gif b/web/cgi/images/dstripe.gif
new file mode 100644
index 00000000..6adf1bcb
--- /dev/null
+++ b/web/cgi/images/dstripe.gif
Binary files differ
diff --git a/web/cgi/images/env/d_new.gif b/web/cgi/images/env/d_new.gif
new file mode 100644
index 00000000..f9766a80
--- /dev/null
+++ b/web/cgi/images/env/d_new.gif
Binary files differ
diff --git a/web/cgi/images/env/d_newans.gif b/web/cgi/images/env/d_newans.gif
new file mode 100644
index 00000000..d90c8509
--- /dev/null
+++ b/web/cgi/images/env/d_newans.gif
Binary files differ
diff --git a/web/cgi/images/env/d_newansdel.gif b/web/cgi/images/env/d_newansdel.gif
new file mode 100644
index 00000000..d735bb14
--- /dev/null
+++ b/web/cgi/images/env/d_newansdel.gif
Binary files differ
diff --git a/web/cgi/images/env/d_newdel.gif b/web/cgi/images/env/d_newdel.gif
new file mode 100644
index 00000000..2f758bd5
--- /dev/null
+++ b/web/cgi/images/env/d_newdel.gif
Binary files differ
diff --git a/web/cgi/images/env/d_newimp.gif b/web/cgi/images/env/d_newimp.gif
new file mode 100644
index 00000000..10510595
--- /dev/null
+++ b/web/cgi/images/env/d_newimp.gif
Binary files differ
diff --git a/web/cgi/images/env/d_newimpans.gif b/web/cgi/images/env/d_newimpans.gif
new file mode 100644
index 00000000..0fa8b0c0
--- /dev/null
+++ b/web/cgi/images/env/d_newimpans.gif
Binary files differ
diff --git a/web/cgi/images/env/d_newimpansdel.gif b/web/cgi/images/env/d_newimpansdel.gif
new file mode 100644
index 00000000..872a80d9
--- /dev/null
+++ b/web/cgi/images/env/d_newimpansdel.gif
Binary files differ
diff --git a/web/cgi/images/env/d_newimpdel.gif b/web/cgi/images/env/d_newimpdel.gif
new file mode 100644
index 00000000..dd92dc26
--- /dev/null
+++ b/web/cgi/images/env/d_newimpdel.gif
Binary files differ
diff --git a/web/cgi/images/env/d_newyou.gif b/web/cgi/images/env/d_newyou.gif
new file mode 100644
index 00000000..c227e684
--- /dev/null
+++ b/web/cgi/images/env/d_newyou.gif
Binary files differ
diff --git a/web/cgi/images/env/d_newyouans.gif b/web/cgi/images/env/d_newyouans.gif
new file mode 100644
index 00000000..9f8c24c1
--- /dev/null
+++ b/web/cgi/images/env/d_newyouans.gif
Binary files differ
diff --git a/web/cgi/images/env/d_newyouansdel.gif b/web/cgi/images/env/d_newyouansdel.gif
new file mode 100644
index 00000000..d922a6a3
--- /dev/null
+++ b/web/cgi/images/env/d_newyouansdel.gif
Binary files differ
diff --git a/web/cgi/images/env/d_newyoudel.gif b/web/cgi/images/env/d_newyoudel.gif
new file mode 100644
index 00000000..8ac883c2
--- /dev/null
+++ b/web/cgi/images/env/d_newyoudel.gif
Binary files differ
diff --git a/web/cgi/images/env/d_read.gif b/web/cgi/images/env/d_read.gif
new file mode 100644
index 00000000..2b9aa56e
--- /dev/null
+++ b/web/cgi/images/env/d_read.gif
Binary files differ
diff --git a/web/cgi/images/env/d_readans.gif b/web/cgi/images/env/d_readans.gif
new file mode 100644
index 00000000..dd9b80ae
--- /dev/null
+++ b/web/cgi/images/env/d_readans.gif
Binary files differ
diff --git a/web/cgi/images/env/d_readansdel.gif b/web/cgi/images/env/d_readansdel.gif
new file mode 100644
index 00000000..c98d2395
--- /dev/null
+++ b/web/cgi/images/env/d_readansdel.gif
Binary files differ
diff --git a/web/cgi/images/env/d_readdel.gif b/web/cgi/images/env/d_readdel.gif
new file mode 100644
index 00000000..a922f923
--- /dev/null
+++ b/web/cgi/images/env/d_readdel.gif
Binary files differ
diff --git a/web/cgi/images/env/d_readimp.gif b/web/cgi/images/env/d_readimp.gif
new file mode 100644
index 00000000..81015d7b
--- /dev/null
+++ b/web/cgi/images/env/d_readimp.gif
Binary files differ
diff --git a/web/cgi/images/env/d_readimpans.gif b/web/cgi/images/env/d_readimpans.gif
new file mode 100644
index 00000000..d8bfcb89
--- /dev/null
+++ b/web/cgi/images/env/d_readimpans.gif
Binary files differ
diff --git a/web/cgi/images/env/d_readimpansdel.gif b/web/cgi/images/env/d_readimpansdel.gif
new file mode 100644
index 00000000..02342edd
--- /dev/null
+++ b/web/cgi/images/env/d_readimpansdel.gif
Binary files differ
diff --git a/web/cgi/images/env/d_readimpdel.gif b/web/cgi/images/env/d_readimpdel.gif
new file mode 100644
index 00000000..0d66fcbd
--- /dev/null
+++ b/web/cgi/images/env/d_readimpdel.gif
Binary files differ
diff --git a/web/cgi/images/env/d_readyou.gif b/web/cgi/images/env/d_readyou.gif
new file mode 100644
index 00000000..8dc32802
--- /dev/null
+++ b/web/cgi/images/env/d_readyou.gif
Binary files differ
diff --git a/web/cgi/images/env/d_readyouans.gif b/web/cgi/images/env/d_readyouans.gif
new file mode 100644
index 00000000..dab41d34
--- /dev/null
+++ b/web/cgi/images/env/d_readyouans.gif
Binary files differ
diff --git a/web/cgi/images/env/d_readyouansdel.gif b/web/cgi/images/env/d_readyouansdel.gif
new file mode 100644
index 00000000..98a9b4ae
--- /dev/null
+++ b/web/cgi/images/env/d_readyouansdel.gif
Binary files differ
diff --git a/web/cgi/images/env/d_readyoudel.gif b/web/cgi/images/env/d_readyoudel.gif
new file mode 100644
index 00000000..646c2b4f
--- /dev/null
+++ b/web/cgi/images/env/d_readyoudel.gif
Binary files differ
diff --git a/web/cgi/images/env/new.gif b/web/cgi/images/env/new.gif
new file mode 100644
index 00000000..a34257ed
--- /dev/null
+++ b/web/cgi/images/env/new.gif
Binary files differ
diff --git a/web/cgi/images/env/newans.gif b/web/cgi/images/env/newans.gif
new file mode 100644
index 00000000..e43c377b
--- /dev/null
+++ b/web/cgi/images/env/newans.gif
Binary files differ
diff --git a/web/cgi/images/env/newansdel.gif b/web/cgi/images/env/newansdel.gif
new file mode 100644
index 00000000..ecfbaa83
--- /dev/null
+++ b/web/cgi/images/env/newansdel.gif
Binary files differ
diff --git a/web/cgi/images/env/newdel.gif b/web/cgi/images/env/newdel.gif
new file mode 100644
index 00000000..c1c2f02c
--- /dev/null
+++ b/web/cgi/images/env/newdel.gif
Binary files differ
diff --git a/web/cgi/images/env/newimp.gif b/web/cgi/images/env/newimp.gif
new file mode 100644
index 00000000..12aaf644
--- /dev/null
+++ b/web/cgi/images/env/newimp.gif
Binary files differ
diff --git a/web/cgi/images/env/newimpans.gif b/web/cgi/images/env/newimpans.gif
new file mode 100644
index 00000000..1ae6db2e
--- /dev/null
+++ b/web/cgi/images/env/newimpans.gif
Binary files differ
diff --git a/web/cgi/images/env/newimpansdel.gif b/web/cgi/images/env/newimpansdel.gif
new file mode 100644
index 00000000..df986427
--- /dev/null
+++ b/web/cgi/images/env/newimpansdel.gif
Binary files differ
diff --git a/web/cgi/images/env/newimpdel.gif b/web/cgi/images/env/newimpdel.gif
new file mode 100644
index 00000000..8eff245f
--- /dev/null
+++ b/web/cgi/images/env/newimpdel.gif
Binary files differ
diff --git a/web/cgi/images/env/newyou.gif b/web/cgi/images/env/newyou.gif
new file mode 100644
index 00000000..d376ece8
--- /dev/null
+++ b/web/cgi/images/env/newyou.gif
Binary files differ
diff --git a/web/cgi/images/env/newyouans.gif b/web/cgi/images/env/newyouans.gif
new file mode 100644
index 00000000..f9afe98a
--- /dev/null
+++ b/web/cgi/images/env/newyouans.gif
Binary files differ
diff --git a/web/cgi/images/env/newyouansdel.gif b/web/cgi/images/env/newyouansdel.gif
new file mode 100644
index 00000000..bca5ab7e
--- /dev/null
+++ b/web/cgi/images/env/newyouansdel.gif
Binary files differ
diff --git a/web/cgi/images/env/newyoudel.gif b/web/cgi/images/env/newyoudel.gif
new file mode 100644
index 00000000..5f3305ff
--- /dev/null
+++ b/web/cgi/images/env/newyoudel.gif
Binary files differ
diff --git a/web/cgi/images/env/read.gif b/web/cgi/images/env/read.gif
new file mode 100644
index 00000000..b5325e06
--- /dev/null
+++ b/web/cgi/images/env/read.gif
Binary files differ
diff --git a/web/cgi/images/env/readans.gif b/web/cgi/images/env/readans.gif
new file mode 100644
index 00000000..29e08915
--- /dev/null
+++ b/web/cgi/images/env/readans.gif
Binary files differ
diff --git a/web/cgi/images/env/readansdel.gif b/web/cgi/images/env/readansdel.gif
new file mode 100644
index 00000000..d74cac4c
--- /dev/null
+++ b/web/cgi/images/env/readansdel.gif
Binary files differ
diff --git a/web/cgi/images/env/readdel.gif b/web/cgi/images/env/readdel.gif
new file mode 100644
index 00000000..9fa3f1d3
--- /dev/null
+++ b/web/cgi/images/env/readdel.gif
Binary files differ
diff --git a/web/cgi/images/env/readimp.gif b/web/cgi/images/env/readimp.gif
new file mode 100644
index 00000000..c202ce57
--- /dev/null
+++ b/web/cgi/images/env/readimp.gif
Binary files differ
diff --git a/web/cgi/images/env/readimpans.gif b/web/cgi/images/env/readimpans.gif
new file mode 100644
index 00000000..8658dbe5
--- /dev/null
+++ b/web/cgi/images/env/readimpans.gif
Binary files differ
diff --git a/web/cgi/images/env/readimpansdel.gif b/web/cgi/images/env/readimpansdel.gif
new file mode 100644
index 00000000..c0adfd9d
--- /dev/null
+++ b/web/cgi/images/env/readimpansdel.gif
Binary files differ
diff --git a/web/cgi/images/env/readimpdel.gif b/web/cgi/images/env/readimpdel.gif
new file mode 100644
index 00000000..16e97f72
--- /dev/null
+++ b/web/cgi/images/env/readimpdel.gif
Binary files differ
diff --git a/web/cgi/images/env/readyou.border.gif b/web/cgi/images/env/readyou.border.gif
new file mode 100644
index 00000000..7f0f4a7c
--- /dev/null
+++ b/web/cgi/images/env/readyou.border.gif
Binary files differ
diff --git a/web/cgi/images/env/readyou.gif b/web/cgi/images/env/readyou.gif
new file mode 100644
index 00000000..e1587077
--- /dev/null
+++ b/web/cgi/images/env/readyou.gif
Binary files differ
diff --git a/web/cgi/images/env/readyouans.gif b/web/cgi/images/env/readyouans.gif
new file mode 100644
index 00000000..8a71bf4a
--- /dev/null
+++ b/web/cgi/images/env/readyouans.gif
Binary files differ
diff --git a/web/cgi/images/env/readyouansdel.gif b/web/cgi/images/env/readyouansdel.gif
new file mode 100644
index 00000000..d59d4a6a
--- /dev/null
+++ b/web/cgi/images/env/readyouansdel.gif
Binary files differ
diff --git a/web/cgi/images/env/readyoudel.gif b/web/cgi/images/env/readyoudel.gif
new file mode 100644
index 00000000..c1718d1d
--- /dev/null
+++ b/web/cgi/images/env/readyoudel.gif
Binary files differ
diff --git a/web/cgi/images/hdr.gif b/web/cgi/images/hdr.gif
new file mode 100644
index 00000000..25432375
--- /dev/null
+++ b/web/cgi/images/hdr.gif
Binary files differ
diff --git a/web/cgi/images/hdrless.gif b/web/cgi/images/hdrless.gif
new file mode 100644
index 00000000..dc6f1279
--- /dev/null
+++ b/web/cgi/images/hdrless.gif
Binary files differ
diff --git a/web/cgi/images/hdrmore.gif b/web/cgi/images/hdrmore.gif
new file mode 100644
index 00000000..ce451397
--- /dev/null
+++ b/web/cgi/images/hdrmore.gif
Binary files differ
diff --git a/web/cgi/images/hdrnon.gif b/web/cgi/images/hdrnon.gif
new file mode 100644
index 00000000..26d60632
--- /dev/null
+++ b/web/cgi/images/hdrnon.gif
Binary files differ
diff --git a/web/cgi/images/help_trans.gif b/web/cgi/images/help_trans.gif
new file mode 100644
index 00000000..d2043df4
--- /dev/null
+++ b/web/cgi/images/help_trans.gif
Binary files differ
diff --git a/web/cgi/images/ibarmsg.gif b/web/cgi/images/ibarmsg.gif
new file mode 100644
index 00000000..ba5a25f9
--- /dev/null
+++ b/web/cgi/images/ibarmsg.gif
Binary files differ
diff --git a/web/cgi/images/ibarvertmsg.gif b/web/cgi/images/ibarvertmsg.gif
new file mode 100644
index 00000000..4cf3fb4d
--- /dev/null
+++ b/web/cgi/images/ibarvertmsg.gif
Binary files differ
diff --git a/web/cgi/images/if_blank.gif b/web/cgi/images/if_blank.gif
new file mode 100644
index 00000000..54a6a152
--- /dev/null
+++ b/web/cgi/images/if_blank.gif
Binary files differ
diff --git a/web/cgi/images/if_left.gif b/web/cgi/images/if_left.gif
new file mode 100644
index 00000000..7d750037
--- /dev/null
+++ b/web/cgi/images/if_left.gif
Binary files differ
diff --git a/web/cgi/images/if_narrow.gif b/web/cgi/images/if_narrow.gif
new file mode 100644
index 00000000..e0ef6ec7
--- /dev/null
+++ b/web/cgi/images/if_narrow.gif
Binary files differ
diff --git a/web/cgi/images/if_narrow2.gif b/web/cgi/images/if_narrow2.gif
new file mode 100644
index 00000000..141e7946
--- /dev/null
+++ b/web/cgi/images/if_narrow2.gif
Binary files differ
diff --git a/web/cgi/images/if_remove.gif b/web/cgi/images/if_remove.gif
new file mode 100644
index 00000000..f4f74548
--- /dev/null
+++ b/web/cgi/images/if_remove.gif
Binary files differ
diff --git a/web/cgi/images/if_right.gif b/web/cgi/images/if_right.gif
new file mode 100644
index 00000000..d2490ff6
--- /dev/null
+++ b/web/cgi/images/if_right.gif
Binary files differ
diff --git a/web/cgi/images/if_widen.gif b/web/cgi/images/if_widen.gif
new file mode 100644
index 00000000..5cc84849
--- /dev/null
+++ b/web/cgi/images/if_widen.gif
Binary files differ
diff --git a/web/cgi/images/if_wider.gif b/web/cgi/images/if_wider.gif
new file mode 100644
index 00000000..dc39da1a
--- /dev/null
+++ b/web/cgi/images/if_wider.gif
Binary files differ
diff --git a/web/cgi/images/increas4.gif b/web/cgi/images/increas4.gif
new file mode 100644
index 00000000..8cb8e232
--- /dev/null
+++ b/web/cgi/images/increas4.gif
Binary files differ
diff --git a/web/cgi/images/indexhdr.gif b/web/cgi/images/indexhdr.gif
new file mode 100644
index 00000000..0463a80d
--- /dev/null
+++ b/web/cgi/images/indexhdr.gif
Binary files differ
diff --git a/web/cgi/images/logo/alpine/back.gif b/web/cgi/images/logo/alpine/back.gif
new file mode 100644
index 00000000..cab310df
--- /dev/null
+++ b/web/cgi/images/logo/alpine/back.gif
Binary files differ
diff --git a/web/cgi/images/logo/alpine/big.gif b/web/cgi/images/logo/alpine/big.gif
new file mode 100644
index 00000000..6d4862ee
--- /dev/null
+++ b/web/cgi/images/logo/alpine/big.gif
Binary files differ
diff --git a/web/cgi/images/logo/alpine/small-blank.gif b/web/cgi/images/logo/alpine/small-blank.gif
new file mode 100644
index 00000000..41868d0a
--- /dev/null
+++ b/web/cgi/images/logo/alpine/small-blank.gif
Binary files differ
diff --git a/web/cgi/images/logo/alpine/small.gif b/web/cgi/images/logo/alpine/small.gif
new file mode 100644
index 00000000..af845545
--- /dev/null
+++ b/web/cgi/images/logo/alpine/small.gif
Binary files differ
diff --git a/web/cgi/images/markall3.gif b/web/cgi/images/markall3.gif
new file mode 100644
index 00000000..15b2b82d
--- /dev/null
+++ b/web/cgi/images/markall3.gif
Binary files differ
diff --git a/web/cgi/images/marknone3.gif b/web/cgi/images/marknone3.gif
new file mode 100644
index 00000000..b8845863
--- /dev/null
+++ b/web/cgi/images/marknone3.gif
Binary files differ
diff --git a/web/cgi/images/minus2.gif b/web/cgi/images/minus2.gif
new file mode 100644
index 00000000..928ec8f5
--- /dev/null
+++ b/web/cgi/images/minus2.gif
Binary files differ
diff --git a/web/cgi/images/nondither10x10.gif b/web/cgi/images/nondither10x10.gif
new file mode 100644
index 00000000..cea4b5cf
--- /dev/null
+++ b/web/cgi/images/nondither10x10.gif
Binary files differ
diff --git a/web/cgi/images/plus2.gif b/web/cgi/images/plus2.gif
new file mode 100644
index 00000000..be20fa4b
--- /dev/null
+++ b/web/cgi/images/plus2.gif
Binary files differ
diff --git a/web/cgi/images/postmark.gif b/web/cgi/images/postmark.gif
new file mode 100644
index 00000000..dd384564
--- /dev/null
+++ b/web/cgi/images/postmark.gif
Binary files differ
diff --git a/web/cgi/images/printer2.gif b/web/cgi/images/printer2.gif
new file mode 100644
index 00000000..d752ed33
--- /dev/null
+++ b/web/cgi/images/printer2.gif
Binary files differ
diff --git a/web/cgi/images/slidein.gif b/web/cgi/images/slidein.gif
new file mode 100644
index 00000000..7f5ceefa
--- /dev/null
+++ b/web/cgi/images/slidein.gif
Binary files differ
diff --git a/web/cgi/images/slideout.gif b/web/cgi/images/slideout.gif
new file mode 100644
index 00000000..1ccd330f
--- /dev/null
+++ b/web/cgi/images/slideout.gif
Binary files differ
diff --git a/web/cgi/images/tabless.gif b/web/cgi/images/tabless.gif
new file mode 100644
index 00000000..9f923935
--- /dev/null
+++ b/web/cgi/images/tabless.gif
Binary files differ
diff --git a/web/cgi/images/tabmore.gif b/web/cgi/images/tabmore.gif
new file mode 100644
index 00000000..97f21212
--- /dev/null
+++ b/web/cgi/images/tabmore.gif
Binary files differ
diff --git a/web/cgi/images/tabs/abdtab.gif b/web/cgi/images/tabs/abdtab.gif
new file mode 100644
index 00000000..1e464fc2
--- /dev/null
+++ b/web/cgi/images/tabs/abdtab.gif
Binary files differ
diff --git a/web/cgi/images/tabs/abtab.gif b/web/cgi/images/tabs/abtab.gif
new file mode 100644
index 00000000..b60728a0
--- /dev/null
+++ b/web/cgi/images/tabs/abtab.gif
Binary files differ
diff --git a/web/cgi/images/tabs/blank.gif b/web/cgi/images/tabs/blank.gif
new file mode 100644
index 00000000..8079c962
--- /dev/null
+++ b/web/cgi/images/tabs/blank.gif
Binary files differ
diff --git a/web/cgi/images/tabs/cdtab.gif b/web/cgi/images/tabs/cdtab.gif
new file mode 100644
index 00000000..d55eb0ae
--- /dev/null
+++ b/web/cgi/images/tabs/cdtab.gif
Binary files differ
diff --git a/web/cgi/images/tabs/ctab.gif b/web/cgi/images/tabs/ctab.gif
new file mode 100644
index 00000000..53a1b1f3
--- /dev/null
+++ b/web/cgi/images/tabs/ctab.gif
Binary files differ
diff --git a/web/cgi/images/tabs/fdtab.gif b/web/cgi/images/tabs/fdtab.gif
new file mode 100644
index 00000000..bcbaf36c
--- /dev/null
+++ b/web/cgi/images/tabs/fdtab.gif
Binary files differ
diff --git a/web/cgi/images/tabs/ftab.gif b/web/cgi/images/tabs/ftab.gif
new file mode 100644
index 00000000..163c9f39
--- /dev/null
+++ b/web/cgi/images/tabs/ftab.gif
Binary files differ
diff --git a/web/cgi/images/tabs/gdtab.gif b/web/cgi/images/tabs/gdtab.gif
new file mode 100644
index 00000000..f4651a54
--- /dev/null
+++ b/web/cgi/images/tabs/gdtab.gif
Binary files differ
diff --git a/web/cgi/images/tabs/gtab.gif b/web/cgi/images/tabs/gtab.gif
new file mode 100644
index 00000000..152280cd
--- /dev/null
+++ b/web/cgi/images/tabs/gtab.gif
Binary files differ
diff --git a/web/cgi/images/tabs/mldtab.gif b/web/cgi/images/tabs/mldtab.gif
new file mode 100644
index 00000000..ad10bafb
--- /dev/null
+++ b/web/cgi/images/tabs/mldtab.gif
Binary files differ
diff --git a/web/cgi/images/tabs/mltab.gif b/web/cgi/images/tabs/mltab.gif
new file mode 100644
index 00000000..c2a6833f
--- /dev/null
+++ b/web/cgi/images/tabs/mltab.gif
Binary files differ
diff --git a/web/cgi/images/tabs/mvdtab.gif b/web/cgi/images/tabs/mvdtab.gif
new file mode 100644
index 00000000..2051a898
--- /dev/null
+++ b/web/cgi/images/tabs/mvdtab.gif
Binary files differ
diff --git a/web/cgi/images/tabs/mvtab.gif b/web/cgi/images/tabs/mvtab.gif
new file mode 100644
index 00000000..01b66066
--- /dev/null
+++ b/web/cgi/images/tabs/mvtab.gif
Binary files differ
diff --git a/web/cgi/images/tabs/rdtab.gif b/web/cgi/images/tabs/rdtab.gif
new file mode 100644
index 00000000..c97628bc
--- /dev/null
+++ b/web/cgi/images/tabs/rdtab.gif
Binary files differ
diff --git a/web/cgi/images/tabs/rtab.gif b/web/cgi/images/tabs/rtab.gif
new file mode 100644
index 00000000..06519f2a
--- /dev/null
+++ b/web/cgi/images/tabs/rtab.gif
Binary files differ
diff --git a/web/cgi/images/tabs/tabbg.gif b/web/cgi/images/tabs/tabbg.gif
new file mode 100644
index 00000000..f0382851
--- /dev/null
+++ b/web/cgi/images/tabs/tabbg.gif
Binary files differ
diff --git a/web/cgi/images/tabs/tabmid.gif b/web/cgi/images/tabs/tabmid.gif
new file mode 100644
index 00000000..7d9bd22c
--- /dev/null
+++ b/web/cgi/images/tabs/tabmid.gif
Binary files differ
diff --git a/web/cgi/motd.sample b/web/cgi/motd.sample
new file mode 100644
index 00000000..d3525a3f
--- /dev/null
+++ b/web/cgi/motd.sample
@@ -0,0 +1,5 @@
+<b>Note:</b><br>
+We're always looking to improve Web Alpine! Please send your comments and suggestions to to alpine-info@cac.washington.edu.
+<br>
+Thanks!
+
diff --git a/web/cgi/pub/alpine.tcl b/web/cgi/pub/alpine.tcl
new file mode 120000
index 00000000..5ad8d42f
--- /dev/null
+++ b/web/cgi/pub/alpine.tcl
@@ -0,0 +1 @@
+../alpine.tcl \ No newline at end of file
diff --git a/web/cgi/pub/getach.tcl b/web/cgi/pub/getach.tcl
new file mode 100755
index 00000000..dce5047c
--- /dev/null
+++ b/web/cgi/pub/getach.tcl
@@ -0,0 +1,87 @@
+#!./tclsh
+
+# ========================================================================
+# Copyright 2006-2007 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# getach.tcl
+#
+# Purpose: CGI script to retrieve requested attachment
+#
+# Input:
+#
+# h : handle referring to temp file holding attachment particulars
+
+# inherit global config
+source ./alpine.tcl
+
+cgi_eval {
+
+ # verify that the format of the request is correct. Mainly it's
+ # to reasonably handle relative urls in viewed html attachments. Ugh.
+ if {[regexp {^h=[A-Za-z0-9]*$} $env(QUERY_STRING)]} {
+
+ cgi_input
+
+ WPImport h
+
+ if {[regexp {^[A-Za-z0-9]+$} $h] != 1} {
+ WPInfoPage "Web Alpine Error" [font size=+2 "Bogus Attachment Handle: $h"] "Please close this window."
+ exit
+ }
+
+ set cmdfile [file join $_wp(detachpath) detach.${h}-control]
+
+ if {[file exists $cmdfile] == 0} {
+ WPInfoPage "Webpine Error" [font size=+2 "Stale Handle Reference"] "Please click the attachment link to view this attachment."
+ } elseif {[catch {
+ set cid [open $cmdfile r]
+
+ while {1} {
+ if {[gets $cid line] == 0} {
+ if {[gets $cid tmpfile] != 0} {
+ puts stdout ""
+
+ set fp [open $tmpfile r]
+
+ fconfigure $fp -translation binary
+ fconfigure stdout -translation binary
+
+ fcopy $fp stdout
+
+ close $fp
+ }
+
+ break
+ } else {
+ puts stdout $line
+ }
+ }
+ } errstr]} {
+ WPInfoPage "Webpine Error" [font size=+2 $errstr] "Please close this window."
+ }
+
+ #
+ # Don't delete the temp files immediately because *some* browsers
+ # <cough>IE<cough> will download the attachment, then hand the
+ # URL of the downloaded attachment to the viewer <cough>WMP<cough>
+ # so the viewer can then *REFETCH* the data for display. No,
+ # they don't pay attention to the redirect code.
+ #
+ # The script that created them is responsible for having set in motion
+ # a process to delete them at some point in the future.
+ #
+ # catch {file delete -force $cmdfile}
+ # catch {file delete -force $tmpfile}
+ } else {
+ WPInfoPage "Invalid Attachment Reference" "[font size=+2 "Invalid Attachment Reference"]" \
+ "This page is the result of clicking a link in an attached HTML document. It's author likely used an incomplete hypertext link which resulted in a bogus link to the WebPine server.<p>Clicking your browser's Back button should restore the attachment's display."
+ }
+}
diff --git a/web/cgi/pub/standard.css b/web/cgi/pub/standard.css
new file mode 100644
index 00000000..e2b0fd21
--- /dev/null
+++ b/web/cgi/pub/standard.css
@@ -0,0 +1,45 @@
+TD.nosize { font-size: 16px }
+DIV.fname { font-family: arial, sans-serif; font-size: 10pt }
+.prog { font-family: arial, sans-serif ; font-weight: bold ; font-size: 16px ; color: #50056E }
+.title { font-family: arial, sans-serif ; color: white }
+.flymenu { visibility: hidden; position: absolute; left: 0; top: 0 }
+.flydata { font-family: arial, sans-serif ; font-size: 10pt }
+.flydata:hover { color: #ff0066 }
+TABLE.flydata { background-color: #fefac9 ; border: #006400 2px solid }
+TH.flydata { text-align: center ; color: white ; background-color: #006400 }
+HR.flydata { color: #006400 }
+A.flydata { font-size: 10pt ; text-decoration: none ; color: black }
+.menubar { color: white; font-family: arial, sans-serif; font-size: 8pt }
+.menubar:hover { color:yellow }
+DIV.menubar { position: absolute; visibility: visible; top: 62px; left: 2px; }
+A.menubar { color:black; text-decoration:none; font-weight:bold ; height: 16px ; width: 100px ; vertical-align: middle }
+HR.menubar { border-top: solid; color: black }
+.body { background-color: white }
+input.body { color: white; }
+.indexhdr { font-family: geneva, arial, sans-serif ; font-size: 8pt ; color: black }
+.indexsort { font-family: geneva, arial, sans-serif ; background-color: #999999 ; font-size: 8pt ; color: white }
+.auth { font-family: Arial, Sans-Serif ; font-size: 10pt ; font-weight: bold }
+.extrahdrs { background-color: white; display: none }
+.navtext { font-family: geneva, arial, sans-serif ; font-size: 9pt }
+.navbar { color: white ; font-family: geneva, arial, sans-serif ; font-size: 9pt ; letter-spacing: 0pt }
+FORM { margin-bottom: 0px ; margin-top: 0px }
+.statustext { color: black ; font-family: geneva, arial, sans-serif ; font-size: 8pt }
+.morestatus { color: #ff3333 ; font-size: 10pt ; font-weight : bold }
+.ifakebar { visibility: hidden; position: absolute; left: 0; top: 0 }
+.ithumb { position: relative }
+.iflags { font-family: sans-serif ; color: red }
+.isize { font-size: 9pt }
+.notice { color: red ; font-weight: bold }
+A.notice { color: red }
+.attach { visibility: hidden; position: absolute; left: 0; top: 0 }
+.mispell { background: #ffcccc ; color: #000000; text-decoration: none }
+.spelltext { position: relative }
+.dialog { background-color: #fefac9 ; font-family: arial, sans-serif ; font-size: 12pt }
+.context { background-color: #999999 ; color: black ; font-family: Helvetica, sans-serif ; font-size: 9pt }
+.ops { background-color: #666666 ; color: white ; font-family: Helvetica, sans-serif }
+.i0 { background-color: #eeeeee }
+.i1 { background-color: #ffffff }
+.cfntc { color: red; font-size: 8pt }
+.cfval { font-size: 9pt }
+.cfvn { font-weight: bold; font-size: 10pt }
+.foldpic { background-color: #eeeeee }
diff --git a/web/cgi/pub/standard.js b/web/cgi/pub/standard.js
new file mode 100644
index 00000000..89157e1f
--- /dev/null
+++ b/web/cgi/pub/standard.js
@@ -0,0 +1,414 @@
+var child = new Object();
+child.win = null;
+var reloadtimer = null
+var resizer = null;
+var resized = null;
+var resizex = 0;
+var resizey = 0;
+
+if (navigator.appName.indexOf('Netscape') >= 0) {
+ if (navigator.appVersion.substr(0,1) < 5) {
+ isW3C = false;
+ isIE = false;
+ sEvent='e';
+ sKey='.which';
+ yRef='.top';
+ xRef='.left';
+ xOff='.clip.width';
+ yOff='.clip.height';
+ xEvent='.pageX';
+ yEvent='.pageY';
+ dS='document.';
+ sD='';
+ sHideV="'hide'";
+ sShowV="'show'";
+ dRef='self';
+ hRef='.innerHeight';
+ wRef='.innerWidth';
+ xSRef='.screenX';
+ ySRef='.screenY';
+ xPos=dRef+'.pageXOffset';
+ yPos=dRef+'.pageYOffset';
+ eSrc='.target';
+ } else {
+ isW3C = true;
+ isIE = false;
+ sEvent='e';
+ sKey='.which';
+ yRef='.top';
+ xRef='.left';
+ xOff='.offsetWidth';
+ yOff='.offsetHeight';
+ xEvent='.pageX';
+ yEvent='.pageY';
+ dS='document.';
+ sD='.style';
+ sHideV="'hidden'";
+ sShowV="'visible'";
+ dRef='self';
+ hRef='.innerHeight';
+ wRef='.innerWidth';
+ xSRef='.screenX';
+ ySRef='.screenY';
+ xPos=dRef+'.pageXOffset';
+ yPos=dRef+'.pageYOffset';
+ eSrc='.target';
+ }
+}
+else {
+ isIE = true;
+ isW3C = 0;
+ sEvent='window.event';
+ sKey='.keyCode';
+ yRef='.pixelTop';
+ xRef='.pixelLeft';
+ xOff='.offsetWidth';
+ yOff='.offsetHeight';
+ xEvent='.clientX';
+ yEvent='.clientY';
+ dS='';
+ sD='.style';
+ sHideV="'hidden'";
+ sShowV="'visible'";
+ dRef='document.body';
+ hRef='.clientHeight';
+ wRef='.clientWidth';
+ xPos=dRef+'.scrollLeft';
+ yPos=dRef+'.scrollTop';
+ xSRef='.screenLeft';
+ ySRef='.screenTop';
+ eSrc='.srcElement';
+}
+
+function setLayout() {
+ updateLayout();
+}
+
+function updateLayout() {
+ var yy = eval(yPos);
+ yy += Math.max(64 - yy, 0);
+ moveLayerY(getLayer('tasks'),yy);
+ setTimeout('updateLayout()',100);
+}
+
+function setResize(f,w) {
+ document.resized = (f) ? f : doResize;
+
+ document.resizex = getDisplayWidth();
+ document.resizey = getDisplayHeight();
+
+ if (isIE){
+ document.resizer = (w) ? w : null;
+ window.onresize = armResize;
+ }
+ else{
+ window.onresize = document.resized;
+ }
+}
+
+function armResize(e) {
+ if(document.resizer) document.resizer(e);
+ document.onmouseover = document.resized;
+}
+
+function doResize(e) {
+ if(!(document.resizex == getDisplayWidth() && document.resizey == getDisplayHeight())){
+ var newurl = window.location.href.replace(/\?.*$/, '');
+ document.onmouseover = null;
+ window.location.replace(newurl+'?ppg='+getResizedLines(e));
+ }
+}
+
+function getResizedLines(e) {
+ var h = (isW3C || document.all) ? eval(dRef+hRef) : e.height;
+ return Math.max(Math.floor((h - 66) / getIndexHeight()) - 1, 2);
+}
+
+function getDisplayWidth() {
+ return eval(dRef+wRef);
+}
+
+function getDisplayHeight() {
+ return eval(dRef+hRef);
+}
+
+function getWindowX() {
+ return eval('window'+xSRef);
+}
+
+function getWindowY() {
+ return eval('window'+ySRef);
+}
+
+function showElement(o) {
+ eval('o'+sD+'.visibility = '+sShowV);
+}
+
+function hideElement(o) {
+ eval('o'+sD+'.visibility = '+sHideV);
+}
+
+function isElementDisplayed(o) {
+ var d = eval('o'+sD+'.display');
+ return (d == 'block');
+}
+
+function displayElement(o) {
+ eval('o'+sD+'.display = "block"');
+}
+
+function concealElement(o) {
+ eval('o'+sD+'.display = "none"');
+}
+
+function getScrollAbove() {
+ return(eval(yPos));
+}
+
+function getScrollLeft() {
+ return(eval(xPos));
+}
+
+function layerWalk(l,t) {
+ var o;
+ for(var i = 0; i < l.length; i++){
+ o = eval('l[i]'+t);
+ if(o) return o;
+ o = layerWalk(l[i].document.layers,t);
+ if(o) return o;
+ }
+
+ return null;
+}
+
+function getImage(id) {
+ if(isW3C)
+ return document.getElementById(id);
+ else if(isIE)
+ return document.all[id];
+ else if(window.document.images[id])
+ return window.document.images[id];
+ else
+ return layerWalk(window.document.layers,'.document.images.'+id);
+}
+
+function getImageX(o) {
+ if(isIE || isW3C){
+ var x = o.offsetLeft;
+ for(var p = o.offsetParent; p != null; p = p.offsetParent)
+ x += p.offsetLeft;
+
+ return x;
+ }
+ else
+ return o.x;
+}
+
+function getImageY(o) {
+ if(isIE || isW3C){
+ var y = o.offsetTop;
+ for(var p = o.offsetParent; p != null; p = p.offsetParent)
+ y += p.offsetTop;
+
+ return y;
+ }
+ else
+ return o.y;
+}
+
+function getLayer(id) {
+ if(isW3C)
+ return document.getElementById(id);
+ else if(isIE)
+ return document.all[id];
+ else if(window.document.layers[id])
+ return window.document.layers[id];
+ else
+ return layerWalk(window.document.layers,'.document.layers.'+id);
+}
+
+function getElementWidth(l){
+ return l.width;
+}
+
+function getLayerHeight(l){
+ return eval('l'+yOff);
+}
+
+function getLayerWidth(l){
+ return eval('l'+xOff);
+}
+
+function getLayerX(l) {
+ return eval('l'+sD+xRef);
+}
+
+function getLayerY(l) {
+ return eval('l'+sD+yRef);
+}
+
+function moveLayerX(l,left) {
+ eval ('l'+sD+xRef+'='+left);
+}
+
+function moveLayerY(l,top) {
+ eval ('l'+sD+yRef+'='+top);
+}
+
+function moveLayer(l,left,top) {
+ moveLayerX(l,left);
+ moveLayerY(l,top);
+}
+
+function setLayerText(l,t) {
+ if(isIE || isW3C){
+ l.innerHTML = t;
+ }
+ else{
+ l.document.open();
+ l.document.write(t);
+ l.document.close();
+ }
+}
+
+function getEvent(e) {
+ return eval(sEvent);
+}
+
+function getEventElement(e) {
+ return eval('getEvent(e)'+eSrc);
+}
+
+function getEventX(e) {
+ return eval('getEvent(e)'+xEvent);
+}
+
+function getEventY(e) {
+ return eval('getEvent(e)'+yEvent);
+}
+
+function getKeyCode(e) {
+ return eval('getEvent(e)'+sKey);
+}
+
+function getControlKey(e) {
+ if(isW3C || isIE){
+ return getEvent(e).ctrlKey;
+ }
+ else{
+ return (e.modifiers & Event.CONTROL_MASK) != 0;
+ }
+}
+
+function getKeyStr(e) {
+ return String.fromCharCode(getKeyCode(e)).toLowerCase();
+}
+
+function focuschild() {
+ var rv = false;
+ var ourif = 'child.win.focus(); rv = true;';
+ var ourelse = 'child.win = null; window.onfocus = null;';
+
+ if(isIE && js_version >= 1.3){
+ eval('try {'+ourif+'} catch (all) {'+ourelse+'}');
+ }
+ else{
+ eval('if((child.win == null) || (child.win.closed)){'+ourelse+'}else{'+ourif+'}');
+ }
+
+ return rv;
+}
+
+function cOpen(u,n,a,w,h) {
+ if(!focuschild()){
+ var xWin = getWindowX(), yWin = getWindowY();
+ var wPage = getDisplayWidth(), hPage = getDisplayHeight();;
+ var x = Math.min(window.screen.width - wPage, Math.max(0, xWin + ((wPage - w)/2)));
+ var y = Math.min(window.screen.height - hPage, Math.max(0, yWin + ((hPage - h)/2)));
+ var f = a ? a+',' : '';
+ var now = new Date();
+
+ child.win = window.open(u,n+now.getTime(),f+'width='+w+',height='+h+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
+ window.onfocus = focuschild;
+ }
+
+ return child.win;
+}
+
+function cnOpen(u,n,a,w,h) {
+ var xOffset = (window.screen.width - w)/2, yOffset = (window.screen.height - h)/2;
+ window.open(u,n,a+',width='+w+',height='+h+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset);
+}
+
+function composeMsg(f,d,k) {
+ var s = 'compose.tcl', replace = 0;
+ switch(f) {
+ //case 'reply' : if(confirm('Include all recipients in Reply') == true) c = '?style=ReplyAll&uid='+d ; else c = '?style=Reply&uid='+d ; break;
+ case 'reply' : s='reply.tcl'; c = '?style=ReplyAll&uid='+d+'&cid='+k ; break;
+ case 'fwd' : c = '?style=Forward&uid='+d+'&cid='+k ; break;
+ case 'mailto' : c = '?to='+d+'&cid='+k ; break;
+ case 'nickto' : c = '?nickto='+d+'&cid='+k ; replace = 1; break;
+ default : c = '?cid='+k ; break;
+ }
+ if(!replace)
+ cOpen(s+c, 'compose', 'scrollbars=yes,resizable=yes', 800, 560);
+ else
+ window.location.href = s + c;
+ return false;
+}
+
+function isanum(s) {
+ if(s.length == 0)
+ return false;
+
+ for(var i = 0; i < s.length; i++)
+ if(s.charCodeAt(i) < 48 || s.charCodeAt(i) > 57)
+ return false;
+
+ return true;
+}
+
+function confOpen(s) {cOpen(s,'config','scrollbars=yes',800,560); return false;}
+function abookOpen(s) {cOpen(s,'addrbook','scrollbars=yes,resizable=yes',800,560); return false;}
+function helpOpen(s) {cOpen(s,'help','scrollbars=yes,resizable=yes',600,600); return false;}
+function aeOpen(s) {cOpen(s, 'addredit', 'scrollbars=yes,resizable=yes', 700, 500); return false}
+function taOpen(s) {cOpen(s, 'takeaddr', 'scrollbars=yes,resizable=yes', 700, 500); return false}
+function quitOpen(s) {cOpen(s, 'quit', '', 420, 200); return false}
+
+function doReload(ival) {
+ if((child.win == null) || (child.win.closed)){
+ var newurl = window.location.href.replace(/\?.*$/, '');
+ window.location.replace(newurl+'?reload=1');
+ }
+ else{
+ var i = getImage('logo');
+ if(i){
+ var now = new Date();
+ var t = new String();
+
+ t += now.getYear();
+ t += now.getMonth();
+ t += now.getDate();
+ t += now.getHours();
+ t += now.getMinutes();
+ t += now.getSeconds();
+ i.src = location.href.replace(/(.*)\/[^\/]*\.tcl.*/,'$1/ping.tcl/'+t+'/'+ival+'/'+(t - (t % ival))+'.gif');
+ }
+ }
+}
+
+function reloadTimer(s) {
+ reloadtimer = window.setInterval('doReload('+s+')', s * 1000);
+}
+
+function wp_escape(s) {
+ var t = escape(s);
+ t = t.replace(/\+/, '%2b');
+ return t;
+}
+
+function flipCheck(eid){
+ var cb = window.document.getElementById(eid);
+ if(cb) cb.checked = !cb.checked;
+ return false;
+}
diff --git a/web/cgi/pub/tclsh b/web/cgi/pub/tclsh
new file mode 120000
index 00000000..385fc6c6
--- /dev/null
+++ b/web/cgi/pub/tclsh
@@ -0,0 +1 @@
+../tclsh \ No newline at end of file
diff --git a/web/cgi/session/.htaccess b/web/cgi/session/.htaccess
new file mode 100644
index 00000000..a4f615c2
--- /dev/null
+++ b/web/cgi/session/.htaccess
@@ -0,0 +1,28 @@
+
+DirectoryIndex greeting.tcl
+
+#
+# mod_rewrite rules to coerce secure (https) access to underlying pages
+#
+
+RewriteEngine on
+
+#
+# If the server's connecting port isn't secure (https), then
+# redirect request to same location but such that the communication
+# is secure. NOTE: this isn't as secure as turning off the unsecure
+# port because any confidential information in the request is exposed
+# in the unsuspecting request on the unsecure port. Shouldn't really
+# be a problem since the secure content should only contain secure
+# references and the likelihood that a client mucks with the url into
+# a reference to secure content is pretty darn small.
+#
+
+RewriteCond %{SERVER_PORT} !=443
+
+#
+# Include SCRIPT_URL incase webpine package isn't in the
+# root of the server's data
+#
+RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=permanent,L]
+
diff --git a/web/cgi/session/_htaccess b/web/cgi/session/_htaccess
new file mode 100644
index 00000000..a4f615c2
--- /dev/null
+++ b/web/cgi/session/_htaccess
@@ -0,0 +1,28 @@
+
+DirectoryIndex greeting.tcl
+
+#
+# mod_rewrite rules to coerce secure (https) access to underlying pages
+#
+
+RewriteEngine on
+
+#
+# If the server's connecting port isn't secure (https), then
+# redirect request to same location but such that the communication
+# is secure. NOTE: this isn't as secure as turning off the unsecure
+# port because any confidential information in the request is exposed
+# in the unsuspecting request on the unsecure port. Shouldn't really
+# be a problem since the secure content should only contain secure
+# references and the likelihood that a client mucks with the url into
+# a reference to secure content is pretty darn small.
+#
+
+RewriteCond %{SERVER_PORT} !=443
+
+#
+# Include SCRIPT_URL incase webpine package isn't in the
+# root of the server's data
+#
+RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=permanent,L]
+
diff --git a/web/cgi/session/alpine.tcl b/web/cgi/session/alpine.tcl
new file mode 120000
index 00000000..5ad8d42f
--- /dev/null
+++ b/web/cgi/session/alpine.tcl
@@ -0,0 +1 @@
+../alpine.tcl \ No newline at end of file
diff --git a/web/cgi/session/greeting.tcl b/web/cgi/session/greeting.tcl
new file mode 100755
index 00000000..a6acc1e5
--- /dev/null
+++ b/web/cgi/session/greeting.tcl
@@ -0,0 +1,395 @@
+#!./tclsh
+# $Id: greeting.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# suck in any global config
+source ./alpine.tcl
+
+# figure out SSL defaults
+if {[info exists _wp(ssl_default)] && $_wp(ssl_default) == 0} {
+ set ssl 0
+} else {
+ set ssl 1
+ if {[info exists _wp(ssl_safe_domains)]} {
+ if {[info exists env(REMOTE_HOST)]} {
+ foreach d $_wp(ssl_safe_domains) {
+ regsub -all {\.} $d {\.} d
+ if {[regexp -nocase "$d\$" $env(REMOTE_HOST)]} {
+ set ssl 0
+ break
+ }
+ }
+ }
+
+ if {$ssl && [info exists env(REMOTE_ADDR)]} {
+ regexp {([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)} $env(REMOTE_ADDR) dummy a b c d
+ set h "$d.$c.$b.$a.in-addr.arpa"
+ if {[catch {exec nslookup -q=PTR $h "2&>1"} pr] == 0} {
+ foreach l [split $pr \n] {
+ if {[regexp -nocase "^$h\[ \]*name = (.*)\$" $l dummy inaddr]} {
+ break
+ }
+ }
+ }
+
+ if {[info exists inaddr]} {
+ foreach d $_wp(ssl_safe_domains) {
+ if {[set n [expr {[string length $inaddr] - [string length $d] - 1}]] > 1
+ && [string compare [string tolower [string range $inaddr $n end]] [string tolower ".$d"]] == 0} {
+ set ssl 0
+ break
+ }
+ }
+ }
+ }
+ }
+
+ if {$ssl && [info exists _wp(ssl_safe_addrs)]} {
+ set ra [split $env(REMOTE_ADDR) .]
+ foreach a $_wp(ssl_safe_addrs) {
+ if {[llength $a] == 2} {
+ set low [split [lindex $a 0] .]
+ set hi [split [lindex $a 1] .]
+
+ foreach a $ra b $low c $hi {
+ if {$b == $c} {
+ if {$a != $b} {
+ break
+ }
+ } else {
+ if {$a >= $b && $a <= $c} {
+ set ssl 0
+ break
+ }
+ }
+ }
+ } else {
+ foreach a [split $a .] b $ra {
+ if {[string length $a]} {
+ if {$a != $b} {
+ break
+ }
+ } else {
+ set $ssl 0
+ break
+ }
+ }
+ }
+
+ if {!$ssl} {
+ break
+ }
+ }
+ }
+}
+
+cgi_eval {
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+
+ cgi_head {
+ WPStdHtmlHdr Logon
+ WPStdScripts $_wp(indexheight)
+
+ if {$_wp(flexserver)} {
+ cgi_javascript {
+ cgi_put "function bogus(f,o) {"
+ cgi_put " if(o.value.length == 0){"
+ cgi_put " alert('What '+f+' will you be using to log in to your IMAP server?\\nPlease fill in the '+f+' field.');"
+ cgi_put " o.focus();"
+ cgi_put " return true;"
+ cgi_put " }"
+ cgi_put " return false;"
+ cgi_puts "}"
+ cgi_put "function doSubmit() {"
+ cgi_put " var f = document.Login;"
+ cgi_put " var l = f.Server;"
+ cgi_put " var o = l.options\[l.selectedIndex\];"
+ cgi_put " if(bogus('Username',f.User) || bogus('Password',f.Pass)) return false;"
+ cgi_put " if(o.value < 0){"
+ cgi_put " o.value = alien_server;"
+ cgi_put " }"
+ cgi_put " return true;"
+ cgi_puts "}"
+ cgi_put "function customServer() {"
+ cgi_put " var f = document.Login;"
+ cgi_put " var l = f.Server;"
+ cgi_put " var o = l.options\[l.selectedIndex\];"
+ if {[info exists env(REMOTE_USER)]} {
+ cgi_put " f.User.value = (o.value < 0) ? alien_user : def_user;"
+ cgi_put " f.Pass.value = (o.value < 0) ? alien_pass : def_pass;"
+ }
+ cgi_put " if(o.value < 0){"
+ cgi_put " if(s = prompt('IMAP Server Name (append \"/ssl\" for secure link)',o.s ? o.s : '')){"
+ cgi_put " alien_server = s;"
+ cgi_put " o.text = 'Your Server: '+alien_server;"
+ cgi_put " f.User.onfocus = null;"
+ cgi_put " f.Pass.onfocus = null;"
+ cgi_put " f.User.focus();"
+ cgi_put " }"
+ cgi_put " else if(alien_server.length == 0){"
+ if {[info exists env(REMOTE_USER)]} {
+ cgi_put " f.User.onfocus = f.User.blur;"
+ cgi_put " f.Pass.onfocus = f.Pass.blur;"
+ cgi_put " f.User.value = def_user;"
+ cgi_put " f.Pass.value = def_pass;"
+ }
+ cgi_put " l.selectedIndex = 0;"
+ cgi_put " }"
+ cgi_put " }"
+ if {[info exists env(REMOTE_USER)]} {
+ cgi_put " else {"
+ cgi_put " f.User.onfocus = f.User.blur;"
+ cgi_put " f.Pass.onfocus = f.Pass.blur;"
+ cgi_put " }"
+ }
+ cgi_puts "}"
+ if {[info exists env(REMOTE_USER)]} {
+ cgi_put "var def_user = new Array('$env(REMOTE_USER)');"
+ cgi_put "var def_pass = new Array('x');"
+ cgi_put "var alien_server = '';"
+ cgi_put "var alien_user = '';"
+ cgi_put "var alien_pass = '';"
+ cgi_put "function customSave() {"
+ cgi_put " var f = document.Login;"
+ cgi_put " var s = f.Server.options\[f.Server.selectedIndex\];"
+ cgi_put " if(s.value < 0){"
+ cgi_put " alien_user = f.User.value;"
+ cgi_put " alien_pass = f.Pass.value;"
+ cgi_put " }"
+ cgi_puts "}"
+ }
+ }
+ }
+ }
+
+ if {[info exists env(REMOTE_USER)]} {
+ set onload ""
+ } else {
+ set onload "onLoad=document.Login.User.focus()"
+ }
+
+ cgi_body $onload {
+ if {$_wp(flexserver)} {
+ set onsubmit "onSubmit=return doSubmit()"
+ } else {
+ set onsubmit ""
+ }
+
+ cgi_form session/init method=post enctype=multipart/form-data name=Login $onsubmit {
+ cgi_javascript {
+ cgi_puts "document.write('<input name=\"hPx\" value='+window.getDisplayHeight()+' type=hidden notab>');"
+ }
+
+ cgi_table height=100% width=100% align=center {
+
+ cgi_table_row {
+ cgi_table_data align=center valign=bottom height=18% colspan=8 {
+ set intro "Welcome to $_wp(appname)"
+ if {[info exists env(REMOTE_USER)]} {
+ set conf [subst [lindex [lindex $_wp(hosts) 0] 2]]
+ set pldap [file join $_wp(bin) $_wp(pldap)]
+ if {[catch {exec $pldap -p $conf -u $env(REMOTE_USER)} pname] == 0} {
+ append intro ", $pname"
+ }
+ }
+
+ cgi_put [font size=+2 face=Helvetica [bold $intro]]
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data width=36% height=35% align=right valign=middle {
+ cgi_put [cgi_imglink logo]
+ }
+
+ cgi_table_data width=5% {
+ cgi_puts [cgi_nbspace]
+ }
+
+ cgi_table_data {
+ cgi_table border=0 cellspacing=8 {
+ cgi_table_row {
+ cgi_table_data align=right valign=bottom {
+ cgi_puts [font size=+1 face=Helvetica "Username:"]
+ }
+
+ cgi_table_data align=left valign=bottom {
+ if {[info exists env(REMOTE_USER)]} {
+ set user "User=$env(REMOTE_USER)"
+ set rdonly "onFocus=this.blur();"
+ } else {
+ set user "User="
+ set rdonly ""
+ }
+
+ if {$_wp(flexserver) && [info exists env(REMOTE_USER)]} {
+ set onblur onBlur=customSave()
+ } else {
+ set onblur ""
+ }
+
+ cgi_text $user type=text maxlength=30 tableindex=1 $rdonly $onblur
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=right valign=middle {
+ cgi_puts [font size=+1 face=Helvetica "Password:"]
+ }
+
+ cgi_table_data align=left valign=middle {
+ if {[info exists env(REMOTE_USER)]} {
+ set pass "Pass=*"
+ set rdonly "onFocus=this.blur();"
+ } else {
+ set pass "Pass="
+ set rdonly ""
+ }
+
+ if {$_wp(flexserver) && [info exists env(REMOTE_USER)]} {
+ set onblur onBlur=customSave()
+ } else {
+ set onblur ""
+ }
+
+ cgi_text $pass type=password maxlength=30 tableindex=2 $rdonly $onblur
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=right valign=middle {
+ cgi_puts [font face=Helvetica size=+1 "Server:"]
+ }
+
+ cgi_table_data align=left valign=top {
+ if {[info exists _wp(hosts)]} {
+ if {$_wp(flexserver)} {
+ set onchange onChange=customServer()
+ if {[info exists env(REMOTE_USER)]} {
+ set onblur onBlur=customSave()
+ } else {
+ set onblur ""
+ }
+ } else {
+ set onchange ""
+ set onblur ""
+ }
+
+ cgi_select Server align=left $onchange $onblur {
+ for {set j 0} {$j < [llength $_wp(hosts)]} {incr j} {
+ cgi_option [lindex [lindex $_wp(hosts) $j] 0] value=$j
+ }
+
+ if {$_wp(flexserver)} {
+ cgi_javascript {
+ cgi_puts "document.write('<option value=\"-1\">Server of Your Choice');"
+ }
+ }
+ }
+ } else {
+ cgi_text Server= type=text maxlength=256
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if {[info exists env(REMOTE_USER)]} {
+ cgi_table_row {
+ cgi_table_data align=center valign=top height=1% colspan=8 {
+ cgi_puts "Protect your privacy! When you finish, [cgi_url "completely exit your Web browser" "http://www.washington.edu/computing/web/logout.html"]."
+ }
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data align=center valign=top colspan=8 "style=padding-bottom:10" {
+ cgi_submit_button login=Login
+ }
+ }
+
+ if {[info exists _wp(plainservpath)] && [string length $_wp(plainservpath)]} {
+ cgi_table_row {
+ cgi_table_data colspan=8 align=center valign=middle {
+ cgi_table border=0 width=30% {
+ cgi_table_row {
+ cgi_table_data rowspan=2 valign=top {
+ if {$ssl} {
+ set checked checked
+ } else {
+ set checked ""
+ }
+
+ cgi_checkbox ssl=1 $checked
+ }
+
+ cgi_table_data {
+ cgi_put [cgi_font size=-1 face=Helvetica "Use [cgi_url "SSL Session Encryption" "$_wp(serverpath)/$_wp(appdir)/$_wp(ui1dir)/help/secure.html" target=_blank]"]
+ cgi_br
+ set t "Session encryption over low-speed connections may slow WebPine, but prevents eavesdropping. Passwords are safely encrypted though."
+
+ cgi_division style=background-color:#eeeeee {
+ cgi_put [cgi_font size=-2 face=Helvetica $t]
+ }
+ }
+ }
+ }
+ }
+ }
+ } else {
+ cgi_text ssl=1 type=hidden notab
+ }
+
+ if {[info exists _wp(oldserverpath)] && [regexp {^[Hh][Tt][Tt][Pp][Ss]://} $_wp(oldserverpath)]} {
+ cgi_table_row {
+ cgi_table_data colspan=8 align=center valign=middle {
+ cgi_division "style=\"width: 30% ; font-family: Helvetica; font-size: small ; background-color: #EEEEEE; padding: 8 2 \"" {
+ cgi_puts "For the time being, the [cgi_url "old version" $_wp(oldserverpath)] is still available."
+ }
+ }
+ }
+ }
+
+ if {[catch {open [file join $_wp(cgipath) $_wp(motd)] r} id] == 0} {
+ cgi_table_row {
+ cgi_table_data colspan=8 height=20% valign=top {
+ cgi_table width=100% {
+ cgi_table_data height=40 width=18% {
+ # cgi_puts [cgi_imglink bang]
+ cgi_puts [cgi_nbspace]
+ }
+
+ cgi_table_data {
+ cgi_puts [font size=-1 face=Helvetica [read $id]]
+ }
+
+ cgi_table_data width=18% {
+ # cgi_puts [cgi_imglink bang]
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+ }
+
+ close $id
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/session/init.tcl b/web/cgi/session/init.tcl
new file mode 100755
index 00000000..00f0f903
--- /dev/null
+++ b/web/cgi/session/init.tcl
@@ -0,0 +1,218 @@
+#!./tclsh
+# $Id: init.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# init.tcl
+#
+# Purpose: CGI script to establish foundation for webpine session
+
+# and any global config
+source ./alpine.tcl
+
+
+cgi_eval {
+ if {$_wp(debug)} {
+ cgi_debug -on
+ }
+
+ #
+ # Import username and password from pubcookie, if possible.
+ # Otherwise get it from the form that was submitted.
+ #
+ cgi_input
+
+ if {[catch {cgi_import User}] || 0 == [string length $User]} {
+ WPInfoPage "Bogus Username" \
+ "[font size=+2 "Sorry, didn't catch your [bold name]!"]" \
+ "Please click your browser's [bold Back] button to return to the [cgi_link Start], and fill in a [italic Username]..."
+ return
+ }
+
+ if {[catch {cgi_import Pass}]} {
+ set Pass ""
+ }
+
+ if {[catch {cgi_import Server}] || 0 == [string length $Server]} {
+ WPInfoPage "Bogus Server" \
+ "[font size=+2 "Invalid Server specified"]" \
+ "Please click your browser's [bold Back] button to return to the [cgi_link Start], and fill in a [italic Server]..."
+ return
+ }
+
+ catch {cgi_import hPx}
+
+ set defconf [file join $_wp(confdir) $_wp(defconf)]
+ set confloc ""
+
+ if {[string length $Server] < 256 && 0 == [regexp {[[:cntrl:]]} $Server]} {
+ if {[info exists _wp(hosts)] && $Server >= 0 && $Server < [llength $_wp(hosts)]} {
+ set sdata [lindex $_wp(hosts) $Server]
+
+ set env(IMAP_SERVER) "[subst [lindex $sdata 1]]/user=$User"
+
+ if {[llength $sdata] > 2 && [string length [lindex $sdata 2]]} {
+ set defconf [subst [lindex $sdata 2]]
+ } else {
+ #
+ # Validate input?
+ #
+ WPInfoPage "Internal Error" \
+ [font size=+2 "IMAP Server Mismatch"] \
+ "Please complain to the [link Admin] and visit the [cgi_link Start] later."
+ return
+ }
+ } elseif {[regexp {/user=} $Server]} {
+ set env(IMAP_SERVER) "$Server"
+ } else {
+ set env(IMAP_SERVER) "$Server/user=$User"
+ }
+
+ set confloc "\{$env(IMAP_SERVER)\}$_wp(config)"
+
+ regexp {^[^:/]*} $env(IMAP_SERVER) env(IMAP_SERVER_BASE)
+ } else {
+ WPInfoPage "Bad Server Name" [font size=+2 "Server Name too long or has bogus characters."] \
+ "Please click your browser's [bold Back] button to return to the [cgi_link Start] to try again..."
+ return
+ }
+
+ set confloc "\{$env(IMAP_SERVER)\}$_wp(config)"
+
+ if {[catch {regexp {^[^:/]*} $env(IMAP_SERVER) env(IMAP_SERVER_BASE)}]} {
+ set env(IMAP_SERVER_BASE) ""
+ }
+
+ # in less rigid settings, it might make sense to allow
+ # for random input folder names...
+ # cgi_import Folder
+
+ #
+ # Server, folder and credentials in hand, fork the client...
+ # <OL>
+ # <LI> The session is *assumed* to run over SSL.
+ # <LI> The server is *assumed* to be a black box
+ # (no, possibly hostile, user shells)
+ # <LI> We need to run the alpine process as the given user.
+ # Unless we bind to a specific server, http authentication
+ # isn't sufficient as t
+ #
+ # <LI> The session-id connects future requests to the newly
+ # created alpine engine.
+ # <LI> The auth-cookie will tell us the session-id isn't coming from
+ # j. random cracker's client
+ # </OL>
+ #
+
+ if {[catch {exec [file join $_wp(bin) launch.tcl]} _wp(sessid)]} {
+ WPInfoPage "Internal Error" [font size=+2 $_wp(sessid)] \
+ "Please complain to the [link Admin] and visit the [cgi_link Start] later."
+ return
+ } else {
+ WPValidId $_wp(sessid)
+ }
+
+ if {[catch {cgi_import ssl}] || $ssl == 0} {
+ WPCmd set serverroot $_wp(plainservpath)
+ cgi_root $_wp(plainservpath)
+ }
+
+ # stash login credentials away for later
+ if {[catch {
+ WPCmd set nojs 1
+ WPCmd PESession creds 0 $confloc $User $Pass
+ } result]} {
+ WPInfoPage "Initialization Failure" [font size=+2 "Initialization Failure: $result"] \
+ "Please click your browser's [bold Back] button to return to the [cgi_link Start] to try again..."
+ catch {WPCmd exit}
+ return
+ }
+
+ set cookiepath $_wp(appdir)
+
+ # stash session open parms in alpined's interpreter
+ lappend parms User
+ lappend parms $User
+ lappend parms Server
+ lappend parms $Server
+ lappend parms confloc
+ lappend parms $confloc
+ lappend parms defconf
+ lappend parms $defconf
+ lappend parms startpage
+
+ lappend parms "$_wp(appdir)/$_wp(ui2dir)/browse/0/INBOX"
+ lappend parms prunepage
+ lappend parms ""
+
+ if {[info exists hPx]} {
+ lappend parms hPx
+ lappend parms $hPx
+ }
+
+ if {[catch {WPCmd set wp_open_parms $parms} result]} {
+ WPInfoPage "Internal Error" [font size=+2 $result] \
+ "Please complain to the [link Admin] and visit the [cgi_link Start] later."
+ return
+ }
+
+ # return a page that says we're logging in the user
+ # have that page return to opening the session...
+
+ catch {WPCmd set wp_ver_dir $cookiepath}
+
+ set sessid "$_wp(sessid)@[info hostname]"
+
+ cgi_http_head {
+ WPExportCookie sessid $sessid $cookiepath
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ cgi_http_equiv Refresh "0; url=$_wp(serverpath)/session/logon.tcl?sessid=$sessid"
+ }
+
+ cgi_body {
+ cgi_table height="20%" {
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts [cgi_nbspace]
+ }
+ }
+ }
+
+ cgi_center {
+ cgi_table border=0 width=500 cellpadding=3 {
+ cgi_table_row {
+ cgi_table_data align=center rowspan=2 {
+ cgi_put [cgi_imglink logo]
+ }
+
+ cgi_table_data rowspan=2 {
+ cgi_put [cgi_img [WPimg dot2] border=0 width=18]
+ }
+
+ cgi_table_data {
+ cgi_puts [cgi_font size=+2 "Logging into $_wp(appname)"]
+ }
+ }
+
+ cgi_table_row {
+ cgi_table_data {
+ cgi_puts "Please be patient! Depending on Inbox size, server load and other factors this may take a moment [cgi_img [WPimg dotblink]]"
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/session/logon.tcl b/web/cgi/session/logon.tcl
new file mode 100755
index 00000000..2d675cf1
--- /dev/null
+++ b/web/cgi/session/logon.tcl
@@ -0,0 +1,169 @@
+#!./tclsh
+# $Id: logon.tcl 1142 2008-08-13 17:22:21Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# logon.tcl
+#
+# Purpose: CGI script to authenticate user based on provided
+# credentials and launch them into the mailbox index
+
+# and any global config
+source ./alpine.tcl
+
+# don't use WPEval since it'll mask open's credential failure case
+cgi_eval {
+
+ if {$_wp(debug)} {
+ cgi_debug -on
+ }
+
+ #
+ # Import username and password from pubcookie, if possible.
+ # Otherwise get it from the form that was submitted.
+ #
+ cgi_input
+
+ if {[catch {
+ cgi_import sessid
+ WPValidId $sessid
+ } result]} {
+ WPInfoPage "Web Alpine Error" [font size=+2 "$result"] \
+ "Please complain to the [cgi_link Admin] and visit the [cgi_link Start] later."
+ return
+ }
+
+ if {[catch {WPCmd set wp_open_parms} parms]} {
+ WPInfoPage "Internal Error" [font size=+2 $parms] \
+ "Please complain to the [link Admin] and visit the [cgi_link Start] later."
+ } else {
+ catch {WPCmd unset wp_open_parms}
+
+ foreach {p v} $parms {
+ set $p $v
+ }
+
+ if {[catch {WPCmd PESession open $User $confloc $defconf} answer]} {
+ if {0 == [string length $answer] || 0 == [string compare BADPASSWD [lindex $answer 0]]} {
+ set answer "Unknown Username or Incorrect Password"
+ }
+
+ set alerts {}
+ if {[catch {WPCmd PEInfo statmsgs} statmsgs] == 0} {
+ # display any IMAP alerts
+ foreach m $statmsgs {
+ if {[regexp {^Alert received.*\[ALERT\] (.*)$} $m dummy a]} {
+ if {[lsearch -exact $alerts $a] < 0} {
+ lappend alerts $a
+ }
+ }
+ }
+ }
+
+ WPInfoPage "Login Failure" [font size=+2 $answer] \
+ "Please click your browser's [bold Back] button to return to the [cgi_link Start] to try again..." \
+ {} [join $alerts "<br>"]
+
+ # unlaunch the thing
+ catch {WPCmd PESession close}
+ catch {WPCmd exit}
+ return
+ }
+
+ # determine suitable number of index lines for the indicated display size
+ # based on:
+ #
+ # 1. a header length of 72 pixels
+ # 2. a TD font-size plus padding of 24 points
+ #
+
+ set indexheight [WPCmd PEInfo indexheight]
+ if {[string length $indexheight] == 0} { set indexheight $_wp(indexheight)}
+ if {[info exists hPx] && [regexp {^[0-9]+$} $hPx]} {
+ # "66" comes from _wp(titlethick) + _wp(titlesep) + ((index tables cellpaddings * 2) = 8) + some fudge
+ set indexlines [expr (($hPx - 66) / $indexheight) - 1]
+ }
+
+ if {[info exists indexlines] == 0 || $indexlines <= 0} {
+ set indexlines [WPCmd PEInfo indexlines]
+ }
+
+ if {$indexlines <= 0} {
+ set indexlines $_wp(indexlines)
+ }
+
+ # start with the message indicated by the
+ # 'incoming-startup-rule' in the current index
+ set firstmsg 1
+ if {![catch {WPCmd PEMailbox firstinteresting} firstint] && $firstint > 0} {
+ set messagecount [WPCmd PEMailbox messagecount]
+ for {set i 1} {$i < $messagecount} {incr i $indexlines} {
+ if {$i >= $firstint} {
+ break
+ }
+
+ set firstmsg $i
+ }
+
+ # show whole last page
+ if {$firstmsg + $indexlines > $messagecount} {
+ if {[set n [expr ($messagecount + 1) - $indexlines]] > 0} {
+ set firstmsg $n
+ } else {
+ set firstmsg 1
+ }
+ }
+ }
+
+ if {[catch {WPCmd PEInfo sort} defsort]} {
+ set defsort {Date 0}
+ }
+
+ # set these in alpined's interp so they're fished out by WPImport
+ if {[catch {
+ WPCmd set sort [lindex $defsort 0]
+ WPCmd set rev [lindex $defsort 1]
+ WPCmd set ppg $indexlines
+ WPCmd set width $_wp(width)
+ WPCmd set serverid $Server} result]} {
+ WPInfoPage "Initialization Failure" [font size=+2 $result] \
+ "Please click your browser's [bold Back] button to return to the [cgi_link Start] to try again..."
+ catch {WPCmd PESession close}
+ catch {WPCmd exit}
+ return
+ }
+
+ if {[catch {WPCmd PEMailbox uid $firstmsg} exp]} {
+ set exp 1
+ }
+
+ WPCmd set top $exp
+
+ if {[catch {WPCmd set serverroot} serverroot] == 0} {
+ cgi_root $serverroot
+ }
+
+ set startpage "[cgi_root]/${startpage}?sessid=$sessid"
+
+ if {[string length $prunepage] && [WPCmd PEInfo prunecheck] == 1} {
+ set startpage "[cgi_root]/${prunepage}cid=[WPCmd PEInfo key]&sessid=${sessid}&start=[WPPercentQuote ${startpage}]"
+ }
+
+ cgi_http_head {
+ if {[info exists env(REMOTE_USER)]} {
+ # redirect thru intermediate so session id and secured user name can get bound in uidampper
+ cgi_redirect $_wp(serverpath)/session/startup.tcl?sessid=${sessid}&page=[WPPercentQuote $startpage]
+ } else {
+ cgi_redirect $startpage
+ }
+ }
+ }
+}
diff --git a/web/cgi/session/logout.tcl b/web/cgi/session/logout.tcl
new file mode 100755
index 00000000..698e3558
--- /dev/null
+++ b/web/cgi/session/logout.tcl
@@ -0,0 +1,67 @@
+#!./tclsh
+# $Id: logout.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# Imported args
+set logout_vars {
+ {serverid {} 0}
+ {expinbox {} 0}
+ {expcurrent {} 0}
+ {cid "Missing Command ID"}
+}
+
+# and any global config
+source ./alpine.tcl
+
+WPEval $logout_vars {
+
+ if {$cid != [WPCmd PEInfo key]} {
+ error [list _action Logout "Invalid Operation ID" "Please close this window."]
+ }
+
+ if {$expinbox && [catch {WPCmd PEMailbox expunge inbox} result]} {
+ set logouterr $result
+ }
+
+ if {$expcurrent && [catch {WPCmd PEMailbox expunge current} result]} {
+ if {[info exists logouterr] == 0} {
+ set logouterr $result
+ }
+ }
+
+ if {[catch {WPCmd PESession close} result]} {
+ if {[info exists logouterr] == 0} {
+ set logouterr $result
+ }
+ }
+
+ if {[catch {WPCmd set wp_ver_dir} verdir]} {
+ set verdir $_wp(appdir)
+ }
+
+ catch {WPCmd exit}
+
+ cgi_http_head {
+ set parms "?verdir=${verdir}"
+
+ if {[regexp {^[0-9]+$} $serverid]} {
+ append parms "&serverid=$serverid"
+ }
+
+ if {[info exists logouterr]} {
+ append parms "&logerr=[WPPercentQuote $logouterr]"
+ }
+
+ cgi_redirect $_wp(serverpath)/$_wp(appdir)/farewell.tcl${parms}
+ }
+}
+
diff --git a/web/cgi/session/logout/alpine.tcl b/web/cgi/session/logout/alpine.tcl
new file mode 120000
index 00000000..5ad8d42f
--- /dev/null
+++ b/web/cgi/session/logout/alpine.tcl
@@ -0,0 +1 @@
+../alpine.tcl \ No newline at end of file
diff --git a/web/cgi/session/logout/logout.tcl b/web/cgi/session/logout/logout.tcl
new file mode 100755
index 00000000..39587e4e
--- /dev/null
+++ b/web/cgi/session/logout/logout.tcl
@@ -0,0 +1,51 @@
+#!./tclsh
+
+
+#
+# and any global config
+#
+
+source ./alpine.tcl
+
+cgi_eval {
+
+ cgi_input
+
+ if {[catch {cgi_import serverid}]} {
+ set serverid 0
+ }
+
+ catch {cgi_import logerr}
+
+ cgi_http_head {
+ WPStdHttpHdrs
+
+ # clear cookies
+ cgi_cookie_set sessid=0 expires=now
+ }
+
+ if {[info exists env(REMOTE_USER)]} {
+ set log_text [font class=notice "Protect your privacy![cgi_nl]When you finish, [cgi_url "completely exit your Web browser" http://www.washington.edu/computing/web/logout.html class=notice]."]
+ append log_text "[cgi_nl][cgi_nl]Or you may want to:"
+ append log_text "<center><ul>"
+ if {[catch {cgi_import ppg}]} {
+ set perpage ""
+ } else {
+ set perpage "&ppg=$ppg"
+ }
+
+ append log_text "<li>[cgi_url "restart Web Alpine" "http://alpine.washington.edu"]"
+ append log_text "<li>[cgi_url "go to MyUW" "http://myuw.washington.edu"]"
+ append log_text "</ul></center>"
+ set log_url ""
+ } else {
+ set log_text "Please visit the [cgi_link Start] for a new session."
+ set log_url $_wp(serverpath)/
+ }
+
+ if {[info exists logerr] && [string length $logerr]} {
+ set log_text "[cgi_bold "Please Note"]: A problem, \"$logerr\", occurred while ending your session.<p>${log_text}"
+ }
+
+ WPInfoPage "Logged Out" "[font size=+2 face=Helvetica "Thank you for using Alpine"]" $log_text $log_url
+}
diff --git a/web/cgi/session/logout/tclsh b/web/cgi/session/logout/tclsh
new file mode 120000
index 00000000..385fc6c6
--- /dev/null
+++ b/web/cgi/session/logout/tclsh
@@ -0,0 +1 @@
+../tclsh \ No newline at end of file
diff --git a/web/cgi/session/monitor.tcl b/web/cgi/session/monitor.tcl
new file mode 100755
index 00000000..70edf61f
--- /dev/null
+++ b/web/cgi/session/monitor.tcl
@@ -0,0 +1,282 @@
+#!./tclsh
+# $Id: monitor.tcl 1074 2008-06-04 00:08:43Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# monitor.tcl
+
+# read config
+source ./alpine.tcl
+
+proc nicetime {timeoutput} {
+ if {[regexp {^[0-9]+ } $timeoutput msec]} {
+ return "[format {%d.%06d} [expr {$msec / 1000000}] [expr {$msec % 1000000}]] seconds"
+ } else {
+ return $timeoutput
+ }
+}
+
+# take process snapshot
+#set cmd "/bin/ps -lC alpined --sort=cutime"
+set cmd "/bin/ps -auxww --sort=cutime"
+if {[catch "exec $cmd" result]} {
+ set prohdr "ps error: $result"
+ set proclist {}
+} else {
+ set r [split $result "\n"]
+ set prochdr [lindex $r 0]
+ set proclist [lrange $r 1 end]
+}
+
+cgi_eval {
+ cgi_html {
+ cgi_head {
+ cgi_title "Web Alpine Monitor"
+ cgi_puts "<style type='text/css'>"
+ cgi_puts ".monsec { text-decoration: underline ; margin: 4}"
+ cgi_puts "</style>"
+ }
+
+ cgi_body {
+ cgi_h2 "WebPine Status // [info hostname] // [clock format [clock seconds]]"
+
+ ##
+ ## system performance monitor
+ ##n
+ cgi_preformatted {
+ # simple server load
+ set cmd "/usr/ucb/uptime"
+ if {[catch "exec $cmd" result]} {
+ cgi_puts "uptime unavailable: $result"
+ } else {
+ cgi_puts [cgi_span class=monsec "Server uptime"]
+ foreach l [split $result "\n"] {
+ cgi_puts " $l"
+ }
+ }
+
+ cgi_br
+
+ # list alpined adapters
+ foreach l $proclist {
+ if {[regexp $_wp(servlet) $l] || [regexp $_wp(pc_servlet) $l]} {
+ lappend adapters $l
+ }
+ }
+
+ cgi_puts [cgi_span class=monsec "WebPine Adapters ([llength $adapters])"]
+ cgi_puts " $prochdr"
+ foreach l $adapters {
+ cgi_puts " $l"
+ }
+
+ cgi_br
+
+ # tmp disc usage
+ cgi_puts [cgi_span class=monsec "Temp Directory Usage ($_wp(tmpdir))"]
+ set cmd "/bin/df $_wp(tmpdir)"
+ if {[catch "exec $cmd" result]} {
+ cgi_puts "usage unavailable: $result"
+ } else {
+ foreach l [split $result "\n"] {
+ cgi_puts " $l"
+ }
+ }
+
+ cgi_br
+
+ # detach staging usage
+ cgi_puts [cgi_span class=monsec "Detach Staging Usage ($_wp(tmpdir))"]
+ set cmd "/bin/df $_wp(detachpath)"
+ if {[catch "exec $cmd" result]} {
+ cgi_puts "usage unavailable: $result"
+ } else {
+ foreach l [split $result "\n"] {
+ cgi_puts " $l"
+ }
+ }
+
+ if {[info exists report_env]} {
+ cgi_br
+
+ cgi_puts [cgi_span class=monsec "Environment:"]
+
+ set cgiv {
+ SERVER_SOFTWARE
+ SERVER_NAME
+ GATEWAY_INTERFACE
+ SERVER_PROTOCOL
+ SERVER_PORT
+ REQUEST_METHOD
+ PATH_INFO
+ PATH_TRANSLATED
+ SCRIPT_NAME
+ QUERY_STRING
+ REMOTE_HOST
+ REMOTE_ADDR
+ AUTH_TYPE
+ REMOTE_USER
+ REMOTE_IDENT
+ CONTENT_TYPE
+ CONTENT_LENGTH
+ HTTP_ACCEPT
+ HTTP_USER_AGENT
+ }
+ foreach v $cgiv {
+ if {[info exists env($v)]} {
+ cgi_puts " $v: $env($v)"
+ }
+ }
+ }
+
+
+ ##
+ ## session specific feedback
+ ##
+ if {[info exists _wp(monitors)]
+ && [info exists env(REMOTE_USER)]
+ && [lsearch -exact $_wp(monitors) $env(REMOTE_USER)] >= 0} {
+
+ cgi_br
+
+ cgi_puts [cgi_span class=monsec "Kerberos ticket cache info"]
+ foreach l [glob "[file join $_wp(tmpdir) krb]*"] {
+ set file [file join $_wp(tmpdir) $l]
+ cgi_put " [exec /bin/ls -l $file]"
+ if {[catch {expr {[clock seconds] - [file mtime $file]}} d]} {
+ } else {
+ cgi_puts " ([expr {$d / 3600}] hours, [expr {($d % 3600) / 60}] minutes old)"
+ }
+ }
+
+ cgi_br
+
+ cgi_puts [cgi_span class=monsec "uid_mapper Process"]
+ # Condition of uid_mapper
+ cgi_puts " $prochdr"
+ foreach l $proclist {
+ if {[regexp uidmapper $l]} {
+ lappend umlist $l
+ }
+ }
+
+ if {[info exists umlist]} {
+ foreach l $umlist {
+ cgi_puts " $l"
+ }
+ } else {
+ cgi_puts " HELP!!! NO UIDMAPPER RUNNING!!!"
+ }
+
+ cgi_br
+
+ if {[info exists _wp(hosts)] && [llength $_wp(hosts)]} {
+ cgi_puts [cgi_span class=monsec "Session Performance (netid: $env(REMOTE_USER))"]
+
+ set sdata [lindex $_wp(hosts) 0]
+ set User $env(REMOTE_USER)
+ set env(IMAP_SERVER) "[subst [lindex $sdata 1]]/user=$env(REMOTE_USER)"
+
+ if {[llength $sdata] > 2 && [string length [lindex $sdata 2]]} {
+ set defconf [subst [lindex $sdata 2]]
+ set confloc "\{$env(IMAP_SERVER)\}$_wp(config)"
+ cgi_puts " User Config: $confloc"
+
+ # launch session
+ cgi_put " alpined Launch: "
+ set ct [time {
+ if {[catch {exec [file join $_wp(bin) launch.tcl]} _wp(sessid)]} {
+ set err "FAILURE: $_wp(sessid)"
+ } else {
+ WPValidId $_wp(sessid)
+ }
+ }]
+
+ if {[info exists err]} {
+ cgi_puts $err
+ } else {
+ cgi_puts [nicetime $ct]
+
+ cgi_put " Open Inbox: "
+ set ct [time {
+ if {[catch {WPCmd PESession open $env(REMOTE_USER) "" $confloc $defconf} answer]} {
+ set err "FAILURE: "
+ if {[info exists answer]} {
+ if {[string length $answer] == 0} {
+ append err "Unknown Username or Incorrect Password"
+ } else {
+ append err $answer
+ }
+ } else {
+ append err "Unknown reason"
+ }
+ }
+ }]
+
+ if {[info exists err]} {
+ cgi_puts $err
+ } else {
+ cgi_puts [nicetime $ct]
+
+ cgi_put " Fetch First Message: "
+
+ set ct [time {
+ if {[catch {
+ set msg [WPCmd PEMailbox first]
+ set uid [WPCmd PEMailbox uid $msg]
+ set txt [WPCmd PEMessage $uid text]
+ } txt]} {
+ set err $txt
+ }
+ }]
+
+ if {[info exists err]} {
+ cgi_puts "FAILURE: $err"
+ } else {
+ cgi_puts [nicetime $ct]
+
+ cgi_put " Fetch Last Message: "
+
+ set ct [time {
+ if {[catch {
+ set msg [WPCmd PEMailbox last]
+ set uid [WPCmd PEMailbox uid $msg]
+ set txt [WPCmd PEMessage $uid text]
+ } txt]} {
+ set err $txt
+ }
+ }]
+
+ if {[info exists err]} {
+ cgi_puts "FAILURE: $err"
+ } else {
+ cgi_puts [nicetime $ct]
+ }
+ }
+ }
+
+ set ct [time {
+ catch {WPCmd PESession close}
+ catch {WPCmd exit}
+ }]
+
+ cgi_puts " Close Session: [nicetime $ct]"
+ }
+ } else {
+ cgi_puts "Invalid host configuration"
+ }
+
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/web/cgi/session/queryauth.tcl b/web/cgi/session/queryauth.tcl
new file mode 100755
index 00000000..27e10c97
--- /dev/null
+++ b/web/cgi/session/queryauth.tcl
@@ -0,0 +1,120 @@
+#!./tclsh
+# $Id: queryauth.tcl 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# queryauth.tcl
+#
+# Purpose: CGI script to generate html form used to ask for authentication
+# credentials
+
+# input:
+set query_vars {
+ {cid "Missing Command ID"}
+ {authcol "Missing Authenticaion Collection"}
+ {authfolder "Missing Authentication Folder"}
+ {authpage "No Post Authorization Instructions"}
+ {authcancel "No Auth Cancel Instructions"}
+ {authuser "" ""}
+ {reason "" ""}
+}
+
+# Output:
+#
+# HTML/Javascript/CSS data representing the message specified
+# by the 'uid' argument
+
+
+# inherit global config
+source ./alpine.tcl
+source ../$_wp(appdir)/$_wp(ui1dir)/cmdfunc.tcl
+
+
+set query_menu {
+ {
+ {}
+ {
+ {
+ # * * * * Help * * * *
+ cgi_put "Get Help"
+ }
+ }
+ }
+}
+
+
+WPEval $query_vars {
+
+ if {$cid != [WPCmd PEInfo key]} {
+ error [list _action open "Invalid Operation ID" "Click Back button to try again."]
+ }
+
+ cgi_http_head {
+ WPStdHttpHdrs
+ }
+
+ cgi_html {
+ cgi_head {
+ WPStdHtmlHdr "Authentication Credentials"
+ WPStyleSheets
+ }
+
+ if {[string length $authuser]} {
+ set onload "onLoad=document.auth.pass.focus()"
+ } else {
+ set onload "onLoad=document.auth.user.focus()"
+ }
+
+ cgi_body BGCOLOR="$_wp(bordercolor)" $onload {
+ cgi_form $_wp(serverpath)/session/setauth.tcl method=post enctype=multipart/form-data name=auth target=_top {
+ cgi_text "sessid=$sessid" type=hidden notab
+ cgi_text "cid=$cid" type=hidden notab
+ cgi_text "authcol=$authcol" type=hidden notab
+ cgi_text "authfolder=$authfolder" type=hidden notab
+ cgi_text "authpage=$authpage" type=hidden notab
+ cgi_text "authcancel=$authcancel" type=hidden notab
+
+ cgi_table border=0 cellspacing=0 cellpadding=2 width="100%" height="100%" {
+ cgi_table_row {
+ eval {
+ cgi_table_data $_wp(menuargs) {
+ WPTFCommandMenu query_menu {}
+ }
+ }
+
+ cgi_table_data valign=top class=dialog {
+ cgi_division align=center class=dialog "style=\"padding:30 12%\"" {
+ if {[info exists reason] && [string compare BADPASSWD [string range $reason 0 8]]} {
+ cgi_puts $reason
+ } else {
+ cgi_puts "Login Required"
+ }
+ }
+
+ cgi_center {
+ cgi_puts [cgi_font size=+1 class=dialog "Username: "]
+ cgi_text user=$authuser maxlength=30 size=25%
+ cgi_br
+ cgi_br
+ cgi_puts [cgi_font size=+1 class=dialog "Password: "]
+ cgi_text pass= type=password maxlength=30 size=25%
+ cgi_br
+ cgi_br
+ cgi_submit_button auths=Login
+ cgi_submit_button cancel=Cancel
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/web/cgi/session/setauth.tcl b/web/cgi/session/setauth.tcl
new file mode 100755
index 00000000..c2da7a6b
--- /dev/null
+++ b/web/cgi/session/setauth.tcl
@@ -0,0 +1,68 @@
+#!./tclsh
+# $Id: setauth.tcl 764 2007-10-23 23:44:49Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# setauth.tcl
+#
+# Purpose: CGI script to generate html form used to ask for authentication
+# credentials
+
+# Input:
+set auth_vars {
+ {cid "Missing Command ID"}
+ {authcol "No Authorization Collection"}
+ {authfolder "No Authorization Folder"}
+ {authpage "No Post Authorization Instructions"}
+ {authcancel "No Auth Cancel Instructions"}
+ {auths "" 0}
+ {user "" 0}
+ {pass "" 0}
+ {cancel "" 0}
+}
+
+# Output:
+#
+# Redirect to specified post-authentication page
+
+# inherit global config
+source ./alpine.tcl
+
+
+WPEval $auth_vars {
+
+ if {$cid != [WPCmd PEInfo key]} {
+ error [list _action open "Invalid Operation ID" "Click Back button to try again."]
+ }
+
+ # if NOT cancelled
+ if {[string compare $auths "Login"] == 0
+ && [string length $user]
+ && [catch {WPCmd PESession creds $authcol $authfolder $user $pass}] == 0} {
+ set redirect $authpage
+ } else {
+ set redirect $authcancel
+ }
+
+ cgi_http_head {
+ # redirect to the place we stuffed the export info. use the ip address
+ # to foil spilling any session cookies or the like
+
+ if {[info exists env(SERVER_PROTOCOL)] && [regexp {[Hh][Tt][Tt][PP]/([0-9]+)\.([0-9]+)} $env(SERVER_PROTOCOL) m vmaj vmin] && $vmaj >= 1 && $vmin >= 1} {
+ cgi_puts "Status: 303 Temporary Redirect"
+ } else {
+ cgi_puts "Status: 302 Redirected"
+ }
+
+ cgi_puts "URI: $redirect"
+ cgi_puts "Location: $redirect"
+ }
+}
diff --git a/web/cgi/session/setauth2.tcl b/web/cgi/session/setauth2.tcl
new file mode 100755
index 00000000..ccb4ce17
--- /dev/null
+++ b/web/cgi/session/setauth2.tcl
@@ -0,0 +1,58 @@
+#!./tclsh
+# $Id: setauth2.tcl 391 2007-01-25 03:53:59Z mikes@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# setauth2.tcl
+#
+# Purpose: CGI script to accept user authorization
+# credentials via xmlHttpRequest
+
+# Input:
+set auth_vars {
+ {c "No Authorization Collection"}
+ {f "No Authorization Folder"}
+ {auths "" 0}
+ {user "" 0}
+ {pass "" 0}
+ {cancel "" 0}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid}]} {
+ return
+}
+
+# grok parameters
+foreach item $auth_vars {
+ if {[catch {eval WPImport $item} errstr]} {
+ WPInfoPage "Web Alpine Error" [font size=+2 $errstr] "Please close this window."
+ return
+ }
+}
+
+cgi_puts "Content-type: text/html; charset=\"UTF-8\"\n"
+set answer "Problem setting authorization credentials"
+
+
+if {[string compare $auths "Login"] == 0
+ && [string length $user]
+ && [catch {WPCmd PESession creds $c $f $user $pass} answer] == 0} {
+ cgi_puts "$answer"
+} else {
+ cgi_puts "Cannot accept login: $answer"
+}
diff --git a/web/cgi/session/setpassphrase.tcl b/web/cgi/session/setpassphrase.tcl
new file mode 100755
index 00000000..b4d25e26
--- /dev/null
+++ b/web/cgi/session/setpassphrase.tcl
@@ -0,0 +1,52 @@
+#!./tclsh
+# $Id: setpassphrase.tcl 1142 2008-08-13 17:22:21Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2008 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# setpassphrase.tcl
+#
+# Purpose: CGI script to accept user passphrase
+# via xmlHttpRequest
+
+# Input:
+set auth_vars {
+ {auths "" 0}
+ {pass "" 0}
+ {cancel "" 0}
+}
+
+# Output:
+#
+
+# inherit global config
+source ./alpine.tcl
+
+# Import data validate it and get session id
+if {[catch {WPGetInputAndID sessid}]} {
+ return
+}
+
+# grok parameters
+foreach item $auth_vars {
+ if {[catch {eval WPImport $item} errstr]} {
+ WPInfoPage "Web Alpine Error" [font size=+2 $errstr] "Please close this window."
+ return
+ }
+}
+
+cgi_puts "Content-type: text/html; charset=\"UTF-8\"\n"
+set answer "Problem setting passphrase"
+
+if {[string compare $auths "Smime"] != 0
+ || [string length $pass] == 0
+ || [catch {WPCmd PESession setpassphrase $pass} answer]} {
+ cgi_puts "Cannot accept passphrase: $answer"
+}
diff --git a/web/cgi/session/startup.tcl b/web/cgi/session/startup.tcl
new file mode 100755
index 00000000..9e3feec8
--- /dev/null
+++ b/web/cgi/session/startup.tcl
@@ -0,0 +1,33 @@
+#!./tclsh
+# $Id: startup.tcl 764 2007-10-23 23:44:49Z hubert@u.washington.edu $
+# ========================================================================
+# Copyright 2006 University of Washington
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# ========================================================================
+
+# read config
+source ./alpine.tcl
+
+# Input: page
+
+# Output: redirection to given page
+
+cgi_eval {
+ cgi_input
+
+ if {[catch {cgi_import page}]} {
+ WPInfoPage "Bogus Page Request" \
+ "[font size=+2 "Invalid Page Request!"]" \
+ "Please click your browser's [bold Back] button to return to the [cgi_link Start]"
+ } else {
+ cgi_http_head {
+ cgi_redirect $page
+ }
+ }
+} \ No newline at end of file
diff --git a/web/cgi/session/tclsh b/web/cgi/session/tclsh
new file mode 120000
index 00000000..385fc6c6
--- /dev/null
+++ b/web/cgi/session/tclsh
@@ -0,0 +1 @@
+../tclsh \ No newline at end of file
diff --git a/web/cgi/sounds/ding.wav b/web/cgi/sounds/ding.wav
new file mode 100644
index 00000000..5741f232
--- /dev/null
+++ b/web/cgi/sounds/ding.wav
Binary files differ
diff --git a/web/cgi/sounds/mail_msg.wav b/web/cgi/sounds/mail_msg.wav
new file mode 100644
index 00000000..d6370e0a
--- /dev/null
+++ b/web/cgi/sounds/mail_msg.wav
Binary files differ
diff --git a/web/cgi/tclsh b/web/cgi/tclsh
new file mode 120000
index 00000000..922d6309
--- /dev/null
+++ b/web/cgi/tclsh
@@ -0,0 +1 @@
+../bin/tclsh \ No newline at end of file