Implemented initial login code for the management agent
TODO: crypto-secure random session ID, data providers - HELP ME JEBUS (Or Adam)zircon^2
parent
0120938f7a
commit
6ddc0f4c39
|
@ -1,6 +1,8 @@
|
||||||
using Nwc.XmlRpc;
|
using Nwc.XmlRpc;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Servers;
|
using OpenSim.Servers;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace OpenGrid.Framework.Manager {
|
namespace OpenGrid.Framework.Manager {
|
||||||
|
|
||||||
|
@ -20,6 +22,8 @@ namespace OpenGrid.Framework.Manager {
|
||||||
this.component_type=component_type;
|
this.component_type=component_type;
|
||||||
this.thecallback=thecallback;
|
this.thecallback=thecallback;
|
||||||
|
|
||||||
|
app_httpd.AddXmlRPCHandler("manager_login",XmlRpcLoginMethod);
|
||||||
|
|
||||||
switch(component_type)
|
switch(component_type)
|
||||||
{
|
{
|
||||||
case "gridserver":
|
case "gridserver":
|
||||||
|
@ -31,5 +35,25 @@ namespace OpenGrid.Framework.Manager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
|
||||||
|
{
|
||||||
|
XmlRpcResponse response = new XmlRpcResponse();
|
||||||
|
Hashtable requestData = (Hashtable)request.Params[0];
|
||||||
|
Hashtable responseData = new Hashtable();
|
||||||
|
|
||||||
|
// TODO: Switch this over to using OpenGrid.Framework.Data
|
||||||
|
if( requestData["username"].Equals("admin") && requestData["password"].Equals("supersecret")) {
|
||||||
|
response.IsFault=false;
|
||||||
|
responseData["msg"]="Login OK";
|
||||||
|
} else {
|
||||||
|
response.IsFault=true;
|
||||||
|
responseData["error"]="Invalid username or password";
|
||||||
|
}
|
||||||
|
|
||||||
|
response.Value = responseData;
|
||||||
|
return response;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue