aboutsummaryrefslogtreecommitdiffstats
path: root/src/users.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-12-10 15:27:18 +0000
committerGravatar Sadie Powell2022-12-10 15:30:51 +0000
commit9d35da3e84376cfe882882bec536c4210df31dde (patch)
tree1609aea6cfc01c2883bfa1060c0fb5f20613ad1b /src/users.cpp
parentRemove the unused Extensible* parameter to PassCompare/OnPassCompare. (diff)
Move password checking from core_oper into OperAccount.
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 50421114e..cfa2fe305 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -1375,6 +1375,8 @@ void OperType::MergeTag(const std::shared_ptr<ConfigTag>& tag)
OperAccount::OperAccount(const std::string& n, const std::shared_ptr<OperType>& o, const std::shared_ptr<ConfigTag>& t)
: OperType(n, nullptr)
+ , password(t->getString("password"))
+ , passwordhash(t->getString("hash", "plaintext", 1))
, type(o ? o->GetName() : n)
{
if (o)
@@ -1387,5 +1389,9 @@ OperAccount::OperAccount(const std::string& n, const std::shared_ptr<OperType>&
Configure(o->GetConfig(), true);
}
Configure(t, true);
+}
+bool OperAccount::CheckPassword(const std::string& pw) const
+{
+ return ServerInstance->PassCompare(password, pw, passwordhash);
}