Fixed issue in SessionFacade.GetCurrentUser().
This commit is contained in:
parent
bd65c84133
commit
7d63ef3a44
3 changed files with 19 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.0.348")]
|
[assembly: AssemblyVersion("3.0.0.349")]
|
||||||
[assembly: AssemblyFileVersion("3.0.0.348")]
|
[assembly: AssemblyFileVersion("3.0.0.349")]
|
||||||
|
|
|
@ -49,10 +49,10 @@ namespace ScrewTurn.Wiki {
|
||||||
else {
|
else {
|
||||||
string un = CurrentUsername;
|
string un = CurrentUsername;
|
||||||
if(string.IsNullOrEmpty(un)) return null;
|
if(string.IsNullOrEmpty(un)) return null;
|
||||||
else if(object.ReferenceEquals(un, AnonymousUsername) || un == AnonymousUsername) return Users.GetAdministratorAccount();
|
else if(un == AnonymousUsername) return Users.GetAnonymousAccount();
|
||||||
else {
|
else {
|
||||||
current = Users.FindUser(un);
|
current = Users.FindUser(un);
|
||||||
SessionCache.SetCurrentUser(sessionId, current);
|
if(current != null) SessionCache.SetCurrentUser(sessionId, current);
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace ScrewTurn.Wiki {
|
||||||
public static class Users {
|
public static class Users {
|
||||||
|
|
||||||
private static UserInfo adminAccount = null;
|
private static UserInfo adminAccount = null;
|
||||||
|
private static UserInfo anonAccount = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the built-in administrator account.
|
/// Gets the built-in administrator account.
|
||||||
|
@ -21,12 +22,25 @@ namespace ScrewTurn.Wiki {
|
||||||
public static UserInfo GetAdministratorAccount() {
|
public static UserInfo GetAdministratorAccount() {
|
||||||
if(adminAccount == null) {
|
if(adminAccount == null) {
|
||||||
adminAccount = new UserInfo("admin", "Administrator", Settings.ContactEmail, true, DateTime.MinValue, null);
|
adminAccount = new UserInfo("admin", "Administrator", Settings.ContactEmail, true, DateTime.MinValue, null);
|
||||||
adminAccount.Groups = new string[] { Settings.AdministratorsGroup };
|
adminAccount.Groups = new[] { Settings.AdministratorsGroup };
|
||||||
}
|
}
|
||||||
|
|
||||||
return adminAccount;
|
return adminAccount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the fake anonymous account.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The account.</returns>
|
||||||
|
public static UserInfo GetAnonymousAccount() {
|
||||||
|
if(anonAccount == null) {
|
||||||
|
anonAccount = new UserInfo(SessionFacade.AnonymousUsername, null, null, false, DateTime.MinValue, null);
|
||||||
|
anonAccount.Groups = new[] { Settings.AnonymousGroup };
|
||||||
|
}
|
||||||
|
|
||||||
|
return anonAccount;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The user data key pointing to page changes notification entries.
|
/// The user data key pointing to page changes notification entries.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue