diff options
author | Kahrl <kahrl@gmx.net> | 2011-11-20 20:16:15 +0100 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-12-01 12:06:39 +0200 |
commit | 2ca00fa585087f2097796d994d378708041a7194 (patch) | |
tree | b2aecfa7d40b17f3b5eeac3b27942767c2b2aeec /src/auth.cpp | |
parent | 1901158b3eacc95d945becea62ac28039618f460 (diff) | |
download | minetest-2ca00fa585087f2097796d994d378708041a7194.tar.gz minetest-2ca00fa585087f2097796d994d378708041a7194.tar.bz2 minetest-2ca00fa585087f2097796d994d378708041a7194.zip |
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.
Diffstat (limited to 'src/auth.cpp')
-rw-r--r-- | src/auth.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/auth.cpp b/src/auth.cpp index 684391654..9920e0e40 100644 --- a/src/auth.cpp +++ b/src/auth.cpp @@ -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; } |