Commit dd40626a authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Add reminder to remove the image file (if there is a path defined).

parent 9bfe0066
<?php <?php
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2002 University of Utah and the Flux Group. # Copyright (c) 2000-2003 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
include("defs.php3"); include("defs.php3");
...@@ -119,28 +119,38 @@ DBQueryFatal("lock tables images write, os_info write, osidtoimageid write"); ...@@ -119,28 +119,38 @@ DBQueryFatal("lock tables images write, os_info write, osidtoimageid write");
# If this is an EZ imageid, then delete the corresponding OSID too. # If this is an EZ imageid, then delete the corresponding OSID too.
# #
$query_result = $query_result =
DBQueryFatal("select ezid from images ". DBQueryFatal("select ezid,path from images where imageid='$imageid'");
"where imageid='$imageid' and ezid=1"); $row = mysql_fetch_row($query_result);
$ezid = $row[0];
$path = $row[1];
# #
# Delete the record(s). # Delete the record(s).
# #
DBQueryFatal("DELETE FROM images WHERE imageid='$imageid'"); DBQueryFatal("DELETE FROM images WHERE imageid='$imageid'");
DBQueryFatal("DELETE FROM osidtoimageid where imageid='$imageid'"); DBQueryFatal("DELETE FROM osidtoimageid where imageid='$imageid'");
if ($ezid) {
if (mysql_num_rows($query_result)) {
DBQueryFatal("DELETE FROM os_info WHERE osid='$imageid'"); DBQueryFatal("DELETE FROM os_info WHERE osid='$imageid'");
} }
DBQueryFatal("unlock tables"); DBQueryFatal("unlock tables");
echo "<p> echo "<br>
<center><h3> <h3>
Image '$imageid' in project $pid has been deleted! Image '$imageid' in project $pid has been deleted!\n";
</h3></center>\n";
if ($path) {
echo "<br>
<br>
<font color=red>Please remember to delete $path!</font>\n";
}
echo "</h3>\n";
echo "<br> echo "<br>
<a href='showimageid_list.php3'>Back to Image Descriptor list</a>\n"; <center>
<a href='showimageid_list.php3'>Back to Image Descriptor list</a>
</center>
<br><br>\n";
# #
# Standard Testbed Footer # Standard Testbed Footer
......
Supports Markdown
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