From 03adf300afc647f68e20030ce012c167e8e2944d Mon Sep 17 00:00:00 2001 From: "terry%netscape.com" Date: Mon, 27 Jul 1998 20:53:06 +0000 Subject: [PATCH] Deal better with % in the middle of usernames. --- webtools/bonsai/globals.tcl | 13 ++++++++++++- webtools/bonsai/toplevel.cgi | 31 +++++++++++++++---------------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/webtools/bonsai/globals.tcl b/webtools/bonsai/globals.tcl index 4ce6d6a93fa..922ac746fff 100755 --- a/webtools/bonsai/globals.tcl +++ b/webtools/bonsai/globals.tcl @@ -398,7 +398,7 @@ proc WriteCheckins {} { set fid [open $filename "w"] chmod 0666 $filename foreach i [lsort [array names person]] { - puts $fid $i + puts $fid [EmailFromUsername $i] } puts $fid "bonsai-hookinterest@glacier" puts $fid "mcom.dev.client.build.busted" @@ -693,3 +693,14 @@ proc MungeTagName {name} { } return $result } + + +# Given a person's username, get back their full email address. +# ### This needs to be paramaterized... +proc EmailFromUsername {name} { + regsub {%} $name {@} name + if {[string first "@" $name] < 0} { + append name "@netscape.com" + } + return $name +} diff --git a/webtools/bonsai/toplevel.cgi b/webtools/bonsai/toplevel.cgi index 5e8a318a1a9..8a20d09dd1b 100755 --- a/webtools/bonsai/toplevel.cgi +++ b/webtools/bonsai/toplevel.cgi @@ -122,9 +122,11 @@ puts "Free-for-all whiteboard:< foreach c $checkinlist { upvar #0 $c info - lappend people($info(person)) $c + set addr [EmailFromUsername $info(person)] + set username($addr) $info(person) + lappend people($addr) $c if {!$info(treeopen)} { - lappend closedcheckin($info(person)) $c + lappend closedcheckin($addr) $c } } @@ -135,8 +137,9 @@ proc GetInfoForPeople {peoplelist} { return } set query "(| " + set isempty 1 foreach p $peoplelist { - append query "(mail=$p@netscape.com) " + append query "(mail=$p) " set fullname($p) "" set curcontact($p) "" } @@ -153,7 +156,7 @@ proc GetInfoForPeople {peoplelist} { } set doingcontactinfo 0 } - if {[regexp -- {^mail: (.*)@} $line foo n]} { + if {[regexp -- {^mail: (.*@.*)$} $line foo n]} { set curperson $n } elseif {[regexp -- {^cn: (.*)$} $line foo n]} { set fullname($curperson) $n @@ -199,12 +202,15 @@ if {[info exists people]} { set extra "" } + set uname $username($p) + set namepart $p + regsub {@.*$} $namepart {} namepart puts " $fullname($p) - -$p -[llength $people($p)] + +$uname +[llength $people($p)] [Pluralize change [llength $people($p)]]$extra" puts " $curcontact($p) @@ -215,16 +221,9 @@ $p puts "[llength $checkinlist] checkins." if {[cequal $treeid default]} { - set mailaddr "bonsai-hook" + set mailaddr "bonsai-hook@warp" } else { - set f [open data/$treeid/hooklist r] - set fileEOF [gets $f hookentry] - set theHookList {} - while { $fileEOF != -1 } { - set theHookList [concat $theHookList $hookentry] - set fileEOF [gets $f hookentry] - } - set mailaddr "$theHookList" + set mailaddr [join $peoplelist ","] } puts "

" puts "Show all checkins.
"