summaryrefslogtreecommitdiff
path: root/src/operator-login.cc
diff options
context:
space:
mode:
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;
}