Disable enabling apps by groups for filesystem, authentication and loggin apps
This commit is contained in:
parent
402a31f196
commit
7e07ff6f4f
|
@ -89,6 +89,13 @@ OC.Settings.Apps = OC.Settings.Apps || {
|
||||||
page.find(".warning").hide();
|
page.find(".warning").hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
page.find("div.multiselect").parent().remove();
|
||||||
|
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) {
|
$('#group_select > option').each(function (i, el) {
|
||||||
if (app.groups.length === 0 || app.groups.indexOf(el.value) >= 0) {
|
if (app.groups.length === 0 || app.groups.indexOf(el.value) >= 0) {
|
||||||
$(el).attr('selected', 'selected');
|
$(el).attr('selected', 'selected');
|
||||||
|
@ -96,7 +103,6 @@ OC.Settings.Apps = OC.Settings.Apps || {
|
||||||
$(el).attr('selected', null);
|
$(el).attr('selected', null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
page.find("div.multiselect").parent().remove();
|
|
||||||
if (app.active) {
|
if (app.active) {
|
||||||
if (app.groups.length) {
|
if (app.groups.length) {
|
||||||
$('#group_select').multiSelect();
|
$('#group_select').multiSelect();
|
||||||
|
@ -110,6 +116,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
|
||||||
page.find("#groups_enable").hide();
|
page.find("#groups_enable").hide();
|
||||||
page.find("label[for='groups_enable']").hide();
|
page.find("label[for='groups_enable']").hide();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
enableApp:function(appid, active, element, groups) {
|
enableApp:function(appid, active, element, groups) {
|
||||||
console.log('enableApp:', appid, active, element);
|
console.log('enableApp:', appid, active, element);
|
||||||
|
@ -271,6 +278,9 @@ OC.Settings.Apps = OC.Settings.Apps || {
|
||||||
showErrorMessage: function(message) {
|
showErrorMessage: function(message) {
|
||||||
$('.appinfo .warning').show();
|
$('.appinfo .warning').show();
|
||||||
$('.appinfo .warning').text(message);
|
$('.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){
|
$('#app-navigation ul li').each(function(index,li){
|
||||||
var app = OC.get('appData_'+$(li).data('id'));
|
var app = OC.get('appData_'+$(li).data('id'));
|
||||||
if (app) {
|
if (app) {
|
||||||
|
console.log(app);
|
||||||
app.groups= $(li).data('groups') || [];
|
app.groups= $(li).data('groups') || [];
|
||||||
}
|
}
|
||||||
$(li).data('app',app);
|
$(li).data('app',app);
|
||||||
|
|
Loading…
Reference in New Issue