File manager - Edit - /home/opticamezl/www/newok/user.zip
Back
PK ��\��֔� � src/Extension/UserPlugin.phpnu �[��� <?php /** * @package Joomla.Plugin * @subpackage Privacy.user * * @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\Plugin\Privacy\User\Extension; use Joomla\CMS\Language\Text; use Joomla\CMS\Table\User as TableUser; use Joomla\CMS\User\User; use Joomla\CMS\User\UserHelper; use Joomla\Component\Privacy\Administrator\Plugin\PrivacyPlugin; use Joomla\Component\Privacy\Administrator\Removal\Status; use Joomla\Component\Privacy\Administrator\Table\RequestTable; use Joomla\Database\ParameterType; use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Privacy plugin managing Joomla user data * * @since 3.9.0 */ final class UserPlugin extends PrivacyPlugin { /** * Performs validation to determine if the data associated with a remove information request can be processed * * This event will not allow a super user account to be removed * * @param RequestTable $request The request record being processed * @param User $user The user account associated with this request if available * * @return Status * * @since 3.9.0 */ public function onPrivacyCanRemoveData(RequestTable $request, User $user = null) { $status = new Status(); if (!$user) { return $status; } if ($user->authorise('core.admin')) { $status->canRemove = false; $status->reason = Text::_('PLG_PRIVACY_USER_ERROR_CANNOT_REMOVE_SUPER_USER'); } return $status; } /** * Processes an export request for Joomla core user data * * This event will collect data for the following core tables: * * - #__users (excluding the password, otpKey, and otep columns) * - #__user_notes * - #__user_profiles * - User custom fields * * @param RequestTable $request The request record being processed * @param User $user The user account associated with this request if available * * @return \Joomla\Component\Privacy\Administrator\Export\Domain[] * * @since 3.9.0 */ public function onPrivacyExportRequest(RequestTable $request, User $user = null) { if (!$user) { return []; } /** @var TableUser $userTable */ $userTable = User::getTable(); $userTable->load($user->id); $domains = []; $domains[] = $this->createUserDomain($userTable); $domains[] = $this->createNotesDomain($userTable); $domains[] = $this->createProfileDomain($userTable); $domains[] = $this->createCustomFieldsDomain('com_users.user', [$userTable]); return $domains; } /** * Removes the data associated with a remove information request * * This event will pseudoanonymise the user account * * @param RequestTable $request The request record being processed * @param User $user The user account associated with this request if available * * @return void * * @since 3.9.0 */ public function onPrivacyRemoveData(RequestTable $request, User $user = null) { // This plugin only processes data for registered user accounts if (!$user) { return; } $pseudoanonymisedData = [ 'name' => 'User ID ' . $user->id, 'username' => bin2hex(random_bytes(12)), 'email' => 'UserID' . $user->id . 'removed@email.invalid', 'block' => true, ]; $user->bind($pseudoanonymisedData); $user->save(); // Destroy all sessions for the user account UserHelper::destroyUserSessions($user->id); } /** * Create the domain for the user notes data * * @param TableUser $user The TableUser object to process * * @return \Joomla\Component\Privacy\Administrator\Export\Domain * * @since 3.9.0 */ private function createNotesDomain(TableUser $user) { $domain = $this->createDomain('user_notes', 'joomla_user_notes_data'); $db = $this->getDatabase(); $query = $db->getQuery(true) ->select('*') ->from($db->quoteName('#__user_notes')) ->where($db->quoteName('user_id') . ' = :userid') ->bind(':userid', $user->id, ParameterType::INTEGER); $items = $db->setQuery($query)->loadAssocList(); // Remove user ID columns foreach (['user_id', 'created_user_id', 'modified_user_id'] as $column) { $items = ArrayHelper::dropColumn($items, $column); } foreach ($items as $item) { $domain->addItem($this->createItemFromArray($item, $item['id'])); } return $domain; } /** * Create the domain for the user profile data * * @param TableUser $user The TableUser object to process * * @return \Joomla\Component\Privacy\Administrator\Export\Domain * * @since 3.9.0 */ private function createProfileDomain(TableUser $user) { $domain = $this->createDomain('user_profile', 'joomla_user_profile_data'); $db = $this->getDatabase(); $query = $db->getQuery(true) ->select('*') ->from($db->quoteName('#__user_profiles')) ->where($db->quoteName('user_id') . ' = :userid') ->order($db->quoteName('ordering') . ' ASC') ->bind(':userid', $user->id, ParameterType::INTEGER); $items = $db->setQuery($query)->loadAssocList(); foreach ($items as $item) { $domain->addItem($this->createItemFromArray($item)); } return $domain; } /** * Create the domain for the user record * * @param TableUser $user The TableUser object to process * * @return \Joomla\Component\Privacy\Administrator\Export\Domain * * @since 3.9.0 */ private function createUserDomain(TableUser $user) { $domain = $this->createDomain('users', 'joomla_users_data'); $domain->addItem($this->createItemForUserTable($user)); return $domain; } /** * Create an item object for a TableUser object * * @param TableUser $user The TableUser object to convert * * @return \Joomla\Component\Privacy\Administrator\Export\Item * * @since 3.9.0 */ private function createItemForUserTable(TableUser $user) { $data = []; $exclude = ['password', 'otpKey', 'otep']; foreach (array_keys($user->getFields()) as $fieldName) { if (!in_array($fieldName, $exclude)) { $data[$fieldName] = $user->$fieldName; } } return $this->createItemFromArray($data, $user->id); } } PK ��\�� � services/provider.phpnu �[��� <?php /** * @package Joomla.Plugin * @subpackage Fields.user * * @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Extension\PluginInterface; use Joomla\CMS\Factory; use Joomla\CMS\Plugin\PluginHelper; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use Joomla\Event\DispatcherInterface; use Joomla\Plugin\Fields\User\Extension\User; return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.3.0 */ public function register(Container $container) { $container->set( PluginInterface::class, function (Container $container) { $dispatcher = $container->get(DispatcherInterface::class); $plugin = new User( $dispatcher, (array) PluginHelper::getPlugin('fields', 'user') ); $plugin->setApplication(Factory::getApplication()); return $plugin; } ); } }; PK ��\E<Zz z user.xmlnu �[��� <?xml version="1.0" encoding="UTF-8"?> <extension type="plugin" group="fields" method="upgrade"> <name>plg_fields_user</name> <author>Joomla! Project</author> <creationDate>2016-03</creationDate> <copyright>(C) 2016 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>3.7.0</version> <description>PLG_FIELDS_USER_XML_DESCRIPTION</description> <namespace path="src">Joomla\Plugin\Fields\User</namespace> <files> <folder>params</folder> <folder plugin="user">services</folder> <folder>src</folder> <folder>tmpl</folder> </files> <languages> <language tag="en-GB">language/en-GB/plg_fields_user.ini</language> <language tag="en-GB">language/en-GB/plg_fields_user.sys.ini</language> </languages> </extension> PK 4��\���� � edit.xmlnu �[��� <?xml version="1.0" encoding="UTF-8"?> <metadata> <layout title="COM_USERS_USER_VIEW_EDIT_TITLE"> <message> <![CDATA[COM_USERS_USER_VIEW_EDIT_DESC]]> </message> </layout> </metadata> PK 4��\g �5� � edit.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_users * * @copyright (C) 2008 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; /** @var Joomla\Component\Users\Administrator\View\User\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->document->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); $input = Factory::getApplication()->getInput(); // Get the form fieldsets. $fieldsets = $this->form->getFieldsets(); $settings = []; $this->useCoreUI = true; ?> <form action="<?php echo Route::_('index.php?option=com_users&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="user-form" enctype="multipart/form-data" aria-label="<?php echo Text::_('COM_USERS_USER_FORM_' . ((int) $this->item->id === 0 ? 'NEW' : 'EDIT'), true); ?>" class="form-validate"> <h2><?php echo $this->escape($this->form->getValue('name', null, Text::_('COM_USERS_USER_NEW_USER_TITLE'))); ?></h2> <div class="main-card"> <?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => 'details', 'recall' => true, 'breakpoint' => 768]); ?> <?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'details', Text::_('COM_USERS_USER_ACCOUNT_DETAILS')); ?> <fieldset class="options-form"> <legend><?php echo Text::_('COM_USERS_USER_ACCOUNT_DETAILS'); ?></legend> <div class="form-grid"> <?php echo $this->form->renderFieldset('user_details'); ?> </div> </fieldset> <?php echo HTMLHelper::_('uitab.endTab'); ?> <?php if ($this->grouplist) : ?> <?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'groups', Text::_('COM_USERS_ASSIGNED_GROUPS')); ?> <fieldset id="fieldset-groups" class="options-form"> <legend><?php echo Text::_('COM_USERS_ASSIGNED_GROUPS'); ?></legend> <div> <?php echo $this->loadTemplate('groups'); ?> </div> </fieldset> <?php echo HTMLHelper::_('uitab.endTab'); ?> <?php endif; ?> <?php $this->ignore_fieldsets = ['user_details']; echo LayoutHelper::render('joomla.edit.params', $this); ?> <?php if (!empty($this->mfaConfigurationUI)) : ?> <?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'multifactorauth', Text::_('COM_USERS_USER_MULTIFACTOR_AUTH')); ?> <fieldset class="options-form"> <legend><?php echo Text::_('COM_USERS_USER_MULTIFACTOR_AUTH'); ?></legend> <?php echo $this->mfaConfigurationUI ?> </fieldset> <?php echo HTMLHelper::_('uitab.endTab'); ?> <?php endif; ?> <?php echo HTMLHelper::_('uitab.endTabSet'); ?> </div> <input type="hidden" name="task" value=""> <input type="hidden" name="return" value="<?php echo $input->getBase64('return'); ?>"> <?php echo HTMLHelper::_('form.token'); ?> </form> PK 4��\8w\#x x edit_groups.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_users * * @copyright (C) 2008 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\HTML\HTMLHelper; echo HTMLHelper::_('access.usergroups', 'jform[groups]', $this->groups, true); PK ��\����� � tmpl/user.phpnu �[��� <?php /** * @package Joomla.Plugin * @subpackage Fields.User * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Factory; $value = $field->value; if ($value == '') { return; } $value = (array) $value; $texts = []; foreach ($value as $userId) { if (!$userId) { continue; } $user = Factory::getUser($userId); if ($user) { // Use the Username $texts[] = $user->name; continue; } // Fallback and add the User ID if we get no JUser Object $texts[] = $userId; } echo htmlentities(implode(', ', $texts)); PK ��\Fx-%� � src/Extension/User.phpnu �[��� <?php /** * @package Joomla.Plugin * @subpackage Fields.user * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Plugin\Fields\User\Extension; use Joomla\CMS\Form\Form; use Joomla\Component\Fields\Administrator\Plugin\FieldsPlugin; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Fields User Plugin * * @since 3.7.0 */ final class User extends FieldsPlugin { /** * Transforms the field into a DOM XML element and appends it as a child on the given parent. * * @param stdClass $field The field. * @param \DOMElement $parent The field node parent. * @param Form $form The form. * * @return \DOMElement * * @since 3.7.0 */ public function onCustomFieldsPrepareDom($field, \DOMElement $parent, Form $form) { if ($this->getApplication()->isClient('site')) { // The user field is not working on the front end return; } return parent::onCustomFieldsPrepareDom($field, $parent, $form); } } PK ��\UR'�a a params/user.xmlnu �[��� <?xml version="1.0" encoding="UTF-8"?> <form> <field name="default_value" type="user" label="PLG_FIELDS_USER_DEFAULT_VALUE_LABEL" validate="UserId" /> <fields name="params" label="COM_FIELDS_FIELD_BASIC_LABEL"> <fieldset name="basic"> <field name="show_on" type="hidden" filter="unset" /> </fieldset> </fields> </form> PK XE�\w���O O token/token.phpnu �[��� <?php /** * @package Joomla.Site * @subpackage Layout * * @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; extract($displayData); /** * Layout variables * ----------------- * @var string $id DOM id of the field. * @var string $label Label of the field. * @var string $name Name of the input field. * @var string $value Value attribute of the field. */ Text::script('ERROR'); Text::script('MESSAGE'); Text::script('PLG_USER_TOKEN_COPY_SUCCESS'); Text::script('PLG_USER_TOKEN_COPY_FAIL'); Factory::getApplication()->getDocument()->getWebAssetManager() ->registerAndUseScript('plg_user_token.token', 'plg_user_token/token.js', [], ['defer' => true], ['core']); ?> <div class="input-group"> <input type="text" class="form-control" name="<?php echo $name; ?>" id="<?php echo $id; ?>" readonly value="<?php echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>"> <button class="btn btn-primary" type="button" id="token-copy" title="<?php echo Text::_('PLG_USER_TOKEN_COPY_DESC'); ?>"><?php echo Text::_('PLG_USER_TOKEN_COPY'); ?></button> </div> PK XE�\� ��y y terms/message.phpnu �[��� <?php /** * @package Joomla.Plugin * @subpackage User.terms * * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; extract($displayData); /** * Layout variables * ----------------- * @var string $autocomplete Autocomplete attribute for the field. * @var boolean $autofocus Is autofocus enabled? * @var string $class Classes for the input. * @var boolean $disabled Is this field disabled? * @var string $group Group the field belongs to. <fields> section in form XML. * @var boolean $hidden Is this field hidden in the form? * @var string $hint Placeholder for the field. * @var string $id DOM id of the field. * @var string $label Label of the field. * @var string $labelclass Classes to apply to the label. * @var boolean $multiple Does this field support multiple values? * @var string $name Name of the input field. * @var string $onchange Onchange attribute for the field. * @var string $onclick Onclick attribute for the field. * @var string $pattern Pattern (Reg Ex) of value of the form field. * @var boolean $readonly Is this field read only? * @var boolean $repeat Allows extensions to duplicate elements. * @var boolean $required Is this field required? * @var integer $size Size attribute of the input. * @var boolean $spellcheck Spellcheck state for the form field. * @var string $validate Validation rules to apply. * @var string $value Value attribute of the field. * @var array $options Options available for this field. * @var array $termsnote The terms note that needs to be displayed * @var array $translateLabel Should the label be translated? * @var array $translateHint Should the hint be translated? * @var array $termsArticle The Article ID holding the Terms Article */ echo '<div class="alert alert-info">' . $termsnote . '</div>'; PK XE�\s^F�+ + terms/label.phpnu �[��� <?php /** * @package Joomla.Plugin * @subpackage User.terms * * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; extract($displayData); /** * Layout variables * ----------------- * @var string $autocomplete Autocomplete attribute for the field. * @var boolean $autofocus Is autofocus enabled? * @var string $class Classes for the input. * @var boolean $disabled Is this field disabled? * @var string $group Group the field belongs to. <fields> section in form XML. * @var boolean $hidden Is this field hidden in the form? * @var string $hint Placeholder for the field. * @var string $id DOM id of the field. * @var string $label Label of the field. * @var string $labelclass Classes to apply to the label. * @var boolean $multiple Does this field support multiple values? * @var string $name Name of the input field. * @var string $onchange Onchange attribute for the field. * @var string $onclick Onclick attribute for the field. * @var string $pattern Pattern (Reg Ex) of value of the form field. * @var boolean $readonly Is this field read only? * @var boolean $repeat Allows extensions to duplicate elements. * @var boolean $required Is this field required? * @var integer $size Size attribute of the input. * @var boolean $spellcheck Spellcheck state for the form field. * @var string $validate Validation rules to apply. * @var string $value Value attribute of the field. * @var array $options Options available for this field. * @var array $termsnote The terms note that needs to be displayed * @var array $translateLabel Should the label be translated? * @var array $translateHint Should the hint be translated? * @var array $termsArticle The Article ID holding the Terms Article * @var object $article The Article object */ // Get the label text from the XML element, defaulting to the element name. $text = $label ? (string) $label : (string) $name; $text = $translateLabel ? Text::_($text) : $text; // Set required to true as this field is not displayed at all if not required. $required = true; // Build the class for the label. $class = 'required'; $class = !empty($labelclass) ? $class . ' ' . $labelclass : $class; if ($article) { $attribs = [ 'data-bs-toggle' => 'modal', 'data-bs-target' => '#tosModal', 'class' => 'required', ]; $link = HTMLHelper::_('link', Route::_($article->link . '&tmpl=component'), $text, $attribs); echo HTMLHelper::_( 'bootstrap.renderModal', 'tosModal', [ 'url' => Route::_($article->link . '&tmpl=component'), 'title' => $text, 'height' => '100%', 'width' => '100%', 'bodyHeight' => 70, 'modalWidth' => 80, 'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-hidden="true">' . Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>', ] ); } else { $link = '<span class="' . $class . '">' . $text . '</span>'; } // Add the label text and star. $label = $link . '<span class="star" aria-hidden="true"> *</span>'; echo $label; PK ��\��֔� � src/Extension/UserPlugin.phpnu �[��� PK ��\�� � � services/provider.phpnu �[��� PK ��\E<Zz z X! user.xmlnu �[��� PK 4��\���� � % edit.xmlnu �[��� PK 4��\g �5� � &