|
|
@ -8,10 +8,9 @@
|
|
|
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
|
|
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace VDM\Plugin\Extension\ComponentbuilderPrivacyCompiler\Extension;
|
|
|
|
|
|
|
|
|
|
|
|
// No direct access to this file
|
|
|
|
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
|
|
|
|
defined('_JEXEC') or die('Restricted access');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use Joomla\CMS\Factory;
|
|
|
|
use Joomla\CMS\Factory;
|
|
|
|
use Joomla\CMS\Language\Text;
|
|
|
|
use Joomla\CMS\Language\Text;
|
|
|
|
use Joomla\CMS\Application\CMSApplication;
|
|
|
|
use Joomla\CMS\Application\CMSApplication;
|
|
|
@ -19,22 +18,24 @@ use Joomla\CMS\Plugin\CMSPlugin;
|
|
|
|
use Joomla\Registry\Registry;
|
|
|
|
use Joomla\Registry\Registry;
|
|
|
|
use VDM\Joomla\Utilities\JsonHelper;
|
|
|
|
use VDM\Joomla\Utilities\JsonHelper;
|
|
|
|
use VDM\Joomla\Utilities\ArrayHelper;
|
|
|
|
use VDM\Joomla\Utilities\ArrayHelper;
|
|
|
|
|
|
|
|
use VDM\Joomla\Componentbuilder\Compiler\Factory as CompilerFactory;
|
|
|
|
use VDM\Joomla\Utilities\StringHelper;
|
|
|
|
use VDM\Joomla\Utilities\StringHelper;
|
|
|
|
|
|
|
|
|
|
|
|
JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
|
|
|
|
|
|
|
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
|
|
|
|
|
|
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
|
|
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
|
|
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
|
|
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
|
|
|
|
|
|
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
|
|
|
|
|
|
|
use Joomla\Event\SubscriberInterface;
|
|
|
|
|
|
|
|
use Joomla\CMS\Plugin\PluginHelper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// No direct access to this file
|
|
|
|
|
|
|
|
defined('_JEXEC') or die('Restricted access');
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Extension - Componentbuilder Privacy Compiler plugin.
|
|
|
|
* Extension - Componentbuilder Privacy Compiler plugin.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @package ComponentbuilderPrivacyCompiler
|
|
|
|
* @package ComponentbuilderPrivacyCompiler
|
|
|
|
* @since 1.2.2
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
final class ComponentbuilderPrivacyCompiler extends CMSPlugin implements SubscriberInterface
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Affects constructor behavior. If true, language files will be loaded automatically.
|
|
|
|
* Affects constructor behavior. If true, language files will be loaded automatically.
|
|
|
@ -99,15 +100,25 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$view->addpermissions = array_values($view->addpermissions);
|
|
|
|
$view->addpermissions = array_values($view->addpermissions);
|
|
|
|
// add the new permissions
|
|
|
|
// add the new permissions
|
|
|
|
$view->addpermissions[] = array('action' => 'view.privacy.delete', 'implementation' => 3, 'title' => $view->name_list . ' Privacy Delete', 'description' => ' Allows the users in this group to remove their personal data in ' . $view->name_list . ' via the Joomla privacy suite.');
|
|
|
|
$view->addpermissions[] = [
|
|
|
|
$view->addpermissions[] = array('action' => 'view.privacy.access', 'implementation' => 3, 'title' => $view->name_list . ' Privacy Access', 'description' => ' Allows the users in this group to access their personal data in ' . $view->name_list . ' via the Joomla privacy suite.');
|
|
|
|
'action' => 'view.privacy.delete',
|
|
|
|
|
|
|
|
'implementation' => 3,
|
|
|
|
|
|
|
|
'title' => $view->name_list . ' Privacy Delete',
|
|
|
|
|
|
|
|
'description' => ' Allows the users in this group to remove their personal data in ' . $view->name_list . ' via the Joomla privacy suite.'
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
$view->addpermissions[] = [
|
|
|
|
|
|
|
|
'action' => 'view.privacy.access',
|
|
|
|
|
|
|
|
'implementation' => 3,
|
|
|
|
|
|
|
|
'title' => $view->name_list . ' Privacy Access',
|
|
|
|
|
|
|
|
'description' => ' Allows the users in this group to access their personal data in ' . $view->name_list . ' via the Joomla privacy suite.'
|
|
|
|
|
|
|
|
];
|
|
|
|
// convert back to json
|
|
|
|
// convert back to json
|
|
|
|
$view->addpermissions = json_encode($view->addpermissions, JSON_FORCE_OBJECT);
|
|
|
|
$view->addpermissions = json_encode($view->addpermissions, JSON_FORCE_OBJECT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// add placeholders to view if not already set
|
|
|
|
// add placeholders to view if not already set
|
|
|
|
if (!isset($this->activeViews[$view->id]->placeholders))
|
|
|
|
if (!isset($this->activeViews[$view->id]->placeholders))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->activeViews[$view->id]->placeholders = CFactory::_('Placeholder')->active;
|
|
|
|
$this->activeViews[$view->id]->placeholders = CompilerFactory::_('Placeholder')->active;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -124,7 +135,7 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
// check if this component needs a privacy plugin loaded
|
|
|
|
// check if this component needs a privacy plugin loaded
|
|
|
|
if ($this->loadPrivacy)
|
|
|
|
if ($this->loadPrivacy)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$plugin = JPluginHelper::getPlugin('content', 'componentbuilderprivacytabs');
|
|
|
|
$plugin = PluginHelper::getPlugin('content', 'componentbuilderprivacytabs');
|
|
|
|
// check if this is json
|
|
|
|
// check if this is json
|
|
|
|
if (isset($plugin->params) && JsonHelper::check($plugin->params))
|
|
|
|
if (isset($plugin->params) && JsonHelper::check($plugin->params))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -137,11 +148,11 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
if (isset($plugin->params['plugin']) && $plugin->params['plugin'] > 0)
|
|
|
|
if (isset($plugin->params['plugin']) && $plugin->params['plugin'] > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// if linked it will only load it once
|
|
|
|
// if linked it will only load it once
|
|
|
|
CFactory::_('Joomlaplugin.Data')->set($plugin->params['plugin']);
|
|
|
|
CompilerFactory::_('Joomlaplugin.Data')->set($plugin->params['plugin']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Factory::getApplication()->enqueueMessage(Text::_('PLG_EXTENSION_COMPONENTBUILDERPRIVACYCOMPILER_YOU_DO_NOT_HAVE_A_GLOBAL_PRIVACY_PLUGIN_SETUP_SO_THE_INTEGRATION_WITH_JOOMLA_PRIVACY_SUITE_COULD_NOT_BE_BUILD'), 'Error');
|
|
|
|
$this->getApplication()->enqueueMessage(Text::_('PLG_EXTENSION_COMPONENTBUILDERPRIVACYCOMPILER_YOU_DO_NOT_HAVE_A_GLOBAL_PRIVACY_PLUGIN_SETUP_SO_THE_INTEGRATION_WITH_JOOMLA_PRIVACY_SUITE_COULD_NOT_BE_BUILD'), 'Warning');
|
|
|
|
$this->loadPrivacy= false;
|
|
|
|
$this->loadPrivacy= false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -160,8 +171,8 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
if ($this->loadPrivacy && ArrayHelper::check($this->activeViews))
|
|
|
|
if ($this->loadPrivacy && ArrayHelper::check($this->activeViews))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// get compiler defaults
|
|
|
|
// get compiler defaults
|
|
|
|
$strictFieldExportPermissions = CFactory::_('Config')->get('permission_strict_per_field', false);
|
|
|
|
$strictFieldExportPermissions = CompilerFactory::_('Config')->get('permission_strict_per_field', false);
|
|
|
|
$exportTextOnly = CFactory::_('Config')->get('export_text_only', 1);
|
|
|
|
$exportTextOnly = CompilerFactory::_('Config')->get('export_text_only', 1);
|
|
|
|
|
|
|
|
|
|
|
|
// load the getPrivacyExport functions
|
|
|
|
// load the getPrivacyExport functions
|
|
|
|
foreach ($this->activeViews as $id => &$view)
|
|
|
|
foreach ($this->activeViews as $id => &$view)
|
|
|
@ -169,18 +180,18 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
// set permissions based on view
|
|
|
|
// set permissions based on view
|
|
|
|
if (isset($view->params['privacy']['permissions']))
|
|
|
|
if (isset($view->params['privacy']['permissions']))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CFactory::_('Config')->set('permission_strict_per_field', (bool) $view->params['privacy']['permissions']);
|
|
|
|
CompilerFactory::_('Config')->set('permission_strict_per_field', (bool) $view->params['privacy']['permissions']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// allow text only export
|
|
|
|
// allow text only export
|
|
|
|
CFactory::_('Config')->set('export_text_only', 1);
|
|
|
|
CompilerFactory::_('Config')->set('export_text_only', 1);
|
|
|
|
|
|
|
|
|
|
|
|
// set view list name
|
|
|
|
// set view list name
|
|
|
|
$viewName_list = StringHelper::safe($view->name_list);
|
|
|
|
$viewName_list = StringHelper::safe($view->name_list);
|
|
|
|
// set view single name
|
|
|
|
// set view single name
|
|
|
|
$viewName_single = StringHelper::safe($view->name_single);
|
|
|
|
$viewName_single = StringHelper::safe($view->name_single);
|
|
|
|
// load the function
|
|
|
|
// load the function
|
|
|
|
CFactory::_('Compiler.Builder.Content.Multi')->add($viewName_list . '|MODELEXPORTMETHOD',
|
|
|
|
CompilerFactory::_('Compiler.Builder.Content.Multi')->add($viewName_list . '|MODELEXPORTMETHOD',
|
|
|
|
$compiler->setGetItemsModelMethod(
|
|
|
|
$compiler->setGetItemsModelMethod(
|
|
|
|
$viewName_single,
|
|
|
|
$viewName_single,
|
|
|
|
$viewName_list,
|
|
|
|
$viewName_list,
|
|
|
@ -192,7 +203,7 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
// get the permissions building values for later if needed
|
|
|
|
// get the permissions building values for later if needed
|
|
|
|
if (CFactory::_('Config')->get('permission_strict_per_field', false) &&
|
|
|
|
if (CompilerFactory::_('Config')->get('permission_strict_per_field', false) &&
|
|
|
|
isset($compiler->permissionFields[$viewName_single]) &&
|
|
|
|
isset($compiler->permissionFields[$viewName_single]) &&
|
|
|
|
ArrayHelper::check($compiler->permissionFields[$viewName_single]))
|
|
|
|
ArrayHelper::check($compiler->permissionFields[$viewName_single]))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -201,8 +212,8 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// set compiler defaults
|
|
|
|
// set compiler defaults
|
|
|
|
CFactory::_('Config')->set('permission_strict_per_field', $strictFieldExportPermissions);
|
|
|
|
CompilerFactory::_('Config')->set('permission_strict_per_field', $strictFieldExportPermissions);
|
|
|
|
CFactory::_('Config')->set('export_text_only', $exportTextOnly);
|
|
|
|
CompilerFactory::_('Config')->set('export_text_only', $exportTextOnly);
|
|
|
|
|
|
|
|
|
|
|
|
// add helper classes
|
|
|
|
// add helper classes
|
|
|
|
$helper_strings = ['CUSTOM_HELPER_SCRIPT', 'SITE_CUSTOM_HELPER_SCRIPT', 'BOTH_CUSTOM_HELPER_SCRIPT'];
|
|
|
|
$helper_strings = ['CUSTOM_HELPER_SCRIPT', 'SITE_CUSTOM_HELPER_SCRIPT', 'BOTH_CUSTOM_HELPER_SCRIPT'];
|
|
|
@ -214,7 +225,7 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($helper_strings as $helper)
|
|
|
|
foreach ($helper_strings as $helper)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (($helper_content = CFactory::_('Compiler.Builder.Content.One')->get($helper)) !== null &&
|
|
|
|
if (($helper_content = CompilerFactory::_('Compiler.Builder.Content.One')->get($helper)) !== null &&
|
|
|
|
StringHelper::check($helper_content))
|
|
|
|
StringHelper::check($helper_content))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach ($privacy_events as $privacy_event => &$add)
|
|
|
|
foreach ($privacy_events as $privacy_event => &$add)
|
|
|
@ -229,8 +240,8 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// add the events still needed
|
|
|
|
// add the events still needed
|
|
|
|
CFactory::_('Compiler.Builder.Content.One')->add('BOTH_CUSTOM_HELPER_SCRIPT',
|
|
|
|
CompilerFactory::_('Compiler.Builder.Content.One')->add('BOTH_CUSTOM_HELPER_SCRIPT',
|
|
|
|
CFactory::_('Placeholder')->update_($this->getHelperMethod($privacy_events))
|
|
|
|
CompilerFactory::_('Placeholder')->update_($this->getHelperMethod($privacy_events))
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -248,7 +259,7 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach($this->languageArray as $key => $string)
|
|
|
|
foreach($this->languageArray as $key => $string)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CFactory::_('Language')->set('site', $key, $string);
|
|
|
|
CompilerFactory::_('Language')->set('site', $key, $string);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -299,7 +310,7 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param PrivacyPlugin \$plugin The plugin being processed";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param PrivacyPlugin \$plugin The plugin being processed";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param PrivacyRemovalStatus \$status The status being set";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param PrivacyRemovalStatus \$status The status being set";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param PrivacyTableRequest \$request The request record being processed";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param PrivacyTableRequest \$request The request record being processed";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param JUser \$user The user account associated with this request if available";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param Joomla__"."_effdaf6d_2275_425d_9f52_d4952e564d34___Power \$user The user account associated with this request if available";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @return PrivacyRemovalStatus";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @return PrivacyRemovalStatus";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " */";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " */";
|
|
|
@ -316,27 +327,27 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check if user has permission to delete " . $view->name_list;
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check if user has permission to delete " . $view->name_list;
|
|
|
|
// set the if statement based on the permission builder
|
|
|
|
// set the if statement based on the permission builder
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "if (!\$user->authorise('"
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "if (!\$user->authorise('"
|
|
|
|
. CFactory::_('Compiler.Creator.Permission')->getAction($viewName_single, 'core.delete')
|
|
|
|
. CompilerFactory::_('Compiler.Creator.Permission')->getAction($viewName_single, 'core.delete')
|
|
|
|
. "', 'com_" . Placefix::_("component") . "') && !\$user->authorise('"
|
|
|
|
. "', 'com_" . Placefix::_("component") . "') && !\$user->authorise('"
|
|
|
|
. CFactory::_('Compiler.Creator.Permission')->getAction($viewName_single, 'core.privacy.delete')
|
|
|
|
. CompilerFactory::_('Compiler.Creator.Permission')->getAction($viewName_single, 'core.privacy.delete')
|
|
|
|
. "', 'com_" . Placefix::_("component") . "'))";
|
|
|
|
. "', 'com_" . Placefix::_("component") . "'))";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "{";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "{";
|
|
|
|
// set language key
|
|
|
|
// set language key
|
|
|
|
$lang_key = $view->placeholders[Placefix::_("LANG_PREFIX")] . '_PRIVACY_CANT_REMOVE_' . $view->placeholders[Placefix::_("VIEWS")];
|
|
|
|
$lang_key = $view->placeholders[Placefix::_("LANG_PREFIX")] . '_PRIVACY_CANT_REMOVE_' . $view->placeholders[Placefix::_("VIEWS")];
|
|
|
|
// set language string
|
|
|
|
// set language string
|
|
|
|
$this->languageArray[$lang_key] = "You do not have permission to remove/delete ". $view->name_list . ".";
|
|
|
|
$this->languageArray[$lang_key] = "You do not have permission to remove/delete ". $view->name_list . ".";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "\$reasons[] = JTe" . "xt::_('" . $lang_key . "');";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "\$reasons[] = Joomla__" . "_ba6326ef_cb79_4348_80f4_ab086082e3c5___Power::_('" . $lang_key . "');";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "}";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "}";
|
|
|
|
// set language key
|
|
|
|
// set language key
|
|
|
|
$lang_key = $view->placeholders[Placefix::_("LANG_PREFIX")] . '_PRIVACY_CANT_REMOVE_CONTACT_SUPPORT';
|
|
|
|
$lang_key = $view->placeholders[Placefix::_("LANG_PREFIX")] . '_PRIVACY_CANT_REMOVE_CONTACT_SUPPORT';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check if any reasons were found not to allow removal";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check if any reasons were found not to allow removal";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "if (ArrayHelper::check(\$reasons))";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "if (Super__" . "_0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$reasons))";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "{";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "{";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "\$status->canRemove = false;";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "\$status->canRemove = false;";
|
|
|
|
// set language string
|
|
|
|
// set language string
|
|
|
|
$this->languageArray[$lang_key] = 'Please contact support for more details.';
|
|
|
|
$this->languageArray[$lang_key] = 'Please contact support for more details.';
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "\$status->reason = implode(' ' . PHP_EOL, \$reasons) . ' ' . PHP_EOL . JTe" . "xt::_('" . $lang_key . "');";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "\$status->reason = implode(' ' . PHP_EOL, \$reasons) . ' ' . PHP_EOL . Joomla__" . "_ba6326ef_cb79_4348_80f4_ab086082e3c5___Power::_('" . $lang_key . "');";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "}";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "}";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "return \$status;";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "return \$status;";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . "}" . PHP_EOL;
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . "}" . PHP_EOL;
|
|
|
@ -358,7 +369,7 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param PrivacyPlugin \$plugin The plugin being processed";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param PrivacyPlugin \$plugin The plugin being processed";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param DomainArray \$domains The array of domains";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param DomainArray \$domains The array of domains";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param PrivacyTableRequest \$request The request record being processed";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param PrivacyTableRequest \$request The request record being processed";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param JUser \$user The user account associated with this request if available";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param Joomla__"."_effdaf6d_2275_425d_9f52_d4952e564d34___Power \$user The user account associated with this request if available";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @return PrivacyExportDomain[]";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @return PrivacyExportDomain[]";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " */";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " */";
|
|
|
@ -374,9 +385,9 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check if user has permission to access " . $view->name_list;
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check if user has permission to access " . $view->name_list;
|
|
|
|
// set the if statement based on the permission builder
|
|
|
|
// set the if statement based on the permission builder
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "if (\$user->authorise('"
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "if (\$user->authorise('"
|
|
|
|
. CFactory::_('Compiler.Creator.Permission')->getGlobal($viewName_single, 'core.access')
|
|
|
|
. CompilerFactory::_('Compiler.Creator.Permission')->getGlobal($viewName_single, 'core.access')
|
|
|
|
. "', 'com_" . Placefix::_("component") . "') || \$user->authorise('"
|
|
|
|
. "', 'com_" . Placefix::_("component") . "') || \$user->authorise('"
|
|
|
|
. CFactory::_('Compiler.Creator.Permission')->getGlobal($viewName_single, 'core.privacy.access')
|
|
|
|
. CompilerFactory::_('Compiler.Creator.Permission')->getGlobal($viewName_single, 'core.privacy.access')
|
|
|
|
. "', 'com_" . Placefix::_("component") . "'))";
|
|
|
|
. "', 'com_" . Placefix::_("component") . "'))";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "{";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "{";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Get " . $view->name_single . " domain";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Get " . $view->name_single . " domain";
|
|
|
@ -396,7 +407,7 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . "/**";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . "/**";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * Create the domain for the " . $view->name_single;
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * Create the domain for the " . $view->name_single;
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param JTableUser \$user The JTableUser object to process";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param Joomla__"."_11accf54_fcb9_4ba0_a645_7c80ce14e224___Power \$user The Joomla__"."_11accf54_fcb9_4ba0_a645_7c80ce14e224___Power object to process";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @return PrivacyExportDomain";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @return PrivacyExportDomain";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " */";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " */";
|
|
|
@ -444,7 +455,7 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Get all item details of " . $view->name_list . " that belong to this user";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Get all item details of " . $view->name_list . " that belong to this user";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "\$items = \$model->getPrivacyExport(\$pks, \$user);";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "\$items = \$model->getPrivacyExport(\$pks, \$user);";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check if we have items since permissions could block the request";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " check if we have items since permissions could block the request";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "if (ArrayHelper::check(\$items))";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "if (Super__" . "_0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$items))";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "{";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "{";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Remove " . $view->name_single . " default columns";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Remove " . $view->name_single . " default columns";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "foreach (array('params', 'asset_id', 'checked_out', 'checked_out_time', 'created', 'created_by', 'modified', 'modified_by', 'published', 'ordering', 'access', 'version', 'hits') as \$column)";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "foreach (array('params', 'asset_id', 'checked_out', 'checked_out_time', 'created', 'created_by', 'modified', 'modified_by', 'published', 'ordering', 'access', 'version', 'hits') as \$column)";
|
|
|
@ -553,7 +564,7 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * Removes the data associated with a remove information request";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * Removes the data associated with a remove information request";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param PrivacyTableRequest \$request The request record being processed";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param PrivacyTableRequest \$request The request record being processed";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param JUser \$user The user account associated with this request if available";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param Joomla__"."_effdaf6d_2275_425d_9f52_d4952e564d34___Power \$user The user account associated with this request if available";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @return void";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @return void";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " */";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " */";
|
|
|
@ -576,9 +587,9 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check if user has permission to delet " . $view->name_list;
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " Check if user has permission to delet " . $view->name_list;
|
|
|
|
// set the if statement based on the permission builder
|
|
|
|
// set the if statement based on the permission builder
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "if (\$user->authorise('"
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "if (\$user->authorise('"
|
|
|
|
. CFactory::_('Compiler.Creator.Permission')->getAction($viewName_single, 'core.delete')
|
|
|
|
. CompilerFactory::_('Compiler.Creator.Permission')->getAction($viewName_single, 'core.delete')
|
|
|
|
. "', 'com_" . Placefix::_("component") . "') || \$user->authorise('"
|
|
|
|
. "', 'com_" . Placefix::_("component") . "') || \$user->authorise('"
|
|
|
|
. CFactory::_('Compiler.Creator.Permission')->getAction($viewName_single, 'core.privacy.delete')
|
|
|
|
. CompilerFactory::_('Compiler.Creator.Permission')->getAction($viewName_single, 'core.privacy.delete')
|
|
|
|
. "', 'com_" . Placefix::_("component") . "'))";
|
|
|
|
. "', 'com_" . Placefix::_("component") . "'))";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "{";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "{";
|
|
|
|
// check if this is a plain delete, or it is a Anonymize
|
|
|
|
// check if this is a plain delete, or it is a Anonymize
|
|
|
@ -627,7 +638,7 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param JTableUser \$user The JTableUser object to process";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @param Joomla__"."_11accf54_fcb9_4ba0_a645_7c80ce14e224___Power \$user The Joomla__"."_11accf54_fcb9_4ba0_a645_7c80ce14e224___Power object to process";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " *";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @return void";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " * @return void";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " */";
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . " */";
|
|
|
@ -681,7 +692,7 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " get all items for the " . $view->name_list . " table that belong to this user";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__) . " get all items for the " . $view->name_list . " table that belong to this user";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "\$pks = \$db->setQuery(\$query)->loadColumn();";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "\$pks = \$db->setQuery(\$query)->loadColumn();";
|
|
|
|
|
|
|
|
|
|
|
|
$methods .= PHP_EOL .PHP_EOL . Indent::_(2) . "if (ArrayHelper::check(\$pks))";
|
|
|
|
$methods .= PHP_EOL .PHP_EOL . Indent::_(2) . "if (Super__" . "_0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$pks))";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "{";
|
|
|
|
$methods .= PHP_EOL . Indent::_(2) . "{";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " get the " . $viewName_single . " model";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " get the " . $viewName_single . " model";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "\$model = self::getModel('" . $viewName_single . "', JPATH_ADMINISTRATOR . '/components/com_" . Placefix::_("component") . "');";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "\$model = self::getModel('" . $viewName_single . "', JPATH_ADMINISTRATOR . '/components/com_" . Placefix::_("component") . "');";
|
|
|
@ -738,7 +749,7 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
if ($hasPermissional)
|
|
|
|
if ($hasPermissional)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$methods .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Get global permissional control activation. (default is inactive)";
|
|
|
|
$methods .= PHP_EOL . PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " Get global permissional control activation. (default is inactive)";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "\$strict_permission_per_field = \JComponentHelper::getParams('com_" . Placefix::_("component") . "')->get('strict_permission_per_field', 0);";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "\$strict_permission_per_field = Joomla__" . "_aeb8e463_291f_4445_9ac4_34b637c12dbd___Power::getParams('com_" . Placefix::_("component") . "')->get('strict_permission_per_field', 0);";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "if(\$strict_permission_per_field)";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "if(\$strict_permission_per_field)";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "{";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "{";
|
|
|
|
$methods .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " remove all fields that is not permitted to be changed";
|
|
|
|
$methods .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " remove all fields that is not permitted to be changed";
|
|
|
@ -768,7 +779,7 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "\$table = \$model->getTable();";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "\$table = \$model->getTable();";
|
|
|
|
|
|
|
|
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " check that we still have pseudoanonymised data for " . $view->name_list . " set";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "//" . Line::_(__Line__, __Class__) . " check that we still have pseudoanonymised data for " . $view->name_list . " set";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "if (!ArrayHelper::check(\$pseudoanonymisedData))";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "if (!Super__" . "_0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$pseudoanonymisedData))";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "{";
|
|
|
|
$methods .= PHP_EOL . Indent::_(3) . "{";
|
|
|
|
$methods .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " still archive all items";
|
|
|
|
$methods .= PHP_EOL . Indent::_(4) . "//" . Line::_(__Line__, __Class__) . " still archive all items";
|
|
|
|
$methods .= PHP_EOL . Indent::_(4) . "\$table->publish(\$pks, 2);";
|
|
|
|
$methods .= PHP_EOL . Indent::_(4) . "\$table->publish(\$pks, 2);";
|
|
|
@ -819,4 +830,21 @@ class PlgExtensionComponentbuilderPrivacyCompiler extends CMSPlugin
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . "}" . PHP_EOL;
|
|
|
|
$methods .= PHP_EOL . Indent::_(1) . "}" . PHP_EOL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Returns an array of events this subscriber will listen to.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return array
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @since 5.0.0
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public static function getSubscribedEvents(): array
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'jcb_ce_onBeforeModelViewData' => 'jcb_ce_onBeforeModelViewData',
|
|
|
|
|
|
|
|
'jcb_ce_onAfterGet' => 'jcb_ce_onAfterGet',
|
|
|
|
|
|
|
|
'jcb_ce_onBeforeUpdateFiles' => 'jcb_ce_onBeforeUpdateFiles',
|
|
|
|
|
|
|
|
'jcb_ce_onBeforeSetLangFileData' => 'jcb_ce_onBeforeSetLangFileData'
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|