From 7ab41a8a815968e274ebbfc459328be40cf5479a Mon Sep 17 00:00:00 2001
From: Roxie Linden <roxie@lindenlab.com>
Date: Fri, 5 Feb 2010 15:59:14 -0800
Subject: [PATCH] transplant with 2517, also fix single username login issue

---
 indra/newview/llinventorymodel.cpp  | 11 ++++++++---
 indra/newview/llpanellogin.cpp      |  2 +-
 indra/newview/llsecapi.cpp          |  2 +-
 indra/newview/llviewerinventory.cpp | 13 ++++++++-----
 4 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 711114173c9..89f5ef026a9 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1568,10 +1568,15 @@ void LLInventoryModel::bulkFetch(std::string url)
 				    folder_sd["fetch_folders"]	= TRUE; //(LLSD::Boolean)sFullFetchStarted;
 				    folder_sd["fetch_items"]	= (LLSD::Boolean)TRUE;
 				    
-				    if (ALEXANDRIA_LINDEN_ID == cat->getOwnerID())
-					    body_lib["folders"].append(folder_sd);
-				    else
+				    if (gAgent.getID() == cat->getOwnerID())
+				    {
 					    body["folders"].append(folder_sd);
+				    }
+				    else
+				    {
+					    body_lib["folders"].append(folder_sd);
+				    }
+
 				    folder_count++;
 			    }
 			    if (sMyInventoryFetchStarted ||
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 7752750a311..906f091090f 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -871,7 +871,7 @@ void LLPanelLogin::loadLoginPage()
 	curl_free(curl_version);
 
 	// Grid
-	char* curl_grid = curl_escape(LLGridManager::getInstance()->getGridLabel().c_str(), 0);
+	char* curl_grid = curl_escape(LLGridManager::getInstance()->getGridID().c_str(), 0);
 	oStr << "&grid=" << curl_grid;
 	curl_free(curl_grid);
 	gViewerWindow->setMenuBackgroundColor(false, !LLGridManager::getInstance()->isInProductionGrid());
diff --git a/indra/newview/llsecapi.cpp b/indra/newview/llsecapi.cpp
index 26bdfd19da7..a928b4580e0 100644
--- a/indra/newview/llsecapi.cpp
+++ b/indra/newview/llsecapi.cpp
@@ -131,7 +131,7 @@ LLSD LLCredential::getLoginParams()
 	}
 	else if (mIdentifier["type"].asString() == "account")
 	{
-		result["username"] = mIdentifier["username"];
+		result["username"] = mIdentifier["account_name"];
 		result["passwd"] = mAuthenticator["secret"];
                                     
 	}
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 5605f425e09..df873f241e3 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -35,7 +35,6 @@
 
 #include "llnotificationsutil.h"
 #include "message.h"
-#include "indra_constants.h"
 
 #include "llagent.h"
 #include "llviewerfoldertype.h"
@@ -242,10 +241,14 @@ void LLViewerInventoryItem::fetchFromServer(void) const
 		// we have to check region. It can be null after region was destroyed. See EXT-245
 		if (region)
 		{
-			if( ALEXANDRIA_LINDEN_ID.getString() == mPermissions.getOwner().getString())
-				url = region->getCapability("FetchLib");
-			else	
-				url = region->getCapability("FetchInventory");
+		  if(gAgent.getID() != mPermissions.getOwner())
+		    {
+		      url = region->getCapability("FetchLib");
+		    }
+		  else
+		    {	
+		      url = region->getCapability("FetchInventory");
+		    }
 		}
 		else
 		{
-- 
GitLab