Exemplo n.º 1
0
 public function request()
 {
     if (!$this->session->exists()) {
         $this->redirectNoSession();
         return false;
     }
     if ($this->getRequestVar('save')) {
         $filePath = base64_decode(str_rot13($this->getRequestVar('save')));
         $file = new \fpcm\model\files\dbbackup(basename($filePath));
         if (!$file->exists()) {
             $this->view = new \fpcm\model\view\error();
             $this->view->setMessage($this->lang->translate('GLOBAL_NOTFOUND_FILE'));
             $this->view->render();
             die;
         }
         header('Content-Description: File Transfer');
         header('Content-Type: ' . $file->getMimetype());
         header('Content-Disposition: attachment; filename="' . $file->getFilename() . '"');
         header('Expires: 0');
         header('Cache-Control: must-revalidate');
         header('Pragma: public');
         header('Content-Length: ' . $file->getFilesize());
         readfile($file->getFullpath());
         exit;
     }
     return true;
 }
Exemplo n.º 2
0
 public function process()
 {
     if (!parent::process()) {
         return false;
     }
     if (!$this->moduleKey) {
         $this->view = new \fpcm\model\view\error();
         $this->view->setMessage('Selected module not found in installed modules!');
         return $this->view->render();
     }
     $this->events->runEvent('acpConfig', $this->moduleKey);
     $this->view->render();
 }