<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
+ | CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017 |
+ | Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2017
+ * @copyright CiviCRM LLC (c) 2004-2018
* $Id$
*
*/
$values = $form->controller->exportValues($form->get('searchFormName'));
$form->_task = $values['task'];
- $eventTasks = CRM_Event_Task::tasks();
- $form->assign('taskName', $eventTasks[$form->_task]);
+ $tasks = CRM_Event_Task::permissionedTaskTitles(CRM_Core_Permission::getPermission());
+ if (!array_key_exists($form->_task, $tasks)) {
+ CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
+ }
+ $form->assign('taskName', $tasks[$form->_task]);
$ids = array();
if ($values['radio_ts'] == 'ts_sel') {