From 2ca00fa585087f2097796d994d378708041a7194 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Sun, 20 Nov 2011 20:16:15 +0100 Subject: 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. --- src/auth.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/auth.cpp') 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 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; } -- cgit v1.2.3