支持高权限免密码
This commit is contained in:
@ -122,11 +122,12 @@ std::vector<std::string> BookStoreEngineClass::ExecuteSu(
|
||||
if (!CommandSuLexer(cmd, user_id, password))
|
||||
return std::vector<std::string>({"Invalid"});
|
||||
// debugPrint("su", user_id, " ", password);
|
||||
if (user_data_base.GetPrevilege(user_id) == -1)
|
||||
return std::vector<std::string>({"Invalid"});
|
||||
if (login_stack.size() > 0 &&
|
||||
user_data_base.GetPrevilege(login_stack.top().first) == 7) {
|
||||
user_data_base.GetPrevilege(login_stack.top().first) >
|
||||
user_data_base.GetPrevilege(user_id)) {
|
||||
// debugPrint("has root previlege");
|
||||
if (user_data_base.GetPrevilege(user_id) == -1)
|
||||
return std::vector<std::string>({"Invalid"});
|
||||
login_stack.push(std::make_pair(user_id, 0));
|
||||
login_count[user_id]++;
|
||||
return std::vector<std::string>();
|
||||
|
Reference in New Issue
Block a user