From 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 19 May 2019 21:24:15 +1000 Subject: Dump OpenSim 0.9.0.1 into it's own branch. --- OpenSim/Data/PGSQL/PGSQLGroupsData.cs | 40 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) mode change 100644 => 100755 OpenSim/Data/PGSQL/PGSQLGroupsData.cs (limited to 'OpenSim/Data/PGSQL/PGSQLGroupsData.cs') diff --git a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs old mode 100644 new mode 100755 index e257e7c..f398256 --- a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs +++ b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs @@ -37,7 +37,7 @@ using Npgsql; namespace OpenSim.Data.PGSQL { public class PGSQLGroupsData : IGroupsData - { + { private PGSqlGroupsGroupsHandler m_Groups; private PGSqlGroupsMembershipHandler m_Membership; private PGSqlGroupsRolesHandler m_Roles; @@ -83,17 +83,17 @@ namespace OpenSim.Data.PGSQL public GroupData[] RetrieveGroups(string pattern) { - + if (string.IsNullOrEmpty(pattern)) // True for where clause { pattern = " 1 ORDER BY lower(\"Name\") LIMIT 100"; - + return m_Groups.Get(pattern); } - else - { + else + { pattern = " \"ShowInList\" = 1 AND lower(\"Name\") LIKE lower('%" + pattern + "%') ORDER BY lower(\"Name\") LIMIT 100"; - + return m_Groups.Get(pattern, new NpgsqlParameter("pattern", pattern)); } } @@ -138,10 +138,10 @@ namespace OpenSim.Data.PGSQL public bool DeleteMember(UUID groupID, string pricipalID) { - return m_Membership.Delete(new string[] { "GroupID", "PrincipalID" }, + return m_Membership.Delete(new string[] { "GroupID", "PrincipalID" }, new string[] { groupID.ToString(), pricipalID }); } - + public int MemberCount(UUID groupID) { return (int)m_Membership.GetCount("GroupID", groupID.ToString()); @@ -173,7 +173,7 @@ namespace OpenSim.Data.PGSQL public bool DeleteRole(UUID groupID, UUID roleID) { - return m_Roles.Delete(new string[] { "GroupID", "RoleID" }, + return m_Roles.Delete(new string[] { "GroupID", "RoleID" }, new string[] { groupID.ToString(), roleID.ToString() }); } @@ -365,7 +365,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSqlGroupsGroupsHandler(string connectionString, string realm, string store) + public PGSqlGroupsGroupsHandler(string connectionString, string realm, string store) : base(connectionString, realm, store) { } @@ -380,7 +380,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSqlGroupsMembershipHandler(string connectionString, string realm) + public PGSqlGroupsMembershipHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -395,7 +395,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSqlGroupsRolesHandler(string connectionString, string realm) + public PGSqlGroupsRolesHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -410,7 +410,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSqlGroupsRoleMembershipHandler(string connectionString, string realm) + public PGSqlGroupsRoleMembershipHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -425,7 +425,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSqlGroupsInvitesHandler(string connectionString, string realm) + public PGSqlGroupsInvitesHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -435,8 +435,8 @@ namespace OpenSim.Data.PGSQL using (NpgsqlCommand cmd = new NpgsqlCommand()) { - cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm); - + cmd.CommandText = String.Format("delete from {0} where \"TMStamp\"::abstime::timestamp < now() - INTERVAL '2 week'", m_Realm); + ExecuteNonQuery(cmd); } @@ -451,7 +451,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSqlGroupsNoticesHandler(string connectionString, string realm) + public PGSqlGroupsNoticesHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } @@ -461,8 +461,8 @@ namespace OpenSim.Data.PGSQL using (NpgsqlCommand cmd = new NpgsqlCommand()) { - cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm); - + cmd.CommandText = String.Format("delete from {0} where \"TMStamp\"::abstime::timestamp < now() - INTERVAL '2 week'", m_Realm); + ExecuteNonQuery(cmd); } @@ -477,7 +477,7 @@ namespace OpenSim.Data.PGSQL get { return GetType().Assembly; } } - public PGSqlGroupsPrincipalsHandler(string connectionString, string realm) + public PGSqlGroupsPrincipalsHandler(string connectionString, string realm) : base(connectionString, realm, string.Empty) { } -- cgit v1.1