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

« back to all changes in this revision

Viewing changes to web/cgi/session/logout.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2007-02-17 13:17:42 UTC
  • Revision ID: james.westby@ubuntu.com-20070217131742-99x5c6cpg1pbkdhw
Tags: upstream-0.82+dfsg
ImportĀ upstreamĀ versionĀ 0.82+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!./tclsh
 
2
# $Id: logout.tcl 391 2007-01-25 03:53:59Z mikes@u.washington.edu $
 
3
# ========================================================================
 
4
# Copyright 2006 University of Washington
 
5
#
 
6
# Licensed under the Apache License, Version 2.0 (the "License");
 
7
# you may not use this file except in compliance with the License.
 
8
# You may obtain a copy of the License at
 
9
#
 
10
#     http://www.apache.org/licenses/LICENSE-2.0
 
11
#
 
12
# ========================================================================
 
13
 
 
14
# Imported args
 
15
set logout_vars {
 
16
  {serverid     {}      0}
 
17
  {expinbox     {}      0}
 
18
  {expcurrent   {}      0}
 
19
  {cid          "Missing Command ID"}
 
20
}
 
21
 
 
22
# and any global config
 
23
source ./alpine.tcl
 
24
 
 
25
WPEval $logout_vars {
 
26
  
 
27
  if {$cid != [WPCmd PEInfo key]} {
 
28
    error [list _action Logout "Invalid Operation ID" "Please close this window."]
 
29
  }
 
30
 
 
31
  if {$expinbox &&  [catch {WPCmd PEMailbox expunge inbox} result]} {
 
32
    set logouterr $result
 
33
  }
 
34
 
 
35
  if {$expcurrent &&  [catch {WPCmd PEMailbox expunge current} result]} {
 
36
    if {[info exists logouterr] == 0} {
 
37
      set logouterr $result
 
38
    }
 
39
  }
 
40
 
 
41
  if {[catch {WPCmd PESession close} result]} {
 
42
    if {[info exists logouterr] == 0} {
 
43
      set logouterr $result
 
44
    }
 
45
  }
 
46
 
 
47
  if {[catch {WPCmd set wp_ver_dir} verdir]} {
 
48
    set verdir $_wp(appdir)
 
49
  }
 
50
 
 
51
  catch {WPCmd exit}
 
52
 
 
53
  cgi_http_head {
 
54
    set parms "?verdir=${verdir}"
 
55
 
 
56
    if {[regexp {^[0-9]+$} $serverid]} {
 
57
      append parms "&serverid=$serverid"
 
58
    }
 
59
 
 
60
    if {[info exists logouterr]} {
 
61
      append parms "&logerr=[WPPercentQuote $logouterr]"
 
62
    }
 
63
 
 
64
    cgi_redirect [cgi_root]/${verdir}/farewell.tcl${parms}
 
65
  }
 
66
}
 
67