Fixed and closed #438: group deletion no longer causes exceptions for former members.
This commit is contained in:
parent
ca12d536c4
commit
446934322c
3 changed files with 9 additions and 5 deletions
|
@ -16,5 +16,5 @@ using System.Reflection;
|
||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Revision and Build Numbers
|
// You can specify all the values or you can default the Revision and Build Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
[assembly: AssemblyVersion("3.0.1.455")]
|
[assembly: AssemblyVersion("3.0.1.456")]
|
||||||
[assembly: AssemblyFileVersion("3.0.1.455")]
|
[assembly: AssemblyFileVersion("3.0.1.456")]
|
||||||
|
|
|
@ -94,10 +94,13 @@ namespace ScrewTurn.Wiki {
|
||||||
if(groups == null || groups.Length == 0) {
|
if(groups == null || groups.Length == 0) {
|
||||||
UserInfo current = GetCurrentUser();
|
UserInfo current = GetCurrentUser();
|
||||||
if(current != null) {
|
if(current != null) {
|
||||||
groups = new UserGroup[current.Groups.Length];
|
// This check is necessary because after group deletion the session might contain outdated data
|
||||||
for(int i = 0; i < groups.Length; i++) {
|
List<UserGroup> temp = new List<UserGroup>(current.Groups.Length);
|
||||||
groups[i] = Users.FindUserGroup(current.Groups[i]);
|
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 {
|
else {
|
||||||
groups = new UserGroup[] { Users.FindUserGroup(Settings.AnonymousGroup) };
|
groups = new UserGroup[] { Users.FindUserGroup(Settings.AnonymousGroup) };
|
||||||
|
|
|
@ -643,6 +643,7 @@ namespace ScrewTurn.Wiki {
|
||||||
DumpUserGroups(result.ToArray());
|
DumpUserGroups(result.ToArray());
|
||||||
|
|
||||||
groupsCache = null;
|
groupsCache = null;
|
||||||
|
usersCache = null;
|
||||||
|
|
||||||
return result.Count == allGroups.Length - 1;
|
return result.Count == allGroups.Length - 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue