diff --git a/src/Shell/ShellSession.cpp b/src/Shell/ShellSession.cpp index 7e78eb8c..9d25c809 100644 --- a/src/Shell/ShellSession.cpp +++ b/src/Shell/ShellSession.cpp @@ -161,6 +161,7 @@ inline void ShellSession::sendHead() { inline bool ShellSession::authUser(const string& user, const string& pwd) { auto it = g_mapUser.find(user); if (it == g_mapUser.end()) { + //WarnL << user << " " << pwd; return false; } return it->second == pwd; diff --git a/src/Shell/ShellSession.h b/src/Shell/ShellSession.h index cadec641..55923e5e 100644 --- a/src/Shell/ShellSession.h +++ b/src/Shell/ShellSession.h @@ -28,7 +28,9 @@ public: void onRecv(const Socket::Buffer::Ptr &) override; void onError(const SockException &err) override; void onManager() override; - + static void addUser(const string &userName,const string &userPwd){ + g_mapUser[userName] = userPwd; + } private: friend class CMD_help; inline bool onProcessLine(const string &);