1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Fix processing of the default_password setting. It is now actually used as the plaintext password for new users. Also add /setpassword and /clearpassword server commands that can be used by admins with the PRIV_PASSWORD privilege, and update the /help message.

This commit is contained in:
Kahrl 2011-11-20 20:16:15 +01:00 committed by Perttu Ahola
parent 1901158b3e
commit 2ca00fa585
5 changed files with 109 additions and 36 deletions

View file

@ -42,6 +42,8 @@ std::set<std::string> privsToSet(u64 privs)
s.insert("ban");
if(privs & PRIV_GIVE)
s.insert("give");
if(privs & PRIV_PASSWORD)
s.insert("password");
return s;
}
@ -64,6 +66,8 @@ std::string privsToString(u64 privs)
os<<"ban,";
if(privs & PRIV_GIVE)
os<<"give,";
if(privs & PRIV_PASSWORD)
os<<"password,";
if(os.tellp())
{
// Drop the trailing comma. (Why on earth can't
@ -98,6 +102,8 @@ u64 stringToPrivs(std::string str)
privs |= PRIV_BAN;
else if(s == "give")
privs |= PRIV_GIVE;
else if(s == "password")
privs |= PRIV_PASSWORD;
else
return PRIV_INVALID;
}