[yast-commit] r48625 - in /trunk/ldap-server/src/lib: backConfigTest.cpp backConfigTest.h
Author: rhafer Date: Fri Jun 27 15:59:05 2008 New Revision: 48625 URL: http://svn.opensuse.org/viewcvs/yast?rev=48625&view=rev Log: Support for deleting Indexes Modified: trunk/ldap-server/src/lib/backConfigTest.cpp trunk/ldap-server/src/lib/backConfigTest.h Modified: trunk/ldap-server/src/lib/backConfigTest.cpp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/backConfigTest.cpp?rev=48625&r1=48624&r2=48625&view=diff ============================================================================== --- trunk/ldap-server/src/lib/backConfigTest.cpp (original) +++ trunk/ldap-server/src/lib/backConfigTest.cpp Fri Jun 27 15:59:05 2008 @@ -187,8 +187,26 @@ this->addStringValue( "olcDbIndex", indexString ); } -void OlcBdbDatabase::deleteIndex(const std::string& attr) +void OlcBdbDatabase::deleteIndex(const std::string& type) { + const LDAPAttribute *attr = m_dbEntryChanged.getAttributes()->getAttributeByName("olcdbindex"); + if (! attr ) { + return; + }; + + StringList sl = attr->getValues(); + StringList newValues; + StringList::const_iterator i; + for (i = sl.begin(); i != sl.end(); i++ ) { + std::string attrType; + std::string indexes; + splitIndexString(*i, attrType, indexes ); + if ( attrType != type ) + { + newValues.add(*i); + } + } + this->setStringValues("olcdbindex", newValues ); } void OlcBdbDatabase::setDirectory( const std::string &dir ) @@ -765,7 +783,7 @@ replace = true; } else { modifications.addModification( - LDAPModification( LDAPAttribute(i->getName()), + LDAPModification( LDAPAttribute(i->getName(), delValues ), LDAPModification::OP_DELETE) ); } Modified: trunk/ldap-server/src/lib/backConfigTest.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/backConfigTest.h?rev=48625&r1=48624&r2=48625&view=diff ============================================================================== --- trunk/ldap-server/src/lib/backConfigTest.h (original) +++ trunk/ldap-server/src/lib/backConfigTest.h Fri Jun 27 15:59:05 2008 @@ -99,7 +99,7 @@ virtual IndexMap getDatabaseIndexes() const {}; virtual std::vector<IndexType> getDatabaseIndex( const std::string &attr ) const {}; virtual void addIndex(const std::string& attr, const std::vector<IndexType>& idx) {}; - + virtual void deleteIndex(const std::string& attr) {}; protected: virtual void updateEntryDn(); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
rhafer@svn.opensuse.org