From 63611932ebae93620386b26cfa82f7c4552b22ff Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 29 May 2011 21:11:16 +0300 Subject: player passwords and privileges in world/auth.txt --HG-- extra : rebase_source : 7260636295d9068fbeeddf4143c89f2b8a91446c --- src/servercommand.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/servercommand.cpp') diff --git a/src/servercommand.cpp b/src/servercommand.cpp index 5bb4f67f8..e14f326f4 100644 --- a/src/servercommand.cpp +++ b/src/servercommand.cpp @@ -35,7 +35,7 @@ void cmd_privs(std::wostringstream &os, { // Show our own real privs, without any adjustments // made for admin status - os<player->privs); + os<player->privs)); return; } @@ -52,7 +52,7 @@ void cmd_privs(std::wostringstream &os, return; } - os<privs); + os<privs)); } void cmd_grantrevoke(std::wostringstream &os, @@ -70,7 +70,7 @@ void cmd_grantrevoke(std::wostringstream &os, return; } - u64 newprivs = stringToPrivs(ctx->parms[2]); + u64 newprivs = stringToPrivs(wide_to_narrow(ctx->parms[2])); if(newprivs == PRIV_INVALID) { os<privs &= ~newprivs; os<privs); + os<privs)); } void cmd_time(std::wostringstream &os, -- cgit v1.2.3 From e81919c818c6040de7401a037e3fdfac88b28eea Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 29 May 2011 22:34:04 +0300 Subject: hopefully fixed the privilege problems --HG-- extra : rebase_source : 9826d20176134a53ff232816a10407465d8c0f50 --- src/servercommand.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/servercommand.cpp') diff --git a/src/servercommand.cpp b/src/servercommand.cpp index e14f326f4..e05578b39 100644 --- a/src/servercommand.cpp +++ b/src/servercommand.cpp @@ -35,7 +35,8 @@ void cmd_privs(std::wostringstream &os, { // Show our own real privs, without any adjustments // made for admin status - os<player->privs)); + os<server->getPlayerAuthPrivs(ctx->player->getName()))); return; } @@ -52,7 +53,7 @@ void cmd_privs(std::wostringstream &os, return; } - os<privs)); + os<server->getPlayerAuthPrivs(tp->getName()))); } void cmd_grantrevoke(std::wostringstream &os, @@ -83,14 +84,19 @@ void cmd_grantrevoke(std::wostringstream &os, os<parms[1]); + u64 privs = ctx->server->getPlayerAuthPrivs(playername); if(ctx->parms[0] == L"grant") - tp->privs |= newprivs; + privs |= newprivs; else - tp->privs &= ~newprivs; + privs &= ~newprivs; + + ctx->server->setPlayerAuthPrivs(playername, privs); os<privs)); + os< Date: Tue, 31 May 2011 11:59:51 +0300 Subject: Updated licenses of CiaranG's contributions to be in line with the new contribution policy and added a TODO note to server.cpp --- src/servercommand.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'src/servercommand.cpp') diff --git a/src/servercommand.cpp b/src/servercommand.cpp index e05578b39..333e29084 100644 --- a/src/servercommand.cpp +++ b/src/servercommand.cpp @@ -1,24 +1,21 @@ /* -Minetest-c55 -Copyright (C) 2010-2011 celeron55, Perttu Ahola +Part of Minetest-c55 +Copyright (C) 2010-11 celeron55, Perttu Ahola Copyright (C) 2011 Ciaran Gultnieks -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - #include "servercommand.h" #include "utility.h" -- cgit v1.2.3