~ubuntu-branches/debian/stretch/alpine/stretch

« back to all changes in this revision

Viewing changes to web/cgi/alpine/fr_ldapquery.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2010-10-03 15:31:55 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20101003153155-2exypc96j1e8tw0p
Tags: 2.02-1
* New upstream release, based on re-alpine project
* Updated debian/copyright to reflect this fact
* re-alpine removed the non-free from the tarball, so now
  we do not repack the upstream tarball. (Yay!)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: fr_ldapquery.tcl 391 2007-01-25 03:53:59Z mikes@u.washington.edu $
2
 
# ========================================================================
3
 
# Copyright 2006 University of Washington
4
 
#
5
 
# Licensed under the Apache License, Version 2.0 (the "License");
6
 
# you may not use this file except in compliance with the License.
7
 
# You may obtain a copy of the License at
8
 
#
9
 
#     http://www.apache.org/licenses/LICENSE-2.0
10
 
#
11
 
# ========================================================================
12
 
 
13
 
#  fr_ldapquery.tcl
14
 
#
15
 
#  Purpose:  CGI script to generate frame set for LDAP server query
16
 
#            handling in webpine-lite pages.  the idea is that this
17
 
#            page specifies a frameset that loads a "header" page 
18
 
#            used to keep the servlet alive via
19
 
#            periodic reloads and a "body" page containing static/form
20
 
#            elements that can't/needn't be periodically reloaded or
21
 
#            is blocked on user input.
22
 
 
23
 
#  Input:
24
 
set frame_vars {
25
 
  {dir          "Missing Directory Index"}
26
 
  {srchstr      {}      ""}
27
 
  {field        {}      ""}
28
 
  {op           {}      ""}
29
 
  {searchtype   {}      ""}
30
 
}
31
 
 
32
 
#  Output:
33
 
#
34
 
 
35
 
## read vars
36
 
foreach item $frame_vars {
37
 
  if {[catch {cgi_import [lindex $item 0].x}]} {
38
 
    if {[catch {eval WPImport $item} errstr]} {
39
 
      error [list _action "Impart Variable" $errstr]
40
 
    }
41
 
  } else {
42
 
    set [lindex $item 0] 1
43
 
  }
44
 
}
45
 
 
46
 
 
47
 
cgi_http_head {
48
 
  WPStdHttpHdrs
49
 
}
50
 
 
51
 
cgi_html {
52
 
  cgi_head {
53
 
  }
54
 
 
55
 
  cgi_frameset "rows=$_wp(titleheight),*" resize=yes border=0 frameborder=0 framespacing=0 {
56
 
    set parms ""
57
 
 
58
 
    if {[info exists frame_vars]} {
59
 
      foreach v $frame_vars {
60
 
        if {[string length [subst $[lindex $v 0]]]} {
61
 
          if {[string length $parms]} {
62
 
            append parms "&"
63
 
          } else {
64
 
            append parms "?"
65
 
          }
66
 
 
67
 
          append parms "[lindex $v 0]=[WPPercentQuote [subst $[lindex $v 0]]]"
68
 
        }
69
 
      }
70
 
    }
71
 
 
72
 
    cgi_frame hdr=header.tcl?title=240
73
 
    cgi_frame body=ldapquery.tcl${parms}
74
 
  }
75
 
}