AnonSec Shell
Server IP : 46.105.57.169  /  Your IP : 216.73.216.144
Web Server : Apache
System : Linux webd003.cluster120.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : maitricfuz ( 93378)
PHP Version : 8.4.10
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/maitricfuz/www/saint-martin-lg/administrator/components/com_maximenuck/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/maitricfuz/www/saint-martin-lg/administrator/components/com_maximenuck/install.php
<?php

defined('_JEXEC') or die('Restricted access');

use Joomla\CMS\Factory;
use Joomla\CMS\Installer\Installer;
use Joomla\CMS\Installer\InstallerAdapter;
use Joomla\CMS\Installer\InstallerScriptInterface;
use Joomla\CMS\Language\Text;

/*
	preflight which is executed before install and update
	install
	update
	uninstall
	postflight which is executed after install and update
	*/

if (version_compare(JVERSION, 6, '>=')) {
	return new class () implements InstallerScriptInterface {

		// private string $minimumJoomla = '4.4.0';
		// private string $minimumPhp    = '7.4.0';

		public function install(InstallerAdapter $adapter): bool
		{
			// not used
			return true;
		}

		public function update(InstallerAdapter $adapter): bool
		{
			// not used
			return true;
		}

		public function uninstall(InstallerAdapter $adapter): bool
		{
			return MaximenuCK_installer_uninstall($adapter);
		}

		public function preflight(string $type, InstallerAdapter $adapter): bool
		{
			return MaximenuCK_installer_preflight($type, $adapter);
			
			// if (version_compare(PHP_VERSION, $this->minimumPhp, '<')) {
				// Factory::getApplication()->enqueueMessage(sprintf(Text::_('JLIB_INSTALLER_MINIMUM_PHP'), $this->minimumPhp), 'error');
				// return false;
			// }

			// if (version_compare(JVERSION, $this->minimumJoomla, '<')) {
				// Factory::getApplication()->enqueueMessage(sprintf(Text::_('JLIB_INSTALLER_MINIMUM_JOOMLA'), $this->minimumJoomla), 'error');
				// return false;
			// }

			// return true;
		}

		public function postflight(string $type, InstallerAdapter $adapter): bool
		{
			return MaximenuCK_installer_postflight($type, $adapter);
		}
	};

} else {
	class com_maximenuckInstallerScript {

		function install($parent) {
			// not used
			return true;
		}
		
		function update($parent) {
			// not used
			return true;
		}

		function uninstall($parent) {
			return MaximenuCK_installer_uninstall($parent);
		}

		function preflight($type, $parent) {
			return MaximenuCK_installer_preflight($type, $parent);
		}

		// run on install and update
		function postflight($type, $parent) {
			jimport('joomla.installer.installer');
			return MaximenuCK_installer_postflight($type, $parent);
		}
	}
}

function MaximenuCK_installer_uninstall($parent) {
	// disable all plugins and modules
	$db = \Joomla\CMS\Factory::getDbo();
	$db->setQuery("UPDATE `#__modules` SET `published` = 0 WHERE `module` LIKE '%maximenuck%'");
	$db->execute();

	$db->setQuery("UPDATE `#__extensions` SET `enabled` = 0 WHERE `type` = 'plugin' AND `element` LIKE '%maximenuck%' AND `folder` NOT LIKE '%maximenuck%'");
	$db->execute();
	return true;
}

function MaximenuCK_installer_preflight($type, $parent) {
	// disable the install on Joomla 3
	if (version_compare(JVERSION, '4') === -1) {
		throw new RuntimeException('This version of Maximenu CK can not be installed on Joomla 3. Please use the version 10.0.12.');
	}

	// disable the install on Joomla 4
	if (version_compare(JVERSION, '5', '<')) {
		throw new RuntimeException('This version of Maximenu CK can not be installed on Joomla 4. Please use the version 10.1.19.');
	}

	$db = \Joomla\CMS\Factory::getDbo();
	$db->setQuery("SELECT id FROM #__modules WHERE `module` = 'mod_maximenuck' AND `params` LIKE '%\"isv9\":\"0\"%'");
	$oldItems = $db->loadObjectList();

	if (! empty($oldItems)) {
		foreach ($oldItems as $oldItem) {
			throw new RuntimeException('<div>Installation error : You have an old module in V8 mode, ID <b>' . $oldItem->id . '. You must convert your module, please check the infos on https://forum.joomlack.fr</b>.<br/> This check is made to help you to update your website safely.</div>');
		}
		return;
	}

	return true;
}

// run on install and update
function MaximenuCK_installer_postflight($type, $parent) {
	// install modules and plugins
	$db = \Joomla\CMS\Factory::getDbo();
	$status = array();
	$src_ext = dirname(__FILE__).'/administrator/extensions';

	// module
	$result = MaximenuCK_installer_installExtension($src_ext.'/mod_maximenuck');
	$status[] = array('name'=>'Maximenu CK - Module','type'=>'module', 'result'=>$result);

	// system plugin
	$result = MaximenuCK_installer_installExtension($src_ext.'/maximenuck');
	$status[] = array('name'=>'System - Maximenu CK','type'=>'plugin', 'result'=>$result);
	// system plugin must be enabled for user group limits and private areas
	$db->setQuery("UPDATE #__extensions SET enabled = '1' WHERE `element` = 'maximenuck' AND `type` = 'plugin'");
	$db->execute();

	// maximenuck plugin
	// slideshowck plugin
	$plugins_src_ext = $src_ext . '/plugins';

	// check that the folder still exists
	if (! is_dir($plugins_src_ext)) return true;

	$plugins = array_values(array_filter(scandir($plugins_src_ext), function ($entry) use ($plugins_src_ext) {
		return $entry !== '.' && $entry !== '..' && is_dir($plugins_src_ext . '/' . $entry);
	}));
	$ordering = 1;
	foreach ($plugins as $plugin) {
		$result = MaximenuCK_installer_installExtension($plugins_src_ext . '/' . $plugin);
		$status[] = array('name' => 'Maximenu CK - ' . $plugin, 'type' => 'plugin', 'result' => $result);
		// auto enable the plugin
		$db->setQuery("UPDATE #__extensions SET enabled = '1', ordering = '" . $ordering . "' WHERE `element` = '" . $plugin . "' AND `type` = 'plugin' AND `folder` = 'maximenuck'");
		$db->execute();
		$ordering++;
	}

	// disable the old update site
	$db->setQuery("UPDATE #__update_sites SET enabled = '0' WHERE `location` = 'http://update.joomlack.fr/mod_maximenuck_update.xml'");
	$result3 = $db->execute();
	// disable the old update site
	$db->setQuery("UPDATE #__update_sites SET enabled = '0' WHERE `location` = 'http://update.joomlack.fr/com_maximenuck_update.xml'");
	$result4 = $db->execute();
	// disable the light update site
	$db->setQuery("UPDATE #__update_sites SET enabled = '0' WHERE `location` = 'https://update.joomlack.fr/maximenuck_light_update.xml'");
	$result3 = $db->execute();

	foreach ($status as $statu) {
		if ($statu['result'] == true) {
			$alert = 'success';
			$icon = 'icon-ok';
			$text = 'Successful';
		} else {
			$alert = 'warning';
			$icon = 'icon-cancel';
			$text = 'Failed';
		}
		echo '<div class="alert alert-' . $alert . '"><i class="icon ' . $icon . '"></i>Installation and activation of the <b>' . $statu['type'] . ' ' . $statu['name'] . '</b> : ' . $text . '</div>';
	}

	// check for table creation
	require_once JPATH_ROOT . '/administrator/components/com_maximenuck/helpers/helper.php';
	Maximenuck\Helper::checkDbIntegrity();

	return true;
}

function MaximenuCK_installer_installExtension($path) {
	$installer = new Installer();
	$installer->setDatabase(Factory::getDbo());

	return $installer->install($path);
}


Anon7 - 2022
AnonSec Team