aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
diff options
context:
space:
mode:
authorKitto Flora2009-09-30 19:07:18 +0200
committerKitto Flora2009-09-30 19:07:18 +0200
commit07df0e0ab0c69633a6afec8d05cccc117656d3d9 (patch)
tree3048cc38b313e255cbf03fa3e2900e28cadc47c9 /OpenSim/Framework/Communications
parentAnd another merge issue (diff)
parentFix loading modules with alternate configurations and ports into ROBUST. (diff)
downloadopensim-SC_OLD-07df0e0ab0c69633a6afec8d05cccc117656d3d9.zip
opensim-SC_OLD-07df0e0ab0c69633a6afec8d05cccc117656d3d9.tar.gz
opensim-SC_OLD-07df0e0ab0c69633a6afec8d05cccc117656d3d9.tar.bz2
opensim-SC_OLD-07df0e0ab0c69633a6afec8d05cccc117656d3d9.tar.xz
Merge branch '0.6.7-post-fixes' into vehicles
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r--OpenSim/Framework/Communications/IUserService.cs16
-rw-r--r--OpenSim/Framework/Communications/Services/LoginService.cs5
-rw-r--r--OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs5
-rw-r--r--OpenSim/Framework/Communications/UserManagerBase.cs32
4 files changed, 50 insertions, 8 deletions
diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs
index 725225d..15c5a96 100644
--- a/OpenSim/Framework/Communications/IUserService.cs
+++ b/OpenSim/Framework/Communications/IUserService.cs
@@ -98,7 +98,7 @@ namespace OpenSim.Framework.Communications
98 /// <param name="friendlistowner">The agent that who's friends list is being updated</param> 98 /// <param name="friendlistowner">The agent that who's friends list is being updated</param>
99 /// <param name="friend">The agent that is getting or loosing permissions</param> 99 /// <param name="friend">The agent that is getting or loosing permissions</param>
100 /// <param name="perms">A uint bit vector for set perms that the friend being added has; 0 = none, 1=This friend can see when they sign on, 2 = map, 4 edit objects </param> 100 /// <param name="perms">A uint bit vector for set perms that the friend being added has; 0 = none, 1=This friend can see when they sign on, 2 = map, 4 edit objects </param>
101 void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms); 101 void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms);
102 102
103 /// <summary> 103 /// <summary>
104 /// Logs off a user on the user server 104 /// Logs off a user on the user server
@@ -137,9 +137,21 @@ namespace OpenSim.Framework.Communications
137 // But since Scenes only have IUserService references, I'm placing it here for now. 137 // But since Scenes only have IUserService references, I'm placing it here for now.
138 bool VerifySession(UUID userID, UUID sessionID); 138 bool VerifySession(UUID userID, UUID sessionID);
139 139
140 /// <summary>
141 /// Authenticate a user by their password.
142 /// </summary>
143 ///
144 /// This is used by callers outside the login process that want to
145 /// verify a user who has given their password.
146 ///
147 /// This should probably also be in IAuthentication but is here for the same reasons as VerifySession() is
148 ///
149 /// <param name="userID"></param>
150 /// <param name="password"></param>
151 /// <returns></returns>
152 bool AuthenticateUserByPassword(UUID userID, string password);
140 153
141 // Temporary Hack until we move everything to the new service model 154 // Temporary Hack until we move everything to the new service model
142 void SetInventoryService(IInventoryService invService); 155 void SetInventoryService(IInventoryService invService);
143
144 } 156 }
145} 157}
diff --git a/OpenSim/Framework/Communications/Services/LoginService.cs b/OpenSim/Framework/Communications/Services/LoginService.cs
index bf59f8e..a6cd918 100644
--- a/OpenSim/Framework/Communications/Services/LoginService.cs
+++ b/OpenSim/Framework/Communications/Services/LoginService.cs
@@ -1221,11 +1221,13 @@ namespace OpenSim.Framework.Communications.Services
1221 { 1221 {
1222 return Util.CreateUnknownUserErrorResponse(); 1222 return Util.CreateUnknownUserErrorResponse();
1223 } 1223 }
1224
1224 UUID.TryParse((string)requestData["session_id"], out guess_sid); 1225 UUID.TryParse((string)requestData["session_id"], out guess_sid);
1225 if (guess_sid == UUID.Zero) 1226 if (guess_sid == UUID.Zero)
1226 { 1227 {
1227 return Util.CreateUnknownUserErrorResponse(); 1228 return Util.CreateUnknownUserErrorResponse();
1228 } 1229 }
1230
1229 if (m_userManager.VerifySession(guess_aid, guess_sid)) 1231 if (m_userManager.VerifySession(guess_aid, guess_sid))
1230 { 1232 {
1231 authed = "TRUE"; 1233 authed = "TRUE";
@@ -1243,6 +1245,5 @@ namespace OpenSim.Framework.Communications.Services
1243 response.Value = responseData; 1245 response.Value = responseData;
1244 return response; 1246 return response;
1245 } 1247 }
1246
1247 } 1248 }
1248} 1249} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs
index ac0dc6d..a757282 100644
--- a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs
+++ b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs
@@ -149,6 +149,11 @@ namespace OpenSim.Framework.Communications.Tests
149 { 149 {
150 throw new NotImplementedException(); 150 throw new NotImplementedException();
151 } 151 }
152
153 public virtual bool AuthenticateUserByPassword(UUID userID, string password)
154 {
155 throw new NotImplementedException();
156 }
152 } 157 }
153 } 158 }
154} 159}
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index 58174a0..1abd733 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -44,7 +44,8 @@ namespace OpenSim.Framework.Communications
44 /// <summary> 44 /// <summary>
45 /// Base class for user management (create, read, etc) 45 /// Base class for user management (create, read, etc)
46 /// </summary> 46 /// </summary>
47 public abstract class UserManagerBase : IUserService, IUserAdminService, IAvatarService, IMessagingService, IAuthentication 47 public abstract class UserManagerBase
48 : IUserService, IUserAdminService, IAvatarService, IMessagingService, IAuthentication
48 { 49 {
49 private static readonly ILog m_log 50 private static readonly ILog m_log
50 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 51 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -93,9 +94,9 @@ namespace OpenSim.Framework.Communications
93 public void AddPlugin(string provider, string connect) 94 public void AddPlugin(string provider, string connect)
94 { 95 {
95 m_plugins.AddRange(DataPluginFactory.LoadDataPlugins<IUserDataPlugin>(provider, connect)); 96 m_plugins.AddRange(DataPluginFactory.LoadDataPlugins<IUserDataPlugin>(provider, connect));
96 } 97 }
97 98
98 #region UserProfile 99 #region UserProfile
99 100
100 public virtual void AddTemporaryUserProfile(UserProfileData userProfile) 101 public virtual void AddTemporaryUserProfile(UserProfileData userProfile)
101 { 102 {
@@ -891,7 +892,10 @@ namespace OpenSim.Framework.Communications
891 892
892 if (userProfile != null && userProfile.CurrentAgent != null) 893 if (userProfile != null && userProfile.CurrentAgent != null)
893 { 894 {
894 m_log.DebugFormat("[USER AUTH]: Verifying session {0} for {1}; current session {2}", sessionID, userID, userProfile.CurrentAgent.SessionID); 895 m_log.DebugFormat(
896 "[USER AUTH]: Verifying session {0} for {1}; current session {2}",
897 sessionID, userID, userProfile.CurrentAgent.SessionID);
898
895 if (userProfile.CurrentAgent.SessionID == sessionID) 899 if (userProfile.CurrentAgent.SessionID == sessionID)
896 { 900 {
897 return true; 901 return true;
@@ -901,6 +905,26 @@ namespace OpenSim.Framework.Communications
901 return false; 905 return false;
902 } 906 }
903 907
908 public virtual bool AuthenticateUserByPassword(UUID userID, string password)
909 {
910// m_log.DebugFormat("[USER AUTH]: Authenticating user {0} given password {1}", userID, password);
911
912 UserProfileData userProfile = GetUserProfile(userID);
913
914 if (null == userProfile)
915 return false;
916
917 string md5PasswordHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + userProfile.PasswordSalt);
918
919// m_log.DebugFormat(
920// "[USER AUTH]: Submitted hash {0}, stored hash {1}", md5PasswordHash, userProfile.PasswordHash);
921
922 if (md5PasswordHash == userProfile.PasswordHash)
923 return true;
924 else
925 return false;
926 }
927
904 #endregion 928 #endregion
905 } 929 }
906} 930}