HEX
Server: LiteSpeed
System: Linux lp015.web24.net.au 2.6.32-954.3.5.lve1.4.93.el6.x86_64 #1 SMP Wed Oct 4 17:04:29 UTC 2023 x86_64
User: pgkdistr (10190)
PHP: 8.1.32
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/pgkdistribution.com.au/citisolar.com.au/tmp/admin/install.fst.php
<?php
/**
* @Copyright Freestyle Joomla (C) 2010
* @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
*     
* This file is part of Freestyle Testimonials
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
**/
?>
<?php

defined('_JEXEC') or die(';)');
jimport('joomla.application.component.controller');
jimport('joomla.application.component.model');
jimport('joomla.installer.installer');
jimport('joomla.installer.helper');
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive');
jimport('joomla.filesystem.path');


class Status {
	var $STATUS_FAIL = 'Failed';
	var $STATUS_SUCCESS = 'Success';
	var $infomsg = array();
	var $errmsg = array();
	var $status;
}
$install_status = array();
global $install_status;

function InstallExtras()
{
	global $install_status;
	
	$pkg_path = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_fst'.DS.'extensions'.DS;
	
	if ($dir = opendir($pkg_path))
	{
		while (($file = readdir($dir)) !== false) 
		{
			if ($file == "." || $file == "..") continue;
			if (stripos($file,".zip") < 1) continue;
			
			$installer = new JInstaller();
			$installer->setOverwrite(true);	
			
			$status = new Status();
			$status->file = $pkg_path.$file;
			$status->status = $status->STATUS_FAIL;

			$package = JInstallerHelper::unpack( $pkg_path.$file );
			$status->package = print_r($package,true);
			if( $installer->install( $package['dir'] ) )
			{
				$status->status = $status->STATUS_SUCCESS;
			}
			else
			{
				$status->errmsg[]="Unable to install $file";
			}
		
			$install_status[$file] = $status;
		
			JInstallerHelper::cleanupInstall( $pkg_path.$file, $package['dir'] );
		}
	}
}

function com_install()
{
	require_once (JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_fst'.DS.'updatedb.php');
	
	$updater = new FSTUpdater();
	$updater->Process();
	
	// think this has to be done last
	InstallExtras();
	
	FST_Done();
}

function FST_Done()
{
	global $install_status;
?>

<h1>Freestyle Testimonials Installation Completed</h1>
<?php if (count($install_status) > 0): ?>
<table class="adminlist">
	<thead>
		<tr>
			<th class="title">Sub Component</th>
			<th width="60%">Status</th>
		</tr>
	</thead>
	<tfoot>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
	</tfoot>
	<tbody>
	<?php
		$i=0; 
		foreach ( $install_status as $component => $status ) {?>
		<tr class="row<?php echo $i; ?>">
			<td class="key"><?php echo $component; ?></td>
			<td>
				<?php echo ($status->status == $status->STATUS_SUCCESS)? '<strong>Installed</strong>' : '<em>Not Installed</em>'?>
				<?php if (count($status->errmsg) > 0 ) {
						foreach ( $status->errmsg as $errmsg ) {
       						echo '<br/>Error: ' . $errmsg;
						}
				} ?>
				<?php if (count($status->infomsg) > 0 ) {
						foreach ( $status->infomsg as $infomsg ) {
       						echo '<br/>Info: ' . $infomsg;
						}
				} ?>
			</td>
		</tr>	
	<?php
			if ($i=0){ $i=1;} else {$i = 0;}; 
		}?>
		
	</tbody>
</table>
<?php endif; ?>	

<?php
}
?>