rename.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. require_once 'includes/common.inc.php';
  3. if (isset($_POST['old'], $_POST['key'])) {
  4. if (strlen($_POST['key']) > $config['maxkeylen']) {
  5. die('ERROR: Your key is to long (max length is '.$config['maxkeylen'].')');
  6. }
  7. $redis->rename($_POST['old'], $_POST['key']);
  8. // Refresh the top so the key tree is updated.
  9. require 'includes/header.inc.php';
  10. ?>
  11. <script>
  12. top.location.href = top.location.pathname+'?view&s=<?php echo $server['id']?>&d=<?php echo $server['db']?>&key=<?php echo urlencode($_POST['key'])?>';
  13. </script>
  14. <?php
  15. require 'includes/footer.inc.php';
  16. die;
  17. }
  18. $page['css'][] = 'frame';
  19. $page['js'][] = 'frame';
  20. require 'includes/header.inc.php';
  21. ?>
  22. <h2>Edit Name of <?php echo format_html($_GET['key'])?></h2>
  23. <form action="<?php echo format_html($_SERVER['REQUEST_URI'])?>" method="post">
  24. <input type="hidden" name="old" value="<?php echo format_html($_GET['key'])?>">
  25. <p>
  26. <label for="key">Key:</label>
  27. <input type="text" name="key" id="key" size="30" <?php echo isset($_GET['key']) ? 'value="'.format_html($_GET['key']).'"' : ''?>>
  28. </p>
  29. <p>
  30. <input type="submit" class="button" value="Rename">
  31. </p>
  32. </form>
  33. <?php
  34. require 'includes/footer.inc.php';
  35. ?>