// HOST DISPLAY $id_currenthost = $row["id_host"]; if ($id_currenthost != $id_lasthost) { $hostname = get_host_name($id_currenthost); $line = "<tr><td class='title'><img src='images/server.gif' border='0'>{$hostname}</td></tr>\n"; $id_lastaccount = ""; } $id_lasthost = $id_currenthost; // ACCOUNT DISPLAY $id_currentaccount = $row["id_account"]; if ($id_currentaccount != $id_lastaccount) { $accountname = get_account_name($id_currentaccount); $line .= "<tr><td class='detail1'><img src='images/mister.gif' border='0'>{$accountname}</td></tr>\n"; } $id_lastaccount = $id_currentaccount; $keyname = get_key_name($id_currentkey); $line .= "<tr><td class='detail2'><img src='images/key_little.gif' border='0'>{$keyname}</td></tr>\n"; echo "{$line}\n"; } } echo "</table></fieldset>\n"; } // We will seek all accounts of the Servers that contain the keyring application... // --------------------------------------------------------------------------------------- $resultkeyring = mysql_query("SELECT * FROM `keyrings-keys` where `id_key` = '{$id_key}' ORDER BY `id_keyring`") or die(mysql_error() . "<br>Couldn't execute query: {$query}"); while ($rowkeyring = mysql_fetch_array($resultkeyring)) { $id_keyring = $rowkeyring["id_keyring"]; $result = mysql_query("SELECT * FROM `hak` where `id_keyring` = '{$id_keyring}' ORDER BY `id_host`") or die(mysql_error() . "<br>Couldn't execute query: {$query}"); $keyring_name = get_keyring_name($id_keyring); $nr = mysql_num_rows($result); if (empty($nr)) {
} echo "<a href='keyrings_setup.php?id={$id}'>| edit name</a><a href='keyrings.php?id={$id}&action=delete'>| Delete ]</a>\n"; echo "<tr>\n"; // DISPLAY DETAILS ONLY IF EXPAND=Y if ($row['expand'] == "Y") { // looking for keys $keys = mysql_query("SELECT * FROM `keyrings-keys` WHERE `id_keyring` = '{$id}'") or die(mysql_error() . "<br>Couldn't execute query: {$query}"); $nr_keys = mysql_num_rows($keys); if (empty($nr_keys)) { echo "<tr><td class='detail2'>No keys associated</td></tr>\n"; } else { while ($keyrow = mysql_fetch_array($keys)) { // Afecting values //$name = $keyrow["name"]; $id_key = $keyrow["id_key"]; $name_key = get_key_name($id_key); // Displaying rows echo "<tr>\n"; echo " <td class='detail2'><img src='images/key_little.gif' border=0 >{$name_key}\n"; echo "<a href='keyrings.php?id={$id}&id_key={$id_key}&action=deleteJT'>[ Delete ]</a></td>\n"; echo "</tr>\n"; } mysql_free_result($keys); } //echo ("<tr><td class='detail2'><br><a href=\"kk_setup.php?id=$id&keyring_name=$name\">Click here to add key(s) to $name</a><img src='images/add.gif' border='0'></td></tr>\n"); } //END expand } mysql_free_result($result); } ?>
function display_key($id_host, $id_account, $id_key, $hostgroup, $ident_level) { // Afecting values //$name = $keyrow["name"]; $name_key = get_key_name($id_key); // Displaying rows echo "<tr>\n"; echo " <td class='{$ident_level}'><img src='images/key_little.gif' border=0 >{$name_key} "; // If indent_level == 2, we are displaying key within if ($ident_level != "detail2") { echo "<a href='account-view.php?id={$id_host}&id_account={$id_account}&id_key={$id_key}&hostgroup={$hostgroup}&action=deleteKey'>[ Delete ]</a></td>\n"; } echo "</tr>\n"; }