From 8802b8d03a162e830a7494f74a52208ef1714567 Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Sun, 27 Jun 2010 17:08:41 +0000 Subject: [PATCH] Hidden users feature implemented --- Builder/IISMainHandler/build.txt | 2 +- Builder/IISUploadHandler/build.txt | 2 +- Common/dataobjects/Post.cs | 9 +++++++++ Common/dataobjects/User.cs | 5 +++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 93168a9..5f7b1b0 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -398 \ No newline at end of file +399 \ No newline at end of file diff --git a/Builder/IISUploadHandler/build.txt b/Builder/IISUploadHandler/build.txt index 8306ec1..b9c6c00 100644 --- a/Builder/IISUploadHandler/build.txt +++ b/Builder/IISUploadHandler/build.txt @@ -1 +1 @@ -130 \ No newline at end of file +131 \ No newline at end of file diff --git a/Common/dataobjects/Post.cs b/Common/dataobjects/Post.cs index b2b27af..3a623b3 100644 --- a/Common/dataobjects/Post.cs +++ b/Common/dataobjects/Post.cs @@ -159,6 +159,15 @@ namespace FLocal.Common.dataobjects { } public XElement exportToXmlWithoutThread(UserContext context, bool includeParentPost, params XElement[] additional) { + + if(context.account == null && this.poster.showPostsToUsers != User.ENUM_SHOWPOSTSTOUSERS_ALL) { + return null; + } + + if(this.poster.showPostsToUsers == User.ENUM_SHOWPOSTSTOUSERS_NONE) { + return null; + } + XElement result = new XElement("post", new XElement("id", this.id), new XElement("poster", this.poster.exportToXmlForViewing(context)), diff --git a/Common/dataobjects/User.cs b/Common/dataobjects/User.cs index 96987b2..68b99a1 100644 --- a/Common/dataobjects/User.cs +++ b/Common/dataobjects/User.cs @@ -10,6 +10,11 @@ using FLocal.Core.DB.conditions; namespace FLocal.Common.dataobjects { public class User : SqlObject { + public const string ENUM_SHOWPOSTSTOUSERS_ALL = "All"; + public const string ENUM_SHOWPOSTSTOUSERS_LOGGEDIN = "LoggedIn"; + public const string ENUM_SHOWPOSTSTOUSERS_PRIVELEGED = "Priveleged"; + public const string ENUM_SHOWPOSTSTOUSERS_NONE = "None"; + public class TableSpec : ISqlObjectTableSpec { public const string TABLE = "Users"; public const string FIELD_ID = "Id";