aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs22
-rw-r--r--OpenSim/Region/Communications/Local/CommunicationsLocal.cs32
-rw-r--r--OpenSim/Region/Communications/Local/LocalUserServices.cs23
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs2
-rw-r--r--bin/OpenSim.ini3
-rw-r--r--prebuild.xml1
6 files changed, 73 insertions, 10 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 7316db4..611041d 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -53,6 +53,7 @@ using OpenSim.Framework.Utilities;
53 53
54namespace OpenSim 54namespace OpenSim
55{ 55{
56 public delegate void ConsoleCommand(string comParams);
56 57
57 public class OpenSimMain : RegionApplicationBase, conscmd_callback 58 public class OpenSimMain : RegionApplicationBase, conscmd_callback
58 { 59 {
@@ -68,7 +69,10 @@ namespace OpenSim
68 protected List<Scene> m_localScenes = new List<Scene>(); 69 protected List<Scene> m_localScenes = new List<Scene>();
69 70
70 private bool m_silent; 71 private bool m_silent;
71 private string m_logFilename = ("region-console" + ".log"); 72 private string m_logFilename = ("region-console.log");
73
74 private bool standaloneAuthenticate = false;
75 public ConsoleCommand CreateAccount = null;
72 76
73 public OpenSimMain(IConfigSource configSource) 77 public OpenSimMain(IConfigSource configSource)
74 : base() 78 : base()
@@ -98,6 +102,8 @@ namespace OpenSim
98 m_silent = configSource.Configs["Startup"].GetBoolean("noverbose", false); 102 m_silent = configSource.Configs["Startup"].GetBoolean("noverbose", false);
99 103
100 m_storageDLL = configSource.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); 104 m_storageDLL = configSource.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
105
106 standaloneAuthenticate = configSource.Configs["Startup"].GetBoolean("standalone_authenticate", false);
101 } 107 }
102 108
103 /// <summary> 109 /// <summary>
@@ -122,7 +128,12 @@ namespace OpenSim
122 128
123 if (m_sandbox) 129 if (m_sandbox)
124 { 130 {
125 m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache); 131 CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, standaloneAuthenticate);
132 m_commsManager = localComms;
133 if(standaloneAuthenticate)
134 {
135 this.CreateAccount = localComms.do_create;
136 }
126 } 137 }
127 else 138 else
128 { 139 {
@@ -320,6 +331,13 @@ namespace OpenSim
320 Shutdown(); 331 Shutdown();
321 break; 332 break;
322 333
334 case "create":
335 if (CreateAccount != null)
336 {
337 CreateAccount(cmdparams[0]);
338 }
339 break;
340
323 default: 341 default:
324 m_log.Error("Unknown command"); 342 m_log.Error("Unknown command");
325 break; 343 break;
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
index 0c40453..69352d1 100644
--- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
+++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
@@ -25,10 +25,13 @@
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28using System;
28using OpenSim.Framework.Communications; 29using OpenSim.Framework.Communications;
29using OpenSim.Framework.Types; 30using OpenSim.Framework.Types;
30using OpenSim.Framework.Servers; 31using OpenSim.Framework.Servers;
31using OpenSim.Framework.Communications.Caches; 32using OpenSim.Framework.Communications.Caches;
33using OpenSim.Framework.Console;
34using OpenSim.Framework.Utilities;
32 35
33namespace OpenSim.Region.Communications.Local 36namespace OpenSim.Region.Communications.Local
34{ 37{
@@ -37,10 +40,10 @@ namespace OpenSim.Region.Communications.Local
37 public LocalBackEndServices SandBoxServices = new LocalBackEndServices(); 40 public LocalBackEndServices SandBoxServices = new LocalBackEndServices();
38 public LocalUserServices UserServices; 41 public LocalUserServices UserServices;
39 42
40 public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) 43 public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, bool accountsAuthenticate )
41 : base(serversInfo, httpServer, assetCache) 44 : base(serversInfo, httpServer, assetCache)
42 { 45 {
43 UserServices = new LocalUserServices(this, serversInfo); 46 UserServices = new LocalUserServices(this, serversInfo, accountsAuthenticate);
44 UserServices.AddPlugin("OpenSim.Framework.Data.DB4o.dll"); 47 UserServices.AddPlugin("OpenSim.Framework.Data.DB4o.dll");
45 UserServer = UserServices; 48 UserServer = UserServices;
46 GridServer = SandBoxServices; 49 GridServer = SandBoxServices;
@@ -52,5 +55,30 @@ namespace OpenSim.Region.Communications.Local
52 { 55 {
53 this.SandBoxServices.AddNewSession(regionHandle, login); 56 this.SandBoxServices.AddNewSession(regionHandle, login);
54 } 57 }
58
59 public void do_create(string what)
60 {
61 switch (what)
62 {
63 case "user":
64 string tempfirstname;
65 string templastname;
66 string tempMD5Passwd;
67 uint regX = 1000;
68 uint regY = 1000;
69
70 tempfirstname = MainLog.Instance.CmdPrompt("First name");
71 templastname = MainLog.Instance.CmdPrompt("Last name");
72 tempMD5Passwd = MainLog.Instance.PasswdPrompt("Password");
73 regX = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region X"));
74 regY = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region Y"));
75
76 tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + "");
77
78 this.UserServices.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY);
79 break;
80 }
81 }
82
55 } 83 }
56} 84}
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index cc80c81..223c157 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -15,13 +15,15 @@ namespace OpenSim.Region.Communications.Local
15 private NetworkServersInfo serversInfo; 15 private NetworkServersInfo serversInfo;
16 private uint defaultHomeX ; 16 private uint defaultHomeX ;
17 private uint defaultHomeY; 17 private uint defaultHomeY;
18 private bool authUsers = false;
18 19
19 public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo) 20 public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo, bool authenticate)
20 { 21 {
21 m_Parent = parent; 22 m_Parent = parent;
22 this.serversInfo = serversInfo; 23 this.serversInfo = serversInfo;
23 defaultHomeX = this.serversInfo.DefaultHomeLocX; 24 defaultHomeX = this.serversInfo.DefaultHomeLocX;
24 defaultHomeY = this.serversInfo.DefaultHomeLocY; 25 defaultHomeY = this.serversInfo.DefaultHomeLocY;
26 this.authUsers = authenticate;
25 } 27 }
26 28
27 public UserProfileData GetUserProfile(string firstName, string lastName) 29 public UserProfileData GetUserProfile(string firstName, string lastName)
@@ -68,9 +70,22 @@ namespace OpenSim.Region.Communications.Local
68 70
69 public override bool AuthenticateUser(UserProfileData profile, string password) 71 public override bool AuthenticateUser(UserProfileData profile, string password)
70 { 72 {
71 //for now we will accept any password in sandbox mode 73 if (!authUsers)
72 Console.WriteLine("authorising user"); 74 {
73 return true; 75 //for now we will accept any password in sandbox mode
76 Console.WriteLine("authorising user");
77 return true;
78 }
79 else
80 {
81 Console.WriteLine( "Authenticating " + profile.username + " " + profile.surname);
82
83 password = password.Remove(0, 3); //remove $1$
84
85 string s = Util.Md5Hash(password + ":" + profile.passwordSalt);
86
87 return profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase);
88 }
74 } 89 }
75 90
76 public override void CustomiseResponse(LoginResponse response, UserProfileData theUser) 91 public override void CustomiseResponse(LoginResponse response, UserProfileData theUser)
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index 84c86fd..8db3262 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -47,7 +47,7 @@ namespace SimpleApp
47 { 47 {
48 base.StartUp(); 48 base.StartUp();
49 49
50 m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache); 50 m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, false);
51 51
52 m_log.Notice(m_log.LineInfo); 52 m_log.Notice(m_log.LineInfo);
53 53
diff --git a/bin/OpenSim.ini b/bin/OpenSim.ini
index 022d82f..278202d 100644
--- a/bin/OpenSim.ini
+++ b/bin/OpenSim.ini
@@ -1,4 +1,5 @@
1[Startup] 1[Startup]
2gridmode = false 2gridmode = false
3physics = basicphysics 3physics = basicphysics
4storage_plugin = "OpenSim.DataStore.NullStorage.dll" \ No newline at end of file 4storage_plugin = "OpenSim.DataStore.NullStorage.dll"
5standalone_authenticate = false
diff --git a/prebuild.xml b/prebuild.xml
index 572a5de..a8a455e 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -511,6 +511,7 @@
511 <Reference name="OpenSim.Framework.UserManagement" /> 511 <Reference name="OpenSim.Framework.UserManagement" />
512 <Reference name="OpenSim.Framework.Data" /> 512 <Reference name="OpenSim.Framework.Data" />
513 <Reference name="OpenSim.Framework.Servers"/> 513 <Reference name="OpenSim.Framework.Servers"/>
514 <Reference name="OpenSim.Framework.Console"/>
514 <Reference name="libsecondlife.dll"/> 515 <Reference name="libsecondlife.dll"/>
515 <Reference name="OpenSim.Framework"/> 516 <Reference name="OpenSim.Framework"/>
516 <Reference name="XMLRPC.dll"/> 517 <Reference name="XMLRPC.dll"/>