diff options
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 6ffb8ec..eaab61c 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -92,6 +92,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
92 | m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod); | 92 | m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod); |
93 | m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod); | 93 | m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod); |
94 | m_httpd.AddXmlRPCHandler("admin_create_user", XmlRpcCreateUserMethod); | 94 | m_httpd.AddXmlRPCHandler("admin_create_user", XmlRpcCreateUserMethod); |
95 | m_httpd.AddXmlRPCHandler("admin_exists_user", XmlRpcUserExistsMethod); | ||
95 | m_httpd.AddXmlRPCHandler("admin_update_user", XmlRpcUpdateUserAccountMethod); | 96 | m_httpd.AddXmlRPCHandler("admin_update_user", XmlRpcUpdateUserAccountMethod); |
96 | m_httpd.AddXmlRPCHandler("admin_load_xml", XmlRpcLoadXMLMethod); | 97 | m_httpd.AddXmlRPCHandler("admin_load_xml", XmlRpcLoadXMLMethod); |
97 | m_httpd.AddXmlRPCHandler("admin_save_xml", XmlRpcSaveXMLMethod); | 98 | m_httpd.AddXmlRPCHandler("admin_save_xml", XmlRpcSaveXMLMethod); |
@@ -646,6 +647,79 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
646 | return response; | 647 | return response; |
647 | } | 648 | } |
648 | 649 | ||
650 | |||
651 | /// <summary> | ||
652 | /// Check whether a certain user account exists. | ||
653 | /// <summary> | ||
654 | /// <param name="request">incoming XML RPC request</param> | ||
655 | /// <remarks> | ||
656 | /// XmlRpcUserExistsMethod takes the following XMLRPC | ||
657 | /// parameters | ||
658 | /// <list type="table"> | ||
659 | /// <listheader><term>parameter name</term><description>description</description></listheader> | ||
660 | /// <item><term>password</term> | ||
661 | /// <description>admin password as set in OpenSim.ini</description></item> | ||
662 | /// <item><term>user_firstname</term> | ||
663 | /// <description>avatar's first name</description></item> | ||
664 | /// <item><term>user_lastname</term> | ||
665 | /// <description>avatar's last name</description></item> | ||
666 | /// </list> | ||
667 | /// | ||
668 | /// XmlRpcCreateUserMethod returns | ||
669 | /// <list type="table"> | ||
670 | /// <listheader><term>name</term><description>description</description></listheader> | ||
671 | /// <item><term>user_firstname</term> | ||
672 | /// <description>avatar's first name</description></item> | ||
673 | /// <item><term>user_lastname</term> | ||
674 | /// <description>avatar's last name</description></item> | ||
675 | /// <item><term>success</term> | ||
676 | /// <description>true or false</description></item> | ||
677 | /// <item><term>error</term> | ||
678 | /// <description>error message if success is false</description></item> | ||
679 | /// </list> | ||
680 | /// </remarks> | ||
681 | public XmlRpcResponse XmlRpcUserExistsMethod(XmlRpcRequest request) | ||
682 | { | ||
683 | m_log.Info("[RADMIN]: UserExists: new request"); | ||
684 | XmlRpcResponse response = new XmlRpcResponse(); | ||
685 | Hashtable responseData = new Hashtable(); | ||
686 | |||
687 | try | ||
688 | { | ||
689 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
690 | |||
691 | // check completeness | ||
692 | checkStringParameters(request, new string[] { "password", "user_firstname", "user_lastname"}); | ||
693 | |||
694 | string firstname = (string) requestData["user_firstname"]; | ||
695 | string lastname = (string) requestData["user_lastname"]; | ||
696 | |||
697 | UserProfileData userProfile = m_app.CommunicationsManager.UserService.GetUserProfile(firstname, lastname); | ||
698 | |||
699 | responseData["user_firstname"] = firstname; | ||
700 | responseData["user_lastname"] = lastname; | ||
701 | |||
702 | if (null == userProfile) | ||
703 | responseData["success"] = false; | ||
704 | else | ||
705 | responseData["success"] = true; | ||
706 | |||
707 | response.Value = responseData; | ||
708 | } | ||
709 | catch (Exception e) | ||
710 | { | ||
711 | m_log.ErrorFormat("[RADMIN] UserExists: failed: {0}", e.Message); | ||
712 | m_log.DebugFormat("[RADMIN] UserExists: failed: {0}", e.ToString()); | ||
713 | |||
714 | responseData["success"] = "false"; | ||
715 | responseData["error"] = e.Message; | ||
716 | |||
717 | response.Value = responseData; | ||
718 | } | ||
719 | |||
720 | return response; | ||
721 | } | ||
722 | |||
649 | /// <summary> | 723 | /// <summary> |
650 | /// Update the password of a user account. | 724 | /// Update the password of a user account. |
651 | /// <summary> | 725 | /// <summary> |