+ if (-d $project_list) {
+ # search in directory
+ my $dir = $project_list;
+ opendir my $dh, $dir || return undef;
+ while (my $dir = readdir($dh)) {
+ if (-e "$projectroot/$dir/HEAD") {
+ push @list, $dir;
+ }
+ }
+ closedir($dh);
+ } elsif (-e $project_list) {
+ # read from file
+ open my $fd , $project_list || return undef;
+ while (my $line = <$fd>) {
+ chomp $line;
+ if (-e "$projectroot/$line/HEAD") {
+ push @list, $line;
+ }
+ }
+ close $fd;
+ }
+
+ if (!@list) {
+ die_error(undef, "No project found.");
+ }
+ @list = sort @list;
+
+ git_header_html();
+ print "<div class=\"page_body\"><br/>\n";
+ print "<table cellspacing=\"0\">\n";
+ print "<tr>\n" .
+ "<th>Project</th>\n" .
+ "<th>Description</th>\n" .
+ "<th>Owner</th>\n" .
+ "<th>last change</th>\n" .
+ "</tr>\n";
+ foreach my $proj (@list) {
+ my $head = git_read_head($proj);
+ if (!defined $head) {
+ next;
+ }
+ $ENV{'SHA1_FILE_DIRECTORY'} = "$projectroot/$proj/objects";
+ my %co = git_read_commit($head);
+ if (!%co) {
+ next;
+ }
+ my $descr = git_read_description($proj) || "";
+ my $owner = "";
+ my ($dev, $ino, $mode, $nlink, $st_uid, $st_gid, $rdev, $size) = stat("$projectroot/$proj");
+ my ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwuid($st_uid);
+ if (defined $gcos) {
+ $owner = $gcos;
+ $owner =~ s/[,;].*$//;
+ }
+ print "<tr>\n" .
+ "<td>" . $cgi->a({-href => "$my_uri?p=$proj;a=log"}, escapeHTML($proj)) . "</td>\n" .
+ "<td>$descr</td>\n" .
+ "<td><i>$owner</i></td>\n";
+ if ($co{'age'} < 60*60*2) {
+ print "<td><span style =\"color: #009900;\"><b><i>" . $co{'age_string'} . "</i></b></span></td>\n";
+ } elsif ($co{'age'} < 60*60*24*2) {
+ print "<td><span style =\"color: #009900;\"><i>" . $co{'age_string'} . "</i></span></td>\n";
+ } else {
+ print "<td><i>" . $co{'age_string'} . "</i></td>\n";
+ }
+ print "</tr>\n";
+ }
+ print "</table>\n" .
+ "<br/>\n" .
+ "</div>\n";
+ git_footer_html();