From 1978c49bea5b439d993067c055cec47e70db8fd6 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Sat, 7 Oct 2023 22:33:50 +0200 Subject: minor refactoring --- src/operator-login.cc | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'src/operator-login.cc') 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 #include -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"); -- cgit v1.2.3