TYPE-0 PERFECT SEIHA
Server Info:
FreeBSD scimitar.blueboard.cz 13.5-STABLE FreeBSD 13.5-STABLE stable/13-4f2925105 GENERIC amd64
Software:
Apache
User:
www
Crot
Crot File
Crot Dir
Crot Command
[LockSelf]
[HOME]
data
www
19068
fszoo_net
addlogo
home
app
presenters
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/addlogo/home/app/presenters/HomepagePresenter.php
<?php namespace App\Presenters; use Fszoo\LogoControl; use Nette; class HomepagePresenter extends Nette\Application\UI\Presenter { /** * @var LogoControl * @inject */ public $logoControl; /** * @return Nette\Application\UI\Control */ protected function createComponentForm(){ $control = new Nette\Application\UI\Form(); $control->addUpload('image', 'Image', TRUE)->addRule(Nette\Application\UI\Form::IMAGE); $control->addSubmit('formsubmitted', 'Send'); $control->onSuccess[] = function() use ($control){ $this->formSubmitted($control, $control->values); }; return $control; } public function formSubmitted(Nette\Application\UI\Form $form, Nette\Utils\ArrayHash $values){ foreach($values->image as $image){ $this->logoControl->process($image->toImage(), $this->context->parameters['appDir'].'/../temp/out/'.substr($image->name, 0, -4).'.jpg'); } } public function actionAddLogo(){ // create random directory in temp $dir = $this->context->parameters['appDir'].'/../temp/'.time(); mkdir($dir); foreach(Nette\Utils\Finder::findFiles('*.jpg')->in($this->context->parameters['wwwDir'].'/server/php/files') as $path => $file){ $image = Nette\Utils\Image::fromFile($path); $parts = explode('/', $path); $name = end($parts); $this->logoControl->process($image, $dir.'/'.substr($name, 0, -4).'.jpg'); }; // create zip $zip = new \ZipArchive(); $filename = $dir.".zip"; if ($zip->open($filename, \ZipArchive::CREATE)!==TRUE) { exit("cannot open <$filename>\n"); } foreach(Nette\Utils\Finder::findFiles('*.jpg')->in($dir) as $path => $file){ $parts = explode('/', $path); $name = end($parts); $zip->addFile($path, $name); } $zip->close(); header("Content-type: application/force-download"); header("Content-Transfer-Encoding: Binary"); header("Content-length: ".filesize($filename)); header("Content-disposition: attachment; filename=fszoo_logo.zip"); readfile("$filename"); die(); } }
Crotin
Name
Size
Permissions
Modified
User/Group
templates
-
0755
2015-09-30 18:28:44
Unknown/Unknown
HomepagePresenter.php
1997
0644
2015-09-30 18:28:28
Unknown/Unknown
ErrorPresenter.php
717
0644
2015-09-30 18:28:28
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin