diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-04-28 13:27:32 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-06-03 12:42:36 +0200 |
commit | 7e07ff6f4f0c4649a6d81925a05bd01eb816c4ba (patch) | |
tree | 78a07160503816aaa035df6da055dd93643c80fe /settings/js | |
parent | 402a31f19622f67315ba741ce67ccfd136fe9d49 (diff) | |
download | nextcloud-server-7e07ff6f4f0c4649a6d81925a05bd01eb816c4ba.tar.gz nextcloud-server-7e07ff6f4f0c4649a6d81925a05bd01eb816c4ba.zip |
Disable enabling apps by groups for filesystem, authentication and loggin apps
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/apps.js | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/settings/js/apps.js b/settings/js/apps.js index f0e40232ee0..a9478c043a2 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -89,26 +89,33 @@ OC.Settings.Apps = OC.Settings.Apps || { page.find(".warning").hide(); } - $('#group_select > option').each(function (i, el) { - if (app.groups.length === 0 || app.groups.indexOf(el.value) >= 0) { - $(el).attr('selected', 'selected'); - } else { - $(el).attr('selected', null); - } - }); page.find("div.multiselect").parent().remove(); - if (app.active) { - if (app.groups.length) { - $('#group_select').multiSelect(); - page.find("#groups_enable").attr('checked','checked'); - } else { - page.find("#groups_enable").attr('checked', null); - } - page.find("#groups_enable").show(); - page.find("label[for='groups_enable']").show(); - } else { + if(OC.Settings.Apps.isType(app, 'filesystem') || OC.Settings.Apps.isType(app, 'prelogin') || + OC.Settings.Apps.isType(app, 'authentication') || OC.Settings.Apps.isType(app, 'logging')) { page.find("#groups_enable").hide(); page.find("label[for='groups_enable']").hide(); + page.find("#groups_enable").attr('checked', null); + } else { + $('#group_select > option').each(function (i, el) { + if (app.groups.length === 0 || app.groups.indexOf(el.value) >= 0) { + $(el).attr('selected', 'selected'); + } else { + $(el).attr('selected', null); + } + }); + if (app.active) { + if (app.groups.length) { + $('#group_select').multiSelect(); + page.find("#groups_enable").attr('checked','checked'); + } else { + page.find("#groups_enable").attr('checked', null); + } + page.find("#groups_enable").show(); + page.find("label[for='groups_enable']").show(); + } else { + page.find("#groups_enable").hide(); + page.find("label[for='groups_enable']").hide(); + } } }, enableApp:function(appid, active, element, groups) { @@ -271,6 +278,9 @@ OC.Settings.Apps = OC.Settings.Apps || { showErrorMessage: function(message) { $('.appinfo .warning').show(); $('.appinfo .warning').text(message); + }, + isType: function(app, type){ + return app.types && app.types.indexOf(type) !== -1; } }; @@ -278,6 +288,7 @@ $(document).ready(function(){ $('#app-navigation ul li').each(function(index,li){ var app = OC.get('appData_'+$(li).data('id')); if (app) { + console.log(app); app.groups= $(li).data('groups') || []; } $(li).data('app',app); |