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_sliderck/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/maitricfuz/www/saint-martin-lg/administrator/components/com_sliderck//install.php
<?php
/**
 * @name		Slider CK
 * @package		com_sliderck
 * @copyright	Copyright (C) 2015. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 * @author		Cedric Keiflin - https://www.template-creator.com - https://www.joomlack.fr
 */
 
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 {

		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 SliderCK_installer_uninstall($adapter);
		}

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

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

} else {
	class com_sliderckInstallerScript {

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

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

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

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


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

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

function SliderCK_installer_preflight($type, $parent) {
	// disable the install on Joomla 3
	if (version_compare(JVERSION, '4') === -1) {
		throw new RuntimeException('This version of Slider CK can not be installed on Joomla 3. Please use the version 2.3.1');
	}
	// disable the install on Joomla 4
	if (version_compare(JVERSION, '5', '<')) {
		Factory::getApplication()->enqueueMessage('This version of Slider CK can not be installed on Joomla 4. Please use the version 2.4.6.', 'error');
		return false;
	}

	return true;
}

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

	// module
	$result = SliderCK_installer_installExtension($src_ext.'/mod_sliderck');
	$status[] = array('name'=>'Slider CK - Module','type'=>'module', 'result'=>$result);

	// system plugin
	$result = SliderCK_installer_installExtension($src_ext.'/sliderck');
	$status[] = array('name'=>'System - Slider 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` = 'sliderck' AND `type` = 'plugin'");
	$db->execute();

	// sliderck 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 = SliderCK_installer_installExtension($plugins_src_ext . '/' . $plugin);
		$status[] = array('name'=>'Slider 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` = 'sliderck'");
		$db->execute();
		$ordering++;
	}

	// disable the old update site
	$db->setQuery("UPDATE #__update_sites SET enabled = '0' WHERE `location` = 'http://update.joomlack.fr/mod_sliderck_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_sliderck_update.xml'");
	$result4 = $db->execute();
	// disable the light update site
	$db->setQuery("UPDATE #__update_sites SET enabled = '0' WHERE `location` = 'https://update.joomlack.fr/sliderck_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>';
	}

	return true;
}

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

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


Anon7 - 2022
AnonSec Team