Fixed count (php 7.2) issue across JCB. Improved the setModelExportMethod method in the compiler to now work as a setGetItemsModelMethod instead. Added more strict permissional implementation per/field across the export methods of JCB.
This commit is contained in:
@ -97,9 +97,15 @@ class ComponentbuilderModelDynamic_gets extends JModelList
|
||||
// set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ComponentbuilderHelper::checkObject($user))
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
}
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder'));
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && $user->authorise('dynamic_get.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
@ -250,6 +256,9 @@ class ComponentbuilderModelDynamic_gets extends JModelList
|
||||
/**
|
||||
* Method to get list export data.
|
||||
*
|
||||
* @param array $pks The ids of the items to get
|
||||
* @param JUser $user The user making the request
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExportData($pks, $user = null)
|
||||
@ -257,10 +266,10 @@ class ComponentbuilderModelDynamic_gets extends JModelList
|
||||
// setup the query
|
||||
if (ComponentbuilderHelper::checkArray($pks))
|
||||
{
|
||||
// Set a value to know this is exporting method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
|
||||
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
|
||||
$_export = true;
|
||||
// Get the user object if not set.
|
||||
if (ComponentbuilderHelper::checkObject($user))
|
||||
if (!isset($user) || !ComponentbuilderHelper::checkObject($user))
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
}
|
||||
@ -296,7 +305,8 @@ class ComponentbuilderModelDynamic_gets extends JModelList
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder'));
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && $user->authorise('dynamic_get.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
|
Reference in New Issue
Block a user