From d6040b028e66f31edfe81aa9e668c18f2abdeb4a Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 2 May 2015 02:07:22 +0200 Subject: [PATCH] Clean up and fix. --- src/_h5ai/server/php/inc/class-api.php | 7 +++---- src/_h5ai/server/php/inc/class-thumb.php | 3 +-- src/_h5ai/server/php/inc/class-util.php | 1 - 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/_h5ai/server/php/inc/class-api.php b/src/_h5ai/server/php/inc/class-api.php index 17890093..76e2621b 100644 --- a/src/_h5ai/server/php/inc/class-api.php +++ b/src/_h5ai/server/php/inc/class-api.php @@ -2,14 +2,13 @@ class Api { - private $actions, $app, $options; + private $actions, $app; public function __construct($app) { $this->actions = array("login", "logout", "get", "getThumbHref", "download"); $this->app = $app; - $this->options = $app->get_options(); } @@ -99,7 +98,7 @@ class Api { private function on_getThumbHref() { - Util::json_fail(Util::RC_DISABLED, "thumbnails disabled", !$this->get_option("thumbnails.enabled", false)); + Util::json_fail(Util::RC_DISABLED, "thumbnails disabled", !$this->app->get_option("thumbnails.enabled", false)); Util::json_fail(Util::RC_UNSUPPORTED, "thumbnails not supported", !HAS_PHP_JPG); $type = Util::get_request_param("type"); @@ -117,7 +116,7 @@ class Api { private function on_download() { - Util::json_fail(Util::RC_DISABLED, "downloads disabled", !$this->get_option("download.enabled", false)); + Util::json_fail(Util::RC_DISABLED, "downloads disabled", !$this->app->get_option("download.enabled", false)); $as = Util::get_request_param("as"); $type = Util::get_request_param("type"); diff --git a/src/_h5ai/server/php/inc/class-thumb.php b/src/_h5ai/server/php/inc/class-thumb.php index 68d95b58..9390b45e 100644 --- a/src/_h5ai/server/php/inc/class-thumb.php +++ b/src/_h5ai/server/php/inc/class-thumb.php @@ -62,8 +62,7 @@ class Thumb { $image = new Image(); $et = false; - $opts = $this->app->get_options(); - if (HAS_PHP_EXIF && $opts["thumbnails"]["exif"] === true && $height != 0) { + if (HAS_PHP_EXIF && $this->app->get_option("thumbnails.exif", false) === true && $height != 0) { $et = @exif_thumbnail($source_path); } if($et !== false) { diff --git a/src/_h5ai/server/php/inc/class-util.php b/src/_h5ai/server/php/inc/class-util.php index 5a3b4309..2c8a180f 100644 --- a/src/_h5ai/server/php/inc/class-util.php +++ b/src/_h5ai/server/php/inc/class-util.php @@ -170,7 +170,6 @@ class Util { } else if (is_dir($path)) { - $options = $app->get_options(); if ($app->get_option("foldersize.enabled", false)) { if (HAS_CMD_DU && $app->get_option("foldersize.type", null) === "shell-du") { $cmdv = array("du", "-sk", $path);