summaryrefslogtreecommitdiff
path: root/src/modules/m_password_hash.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2013-05-14 16:24:08 -0700
committerAttila Molnar <attilamolnar@hush.com>2013-05-14 16:24:08 -0700
commit23e8bba13c55d33ce89d505780da36c9589e300a (patch)
tree85a2e81cde272a0900b0e448d2d1fabdfd7e897e /src/modules/m_password_hash.cpp
parentc5ab97b1efe26609e7b9e3ff2301ad0c0911a0f6 (diff)
parent226a95aab09b9e1f43f61e78179bfa1135816c2d (diff)
Merge pull request #523 from SaberUK/master+server-notice
Add method for writing server notices.
Diffstat (limited to 'src/modules/m_password_hash.cpp')
-rw-r--r--src/modules/m_password_hash.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/modules/m_password_hash.cpp b/src/modules/m_password_hash.cpp
index e913f4925..da4342ae4 100644
--- a/src/modules/m_password_hash.cpp
+++ b/src/modules/m_password_hash.cpp
@@ -42,15 +42,14 @@ class CommandMkpasswd : public Command
HashProvider* hp = ServerInstance->Modules->FindDataService<HashProvider>("hash/" + type);
if (!hp)
{
- user->WriteServ("NOTICE %s :Unknown hash type", user->nick.c_str());
+ user->WriteNotice("Unknown hash type");
return;
}
std::string salt = ServerInstance->GenRandomStr(6, false);
std::string target = hp->hmac(salt, stuff);
std::string str = BinToBase64(salt) + "$" + BinToBase64(target, NULL, 0);
- user->WriteServ("NOTICE %s :%s hashed password for %s is %s",
- user->nick.c_str(), algo.c_str(), stuff.c_str(), str.c_str());
+ user->WriteNotice(algo + " hashed password for " + stuff + " is " + str);
return;
}
HashProvider* hp = ServerInstance->Modules->FindDataService<HashProvider>("hash/" + algo);
@@ -58,12 +57,11 @@ class CommandMkpasswd : public Command
{
/* Now attempt to generate a hash */
std::string hexsum = hp->hexsum(stuff);
- user->WriteServ("NOTICE %s :%s hashed password for %s is %s",
- user->nick.c_str(), algo.c_str(), stuff.c_str(), hexsum.c_str());
+ user->WriteNotice(algo + " hashed password for " + stuff + " is " + hexsum);
}
else
{
- user->WriteServ("NOTICE %s :Unknown hash type", user->nick.c_str());
+ user->WriteNotice("Unknown hash type");
}
}