-
Notifications
You must be signed in to change notification settings - Fork 66
/
counters.php
65 lines (53 loc) · 1.77 KB
/
counters.php
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/*
Cassandra Cluster Admin
@author Sébastien Giroux
@copyright All rights reserved - 2011
*/
require('include/kernel.inc.php');
require('include/verify_login.inc.php');
$keyspace_name = '';
if (isset($_GET['keyspace_name'])) {
$keyspace_name = $_GET['keyspace_name'];
}
$columnfamily_name = '';
if (isset($_GET['columnfamily_name'])) {
$columnfamily_name = $_GET['columnfamily_name'];
}
echo getHTML('header.php');
// Make sure a keyspace name has been specified
if (empty($keyspace_name)) {
echo displayErrorMessage('keyspace_name_must_be_specified');
}
else {
if (empty($columnfamily_name)) {
echo displayErrorMessage('columnfamily_name_must_be_specified');
}
else {
$one_cf = ColumnFamilyHelper::getCFInKeyspace($keyspace_name,$columnfamily_name);
// Make sure the column family exists in this keyspace
if ($one_cf) {
$vw_vars['success_message'] = '';
$vw_vars['error_message'] = '';
// Success
if (isset($_GET['new_value'])) {
$new_value = $_GET['new_value'];
$vw_vars['success_message'] = displaySuccessMessage('edit_counter',array('value' => $new_value));
}
// Error
if (isset($_GET['error'])) {
$vw_vars['error_message'] = displayErrorMessage('something_wrong_happened',array('message' => $_SESSION['message']));
}
$vw_vars['cluster_name'] = $sys_manager->describe_cluster_name();
$vw_vars['keyspace_name'] = $keyspace_name;
$vw_vars['columnfamily_name'] = $columnfamily_name;
$vw_vars['is_super_cf'] = $one_cf->column_type == 'Super';
echo getHTML('counters.php',$vw_vars);
}
else {
echo displayErrorMessage('columnfamily_doesnt_exists',array('column_name' => $columnfamily_name));
}
}
}
echo getHTML('footer.php');
?>