File manager - Edit - /home/ferretapmx/public_html/mod_privacy_status.tar
Back
mod_privacy_status.xml 0000644 00000003643 15231065545 0011221 0 ustar 00 <?xml version="1.0" encoding="UTF-8"?> <extension type="module" client="administrator" method="upgrade"> <name>mod_privacy_status</name> <author>Joomla! Project</author> <creationDate>2019-07</creationDate> <copyright>(C) 2019 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>4.0.0</version> <description>MOD_PRIVACY_STATUS_XML_DESCRIPTION</description> <namespace path="src">Joomla\Module\PrivacyStatus</namespace> <files> <folder module="mod_privacy_status">services</folder> <folder>src</folder> <folder>tmpl</folder> </files> <languages> <language tag="en-GB">language/en-GB/mod_privacy_status.ini</language> <language tag="en-GB">language/en-GB/mod_privacy_status.sys.ini</language> </languages> <help key="Admin_Modules:_Privacy_Status_Check" /> <config> <fields name="params"> <fieldset name="advanced"> <field name="layout" type="modulelayout" label="JFIELD_ALT_LAYOUT_LABEL" class="form-select" /> <field name="moduleclass_sfx" type="textarea" label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" rows="3" validate="CssIdentifier" /> <field name="cache" type="list" label="COM_MODULES_FIELD_CACHING_LABEL" default="1" filter="integer" validate="options" > <option value="1">JGLOBAL_USE_GLOBAL</option> <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> </field> <field name="cache_time" type="number" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" default="900" filter="integer" min="1" validate="number" /> <field name="cachemode" type="hidden" default="static" > <option value="static"></option> </field> </fieldset> </fields> </config> </extension> src/Helper/PrivacyStatusHelper.php 0000644 00000022257 15231065545 0013262 0 ustar 00 <?php /** * @package Joomla.Administrator * @subpackage mod_privacy_status * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Module\PrivacyStatus\Administrator\Helper; use Joomla\CMS\Application\CMSApplicationInterface; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Event\Privacy\CheckPrivacyPolicyPublishedEvent; use Joomla\CMS\Factory; use Joomla\CMS\Language\Multilanguage; use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Router\Route; use Joomla\Database\DatabaseAwareInterface; use Joomla\Database\DatabaseAwareTrait; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Helper class for admin privacy status module * * @since 4.0.0 */ class PrivacyStatusHelper implements DatabaseAwareInterface { use DatabaseAwareTrait; /** * Get the information about the published privacy policy * * @param CMSApplicationInterface $app The application * * @return array Array containing a status of whether a privacy policy is set and a link to the policy document for editing * * @since 5.3.0 */ public function getPrivacyPolicyInformation(CMSApplicationInterface $app) { $dispatcher = $app->getDispatcher(); $policy = [ 'published' => false, 'articlePublished' => false, 'editLink' => '', ]; /* * Prior to 3.9.0 it was common for a plugin such as the User - Profile plugin to define a privacy policy or * terms of service article, therefore we will also import the user plugin group to process this event. */ PluginHelper::importPlugin('privacy', null, true, $dispatcher); PluginHelper::importPlugin('user', null, true, $dispatcher); return $dispatcher->dispatch( 'onPrivacyCheckPrivacyPolicyPublished', new CheckPrivacyPolicyPublishedEvent('onPrivacyCheckPrivacyPolicyPublished', [ 'subject' => &$policy, // @todo: Remove reference in Joomla 6, see CheckPrivacyPolicyPublishedEvent::__constructor() ]) )->getArgument('subject', $policy); } /** * Check whether there is a menu item for the request form * * @param CMSApplicationInterface $app The application * * @return array Array containing a status of whether a menu is published for the request form and its current link * * @since 5.3.0 * */ public function getRequestFormMenuStatus(CMSApplicationInterface $app) { $status = [ 'exists' => false, 'published' => false, 'link' => '', ]; $lang = ''; $db = $this->getDatabase(); $query = $db->getQuery(true) ->select( [ $db->quoteName('id'), $db->quoteName('published'), $db->quoteName('language'), ] ) ->from($db->quoteName('#__menu')) ->where( [ $db->quoteName('client_id') . ' = 0', $db->quoteName('link') . ' = ' . $db->quote('index.php?option=com_privacy&view=request'), ] ) ->setLimit(1); $db->setQuery($query); $menuItem = $db->loadObject(); // Check if the menu item exists in database if ($menuItem) { $status['exists'] = true; // Check if the menu item is published if ($menuItem->published == 1) { $status['published'] = true; } // Add language to the url if the site is multilingual if (Multilanguage::isEnabled() && $menuItem->language && $menuItem->language !== '*') { $lang = '&lang=' . $menuItem->language; } } $linkMode = $app->get('force_ssl', 0) == 2 ? Route::TLS_FORCE : Route::TLS_IGNORE; if (!$menuItem) { if (Multilanguage::isEnabled()) { // Find the Itemid of the home menu item tagged to the site default language $params = ComponentHelper::getParams('com_languages'); $defaultSiteLanguage = $params->get('site'); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__menu')) ->where( [ $db->quoteName('client_id') . ' = 0', $db->quoteName('home') . ' = 1', $db->quoteName('language') . ' = :language', ] ) ->bind(':language', $defaultSiteLanguage) ->setLimit(1); $db->setQuery($query); $homeId = (int) $db->loadResult(); $itemId = $homeId ? '&Itemid=' . $homeId : ''; } else { $itemId = ''; } $status['link'] = Route::link('site', 'index.php?option=com_privacy&view=request' . $itemId, true, $linkMode); } else { $status['link'] = Route::link('site', 'index.php?Itemid=' . $menuItem->id . $lang, true, $linkMode); } return $status; } /** * Method to return number privacy requests older than X days. * * @return integer * * @since 5.3.0 */ public function getNumberOfUrgentRequests() { // Load the parameters. $params = ComponentHelper::getComponent('com_privacy')->getParams(); $notify = (int) $params->get('notify', 14); $now = Factory::getDate()->toSql(); $period = '-' . $notify; $db = $this->getDatabase(); $query = $db->getQuery(true); $query->select('COUNT(*)') ->from($db->quoteName('#__privacy_requests')) ->where( [ $db->quoteName('status') . ' = 1', $query->dateAdd($db->quote($now), $period, 'DAY') . ' > ' . $db->quoteName('requested_at'), ] ); $db->setQuery($query); return (int) $db->loadResult(); } /** * Method to return database encryption details * * @return string The database encryption details * * @since 5.3.0 */ public function getDatabaseConnectionEncryption() { return $this->getDatabase()->getConnectionEncryption(); } /** * Get the information about the published privacy policy * * @return array Array containing a status of whether a privacy policy is set and a link to the policy document for editing * * @since 4.0.0 * * @deprecated 5.3.0 will be removed in 7.0 * Use the non-static method getPrivacyPolicyInformation * Example: Factory::getApplication()->bootModule('mod_privacy_status', 'administrator') * ->getHelper('PrivacyStatusHelper') * ->getPrivacyPolicyInformation(Factory::getApplication()) */ public static function getPrivacyPolicyInfo() { $app = Factory::getApplication(); return $app->bootModule('mod_privacy_status', 'administrator') ->getHelper('PrivacyStatusHelper') ->getPrivacyPolicyInformation($app); } /** * Check whether there is a menu item for the request form * * @return array Array containing a status of whether a menu is published for the request form and its current link * * @since 4.0.0 * * @deprecated 5.3.0 will be removed in 7.0 * Use the non-static method getRequestFormMenuStatus * Example: Factory::getApplication()->bootModule('mod_privacy_status', 'administrator') * ->getHelper('PrivacyStatusHelper') * ->getRequestFormMenuStatus(Factory::getApplication()) */ public static function getRequestFormPublished() { $app = Factory::getApplication(); return $app->bootModule('mod_privacy_status', 'administrator') ->getHelper('PrivacyStatusHelper') ->getRequestFormMenuStatus($app); } /** * Method to return number privacy requests older than X days. * * @return integer * * @since 4.0.0 * * @deprecated 5.3.0 will be removed in 7.0 * Use the non-static method getNumberOfUrgentRequests * Example: Factory::getApplication()->bootModule('mod_privacy_status', 'administrator') * ->getHelper('PrivacyStatusHelper') * ->getNumberOfUrgentRequests() */ public static function getNumberUrgentRequests() { return Factory::getApplication()->bootModule('mod_privacy_status', 'administrator') ->getHelper('PrivacyStatusHelper') ->getNumberOfUrgentRequests(); } } src/Helper/.htaccess 0000555 00000000355 15231065545 0010362 0 ustar 00 <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>