mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +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) {
|
||||
auto it = g_mapUser.find(user);
|
||||
if (it == g_mapUser.end()) {
|
||||
//WarnL << user << " " << pwd;
|
||||
return false;
|
||||
}
|
||||
return it->second == pwd;
|
||||
|
@ -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 &);
|
||||
|
Loading…
Reference in New Issue
Block a user