~ubuntu-branches/debian/lenny/alpine/lenny

« back to all changes in this revision

Viewing changes to web/config/alpine.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2008-03-19 12:03:02 UTC
  • mfrom: (1.2.1 upstream) (2.1.6 hardy)
  • Revision ID: james.westby@ubuntu.com-20080319120302-yam7nzcvc96y5r1n
Tags: 1.10+dfsg-3
Er, re-re-add patch to configure.ac for arm gnueabi (Closes: #471519)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Web Alpine Config options
2
2
# $Id$
3
3
# ========================================================================
4
 
# Copyright 2006 University of Washington
 
4
# Copyright 2006-2008 University of Washington
5
5
#
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
# ========================================================================
13
13
 
14
14
set _wp(appname)        Alpine
15
 
set _wp(version)        0.80
 
15
set _wp(version)        1.00
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
19
19
 
 
20
# List of userid's allowed to request the monitor script output
20
21
set _wp(monitors)       {}
21
22
 
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
 
26
 
 
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
23
30
 
24
31
set _wp(tmpdir)         /tmp
25
32
 
26
 
# file system path to CGI application files on this server
27
 
set _wp(cgiroot)        [file join $_wp(fileroot) cgi]
28
 
 
29
 
# any subdirectories you add between $_wp(cgiroot) (typically
30
 
# the same as httpd's DocumentRoot) and web alpine's CGI script
31
 
# directory tree
32
 
set _wp(cgidir)         {}
33
 
 
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]
38
35
 
39
 
# place for web alpine application scripts
 
36
# place for CGI scripts that execute the interface
40
37
set _wp(appdir)         alpine
41
38
 
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]
61
58
 
62
 
set _wp(imagepath)      [file join / $_wp(cgidir) images]
 
59
set _wp(imagepath)      [file join / $_wp(urlprefix) images]
63
60
 
64
61
set _wp(buttonpath)     [file join $_wp(imagepath) buttons silver]
65
62
 
68
65
set _wp(servername)     [info hostname]
69
66
 
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)]
73
70
 
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)]
 
72
set _wp(plainport)      {}
 
73
set _wp(plainservpath)  http://[file join [join [eval list $_wp(servername) $_wp(plainport)] :] $_wp(urlprefix)]
77
74
 
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"
80
77
 
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"
155
153
 
156
 
 
157
154
#
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
166
163
    }
167
 
    {
168
 
      NDC-MS
169
 
      ndcms.cac.washington.edu/ssl
170
 
      $_wp(confdir)/conf.ndcms
171
 
    }
172
164
}
173
165
 
174
 
 
175
 
#
176
 
# Everbody inherits the cgi package
177
 
#
 
166
# Everybody inherits the cgi, comm packages
178
167
lappend auto_path $_wp(lib)
179
168
 
180
169
package require cgi
356
345
            cgi_debug -on
357
346
        }
358
347
 
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."
362
 
          return
363
 
        }
364
 
 
365
348
        # Session id?
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."]
369
 
          } else {
370
 
            WPInfoPage "Web Alpine Error" [font size=+2 $errstr] "Please close this window."
371
 
          }
372
 
 
 
349
        if {[catch {WPGetInputAndID sessid}]} {
373
350
          return
374
 
        } else {
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."
380
 
              } else {
381
 
                cgi_http_head {
382
 
                  cgi_redirect [lindex $result 1]
383
 
                }
384
 
              }
385
 
 
386
 
              return
387
 
            } elseif {$_wp(sessid) == 0} {
388
 
              WPInactivePage
389
 
              return
390
 
            }
391
 
 
392
 
            if {[catch {WPCmd set serverroot} serverroot] == 0} {
393
 
              cgi_root $serverroot
394
 
            }
395
351
        }
396
352
 
397
353
        foreach item $_wp(vars) {
474
430
    }
475
431
}
476
432
 
 
433
proc WPGetInputAndID {_sessid} {
 
434
  global _wp
 
435
  upvar $_sessid sessid
 
436
 
 
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"
 
441
  }
 
442
 
 
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."]
 
446
    } else {
 
447
      WPInfoPage "Web Alpine Error" [font size=+2 $errstr] "Please close this window."
 
448
    }
 
449
 
 
450
    error "Session ID Failure"
 
451
  } else {
 
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."
 
457
      } else {
 
458
        cgi_http_head {
 
459
          cgi_redirect [lindex $result 1]
 
460
        }
 
461
      }
 
462
 
 
463
      error "Unrecoverable Error"
 
464
    } elseif {$_wp(sessid) == 0} {
 
465
      WPInactivePage
 
466
      error "Inactive Session"
 
467
    }
 
468
 
 
469
    if {[catch {WPCmd set serverroot} serverroot] == 0} {
 
470
      cgi_root $serverroot
 
471
    }
 
472
  }
 
473
 
 
474
}
 
475
 
477
476
proc WPCmd {args} {
478
477
  global _wp
479
478
 
531
530
proc WPExportCookie {name value {scope ""}} {
532
531
    global _wp
533
532
 
534
 
    cgi_cookie_set $name=$value "path=[file join / $_wp(cgidir) $scope]"
 
533
    cgi_cookie_set $name=$value "path=[file join / $_wp(urlprefix) $scope]"
535
534
}
536
535
 
537
536
 
562
561
    cgi_html {
563
562
      cgi_head {
564
563
        cgi_title $title
565
 
        cgi_stylesheet [file join / $_wp(cgidir) $_wp(pubdir) standard.css]
 
564
        cgi_stylesheet [file join / $_wp(urlprefix) $_wp(pubdir) standard.css]
566
565
      }
567
566
 
568
567
      cgi_body {
699
698
proc WPStyleSheets {{ih 0}} {
700
699
  global _wp
701
700
 
702
 
  cgi_stylesheet [file join / $_wp(cgidir) $_wp(pubdir) standard.css]
 
701
  cgi_stylesheet [file join / $_wp(urlprefix) $_wp(pubdir) standard.css]
703
702
 
704
703
  if {$ih <= 0} {
705
704
    set ih [WPIndexLineHeight]
714
713
 
715
714
    set ih [WPStyleSheets $ih]
716
715
 
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';"}
719
718
    cgi_javascript {
720
719
        cgi_puts "function getIndexHeight(){return $ih}"
832
831
        lappend newref [list $newtext "" ""]
833
832
    }
834
833
 
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 ""
840
 
        }
 
834
    foreach statmsg [WPStatusMsgs] {
 
835
      lappend newref [list $statmsg "" ""]
 
836
      WPCmd PEInfo statmsg ""
841
837
    }
842
838
 
843
839
    if {!$reload} {
847
843
    return $newref
848
844
}
849
845
 
 
846
proc WPStatusMsgs {} {
 
847
  set retmsgs ""
 
848
  set lastmsg ""
 
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."
 
854
        } else {
 
855
          lappend retmsgs $statmsg
 
856
        }
 
857
 
 
858
        set lastmsg $statmsg
 
859
      }
 
860
    }
 
861
  }
 
862
 
 
863
  return $retmsgs
 
864
}
 
865
 
850
866
proc WPStatusIcon {uid {extension gif} {statbits ""}} {
851
867
  global _wp
852
868