Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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');
 }
Exemplo n.º 3
0
 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');
     }
 }