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

Add creator/created slots to images and osids for tracking purposes.

Update pages appropriately. Also cleanup up a few more sub menus.
parent f7e30197
...@@ -715,13 +715,13 @@ $query_result = ...@@ -715,13 +715,13 @@ $query_result =
DBQueryFatal("INSERT INTO images ". DBQueryFatal("INSERT INTO images ".
"(imagename, imageid, description, loadpart, loadlength, ". "(imagename, imageid, description, loadpart, loadlength, ".
" part1_osid, part2_osid, part3_osid, part4_osid, ". " part1_osid, part2_osid, part3_osid, part4_osid, ".
" default_osid, path, pid, shared) ". " default_osid, path, pid, shared, creator, created) ".
"VALUES ". "VALUES ".
" ('$imagename', '$imageid', '$description', $loadpart, ". " ('$imagename', '$imageid', '$description', $loadpart, ".
" $loadlength, ". " $loadlength, ".
" $part1_osid, $part2_osid, $part3_osid, $part4_osid, ". " $part1_osid, $part2_osid, $part3_osid, $part4_osid, ".
" '$default_osid', '$path', '$pid', $shared)"); " '$default_osid', '$path', '$pid', $shared, ".
" '$uid', now())");
if (!$isadmin || $makedefault) { if (!$isadmin || $makedefault) {
for ($i = 0; $i < count($mtypes_array); $i++) { for ($i = 0; $i < count($mtypes_array); $i++) {
......
...@@ -571,17 +571,19 @@ if (TBValidImageID($imageid) || TBValidOSID($imageid)) { ...@@ -571,17 +571,19 @@ if (TBValidImageID($imageid) || TBValidOSID($imageid)) {
DBQueryFatal("INSERT INTO images ". DBQueryFatal("INSERT INTO images ".
"(imagename, imageid, ezid, description, loadpart, loadlength, ". "(imagename, imageid, ezid, description, loadpart, loadlength, ".
" part" . "$loadpart" . "_osid, ". " part" . "$loadpart" . "_osid, ".
" default_osid, path, pid, shared) ". " default_osid, path, pid, shared, creator, created) ".
"VALUES ". "VALUES ".
" ('$imagename', '$imageid', 1, '$description', $loadpart, 1, ". " ('$imagename', '$imageid', 1, '$description', $loadpart, 1, ".
" '$imageid', '$imageid', '$path', '$pid', $shared)"); " '$imageid', '$imageid', '$path', '$pid', $shared, ".
" '$uid', now())");
DBQueryFatal("INSERT INTO os_info ". DBQueryFatal("INSERT INTO os_info ".
"(osname, osid, ezid, description, OS, version, path, magic, ". "(osname, osid, ezid, description, OS, version, path, magic, ".
" osfeatures, pid) ". " osfeatures, pid, creator, created) ".
"VALUES ". "VALUES ".
" ('$imagename', '$imageid', 1, '$description', '$os_name', ". " ('$imagename', '$imageid', 1, '$description', '$os_name', ".
" '$os_version', NULL, NULL, '$os_features', '$pid')"); " '$os_version', NULL, NULL, '$os_features', '$pid', ".
" '$uid', now())");
for ($i = 0; $i < count($mtypes_array); $i++) { for ($i = 0; $i < count($mtypes_array); $i++) {
DBQueryFatal("REPLACE INTO osidtoimageid ". DBQueryFatal("REPLACE INTO osidtoimageid ".
......
...@@ -169,10 +169,11 @@ if (TBValidOSID($osid)) { ...@@ -169,10 +169,11 @@ if (TBValidOSID($osid)) {
$query_result = $query_result =
DBQueryFatal("INSERT INTO os_info ". DBQueryFatal("INSERT INTO os_info ".
"(osname, osid, description, OS, version, path, magic, ". "(osname, osid, description, OS, version, path, magic, ".
" osfeatures, pid, shared) ". " osfeatures, pid, shared, creator, created) ".
"VALUES ('$osname', '$osid', '$description', '$OS', ". "VALUES ('$osname', '$osid', '$description', '$OS', ".
" '$os_version', $os_path, '$os_magic', ". " '$os_version', $os_path, '$os_magic', ".
" '$os_features', '$pid', $os_shared)"); " '$os_features', '$pid', $os_shared, ".
" '$uid', now())");
DBQueryFatal("unlock tables"); DBQueryFatal("unlock tables");
......
...@@ -41,7 +41,18 @@ if (mysql_num_rows($query_result) == 0) { ...@@ -41,7 +41,18 @@ if (mysql_num_rows($query_result) == 0) {
} }
} }
echo "<table border=2 cellpadding=2 cellspacing=2 SUBPAGESTART();
SUBMENUSTART("More Options");
WRITESUBMENUBUTTON("Create an Image Descriptor",
"newimageid_explain.php3");
WRITESUBMENUBUTTON("Create an OS Descriptor",
"newosid_form.php3");
WRITESUBMENUBUTTON("Back to OS Descriptor list",
"showosid_list.php3");
SUBMENUEND();
SUBPAGEEND();
echo "<table border=2 cellpadding=0 cellspacing=2
align='center'>\n"; align='center'>\n";
echo "<tr> echo "<tr>
...@@ -66,13 +77,6 @@ while ($row = mysql_fetch_array($query_result)) { ...@@ -66,13 +77,6 @@ while ($row = mysql_fetch_array($query_result)) {
} }
echo "</table>\n"; echo "</table>\n";
# Create option.
echo "<br><center>
<A href='newimageid_explain.php3'>Create a new Image Descriptor?</a>
</center>\n";
echo "<br><br>\n";
# #
# Standard Testbed Footer # Standard Testbed Footer
# #
......
...@@ -43,6 +43,17 @@ if (mysql_num_rows($query_result) == 0) { ...@@ -43,6 +43,17 @@ if (mysql_num_rows($query_result) == 0) {
} }
} }
SUBPAGESTART();
SUBMENUSTART("More Options");
WRITESUBMENUBUTTON("Create an Image Descriptor",
"newimageid_explain.php3");
WRITESUBMENUBUTTON("Create an OS Descriptor",
"newosid_form.php3");
WRITESUBMENUBUTTON("Back to Image Descriptor list",
"showimageid_list.php3");
SUBMENUEND();
SUBPAGEEND();
echo "<table border=2 cellpadding=0 cellspacing=2 echo "<table border=2 cellpadding=0 cellspacing=2
align='center'>\n"; align='center'>\n";
...@@ -66,10 +77,6 @@ while ($row = mysql_fetch_array($query_result)) { ...@@ -66,10 +77,6 @@ while ($row = mysql_fetch_array($query_result)) {
} }
echo "</table>\n"; echo "</table>\n";
echo "<br><center>
<a href='newosid_form.php3'>Create a new OS Descriptor.</a>
</center>\n";
# #
# Standard Testbed Footer # Standard Testbed Footer
# #
......
...@@ -683,6 +683,8 @@ function SHOWOSINFO($osid) { ...@@ -683,6 +683,8 @@ function SHOWOSINFO($osid) {
$os_pid = $osrow[pid]; $os_pid = $osrow[pid];
$os_shared = $osrow[shared]; $os_shared = $osrow[shared];
$os_osname = $osrow[osname]; $os_osname = $osrow[osname];
$creator = $osrow[creator];
$created = $osrow[created];
if (!$os_description) if (!$os_description)
$os_description = "&nbsp"; $os_description = "&nbsp";
...@@ -694,6 +696,8 @@ function SHOWOSINFO($osid) { ...@@ -694,6 +696,8 @@ function SHOWOSINFO($osid) {
$os_magic = "&nbsp"; $os_magic = "&nbsp";
if (!$os_osfeatures) if (!$os_osfeatures)
$os_osfeatures = "&nbsp"; $os_osfeatures = "&nbsp";
if (!$created)
$created = "N/A";
# #
# Generate the table. # Generate the table.
...@@ -710,6 +714,16 @@ function SHOWOSINFO($osid) { ...@@ -710,6 +714,16 @@ function SHOWOSINFO($osid) {
<td class=\"left\">$os_pid</td> <td class=\"left\">$os_pid</td>
</tr>\n"; </tr>\n";
echo "<tr>
<td>Creator: </td>
<td class=left>$creator</td>
</tr>\n";
echo "<tr>
<td>Created: </td>
<td class=left>$created</td>
</tr>\n";
echo "<tr> echo "<tr>
<td>Description: </td> <td>Description: </td>
<td class=\"left\">$os_description</td> <td class=\"left\">$os_description</td>
...@@ -784,6 +798,8 @@ function SHOWIMAGEID($imageid, $edit) { ...@@ -784,6 +798,8 @@ function SHOWIMAGEID($imageid, $edit) {
$path = $row[path]; $path = $row[path];
$loadaddr = $row[load_address]; $loadaddr = $row[load_address];
$shared = $row[shared]; $shared = $row[shared];
$creator = $row[creator];
$created = $row[created];
if ($edit) { if ($edit) {
if (!$description) if (!$description)
...@@ -800,6 +816,8 @@ function SHOWIMAGEID($imageid, $edit) { ...@@ -800,6 +816,8 @@ function SHOWIMAGEID($imageid, $edit) {
$path = "&nbsp"; $path = "&nbsp";
if (!$loadaddr) if (!$loadaddr)
$loadaddr = "&nbsp"; $loadaddr = "&nbsp";
if (!$created)
$created = "N/A";
} }
# #
...@@ -824,6 +842,16 @@ function SHOWIMAGEID($imageid, $edit) { ...@@ -824,6 +842,16 @@ function SHOWIMAGEID($imageid, $edit) {
<td class=\"left\">$pid</td> <td class=\"left\">$pid</td>
</tr>\n"; </tr>\n";
echo "<tr>
<td>Creator: </td>
<td class=left>$creator</td>
</tr>\n";
echo "<tr>
<td>Created: </td>
<td class=left>$created</td>
</tr>\n";
echo "<tr> echo "<tr>
<td>Description: </td> <td>Description: </td>
<td class=left>\n"; <td class=left>\n";
......
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