diff options
author | mingchen | 2007-06-28 14:45:46 +0000 |
---|---|---|
committer | mingchen | 2007-06-28 14:45:46 +0000 |
commit | bee543300fc812277e9a9478dc05b986e00ed44e (patch) | |
tree | 06282ee383d09a271cc8c7bbeed5dd41b5abee8c | |
parent | Finished removing the old scripting code, Scene.Scripting.cs and OpenSim.Fram... (diff) | |
download | opensim-SC-bee543300fc812277e9a9478dc05b986e00ed44e.zip opensim-SC-bee543300fc812277e9a9478dc05b986e00ed44e.tar.gz opensim-SC-bee543300fc812277e9a9478dc05b986e00ed44e.tar.bz2 opensim-SC-bee543300fc812277e9a9478dc05b986e00ed44e.tar.xz |
*User Profile requests on OGS UserServer now uses XMLRPC instead of REST
*Added base support for setting up a master user
-rw-r--r-- | OpenGridServices.sln | 127 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/IUserServices.cs | 5 | ||||
-rw-r--r-- | OpenSim/Framework/UserManager/UserManagerBase.cs | 126 | ||||
-rw-r--r-- | OpenSim/Grid/UserServer/Main.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Communications/Local/LocalUserServices.cs | 25 | ||||
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGSUserServices.cs | 17 |
6 files changed, 165 insertions, 139 deletions
diff --git a/OpenGridServices.sln b/OpenGridServices.sln index 2343bc0..5f47b6b 100644 --- a/OpenGridServices.sln +++ b/OpenGridServices.sln | |||
@@ -1,5 +1,5 @@ | |||
1 | Microsoft Visual Studio Solution File, Format Version 9.00 | 1 | Microsoft Visual Studio Solution File, Format Version 9.00 |
2 | # Visual Studio 2005 | 2 | # Visual C# Express 2005 |
3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Data", "OpenSim\Framework\Data\OpenSim.Framework.Data.csproj", "{36B72A9B-0000-0000-0000-000000000000}" | 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Data", "OpenSim\Framework\Data\OpenSim.Framework.Data.csproj", "{36B72A9B-0000-0000-0000-000000000000}" |
4 | EndProject | 4 | EndProject |
5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Data.DB4o", "OpenSim\Framework\Data.DB4o\OpenSim.Framework.Data.DB4o.csproj", "{FD2D303D-0000-0000-0000-000000000000}" | 5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Data.DB4o", "OpenSim\Framework\Data.DB4o\OpenSim.Framework.Data.DB4o.csproj", "{FD2D303D-0000-0000-0000-000000000000}" |
@@ -25,72 +25,61 @@ EndProject | |||
25 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Grid.UserServer.Config", "OpenSim\Grid\UserServer.Config\OpenSim.Grid.UserServer.Config.csproj", "{08F87229-0000-0000-0000-000000000000}" | 25 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Grid.UserServer.Config", "OpenSim\Grid\UserServer.Config\OpenSim.Grid.UserServer.Config.csproj", "{08F87229-0000-0000-0000-000000000000}" |
26 | EndProject | 26 | EndProject |
27 | Global | 27 | Global |
28 | GlobalSection(SolutionConfigurationPlatforms) = preSolution | 28 | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
29 | Debug|Any CPU = Debug|Any CPU | 29 | Debug|Any CPU = Debug|Any CPU |
30 | Release|Any CPU = Release|Any CPU | 30 | Release|Any CPU = Release|Any CPU |
31 | EndGlobalSection | 31 | EndGlobalSection |
32 | GlobalSection(ProjectDependencies) = postSolution | 32 | GlobalSection(ProjectConfigurationPlatforms) = postSolution |
33 | ({FD2D303D-0000-0000-0000-000000000000}).2 = ({36B72A9B-0000-0000-0000-000000000000}) | 33 | {36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
34 | ({17F7F694-0000-0000-0000-000000000000}).1 = ({36B72A9B-0000-0000-0000-000000000000}) | 34 | {36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU |
35 | ({17F7F6BE-0000-0000-0000-000000000000}).2 = ({36B72A9B-0000-0000-0000-000000000000}) | 35 | {36B72A9B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU |
36 | ({6ECC56A9-0000-0000-0000-000000000000}).1 = ({36B72A9B-0000-0000-0000-000000000000}) | 36 | {36B72A9B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU |
37 | ({586E2916-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000}) | 37 | {FD2D303D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
38 | ({60FCC3A6-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000}) | 38 | {FD2D303D-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU |
39 | ({60FCC3A6-0000-0000-0000-000000000000}).7 = ({4B7BFD1C-0000-0000-0000-000000000000}) | 39 | {FD2D303D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU |
40 | ({2FC96F92-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000}) | 40 | {FD2D303D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU |
41 | ({2FC96F92-0000-0000-0000-000000000000}).7 = ({586E2916-0000-0000-0000-000000000000}) | 41 | {17F7F694-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
42 | EndGlobalSection | 42 | {17F7F694-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU |
43 | GlobalSection(ProjectConfigurationPlatforms) = postSolution | 43 | {17F7F694-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU |
44 | {36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | 44 | {17F7F694-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU |
45 | {36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU | 45 | {17F7F6BE-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
46 | {36B72A9B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU | 46 | {17F7F6BE-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU |
47 | {36B72A9B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU | 47 | {17F7F6BE-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU |
48 | {FD2D303D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | 48 | {17F7F6BE-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU |
49 | {FD2D303D-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU | 49 | {6ECC56A9-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
50 | {FD2D303D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU | 50 | {6ECC56A9-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU |
51 | {FD2D303D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU | 51 | {6ECC56A9-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU |
52 | {17F7F694-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | 52 | {6ECC56A9-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU |
53 | {17F7F694-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU | 53 | {586E2916-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
54 | {17F7F694-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU | 54 | {586E2916-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU |
55 | {17F7F694-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU | 55 | {586E2916-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU |
56 | {17F7F6BE-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | 56 | {586E2916-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU |
57 | {17F7F6BE-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU | 57 | {E5F1A03B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
58 | {17F7F6BE-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU | 58 | {E5F1A03B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU |
59 | {17F7F6BE-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU | 59 | {E5F1A03B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU |
60 | {6ECC56A9-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | 60 | {E5F1A03B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU |
61 | {6ECC56A9-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU | 61 | {4B7BFD1C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
62 | {6ECC56A9-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU | 62 | {4B7BFD1C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU |
63 | {6ECC56A9-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU | 63 | {4B7BFD1C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU |
64 | {586E2916-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | 64 | {4B7BFD1C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU |
65 | {586E2916-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU | 65 | {60FCC3A6-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
66 | {586E2916-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU | 66 | {60FCC3A6-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU |
67 | {586E2916-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU | 67 | {60FCC3A6-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU |
68 | {E5F1A03B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | 68 | {60FCC3A6-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU |
69 | {E5F1A03B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU | 69 | {1442B635-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
70 | {E5F1A03B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU | 70 | {1442B635-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU |
71 | {E5F1A03B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU | 71 | {1442B635-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU |
72 | {4B7BFD1C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | 72 | {1442B635-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU |
73 | {4B7BFD1C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU | 73 | {2FC96F92-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
74 | {4B7BFD1C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU | 74 | {2FC96F92-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU |
75 | {4B7BFD1C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU | 75 | {2FC96F92-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU |
76 | {60FCC3A6-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | 76 | {2FC96F92-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU |
77 | {60FCC3A6-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU | 77 | {08F87229-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
78 | {60FCC3A6-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU | 78 | {08F87229-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU |
79 | {60FCC3A6-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU | 79 | {08F87229-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU |
80 | {1442B635-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | 80 | {08F87229-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU |
81 | {1442B635-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU | 81 | EndGlobalSection |
82 | {1442B635-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU | 82 | GlobalSection(SolutionProperties) = preSolution |
83 | {1442B635-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU | 83 | HideSolutionNode = FALSE |
84 | {2FC96F92-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | 84 | EndGlobalSection |
85 | {2FC96F92-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
86 | {2FC96F92-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
87 | {2FC96F92-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU | ||
88 | {08F87229-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
89 | {08F87229-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
90 | {08F87229-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
91 | {08F87229-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU | ||
92 | EndGlobalSection | ||
93 | GlobalSection(SolutionProperties) = preSolution | ||
94 | HideSolutionNode = FALSE | ||
95 | EndGlobalSection | ||
96 | EndGlobal | 85 | EndGlobal |
diff --git a/OpenSim/Framework/Communications/IUserServices.cs b/OpenSim/Framework/Communications/IUserServices.cs index 6790651..37f4942 100644 --- a/OpenSim/Framework/Communications/IUserServices.cs +++ b/OpenSim/Framework/Communications/IUserServices.cs | |||
@@ -39,6 +39,9 @@ namespace OpenSim.Framework.Communications | |||
39 | UserProfileData GetUserProfile(string firstName, string lastName); | 39 | UserProfileData GetUserProfile(string firstName, string lastName); |
40 | UserProfileData GetUserProfile(string name); | 40 | UserProfileData GetUserProfile(string name); |
41 | UserProfileData GetUserProfile(LLUUID avatarID); | 41 | UserProfileData GetUserProfile(LLUUID avatarID); |
42 | 42 | ||
43 | UserProfileData SetupMasterUser(string firstName, string lastName); | ||
44 | UserProfileData SetupMasterUser(string firstName, string lastName, string password); | ||
45 | |||
43 | } | 46 | } |
44 | } | 47 | } |
diff --git a/OpenSim/Framework/UserManager/UserManagerBase.cs b/OpenSim/Framework/UserManager/UserManagerBase.cs index eb46c14..bc35164 100644 --- a/OpenSim/Framework/UserManager/UserManagerBase.cs +++ b/OpenSim/Framework/UserManager/UserManagerBase.cs | |||
@@ -537,27 +537,15 @@ namespace OpenSim.Framework.UserManagement | |||
537 | /// Returns an error message that the user could not be found in the database | 537 | /// Returns an error message that the user could not be found in the database |
538 | /// </summary> | 538 | /// </summary> |
539 | /// <returns>XML string consisting of a error element containing individual error(s)</returns> | 539 | /// <returns>XML string consisting of a error element containing individual error(s)</returns> |
540 | public string CreateUnknownUserErrorResponse() | 540 | public XmlRpcResponse CreateUnknownUserErrorResponse() |
541 | { | 541 | { |
542 | System.IO.StringWriter sw = new System.IO.StringWriter(); | 542 | XmlRpcResponse response = new XmlRpcResponse(); |
543 | XmlTextWriter xw = new XmlTextWriter(sw); | 543 | Hashtable responseData = new Hashtable(); |
544 | 544 | responseData["error_type"] = "unknown_user"; | |
545 | // Header | 545 | responseData["error_desc"] = "The user requested is not in the database"; |
546 | xw.Formatting = Formatting.Indented; | ||
547 | xw.WriteStartDocument(); | ||
548 | xw.WriteDocType("error", null, null, null); | ||
549 | xw.WriteComment("An error occured"); | ||
550 | xw.WriteStartElement("error"); | ||
551 | |||
552 | // User | ||
553 | xw.WriteElementString("unknownuser", "Unable to find a user with that name"); | ||
554 | |||
555 | // Footer | ||
556 | xw.WriteEndElement(); | ||
557 | xw.Flush(); | ||
558 | xw.Close(); | ||
559 | 546 | ||
560 | return sw.ToString(); | 547 | response.Value = responseData; |
548 | return response; | ||
561 | } | 549 | } |
562 | 550 | ||
563 | /// <summary> | 551 | /// <summary> |
@@ -565,75 +553,81 @@ namespace OpenSim.Framework.UserManagement | |||
565 | /// </summary> | 553 | /// </summary> |
566 | /// <param name="profile">The user profile</param> | 554 | /// <param name="profile">The user profile</param> |
567 | /// <returns>A string containing an XML Document of the user profile</returns> | 555 | /// <returns>A string containing an XML Document of the user profile</returns> |
568 | public string ProfileToXml(UserProfileData profile) | 556 | public XmlRpcResponse ProfileToXmlRPCResponse(UserProfileData profile) |
569 | { | 557 | { |
570 | System.IO.StringWriter sw = new System.IO.StringWriter(); | 558 | XmlRpcResponse response = new XmlRpcResponse(); |
571 | XmlTextWriter xw = new XmlTextWriter(sw); | 559 | Hashtable responseData = new Hashtable(); |
572 | 560 | ||
573 | // Header | ||
574 | xw.Formatting = Formatting.Indented; | ||
575 | xw.WriteStartDocument(); | ||
576 | xw.WriteDocType("userprofile", null, null, null); | ||
577 | xw.WriteComment("Found user profiles matching the request"); | ||
578 | xw.WriteStartElement("users"); | ||
579 | |||
580 | // User | ||
581 | xw.WriteStartElement("user"); | ||
582 | // Account information | 561 | // Account information |
583 | xw.WriteAttributeString("firstname", profile.username); | 562 | responseData["firstname"] = profile.username; |
584 | xw.WriteAttributeString("lastname", profile.surname); | 563 | responseData["lastname"] = profile.surname; |
585 | xw.WriteAttributeString("uuid", profile.UUID.ToStringHyphenated()); | 564 | responseData["uuid"] = profile.UUID.ToStringHyphenated(); |
586 | // Server Information | 565 | // Server Information |
587 | xw.WriteAttributeString("server_inventory", profile.userInventoryURI); | 566 | responseData["server_inventory"] = profile.userInventoryURI; |
588 | xw.WriteAttributeString("server_asset", profile.userAssetURI); | 567 | responseData["server_asset"] = profile.userAssetURI; |
589 | // Profile Information | 568 | // Profile Information |
590 | xw.WriteAttributeString("profile_about", profile.profileAboutText); | 569 | responseData["profile_about"] = profile.profileAboutText; |
591 | xw.WriteAttributeString("profile_firstlife_about", profile.profileFirstText); | 570 | responseData["profile_firstlife_about"] = profile.profileFirstText; |
592 | xw.WriteAttributeString("profile_firstlife_image", profile.profileFirstImage.ToStringHyphenated()); | 571 | responseData["profile_firstlife_image"] = profile.profileFirstImage.ToStringHyphenated(); |
593 | xw.WriteAttributeString("profile_can_do", profile.profileCanDoMask.ToString()); | 572 | responseData["profile_can_do"] = profile.profileCanDoMask.ToString(); |
594 | xw.WriteAttributeString("profile_want_do", profile.profileWantDoMask.ToString()); | 573 | responseData["profile_want_do"] = profile.profileWantDoMask.ToString(); |
595 | xw.WriteAttributeString("profile_image", profile.profileImage.ToStringHyphenated()); | 574 | responseData["profile_image"] = profile.profileImage.ToStringHyphenated(); |
596 | xw.WriteAttributeString("profile_created",profile.created.ToString()); | 575 | responseData["profile_created"] = profile.created.ToString(); |
597 | xw.WriteAttributeString("profile_lastlogin",profile.lastLogin.ToString()); | 576 | responseData["profile_lastlogin"] = profile.lastLogin.ToString(); |
598 | // Home region information | 577 | // Home region information |
599 | xw.WriteAttributeString("home_coordinates", profile.homeLocation.ToString()); | 578 | responseData["home_coordinates"] = profile.homeLocation.ToString(); |
600 | xw.WriteAttributeString("home_region", profile.homeRegion.ToString()); | 579 | responseData["home_region"] = profile.homeRegion.ToString(); |
601 | xw.WriteAttributeString("home_look", profile.homeLookAt.ToString()); | 580 | responseData["home_look"] = profile.homeLookAt.ToString(); |
602 | 581 | ||
603 | xw.WriteEndElement(); | 582 | response.Value = responseData; |
604 | 583 | return response; | |
605 | // Footer | ||
606 | xw.WriteEndElement(); | ||
607 | xw.Flush(); | ||
608 | xw.Close(); | ||
609 | |||
610 | return sw.ToString(); | ||
611 | } | 584 | } |
612 | 585 | ||
613 | #region REST Methods | 586 | #region XMLRPC User Methods |
614 | //should most likely move out of here and into the grid's userserver sub class | 587 | //should most likely move out of here and into the grid's userserver sub class |
615 | public string RestGetUserMethodName(string request, string path, string param) | 588 | public XmlRpcResponse XmlRPCGetUserMethodName(XmlRpcRequest request) |
616 | { | 589 | { |
617 | UserProfileData userProfile = getUserProfile(param.Trim()); | 590 | XmlRpcResponse response = new XmlRpcResponse(); |
591 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
592 | UserProfileData userProfile; | ||
618 | 593 | ||
619 | if (userProfile == null) | 594 | if (requestData.Contains("avatar_name")) |
595 | { | ||
596 | userProfile = getUserProfile((string)requestData["avatar_name"]); | ||
597 | if (userProfile == null) | ||
598 | { | ||
599 | return CreateUnknownUserErrorResponse(); | ||
600 | } | ||
601 | } | ||
602 | else | ||
620 | { | 603 | { |
621 | return CreateUnknownUserErrorResponse(); | 604 | return CreateUnknownUserErrorResponse(); |
622 | } | 605 | } |
606 | |||
623 | 607 | ||
624 | return ProfileToXml(userProfile); | 608 | return ProfileToXmlRPCResponse(userProfile); |
625 | } | 609 | } |
626 | 610 | ||
627 | public string RestGetUserMethodUUID(string request, string path, string param) | 611 | public XmlRpcResponse XmlRPCGetUserMethodUUID(XmlRpcRequest request) |
628 | { | 612 | { |
629 | UserProfileData userProfile = getUserProfile(new LLUUID(param)); | 613 | XmlRpcResponse response = new XmlRpcResponse(); |
630 | 614 | Hashtable requestData = (Hashtable)request.Params[0]; | |
631 | if (userProfile == null) | 615 | UserProfileData userProfile; |
616 | if (requestData.Contains("avatar_uuid")) | ||
617 | { | ||
618 | userProfile = getUserProfile((LLUUID)requestData["avatar_uuid"]); | ||
619 | if (userProfile == null) | ||
620 | { | ||
621 | return CreateUnknownUserErrorResponse(); | ||
622 | } | ||
623 | } | ||
624 | else | ||
632 | { | 625 | { |
633 | return CreateUnknownUserErrorResponse(); | 626 | return CreateUnknownUserErrorResponse(); |
634 | } | 627 | } |
635 | 628 | ||
636 | return ProfileToXml(userProfile); | 629 | |
630 | return ProfileToXmlRPCResponse(userProfile); | ||
637 | } | 631 | } |
638 | #endregion | 632 | #endregion |
639 | 633 | ||
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 8ae4dbf..640f91a 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs | |||
@@ -107,8 +107,8 @@ namespace OpenSim.Grid.UserServer | |||
107 | 107 | ||
108 | httpServer.AddXmlRPCHandler("login_to_simulator", m_userManager.XmlRpcLoginMethod); | 108 | httpServer.AddXmlRPCHandler("login_to_simulator", m_userManager.XmlRpcLoginMethod); |
109 | 109 | ||
110 | httpServer.AddRestHandler("GET", "/user/name/", m_userManager.RestGetUserMethodName); | 110 | httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName); |
111 | httpServer.AddRestHandler("GET", "/user/uuid/", m_userManager.RestGetUserMethodUUID); | 111 | httpServer.AddXmlRPCHandler("get_user_by_uuid", m_userManager.XmlRPCGetUserMethodUUID); |
112 | 112 | ||
113 | httpServer.AddRestHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod); | 113 | httpServer.AddRestHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod); |
114 | 114 | ||
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 1eb574c..2097870 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs | |||
@@ -114,5 +114,30 @@ namespace OpenSim.Region.Communications.Local | |||
114 | 114 | ||
115 | } | 115 | } |
116 | 116 | ||
117 | public UserProfileData SetupMasterUser(string firstName, string lastName) | ||
118 | { | ||
119 | return SetupMasterUser(firstName, lastName, ""); | ||
120 | } | ||
121 | public UserProfileData SetupMasterUser(string firstName, string lastName, string password) | ||
122 | { | ||
123 | UserProfileData profile = getUserProfile(firstName, lastName); | ||
124 | if (profile != null) | ||
125 | { | ||
126 | |||
127 | return profile; | ||
128 | } | ||
129 | |||
130 | Console.WriteLine("Unknown Master User. Sandbox Mode: Creating Account"); | ||
131 | this.AddUserProfile(firstName, lastName, password, defaultHomeX, defaultHomeY); | ||
132 | |||
133 | profile = getUserProfile(firstName, lastName); | ||
134 | |||
135 | if (profile == null) | ||
136 | { | ||
137 | Console.WriteLine("Unknown Master User after creation attempt. No clue what to do here."); | ||
138 | } | ||
139 | |||
140 | return profile; | ||
141 | } | ||
117 | } | 142 | } |
118 | } | 143 | } |
diff --git a/OpenSim/Region/Communications/OGS1/OGSUserServices.cs b/OpenSim/Region/Communications/OGS1/OGSUserServices.cs index 012774d..48d3018 100644 --- a/OpenSim/Region/Communications/OGS1/OGSUserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGSUserServices.cs | |||
@@ -11,7 +11,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
11 | { | 11 | { |
12 | public UserProfileData GetUserProfile(string firstName, string lastName) | 12 | public UserProfileData GetUserProfile(string firstName, string lastName) |
13 | { | 13 | { |
14 | return null; | 14 | return GetUserProfile(firstName + " " + lastName); |
15 | } | 15 | } |
16 | public UserProfileData GetUserProfile(string name) | 16 | public UserProfileData GetUserProfile(string name) |
17 | { | 17 | { |
@@ -21,5 +21,20 @@ namespace OpenSim.Region.Communications.OGS1 | |||
21 | { | 21 | { |
22 | return null; | 22 | return null; |
23 | } | 23 | } |
24 | |||
25 | public UserProfileData SetupMasterUser(string firstName, string lastName) | ||
26 | { | ||
27 | return SetupMasterUser(firstName, lastName, ""); | ||
28 | } | ||
29 | |||
30 | public UserProfileData SetupMasterUser(string firstName, string lastName, string password) | ||
31 | { | ||
32 | UserProfileData profile = GetUserProfile(firstName, lastName); | ||
33 | if (profile == null) | ||
34 | { | ||
35 | Console.WriteLine("Unknown Master User. Grid Mode: No clue what I should do. Probably would choose the grid owner UUID when that is implemented"); | ||
36 | } | ||
37 | return null; | ||
38 | } | ||
24 | } | 39 | } |
25 | } | 40 | } |