#!/usr/bin/perl -w
# -*- perl -*-
use P4CGI ;
use strict ;
#
#################################################################
# CONFIGURATION INFORMATION
# All config info should be in P4CGI.pm
#
#################################################################
#
# P4 list user
# List a p4 user
#
#################################################################
# Get parameter
my $user = P4CGI::cgi()->param("USER") ;
unless(defined $user) {
&P4CGI::bail("No user specified!") ;
} ;
# List all users
my @userData ;
&P4CGI::p4call(\@userData, "users" );
my %userData = map { /^(\S+)/ ; ($1,1) ; } @userData ;
# Get user info
my %values ;
my @fields ;
if(exists $userData{$user}) {
@fields = &P4CGI::p4readform("user -o $user",\%values);
}
# Fix email
if(exists $values{"Email"}) {
my $em = &P4CGI::fixSpecChar($values{"Email"}) ;
$values{"Email"}=&P4CGI::ahref(-url => "mailto:$values{Email}",
"HELP=Send email",
$em) ;
}
# Fix fullname
if(exists $values{"FullName"}) {
$values{"FullName"} = &P4CGI::fixSpecChar( $values{"FullName"}) ;
}
# Fix job view
if(exists $values{"JobView"}) {
my $v = $values{"JobView"} ;
$values{"JobView"} = &P4CGI::ahref(-url => "jobList.cgi",
"JOBVIEW=$v",
"LIST=Y",
"HELP=List matching jobs",
$v) ;
}
# Fix group view
{
my @groups ;
&P4CGI::p4call(\@groups,"groups $user") ;
if(@groups > 0) {
my $p = "In group" ;
if(@groups > 1) { $p .="s" ; } ;
push @fields,$p ;
$values{$p} = join(",", map { &P4CGI::ahref(-url => "groupView.cgi",
"GROUP=$_",
"HELP=View group info",
$_) ; } @groups) ;
}
}
print "",
&P4CGI::start_page("User $user",
&P4CGI::ul_list("<b>e-mail address</b> -- e-mail user",
"<b>JobView</b> -- list jobs for this view",
&P4CGI::ahref(-url => "clientList.cgi",
"USER=$user",
"List clients") .
" -- List clients owned by user $user",
&P4CGI::ahref(-url => "changeList.cgi",
"USER=$user",
"FSPC=//...",
"List changes by user") .
" -- List changes made by user $user",
&P4CGI::ahref(-url => "userList.cgi",
"List all users") .
" -- List all users and groups",
)) ;
unless(exists $userData{$user}) {
&P4CGI::signalError("User \"$user\" does not exist. ") ;
}
print
&P4CGI::start_table("") ;
my $f ;
foreach $f (@fields) {
print &P4CGI::table_row({-align => "right",
-type => "th",
-text => "$f"},
$values{$f}) ;
} ;
my $openfiles ;
&P4CGI::p4call(*P4, "opened -a" );
my $line=0 ;
while(<P4>) {
chomp ;
/ by $user\@/ and do {
$line++ ;
/^(.*\#\d+) - (\S+) .* by \w+\@(\S+)/ or do { &P4CGI::ERROR("Unable to parse line $line ($_)") ;
next ; } ;
my $file = $1 ;
my $reason = $2 ;
my $client = $3 ;
$client = &P4CGI::ahref(-url => "clientView.cgi",
"CLIENT=$client",
"HELP=View client info",
"<tt>$client</tt>") ;
$file =~ /(.*)\#(\d+)/ ;
if($reason ne "add") {
$file = &P4CGI::ahref(-url => "fileLogView.cgi",
"FSPC=$1",
"REV=$2",
"HELP=File log",
"$file") ;
}
if(defined $openfiles) {
$openfiles .= "<br><tt>$file</tt> - <b>$reason</b> by client $client" ;
} else {
$openfiles = "<tt>$file</tt> - <b>$reason</b> by client $client" ;
} ;
} ;
} ;
if(defined $openfiles) {
print &P4CGI::table_row({-align => "right",
-type => "th",
-valign => "top",
-text => "Open files"},
"$openfiles") ;
} ;
print
&P4CGI::end_table(),
&P4CGI::end_page() ;
#
# That's all folks
#
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #1 | 1933 | Fredric Fredricson |
P4DB: Created 2.1 "release branch". (The quotation marks are there because this is not really a release. Yet. Perhaps.) |
||
| //guest/fredric_fredricson/P4DB/main/userView.cgi | |||||
| #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 | ||