1
1
# Web Alpine Config options
3
3
# ========================================================================
4
# Copyright 2006 University of Washington
4
# Copyright 2006-2008 University of Washington
6
6
# Licensed under the Apache License, Version 2.0 (the "License");
7
7
# you may not use this file except in compliance with the License.
12
12
# ========================================================================
14
14
set _wp(appname) Alpine
16
16
set _wp(admin) admin@sample-domain.edu
17
17
set _wp(helpdesk) admin@sample-domain.edu
18
18
set _wp(comments) help@sample-domain.edu
20
# List of userid's allowed to request the monitor script output
20
21
set _wp(monitors) {}
22
set _wp(fileroot) /var/www/alpine
23
# directory prefix web server uses for web alpine page requests
24
# Note: set to {} if DocumentRoot set to the root of web alpine cgi scripts
25
set _wp(urlprefix) webmail
27
# file system path to CGI application files
28
# directory containing web alpine application scripts and supporting tools
29
set _wp(fileroot) /usr/local/libexec/alpine
24
31
set _wp(tmpdir) /tmp
26
# file system path to CGI application files on this server
27
set _wp(cgiroot) [file join $_wp(fileroot) cgi]
29
# any subdirectories you add between $_wp(cgiroot) (typically
30
# the same as httpd's DocumentRoot) and web alpine's CGI script
34
# filesystem root of CGI application scripts.
35
33
# NOTE: Make SURE tclsh and alpine.tcl symlinks in this directory
36
# point to their $_wp(fileroot) targets
37
set _wp(cgipath) [file join $_wp(cgiroot) $_wp(cgidir)]
34
set _wp(cgipath) [file join $_wp(fileroot) cgi]
39
# place for web alpine application scripts
36
# place for CGI scripts that execute the interface
40
37
set _wp(appdir) alpine
42
39
# place for CGI scripts not requiring session-key
59
56
# directory used temporarily to stage attatched and detached files
60
57
set _wp(detachpath) [file join $_wp(fileroot) detach]
62
set _wp(imagepath) [file join / $_wp(cgidir) images]
59
set _wp(imagepath) [file join / $_wp(urlprefix) images]
64
61
set _wp(buttonpath) [file join $_wp(imagepath) buttons silver]
68
65
set _wp(servername) [info hostname]
70
67
# MUST specify SSL/TLS connection
71
set _wp(serverport) 5131
72
set _wp(serverpath) https://[file join [join [eval list $_wp(servername) $_wp(serverport)] :] $_wp(cgidir)]
68
set _wp(serverport) {}
69
set _wp(serverpath) https://[file join [join [eval list $_wp(servername) $_wp(serverport)] :] $_wp(urlprefix)]
74
71
# MAY specify a plaintext connection (comment out if plain support undesired)
75
set _wp(plainport) 5132
76
set _wp(plainservpath) http://[file join [join [eval list $_wp(servername) $_wp(plainport)] :] $_wp(cgidir)]
73
set _wp(plainservpath) http://[file join [join [eval list $_wp(servername) $_wp(plainport)] :] $_wp(urlprefix)]
78
75
# url of faq page(s) available from initial greeting page
79
#set _wp(faq) "http://www.washington.edu/computing/faqs/webpine.html"
76
#set _wp(faq) "http://www.yourserver/faqs/alpine.html"
81
78
# url of informational page accessible from initial greeting page
82
79
set _wp(releaseblurb) "$_wp(plainservpath)/alpine/help/release.html"
112
109
set _wp(config) remote_pinerc
113
110
set _wp(motd) motd
114
111
set _wp(save_cache_max) 6
115
set _wp(fldr_cache_max) 3
112
set _wp(fldr_cache_max) 8
113
set _wp(fldr_cache_def) 3
116
114
set _wp(statushelp) 0
117
115
set _wp(imgbuttons) 0
118
116
set _wp(keybindings) 1
153
151
#set _wp(spamfolder) junk-mail
154
152
#set _wp(spamsubj) "ATTACHED SPAM"
158
155
# Nickname server bindings. If not present, prompt for the
159
156
# destination of the default pinerc location.
164
161
$User.deskmail.washington.edu/ssl
165
162
$_wp(confdir)/conf.deskmail
169
ndcms.cac.washington.edu/ssl
170
$_wp(confdir)/conf.ndcms
176
# Everbody inherits the cgi package
166
# Everybody inherits the cgi, comm packages
178
167
lappend auto_path $_wp(lib)
180
169
package require cgi
359
# Import data and validate it
360
if {[catch {cgi_input "sessid=8543949466398&"} result]} {
361
WPInfoPage "Web Alpine Error" [font size=+2 $result] "Please close this window."
366
if {[catch {WPImport sessid "Missing Session ID"} errstr]} {
367
if {[regexp {.*sessid.*no such.*} $errstr]} {
368
WPInactivePage [list "Your browser may have failed to send the necessary <i>cookie</i> information. Please verify your browser configuration has cookies enabled."]
370
WPInfoPage "Web Alpine Error" [font size=+2 $errstr] "Please close this window."
349
if {[catch {WPGetInputAndID sessid}]} {
375
# initialization here
376
if {[catch {WPValidId $sessid} result]} {
377
if {[string compare [lindex $result 0] redirect]} {
378
WPInfoPage "Web Alpine Error" [font size=+2 "$result"] \
379
"Please complain to the [cgi_link Admin] and visit the [cgi_link Start] later."
382
cgi_redirect [lindex $result 1]
387
} elseif {$_wp(sessid) == 0} {
392
if {[catch {WPCmd set serverroot} serverroot] == 0} {
397
353
foreach item $_wp(vars) {
433
proc WPGetInputAndID {_sessid} {
435
upvar $_sessid sessid
437
# Import data and validate it
438
if {[catch {cgi_input "sessid=8543949466398&"} result]} {
439
WPInfoPage "Web Alpine Error" [font size=+2 $result] "Please close this window."
440
error "Cannot get CGI Input"
443
if {[catch {WPImport sessid "Missing Session ID"} errstr]} {
444
if {[regexp {.*sessid.*no such.*} $errstr]} {
445
WPInactivePage [list "Your browser may have failed to send the necessary <i>cookie</i> information. Please verify your browser configuration has cookies enabled."]
447
WPInfoPage "Web Alpine Error" [font size=+2 $errstr] "Please close this window."
450
error "Session ID Failure"
452
# initialization here
453
if {[catch {WPValidId $sessid} result]} {
454
if {[string compare [lindex $result 0] redirect]} {
455
WPInfoPage "Web Alpine Error" [font size=+2 "$result"] \
456
"Please complain to the [cgi_link Admin] and visit the [cgi_link Start] later."
459
cgi_redirect [lindex $result 1]
463
error "Unrecoverable Error"
464
} elseif {$_wp(sessid) == 0} {
466
error "Inactive Session"
469
if {[catch {WPCmd set serverroot} serverroot] == 0} {
477
476
proc WPCmd {args} {
715
714
set ih [WPStyleSheets $ih]
717
cgi_script language="JavaScript" src="[file join / $_wp(cgidir) $_wp(pubdir) standard.js]" {}
716
cgi_script language="JavaScript" src="[file join / $_wp(urlprefix) $_wp(pubdir) standard.js]" {}
718
717
cgi_script language="JavaScript1.3" {cgi_put "js_version = '1.3';"}
720
719
cgi_puts "function getIndexHeight(){return $ih}"
832
831
lappend newref [list $newtext "" ""]
835
set statmsgs [WPCmd PEInfo statmsgs]
836
foreach statmsg $statmsgs {
837
if {[string length $statmsg] > 0} {
838
lappend newref [list $statmsg "" ""]
839
WPCmd PEInfo statmsg ""
834
foreach statmsg [WPStatusMsgs] {
835
lappend newref [list $statmsg "" ""]
836
WPCmd PEInfo statmsg ""
846
proc WPStatusMsgs {} {
849
if {[catch {WPCmd PEInfo statmsgs} statmsgs] == 0} {
850
foreach statmsg $statmsgs {
851
if {[string length $statmsg] > 0 && [string compare $statmsg $lastmsg]} {
852
if {[regexp "^Pinerc \(.+\) NOT saved$" $statmsg]} {
853
lappend retmsgs "Another Pine/WebPine session may be running. Settings cannot be saved."
855
lappend retmsgs $statmsg
850
866
proc WPStatusIcon {uid {extension gif} {statbits ""}} {