diff options
author | Justin Clark-Casey (justincc) | 2009-09-24 14:54:12 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2009-09-24 14:54:12 +0100 |
commit | 7870152d23db4cb6f5834d4921fac17feb717220 (patch) | |
tree | ccfd000db77de790908b6480785c78151859886b /OpenSim/Framework/Communications/UserManagerBase.cs | |
parent | Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-7870152d23db4cb6f5834d4921fac17feb717220.zip opensim-SC-7870152d23db4cb6f5834d4921fac17feb717220.tar.gz opensim-SC-7870152d23db4cb6f5834d4921fac17feb717220.tar.bz2 opensim-SC-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/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 | } |