ZOMG! Authentication!

zircon^2
gareth 2007-05-19 11:52:04 +00:00
parent 605a34c5ef
commit f0261fb51b
1 changed files with 10 additions and 1 deletions

View File

@ -16,6 +16,8 @@ namespace OpenGrid.Framework.Manager {
private string recvkey; private string recvkey;
private string component_type; private string component_type;
private static ArrayList Sessions;
public GridManagementAgent(BaseHttpServer app_httpd, string component_type, string sendkey, string recvkey, GridManagerCallback thecallback) public GridManagementAgent(BaseHttpServer app_httpd, string component_type, string sendkey, string recvkey, GridManagerCallback thecallback)
{ {
this.sendkey=sendkey; this.sendkey=sendkey;
@ -36,6 +38,11 @@ namespace OpenGrid.Framework.Manager {
} }
} }
public static bool SessionExists(LLUUID sessionID)
{
return Sessions.Contains(sessionID);
}
public static XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) public static XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
{ {
XmlRpcResponse response = new XmlRpcResponse(); XmlRpcResponse response = new XmlRpcResponse();
@ -45,7 +52,9 @@ namespace OpenGrid.Framework.Manager {
// TODO: Switch this over to using OpenGrid.Framework.Data // TODO: Switch this over to using OpenGrid.Framework.Data
if( requestData["username"].Equals("admin") && requestData["password"].Equals("supersecret")) { if( requestData["username"].Equals("admin") && requestData["password"].Equals("supersecret")) {
response.IsFault=false; response.IsFault=false;
responseData["session_id"]=(LLUUID.Random()).ToString(); LLUUID new_session=LLUUID.Random();
Sessions.Add(new_session);
responseData["session_id"]=new_session.ToString();
responseData["msg"]="Login OK"; responseData["msg"]="Login OK";
} else { } else {
response.IsFault=true; response.IsFault=true;