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