protected function startup() { parent::startup(); if (!$this->user->isAllowed('update', 'edit')) { $this->flashMessage('Nemáte oprávnění pro přístup!', 'error'); $this->redirect('Homepage:'); } $this->path = $this->serverRepo->getPath($this->selectedServerId); }
public function handleDelete($serverId) { $path = $this->serverRepo->getPath($serverId); try { $this->serverRepo->removeServer($serverId); BackupModel::removeDir($path); } catch (Exception $ex) { dump($ex); } $this->presenter->flashMessage("Smazáno.", 'success'); $this->presenter->redirect('this'); }
public function handleMakeBackup() { $path = $this->serverRepo->getPath($this->selectedServerId); if ($this->backupModel->backup($path, $this->runtimeHash)) { $this->flashMessage('Záloha úspěšná', 'success'); } else { $this->flashMessage('Něco se nepovedlo :/', 'error'); } if ($this->isAjax()) { $this->redrawControl(); } else { $this->redirect('this'); } }