Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
shiningw committed Aug 4, 2022
1 parent 22f4756 commit 285b9cd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Search for torrents within the app from mutiple BT sites;
Control Aria2 and manage download tasks from the web;
download videos from 700+ video sites(youtube,youku,vimo,dailymotion,twitter,facebook and the likes
</description>
<version>1.0.0</version>
<version>1.0.1</version>
<licence>agpl</licence>
<author mail="freefallbenson@gmail.com" homepage="https://github.com/shiningw">jiaxinhuang</author>
<namespace>NCDownloader</namespace>
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function getGlobalAria2()
public function saveCustomAria2()
{
$noAria2Settings = (bool) Helper::getAdminSettings("disallow_aria2_settings");
if (!$noAria2Settings) {
if ($noAria2Settings && !\OC_User::isAdminUser($this->UserId)) {
$resp = ["error" => "forbidden", "status" => false];
return new JSONResponse($resp);
}
Expand Down
1 change: 1 addition & 0 deletions lib/Settings/Personal.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function getForm()
'ncd_seed_time' => $this->settings->get("ncd_seed_time"),
"path" => '/apps/ncdownloader/personal/save',
"disallow_aria2_settings" => Helper::getAdminSettings("disallow_aria2_settings"),
"is_admin" => \OC_User::isAdminUser($this->UserId),
]
];

Expand Down
4 changes: 3 additions & 1 deletion src/personalSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/>
</div>
<customOptions
v-if="!disallowAria2Settings"
v-if="!disallowAria2Settings || isAdmin"
name="custom-aria2-settings"
title="Personal Aria2 Settings"
@mounted="renderAria2"
Expand Down Expand Up @@ -47,6 +47,7 @@ export default {
aria2Options: aria2Options,
ytdlOptions: ytdlOptions,
disallowAria2Settings: false,
isAdmin: false,
};
},
components: {
Expand Down Expand Up @@ -102,6 +103,7 @@ export default {
data = JSON.parse(data);
let path = "/apps/ncdownloader/personal/save";
this.disallowAria2Settings = helper.str2Boolean(data["disallow_aria2_settings"]);
this.isAdmin = data["is_admin"];
this.options = [
{
label: "Downloads Folder ",
Expand Down

0 comments on commit 285b9cd

Please sign in to comment.