Unsupported scripts and control panel web app for a hosting company
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ssh.keys.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?PHP
  2. require_once('lib/database.php');
  3. require_once('lib/common.php');
  4. ?>
  5. <form action="<?PHP echo CP_PATH; ?>ssh" method="post">
  6. <div class="block">
  7. <h2>My SSH Keys</h2>
  8. <table class="innerblock bottomdiv">
  9. <tr>
  10. <th>&nbsp;</th>
  11. <th>Comment</th>
  12. <th>Key</th>
  13. </tr>
  14. <?PHP
  15. $i = 0;
  16. $n = 0;
  17. $sql = 'SELECT key_id, key_comment, key_key FROM sshkeys WHERE user_id = '.UID;
  18. $res = mysql_query($sql) or mf(__FILE__, __LINE__, $sql);
  19. if (mysql_num_rows($res) == 0) {
  20. echo '<tr><td colspan="3" style="font-style: italic; text-align: center;">';
  21. echo 'You have no SSH keys. Without a key you won\'t be able to access';
  22. echo ' UTD-Hosting SSH services. You may add a new key below.</td></tr>';
  23. }
  24. while ($row = mysql_fetch_array($res)) {
  25. $n++;
  26. ?>
  27. <tr class="<?PHP echo ($i == 0) ? 'even' : 'odd'; ?>">
  28. <td><input type="checkbox" name="key_<?PHP echo $row['key_id']; ?>"></td>
  29. <td><?PHP echo htmlentities($row['key_comment']); ?></td>
  30. <td style="font-family: monospace;">
  31. <?PHP echo htmlentities(substr($row['key_key'], 0, 25)); ?> &hellip;
  32. <?PHP echo htmlentities(substr($row['key_key'], -25, 25)); ?>
  33. </td>
  34. </tr>
  35. <?PHP
  36. $i = 1 - $i;
  37. }
  38. ?>
  39. </table>
  40. <div class="innerblock">
  41. <p>With selected:</p>
  42. <blockquote>
  43. <input type="submit" name="delete" value="Delete">
  44. </blockquote>
  45. </div>
  46. </div>
  47. </form>