Made account Authentication optional in "sandbox/standalone" mode. Just change "standalone_authenticate = false" to be true in OpenSim.ini. Then as per grid mode, you can use the "create user" command to create new accounts.
parent
f147d8e0f0
commit
114807b9d1
|
@ -53,6 +53,7 @@ using OpenSim.Framework.Utilities;
|
||||||
|
|
||||||
namespace OpenSim
|
namespace OpenSim
|
||||||
{
|
{
|
||||||
|
public delegate void ConsoleCommand(string comParams);
|
||||||
|
|
||||||
public class OpenSimMain : RegionApplicationBase, conscmd_callback
|
public class OpenSimMain : RegionApplicationBase, conscmd_callback
|
||||||
{
|
{
|
||||||
|
@ -68,7 +69,10 @@ namespace OpenSim
|
||||||
protected List<Scene> m_localScenes = new List<Scene>();
|
protected List<Scene> m_localScenes = new List<Scene>();
|
||||||
|
|
||||||
private bool m_silent;
|
private bool m_silent;
|
||||||
private string m_logFilename = ("region-console" + ".log");
|
private string m_logFilename = ("region-console.log");
|
||||||
|
|
||||||
|
private bool standaloneAuthenticate = false;
|
||||||
|
public ConsoleCommand CreateAccount = null;
|
||||||
|
|
||||||
public OpenSimMain(IConfigSource configSource)
|
public OpenSimMain(IConfigSource configSource)
|
||||||
: base()
|
: base()
|
||||||
|
@ -98,6 +102,8 @@ namespace OpenSim
|
||||||
m_silent = configSource.Configs["Startup"].GetBoolean("noverbose", false);
|
m_silent = configSource.Configs["Startup"].GetBoolean("noverbose", false);
|
||||||
|
|
||||||
m_storageDLL = configSource.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
|
m_storageDLL = configSource.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
|
||||||
|
|
||||||
|
standaloneAuthenticate = configSource.Configs["Startup"].GetBoolean("standalone_authenticate", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -122,7 +128,12 @@ namespace OpenSim
|
||||||
|
|
||||||
if (m_sandbox)
|
if (m_sandbox)
|
||||||
{
|
{
|
||||||
m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache);
|
CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, standaloneAuthenticate);
|
||||||
|
m_commsManager = localComms;
|
||||||
|
if(standaloneAuthenticate)
|
||||||
|
{
|
||||||
|
this.CreateAccount = localComms.do_create;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -320,6 +331,13 @@ namespace OpenSim
|
||||||
Shutdown();
|
Shutdown();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "create":
|
||||||
|
if (CreateAccount != null)
|
||||||
|
{
|
||||||
|
CreateAccount(cmdparams[0]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
m_log.Error("Unknown command");
|
m_log.Error("Unknown command");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -25,10 +25,13 @@
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
using System;
|
||||||
using OpenSim.Framework.Communications;
|
using OpenSim.Framework.Communications;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Servers;
|
using OpenSim.Framework.Servers;
|
||||||
using OpenSim.Framework.Communications.Caches;
|
using OpenSim.Framework.Communications.Caches;
|
||||||
|
using OpenSim.Framework.Console;
|
||||||
|
using OpenSim.Framework.Utilities;
|
||||||
|
|
||||||
namespace OpenSim.Region.Communications.Local
|
namespace OpenSim.Region.Communications.Local
|
||||||
{
|
{
|
||||||
|
@ -37,10 +40,10 @@ namespace OpenSim.Region.Communications.Local
|
||||||
public LocalBackEndServices SandBoxServices = new LocalBackEndServices();
|
public LocalBackEndServices SandBoxServices = new LocalBackEndServices();
|
||||||
public LocalUserServices UserServices;
|
public LocalUserServices UserServices;
|
||||||
|
|
||||||
public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache )
|
public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, bool accountsAuthenticate )
|
||||||
: base(serversInfo, httpServer, assetCache)
|
: base(serversInfo, httpServer, assetCache)
|
||||||
{
|
{
|
||||||
UserServices = new LocalUserServices(this, serversInfo);
|
UserServices = new LocalUserServices(this, serversInfo, accountsAuthenticate);
|
||||||
UserServices.AddPlugin("OpenSim.Framework.Data.DB4o.dll");
|
UserServices.AddPlugin("OpenSim.Framework.Data.DB4o.dll");
|
||||||
UserServer = UserServices;
|
UserServer = UserServices;
|
||||||
GridServer = SandBoxServices;
|
GridServer = SandBoxServices;
|
||||||
|
@ -52,5 +55,30 @@ namespace OpenSim.Region.Communications.Local
|
||||||
{
|
{
|
||||||
this.SandBoxServices.AddNewSession(regionHandle, login);
|
this.SandBoxServices.AddNewSession(regionHandle, login);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void do_create(string what)
|
||||||
|
{
|
||||||
|
switch (what)
|
||||||
|
{
|
||||||
|
case "user":
|
||||||
|
string tempfirstname;
|
||||||
|
string templastname;
|
||||||
|
string tempMD5Passwd;
|
||||||
|
uint regX = 1000;
|
||||||
|
uint regY = 1000;
|
||||||
|
|
||||||
|
tempfirstname = MainLog.Instance.CmdPrompt("First name");
|
||||||
|
templastname = MainLog.Instance.CmdPrompt("Last name");
|
||||||
|
tempMD5Passwd = MainLog.Instance.PasswdPrompt("Password");
|
||||||
|
regX = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region X"));
|
||||||
|
regY = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region Y"));
|
||||||
|
|
||||||
|
tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + "");
|
||||||
|
|
||||||
|
this.UserServices.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,13 +15,15 @@ namespace OpenSim.Region.Communications.Local
|
||||||
private NetworkServersInfo serversInfo;
|
private NetworkServersInfo serversInfo;
|
||||||
private uint defaultHomeX ;
|
private uint defaultHomeX ;
|
||||||
private uint defaultHomeY;
|
private uint defaultHomeY;
|
||||||
|
private bool authUsers = false;
|
||||||
|
|
||||||
public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo)
|
public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo, bool authenticate)
|
||||||
{
|
{
|
||||||
m_Parent = parent;
|
m_Parent = parent;
|
||||||
this.serversInfo = serversInfo;
|
this.serversInfo = serversInfo;
|
||||||
defaultHomeX = this.serversInfo.DefaultHomeLocX;
|
defaultHomeX = this.serversInfo.DefaultHomeLocX;
|
||||||
defaultHomeY = this.serversInfo.DefaultHomeLocY;
|
defaultHomeY = this.serversInfo.DefaultHomeLocY;
|
||||||
|
this.authUsers = authenticate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserProfileData GetUserProfile(string firstName, string lastName)
|
public UserProfileData GetUserProfile(string firstName, string lastName)
|
||||||
|
@ -67,11 +69,24 @@ namespace OpenSim.Region.Communications.Local
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool AuthenticateUser(UserProfileData profile, string password)
|
public override bool AuthenticateUser(UserProfileData profile, string password)
|
||||||
|
{
|
||||||
|
if (!authUsers)
|
||||||
{
|
{
|
||||||
//for now we will accept any password in sandbox mode
|
//for now we will accept any password in sandbox mode
|
||||||
Console.WriteLine("authorising user");
|
Console.WriteLine("authorising user");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine( "Authenticating " + profile.username + " " + profile.surname);
|
||||||
|
|
||||||
|
password = password.Remove(0, 3); //remove $1$
|
||||||
|
|
||||||
|
string s = Util.Md5Hash(password + ":" + profile.passwordSalt);
|
||||||
|
|
||||||
|
return profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void CustomiseResponse(LoginResponse response, UserProfileData theUser)
|
public override void CustomiseResponse(LoginResponse response, UserProfileData theUser)
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace SimpleApp
|
||||||
{
|
{
|
||||||
base.StartUp();
|
base.StartUp();
|
||||||
|
|
||||||
m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache);
|
m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, false);
|
||||||
|
|
||||||
m_log.Notice(m_log.LineInfo);
|
m_log.Notice(m_log.LineInfo);
|
||||||
|
|
||||||
|
|
|
@ -2,3 +2,4 @@
|
||||||
gridmode = false
|
gridmode = false
|
||||||
physics = basicphysics
|
physics = basicphysics
|
||||||
storage_plugin = "OpenSim.DataStore.NullStorage.dll"
|
storage_plugin = "OpenSim.DataStore.NullStorage.dll"
|
||||||
|
standalone_authenticate = false
|
||||||
|
|
|
@ -511,6 +511,7 @@
|
||||||
<Reference name="OpenSim.Framework.UserManagement" />
|
<Reference name="OpenSim.Framework.UserManagement" />
|
||||||
<Reference name="OpenSim.Framework.Data" />
|
<Reference name="OpenSim.Framework.Data" />
|
||||||
<Reference name="OpenSim.Framework.Servers"/>
|
<Reference name="OpenSim.Framework.Servers"/>
|
||||||
|
<Reference name="OpenSim.Framework.Console"/>
|
||||||
<Reference name="libsecondlife.dll"/>
|
<Reference name="libsecondlife.dll"/>
|
||||||
<Reference name="OpenSim.Framework"/>
|
<Reference name="OpenSim.Framework"/>
|
||||||
<Reference name="XMLRPC.dll"/>
|
<Reference name="XMLRPC.dll"/>
|
||||||
|
|
Loading…
Reference in New Issue