From fecbb2febd04ec1ad26d0a38930c61cad372b6c6 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 1 Oct 2008 15:17:37 +0000 Subject: Add a user server XMLRPC method to set the MOTD and the minimum GodLevel required to log in. set_login_params accepts avatar_uuid and password of a user with god level 200 or more, and allows setting either or both the login_motd or login_level --- OpenSim/Framework/Communications/LoginResponse.cs | 16 ++++++++++++++++ OpenSim/Framework/Communications/LoginService.cs | 9 +++++++++ 2 files changed, 25 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/LoginResponse.cs b/OpenSim/Framework/Communications/LoginResponse.cs index db504f9..b2565b1 100644 --- a/OpenSim/Framework/Communications/LoginResponse.cs +++ b/OpenSim/Framework/Communications/LoginResponse.cs @@ -275,6 +275,22 @@ namespace OpenSim.Framework.Communications "false"); } + public XmlRpcResponse CreateLoginBlockedResponse() + { + return + (GenerateFailureResponse("presence", + "Logins are currently restricted. Please try again later", + "false")); + } + + public LLSD CreateLoginBlockedResponseLLSD() + { + return GenerateFailureResponseLLSD( + "presence", + "Logins are currently restricted. Please try again later", + "false"); + } + public XmlRpcResponse CreateDeadRegionResponse() { return diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index 7a39a97..7a657b5 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs @@ -47,6 +47,7 @@ namespace OpenSim.Framework.Communications private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected string m_welcomeMessage = "Welcome to OpenSim"; + protected int m_minLoginLevel = 0; protected UserManagerBase m_userManager = null; protected Mutex m_loginMutex = new Mutex(false); @@ -196,6 +197,10 @@ namespace OpenSim.Framework.Communications return logResponse.CreateLoginFailedResponse(); } + else if (userProfile.GodLevel < m_minLoginLevel) + { + return logResponse.CreateLoginBlockedResponse(); + } else { // If we already have a session... @@ -363,6 +368,10 @@ namespace OpenSim.Framework.Communications { return logResponse.CreateLoginFailedResponseLLSD(); } + else if (userProfile.GodLevel < m_minLoginLevel) + { + return logResponse.CreateLoginBlockedResponseLLSD(); + } else { // If we already have a session... -- cgit v1.1