From 860c879989e9e3f51f6654579e7bf3fddc652d85 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 4 May 2023 17:19:02 +0900 Subject: Drop deprecated kitchensync code Signed-off-by: Michele Calgaro --- kitchensync/src/configguildap.cpp | 153 -------------------------------------- 1 file changed, 153 deletions(-) delete mode 100644 kitchensync/src/configguildap.cpp (limited to 'kitchensync/src/configguildap.cpp') diff --git a/kitchensync/src/configguildap.cpp b/kitchensync/src/configguildap.cpp deleted file mode 100644 index 1b1c3622c..000000000 --- a/kitchensync/src/configguildap.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - This file is part of KitchenSync. - - Copyright (c) 2007 Tobias Koenig - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - USA. -*/ - -#include "configguildap.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -ConfigGuiLdap::ConfigGuiLdap( const QSync::Member &member, TQWidget *parent ) - : ConfigGui( member, parent ) -{ - initGUI(); - - mSearchScope->insertItem( i18n( "Base" ) ); - mSearchScope->insertItem( i18n( "One" ) ); - mSearchScope->insertItem( i18n( "Sub" ) ); -} - -void ConfigGuiLdap::load( const TQString &xml ) -{ - TQDomDocument doc; - doc.setContent( xml ); - TQDomElement docElement = doc.documentElement(); - TQDomNode node; - for( node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) { - TQDomElement element = node.toElement(); - if ( element.tagName() == "servername" ) { - mLdapWidget->setHost( element.text() ); - } else if ( element.tagName() == "serverport" ) { - mLdapWidget->setPort( element.text().toInt() ); - } else if ( element.tagName() == "binddn" ) { - mLdapWidget->setBindDN( element.text() ); - } else if ( element.tagName() == "password" ) { - mLdapWidget->setPassword( element.text() ); - } else if ( element.tagName() == "anonymous" ) { - mLdapWidget->setAuthAnon( element.text().toInt() == 1 ); - } else if ( element.tagName() == "searchbase" ) { - mLdapWidget->setDn( element.text() ); - } else if ( element.tagName() == "searchfilter" ) { - mLdapWidget->setFilter( element.text() ); - } else if ( element.tagName() == "storebase" ) { - mLdapWidget->setDn( element.text() ); - } else if ( element.tagName() == "keyattr" ) { - mKeyAttribute->setText( element.text() ); - } else if ( element.tagName() == "scope" ) { - TQStringList list; - list << "base" << "one" << "sub"; - for ( uint i = 0; i < list.count(); ++i ) - if ( list[ i ] == element.text() ) - mSearchScope->setCurrentItem( i ); - - } else if ( element.tagName() == "authmech" ) { - if ( element.text() == "SIMPLE" ) { - mLdapWidget->setAuthSimple( true ); - } - } else if ( element.tagName() == "encryption" ) { - mEncryption->setChecked( element.text().toInt() == 1 ); - } else if ( element.tagName() == "ldap_read" ) { - mReadLdap->setChecked( element.text().toInt() == 1 ); - } else if ( element.tagName() == "ldap_write" ) { - mWriteLdap->setChecked( element.text().toInt() == 1 ); - } - } -} - -TQString ConfigGuiLdap::save() const -{ - TQString config = "\n"; - - config += TQString( "%1\n" ).arg( mLdapWidget->host() ); - config += TQString( "%1\n" ).arg( mLdapWidget->port() ); - config += TQString( "%1\n" ).arg( mLdapWidget->bindDN() ); - config += TQString( "%1\n" ).arg( mLdapWidget->password() ); - config += TQString( "%1\n" ).arg( mLdapWidget->isAuthAnon() ? "1" : "0" ); - config += TQString( "%1\n" ).arg( mLdapWidget->dn() ); - config += TQString( "%1\n" ).arg( mLdapWidget->filter() ); - config += TQString( "%1\n" ).arg( mLdapWidget->dn() ); - config += TQString( "%1\n" ).arg( mKeyAttribute->text() ); - - TQStringList scopes; - scopes << "base" << "one" << "sub"; - - config += TQString( "%1\n" ).arg( scopes[ mSearchScope->currentItem() ] ); - - config += TQString( "SIMPLE\n" ); - config += TQString( "%1\n" ).arg( mEncryption->isChecked() ? "1" : "0" ); - - config += TQString( "%1\n" ).arg( mReadLdap->isChecked() ? "1" : "0" ); - config += TQString( "%1\n" ).arg( mWriteLdap->isChecked() ? "1" : "0" ); - - config += ""; - - return config; -} - -void ConfigGuiLdap::initGUI() -{ - TQGridLayout *layout = new TQGridLayout( topLayout(), 12, 4, KDialog::spacingHint() ); - layout->setMargin( KDialog::marginHint() ); - - mLdapWidget = new TDEABC::LdapConfigWidget( TDEABC::LdapConfigWidget::W_HOST | - TDEABC::LdapConfigWidget::W_PORT | - TDEABC::LdapConfigWidget::W_USER | - TDEABC::LdapConfigWidget::W_PASS | - TDEABC::LdapConfigWidget::W_BINDDN | - TDEABC::LdapConfigWidget::W_DN | - TDEABC::LdapConfigWidget::W_FILTER | - TDEABC::LdapConfigWidget::W_AUTHBOX, this ); - - mKeyAttribute = new KLineEdit( this ); - mSearchScope = new KComboBox( this ); - mEncryption = new TQCheckBox( i18n( "Use encryption" ), this ); - mReadLdap = new TQCheckBox( i18n( "Load data from LDAP" ), this ); - mWriteLdap = new TQCheckBox( i18n( "Save data to LDAP" ), this ); - - layout->addMultiCellWidget( mLdapWidget, 0, 9, 0, 3 ); - layout->addWidget( new TQLabel( i18n( "Key Attribute:" ), this ), 10, 0 ); - layout->addMultiCellWidget( mKeyAttribute, 10, 10, 1, 2 ); - layout->addWidget( new TQLabel( i18n( "Search Scope:" ), this ), 11, 0 ); - layout->addMultiCellWidget( mSearchScope, 11, 11, 1, 2 ); - layout->addWidget( mEncryption, 12, 0 ); - layout->addWidget( mReadLdap, 13, 0 ); - layout->addWidget( mWriteLdap, 13, 3 ); - -} - -#include "configguildap.moc" -- cgit v1.2.1