Fixed and closed #438: group deletion no longer causes exceptions for former members.

This commit is contained in:
Dario Solera 2010-01-14 06:34:04 +00:00
parent ca12d536c4
commit 446934322c
3 changed files with 9 additions and 5 deletions

View file

@ -16,5 +16,5 @@ using System.Reflection;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("3.0.1.455")]
[assembly: AssemblyFileVersion("3.0.1.455")]
[assembly: AssemblyVersion("3.0.1.456")]
[assembly: AssemblyFileVersion("3.0.1.456")]

View file

@ -94,10 +94,13 @@ namespace ScrewTurn.Wiki {
if(groups == null || groups.Length == 0) {
UserInfo current = GetCurrentUser();
if(current != null) {
groups = new UserGroup[current.Groups.Length];
for(int i = 0; i < groups.Length; i++) {
groups[i] = Users.FindUserGroup(current.Groups[i]);
// This check is necessary because after group deletion the session might contain outdated data
List<UserGroup> temp = new List<UserGroup>(current.Groups.Length);
for(int i = 0; i < current.Groups.Length; i++) {
UserGroup tempGroup = Users.FindUserGroup(current.Groups[i]);
if(tempGroup != null) temp.Add(tempGroup);
}
groups = temp.ToArray();
}
else {
groups = new UserGroup[] { Users.FindUserGroup(Settings.AnonymousGroup) };

View file

@ -643,6 +643,7 @@ namespace ScrewTurn.Wiki {
DumpUserGroups(result.ToArray());
groupsCache = null;
usersCache = null;
return result.Count == allGroups.Length - 1;
}