2
# $Id: getcontact.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 to handle saving new/edited contacts
26
# inherit global config
29
# Import data validate it and get session id
30
if {[catch {WPGetInputAndID sessid} result]} {
31
error "getcontact.tcl $result"
35
foreach item $contact_vars {
36
if {[catch {eval WPImport $item} result]} {
37
error "getcontact.tcl $result"
41
if {[catch {WPCmd PEAddress fullentry $book "" $index} addrinfo]} {
42
error "getcontact.tcl $addrinfo"
45
puts stdout "Content-type: text/xml; charset=\"UTF-8\"\n"
46
puts stdout {<?xml version="1.0" encoding="UTF-8"?>}
47
puts stdout "<ResultSet totalResultsAvailable=\"1\"><Result>"
48
puts stdout "<Nickname>[cgi_quote_html [lindex $addrinfo 0]]</Nickname>"
49
puts stdout "<Personal>[cgi_quote_html [lindex $addrinfo 1]]</Personal>"
50
puts stdout "<Mailbox>[cgi_quote_html [join [lindex $addrinfo 2] ", "]]</Mailbox>"
51
puts stdout "<Fcc>[cgi_quote_html [lindex $addrinfo 3]]</Fcc>"
52
puts stdout "<Note>[cgi_quote_html [lindex $addrinfo 4]]</Note>"
53
puts stdout "</Result></ResultSet>"