mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 06:22:20 +00:00
Bug 231965 LDAP Download User Interface and function broken. r=dmose,sr=bienvenu
This commit is contained in:
parent
d5bd8fcb00
commit
0d60f4a669
@ -44,8 +44,7 @@
|
||||
#include "nsIAddrBookSession.h"
|
||||
#include "nsAbBaseCID.h"
|
||||
#include "nsAbUtils.h"
|
||||
#include "nsAbMDBCard.h"
|
||||
#include "nsAbLDAPCard.h"
|
||||
#include "nsIAbMDBCard.h"
|
||||
#include "nsAbLDAPReplicationQuery.h"
|
||||
#include "nsProxiedService.h"
|
||||
#include "nsCPasswordManager.h"
|
||||
@ -334,9 +333,24 @@ nsresult nsAbLDAPProcessReplicationData::OnLDAPSearchEntry(nsILDAPMessage *aMess
|
||||
if(!mReplicationDB || !mDBOpen)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsAbLDAPCard card;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
nsresult rv = mAttrMap->SetCardPropertiesFromLDAPMessage(aMessage, &card);
|
||||
// Although we would may naturally create an nsIAbLDAPCard here, we don't
|
||||
// need to as we are writing this straight to the database, so just create
|
||||
// the database version instead.
|
||||
nsCOMPtr<nsIAbMDBCard> dbCard(do_CreateInstance(NS_ABMDBCARD_CONTRACTID, &rv));
|
||||
if(NS_FAILED(rv)) {
|
||||
Abort();
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAbCard> newCard(do_QueryInterface(dbCard, &rv));
|
||||
if(NS_FAILED(rv)) {
|
||||
Abort();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = mAttrMap->SetCardPropertiesFromLDAPMessage(aMessage, newCard);
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
NS_WARNING("nsAbLDAPProcessReplicationData::OnLDAPSearchEntry"
|
||||
@ -359,26 +373,6 @@ nsresult nsAbLDAPProcessReplicationData::OnLDAPSearchEntry(nsILDAPMessage *aMess
|
||||
printf("\n LDAPReplication :: got card #: %d, name: %s \n", mCount, name.get());
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIAbMDBCard> dbCard;
|
||||
dbCard = do_CreateInstance(NS_ABMDBCARD_CONTRACTID, &rv);
|
||||
if(NS_FAILED(rv)) {
|
||||
Abort();
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAbCard> newCard;
|
||||
newCard = do_QueryInterface(dbCard, &rv);
|
||||
if(NS_FAILED(rv)) {
|
||||
Abort();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = newCard->Copy(&card);
|
||||
if(NS_FAILED(rv)) {
|
||||
Abort();
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = mReplicationDB->CreateNewCardAndAddToDB(newCard, PR_FALSE);
|
||||
if(NS_FAILED(rv)) {
|
||||
Abort();
|
||||
|
@ -139,13 +139,17 @@ NS_IMETHODIMP nsAbLDAPReplicationService::Done(PRBool aSuccess)
|
||||
}
|
||||
|
||||
|
||||
// This method should query the RootDSE for the changeLog attribute,
|
||||
// XXX: This method should query the RootDSE for the changeLog attribute,
|
||||
// if it exists ChangeLog protocol is supported.
|
||||
PRInt32 nsAbLDAPReplicationService::DecideProtocol()
|
||||
{
|
||||
// do the changeLog, it will decide if there is a need to replicate all
|
||||
// entries or only update existing DB and will do the approprite thing.
|
||||
return nsIAbLDAPProcessReplicationData::kChangeLogProtocol;
|
||||
// do the changeLog, it will decide if there is a need to replicate all
|
||||
// entries or only update existing DB and will do the approprite thing.
|
||||
//
|
||||
// XXX: Bug 231965 changed this from kChangeLogProtocol to
|
||||
// kDefaultDownloadAll because of a problem with ldap replication not
|
||||
// working correctly. We need to change this back at some stage (bug 311632).
|
||||
return nsIAbLDAPProcessReplicationData::kDefaultDownloadAll;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user