summaryrefslogtreecommitdiff
path: root/src/operator-login.cc
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-10-07 22:33:50 +0200
committerJannis M. Hoffmann <jannis@fehcom.de>2023-10-08 11:35:51 +0200
commit1978c49bea5b439d993067c055cec47e70db8fd6 (patch)
tree255caea96a13f95564e6b631be9a4ac55ce33cd9 /src/operator-login.cc
parent3b1278f5459514a6d6364f068ff97b8a0432057b (diff)
minor refactoring
Diffstat (limited to 'src/operator-login.cc')
-rw-r--r--src/operator-login.cc24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/operator-login.cc b/src/operator-login.cc
index 7b7ffc2..cacafbb 100644
--- a/src/operator-login.cc
+++ b/src/operator-login.cc
@@ -1,9 +1,10 @@
-/** --------------------------------------------------------------------
+/**
* @file operator-login.cc
* @brief Implementation of the rapid LOGIN command
* @author Andreas Aardal Hanssen, Erwin Hoffmann
* @date 2002-2005, 2023
- * ----------------------------------------------------------------- **/
+ */
+
#include "authenticate.h"
#include "depot.h"
#include "globals.h"
@@ -22,28 +23,22 @@
#include <sys/types.h>
#include <unistd.h>
-using namespace ::std;
using namespace Binc;
-//----------------------------------------------------------------------
LoginOperator::LoginOperator(void) {}
-//----------------------------------------------------------------------
LoginOperator::~LoginOperator(void) {}
-//----------------------------------------------------------------------
-const string LoginOperator::getName(void) const
+const std::string LoginOperator::getName(void) const
{
return "LOGIN";
}
-//----------------------------------------------------------------------
int LoginOperator::getState(void) const
{
return Session::NONAUTHENTICATED;
}
-//------------------------------------------------------------------------
Operator::ProcessResult LoginOperator::process(Depot &depot, Request &command)
{
Session &session = Session::getInstance();
@@ -55,7 +50,7 @@ Operator::ProcessResult LoginOperator::process(Depot &depot, Request &command)
}
session.setEnv("BINCIMAP_LOGIN", "LOGIN+" + command.getTag());
- string challenge;
+ std::string challenge;
switch (authenticate(depot, command.getUserID(), command.getPassword(), challenge)) {
case 1:
@@ -70,12 +65,12 @@ Operator::ProcessResult LoginOperator::process(Depot &depot, Request &command)
"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." << std::endl;
break;
case -1:
bincClient << "* BYE The server died unexpectedly. Please contact "
"your system administrator for more information."
- << endl;
+ << std::endl;
break;
}
@@ -85,7 +80,6 @@ Operator::ProcessResult LoginOperator::process(Depot &depot, Request &command)
return NOTHING;
}
-//----------------------------------------------------------------------
Operator::ParseResult LoginOperator::parse(Request &c_in) const
{
Session &session = Session::getInstance();
@@ -98,7 +92,7 @@ Operator::ParseResult LoginOperator::parse(Request &c_in) const
return res;
}
- string userid;
+ std::string userid;
if ((res = expectAstring(userid)) != ACCEPT) {
session.setLastError("Expected userid after LOGIN SPACE");
return res;
@@ -110,7 +104,7 @@ Operator::ParseResult LoginOperator::parse(Request &c_in) const
return res;
}
- string password;
+ std::string password;
if ((res = expectAstring(password)) != ACCEPT) {
session.setLastError("Expected password after LOGIN "
"SPACE userid SPACE");