<?php include 'MyFunctions.inc.php'; if (isset($_GET["id_keyring"])) { $id_keyring = $_GET["id_keyring"]; } else { $id_keyring = ""; } if (isset($_GET["keyring_name"])) { $keyring_name = $_GET["keyring_name"]; } else { $keyring_name = ""; } $keyring_name = get_keyring_name($id_keyring); if (!empty($id_keyring)) { ?> <html> <head> <title>Keyring Deployment Process</title> <LINK REL=STYLESHEET HREF="skm.css" TYPE="text/css"> </head> <body> <?php start_main_frame(); start_left_pane(); display_menu(); end_left_pane(); start_right_pane();
echo "<tr>\n"; echo " <td class='detail2'><img src='images/mister.gif' border=0>{$name_account} <a href=\"decrypt_key.php?action=deploy_account&id={$id}&id_account={$id_account}\">[Deploy]</a></td>\n"; //No need for "Deleted" icon //echo(" <td class='detail2'><a href='deploy.php?id=$id&id_account=$id_account&action=deleteAccount'><img src=\"images/delete.gif\" border=0 alt=\"Delete\"></a></td>\n"); echo "</tr>\n"; // looking for keyrings //--------------------- $keyrings = mysql_query("SELECT * FROM `hak` WHERE `id_host` = '{$id}' and `id_account` ='{$id_account}'") or die(mysql_error() . "<br>Couldn't execute query: {$query}"); $nr_keyrings = mysql_num_rows($keyrings); if (empty($nr_keyrings)) { echo "<tr><td class='detail3'>No keyrings associated</td><td class='detail2'></td></tr>>\n"; } else { while ($keyringrow = mysql_fetch_array($keyrings)) { // Afecting values $id_keyring = $keyringrow["id_keyring"]; $name_keyring = get_keyring_name($id_keyring); // Displaying rows echo "<tr>\n"; echo " <td class='detail3'><img src='images/keyring_little.gif' border='0'>{$name_keyring}</td>\n"; echo "</tr>\n"; } mysql_free_result($keyrings); } } mysql_free_result($accounts); } //echo ("<tr><td class='detail2'><a href=\"ha_setup.php?id=$id&host_name=$name=\">Click here to add account(s) to $name</a><img src='images/add.gif' border='0'></td></tr>\n"); } } // END EXPAND mysql_free_result($result);
function display_keyring($id_host, $id_account, $id_keyring, $hostgroup, $ident_level, $display) { // ident_level : level of identation to display element // display (Y/N) : display keys in current keyring $name_keyring = get_keyring_name($id_keyring); // Displaying rows if ($display == "N") { echo "<tr>\n"; echo " <td class='detail1'><a href=\"account-view.php?id={$id_host}&hostgroup={$hostgroup}&action=expandkeyring&id_account={$id_account}&id_keyring={$id_keyring}\"><img src='images/expand.gif' border='0'></a><img src='images/keyring_little.gif' border='0'>{$name_keyring} "; echo "<a href='account-view.php?id={$id_host}&id_account={$id_account}&id_keyring={$id_keyring}&action=deleteKeyring&hostgroup={$hostgroup}'>[ Delete ]</a></td>\n"; echo "</tr>\n"; } else { echo "<tr>\n"; echo " <td class='detail1'><a href=\"account-view.php?id={$id_host}&id_account={$id_account}&id_keyring={$id_keyring}&action=collapsekeyring&hostgroup={$hostgroup}\"><img src='images/collapse.gif' border='0'></a><img src='images/keyring_little.gif' border='0'>{$name_keyring} "; echo "<a href='account-view.php?id={$id_host}&id_account={$id_account}&id_keyring={$id_keyring}&action=deleteKeyring&hostgroup={$hostgroup}'>[ Delete ]</a></td>\n"; echo "</tr>\n"; // looking for keys $keys = mysql_query("SELECT * FROM `keyrings-keys` WHERE `id_keyring` = '{$id_keyring}'") or die(mysql_error() . "<br>Couldn't execute query: {$query}"); $nr_keys = mysql_num_rows($keys); if (empty($nr_keys)) { //echo ("<tr><td class='$ident_level'>No keys associated</td><td class='$ident_level'></td></tr>\n"); echo "<tr><td class='{$ident_level}'>No keys associated</td></tr>\n"; } else { while ($keyrow = mysql_fetch_array($keys)) { // Afecting values //$name = $keyrow["name"]; $id_key = $keyrow["id_key"]; display_key($id_host, $id_account, $id_key, $hostgroup, $ident_level); } // end while mysql_free_result($keys); } //end if } //end if }