]> code.citadel.org Git - citadel.git/blobdiff - citadel/room_ops.c
Allow LFLR to work in guest mode
[citadel.git] / citadel / room_ops.c
index c6801b6d352b2d7f4c4e665eedd9fa71d64add9f..629aeeb30fad8a1a767582311cc4b2435ab4d777 100644 (file)
@@ -1,6 +1,21 @@
 /* 
  * Server functions which perform operations on room objects.
  *
+ * Copyright (c) 1987-2011 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 as published by
+ * the Free Software Foundation; either version 3 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
 #include "sysdep.h"
@@ -774,7 +789,7 @@ void cmd_lprm(char *argbuf)
        if (!IsEmptyStr(argbuf))
                FloorBeingSearched = extract_int(argbuf, 0);
 
-       cprintf("%d Publiic rooms:\n", LISTING_FOLLOWS);
+       cprintf("%d Public rooms:\n", LISTING_FOLLOWS);
 
        CtdlForEachRoom(cmd_lprm_backend, &FloorBeingSearched);
        cprintf("000\n");
@@ -1019,7 +1034,7 @@ void CtdlUserGoto(char *where, int display_result, int transiently,
 
        if (retmsgs != NULL) *retmsgs = total_messages;
        if (retnew != NULL) *retnew = new_messages;
-       CtdlLogPrintf(CTDL_DEBUG, "<%s> %d new of %d total messages\n",
+       syslog(LOG_DEBUG, "<%s> %d new of %d total messages\n",
                CC->room.QRname,
                new_messages, total_messages
        );
@@ -1162,7 +1177,7 @@ void cmd_goto(char *gargs)
                                   ((ra & UA_KNOWN) == 0) &&
                                   (CC->user.axlevel < AxAideU)
                                   ) {
-                               CtdlLogPrintf(CTDL_DEBUG, "Failed to acquire private room\n");
+                               syslog(LOG_DEBUG, "Failed to acquire private room\n");
                        } else {
                                memcpy(&CC->room, &QRscratch,
                                        sizeof(struct ctdlroom));
@@ -1342,7 +1357,7 @@ int CtdlRenameRoom(char *old_name, char *new_name, int new_floor) {
        long owner = 0L;
        char actual_old_name[ROOMNAMELEN];
 
-       CtdlLogPrintf(CTDL_DEBUG, "CtdlRenameRoom(%s, %s, %d)\n",
+       syslog(LOG_DEBUG, "CtdlRenameRoom(%s, %s, %d)\n",
                old_name, new_name, new_floor);
 
        if (new_floor >= 0) {
@@ -1433,11 +1448,11 @@ int CtdlRenameRoom(char *old_name, char *new_name, int new_floor) {
                lgetfloor(&flbuf, old_floor);
                --flbuf.f_ref_count;
                lputfloor(&flbuf, old_floor);
-               CtdlLogPrintf(CTDL_DEBUG, "Reference count for floor %d is now %d\n", old_floor, flbuf.f_ref_count);
+               syslog(LOG_DEBUG, "Reference count for floor %d is now %d\n", old_floor, flbuf.f_ref_count);
                lgetfloor(&flbuf, new_floor);
                ++flbuf.f_ref_count;
                lputfloor(&flbuf, new_floor);
-               CtdlLogPrintf(CTDL_DEBUG, "Reference count for floor %d is now %d\n", new_floor, flbuf.f_ref_count);
+               syslog(LOG_DEBUG, "Reference count for floor %d is now %d\n", new_floor, flbuf.f_ref_count);
        }
 
        /* ...and everybody say "YATTA!" */     
@@ -1686,7 +1701,7 @@ void CtdlScheduleRoomForDeletion(struct ctdlroom *qrbuf)
        char old_name[ROOMNAMELEN];
        static int seq = 0;
 
-       CtdlLogPrintf(CTDL_NOTICE, "Scheduling room <%s> for deletion\n",
+       syslog(LOG_NOTICE, "Scheduling room <%s> for deletion\n",
                qrbuf->QRname);
 
        safestrncpy(old_name, qrbuf->QRname, sizeof old_name);
@@ -1724,7 +1739,7 @@ void CtdlDeleteRoom(struct ctdlroom *qrbuf)
        char filename[100];
        /* TODO: filename magic? does this realy work? */
 
-       CtdlLogPrintf(CTDL_NOTICE, "Deleting room <%s>\n", qrbuf->QRname);
+       syslog(LOG_NOTICE, "Deleting room <%s>\n", qrbuf->QRname);
 
        /* Delete the info file */
        assoc_file_name(filename, sizeof filename, qrbuf, ctdl_info_dir);
@@ -1855,11 +1870,11 @@ unsigned CtdlCreateRoom(char *new_room_name,
        struct floor flbuf;
        visit vbuf;
 
-       CtdlLogPrintf(CTDL_DEBUG, "CtdlCreateRoom(name=%s, type=%d, view=%d)\n",
+       syslog(LOG_DEBUG, "CtdlCreateRoom(name=%s, type=%d, view=%d)\n",
                new_room_name, new_room_type, new_room_view);
 
        if (CtdlGetRoom(&qrbuf, new_room_name) == 0) {
-               CtdlLogPrintf(CTDL_DEBUG, "%s already exists.\n", new_room_name);
+               syslog(LOG_DEBUG, "%s already exists.\n", new_room_name);
                return(0);
        }
 
@@ -2067,9 +2082,9 @@ void cmd_einf(char *ok)
                return;
        }
        assoc_file_name(infofilename, sizeof infofilename, &CC->room, ctdl_info_dir);
-       CtdlLogPrintf(CTDL_DEBUG, "opening\n");
+       syslog(LOG_DEBUG, "opening\n");
        fp = fopen(infofilename, "w");
-       CtdlLogPrintf(CTDL_DEBUG, "checking\n");
+       syslog(LOG_DEBUG, "checking\n");
        if (fp == NULL) {
                cprintf("%d Cannot open %s: %s\n",
                  ERROR + INTERNAL_ERROR, infofilename, strerror(errno));
@@ -2099,7 +2114,7 @@ void cmd_lflr(char *gargs)
        int a;
        struct floor flbuf;
 
-       if (CtdlAccessCheck(ac_logged_in)) return;
+       if (CtdlAccessCheck(ac_logged_in_or_guest)) return;
 
        cprintf("%d Known floors:\n", LISTING_FOLLOWS);
 
@@ -2265,22 +2280,22 @@ CTDL_MODULE_INIT(room_ops)
                CtdlRegisterProtoHook(cmd_lkrn, "LKRN", "List known rooms with new messages");
                CtdlRegisterProtoHook(cmd_lkro, "LKRO", "List known rooms without new messages");
                CtdlRegisterProtoHook(cmd_lzrm, "LZRM", "List zapped rooms");
-               CtdlRegisterProtoHook(cmd_lprm, "LPRM", "Autoconverted. TODO: document me.");
+               CtdlRegisterProtoHook(cmd_lprm, "LPRM", "List public rooms");
                CtdlRegisterProtoHook(cmd_goto, "GOTO", "Goto a named room");
                CtdlRegisterProtoHook(cmd_whok, "WHOK", "List users who know this room");
                CtdlRegisterProtoHook(cmd_rdir, "RDIR", "List files in room directory");
-               CtdlRegisterProtoHook(cmd_getr, "GETR", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_setr, "SETR", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_geta, "GETA", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_seta, "SETA", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_rinf, "RINF", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_kill, "KILL", "Autoconverted. TODO: document me.");
+               CtdlRegisterProtoHook(cmd_getr, "GETR", "Get room parameters");
+               CtdlRegisterProtoHook(cmd_setr, "SETR", "Set room parameters");
+               CtdlRegisterProtoHook(cmd_geta, "GETA", "Get the room aide name");
+               CtdlRegisterProtoHook(cmd_seta, "SETA", "Set the room aide for this room");
+               CtdlRegisterProtoHook(cmd_rinf, "RINF", "Fetch room info file");
+               CtdlRegisterProtoHook(cmd_kill, "KILL", "Kill (delete) the current room");
                CtdlRegisterProtoHook(cmd_cre8, "CRE8", "Create a new room");
-               CtdlRegisterProtoHook(cmd_einf, "EINF", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_lflr, "LFLR", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_cflr, "CFLR", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_kflr, "KFLR", "Autoconverted. TODO: document me.");
-               CtdlRegisterProtoHook(cmd_eflr, "EFLR", "Autoconverted. TODO: document me.");
+               CtdlRegisterProtoHook(cmd_einf, "EINF", "Enter info file for the current room");
+               CtdlRegisterProtoHook(cmd_lflr, "LFLR", "List all known floors");
+               CtdlRegisterProtoHook(cmd_cflr, "CFLR", "Create a new floor");
+               CtdlRegisterProtoHook(cmd_kflr, "KFLR", "Kill a floor");
+               CtdlRegisterProtoHook(cmd_eflr, "EFLR", "Edit a floor");
        }
         /* return our Subversion id for the Log */
        return "room_ops";