diff options
author | Kitto Flora | 2009-09-30 19:07:18 +0200 |
---|---|---|
committer | Kitto Flora | 2009-09-30 19:07:18 +0200 |
commit | 07df0e0ab0c69633a6afec8d05cccc117656d3d9 (patch) | |
tree | 3048cc38b313e255cbf03fa3e2900e28cadc47c9 /OpenSim/Framework/Communications/UserManagerBase.cs | |
parent | And another merge issue (diff) | |
parent | Fix loading modules with alternate configurations and ports into ROBUST. (diff) | |
download | opensim-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/UserManagerBase.cs')
-rw-r--r-- | OpenSim/Framework/Communications/UserManagerBase.cs | 32 |
1 files changed, 28 insertions, 4 deletions
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 | } |