summaryrefslogtreecommitdiff
path: root/src/operator-login.cc
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-10-07 18:49:13 +0200
committerJannis M. Hoffmann <jannis@fehcom.de>2023-10-08 11:35:51 +0200
commit3b1278f5459514a6d6364f068ff97b8a0432057b (patch)
tree6e1369f28c64b45ac3254225242ebf3844ad0291 /src/operator-login.cc
parentc0234d1b0cea8ac830e9397da8b2270a8f2b45ca (diff)
formatted source and header files
Diffstat (limited to 'src/operator-login.cc')
-rw-r--r--src/operator-login.cc43
1 files changed, 19 insertions, 24 deletions
diff --git a/src/operator-login.cc b/src/operator-login.cc
index a0ecacd..7b7ffc2 100644
--- a/src/operator-login.cc
+++ b/src/operator-login.cc
@@ -2,37 +2,34 @@
* @file operator-login.cc
* @brief Implementation of the rapid LOGIN command
* @author Andreas Aardal Hanssen, Erwin Hoffmann
- * @date 2002-2005, 2023
+ * @date 2002-2005, 2023
* ----------------------------------------------------------------- **/
-#include <unistd.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <errno.h>
-
-#include <string>
-#include <iostream>
-
#include "authenticate.h"
#include "depot.h"
+#include "globals.h"
#include "iodevice.h"
#include "iofactory.h"
-#include "globals.h"
#include "operators.h"
#include "recursivedescent.h"
#include "session.h"
+#include <iostream>
+#include <string>
+
+#include <errno.h>
+#include <signal.h>
+
+#include <sys/types.h>
+#include <unistd.h>
+
using namespace ::std;
using namespace Binc;
//----------------------------------------------------------------------
-LoginOperator::LoginOperator(void)
-{
-}
+LoginOperator::LoginOperator(void) {}
//----------------------------------------------------------------------
-LoginOperator::~LoginOperator(void)
-{
-}
+LoginOperator::~LoginOperator(void) {}
//----------------------------------------------------------------------
const string LoginOperator::getName(void) const
@@ -47,13 +44,11 @@ int LoginOperator::getState(void) const
}
//------------------------------------------------------------------------
-Operator::ProcessResult LoginOperator::process(Depot &depot,
- Request &command)
+Operator::ProcessResult LoginOperator::process(Depot &depot, Request &command)
{
Session &session = Session::getInstance();
- if (!session.command.ssl
- && !session.hasEnv("ALLOW_NONSSL_PLAINTEXT_LOGINS")) {
+ if (!session.command.ssl && !session.hasEnv("ALLOW_NONSSL_PLAINTEXT_LOGINS")) {
session.setLastError("Plain text password authentication is disallowd. "
"Please enable StartTLS or TLS in your mail client.");
return NO;
@@ -63,7 +58,7 @@ Operator::ProcessResult LoginOperator::process(Depot &depot,
string challenge;
switch (authenticate(depot, command.getUserID(), command.getPassword(), challenge)) {
- case 1:
+ case 1:
session.setLastError("An internal error occurred when you attempted "
"to log in to the IMAP server. Please contact "
"your system administrator.");
@@ -75,12 +70,12 @@ Operator::ProcessResult LoginOperator::process(Depot &depot,
"your system administrator.");
return NO;
case 3:
- bincClient << "* BYE Timeout after " << IDLE_TIMEOUT
- << " seconds of inactivity." << endl;
+ bincClient << "* BYE Timeout after " << IDLE_TIMEOUT << " seconds of inactivity." << endl;
break;
case -1:
bincClient << "* BYE The server died unexpectedly. Please contact "
- "your system administrator for more information." << endl;
+ "your system administrator for more information."
+ << endl;
break;
}