From 2371f0e64d8775334782baace87e49df7b0a7b42 Mon Sep 17 00:00:00 2001 From: agree <37550360+greenbea@users.noreply.github.com> Date: Sat, 9 May 2020 00:11:48 -0400 Subject: [PATCH] Phrases add permission (#5258) * Update app_config.php * Update phrase_edit.php --- app/phrases/app_config.php | 3 +++ app/phrases/phrase_edit.php | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/app/phrases/app_config.php b/app/phrases/app_config.php index b8ef8fd0e7..8fe3fa4c6c 100644 --- a/app/phrases/app_config.php +++ b/app/phrases/app_config.php @@ -67,6 +67,9 @@ $apps[$x]['permissions'][$y]['groups'][] = "admin"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "phrase_execute"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $y++; $apps[$x]['permissions'][$y]['name'] = "phrase_domain"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $y++; diff --git a/app/phrases/phrase_edit.php b/app/phrases/phrase_edit.php index c83d212965..102c10d00a 100644 --- a/app/phrases/phrase_edit.php +++ b/app/phrases/phrase_edit.php @@ -133,6 +133,10 @@ $array['phrases'][0]['phrase_description'] = $phrase_description; if ($_POST['phrase_detail_function'] != '') { + if ($_POST['phrase_detail_function'] == 'execute' && substr($_POST['phrase_detail_data'], 0,5) != "sleep" && !permission_exists("phrase_execute")) { + header("Location: phrase_edit.php"); + exit; + } $_POST['phrase_detail_tag'] = 'action'; // default, for now $_POST['phrase_detail_group'] = "0"; // one group, for now @@ -188,6 +192,10 @@ $array['phrases'][0]['phrase_description'] = $phrase_description; if ($_POST['phrase_detail_function'] != '') { + if ($_POST['phrase_detail_function'] == 'execute' && substr($_POST['phrase_detail_data'], 0,5) != "sleep" && !permission_exists("phrase_execute")) { + header("Location: phrase_edit.php?id=".$phrase_uuid); + exit; + } $_POST['phrase_detail_tag'] = 'action'; // default, for now $_POST['phrase_detail_group'] = "0"; // one group, for now