From e5a8314ba72d9025f2047ae7d2319b74b2a16b39 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 1 May 2015 16:45:49 -0400 Subject: [PATCH] migrated serv_rooms.c to new config format --- citadel/modules/ctdlproto/serv_rooms.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/citadel/modules/ctdlproto/serv_rooms.c b/citadel/modules/ctdlproto/serv_rooms.c index 14673274b..51456ac03 100644 --- a/citadel/modules/ctdlproto/serv_rooms.c +++ b/citadel/modules/ctdlproto/serv_rooms.c @@ -1,7 +1,7 @@ /* * Server functions which perform operations on room objects. * - * Copyright (c) 1987-2012 by the citadel.org team + * Copyright (c) 1987-2015 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 3. @@ -19,6 +19,7 @@ #include "citserver.h" #include "ctdl_module.h" #include "room_ops.h" +#include "config.h" /* * Back-back-end for all room listing commands @@ -416,7 +417,7 @@ void cmd_rdir(char *cmdbuf) cprintf("%d not here.\n", ERROR + HIGHER_ACCESS_REQUIRED); return; } - cprintf("%d %s|%s/%s\n", LISTING_FOLLOWS, config.c_fqdn, ctdl_file_dir, CC->room.QRdirname); + cprintf("%d %s|%s/%s\n", LISTING_FOLLOWS, CtdlGetConfigStr("c_fqdn"), ctdl_file_dir, CC->room.QRdirname); snprintf(buf, sizeof buf, "%s/%s/filedir", ctdl_file_dir, CC->room.QRdirname); fd = fopen(buf, "r"); @@ -595,8 +596,7 @@ void cmd_setr(char *args) CC->room.QRflags |= QR_PRIVATE; /* Some changes can't apply to BASEROOM */ - if (!strncasecmp(CC->room.QRname, config.c_baseroom, - ROOMNAMELEN)) { + if (!strncasecmp(CC->room.QRname, CtdlGetConfigStr("c_baseroom"), ROOMNAMELEN)) { CC->room.QRorder = 0; CC->room.QRpasswd[0] = '\0'; CC->room.QRflags &= ~(QR_PRIVATE & QR_PASSWORDED & @@ -619,8 +619,7 @@ void cmd_setr(char *args) } } /* Some changes can't apply to AIDEROOM */ - if (!strncasecmp(CC->room.QRname, config.c_baseroom, - ROOMNAMELEN)) { + if (!strncasecmp(CC->room.QRname, CtdlGetConfigStr("c_baseroom"), ROOMNAMELEN)) { CC->room.QRorder = 0; CC->room.QRflags &= ~QR_MAILBOX; CC->room.QRflags |= QR_PERMANENT; @@ -761,7 +760,7 @@ void cmd_kill(char *argbuf) CtdlScheduleRoomForDeletion(&CC->room); /* Return to the Lobby */ - CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL, NULL, NULL); + CtdlUserGoto(CtdlGetConfigStr("c_baseroom"), 0, 0, NULL, NULL, NULL, NULL); /* tell the world what we did */ snprintf(msg, sizeof msg, "The room \"%s\" has been deleted by %s.\n", @@ -831,7 +830,7 @@ void cmd_cre8(char *args) if (CtdlAccessCheck(ac_logged_in)) return; - if (CC->user.axlevel < config.c_createax && !CC->internal_pgm) { + if (CC->user.axlevel < CtdlGetConfigInt("c_createax") && !CC->internal_pgm) { cprintf("%d You need higher access to create rooms.\n", ERROR + HIGHER_ACCESS_REQUIRED); return; -- 2.30.2