diff options
author | Justin Clarke Casey | 2008-01-29 14:43:45 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-01-29 14:43:45 +0000 |
commit | 55dc0dc2670f0db384d7ff5bad3d810a08ffbd34 (patch) | |
tree | 7384716228c2e8e773ee6db7641c3f98c109a0c8 /OpenSim | |
parent | * No more massive spires and massive pits when editing land using Select + to... (diff) | |
download | opensim-SC_OLD-55dc0dc2670f0db384d7ff5bad3d810a08ffbd34.zip opensim-SC_OLD-55dc0dc2670f0db384d7ff5bad3d810a08ffbd34.tar.gz opensim-SC_OLD-55dc0dc2670f0db384d7ff5bad3d810a08ffbd34.tar.bz2 opensim-SC_OLD-55dc0dc2670f0db384d7ff5bad3d810a08ffbd34.tar.xz |
* Patch from Ansi (IBM)
* Allows the creation of a user via the RemoteAdminPlugin.
* Many thanks!
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 56 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 5 |
2 files changed, 59 insertions, 2 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index fa76078..770abe7 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -67,6 +67,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
67 | m_httpd.AddXmlRPCHandler("admin_broadcast", XmlRpcAlertMethod); | 67 | m_httpd.AddXmlRPCHandler("admin_broadcast", XmlRpcAlertMethod); |
68 | m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod); | 68 | m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod); |
69 | m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod); | 69 | m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod); |
70 | m_httpd.AddXmlRPCHandler("admin_create_user", XmlRpcCreateUserMethod); | ||
70 | } | 71 | } |
71 | } | 72 | } |
72 | catch (NullReferenceException) | 73 | catch (NullReferenceException) |
@@ -281,9 +282,60 @@ namespace OpenSim.ApplicationPlugins.LoadRegions | |||
281 | return response; | 282 | return response; |
282 | } | 283 | } |
283 | 284 | ||
284 | public void Close() | 285 | public XmlRpcResponse XmlRpcCreateUserMethod(XmlRpcRequest request) |
285 | { | 286 | { |
287 | MainLog.Instance.Verbose("RADMIN", "Received Create User Administrator Request"); | ||
288 | XmlRpcResponse response = new XmlRpcResponse(); | ||
289 | Hashtable requestData = (Hashtable) request.Params[0]; | ||
290 | Hashtable responseData = new Hashtable(); | ||
291 | if (requiredPassword != System.String.Empty && | ||
292 | (!requestData.Contains("password") || (string) requestData["password"] != requiredPassword)) | ||
293 | { | ||
294 | responseData["created"] = "false"; | ||
295 | response.Value = responseData; | ||
296 | } | ||
297 | else | ||
298 | { | ||
299 | try | ||
300 | { | ||
301 | string tempfirstname = (string) requestData["user_firstname"]; | ||
302 | string templastname = (string) requestData["user_lastname"]; | ||
303 | string tempPasswd = (string) requestData["user_password"]; | ||
304 | uint regX = Convert.ToUInt32((Int32) requestData["start_region_x"]); | ||
305 | uint regY = Convert.ToUInt32((Int32) requestData["start_region_y"]); | ||
306 | |||
307 | LLUUID tempuserID = m_app.CreateUser(tempfirstname, templastname, tempPasswd, regX, regY); | ||
308 | |||
309 | if (tempuserID == LLUUID.Zero) | ||
310 | { | ||
311 | responseData["created"] = "false"; | ||
312 | responseData["error"] = "Error creating user"; | ||
313 | responseData["avatar_uuid"] = LLUUID.Zero; | ||
314 | response.Value = responseData; | ||
315 | MainLog.Instance.Error("RADMIN", "Error creating user (" + tempfirstname + " " + templastname + ") :"); | ||
316 | } | ||
317 | else | ||
318 | { | ||
319 | responseData["created"] = "true"; | ||
320 | responseData["avatar_uuid"] = tempuserID; | ||
321 | response.Value = responseData; | ||
322 | MainLog.Instance.Verbose("RADMIN", "User " + tempfirstname + " " + templastname + " created. Userid " + tempuserID + " assigned."); | ||
323 | } | ||
324 | } | ||
325 | catch (Exception e) | ||
326 | { | ||
327 | responseData["created"] = "false"; | ||
328 | responseData["error"] = e.ToString(); | ||
329 | responseData["avatar_uuid"] = LLUUID.Zero; | ||
330 | response.Value = responseData; | ||
331 | } | ||
332 | } | ||
333 | |||
334 | return response; | ||
286 | } | 335 | } |
287 | 336 | ||
337 | public void Close() | ||
338 | { | ||
339 | } | ||
288 | } | 340 | } |
289 | } \ No newline at end of file | 341 | } |
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index a620bd4..f0e60cf 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -436,6 +436,10 @@ namespace OpenSim | |||
436 | m_sceneManager.OnRestartSim += handleRestartRegion; | 436 | m_sceneManager.OnRestartSim += handleRestartRegion; |
437 | } | 437 | } |
438 | 438 | ||
439 | public LLUUID CreateUser(string tempfirstname, string templastname, string tempPasswd, uint regX, uint regY) | ||
440 | { | ||
441 | return m_commsManager.AddUser(tempfirstname,templastname,tempPasswd,regX,regY); | ||
442 | } | ||
439 | 443 | ||
440 | public UDPServer CreateRegion(RegionInfo regionInfo) | 444 | public UDPServer CreateRegion(RegionInfo regionInfo) |
441 | { | 445 | { |
@@ -678,6 +682,7 @@ namespace OpenSim | |||
678 | m_log.Error(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive."); | 682 | m_log.Error(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive."); |
679 | m_log.Error(" alert general [Message] - send an alert to all users."); | 683 | m_log.Error(" alert general [Message] - send an alert to all users."); |
680 | m_log.Error("backup - trigger a simulator backup"); | 684 | m_log.Error("backup - trigger a simulator backup"); |
685 | m_log.Error("create user - adds a new user"); | ||
681 | m_log.Error("change-region [name] - sets the region that many of these commands affect."); | 686 | m_log.Error("change-region [name] - sets the region that many of these commands affect."); |
682 | m_log.Error("command-script [filename] - Execute command in a file."); | 687 | m_log.Error("command-script [filename] - Execute command in a file."); |
683 | m_log.Error("debug - debugging commands"); | 688 | m_log.Error("debug - debugging commands"); |