From 60639337bd92fbcd38c42088febc9832e57d19e3 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 20 May 2007 14:38:25 +0000 Subject: [PATCH] * Fixed depreciated warning in MSSQL Manager * Added support for user agents in the Userserver UserManager --- OpenGrid.Framework.Data.MSSQL/MSSQLManager.cs | 2 +- OpenGridServices.UserServer/UserManager.cs | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/OpenGrid.Framework.Data.MSSQL/MSSQLManager.cs b/OpenGrid.Framework.Data.MSSQL/MSSQLManager.cs index 5606c4cf77..12c166c0fb 100644 --- a/OpenGrid.Framework.Data.MSSQL/MSSQLManager.cs +++ b/OpenGrid.Framework.Data.MSSQL/MSSQLManager.cs @@ -57,7 +57,7 @@ namespace OpenGrid.Framework.Data.MSSQL dbcommand.CommandText = sql; foreach (KeyValuePair param in parameters) { - dbcommand.Parameters.Add(param.Key, param.Value); + dbcommand.Parameters.AddWithValue(param.Key, param.Value); } return (IDbCommand)dbcommand; diff --git a/OpenGridServices.UserServer/UserManager.cs b/OpenGridServices.UserServer/UserManager.cs index 7473685cb1..057fb79a1c 100644 --- a/OpenGridServices.UserServer/UserManager.cs +++ b/OpenGridServices.UserServer/UserManager.cs @@ -98,5 +98,56 @@ namespace OpenGridServices.UserServer return null; } + + public UserAgentData getUserAgent(LLUUID uuid) + { + foreach (KeyValuePair plugin in _plugins) + { + try + { + return plugin.Value.getAgentByUUID(uuid); + } + catch (Exception e) + { + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); + } + } + + return null; + } + + public UserAgentData getUserAgent(string name) + { + foreach (KeyValuePair plugin in _plugins) + { + try + { + return plugin.Value.getAgentByName(name); + } + catch (Exception e) + { + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); + } + } + + return null; + } + + public UserAgentData getUserAgent(string fname, string lname) + { + foreach (KeyValuePair plugin in _plugins) + { + try + { + return plugin.Value.getAgentByName(fname,lname); + } + catch (Exception e) + { + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); + } + } + + return null; + } } }