From: Jan Schneider Date: Mon, 15 Mar 2010 23:21:19 +0000 (+0100) Subject: Catch permissions for groups and users that don't exist anymore. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=cdc0aeaf2226b7455bcbe8b27ab1a90d17ef8ec7;p=horde.git Catch permissions for groups and users that don't exist anymore. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 869cf59a2..e5e61e4c7 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -2409,6 +2409,11 @@ KronolithCore = { if (!Object.isArray(perm.value)) { $H(perm.value).each(function(group) { this.insertGroupOrUser(type, 'group', group.key); + if (!$('kronolithC' + type + 'PGshow_' + group.key)) { + // Group doesn't exist anymore. + delete perm.value[group.key]; + return; + } groupPerms = group.value; groupId = group.key; }, this); @@ -2427,6 +2432,11 @@ KronolithCore = { $H(perm.value).each(function(user) { if (user.key != Kronolith.conf.user) { this.insertGroupOrUser(type, 'user', user.key); + if (!$('kronolithC' + type + 'PUshow_' + user.key)) { + // User doesn't exist anymore. + delete perm.value[user.key]; + return; + } advanced = true; } }, this);