Merge branch '581-Error-en-custom-graphs' into 'develop'

When there is no custom graph redirects to the graph list

See merge request !363
This commit is contained in:
vgilc 2017-04-17 09:47:11 +02:00
commit 86a4ca2a80
2 changed files with 21 additions and 0 deletions

View File

@ -65,6 +65,17 @@ $change_weight = (bool) get_parameter('change_weight', false);
$change_label = (bool) get_parameter('change_label', false);
$id_graph = (int) get_parameter('id', 0);
if($id_graph !== 0){
$sql = "SELECT * FROM tgraph
WHERE (private = 0 OR (private = 1 AND id_user = '".$config["id_user"]."'))
AND id_graph = ".$id_graph;
$control = db_process_sql($sql);
if(!$control){
header('Location: index.php?sec=reporting&sec2=godmode/reporting/graphs');
}
}
if ($add_graph) {
$name = get_parameter_post ("name");
$description = get_parameter_post ("description");

View File

@ -25,6 +25,16 @@ $delete_graph = (bool) get_parameter ('delete_graph');
$view_graph = (bool) get_parameter ('view_graph');
$id_graph = (int) get_parameter ('id');
if($id_graph !== 0){
$sql = "SELECT * FROM tgraph
WHERE (private = 0 OR (private = 1 AND id_user = '".$config["id_user"]."'))
AND id_graph = ".$id_graph;
$control = db_process_sql($sql);
if(!$control){
header('Location: index.php?sec=reporting&sec2=godmode/reporting/graphs');
}
}
// Delete module SQL code
if ($delete_graph) {
if (check_acl ($config['id_user'], 0, "AW")) {