mirror of
https://github.com/Expand-sys/CCash
synced 2026-03-22 12:37:08 +11:00
🐛 fixed last commit
This commit is contained in:
parent
b0af12d4ce
commit
3965cc0ce3
1 changed files with 6 additions and 4 deletions
|
|
@ -61,25 +61,27 @@ public:
|
|||
|
||||
bool DelUser(const std::string &name, const std::string &attempt)
|
||||
{
|
||||
bool state;
|
||||
{
|
||||
std::shared_lock<std::shared_mutex> lock{size_l};
|
||||
bool state = users.erase_if(name, [&attempt](User &u) { return (XXH3_64bits(attempt.data(), attempt.size()) == u.password); });
|
||||
state = users.erase_if(name, [&attempt](User &u) { return (XXH3_64bits(attempt.data(), attempt.size()) == u.password); });
|
||||
}
|
||||
if (state)
|
||||
{
|
||||
logs.erase_if(name, [](User &u) {})
|
||||
logs.erase(name);
|
||||
}
|
||||
return state;
|
||||
}
|
||||
bool AdminDelUser(const std::string &name, const std::string &attempt)
|
||||
{
|
||||
bool state;
|
||||
{
|
||||
std::shared_lock<std::shared_mutex> lock{size_l};
|
||||
bool state = users.erase_if(name, [this, &attempt](const User &) { return (admin_pass == attempt); });
|
||||
state = users.erase_if(name, [this, &attempt](const User &) { return (admin_pass == attempt); });
|
||||
}
|
||||
if (state)
|
||||
{
|
||||
logs.erase_if(name, [](User &u) {});
|
||||
logs.erase(name);
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue