aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/CAPS/AdminWebFront.cs
diff options
context:
space:
mode:
authorMW2007-03-28 18:10:52 +0000
committerMW2007-03-28 18:10:52 +0000
commit35fa85069e792579ebd44a974053d6dce288ea0a (patch)
tree8a5629c4f5e0a51e20a05123c4b1b9ea9f49f61e /OpenSim.RegionServer/CAPS/AdminWebFront.cs
parent* log file name conflict (diff)
downloadopensim-SC_OLD-35fa85069e792579ebd44a974053d6dce288ea0a.zip
opensim-SC_OLD-35fa85069e792579ebd44a974053d6dce288ea0a.tar.gz
opensim-SC_OLD-35fa85069e792579ebd44a974053d6dce288ea0a.tar.bz2
opensim-SC_OLD-35fa85069e792579ebd44a974053d6dce288ea0a.tar.xz
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
Diffstat (limited to 'OpenSim.RegionServer/CAPS/AdminWebFront.cs')
-rw-r--r--OpenSim.RegionServer/CAPS/AdminWebFront.cs33
1 files changed, 30 insertions, 3 deletions
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;
3using System.Text; 3using System.Text;
4using System.IO; 4using System.IO;
5using OpenSim.world; 5using OpenSim.world;
6using OpenSim.UserServer;
6 7
7namespace OpenSim.CAPS 8namespace OpenSim.CAPS
8{ 9{
@@ -13,9 +14,11 @@ namespace OpenSim.CAPS
13 private string LoginForm; 14 private string LoginForm;
14 private string passWord = "Admin"; 15 private string passWord = "Admin";
15 private World m_world; 16 private World m_world;
17 private LoginServer _userServer;
16 18
17 public AdminWebFront(string password, World world) 19 public AdminWebFront(string password, World world, LoginServer userserver)
18 { 20 {
21 _userServer = userserver;
19 m_world = world; 22 m_world = world;
20 passWord = password; 23 passWord = password;
21 LoadAdminPage(); 24 LoadAdminPage();
@@ -63,8 +66,12 @@ namespace OpenSim.CAPS
63 case "/Admin/NewAccount": 66 case "/Admin/NewAccount":
64 if (requestMethod == "POST") 67 if (requestMethod == "POST")
65 { 68 {
66 string[] comp = new string[10]; 69 string firstName = "";
67 string[] passw = new string[3]; 70 string secondName = "";
71 string userPasswd = "";
72 string[] comp;
73 string[] passw;
74 string[] line;
68 string delimStr = "&"; 75 string delimStr = "&";
69 char[] delimiter = delimStr.ToCharArray(); 76 char[] delimiter = delimStr.ToCharArray();
70 string delimStr2 = "="; 77 string delimStr2 = "=";
@@ -75,6 +82,26 @@ namespace OpenSim.CAPS
75 passw = comp[3].Split(delimiter2); 82 passw = comp[3].Split(delimiter2);
76 if (passw[1] == passWord) 83 if (passw[1] == passWord)
77 { 84 {
85
86 line = comp[0].Split(delimiter2); //split firstname
87 if (line.Length > 1)
88 {
89 firstName = line[1];
90 }
91 line = comp[1].Split(delimiter2); //split secondname
92 if (line.Length > 1)
93 {
94 secondName = line[1];
95 }
96 line = comp[2].Split(delimiter2); //split user password
97 if (line.Length > 1)
98 {
99 userPasswd = line[1];
100 }
101 if (this._userServer != null)
102 {
103 this._userServer.CreateUserAccount(firstName, secondName, userPasswd);
104 }
78 responseString = "<p> New Account created </p>"; 105 responseString = "<p> New Account created </p>";
79 } 106 }
80 else 107 else