Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ttl.php - github.com/erikdubbelboer/phpRedisAdmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 92e6ccab9657b78bfaff790f169b6094336fed83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php

require_once 'includes/common.inc.php';
global $redis, $config, $csrfToken, $server;

if (isset($_POST['key'], $_POST['ttl'])) {
  if ($_POST['ttl'] == -1) {
    $redis->persist($_POST['key']);
  } else {
    $redis->expire($_POST['key'], $_POST['ttl']);
  }

  header('Location: view.php?key='.urlencode($_POST['key']));
  die;
}

$page['css'][] = 'frame';
$page['js'][]  = 'frame';

require 'includes/header.inc.php';

?>
<h2>Edit TTL</h2>
<form action="<?php echo format_html(getRelativePath('ttl.php'))?>" method="post">
<input type="hidden" name="csrf" value="<?php echo $csrfToken; ?>" />

<p>
<label for="key">Key:</label>
<input type="text" name="key" id="key" size="30" <?php echo isset($_GET['key']) ? 'value="'.format_html($_GET['key']).'"' : ''?>>
</p>

<p>
<label for="ttl"><abbr title="Time To Live">TTL</abbr>:</label>
<input type="text" name="ttl" id="ttl" size="30" <?php echo isset($_GET['ttl']) ? 'value="'.format_html($_GET['ttl']).'"' : ''?>> <span class="info">(-1 to remove the TTL)</span>
</p>

<input type="submit" class="button" value="Edit TTL">

</form>
<?php

require 'includes/footer.inc.php';

?>