From 07d7bb083441b763049ff6224042f35efadb8a7b Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 11 Feb 2019 19:20:07 +0100 Subject: [PATCH] return true if operation was succesful --- controllers/class.Download.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/controllers/class.Download.php b/controllers/class.Download.php index 4232aa848..12526c29a 100644 --- a/controllers/class.Download.php +++ b/controllers/class.Download.php @@ -38,6 +38,7 @@ class SeedDMS_Controller_Download extends SeedDMS_Controller_Common { sendFile($dms->contentDir . $content->getPath()); } } + return true; } /* }}} */ public function file() { /* {{{ */ @@ -55,6 +56,7 @@ class SeedDMS_Controller_Download extends SeedDMS_Controller_Common { sendFile($dms->contentDir . $file->getPath()); } } + return true; } /* }}} */ public function archive() { /* {{{ */ @@ -75,6 +77,7 @@ class SeedDMS_Controller_Download extends SeedDMS_Controller_Common { sendFile($basedir .$filename ); } } + return true; } /* }}} */ public function log() { /* {{{ */ @@ -94,6 +97,7 @@ class SeedDMS_Controller_Download extends SeedDMS_Controller_Common { sendFile($basedir.$filename); } } + return true; } /* }}} */ public function sqldump() { /* {{{ */ @@ -113,6 +117,7 @@ class SeedDMS_Controller_Download extends SeedDMS_Controller_Common { sendFile($basedir.$filename); } } + return true; } /* }}} */ public function approval() { /* {{{ */ @@ -123,7 +128,7 @@ class SeedDMS_Controller_Download extends SeedDMS_Controller_Common { $filename = $dms->contentDir . $document->getDir().'a'.$logid; if (!file_exists($filename) ) { $this->error = 1; - return; + return false; } if(null === $this->callHook('approval')) { @@ -137,6 +142,7 @@ class SeedDMS_Controller_Download extends SeedDMS_Controller_Common { header("Cache-Control: must-revalidate"); sendFile($filename); } + return true; } /* }}} */ public function review() { /* {{{ */ @@ -147,7 +153,7 @@ class SeedDMS_Controller_Download extends SeedDMS_Controller_Common { $filename = $dms->contentDir . $document->getDir().'r'.$logid; if (!file_exists($filename) ) { $this->error = 1; - return; + return false; } if(null === $this->callHook('review')) { @@ -181,25 +187,25 @@ class SeedDMS_Controller_Download extends SeedDMS_Controller_Common { $this->params['content'] = $content; switch($type) { case "version": - $this->version(); + return $this->version(); break; case "file": - $this->file(); + return $this->file(); break; case "archive": - $this->archive(); + return $this->archive(); break; case "log": - $this->log(); + return $this->log(); break; case "sqldump": - $this->sqldump(); + return $this->sqldump(); break; case "approval": - $this->approval(); + return $this->approval(); break; case "review": - $this->review(); + return $this->review(); break; } } /* }}} */