Project Profile

\n"; $proj_created = $row[created]; $proj_expires = $row[expires]; $proj_name = stripslashes($row[name]); $proj_URL = $row[URL]; $proj_public = $row[public]; $proj_funders = stripslashes($row[funders]);; $proj_head_uid = $row[head_uid]; $proj_members = $row[num_members]; $proj_pcs = $row[num_pcs]; $proj_ronpcs = $row[num_ron]; $proj_plabpcs = $row[num_pcplab]; $proj_why = nl2br($row[why]); $control_node = $row[control_node]; $approved = $row[approved]; $expt_count = $row[expt_count]; $expt_last = $row[expt_last]; if ($proj_public) { $proj_public = "Yes"; } else { $proj_public = "No"; } if (!$expt_last) { $expt_last = " "; } # # Generate the table. # echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($approved) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "
Name: $pid
Long Name: $proj_name
Project Head: $proj_head_uid
URL: $proj_URL
Publicly Visible: $proj_public
Funders: $proj_funders
#Project Members: $proj_members
#PCs: $proj_pcs
#Planetlab PCs: $proj_plabpcs
#RON PCs: $proj_ronpcs
Created: $proj_created
Expires: $proj_expires
Experiments Created: $expt_count
Date of last experiment: $expt_last
Approved?: \"Y\"\"N\"
Why?:
$proj_why
\n"; } # # A Group # function SHOWGROUP($pid, $gid) { global $OURDOMAIN; $query_result = DBQueryFatal("SELECT * FROM groups WHERE pid='$pid' and gid='$gid'"); $row = mysql_fetch_array($query_result); echo "

Group Profile

\n"; $leader = $row[leader]; $created = $row[created]; $description= stripslashes($row[description]); $expt_count = $row[expt_count]; $expt_last = $row[expt_last]; $unix_gid = $row[unix_gid]; $unix_name = $row[unix_name]; if (strcmp($pid,$gid)) $mail = "$pid-$gid" . "-users@" . $OURDOMAIN; else $mail = "$pid" . "-users@" . $OURDOMAIN; if (!$expt_last) { $expt_last = " "; } # # Generate the table. # echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
GID: $gid
PID: $pid
Description: $description
Unix GID: $unix_gid
Unix Group Name: $unix_name
Group Leader: $leader
Email List: $mail
Created: $created
Experiments Created: $expt_count
Date of last experiment: $expt_last
\n"; } # # A list of Group members. # function SHOWGROUPMEMBERS($pid, $gid, $prived = 0) { $query_result = DBQueryFatal("SELECT m.*,u.* FROM group_membership as m ". "left join users as u on u.uid=m.uid ". "WHERE pid='$pid' and gid='$gid'"); if (! mysql_num_rows($query_result)) { return; } $showdel = (($prived && !strcmp($pid, $gid)) ? 1 : 0); echo "
\n"; if (strcmp($pid, $gid)) { echo "

Group Members

\n"; } else { echo "

Project Members

\n"; } echo "
\n"; echo "\n"; if ($showdel) { echo "\n"; } echo "\n"; while ($row = mysql_fetch_array($query_result)) { $target_uid = $row[uid]; $usr_name = $row[usr_name]; $trust = $row[trust]; echo "\n"; if (TBTrustConvert($trust) != $TBDB_TRUST_NONE) { echo "\n"; } else { echo "\n"; } if ($showdel) { echo "\n"; } echo "\n"; } echo "
Name UID PrivsRemove
$usr_name $target_uid $trust$trust N
\n"; } # # A list of groups for a user. # function SHOWGROUPMEMBERSHIP($uid) { $none = TBDB_TRUSTSTRING_NONE; $query_result = DBQueryFatal("SELECT * FROM group_membership ". "WHERE uid='$uid' and trust!='$none' ". "order by pid"); if (! mysql_num_rows($query_result)) { return; } echo "

Group Membership

\n"; echo "\n"; while ($row = mysql_fetch_array($query_result)) { $pid = $row[pid]; $gid = $row[gid]; $trust = $row[trust]; if (TBTrustConvert($trust) != $TBDB_TRUST_NONE) { echo "\n"; echo "\n"; } } echo "
PID GID Privs
$pid $gid $trust
\n"; } # # A User # function SHOWUSER($uid) { global $TBDBNAME; $userinfo_result = DBQueryFatal("SELECT * from users where uid='$uid'"); $row = mysql_fetch_array($userinfo_result); $usr_expires = $row[usr_expires]; $usr_email = $row[usr_email]; $usr_URL = $row[usr_URL]; $usr_addr = stripslashes($row[usr_addr]); $usr_name = stripslashes($row[usr_name]); $usr_phone = $row[usr_phone]; $usr_title = stripslashes($row[usr_title]); $usr_affil = stripslashes($row[usr_affil]); $status = $row[status]; $admin = $row[admin]; $adminoff = $row[adminoff]; # # Last Login info. # if (($lastweblogin = LASTWEBLOGIN($uid)) == 0) $lastweblogin = " "; if (($lastuserslogininfo = TBUsersLastLogin($uid)) == 0) $lastuserslogin = "N/A"; else { $lastuserslogin = $lastuserslogininfo["date"] . " " . $lastuserslogininfo["time"]; } if (($lastnodelogininfo = TBUidNodeLastLogin($uid)) == 0) $lastnodelogin = "N/A"; else { $lastnodelogin = $lastnodelogininfo["date"] . " " . $lastnodelogininfo["time"] . " " . "(" . $lastnodelogininfo["node_id"] . ")"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($admin) { $onoff = ($adminoff ? "Off" : "On"); $flip = ($adminoff ? 0 : 1); echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "
Username: $uid
Full Name: $usr_name
Email Address: $usr_email
Home Page URL: $usr_URL
Expiration date: $usr_expires
Mailing Address: $usr_addr
Phone #: $usr_phone
Title/Position: $usr_title
Institutional Affiliation: $usr_affil
Status: $status
Admin (on/off): Yes ($onoff)
Last Web Login: $lastweblogin
Last Users Login: $lastuserslogin
Last Node Login: $lastnodelogin
\n"; } # # Show an experiment. # function SHOWEXP($pid, $eid) { global $TBDBNAME, $TBDOCBASE; $query_result = DBQueryFatal("select e.*,count(r.node_id) from experiments as e ". "left join reserved as r on e.pid=r.pid and e.eid=r.eid ". "where e.pid='$pid' and e.eid='$eid' ". "group by e.eid order by eid"); if (($exprow = mysql_fetch_array($query_result)) == 0) { TBERROR("Experiment $eid in project $pid is gone!\n", 1); } $exp_gid = $exprow[gid]; $exp_expires = $exprow[expt_expires]; $exp_name = stripslashes($exprow[expt_name]); $exp_created = $exprow[expt_created]; $exp_start = $exprow[expt_start]; $exp_swapped = $exprow[expt_swapped]; $exp_end = $exprow[expt_end]; $exp_created = $exprow[expt_created]; $exp_head = $exprow[expt_head_uid]; $exp_status = $exprow[state]; $exp_shared = $exprow[shared]; $exp_path = $exprow[path]; $batchmode = $exprow[batchmode]; $attempts = $exprow[attempts]; $batchstate = $exprow[batchstate]; $priority = $exprow[priority]; $swappable = $exprow[swappable]; $nodes = $exprow["count(r.node_id)"]; if ($swappable) $swappable = "Yes"; else $swappable = "No"; # # Generate the table. # echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($batchmode) { echo "\n"; echo "\n"; echo "\n"; } echo "
Name: $eid
Long Name: $exp_name
Project: $pid
Group: $exp_gid
Experiment Head: $exp_head
Created: $exp_created
Expires: $exp_expires
Started: $exp_start
Last Swapped (in or out): $exp_swapped
Swappable: $swappable
Priority: (0 is highest) $priority
Shared: "; if ($exp_shared) { echo "Yes"; } else { echo "No"; } echo "
Path: $exp_path
Status: $exp_status
Reserved Nodes: $nodes
Batch Mode: Yes
Batch Status: $batchstate
Start Attempts: $attempts
\n"; } # # Show Node information for an experiment. # function SHOWNODES($pid, $eid) { global $TBDBNAME; global $TBOPSPID; $reserved_result = DBQueryFatal("SELECT * FROM reserved WHERE ". "eid='$eid' and pid='$pid'"); # If this is an expt in emulab-ops, we don't care about vname, # since it won't be defined. But we do want to know when the node # entered the experiment, since it won't match the experiment's # swapin date. $nodename="Node Name"; $vnamefield="vname"; if (!strcmp($pid, $TBOPSPID)) { $nodename="Reserve Time"; $vnamefield="rsrvtime"; } if (mysql_num_rows($reserved_result)) { echo "

Reserved Nodes

\n"; $query_result = DBQueryFatal("SELECT nodes.*,reserved.vname, ". "date_format(rsrv_time,\"%Y-%m-%d %T\") as rsrvtime ". "FROM nodes LEFT JOIN reserved ". "ON nodes.node_id=reserved.node_id ". "WHERE reserved.eid=\"$eid\" and reserved.pid=\"$pid\" ". "ORDER BY type,priority"); while ($row = mysql_fetch_array($query_result)) { $node_id = $row[node_id]; $vname = $row[$vnamefield]; $type = $row[type]; $def_boot_osid = $row[def_boot_osid]; $def_boot_path = $row[def_boot_path]; $def_boot_cmd_line = $row[def_boot_cmd_line]; $next_boot_path = $row[next_boot_path]; $next_boot_cmd_line = $row[next_boot_cmd_line]; $startupcmd = $row[startupcmd]; $startstatus = $row[startstatus]; $readystatus = $row[ready]; $bootstatus = $row[bootstatus]; if (!$def_boot_cmd_line) $def_boot_cmd_line = "NULL"; if (!$def_boot_path) $def_boot_path = "NULL"; if (!$next_boot_path) $next_boot_path = "NULL"; if (!$next_boot_cmd_line) $next_boot_cmd_line = "NULL"; if (!$startupcmd) $startupcmd = "NULL"; if (!$vname) $vname = "--"; if ($readystatus) $readylabel = "Yes"; else $readylabel = "No"; echo "\n"; if ($def_boot_osid) { echo ""; } else echo "\n"; echo " \n"; } echo "
Node ID $nodename Type Default
OSID
Default
Path
Default
Cmdline
Boot
Status[1]
Startup
Command
Startup
Status[2]
Ready
Status[3]
$node_id $vname $type"; SPITOSINFOLINK($def_boot_osid); echo " $def_boot_path $def_boot_cmd_line $bootstatus $startupcmd $startstatus $readylabel
\n"; echo "

  1. Node has rebooted successfully after experiment creation.
  2. Exit value of the node startup command. A value of 666 indicates a testbed internal error.
  3. User application ready status, reported via TMCC.

\n"; } } # # Show OS INFO record. # function SHOWOSINFO($osid) { global $TBDBNAME; $query_result = DBQueryFatal("SELECT * FROM os_info WHERE osid='$osid'"); $osrow = mysql_fetch_array($query_result); $os_description = stripslashes($osrow[description]); $os_OS = $osrow[OS]; $os_version = $osrow[version]; $os_path = $osrow[path]; $os_magic = $osrow[magic]; $os_osfeatures = $osrow[osfeatures]; $os_op_mode = $osrow[op_mode]; $os_pid = $osrow[pid]; $os_shared = $osrow[shared]; $os_osname = $osrow[osname]; $creator = $osrow[creator]; $created = $osrow[created]; $mustclean = $osrow[mustclean]; if (!$os_description) $os_description = " "; if (!$os_version) $os_version = " "; if (!$os_path) $os_path = " "; if (!$os_magic) $os_magic = " "; if (!$os_osfeatures) $os_osfeatures = " "; if (!$os_op_mode) $os_op_mode = " "; if (!$created) $created = "N/A"; # # Generate the table. # echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Name: $os_osname
Project: $os_pid
Creator: $creator
Created: $created
Description: $os_description
Operating System: $os_OS
Version: $os_version
Path: $os_path
Magic (uname -r -s): $os_magic
Features: $os_osfeatures
Operational Mode: $os_op_mode
Shared?: \n"; if ($os_shared) echo "Yes"; else echo "No"; echo "
Must Clean?: \n"; if ($mustclean) echo "Yes"; else echo "No"; echo "
Internal ID: $osid
\n"; } # # Show ImageID record. # function SHOWIMAGEID($imageid, $edit, $isadmin = 0) { global $TBDBNAME; $query_result = DBQueryFatal("select * from images where imageid='$imageid'"); $row = mysql_fetch_array($query_result); $imagename = $row[imagename]; $pid = $row[pid]; $description = stripslashes($row[description]); $loadpart = $row[loadpart]; $loadlength = $row[loadlength]; $part1_osid = $row[part1_osid]; $part2_osid = $row[part2_osid]; $part3_osid = $row[part3_osid]; $part4_osid = $row[part4_osid]; $default_osid= $row[default_osid]; $path = $row[path]; $loadaddr = $row[load_address]; $shared = $row[shared]; $creator = $row[creator]; $created = $row[created]; if ($edit) { if (!$description) $description = ""; if (!$path) $path = ""; if (!$loadaddr) $loadaddr = ""; } else { if (!$description) $description = " "; if (!$path) $path = " "; if (!$loadaddr) $loadaddr = " "; if (!$created) $created = "N/A"; } # # Generate the table. # echo "\n"; if ($edit) { $imageid_encoded = rawurlencode($imageid); echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($part1_osid) { echo "\n"; } if ($part2_osid) { echo "\n"; } if ($part3_osid) { echo "\n"; } if ($part4_osid) { echo "\n"; } if ($default_osid) { echo "\n"; } echo "\n"; if (! $edit) { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; if ($edit) { echo "\n"; } echo "
Image Name: $imagename
Project: $pid
Creator: $creator
Created: $created
Description: \n"; if ($edit) { echo ""; } else { echo "$description"; } echo "
Load Partition: $loadpart
Load Length: $loadlength
Partition 1 OS: "; SPITOSINFOLINK($part1_osid); echo "
Partition 2 OS: "; SPITOSINFOLINK($part2_osid); echo "
Partition 3 OS: "; SPITOSINFOLINK($part3_osid); echo "
Partition 4 OS: "; SPITOSINFOLINK($part4_osid); echo "
Boot OS: "; SPITOSINFOLINK($default_osid); echo "
Filename: \n"; if ($edit) { echo ""; } else { echo "$path"; } echo "
Types: \n"; $types_result = DBQueryFatal("select distinct type from osidtoimageid ". "where imageid='$imageid'"); if (mysql_num_rows($types_result)) { while ($row = mysql_fetch_array($types_result)) { $type = $row[type]; echo "$type   "; } } else { echo " "; } echo "
Shared?: \n"; if ($shared) echo "Yes"; else echo "No"; echo "
Internal ID: $imageid
Load Address: \n"; if ($edit && $isadmin) { echo ""; } else { echo "$loadaddr"; } echo "
\n"; } # # Show node record. # function SHOWNODE($node_id) { $query_result = DBQueryFatal("select n.*,r.vname,r.pid,r.eid,i.IP, ". " t.isvirtnode,t.isremotenode ". " from nodes as n ". "left join reserved as r on n.node_id=r.node_id ". "left join node_types as t on t.type=n.type ". "left join interfaces as i on i.card=t.control_net ". " and i.node_id=n.node_id ". "where n.node_id='$node_id'"); if (mysql_num_rows($query_result) == 0) { TBERROR("The node $node_id is not a valid nodeid!", 1); } $row = mysql_fetch_array($query_result); $node_id = $row[node_id]; $phys_nodeid = $row[phys_nodeid]; $type = $row[type]; $vname = $row[vname]; $pid = $row[pid]; $eid = $row[eid]; $bios = $row[bios_version]; $def_boot_osid = $row[def_boot_osid]; $def_boot_path = $row[def_boot_path]; $def_boot_cmd_line = $row[def_boot_cmd_line]; $next_boot_osid = $row[next_boot_osid]; $next_boot_path = $row[next_boot_path]; $next_boot_cmd_line = $row[next_boot_cmd_line]; $rpms = $row[rpms]; $tarballs = $row[tarballs]; $startupcmd = $row[startupcmd]; $routertype = $row[routertype]; $eventstate = $row[eventstate]; $state_timestamp = $row[state_timestamp]; $op_mode = $row[op_mode]; $op_mode_timestamp = $row[op_mode_timestamp]; $IP = $row[IP]; $isvirtnode = $row[isvirtnode]; $isremotenode = $row[isremotenode]; $ipport_low = $row[ipport_low]; $ipport_next = $row[ipport_next]; $ipport_high = $row[ipport_high]; if (!$def_boot_cmd_line) $def_boot_cmd_line = " "; if (!$def_boot_path) $def_boot_path = " "; if (!$next_boot_path) $next_boot_path = " "; if (!$next_boot_cmd_line) $next_boot_cmd_line = " "; if (!$rpms) $rpms = " "; if (!$tarballs) $tarballs = " "; if (!$startupcmd) $startupcmd = " "; if (!$bios) $bios = " "; echo "\n"; echo "\n"; if ($isvirtnode) { if (strcmp($node_id, $phys_nodeid)) { echo "\n"; } } if ($vname) { echo "\n"; } if ($pid) { echo "\n"; echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; if (!$isvirtnode && !$isremotenode) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } elseif ($isvirtnode) { echo "\n"; echo "\n"; echo "\n"; } echo "\n"; echo "\n"; if (!$isvirtnode && !$isremotenode) { echo "\n"; } if (!$isvirtnode && !$isremotenode) { echo "\n"; } if ($eventstate) { $when = strftime("20%y-%m-%d %H:%M:%S", $state_timestamp); echo "\n"; } if ($op_mode) { $when = strftime("20%y-%m-%d %H:%M:%S", $op_mode_timestamp); echo "\n"; } # # We want the last login for this node, but only if its *after* the # experiment was created (or swapped in). # if ($lastnodeuidlogin = TBNodeUidLastLogin($node_id)) { $foo = $lastnodeuidlogin["date"] . " " . $lastnodeuidlogin["time"] . " " . "(" . $lastnodeuidlogin["uid"] . ")"; echo "\n"; } if ($isremotenode) { if ($isvirtnode) { SHOWWIDEAREANODE($phys_nodeid, 1); } else { SHOWWIDEAREANODE($node_id, 1); } } echo "
Node ID: $node_id
Phys ID: $phys_nodeid
Virtual Name: $vname
Project: $pid
Experiment: $eid
Node Type: $type
Control Net IP: $IP
Bios Version: $bios
Def Boot OS: "; SPITOSINFOLINK($def_boot_osid); echo "
Def Boot Path: $def_boot_path
Def Boot Command Line: $def_boot_cmd_line
Next Boot OS: "; if ($next_boot_osid) SPITOSINFOLINK($next_boot_osid); else echo " "; echo "
Next Boot Path: $next_boot_path
Next Boot Command Line: $next_boot_cmd_line
IP Port Low: $ipport_low (sshd port)
IP Port Next: $ipport_next
IP Port High: $ipport_high
Startup Command: $startupcmd
Tarballs: $tarballs
RPMs: $rpms
Router Type: $routertype
EventState: $eventstate ($when)
Operating Mode: $op_mode ($when)
Last Login: $foo
\n"; } # # Show log. # function SHOWNODELOG($node_id) { $query_result = DBQueryFatal("select * from nodelog where node_id='$node_id'". "order by reported"); if (! mysql_num_rows($query_result)) { echo "
There are no entries in the log for node $node_id.
\n"; return; } echo "
Log for node $node_id.

\n"; echo "\n"; echo "\n"; while ($row = mysql_fetch_array($query_result)) { $type = $row[type]; $log_id = $row[log_id]; $reporter = $row[reporting_uid]; $date = $row[reported]; $entry = stripslashes($row[entry]); echo "\n"; } echo "
Delete? Date ID Type Reporter Entry
o $date $log_id $type $reporter $entry
\n"; } # # Show one log entry. # function SHOWNODELOGENTRY($node_id, $log_id) { $query_result = DBQueryFatal("select * from nodelog where ". "node_id='$node_id' and log_id=$log_id"); if (! mysql_num_rows($query_result)) { return; } echo "\n"; $row = mysql_fetch_array($query_result); $type = $row[type]; $log_id = $row[log_id]; $reporter = $row[reporting_uid]; $date = $row[reported]; $entry = stripslashes($row[entry]); echo "\n"; echo "
$date $log_id $type $reporter $entry
\n"; } # # Spit out an OSID link in user format. # function SPITOSINFOLINK($osid) { if (! TBOSInfo($osid, $osname, $pid)) return; echo "$osname\n"; } # # A list of widearea accounts. # function SHOWWIDEAREAACCOUNTS($uid) { $none = TBDB_TRUSTSTRING_NONE; $query_result = DBQueryFatal("SELECT * FROM widearea_accounts ". "WHERE uid='$uid' and trust!='$none' ". "order by node_id"); if (! mysql_num_rows($query_result)) { return; } echo "

Widearea Accounts

\n"; echo "\n"; while ($row = mysql_fetch_array($query_result)) { $node_id = $row[node_id]; $approved = $row[date_approved]; $trust = $row[trust]; if (TBTrustConvert($trust) != $TBDB_TRUST_NONE) { echo "\n"; echo "\n"; } } echo "
Node ID Approved Privs
$node_id $approved $trust
\n"; } # # Show widearea node record. Just the widearea stuff, not the other. # function SHOWWIDEAREANODE($node_id, $embedded = 0) { $query_result = DBQueryFatal("select * from widearea_nodeinfo ". "where node_id='$node_id'"); $row = mysql_fetch_array($query_result); if (! mysql_num_rows($query_result)) { return; } $contact_uid = $row[contact_uid]; $machine_type = $row[machine_type]; $connect_type = $row[connect_type]; $city = $row[city]; $state = $row[state]; $country = $row[country]; $zip = $row[zip]; if (! $embedded) { echo "\n"; } else { echo "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if (! $embedded) { echo "
Widearea Info
Contact UID: $contact_uid
Machine Type: $machine_type
connect Type: $connect_type
City: $city
State: $state
Country: $country
Zip: $zip
\n"; } } # # This is an included file. # ?>