diff options
author | BlueWall | 2012-12-09 15:08:32 -0500 |
---|---|---|
committer | BlueWall | 2012-12-09 15:08:32 -0500 |
commit | 8efae93b51082e0af9048306ffa8ca82586969af (patch) | |
tree | d320388f5a202374a2c8a9eb43b32b290e4ad920 /OpenSim | |
parent | Merge branch 'master' of /home/opensim/var/repo/opensim (diff) | |
download | opensim-SC_OLD-8efae93b51082e0af9048306ffa8ca82586969af.zip opensim-SC_OLD-8efae93b51082e0af9048306ffa8ca82586969af.tar.gz opensim-SC_OLD-8efae93b51082e0af9048306ffa8ca82586969af.tar.bz2 opensim-SC_OLD-8efae93b51082e0af9048306ffa8ca82586969af.tar.xz |
Restrict IPresenceData.VerifyAgent
Restrict IPresenceData.VerifyAgent to only return bool result
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/IPresenceData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLPresenceData.cs | 12 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLPresenceData.cs | 9 | ||||
-rw-r--r-- | OpenSim/Data/Null/NullPresenceData.cs | 11 |
4 files changed, 17 insertions, 17 deletions
diff --git a/OpenSim/Data/IPresenceData.cs b/OpenSim/Data/IPresenceData.cs index 2759a42..9ec48b0 100644 --- a/OpenSim/Data/IPresenceData.cs +++ b/OpenSim/Data/IPresenceData.cs | |||
@@ -53,6 +53,6 @@ namespace OpenSim.Data | |||
53 | bool ReportAgent(UUID sessionID, UUID regionID); | 53 | bool ReportAgent(UUID sessionID, UUID regionID); |
54 | PresenceData[] Get(string field, string data); | 54 | PresenceData[] Get(string field, string data); |
55 | bool Delete(string field, string val); | 55 | bool Delete(string field, string val); |
56 | PresenceData VerifyAgent(UUID secureSessionID); | 56 | bool VerifyAgent(UUID agentId, UUID secureSessionID); |
57 | } | 57 | } |
58 | } | 58 | } |
diff --git a/OpenSim/Data/MSSQL/MSSQLPresenceData.cs b/OpenSim/Data/MSSQL/MSSQLPresenceData.cs index 5f495ae..0c71e79 100644 --- a/OpenSim/Data/MSSQL/MSSQLPresenceData.cs +++ b/OpenSim/Data/MSSQL/MSSQLPresenceData.cs | |||
@@ -100,16 +100,18 @@ namespace OpenSim.Data.MSSQL | |||
100 | return true; | 100 | return true; |
101 | } | 101 | } |
102 | 102 | ||
103 | public PresenceData VerifyAgent(UUID secureSessionID) | 103 | public bool VerifyAgent(UUID agentId, UUID secureSessionID) |
104 | { | 104 | { |
105 | PresenceData[] ret = Get("SecureSessionID", | 105 | PresenceData[] ret = Get("SecureSessionID", |
106 | secureSessionID.ToString()); | 106 | secureSessionID.ToString()); |
107 | 107 | ||
108 | if (ret.Length == 0) | 108 | if (ret.Length == 0) |
109 | return null; | 109 | return false; |
110 | 110 | ||
111 | return ret[0]; | 111 | if(ret[0].UserID != agentId.ToString()) |
112 | } | 112 | return false; |
113 | 113 | ||
114 | return true; | ||
115 | } | ||
114 | } | 116 | } |
115 | } | 117 | } |
diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs index 577a71a..3f90639 100644 --- a/OpenSim/Data/MySQL/MySQLPresenceData.cs +++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs | |||
@@ -96,15 +96,18 @@ namespace OpenSim.Data.MySQL | |||
96 | return true; | 96 | return true; |
97 | } | 97 | } |
98 | 98 | ||
99 | public PresenceData VerifyAgent(UUID secureSessionID) | 99 | public bool VerifyAgent(UUID agentId, UUID secureSessionID) |
100 | { | 100 | { |
101 | PresenceData[] ret = Get("SecureSessionID", | 101 | PresenceData[] ret = Get("SecureSessionID", |
102 | secureSessionID.ToString()); | 102 | secureSessionID.ToString()); |
103 | 103 | ||
104 | if (ret.Length == 0) | 104 | if (ret.Length == 0) |
105 | return null; | 105 | return false; |
106 | 106 | ||
107 | return ret[0]; | 107 | if(ret[0].UserID != agentId.ToString()) |
108 | return false; | ||
109 | |||
110 | return true; | ||
108 | } | 111 | } |
109 | } | 112 | } |
110 | } \ No newline at end of file | 113 | } \ No newline at end of file |
diff --git a/OpenSim/Data/Null/NullPresenceData.cs b/OpenSim/Data/Null/NullPresenceData.cs index eafde95..b85b95e 100644 --- a/OpenSim/Data/Null/NullPresenceData.cs +++ b/OpenSim/Data/Null/NullPresenceData.cs | |||
@@ -222,17 +222,12 @@ namespace OpenSim.Data.Null | |||
222 | return true; | 222 | return true; |
223 | } | 223 | } |
224 | 224 | ||
225 | public PresenceData VerifyAgent(UUID secureSessionID) | 225 | public bool VerifyAgent(UUID agentId, UUID secureSessionID) |
226 | { | 226 | { |
227 | if (Instance != this) | 227 | if (Instance != this) |
228 | return Instance.VerifyAgent(secureSessionID); | 228 | return Instance.VerifyAgent(agentId, secureSessionID); |
229 | 229 | ||
230 | if (m_presenceData.ContainsKey(secureSessionID)) | 230 | return false; |
231 | { | ||
232 | return m_presenceData[secureSessionID]; | ||
233 | } | ||
234 | |||
235 | return null; | ||
236 | } | 231 | } |
237 | 232 | ||
238 | } | 233 | } |