From 6ddc0f4c391831faaf0748750e6dc5637c1c3eb4 Mon Sep 17 00:00:00 2001 From: gareth Date: Thu, 17 May 2007 07:35:27 +0000 Subject: Implemented initial login code for the management agent TODO: crypto-secure random session ID, data providers - HELP ME JEBUS (Or Adam) --- OpenGrid.Framework.Manager/GridManagementAgent.cs | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/OpenGrid.Framework.Manager/GridManagementAgent.cs b/OpenGrid.Framework.Manager/GridManagementAgent.cs index dca7a4a..c8e2cfd 100644 --- a/OpenGrid.Framework.Manager/GridManagementAgent.cs +++ b/OpenGrid.Framework.Manager/GridManagementAgent.cs @@ -1,6 +1,8 @@ using Nwc.XmlRpc; using OpenSim.Framework; using OpenSim.Servers; +using System.Collections; +using System.Collections.Generic; namespace OpenGrid.Framework.Manager { @@ -20,6 +22,8 @@ namespace OpenGrid.Framework.Manager { this.component_type=component_type; this.thecallback=thecallback; + app_httpd.AddXmlRPCHandler("manager_login",XmlRpcLoginMethod); + switch(component_type) { 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; + + } + } } -- cgit v1.1