Clean up and fix.

This commit is contained in:
Lars Jung 2015-05-02 02:07:22 +02:00
parent 509074c263
commit d6040b028e
3 changed files with 4 additions and 7 deletions

View file

@ -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");

View file

@ -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) {

View file

@ -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);