|
|
@ -7,8 +7,11 @@ using FLocal.Core; |
|
|
|
namespace FLocal.Common.dataobjects { |
|
|
|
namespace FLocal.Common.dataobjects { |
|
|
|
public class AnonymousUserSettings : IUserSettings { |
|
|
|
public class AnonymousUserSettings : IUserSettings { |
|
|
|
|
|
|
|
|
|
|
|
public AnonymousUserSettings() { |
|
|
|
private readonly Account account; |
|
|
|
var allSkins = Skin.allSkins.ToArray(); |
|
|
|
|
|
|
|
|
|
|
|
public AnonymousUserSettings(Account account) { |
|
|
|
|
|
|
|
this.account = account; |
|
|
|
|
|
|
|
//var allSkins = Skin.allSkins.ToArray(); |
|
|
|
//this._skinId = allSkins[Util.RandomInt(0, allSkins.Length)].id; |
|
|
|
//this._skinId = allSkins[Util.RandomInt(0, allSkins.Length)].id; |
|
|
|
this._skinId = 28; |
|
|
|
this._skinId = 28; |
|
|
|
this._modernSkinId = 2; |
|
|
|
this._modernSkinId = 2; |
|
|
@ -61,10 +64,17 @@ namespace FLocal.Common.dataobjects { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public bool isPostVisible(Post post) { |
|
|
|
public bool isPostVisible(Post post) { |
|
|
|
|
|
|
|
if(this.account != null) { |
|
|
|
|
|
|
|
if(post.layer.name == PostLayer.NAME_HIDDEN) return false; |
|
|
|
|
|
|
|
if(post.poster.showPostsToUsers == User.ENUM_SHOWPOSTSTOUSERS_NONE) return false; |
|
|
|
|
|
|
|
if(post.poster.showPostsToUsers == User.ENUM_SHOWPOSTSTOUSERS_PRIVELEGED) return account.user.userGroup.name == UserGroup.NAME_JUDGES || account.user.userGroup.name == UserGroup.NAME_ADMINISTRATORS; |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} else { |
|
|
|
if(post.poster.showPostsToUsers != User.ENUM_SHOWPOSTSTOUSERS_ALL) return false; |
|
|
|
if(post.poster.showPostsToUsers != User.ENUM_SHOWPOSTSTOUSERS_ALL) return false; |
|
|
|
if(post.layer.name != PostLayer.NAME_NORMAL) return false; |
|
|
|
if(post.layer.name != PostLayer.NAME_NORMAL) return false; |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int maxUploadImageWidth { |
|
|
|
public int maxUploadImageWidth { |
|
|
|