diff options
author | Justin Clark-Casey (justincc) | 2010-03-26 19:34:49 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-03-26 19:34:49 +0000 |
commit | fc2b1375810ca263242475263428ca676f3fe014 (patch) | |
tree | ebfb48904ac1fa80f3a7d9845997c9abe8d2ff5c /OpenSim/Services | |
parent | comment out very probably unused dist and distdir nant targets (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-fc2b1375810ca263242475263428ca676f3fe014.zip opensim-SC_OLD-fc2b1375810ca263242475263428ca676f3fe014.tar.gz opensim-SC_OLD-fc2b1375810ca263242475263428ca676f3fe014.tar.bz2 opensim-SC_OLD-fc2b1375810ca263242475263428ca676f3fe014.tar.xz |
Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Services')
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index 29c9219..031b326 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs | |||
@@ -177,9 +177,46 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
177 | 177 | ||
178 | public bool SetPassword(UUID principalID, string passwd) | 178 | public bool SetPassword(UUID principalID, string passwd) |
179 | { | 179 | { |
180 | // TODO: Use GetIdentities to find the md5hash identity for principalID | 180 | // Fetch the user name first |
181 | // and then update it with AddIdentity | 181 | NameValueCollection requestArgs = new NameValueCollection |
182 | m_log.Error("[AUTH CONNECTOR]: Changing passwords is not implemented yet"); | 182 | { |
183 | { "RequestMethod", "GetUser" }, | ||
184 | { "UserID", principalID.ToString() } | ||
185 | }; | ||
186 | |||
187 | OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs); | ||
188 | if (response["Success"].AsBoolean() && response["User"] is OSDMap) | ||
189 | { | ||
190 | OSDMap userMap = (OSDMap)response["User"]; | ||
191 | string identifier = userMap["Name"].AsString(); | ||
192 | |||
193 | if (!String.IsNullOrEmpty(identifier)) | ||
194 | { | ||
195 | // Add/update the md5hash identity | ||
196 | requestArgs = new NameValueCollection | ||
197 | { | ||
198 | { "RequestMethod", "AddIdentity" }, | ||
199 | { "Identifier", identifier }, | ||
200 | { "Credential", "$1$" + Utils.MD5String(passwd) }, | ||
201 | { "Type", "md5hash" }, | ||
202 | { "UserID", principalID.ToString() } | ||
203 | }; | ||
204 | |||
205 | response = WebUtil.PostToService(m_serverUrl, requestArgs); | ||
206 | bool success = response["Success"].AsBoolean(); | ||
207 | |||
208 | if (!success) | ||
209 | m_log.WarnFormat("[AUTH CONNECTOR]: Failed to set password for {0} ({1})", identifier, principalID); | ||
210 | |||
211 | return success; | ||
212 | } | ||
213 | } | ||
214 | else | ||
215 | { | ||
216 | m_log.Warn("[AUTH CONNECTOR]: Failed to retrieve identities for " + principalID + ": " + | ||
217 | response["Message"].AsString()); | ||
218 | } | ||
219 | |||
183 | return false; | 220 | return false; |
184 | } | 221 | } |
185 | 222 | ||