| Server IP : 87.98.154.146 / Your IP : 216.73.216.101 Web Server : Apache System : Linux webm005.cluster126.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : bsiadvisil ( 110003) PHP Version : 7.3.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/bsiadvisil/www/plugins/system/msframework/ |
Upload File : |
<?php
/**
* MS Framework
*
* @package MS Framework Plugin
* @version 1.2.1.573
*
* @author Michael Snoeren
* @link https://snoerendevelopment.nl/
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
// Deny direct access
defined('_JEXEC') or die;
class PlgSystemMSFrameworkInstallerScript
{
/**
* Class Data
* @var Boolean
* @access Private
*/
private $methodExists = false;
/**
* Installation Preflight
* @access Public
* @return Void
*/
public function preflight()
{
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
$file = __DIR__ . '/key.sdkey';
$newFile = JPATH_ROOT . '/plugins/system/msframework/key.sdkey';
$key = '';
// Check the method before installing the software
$this->methodExists = method_exists('MSFrameworkInstall', 'showMessage');
// Copy the keyfile to the installation
$key = $this->copyKey($file, $newFile);
}
/**
* Installation Postflight
* @param String $type The type of installation
* @access Public
* @return Void
*/
public function postflight($type)
{
// Enable the plugin by default
$this->setEnabled();
// Load the language
$lang = JFactory::getLanguage();
$lang->load('plg_msframework', JPATH_BASE, $lang->getTag(), true);
// Run the update script
if (!class_exists('MSFrameworkUpdater') &&
file_exists(JPATH_ROOT . '/libraries/msframework/helpers/updater.php')) {
require JPATH_ROOT . '/libraries/msframework/helpers/updater.php';
}
if (class_exists('MSFrameworkUpdater') && method_exists('MSFrameworkUpdater', 'execute')) {
MSFrameworkUpdater::execute();
}
// Show a message
if ($type === 'install') {
if (!$this->methodExists) {
JFactory::getApplication()->enqueueMessage(JText::_('PLG_MSFRAMEWORK_MSG_INSTALLED'), 'message');
} else {
MSFrameworkInstall::showMessage('PLG_MSFRAMEWORK_MSG_INSTALLED');
}
} elseif ($type === 'update') {
if (!$this->methodExists) {
JFactory::getApplication()->enqueueMessage(JText::_('PLG_MSFRAMEWORK_MSG_UPDATED'), 'message');
} else {
MSFrameworkInstall::showMessage('PLG_MSFRAMEWORK_MSG_UPDATED');
}
}
// Install the key
if (!class_exists('MSFrameworkKey')) {
require JPATH_ROOT . '/plugins/system/msframework/helper/key.php';
}
MSFrameworkKey::set($key);
}
/**
* Set the plugin enabled
* @access Private
* @return Boolean
*/
private function setEnabled()
{
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query
->update('#__extensions')
->set(array(
$db->quoteName('enabled') . ' = 1'
))
->where(array(
$db->quoteName('name') . ' = ' . $db->quote('PLG_MSFRAMEWORK'),
$db->quoteName('type') . ' = ' . $db->quote('plugin'),
$db->quoteName('element') . ' = ' . $db->quote('msframework')
));
$db->setQuery($query);
return $db->execute();
}
/**
* Copy the keyfile to the right location
* @param String $file The current file
* @param String $nfile The new file
* @access Private
* @return String Returns the key if found
*/
private function copyKey($file, $nfile)
{
$key = '';
// Copy the keyfile to the installation
if (JFile::exists($file)) {
if (!JFolder::exists(dirname($nfile))) {
JFolder::create(dirname($nfile));
}
rename($file, $nfile);
$key = file_get_contents($nfile);
// Remove any illegal stuff
$key = preg_replace('/[^\w]/', '', $key);
}
return $key;
}
}