2
# $Id: apply.tcl 1150 2008-08-20 00:27:11Z mikes@u.washington.edu $
3
# ========================================================================
4
# Copyright 2008 University of Washington
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
10
# http://www.apache.org/licenses/LICENSE-2.0
12
# ========================================================================
16
# Purpose: CGI script generating response to xmlHttpRequest
25
# inherit global config
29
# Import data validate it and get session id
30
if {[catch {WPGetInputAndID sessid}]} {
35
foreach item $apply_args {
36
if {[catch {eval WPImport $item} errstr]} {
37
WPInfoPage "Web Alpine Error" [font size=+2 $errstr] "Please close this window."
61
cgi_puts "Content-type: text/html; charset=\"UTF-8\""
64
if {[info exists flag] && [info exists state]} {
65
if {[catch {WPCmd PEMailbox apply flag $state $flag} result]} {
66
error "Apply $state ${flag}: $result"
68
set response "$result [WPCmd PEMailbox selected] [WPCmd PEMailbox messagecount]"
72
WPCmd PEInfo statmsg "Unknown flag ($f) or state ($s)"
75
cgi_puts "failed: $result"