mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
add method for add user
This commit is contained in:
parent
e91525e96e
commit
56078f3ba0
@ -161,6 +161,7 @@ inline void ShellSession::sendHead() {
|
|||||||
inline bool ShellSession::authUser(const string& user, const string& pwd) {
|
inline bool ShellSession::authUser(const string& user, const string& pwd) {
|
||||||
auto it = g_mapUser.find(user);
|
auto it = g_mapUser.find(user);
|
||||||
if (it == g_mapUser.end()) {
|
if (it == g_mapUser.end()) {
|
||||||
|
//WarnL << user << " " << pwd;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return it->second == pwd;
|
return it->second == pwd;
|
||||||
|
@ -28,7 +28,9 @@ public:
|
|||||||
void onRecv(const Socket::Buffer::Ptr &) override;
|
void onRecv(const Socket::Buffer::Ptr &) override;
|
||||||
void onError(const SockException &err) override;
|
void onError(const SockException &err) override;
|
||||||
void onManager() override;
|
void onManager() override;
|
||||||
|
static void addUser(const string &userName,const string &userPwd){
|
||||||
|
g_mapUser[userName] = userPwd;
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
friend class CMD_help;
|
friend class CMD_help;
|
||||||
inline bool onProcessLine(const string &);
|
inline bool onProcessLine(const string &);
|
||||||
|
Loading…
Reference in New Issue
Block a user