From b63405c1a796b44b58081857d01f726372467628 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 8 Jan 2010 10:43:34 -0800 Subject: Inching ahead... This compiles, but very likely does not run. --- .../Rest/Inventory/RequestData.cs | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs') diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs index d3a7e64..10f1a6e 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RequestData.cs @@ -35,6 +35,9 @@ using System.Xml; using OpenSim.Framework; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Services.Interfaces; + +using OpenMetaverse; namespace OpenSim.ApplicationPlugins.Rest.Inventory { @@ -658,7 +661,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory { int x; - string HA1; string first; string last; @@ -675,17 +677,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory last = String.Empty; } - UserProfileData udata = Rest.UserServices.GetUserProfile(first, last); + UserAccount account = Rest.UserServices.GetUserAccount(UUID.Zero, first, last); // If we don't recognize the user id, perhaps it is god? - - if (udata == null) + if (account == null) return pass == Rest.GodKey; - HA1 = HashToString(pass); - HA1 = HashToString(String.Format("{0}:{1}",HA1,udata.PasswordSalt)); - - return (0 == sc.Compare(HA1, udata.PasswordHash)); + return (Rest.AuthServices.Authenticate(account.PrincipalID, pass, 1) != string.Empty); } @@ -897,11 +895,10 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory last = String.Empty; } - UserProfileData udata = Rest.UserServices.GetUserProfile(first, last); - + UserAccount account = Rest.UserServices.GetUserAccount(UUID.Zero, first, last); // If we don;t recognize the user id, perhaps it is god? - if (udata == null) + if (account == null) { Rest.Log.DebugFormat("{0} Administrator", MsgId); return Rest.GodKey; @@ -909,7 +906,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory else { Rest.Log.DebugFormat("{0} Normal User {1}", MsgId, user); - return udata.PasswordHash; + + // !!! REFACTORING PROBLEM + // This is what it was. It doesn't work in 0.7 + // Nothing retrieves the password from the authentication service, there's only authentication. + //return udata.PasswordHash; + return string.Empty; } } -- cgit v1.1