diff options
author | onefang | 2019-05-19 21:24:15 +1000 |
---|---|---|
committer | onefang | 2019-05-19 21:24:15 +1000 |
commit | 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch) | |
tree | a9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Data/PGSQL/PGSQLGroupsData.cs | |
parent | Add a build script. (diff) | |
download | opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2 opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz |
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Data/PGSQL/PGSQLGroupsData.cs')
-rwxr-xr-x[-rw-r--r--] | OpenSim/Data/PGSQL/PGSQLGroupsData.cs | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs index e257e7c..f398256 100644..100755 --- a/OpenSim/Data/PGSQL/PGSQLGroupsData.cs +++ b/OpenSim/Data/PGSQL/PGSQLGroupsData.cs | |||
@@ -37,7 +37,7 @@ using Npgsql; | |||
37 | namespace OpenSim.Data.PGSQL | 37 | namespace OpenSim.Data.PGSQL |
38 | { | 38 | { |
39 | public class PGSQLGroupsData : IGroupsData | 39 | public class PGSQLGroupsData : IGroupsData |
40 | { | 40 | { |
41 | private PGSqlGroupsGroupsHandler m_Groups; | 41 | private PGSqlGroupsGroupsHandler m_Groups; |
42 | private PGSqlGroupsMembershipHandler m_Membership; | 42 | private PGSqlGroupsMembershipHandler m_Membership; |
43 | private PGSqlGroupsRolesHandler m_Roles; | 43 | private PGSqlGroupsRolesHandler m_Roles; |
@@ -83,17 +83,17 @@ namespace OpenSim.Data.PGSQL | |||
83 | 83 | ||
84 | public GroupData[] RetrieveGroups(string pattern) | 84 | public GroupData[] RetrieveGroups(string pattern) |
85 | { | 85 | { |
86 | 86 | ||
87 | if (string.IsNullOrEmpty(pattern)) // True for where clause | 87 | if (string.IsNullOrEmpty(pattern)) // True for where clause |
88 | { | 88 | { |
89 | pattern = " 1 ORDER BY lower(\"Name\") LIMIT 100"; | 89 | pattern = " 1 ORDER BY lower(\"Name\") LIMIT 100"; |
90 | 90 | ||
91 | return m_Groups.Get(pattern); | 91 | return m_Groups.Get(pattern); |
92 | } | 92 | } |
93 | else | 93 | else |
94 | { | 94 | { |
95 | pattern = " \"ShowInList\" = 1 AND lower(\"Name\") LIKE lower('%" + pattern + "%') ORDER BY lower(\"Name\") LIMIT 100"; | 95 | pattern = " \"ShowInList\" = 1 AND lower(\"Name\") LIKE lower('%" + pattern + "%') ORDER BY lower(\"Name\") LIMIT 100"; |
96 | 96 | ||
97 | return m_Groups.Get(pattern, new NpgsqlParameter("pattern", pattern)); | 97 | return m_Groups.Get(pattern, new NpgsqlParameter("pattern", pattern)); |
98 | } | 98 | } |
99 | } | 99 | } |
@@ -138,10 +138,10 @@ namespace OpenSim.Data.PGSQL | |||
138 | 138 | ||
139 | public bool DeleteMember(UUID groupID, string pricipalID) | 139 | public bool DeleteMember(UUID groupID, string pricipalID) |
140 | { | 140 | { |
141 | return m_Membership.Delete(new string[] { "GroupID", "PrincipalID" }, | 141 | return m_Membership.Delete(new string[] { "GroupID", "PrincipalID" }, |
142 | new string[] { groupID.ToString(), pricipalID }); | 142 | new string[] { groupID.ToString(), pricipalID }); |
143 | } | 143 | } |
144 | 144 | ||
145 | public int MemberCount(UUID groupID) | 145 | public int MemberCount(UUID groupID) |
146 | { | 146 | { |
147 | return (int)m_Membership.GetCount("GroupID", groupID.ToString()); | 147 | return (int)m_Membership.GetCount("GroupID", groupID.ToString()); |
@@ -173,7 +173,7 @@ namespace OpenSim.Data.PGSQL | |||
173 | 173 | ||
174 | public bool DeleteRole(UUID groupID, UUID roleID) | 174 | public bool DeleteRole(UUID groupID, UUID roleID) |
175 | { | 175 | { |
176 | return m_Roles.Delete(new string[] { "GroupID", "RoleID" }, | 176 | return m_Roles.Delete(new string[] { "GroupID", "RoleID" }, |
177 | new string[] { groupID.ToString(), roleID.ToString() }); | 177 | new string[] { groupID.ToString(), roleID.ToString() }); |
178 | } | 178 | } |
179 | 179 | ||
@@ -365,7 +365,7 @@ namespace OpenSim.Data.PGSQL | |||
365 | get { return GetType().Assembly; } | 365 | get { return GetType().Assembly; } |
366 | } | 366 | } |
367 | 367 | ||
368 | public PGSqlGroupsGroupsHandler(string connectionString, string realm, string store) | 368 | public PGSqlGroupsGroupsHandler(string connectionString, string realm, string store) |
369 | : base(connectionString, realm, store) | 369 | : base(connectionString, realm, store) |
370 | { | 370 | { |
371 | } | 371 | } |
@@ -380,7 +380,7 @@ namespace OpenSim.Data.PGSQL | |||
380 | get { return GetType().Assembly; } | 380 | get { return GetType().Assembly; } |
381 | } | 381 | } |
382 | 382 | ||
383 | public PGSqlGroupsMembershipHandler(string connectionString, string realm) | 383 | public PGSqlGroupsMembershipHandler(string connectionString, string realm) |
384 | : base(connectionString, realm, string.Empty) | 384 | : base(connectionString, realm, string.Empty) |
385 | { | 385 | { |
386 | } | 386 | } |
@@ -395,7 +395,7 @@ namespace OpenSim.Data.PGSQL | |||
395 | get { return GetType().Assembly; } | 395 | get { return GetType().Assembly; } |
396 | } | 396 | } |
397 | 397 | ||
398 | public PGSqlGroupsRolesHandler(string connectionString, string realm) | 398 | public PGSqlGroupsRolesHandler(string connectionString, string realm) |
399 | : base(connectionString, realm, string.Empty) | 399 | : base(connectionString, realm, string.Empty) |
400 | { | 400 | { |
401 | } | 401 | } |
@@ -410,7 +410,7 @@ namespace OpenSim.Data.PGSQL | |||
410 | get { return GetType().Assembly; } | 410 | get { return GetType().Assembly; } |
411 | } | 411 | } |
412 | 412 | ||
413 | public PGSqlGroupsRoleMembershipHandler(string connectionString, string realm) | 413 | public PGSqlGroupsRoleMembershipHandler(string connectionString, string realm) |
414 | : base(connectionString, realm, string.Empty) | 414 | : base(connectionString, realm, string.Empty) |
415 | { | 415 | { |
416 | } | 416 | } |
@@ -425,7 +425,7 @@ namespace OpenSim.Data.PGSQL | |||
425 | get { return GetType().Assembly; } | 425 | get { return GetType().Assembly; } |
426 | } | 426 | } |
427 | 427 | ||
428 | public PGSqlGroupsInvitesHandler(string connectionString, string realm) | 428 | public PGSqlGroupsInvitesHandler(string connectionString, string realm) |
429 | : base(connectionString, realm, string.Empty) | 429 | : base(connectionString, realm, string.Empty) |
430 | { | 430 | { |
431 | } | 431 | } |
@@ -435,8 +435,8 @@ namespace OpenSim.Data.PGSQL | |||
435 | 435 | ||
436 | using (NpgsqlCommand cmd = new NpgsqlCommand()) | 436 | using (NpgsqlCommand cmd = new NpgsqlCommand()) |
437 | { | 437 | { |
438 | cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm); | 438 | cmd.CommandText = String.Format("delete from {0} where \"TMStamp\"::abstime::timestamp < now() - INTERVAL '2 week'", m_Realm); |
439 | 439 | ||
440 | ExecuteNonQuery(cmd); | 440 | ExecuteNonQuery(cmd); |
441 | } | 441 | } |
442 | 442 | ||
@@ -451,7 +451,7 @@ namespace OpenSim.Data.PGSQL | |||
451 | get { return GetType().Assembly; } | 451 | get { return GetType().Assembly; } |
452 | } | 452 | } |
453 | 453 | ||
454 | public PGSqlGroupsNoticesHandler(string connectionString, string realm) | 454 | public PGSqlGroupsNoticesHandler(string connectionString, string realm) |
455 | : base(connectionString, realm, string.Empty) | 455 | : base(connectionString, realm, string.Empty) |
456 | { | 456 | { |
457 | } | 457 | } |
@@ -461,8 +461,8 @@ namespace OpenSim.Data.PGSQL | |||
461 | 461 | ||
462 | using (NpgsqlCommand cmd = new NpgsqlCommand()) | 462 | using (NpgsqlCommand cmd = new NpgsqlCommand()) |
463 | { | 463 | { |
464 | cmd.CommandText = String.Format("delete from {0} where \"TMStamp\" < CURRENT_DATE - INTERVAL '2 week'", m_Realm); | 464 | cmd.CommandText = String.Format("delete from {0} where \"TMStamp\"::abstime::timestamp < now() - INTERVAL '2 week'", m_Realm); |
465 | 465 | ||
466 | ExecuteNonQuery(cmd); | 466 | ExecuteNonQuery(cmd); |
467 | } | 467 | } |
468 | 468 | ||
@@ -477,7 +477,7 @@ namespace OpenSim.Data.PGSQL | |||
477 | get { return GetType().Assembly; } | 477 | get { return GetType().Assembly; } |
478 | } | 478 | } |
479 | 479 | ||
480 | public PGSqlGroupsPrincipalsHandler(string connectionString, string realm) | 480 | public PGSqlGroupsPrincipalsHandler(string connectionString, string realm) |
481 | : base(connectionString, realm, string.Empty) | 481 | : base(connectionString, realm, string.Empty) |
482 | { | 482 | { |
483 | } | 483 | } |