showimageid.php3 1.54 KB
Newer Older
1
<?php
Leigh Stoller's avatar
Leigh Stoller committed
2 3
#
# EMULAB-COPYRIGHT
4
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
Leigh Stoller's avatar
Leigh Stoller committed
5 6
# All rights reserved.
#
7 8 9 10 11 12
include("defs.php3");
include("showstuff.php3");

#
# Standard Testbed Header
#
13
PAGEHEADER("Image Descriptor");
14 15 16 17 18 19

#
# Only known and logged in users can end experiments.
#
$uid = GETLOGIN();
LOGGEDINORDIE($uid);
20
$isadmin = ISADMIN($uid);
21 22 23 24 25 26 27 28 29

#
# Verify form arguments.
# 
if (!isset($imageid) ||
    strcmp($imageid, "") == 0) {
    USERERROR("You must provide an ImageID.", 1);
}

30 31
if (! TBValidImageID($imageid)) {
    USERERROR("ImageID '$imageid' is not a valid ImageID!", 1);
32 33 34
}

#
Leigh Stoller's avatar
Leigh Stoller committed
35
# Verify permission.
36
#
Leigh Stoller's avatar
Leigh Stoller committed
37 38
if (!TBImageIDAccessCheck($uid, $imageid, $TB_IMAGEID_READINFO)) {
    USERERROR("You do not have permission to access ImageID $imageid.", 1);
39 40
}

41 42 43 44 45
SUBPAGESTART();
SUBMENUSTART("More Options");
$fooid = rawurlencode($imageid);
WRITESUBMENUBUTTON("Edit this Image Descriptor",
		   "editimageid_form.php3?imageid=$fooid");
Chad Barb's avatar
Chad Barb committed
46
WRITESUBMENUBUTTON("Snapshot Node Disk into Image",
47
		   "loadimage.php3?imageid=$fooid");
48 49
WRITESUBMENUBUTTON("Delete this Image Descriptor",
		   "deleteimageid.php3?imageid=$fooid");
50
WRITESUBMENUBUTTON("Create a New Image Descriptor",
51
		   "newimageid_ez.php3");
52 53 54 55
if ($isadmin) {
    WRITESUBMENUBUTTON("Create a new OS Descriptor",
		       "newosid_form.php3");
}
Leigh Stoller's avatar
Leigh Stoller committed
56
WRITESUBMENUBUTTON("Image Descriptor list",
57
		   "showimageid_list.php3");
Leigh Stoller's avatar
Leigh Stoller committed
58
WRITESUBMENUBUTTON("OS Descriptor list",
59 60 61
		   "showosid_list.php3");
SUBMENUEND();

62 63 64 65 66
#
# Dump record.
# 
SHOWIMAGEID($imageid, 0);

67
SUBPAGEEND();
68 69 70 71 72 73

#
# Standard Testbed Footer
# 
PAGEFOOTER();
?>