403Webshell
Server IP : 104.21.84.107  /  Your IP : 104.23.197.209
Web Server : Apache/2.4.63 (Ubuntu)
System : Linux adminpruebas-Virtual-Machine 6.14.0-37-generic #37-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 14 22:10:32 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 8.4.5
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/idiomas/plugins/system/webauthn/src/PluginTraits/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/idiomas/plugins/system/webauthn/src/PluginTraits/UserDeletion.php
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  System.Webauthn
 *
 * @copyright   (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Plugin\System\Webauthn\PluginTraits;

use Joomla\CMS\Factory;
use Joomla\CMS\Log\Log;
use Joomla\Database\DatabaseInterface;
use Joomla\Event\Event;
use Joomla\Utilities\ArrayHelper;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Delete all WebAuthn credentials for a particular user
 *
 * @since   4.0.0
 */
trait UserDeletion
{
    /**
     * Remove all passwordless credential information for the given user ID.
     *
     * This method is called after user data is deleted from the database.
     *
     * @param   Event  $event  The event we are handling
     *
     * @return  void
     *
     * @since   4.0.0
     */
    public function onUserAfterDelete(Event $event): void
    {
        /**
         * @var   array       $user    Holds the user data
         * @var   bool        $success True if user was successfully stored in the database
         * @var   string|null $msg     Message
         */
        [$user, $success, $msg] = array_values($event->getArguments());

        if (!$success) {
            $this->returnFromEvent($event, true);
        }

        $userId = ArrayHelper::getValue($user, 'id', 0, 'int');

        if ($userId) {
            Log::add("Removing WebAuthn Passwordless Login information for deleted user #{$userId}", Log::DEBUG, 'webauthn.system');

            /** @var DatabaseInterface $db */
            $db = Factory::getContainer()->get(DatabaseInterface::class);

            $query = $db->getQuery(true)
                ->delete($db->quoteName('#__webauthn_credentials'))
                ->where($db->quoteName('user_id') . ' = :userId')
                ->bind(':userId', $userId);

            try {
                $db->setQuery($query)->execute();
            } catch (\Exception) {
                // Don't worry if this fails
            }

            $this->returnFromEvent($event, true);
        }
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit