#!/usr/bin/perl -w # -*- perl -*- use P4CGI ; use strict ; # ################################################################# # CONFIGURATION INFORMATION # All config info should be in P4CGI.pm # ################################################################# # # P4 view a group # # ################################################################# $| = 1 ; # turn off output buffering # Get parameter my $group = P4CGI::cgi()->param("GROUP") ; unless(defined $group) { &P4CGI::bail("No group specified!") ; } ; $group = &P4CGI::htmlEncode($group) ; # Get real user names... my %userCvt ; &P4CGI::p4user2name(\%userCvt ); my %groups ; { my @groups ; &P4CGI::p4call(\@groups, "groups" ); %groups = map { ($_,1) ; } @groups ; } # Get user info my %values ; my @fields = &P4CGI::p4readform("group -o '$group'",\%values); print "", &P4CGI::start_page("View group <tt>$group</tt>", (&P4CGI::buttonCell("changeList.cgi", "List changes by group $group", "GROUP=$group", "FSPC=//...", "List changes"))) ; unless(exists $groups{$group}) { &P4CGI::signalError("No such group \"$group\"") ; } print &P4CGI::start_framedTable("Group $group"), &P4CGI::start_table("") ; my @emailUsers ; if(exists $values{"Users"}) { my @users ; foreach (split( /\s+/,$values{"Users"})) { my $fullname ; if(exists $userCvt{$_}) { $fullname = "($userCvt{$_})" ; push @emailUsers,$_ ; push @users, &P4CGI::ahref(-url => "userView.cgi", "USER=$_", "HELP=View user info", "$_ $fullname") ; } else { $fullname = "(<font color=red>No such user</font>)" ; push @users, "$_ $fullname" ; } ; } ; $values{"Users"} = join("<br>\n",@users) ; } ; if(exists $values{"Subgroups"}) { my @subgroups ; foreach (split( /\s+/,$values{"Subgroups"})) { my $sg ; if(exists $groups{$_}) { push @subgroups, &P4CGI::ahref(-url => "groupView.cgi", # "GROUP=$_", "HELP=View group info", $_) ; } else { push @subgroups, "$_ (<font color=red>No such group</font>)" ; } ; } ; $values{"Subgroups"} = join("<br>\n",@subgroups) ; } ; my $f ; foreach $f (@fields) { print &P4CGI::table_row({-class => "Prompt", -text => "$f"}, $values{$f}) ; } ; print &P4CGI::end_table(), &P4CGI::end_framedTable() ; if(@emailUsers > 0) { my @email ; foreach (@emailUsers) { my %data ; &P4CGI::p4readform("user -o '$_'",\%data) ; if(exists $data{"Email"}) { push @email,$data{"Email"} ; } } my $email = join(",",@email) ; my $emailbutton = &P4CGI::buttonCell("mailto:$email", "Send an email to all group members", "Subject=To members in group $group", "Email group") ; print &P4CGI::buttonHMenuTable(($emailbutton)) ; } print &P4CGI::end_page() ; # # That's all folks #
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 4998 | Fredric Fredricson |
P4DB: cleaned up some code. Added p4users(), p4client() and p4user2name() to P4CGI.pm and modified all cgi:s to use these, |
||
#6 | 4306 | Fredric Fredricson |
P4DB: Hardened P4DB against malicious parameters (cross site scripting), performed some cleanup and increased version to 3.1.1. |
||
#5 | 4048 | Fredric Fredricson |
P4DB: Updated for Explorer. * Updated Style Sheet to work for Explorer as well as Netscape * Improved alternate header * Some other small fixes.... |
||
#4 | 2942 | Fredric Fredricson | P4DB: Fixed bug: Can now handle spaces in label names etc.... | ||
#3 | 2875 | Fredric Fredricson | P4DB 3.0 first beta... | ||
#2 | 1920 | Fredric Fredricson |
P4DB: Mainly some user interface fixes: * Added a small arrow that points to selection in list of options * Added tooltip help * Added user prefereces to turn the above off (or on) * Some other user interface fixes And fixed a bug in jobList.cgi and some minor bugs in label and branch viewers. |
||
#1 | 1638 | Fredric Fredricson | P4DB: Added all (I think) files for P4DB |