From 25b48263953f542b53a9dd4c00b993033729cd2e Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Mon, 15 Apr 2013 08:56:50 +0200 Subject: [PATCH] show specific templates only if corresponding feature is enabled, fixes #1191 Signed-off-by: Michael Kaufmann (d00p) --- admin_templates.php | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/admin_templates.php b/admin_templates.php index 41b93aeb..fb1c6685 100644 --- a/admin_templates.php +++ b/admin_templates.php @@ -48,17 +48,28 @@ elseif(isset($_GET['id'])) $available_templates = array( 'createcustomer', 'pop_success', - 'trafficmaxpercent', - 'diskmaxpercent', - 'new_ticket_by_customer', - 'new_ticket_for_customer', - 'new_ticket_by_staff', - 'new_reply_ticket_by_customer', - 'new_reply_ticket_by_staff', 'new_database_by_customer', 'new_ftpaccount_by_customer', 'password_reset' ); + +// only show templates of features that are enabled #1191 +if ((int)$settings['system']['report_enable'] == 1) { + array_push($available_templates, + 'trafficmaxpercent', + 'diskmaxpercent' + ); +} +if ((int)$settings['ticket']['enabled'] == 1) { + array_push($available_templates, + 'new_ticket_by_customer', + 'new_ticket_for_customer', + 'new_ticket_by_staff', + 'new_reply_ticket_by_customer', + 'new_reply_ticket_by_staff' + ); +} + $file_templates = array( 'index_html' );