mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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...
|
||||
|
||||
Reference in New Issue
Block a user