fixed bugs

This commit is contained in:
huangjx
2022-08-04 18:19:03 +08:00
parent 22f4756254
commit 285b9cd7fb
4 changed files with 6 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ Search for torrents within the app from mutiple BT sites;
Control Aria2 and manage download tasks from the web; Control Aria2 and manage download tasks from the web;
download videos from 700+ video sites(youtube,youku,vimo,dailymotion,twitter,facebook and the likes download videos from 700+ video sites(youtube,youku,vimo,dailymotion,twitter,facebook and the likes
</description> </description>
<version>1.0.0</version> <version>1.0.1</version>
<licence>agpl</licence> <licence>agpl</licence>
<author mail="freefallbenson@gmail.com" homepage="https://github.com/shiningw">jiaxinhuang</author> <author mail="freefallbenson@gmail.com" homepage="https://github.com/shiningw">jiaxinhuang</author>
<namespace>NCDownloader</namespace> <namespace>NCDownloader</namespace>

View File

@@ -99,7 +99,7 @@ class SettingsController extends Controller
public function saveCustomAria2() public function saveCustomAria2()
{ {
$noAria2Settings = (bool) Helper::getAdminSettings("disallow_aria2_settings"); $noAria2Settings = (bool) Helper::getAdminSettings("disallow_aria2_settings");
if (!$noAria2Settings) { if ($noAria2Settings && !\OC_User::isAdminUser($this->UserId)) {
$resp = ["error" => "forbidden", "status" => false]; $resp = ["error" => "forbidden", "status" => false];
return new JSONResponse($resp); return new JSONResponse($resp);
} }

View File

@@ -46,6 +46,7 @@ class Personal implements ISettings
'ncd_seed_time' => $this->settings->get("ncd_seed_time"), 'ncd_seed_time' => $this->settings->get("ncd_seed_time"),
"path" => '/apps/ncdownloader/personal/save', "path" => '/apps/ncdownloader/personal/save',
"disallow_aria2_settings" => Helper::getAdminSettings("disallow_aria2_settings"), "disallow_aria2_settings" => Helper::getAdminSettings("disallow_aria2_settings"),
"is_admin" => \OC_User::isAdminUser($this->UserId),
] ]
]; ];

View File

@@ -13,7 +13,7 @@
/> />
</div> </div>
<customOptions <customOptions
v-if="!disallowAria2Settings" v-if="!disallowAria2Settings || isAdmin"
name="custom-aria2-settings" name="custom-aria2-settings"
title="Personal Aria2 Settings" title="Personal Aria2 Settings"
@mounted="renderAria2" @mounted="renderAria2"
@@ -47,6 +47,7 @@ export default {
aria2Options: aria2Options, aria2Options: aria2Options,
ytdlOptions: ytdlOptions, ytdlOptions: ytdlOptions,
disallowAria2Settings: false, disallowAria2Settings: false,
isAdmin: false,
}; };
}, },
components: { components: {
@@ -102,6 +103,7 @@ export default {
data = JSON.parse(data); data = JSON.parse(data);
let path = "/apps/ncdownloader/personal/save"; let path = "/apps/ncdownloader/personal/save";
this.disallowAria2Settings = helper.str2Boolean(data["disallow_aria2_settings"]); this.disallowAria2Settings = helper.str2Boolean(data["disallow_aria2_settings"]);
this.isAdmin = data["is_admin"];
this.options = [ this.options = [
{ {
label: "Downloads Folder ", label: "Downloads Folder ",