__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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
/**
 * CustomTables Joomla! 3.x/4.x/5.x Component
 * @package Custom Tables
 * @author Ivan Komlev <[email protected]>
 * @link https://joomlaboat.com
 * @copyright (C) 2018-2024. Ivan Komlev
 * @license GNU/GPL Version 2 or later - https://www.gnu.org/licenses/gpl-2.0.html
 **/

namespace CustomTables;

defined('_JEXEC') or die();

use Exception;

//------------- CURRENTLY UNUSED

class ImportExportUserGroups
{
	/**
	 * @throws Exception
	 * @since 3.2.2
	 */
	public static function processFile($filename, &$msg): bool
	{
		if (file_exists($filename)) {
			$data = common::getStringFromFile($filename);

			if (!str_contains($data, '<usergroupsexport>')) {
				$msg = 'Uploaded file does not contain User Groups JSON data.';
				return false;
			}

			$jsondata = json_decode(str_replace('<usergroupsexport>', '', $data), true);

			return ImportExportUserGroups::processData($jsondata, $msg);
		} else {
			$msg = 'Uploaded file not found. Code EX02';
			return false;
		}
	}

	/**
	 * @throws Exception
	 * @since 3.2.2
	 */
	protected static function processData($jsondata): bool
	{
		$usergroups = $jsondata['usergroups'];

		foreach ($usergroups as $usergroup) {
			$old = ImportTables::getRecordByField('#__usergroups', 'id', $usergroup['id'], false);
			if (is_array($old) and count($old) > 0)
				ImportTables::updateRecords('#__usergroups', $usergroup, $old, false, array(), true);
			else
				$usergroupid = ImportTables::insertRecords('#__usergroups', $usergroup, false, array(), true);
		}

		$viewlevels = $jsondata['viewlevels'];

		foreach ($viewlevels as $viewlevel) {
			$old = ImportTables::getRecordByField('#__viewlevels', 'id', $viewlevel['id'], false);
			if (is_array($old) and count($old) > 0)
				ImportTables::updateRecords('#__viewlevels', $viewlevel, $old, false, array(), true);
			else
				$usergroupidid = ImportTables::insertRecords('#__viewlevels', $viewlevel, false, array(), true);
		}

		return true;
	}

	/**
	 * @throws Exception
	 * @since 3.2.2
	 */
	public static function exportUserGroups(): ?string
	{
		$whereClause = new MySQLWhereClause();

		//This function will export user groups
		//$query = 'SELECT * FROM #__usergroups';
		$usergroups = database::loadAssocList('#__usergroups', ['*'], $whereClause);
		if (count($usergroups) == 0)
			return null;

		//$query = 'SELECT * FROM #__viewlevels';
		$viewLevels = database::loadAssocList('#__viewlevels', ['*'], $whereClause);
		if (count($viewLevels) == 0)
			return null;

		$output = ['usergroups' => $usergroups, 'viewlevels' => $viewLevels];

		if (count($output) > 0) {
			$output_str = '<usergroupsexport>' . common::ctJsonEncode($output);

			$tmp_path = JPATH_SITE . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR;
			$filename = 'usergroups';
			$filename_available = $filename;
			$a = '';
			$i = 0;
			do {
				if (!file_exists($tmp_path . $filename . $a . '.txt')) {
					$filename_available = $filename . $a . '.txt';
					break;
				}

				$i++;
				$a = $i . '';

			} while (1 == 1);

			$link = '/tmp/' . $filename_available;

			$msg = common::saveString2File($tmp_path . $filename_available, $output_str);
			if ($msg !== null) {
				common::enqueueMessage($tmp_path . $filename_available . ': ' . $msg);
				return null;
			}
			return $link;
		}
		return null;
	}

}

Filemanager

Name Type Size Permission Actions
codemirror Folder 0775
customtables Folder 0775
extratasks Folder 0775
fieldtypes Folder 0775
js Folder 0775
tagprocessor Folder 0775
twig Folder 0775
virtualselect Folder 0775
ct-common-joomla.php File 22.88 KB 0664
ct-database-joomla.php File 37.47 KB 0664
esinputbox.php File 1.95 KB 0664
importcsv.php File 12.15 KB 0664
layout.php File 2.61 KB 0664
layouteditor.php File 6.4 KB 0664
pagination.php File 18.72 KB 0664
unused-exportusergroups.php File 3.35 KB 0664
uploader.php File 12.73 KB 0664
Filemanager