Commit b8b3ddfe authored by Leigh B. Stoller's avatar Leigh B. Stoller

Make the "Project Information" link work for anyone. Admin people

still get the entire list, while normal users get a list of projects
for which they are leaders.
parent 37c72682
......@@ -94,8 +94,6 @@ if (isset($uid)) {
if ($admin) {
echo "<A href='approveproject_list.php3'>
New Project Approval</A><p>\n";
echo "<A href='showproject_list.php3'>
Project Information</A><p>\n";
echo "<A href='nodecontrol_list.php3'>
Node Control</A><p>\n";
}
......@@ -107,6 +105,8 @@ if (isset($uid)) {
# Since a user can be a member of more than one project,
# display this option, and let the form decide if the user is
# allowed to do this.
echo "<p><A href='showproject_list.php3'>
Project Information</A><p>\n";
echo "<p><A href='beginexp_form.php3'>
Begin an Experiment</A>\n";
echo "<p><A href='endexp_form.php3'>
......
......@@ -16,24 +16,36 @@ $uid = GETLOGIN();
LOGGEDINORDIE($uid);
#
# Admin users can do this.
# Admin users can see all projects, while normal users can only see
# projects for which they are the leader.
#
# XXX Should we form the list from project members instead of leaders?
#
$isadmin = ISADMIN($uid);
if (! $isadmin) {
USERERROR("You do not have admin privledges!", 1);
}
#
# Show a menu of all projects.
# Get the project list.
#
$query_result = mysql_db_query($TBDBNAME,
if ($isadmin) {
$query_result = mysql_db_query($TBDBNAME,
"SELECT * FROM projects");
}
else {
$query_result = mysql_db_query($TBDBNAME,
"SELECT * FROM projects where head_uid='$uid'");
}
if (! $query_result) {
$err = mysql_error();
TBERROR("Database Error getting project list: $err\n", 1);
}
if (mysql_num_rows($query_result) == 0) {
USERERROR("There are no projects!", 1);
if ($isadmin) {
USERERROR("There are no projects!", 1);
}
else {
USERERROR("You are not a leader of any projects!", 1);
}
}
echo "<center><h3>
......
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