Merge branch 'master' into careminster-presence-refactor

avinationmerge
Melanie 2010-07-29 16:20:59 +01:00
commit 7a9e246ccd
5 changed files with 79 additions and 4 deletions

View File

@ -20,6 +20,7 @@
<delete dir="${distbindir}/.nant"/> <delete dir="${distbindir}/.nant"/>
<delete> <delete>
<fileset basedir="${distbindir}"> <fileset basedir="${distbindir}">
<include name="compile.bat"/>
<include name="BUILDING.txt"/> <include name="BUILDING.txt"/>
<include name="Makefile"/> <include name="Makefile"/>
<include name="nant-color"/> <include name="nant-color"/>
@ -29,7 +30,7 @@
<include name="TESTING.txt"/> <include name="TESTING.txt"/>
<include name="TestResult.xml"/> <include name="TestResult.xml"/>
<include name="bin/OpenSim.Server.ini"/> <include name="bin/OpenSim.Server.ini"/>
<include name="bin/Regions/*"/> <include name="bin/Regions/Regions.ini"/>
<include name="bin/*.db"/> <include name="bin/*.db"/>
<include name="**/.git/**"/> <include name="**/.git/**"/>
<include name=".gitignore"/> <include name=".gitignore"/>

View File

@ -118,7 +118,7 @@ namespace OpenSim.Framework.Console
// (Done with no echo and suitable for passwords) // (Done with no echo and suitable for passwords)
public string PasswdPrompt(string p) public string PasswdPrompt(string p)
{ {
return ReadLine(p, false, false); return ReadLine(String.Format("{0}: ", p), false, false);
} }
public virtual string ReadLine(string p, bool isCommand, bool e) public virtual string ReadLine(string p, bool isCommand, bool e)

View File

@ -88,7 +88,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
public void Initialise(IConfigSource source) public void Initialise(IConfigSource source)
{ {
if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name)) if (Simian.IsSimianEnabled(source, "UserAccountServices", "SimianUserAccountServiceConnector"))
{ {
IConfig gridConfig = source.Configs["UserAccountService"]; IConfig gridConfig = source.Configs["UserAccountService"];
if (gridConfig == null) if (gridConfig == null)
@ -108,6 +108,23 @@ namespace OpenSim.Services.Connectors.SimianGrid
serviceUrl = serviceUrl + '/'; serviceUrl = serviceUrl + '/';
m_serverUrl = serviceUrl; m_serverUrl = serviceUrl;
IConfig profilesConfig = source.Configs["Profiles"];
if (profilesConfig == null)
{
// Do not run this module by default.
return;
}
else
{
// if profiles aren't enabled, we're not needed.
// if we're not specified as the connector to use, then we're not wanted
if (profilesConfig.GetString("Module", String.Empty) != Name)
{
return;
}
m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Initializing {0}", this.Name);
}
} }
} }
@ -135,6 +152,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
// Profiles // Profiles
client.OnRequestAvatarProperties += RequestAvatarPropertiesHandler; client.OnRequestAvatarProperties += RequestAvatarPropertiesHandler;
client.OnUpdateAvatarProperties += UpdateAvatarPropertiesHandler; client.OnUpdateAvatarProperties += UpdateAvatarPropertiesHandler;
client.OnAvatarInterestUpdate += AvatarInterestUpdateHandler; client.OnAvatarInterestUpdate += AvatarInterestUpdateHandler;
client.OnUserInfoRequest += UserInfoRequestHandler; client.OnUserInfoRequest += UserInfoRequestHandler;
@ -302,12 +320,25 @@ namespace OpenSim.Services.Connectors.SimianGrid
System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags, System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags,
about["FLImage"].AsUUID(), about["Image"].AsUUID(), about["URL"].AsString(), user["Partner"].AsUUID()); about["FLImage"].AsUUID(), about["Image"].AsUUID(), about["URL"].AsString(), user["Partner"].AsUUID());
OSDMap interests = null;
if (user.ContainsKey("LLInterests"))
{
try
{
interests = OSDParser.DeserializeJson(user["LLInterests"].AsString()) as OSDMap;
client.SendAvatarInterestsReply(avatarID, interests["WantMask"].AsUInteger(), interests["WantText"].AsString(), interests["SkillsMask"].AsUInteger(), interests["SkillsText"].AsString(), interests["languages"].AsString());
}
catch { }
}
if (about == null)
about = new OSDMap(0);
} }
else else
{ {
m_log.Warn("[SIMIAN PROFILES]: Failed to fetch profile information for " + client.Name + ", returning default values"); m_log.Warn("[SIMIAN PROFILES]: Failed to fetch profile information for " + client.Name + ", returning default values");
client.SendAvatarProperties(avatarID, String.Empty, "1/1/1970", Utils.EmptyBytes, client.SendAvatarProperties(avatarID, String.Empty, "1/1/1970", Utils.EmptyBytes,
String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero); String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero);
} }
} }

View File

@ -45,6 +45,7 @@ namespace OpenSim.Services.InventoryService
MethodBase.GetCurrentMethod().DeclaringType); MethodBase.GetCurrentMethod().DeclaringType);
protected IXInventoryData m_Database; protected IXInventoryData m_Database;
protected bool m_AllowDelete = true;
public XInventoryService(IConfigSource config) : base(config) public XInventoryService(IConfigSource config) : base(config)
{ {
@ -60,6 +61,7 @@ namespace OpenSim.Services.InventoryService
{ {
dllName = authConfig.GetString("StorageProvider", dllName); dllName = authConfig.GetString("StorageProvider", dllName);
connString = authConfig.GetString("ConnectionString", connString); connString = authConfig.GetString("ConnectionString", connString);
m_AllowDelete = authConfig.GetBoolean("AllowDelete", true);
// realm = authConfig.GetString("Realm", realm); // realm = authConfig.GetString("Realm", realm);
} }
@ -304,10 +306,15 @@ namespace OpenSim.Services.InventoryService
// //
public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs) public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs)
{ {
if (!m_AllowDelete)
return false;
// Ignore principal ID, it's bogus at connector level // Ignore principal ID, it's bogus at connector level
// //
foreach (UUID id in folderIDs) foreach (UUID id in folderIDs)
{ {
if (!ParentIsTrash(id))
continue;
InventoryFolderBase f = new InventoryFolderBase(); InventoryFolderBase f = new InventoryFolderBase();
f.ID = id; f.ID = id;
PurgeFolder(f); PurgeFolder(f);
@ -319,6 +326,12 @@ namespace OpenSim.Services.InventoryService
public virtual bool PurgeFolder(InventoryFolderBase folder) public virtual bool PurgeFolder(InventoryFolderBase folder)
{ {
if (!m_AllowDelete)
return false;
if (!ParentIsTrash(folder.ID))
return false;
XInventoryFolder[] subFolders = m_Database.GetFolders( XInventoryFolder[] subFolders = m_Database.GetFolders(
new string[] { "parentFolderID" }, new string[] { "parentFolderID" },
new string[] { folder.ID.ToString() }); new string[] { folder.ID.ToString() });
@ -358,6 +371,9 @@ namespace OpenSim.Services.InventoryService
public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs) public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs)
{ {
if (!m_AllowDelete)
return false;
// Just use the ID... *facepalms* // Just use the ID... *facepalms*
// //
foreach (UUID id in itemIDs) foreach (UUID id in itemIDs)
@ -519,5 +535,29 @@ namespace OpenSim.Services.InventoryService
return newItem; return newItem;
} }
private bool ParentIsTrash(UUID folderID)
{
XInventoryFolder[] folder = m_Database.GetFolders(new string[] {"folderID"}, new string[] {folderID.ToString()});
if (folder.Length < 1)
return false;
UUID parentFolder = folder[0].parentFolderID;
while (parentFolder != UUID.Zero)
{
XInventoryFolder[] parent = m_Database.GetFolders(new string[] {"folderID"}, new string[] {parentFolder.ToString()});
if (parent.Length < 1)
return false;
if (parent[0].type == (int)AssetType.TrashFolder)
return true;
if (parent[0].type == (int)AssetType.RootFolder)
return false;
parentFolder = parent[0].parentFolderID;
}
return false;
}
} }
} }

View File

@ -65,3 +65,6 @@
MessagingModule = GroupsMessagingModule MessagingModule = GroupsMessagingModule
MessagingEnabled = true MessagingEnabled = true
ServicesConnectorModule = SimianGroupsServicesConnector ServicesConnectorModule = SimianGroupsServicesConnector
[Profiles]
Module = SimianProfiles