From d1d83c9e97fc4542a0b8c19ddf27fef3a0beb46e Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 16 Sep 2013 21:22:52 +0200 Subject: Remove executable bits Signed-off-by: Florian Pritz --- application/controllers/index.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 application/controllers/index.html (limited to 'application/controllers') diff --git a/application/controllers/index.html b/application/controllers/index.html old mode 100755 new mode 100644 -- cgit v1.2.3-24-g4f1b From 41c5abd4e8849e6a84ed2af405e9c25a74e018f3 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 22 Sep 2013 17:09:57 +0200 Subject: Move user_logged_in check to controller constructor TL;DR: Allows us to show a proper error page if encryption_key is missing from the config. muser->logged_in() can load the session class which will die if encryption_key is not set in the config causing an error to be displayed. Because the header is also loaded when we display an error loading the class will be tried again. CI maintains an array with information which classes have been tried to be loaded and will simply return true without loading again. muser->logged_in() will then try to access $this->session which doesn't exist. Since all of this happens when we are already in the header the error message appears in the navigation being hard to read. Signed-off-by: Florian Pritz --- application/controllers/file.php | 1 - application/controllers/user.php | 2 -- 2 files changed, 3 deletions(-) (limited to 'application/controllers') diff --git a/application/controllers/file.php b/application/controllers/file.php index 98ccae884..b02cdd8ce 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -20,7 +20,6 @@ class File extends MY_Controller { parent::__construct(); $this->load->model('mfile'); - $this->load->model('muser'); if (is_cli_client()) { $this->var->view_dir = "file_plaintext"; diff --git a/application/controllers/user.php b/application/controllers/user.php index 823166ea5..356cc430b 100644 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -18,8 +18,6 @@ class User extends MY_Controller { { parent::__construct(); - $this->load->model("muser"); - $this->var->view_dir = "user/"; } -- cgit v1.2.3-24-g4f1b From 635b0717931df907ee8015a42ad0ed1fcdf967c4 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 23 Sep 2013 07:47:40 +0200 Subject: Implement rangeDownload() as driver and provide sendfile implementations for Nginx and Lighttpd * The rangeDownload() function has been moved to libraries/Ddownload/drivers/Ddownload_php.php * The nginx and lighttpd drivers can be set via $config['download_driver'] Signed-off-by: Pierre Schmitz --- application/controllers/file.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'application/controllers') diff --git a/application/controllers/file.php b/application/controllers/file.php index b02cdd8ce..6ac0bc28c 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -98,10 +98,12 @@ class File extends MY_Controller { exit(); } + $this->load->driver("ddownload"); + // user wants the plain file if ($lexer == 'plain') { handle_etag($etag); - rangeDownload($file, $filedata["filename"], "text/plain"); + $this->ddownload->serveFile($file, $filedata["filename"], "text/plain"); exit(); } @@ -122,7 +124,7 @@ class File extends MY_Controller { header("$header_name: allow 'none'; img-src *; media-src *; font-src *; style-src * 'unsafe-inline'; script-src 'none'; object-src *; frame-src 'none'; "); } handle_etag($etag); - rangeDownload($file, $filedata["filename"], $filedata["mimetype"]); + $this->ddownload->serveFile($file, $filedata["filename"], $filedata["mimetype"]); exit(); } -- cgit v1.2.3-24-g4f1b