diff options
Diffstat (limited to 'OpenSim/Framework/UserManager/UserManagerBase.cs')
-rw-r--r-- | OpenSim/Framework/UserManager/UserManagerBase.cs | 120 |
1 files changed, 1 insertions, 119 deletions
diff --git a/OpenSim/Framework/UserManager/UserManagerBase.cs b/OpenSim/Framework/UserManager/UserManagerBase.cs index c1084e9..39681d5 100644 --- a/OpenSim/Framework/UserManager/UserManagerBase.cs +++ b/OpenSim/Framework/UserManager/UserManagerBase.cs | |||
@@ -369,124 +369,6 @@ namespace OpenSim.Framework.UserManagement | |||
369 | } | 369 | } |
370 | } | 370 | } |
371 | 371 | ||
372 | // Rest and XML-RPC methods. (could move them to a sub class in the user server?) | 372 | // Rest and XML-RPC methods. (have moved them to a sub class in the user server) |
373 | |||
374 | /// <summary> | ||
375 | /// Deletes an active agent session | ||
376 | /// </summary> | ||
377 | /// <param name="request">The request</param> | ||
378 | /// <param name="path">The path (eg /bork/narf/test)</param> | ||
379 | /// <param name="param">Parameters sent</param> | ||
380 | /// <returns>Success "OK" else error</returns> | ||
381 | public string RestDeleteUserSessionMethod(string request, string path, string param) | ||
382 | { | ||
383 | // TODO! Important! | ||
384 | |||
385 | return "OK"; | ||
386 | } | ||
387 | |||
388 | /// <summary> | ||
389 | /// Returns an error message that the user could not be found in the database | ||
390 | /// </summary> | ||
391 | /// <returns>XML string consisting of a error element containing individual error(s)</returns> | ||
392 | public XmlRpcResponse CreateUnknownUserErrorResponse() | ||
393 | { | ||
394 | XmlRpcResponse response = new XmlRpcResponse(); | ||
395 | Hashtable responseData = new Hashtable(); | ||
396 | responseData["error_type"] = "unknown_user"; | ||
397 | responseData["error_desc"] = "The user requested is not in the database"; | ||
398 | |||
399 | response.Value = responseData; | ||
400 | return response; | ||
401 | } | ||
402 | |||
403 | /// <summary> | ||
404 | /// Converts a user profile to an XML element which can be returned | ||
405 | /// </summary> | ||
406 | /// <param name="profile">The user profile</param> | ||
407 | /// <returns>A string containing an XML Document of the user profile</returns> | ||
408 | public XmlRpcResponse ProfileToXmlRPCResponse(UserProfileData profile) | ||
409 | { | ||
410 | XmlRpcResponse response = new XmlRpcResponse(); | ||
411 | Hashtable responseData = new Hashtable(); | ||
412 | |||
413 | // Account information | ||
414 | responseData["firstname"] = profile.username; | ||
415 | responseData["lastname"] = profile.surname; | ||
416 | responseData["uuid"] = profile.UUID.ToStringHyphenated(); | ||
417 | // Server Information | ||
418 | responseData["server_inventory"] = profile.userInventoryURI; | ||
419 | responseData["server_asset"] = profile.userAssetURI; | ||
420 | // Profile Information | ||
421 | responseData["profile_about"] = profile.profileAboutText; | ||
422 | responseData["profile_firstlife_about"] = profile.profileFirstText; | ||
423 | responseData["profile_firstlife_image"] = profile.profileFirstImage.ToStringHyphenated(); | ||
424 | responseData["profile_can_do"] = profile.profileCanDoMask.ToString(); | ||
425 | responseData["profile_want_do"] = profile.profileWantDoMask.ToString(); | ||
426 | responseData["profile_image"] = profile.profileImage.ToStringHyphenated(); | ||
427 | responseData["profile_created"] = profile.created.ToString(); | ||
428 | responseData["profile_lastlogin"] = profile.lastLogin.ToString(); | ||
429 | // Home region information | ||
430 | responseData["home_coordinates_x"] = profile.homeLocation.X.ToString(); | ||
431 | responseData["home_coordinates_y"] = profile.homeLocation.Y.ToString(); | ||
432 | responseData["home_coordinates_z"] = profile.homeLocation.Z.ToString(); | ||
433 | |||
434 | responseData["home_region"] = profile.homeRegion.ToString(); | ||
435 | |||
436 | responseData["home_look_x"] = profile.homeLookAt.X.ToString(); | ||
437 | responseData["home_look_y"] = profile.homeLookAt.Y.ToString(); | ||
438 | responseData["home_look_z"] = profile.homeLookAt.Z.ToString(); | ||
439 | response.Value = responseData; | ||
440 | |||
441 | return response; | ||
442 | } | ||
443 | |||
444 | #region XMLRPC User Methods | ||
445 | //should most likely move out of here and into the grid's userserver sub class | ||
446 | public XmlRpcResponse XmlRPCGetUserMethodName(XmlRpcRequest request) | ||
447 | { | ||
448 | XmlRpcResponse response = new XmlRpcResponse(); | ||
449 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
450 | UserProfileData userProfile; | ||
451 | if (requestData.Contains("avatar_name")) | ||
452 | { | ||
453 | userProfile = getUserProfile((string)requestData["avatar_name"]); | ||
454 | if (userProfile == null) | ||
455 | { | ||
456 | return CreateUnknownUserErrorResponse(); | ||
457 | } | ||
458 | } | ||
459 | else | ||
460 | { | ||
461 | return CreateUnknownUserErrorResponse(); | ||
462 | } | ||
463 | |||
464 | return ProfileToXmlRPCResponse(userProfile); | ||
465 | } | ||
466 | |||
467 | public XmlRpcResponse XmlRPCGetUserMethodUUID(XmlRpcRequest request) | ||
468 | { | ||
469 | XmlRpcResponse response = new XmlRpcResponse(); | ||
470 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
471 | UserProfileData userProfile; | ||
472 | System.Console.WriteLine("METHOD BY UUID CALLED"); | ||
473 | if (requestData.Contains("avatar_uuid")) | ||
474 | { | ||
475 | userProfile = getUserProfile((LLUUID)(string)requestData["avatar_uuid"]); | ||
476 | if (userProfile == null) | ||
477 | { | ||
478 | return CreateUnknownUserErrorResponse(); | ||
479 | } | ||
480 | } | ||
481 | else | ||
482 | { | ||
483 | return CreateUnknownUserErrorResponse(); | ||
484 | } | ||
485 | |||
486 | |||
487 | return ProfileToXmlRPCResponse(userProfile); | ||
488 | } | ||
489 | #endregion | ||
490 | |||
491 | } | 373 | } |
492 | } | 374 | } |