aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2009-09-24 14:54:12 +0100
committerJustin Clark-Casey (justincc)2009-09-24 14:54:12 +0100
commit7870152d23db4cb6f5834d4921fac17feb717220 (patch)
treeccfd000db77de790908b6480785c78151859886b /OpenSim/Region/Communications
parentMerge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-7870152d23db4cb6f5834d4921fac17feb717220.zip
opensim-SC_OLD-7870152d23db4cb6f5834d4921fac17feb717220.tar.gz
opensim-SC_OLD-7870152d23db4cb6f5834d4921fac17feb717220.tar.bz2
opensim-SC_OLD-7870152d23db4cb6f5834d4921fac17feb717220.tar.xz
Allow load/save iar password checks to be done in grid mode
This should allow load/save iar to work for grid mode as long as the grid user service is later than this revision Grid services of earlier revisions will always erroneously report incorrect password. This will be addressed shortly.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Communications/Local/LocalUserServices.cs19
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserServices.cs43
2 files changed, 59 insertions, 3 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index af4fb37..d18937e 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -80,6 +80,21 @@ namespace OpenSim.Region.Communications.Local
80 throw new Exception("[LOCAL USER SERVICES]: Unknown master user UUID. Possible reason: UserServer is not running."); 80 throw new Exception("[LOCAL USER SERVICES]: Unknown master user UUID. Possible reason: UserServer is not running.");
81 } 81 }
82 return data; 82 return data;
83 } 83 }
84
85 public override bool AuthenticateUserByPassword(UUID userID, string password)
86 {
87 UserProfileData userProfile = GetUserProfile(userID);
88
89 if (null == userProfile)
90 return false;
91
92 string md5PasswordHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + userProfile.PasswordSalt);
93
94 if (md5PasswordHash == userProfile.PasswordHash)
95 return true;
96 else
97 return false;
98 }
84 } 99 }
85} 100} \ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index dff8305..89b3e42 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -140,6 +140,47 @@ namespace OpenSim.Region.Communications.OGS1
140 { 140 {
141 m_log.DebugFormat("[OGS1 USER SERVICES]: Verifying user session for " + userID); 141 m_log.DebugFormat("[OGS1 USER SERVICES]: Verifying user session for " + userID);
142 return AuthClient.VerifySession(GetUserServerURL(userID), userID, sessionID); 142 return AuthClient.VerifySession(GetUserServerURL(userID), userID, sessionID);
143 } 143 }
144
145 public override bool AuthenticateUserByPassword(UUID userID, string password)
146 {
147 try
148 {
149 Hashtable param = new Hashtable();
150 param["user_uuid"] = userID.ToString();
151 param["password"] = password;
152 IList parameters = new ArrayList();
153 parameters.Add(param);
154 XmlRpcRequest req = new XmlRpcRequest("authenticate_user_by_password", parameters);
155 XmlRpcResponse resp = req.Send(m_commsManager.NetworkServersInfo.UserURL, 30000);
156 Hashtable respData = (Hashtable)resp.Value;
157
158// foreach (object key in respData.Keys)
159// {
160// Console.WriteLine("respData {0}, {1}", key, respData[key]);
161// }
162
163// m_log.DebugFormat(
164// "[OGS1 USER SERVICES]: AuthenticatedUserByPassword response for {0} is [{1}]",
165// userID, respData["auth_user"]);
166
167 if ((string)respData["auth_user"] == "TRUE")
168 {
169 return true;
170 }
171 else
172 {
173 return false;
174 }
175 }
176 catch (Exception e)
177 {
178 m_log.ErrorFormat(
179 "[OGS1 USER SERVICES]: Error when trying to authenticate user by password from remote user server: {0}",
180 e);
181
182 return false;
183 }
184 }
144 } 185 }
145} \ No newline at end of file 186} \ No newline at end of file