From 35fa85069e792579ebd44a974053d6dce288ea0a Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 28 Mar 2007 18:10:52 +0000 Subject: After hours of searching for a bug, it works - User accounts in sandbox mode, currently they are not persistent between restarts (ie restarting opensim.exe) but should be persistent between sessions (login/ logout). Use the -account command line arg to enable them and then create new accounts through the web interface --- OpenSim.RegionServer/CAPS/AdminWebFront.cs | 33 +++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'OpenSim.RegionServer/CAPS/AdminWebFront.cs') diff --git a/OpenSim.RegionServer/CAPS/AdminWebFront.cs b/OpenSim.RegionServer/CAPS/AdminWebFront.cs index 03f8692..8224050 100644 --- a/OpenSim.RegionServer/CAPS/AdminWebFront.cs +++ b/OpenSim.RegionServer/CAPS/AdminWebFront.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Text; using System.IO; using OpenSim.world; +using OpenSim.UserServer; namespace OpenSim.CAPS { @@ -13,9 +14,11 @@ namespace OpenSim.CAPS private string LoginForm; private string passWord = "Admin"; private World m_world; + private LoginServer _userServer; - public AdminWebFront(string password, World world) + public AdminWebFront(string password, World world, LoginServer userserver) { + _userServer = userserver; m_world = world; passWord = password; LoadAdminPage(); @@ -63,8 +66,12 @@ namespace OpenSim.CAPS case "/Admin/NewAccount": if (requestMethod == "POST") { - string[] comp = new string[10]; - string[] passw = new string[3]; + string firstName = ""; + string secondName = ""; + string userPasswd = ""; + string[] comp; + string[] passw; + string[] line; string delimStr = "&"; char[] delimiter = delimStr.ToCharArray(); string delimStr2 = "="; @@ -75,6 +82,26 @@ namespace OpenSim.CAPS passw = comp[3].Split(delimiter2); if (passw[1] == passWord) { + + line = comp[0].Split(delimiter2); //split firstname + if (line.Length > 1) + { + firstName = line[1]; + } + line = comp[1].Split(delimiter2); //split secondname + if (line.Length > 1) + { + secondName = line[1]; + } + line = comp[2].Split(delimiter2); //split user password + if (line.Length > 1) + { + userPasswd = line[1]; + } + if (this._userServer != null) + { + this._userServer.CreateUserAccount(firstName, secondName, userPasswd); + } responseString = "

New Account created

"; } else -- cgit v1.1