summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 2e954632e..91f29189e 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -75,8 +75,15 @@ class CommandStartTLS : public Command
CmdResult Handle (const std::vector<std::string> &parameters, User *user)
{
- user->io = Caller;
- Caller->OnRawSocketAccept(user->GetFd(), user->GetIPString(), user->GetPort());
+ if (user->registered == REG_ALL)
+ {
+ ServerInstance->Users->QuitUser(user, "STARTTLS not allowed after client registration");
+ }
+ else
+ {
+ user->io = Caller;
+ Caller->OnRawSocketAccept(user->GetFd(), user->GetIPString(), user->GetPort());
+ }
return CMD_FAILURE;
}