Commit 5ffa3c2c authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add a Projects Using Emulab.Net link, as per Jay request. Added a

radio button in the new project web page so people can opt out of
having their URL listed.
parent bfa13cd5
......@@ -63,6 +63,7 @@ function WRITESIDEBAR() {
WRITESIDEBARBUTTON("FAQ", $TBDOCBASE, "faq.php3");
WRITESIDEBARBUTTON("Tutorial", $TBDOCBASE, "tutorial/tutorial.php3");
WRITESIDEBARBUTTON("People", $TBDOCBASE, "people.php3");
WRITESIDEBARBUTTON("Projects Using Emulab.Net", $TBDOCBASE, "projectlist.php3");
echo "<tr>
<td height=30 valign=center align=center nowrap>
......
......@@ -73,6 +73,10 @@ if (!isset($usr_phones) ||
strcmp($usr_phones, "") == 0) {
FORMERROR("Phone #");
}
if (!isset($proj_public) ||
(strcmp($proj_public, "yes") && strcmp($proj_public, "no"))) {
FORMERROR("Publicly Visible");
}
#
# Check uid and pid for sillyness.
......@@ -132,6 +136,16 @@ $usr_affil = addslashes($usr_affil);
$usr_title = addslashes($usr_title);
$usr_addr = addslashes($usr_addr);
#
# Convert project visibility to boolean value. Tested above for yes/no.
#
if (strcmp($proj_public, "yes") == 0) {
$public = 1;
}
else {
$public = 0;
}
#
# This is a new project request. Make sure it does not already exist.
#
......@@ -273,10 +287,10 @@ if (! $returning) {
#
$newproj_command = "INSERT INTO projects ".
"(pid, created, expires, name, URL, head_uid, ".
" num_members, num_pcs, num_sharks, why, funders, unix_gid)".
" num_members, num_pcs, num_sharks, why, funders, unix_gid, public)".
"VALUES ('$pid', now(), '$proj_expires','$proj_name','$proj_URL',".
"'$proj_head_uid', '$proj_members', '$proj_pcs', '$proj_sharks', ".
"'$proj_why', '$proj_funders', NULL)";
"'$proj_why', '$proj_funders', NULL, $public)";
$newproj_result = mysql_db_query($TBDBNAME, $newproj_command);
if (! $newproj_result) {
$err = mysql_error();
......@@ -311,6 +325,7 @@ mail($TBMAIL_APPROVAL,
"Project: $proj_name\n".
"Expires: $proj_expires\n".
"Project URL: $proj_URL\n".
"Public URL: $proj_public\n".
"Funders: $proj_funders\n".
"Title: $usr_title\n".
"Affiliation: $usr_affil\n".
......
......@@ -246,6 +246,19 @@ echo "<tr>
value=\"http://\" size=\"45\"></td>
</tr>\n";
#
# Publiclly visible.
#
echo "<tr>
<td>*Can we list your URL publicly as an \"Emulab User?\":
<br>
(See our <a href=\"projectlist.php3\" target=\"Users\">Users</a> page)
</td>
<td><input type=radio name=proj_public value=yes checked>Yes &nbsp
<input type=radio name=proj_public value=no>No
</td>
</tr>\n";
#
# Funders/Grant numbers
#
......
<?php
include("defs.php3");
#
# Standard Testbed Header
#
PAGEHEADER("Clients of Emulab.Net");
#
# We let anyone access this page. Its bascailly a pretty printed version of the
# current testbed clients, who have not opted out from this display.
#
# Complete information is better viewed with the "Project Information" link.
# That requires a logged in user though.
#
#
# Get the project list.
#
$query_result = mysql_db_query($TBDBNAME,
"SELECT * FROM projects where public=1 and approved=1 order by pid");
if (! $query_result) {
$err = mysql_error();
TBERROR("Database Error getting project list: $err\n", 1);
}
# Not likely to happen!
if (mysql_num_rows($query_result) == 0) {
USERERROR("There are no projects!", 1);
}
echo "<center><h3>
Here is a list of research groups using Emulab.Net
</h3></center>\n";
echo "<table width=\"100%\" border=2 cellpadding=0 cellspacing=2
align='center'>\n";
echo "<tr>
<td>Name</td>
<td>URL</td>
</tr>\n";
while ($projectrow = mysql_fetch_array($query_result)) {
$pname = $projectrow[name];
$url = $projectrow[URL];
echo "<tr>
<td>$pname</td>\n";
if (!$url || strcmp($url, "") == 0) {
echo "<td>&nbsp</td>\n";
}
else {
echo "<td><A href=\"$url\">$url</A></td>\n";
}
echo "</tr>\n";
}
echo "</table>\n";
#
# Standard Testbed Footer
#
PAGEFOOTER();
?>
......@@ -7,10 +7,7 @@ include("defs.php3");
PAGEHEADER("Project Information List");
#
# Only known and logged in users can end experiments.
#
#
# Only known and logged in users can end experiments.
# Only known and logged in users can do this.
#
$uid = GETLOGIN();
LOGGEDINORDIE($uid);
......
......@@ -24,6 +24,7 @@ function SHOWPROJECT($pid, $thisuid) {
$proj_expires = $row[expires];
$proj_name = $row[name];
$proj_URL = $row[URL];
$proj_public = $row[public];
$proj_funders = $row[funders];
$proj_head_uid = $row[head_uid];
$proj_members = $row[num_members];
......@@ -33,6 +34,13 @@ function SHOWPROJECT($pid, $thisuid) {
$control_node = $row[control_node];
$approved = $row[approved];
if ($proj_public) {
$proj_public = "Yes";
}
else {
$proj_public = "No";
}
#
# Generate the table.
#
......@@ -59,6 +67,11 @@ function SHOWPROJECT($pid, $thisuid) {
<A href='$proj_URL'>$proj_URL</A></td>
</tr>\n";
echo "<tr>
<td>Publicly Visible: </td>
<td class=\"left\">$proj_public</td>
</tr>\n";
echo "<tr>
<td>Funders: </td>
<td class=\"left\">$proj_funders</td>
......
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