Commit 5947dfce authored by Leigh B. Stoller's avatar Leigh B. Stoller

Just for Jay:

* On the showuser_list page, use red font to indicate projects for
  which the user is not yet approved.

* On the showuser page, show all project membership and highlight in
  red those that are not yet approved.
parent 99a47a1b
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2006 University of Utah and the Flux Group.
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# All rights reserved.
#
include("defs.php3");
......@@ -108,9 +108,8 @@ $query_result =
"left join group_membership as g2 on g2.pid=g.pid and ".
" g2.gid=g.gid and ".
" g2.uid_idx='" . $this_user->uid_idx() . "' ".
"where g.uid_idx='$target_idx' and ".
($isadmin ? "" : "g2.uid_idx is not null and ") .
"g.trust!='" . TBDB_TRUSTSTRING_NONE . "' ".
"where g.uid_idx='$target_idx' ".
($isadmin ? "" : "and g2.uid_idx is not null ") .
"group by g.pid, g.gid ".
"order by g.pid,gr.created");
......@@ -136,35 +135,36 @@ if (mysql_num_rows($query_result)) {
$desc = $projrow[description];
$trust = $projrow[trust];
$nodes = $projrow[ncount];
if (TBTrustConvert($trust) != $TBDB_TRUST_NONE) {
echo "<tr>
<td><A href='showproject.php3?pid=$pid'>
$pid</A></td>
<td><A href='showgroup.php3?pid=$pid&gid=$gid'>
$gid</A></td>\n";
echo "<td>$nodes</td>\n";
if (strcmp($pid,$gid)) {
echo "<td>$desc</td>\n";
$mail = $pid . "-" . $gid . "-users@" . $OURDOMAIN;
}
else {
echo "<td>$name</td>\n";
$mail = $pid . "-users@" . $OURDOMAIN;
}
echo "<td>$trust</td>\n";
if ($MAILMANSUPPORT) {
# Not sure what I want to do here ...
echo "<td nowrap><a href=mailto:$mail>$mail</a></td>";
}
else {
echo "<td nowrap><a href=mailto:$mail>$mail</a></td>";
}
echo "</tr>\n";
}
echo "<tr>
<td><A href='showproject.php3?pid=$pid'>
$pid</A></td>
<td><A href='showgroup.php3?pid=$pid&gid=$gid'>
$gid</A></td>\n";
echo "<td>$nodes</td>\n";
if (strcmp($pid,$gid)) {
echo "<td>$desc</td>\n";
$mail = $pid . "-" . $gid . "-users@" . $OURDOMAIN;
}
else {
echo "<td>$name</td>\n";
$mail = $pid . "-users@" . $OURDOMAIN;
}
$color = ($trust == TBDB_TRUSTSTRING_NONE ? "red" : "black");
echo "<td><font color=$color>$trust</font></td>\n";
if ($MAILMANSUPPORT) {
# Not sure what I want to do here ...
echo "<td nowrap><a href=mailto:$mail>$mail</a></td>";
}
else {
echo "<td nowrap><a href=mailto:$mail>$mail</a></td>";
}
echo "</tr>\n";
}
echo "</table>\n";
......
......@@ -154,14 +154,19 @@ echo "<center>
#
$projmemb_array = array();
$projmemb_result =
DBQueryFatal("select distinct uid,pid from group_membership ".
DBQueryFatal("select distinct uid,pid,trust from group_membership ".
"order by uid");
while ($row = mysql_fetch_array($projmemb_result)) {
$uid = $row[0];
$pid = $row[1];
$trust = $row[2];
$projmemb_array[$uid][] = $pid;
$foo = array();
$foo["pid"] = $pid;
$foo["trust"] = $trust;
$projmemb_array[$uid][] = $foo;
}
echo "<table width=\"100%\" border=2 cellpadding=1 cellspacing=2
......@@ -219,8 +224,19 @@ while ($row = mysql_fetch_array($query_result)) {
reset($projmemb_array[$thisuid]);
echo "<td> ";
while (list ($idx, $pid) = each($projmemb_array[$thisuid])) {
echo "<A href='showproject.php3?pid=$pid'>$pid</A>";
while (list ($idx, $foo) = each($projmemb_array[$thisuid])) {
$pid = $foo["pid"];
$trust = $foo["trust"];
echo "<A href='showproject.php3?pid=$pid'>";
if ($trust == TBDB_TRUSTSTRING_NONE) {
echo "<font color=red>";
}
echo $pid;
if ($trust == TBDB_TRUSTSTRING_NONE) {
echo "</font>";
}
echo "</A>";
if ($idx != (count($projmemb_array[$thisuid]) - 1))
echo ", ";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment