diff options
author | gareth | 2007-05-19 11:52:04 +0000 |
---|---|---|
committer | gareth | 2007-05-19 11:52:04 +0000 |
commit | f0261fb51b0110dae4a50196c46848b46b127379 (patch) | |
tree | 42c1cfcf840ade4658205edeb0f7b50f5a15ad15 | |
parent | * TortoiseSVN has an annoying red icon over stuff, this means I probably chan... (diff) | |
download | opensim-SC-f0261fb51b0110dae4a50196c46848b46b127379.zip opensim-SC-f0261fb51b0110dae4a50196c46848b46b127379.tar.gz opensim-SC-f0261fb51b0110dae4a50196c46848b46b127379.tar.bz2 opensim-SC-f0261fb51b0110dae4a50196c46848b46b127379.tar.xz |
ZOMG! Authentication!
-rw-r--r-- | OpenGrid.Framework.Manager/GridManagementAgent.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/OpenGrid.Framework.Manager/GridManagementAgent.cs b/OpenGrid.Framework.Manager/GridManagementAgent.cs index c8f56d1..4f69576 100644 --- a/OpenGrid.Framework.Manager/GridManagementAgent.cs +++ b/OpenGrid.Framework.Manager/GridManagementAgent.cs | |||
@@ -16,6 +16,8 @@ namespace OpenGrid.Framework.Manager { | |||
16 | private string recvkey; | 16 | private string recvkey; |
17 | private string component_type; | 17 | private string component_type; |
18 | 18 | ||
19 | private static ArrayList Sessions; | ||
20 | |||
19 | public GridManagementAgent(BaseHttpServer app_httpd, string component_type, string sendkey, string recvkey, GridManagerCallback thecallback) | 21 | public GridManagementAgent(BaseHttpServer app_httpd, string component_type, string sendkey, string recvkey, GridManagerCallback thecallback) |
20 | { | 22 | { |
21 | this.sendkey=sendkey; | 23 | this.sendkey=sendkey; |
@@ -36,6 +38,11 @@ namespace OpenGrid.Framework.Manager { | |||
36 | } | 38 | } |
37 | } | 39 | } |
38 | 40 | ||
41 | public static bool SessionExists(LLUUID sessionID) | ||
42 | { | ||
43 | return Sessions.Contains(sessionID); | ||
44 | } | ||
45 | |||
39 | public static XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) | 46 | public static XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request) |
40 | { | 47 | { |
41 | XmlRpcResponse response = new XmlRpcResponse(); | 48 | XmlRpcResponse response = new XmlRpcResponse(); |
@@ -45,7 +52,9 @@ namespace OpenGrid.Framework.Manager { | |||
45 | // TODO: Switch this over to using OpenGrid.Framework.Data | 52 | // TODO: Switch this over to using OpenGrid.Framework.Data |
46 | if( requestData["username"].Equals("admin") && requestData["password"].Equals("supersecret")) { | 53 | if( requestData["username"].Equals("admin") && requestData["password"].Equals("supersecret")) { |
47 | response.IsFault=false; | 54 | response.IsFault=false; |
48 | responseData["session_id"]=(LLUUID.Random()).ToString(); | 55 | LLUUID new_session=LLUUID.Random(); |
56 | Sessions.Add(new_session); | ||
57 | responseData["session_id"]=new_session.ToString(); | ||
49 | responseData["msg"]="Login OK"; | 58 | responseData["msg"]="Login OK"; |
50 | } else { | 59 | } else { |
51 | response.IsFault=true; | 60 | response.IsFault=true; |