aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/options
diff options
context:
space:
mode:
authorGravatar Fabio Bas2010-02-13 11:21:16 +0000
committerGravatar Fabio Bas2010-02-13 11:21:16 +0000
commit87bfbefebab8bf25cfcbfd0b4935d8e6822f4508 (patch)
treea6cf3552c0a626845cc81a3a4f842438dbef83fb /src/modules/options
parentTry to check server extended capabilities using CAP LS and use STARTTLS if en... (diff)
downloadKVIrc-87bfbefebab8bf25cfcbfd0b4935d8e6822f4508.tar.gz
KVIrc-87bfbefebab8bf25cfcbfd0b4935d8e6822f4508.tar.bz2
KVIrc-87bfbefebab8bf25cfcbfd0b4935d8e6822f4508.zip
server config: changed "supportsSTARTTLS" to "enabledSTARTTLS" and enabled by default; this option is now meaningful only as a way to force STARTTLS disabled on a server that supports it;
server config: added "enabledSASL", "SaslNick", "SaslPass" options main config: added global "enable SASL" option sparser: handle CAP LS, REQ, ACK, NAK, END ircconnection: added SASL support (only PLAIN method is supported by now) git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3958 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/options')
-rw-r--r--src/modules/options/optw_connection.cpp6
-rw-r--r--src/modules/options/optw_servers.cpp49
-rw-r--r--src/modules/options/optw_servers.h5
3 files changed, 46 insertions, 14 deletions
diff --git a/src/modules/options/optw_connection.cpp b/src/modules/options/optw_connection.cpp
index 41779fabf..8b09172cc 100644
--- a/src/modules/options/optw_connection.cpp
+++ b/src/modules/options/optw_connection.cpp
@@ -86,7 +86,11 @@ KviConnectionOptionsWidget::KviConnectionOptionsWidget(QWidget * parent)
connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool)));
mergeTip(u,__tr2qs_ctx("<center>Minimum value: <b>0 sec</b><br>Maximum value: <b>86400 sec</b></center>","options"));
- addRowSpacer(0,2,4,2);
+ b = addBoolSelector(this,__tr2qs_ctx("Use the SASL authentication protocol if available","options"),&(KVI_OPTION_BOOL(KviOption_boolUseSaslIfAvailable)),true);
+ mergeTip(b,__tr2qs_ctx("<center>When available and enabled of the specific server, KVIrc will try to authenticate the user using the SASL procotol</center>","options"));
+ addWidgetToLayout(b,0,2,0,2);
+
+ addRowSpacer(0,3,4,3);
}
KviConnectionOptionsWidget::~KviConnectionOptionsWidget()
diff --git a/src/modules/options/optw_servers.cpp b/src/modules/options/optw_servers.cpp
index 3f2fdebac..c1c49ff26 100644
--- a/src/modules/options/optw_servers.cpp
+++ b/src/modules/options/optw_servers.cpp
@@ -585,8 +585,6 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviServer * s)
KviTalToolTip::add(m_pPortEditor,__tr2qs_ctx("<center>This is the default <b>port</b> that this server will be contacted on.<br>Usually <b>6667</b> is OK.</center>","options"));
connect(m_pPortEditor,SIGNAL(textChanged(const QString &)),this,SLOT(portEditorTextChanged(const QString &)));
-
-
l = new QLabel(__tr2qs_ctx("IP address:","options"),tab);
gl->addWidget(l,1,0);
m_pIpEditor = new KviIpEditor(tab,KviIpEditor::IPv4);
@@ -644,14 +642,14 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviServer * s)
#endif
m_pUseSSLCheck->setChecked(s->useSSL());
- m_pSupportsSTARTTLSCheck = new QCheckBox(__tr2qs_ctx("Supports STARTTLS protocol","options"),tab);
- gl->addWidget(m_pSupportsSTARTTLSCheck,5,0,1,2);
- KviTalToolTip::add(m_pSupportsSTARTTLSCheck,__tr2qs_ctx("<center>This check marks the server as dynamically supporting the <b>Transport Layer Security</b> " \
- "protocol. If you enable the proper global option in the Connection/SSL tab, the TLS protocol will be used for this server.</center>","options"));
+ m_pEnableSTARTTLSCheck = new QCheckBox(__tr2qs_ctx("Enable STARTTLS protocol","options"),tab);
+ gl->addWidget(m_pEnableSTARTTLSCheck,5,0,1,2);
+ KviTalToolTip::add(m_pEnableSTARTTLSCheck,__tr2qs_ctx("<center>This check enables the use of the <b>Transport Layer Security</b> " \
+ "protocol. If you enable the proper global option in the Connection/SSL tab, the TLS protocol will be used for this server if available.</center>","options"));
#ifndef COMPILE_SSL_SUPPORT
- m_pSupportsSTARTTLSCheck->setEnabled(false);
+ m_pEnableSTARTTLSCheck->setEnabled(false);
#endif
- m_pSupportsSTARTTLSCheck->setChecked(s->supportsSTARTTLS());
+ m_pEnableSTARTTLSCheck->setChecked(s->enabledSTARTTLS());
m_pUseAutoConnect = new QCheckBox(__tr2qs_ctx("Connect to this server at startup","options"),tab);
m_pUseAutoConnect->setChecked(s->autoConnect());
@@ -772,11 +770,30 @@ KviServerDetailsWidget::KviServerDetailsWidget(QWidget * par,KviServer * s)
if(m_pProxyEditor->count() > (s->proxy()+2))
m_pProxyEditor->setCurrentIndex(s->proxy()+2);
+ m_pEnableSASLCheck = new QCheckBox(__tr2qs_ctx("Enable SASL authentication","options"),tab);
+ gl->addWidget(m_pEnableSASLCheck,12,0,1,2);
+ KviTalToolTip::add(m_pEnableSASLCheck,__tr2qs_ctx("<center>This check enables the use of the <b>SASL</b> authentication procotol" \
+ "If you enable the proper global option in the Connection/SSL tab and fill the Sasl Nickname and Sasl Password fields in this page, the SASL protocol will be used for this server if available.</center>","options"));
+ m_pEnableSASLCheck->setChecked(s->enabledSASL());
+
+ l = new QLabel(__tr2qs_ctx("Sasl Nickname:","options"),tab);
+ gl->addWidget(l,13,0);
+ m_pSaslNickEditor = new QLineEdit(tab);
+ m_pSaslNickEditor->setText(s->saslNick());
+ KviTalToolTip::add(m_pSaslNickEditor,__tr2qs_ctx("<center>If you want to enable SASL authentication, insert your nickname here.</center>","options"));
+ gl->addWidget(m_pSaslNickEditor,13,1);
+
+ l = new QLabel(__tr2qs_ctx("Sasl Password:","options"),tab);
+ gl->addWidget(l,14,0);
+ m_pSaslPassEditor = new KviPasswordLineEdit(tab);
+ m_pSaslPassEditor->setText(s->saslPass());
+ KviTalToolTip::add(m_pSaslPassEditor,__tr2qs_ctx("<center>If you want to enable SASL authentication, insert your password here.</center>","options"));
+ gl->addWidget(m_pSaslPassEditor,14,1);
l = new QLabel("",tab);
- gl->addWidget(l,12,0,1,2);
+ gl->addWidget(l,15,0,1,2);
- gl->setRowStretch(12,1);
+ gl->setRowStretch(15,1);
tw->addTab(tab,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_SOCKETWARNING)),__tr2qs_ctx("Connection","options"));
@@ -925,8 +942,16 @@ void KviServerDetailsWidget::fillData(KviServer * s)
s->setCacheIp(m_pCacheIpCheck->isChecked());
if(m_pUseSSLCheck)
s->setUseSSL(m_pUseSSLCheck->isChecked());
- if(m_pSupportsSTARTTLSCheck)
- s->setSupportsSTARTTLS(m_pSupportsSTARTTLSCheck->isChecked());
+ if(m_pEnableSTARTTLSCheck)
+ s->setEnabledSTARTTLS(m_pEnableSTARTTLSCheck->isChecked());
+
+ s->setSaslNick(m_pSaslNickEditor->text());
+ s->setSaslPass(m_pSaslPassEditor->text());
+ s->setEnabledSASL( m_pEnableSASLCheck->isChecked() &&
+ !m_pSaslNickEditor->text().isEmpty() &&
+ !m_pSaslPassEditor->text().isEmpty()
+ );
+
if(m_pIdEditor)
s->setId(m_pIdEditor->text());
if(s->id().isEmpty())s->generateUniqueId();
diff --git a/src/modules/options/optw_servers.h b/src/modules/options/optw_servers.h
index 9ba0046d4..5b14e8f22 100644
--- a/src/modules/options/optw_servers.h
+++ b/src/modules/options/optw_servers.h
@@ -115,7 +115,9 @@ protected:
KviScriptEditor * m_pOnLoginEditor;
QLineEdit * m_pUserEditor;
KviPasswordLineEdit * m_pPassEditor;
+ KviPasswordLineEdit * m_pSaslPassEditor;
QLineEdit * m_pNickEditor;
+ QLineEdit * m_pSaslNickEditor;
QLineEdit * m_pRealEditor;
QLineEdit * m_pDescEditor;
QLineEdit * m_pIdEditor;
@@ -125,7 +127,8 @@ protected:
KviIpEditor * m_pIpEditor;
QCheckBox * m_pCacheIpCheck;
QCheckBox * m_pUseSSLCheck;
- QCheckBox * m_pSupportsSTARTTLSCheck;
+ QCheckBox * m_pEnableSTARTTLSCheck;
+ QCheckBox * m_pEnableSASLCheck;
QCheckBox * m_pUseDefaultInitUMode;
QCheckBox * m_pIMode;
QCheckBox * m_pWMode;