__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php
/**
 * @package   DPCalendar
 * @copyright Copyright (C) 2020 Digital Peak GmbH. <https://www.digital-peak.com>
 * @license   https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
 */

namespace DigitalPeak\Component\DPCalendar\Administrator\Booking\Stages;

\defined('_JEXEC') or die();

use DigitalPeak\Component\DPCalendar\Administrator\Pipeline\StageInterface;
use Joomla\CMS\Application\CMSApplicationInterface;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Form\Form;
use Joomla\CMS\User\UserHelper;
use Joomla\Component\Users\Site\Model\RegistrationModel;
use Joomla\Database\DatabaseInterface;

class CreateUser implements StageInterface
{
	public function __construct(
		private readonly CMSApplicationInterface $application,
		private readonly DatabaseInterface $db,
		private readonly RegistrationModel $model
	) {
	}

	public function __invoke(\stdClass $payload): \stdClass
	{
		$data = [];
		// Do not create when state is not active and previous state was active as well
		if ($payload->item->state != 1 || ($payload->oldItem && $payload->oldItem->state == 1)) {
			return $payload;
		}

		// Only create the user when respective setting is set and user_id is not set
		if (ComponentHelper::getParams('com_dpcalendar')->get('booking_registration', 1) != 2 || $payload->data['user_id']) {
			return $payload;
		}

		// Check if there is a user with the email already
		$query = $this->db->getQuery(true)
			->select('id')->from('#__users')
			->where('email = ' . $this->db->quote($payload->data['email']));
		$this->db->setQuery($query, 0, 1);

		if ($this->db->loadResult()) {
			return $payload;
		}

		$this->application->getLanguage()->load('com_users', JPATH_SITE);
		Form::addFormPath(JPATH_SITE . '/components/com_users/forms');

		$data['name']         = $payload->data['name'];
		$data['email1']       = $payload->data['email'];
		$data['username']     = $payload->data['email'];
		$data['password1']    = UserHelper::genRandomPassword();
		$data['requireReset'] = 1;

		if (!$this->model->register($data)) {
			$this->application->enqueueMessage($this->model->getError(), 'warning');
		}

		$this->db->setQuery($query, 0, 1);
		$payload->item->user_id = $this->db->loadResult();

		return $payload;
	}
}

Filemanager

Name Type Size Permission Actions
AdjustCustomFields.php File 1.06 KB 0664
AssignUserGroups.php File 1.21 KB 0664
CollectEventsAndTickets.php File 2.99 KB 0664
CreateOrUpdateTickets.php File 4.59 KB 0664
CreateUser.php File 2.19 KB 0664
FetchLocationData.php File 1.52 KB 0664
SendInviteMail.php File 2.51 KB 0664
SendNewBookingMail.php File 4.75 KB 0664
SendNotificationMail.php File 3.43 KB 0664
SendPaidBookingMail.php File 3.38 KB 0664
SendWaitingListMail.php File 3.09 KB 0664
SetupForMail.php File 3.27 KB 0664
SetupForNew.php File 15.99 KB 0664
SetupForUpdate.php File 1.96 KB 0664
SetupLanguage.php File 1.51 KB 0664
Filemanager