Migrated many other files to the new config system
authorArt Cancro <ajc@uncensored.citadel.org>
Fri, 1 May 2015 21:42:19 +0000 (17:42 -0400)
committerArt Cancro <ajc@uncensored.citadel.org>
Fri, 1 May 2015 21:42:19 +0000 (17:42 -0400)
12 files changed:
citadel/modules/ctdlproto/serv_user.c
citadel/modules/eventclient/serv_eventclient.c
citadel/modules/expire/expire_policy.c
citadel/modules/extnotify/extnotify_main.c
citadel/modules/extnotify/funambol65.c
citadel/modules/fulltext/serv_fulltext.c
citadel/modules/imap/imap_fetch.c
citadel/modules/imap/imap_misc.c
citadel/modules/imap/imap_search.c
citadel/modules/imap/serv_imap.c
citadel/modules/instmsg/serv_instmsg.c
citadel/modules/managesieve/serv_managesieve.c

index e98daad9fa9e26f6d9e8f3ff79b61362a1f80c76..7d6b18c6c4e8115f8bbdb845f9660a54af9a17c6 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * Server functions which perform operations on user objects.
  *
- * Copyright (c) 1987-2011 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.
 #include "support.h"
 #include "control.h"
 #include "ctdl_module.h"
-
 #include "citserver.h"
-
+#include "config.h"
 #include "user_ops.h"
 #include "internet_addressing.h"
 
 
-
 /*
  * USER cmd
  */
@@ -47,7 +45,7 @@ void cmd_user(char *cmdbuf)
                        "Too many users are already online "
                        "(maximum is %d)\n",
                        ERROR + MAX_SESSIONS_EXCEEDED,
-                       config.c_nodename, config.c_maxsessions);
+                       CtdlGetConfigStr("c_nodename"), CtdlGetConfigInt("c_maxsessions"));
                return;
        case login_ok:
                cprintf("%d Password required for %s\n",
@@ -99,13 +97,13 @@ void cmd_newu(char *cmdbuf)
        long len;
        char username[SIZ];
 
-       if (config.c_auth_mode != AUTHMODE_NATIVE) {
+       if (CtdlGetConfigInt("c_auth_mode") != AUTHMODE_NATIVE) {
                cprintf("%d This system does not use native mode authentication.\n",
                        ERROR + NOT_HERE);
                return;
        }
 
-       if (config.c_disable_newu) {
+       if (CtdlGetConfigInt("c_disable_newu")) {
                cprintf("%d Self-service user account creation "
                        "is disabled on this system.\n", ERROR + NOT_HERE);
                return;
@@ -118,7 +116,7 @@ void cmd_newu(char *cmdbuf)
        if (CC->nologin) {
                cprintf("%d %s: Too many users are already online (maximum is %d)\n",
                        ERROR + MAX_SESSIONS_EXCEEDED,
-                       config.c_nodename, config.c_maxsessions);
+                       CtdlGetConfigStr("c_nodename"), CtdlGetConfigInt("c_maxsessions"));
                return;
        }
        extract_token(username, cmdbuf, 0, '|', sizeof username);
@@ -232,7 +230,7 @@ void cmd_creu(char *cmdbuf)
        } else if (a == ERROR + ALREADY_EXISTS) {
                cprintf("%d '%s' already exists.\n", ERROR + ALREADY_EXISTS, username);
                return;
-       } else if ( (config.c_auth_mode != AUTHMODE_NATIVE) && (a == ERROR + NO_SUCH_USER) ) {
+       } else if ( (CtdlGetConfigInt("c_auth_mode") != AUTHMODE_NATIVE) && (a == ERROR + NO_SUCH_USER) ) {
                cprintf("%d User accounts are not created within Citadel in host authentication mode.\n",
                        ERROR + NO_SUCH_USER);
                return;
@@ -372,7 +370,7 @@ void cmd_invt_kick(char *iuser, int op) {
                return;
        }
 
-       if (!strncasecmp(CC->room.QRname, config.c_baseroom,
+       if (!strncasecmp(CC->room.QRname, CtdlGetConfigStr("c_baseroom"),
                         ROOMNAMELEN)) {
                cprintf("%d Can't add/remove users from this room.\n",
                        ERROR + NOT_HERE);
index f7e286a9ab14cf6188f352b52ac036224df99982..22a715615c6ffac6aa32629eb857b657f5fa60ba 100644 (file)
@@ -1,19 +1,13 @@
 /*
- * Copyright (c) 1998-2012 by the citadel.org team
+ * Copyright (c) 1998-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.
- *  
- *  
+ * 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.
  *
- *  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.
- *
- *  
- *  
- *  
+ * 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.
  */
 
 #include "sysdep.h"
@@ -53,9 +47,8 @@
 #include "server.h"
 #include "citserver.h"
 #include "support.h"
-
 #include "ctdl_module.h"
-
+#include "config.h"
 #include "event_client.h"
 #include "serv_curl.h"
 
@@ -477,13 +470,13 @@ int evcurl_init(AsyncIO *IO)
        OPT(WRITEDATA, (void *)IO);
        OPT(ERRORBUFFER, IO->HttpReq.errdesc);
 
-       if ((!IsEmptyStr(config.c_ip_addr))
-               && (strcmp(config.c_ip_addr, "*"))
-               && (strcmp(config.c_ip_addr, "::"))
-               && (strcmp(config.c_ip_addr, "0.0.0.0"))
+       if ((!IsEmptyStr(CtdlGetConfigStr("c_ip_addr")))
+               && (strcmp(CtdlGetConfigStr("c_ip_addr"), "*"))
+               && (strcmp(CtdlGetConfigStr("c_ip_addr"), "::"))
+               && (strcmp(CtdlGetConfigStr("c_ip_addr"), "0.0.0.0"))
                )
        {
-               OPT(INTERFACE, config.c_ip_addr);
+               OPT(INTERFACE, CtdlGetConfigStr("c_ip_addr"));
        }
 
 #ifdef CURLOPT_HTTP_CONTENT_DECODING
index bc4b772a72c1c28626a7b743d864d82ca8dcdbcb..f3b27df7f9d82786299f1ad6490eadbb1835b4eb 100644 (file)
@@ -1,6 +1,6 @@
 /* 
  * Functions which manage expire policy for rooms
- * 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.
@@ -40,7 +40,7 @@
 #include "support.h"
 #include "msgbase.h"
 #include "citserver.h"
-
+#include "config.h"
 #include "ctdl_module.h"
 #include "user_ops.h"
 
@@ -72,8 +72,7 @@ void GetExpirePolicy(struct ExpirePolicy *epbuf, struct ctdlroom *qrbuf) {
         */
        if (qrbuf->QRflags & QR_MAILBOX) {
                if (config.c_mbxep.expire_mode != 0) {
-                       memcpy(epbuf, &config.c_mbxep,
-                               sizeof(struct ExpirePolicy));
+                       memcpy(epbuf, &config.c_mbxep, sizeof(struct ExpirePolicy));
                        return;
                }
        }
index 8eafc036a61b09e39fbbd54583cc2768dd59e10c..219a03fa122cf4409c21266a4722568f6d69e93c 100644 (file)
@@ -8,7 +8,7 @@
  * Based on bits of serv_funambol
  * Contact: <matt@mcbridematt.dhs.org> / <matt@comalies>
  *
- * Copyright (c) 2008-2011
+ * Copyright (c) 2008-2015
  *
  * 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
  * 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
  */
 
 
@@ -295,9 +291,9 @@ void process_notify(long NotifyMsgnum, void *usrdata)
                {
                case eFunambol:
                        snprintf(remoteurl, SIZ, "http://%s@%s:%d/%s",
-                                config.c_funambol_auth,
-                                config.c_funambol_host,
-                                config.c_funambol_port,
+                                CtdlGetConfigStr("c_funambol_auth"),
+                                CtdlGetConfigStr("c_funambol_host"),
+                                CtdlGetConfigInt("c_funambol_port"),
                                 FUNAMBOL_WS);
 
                        notify_http_server(remoteurl,
@@ -349,7 +345,7 @@ void process_notify(long NotifyMsgnum, void *usrdata)
                        int commandSiz;
                        char *command;
 
-                       commandSiz = sizeof(config.c_pager_program) +
+                       commandSiz = sizeof(CtdlGetConfigStr("c_pager_program")) +
                                strlen(PagerNo) +
                                msg->cm_lengths[eExtnotify] + 5;
 
@@ -358,7 +354,7 @@ void process_notify(long NotifyMsgnum, void *usrdata)
                        snprintf(command,
                                 commandSiz,
                                 "%s %s -u %s",
-                                config.c_pager_program,
+                                CtdlGetConfigStr("c_pager_program"),
                                 PagerNo,
                                 msg->cm_fields[eExtnotify]);
 
@@ -393,8 +389,8 @@ void do_extnotify_queue(void)
         * don't really require extremely fine granularity here, we'll do it
         * with a static variable instead.
         */
-       if (IsEmptyStr(config.c_pager_program) &&
-           IsEmptyStr(config.c_funambol_host))
+       if (IsEmptyStr(CtdlGetConfigStr("c_pager_program")) &&
+           IsEmptyStr(CtdlGetConfigStr("c_funambol_host")))
        {
                syslog(LOG_ERR,
                       "No external notifiers configured on system/user\n");
@@ -472,7 +468,7 @@ int extnotify_after_mbox_save(struct CtdlMessage *msg,
        /* If this is private, local mail, make a copy in the
         * recipient's mailbox and bump the reference count.
         */
-       if (!IsEmptyStr(config.c_funambol_host) || !IsEmptyStr(config.c_pager_program))
+       if (!IsEmptyStr(CtdlGetConfigStr("c_funambol_host")) || !IsEmptyStr(CtdlGetConfigStr("c_pager_program")))
        {
                /* Generate a instruction message for the Funambol notification
                 * server, in the same style as the SMTP queue
index 20246c90d02a38ac25193743a01440340b5fca48..1a109971988185f4b4ebeb44a1a3604fbdc5042c 100644 (file)
@@ -8,21 +8,15 @@
  * Based on bits of the previous serv_funambol
  * Contact: <matt@mcbridematt.dhs.org> / <matt@comalies>
  *
- * Copyright (c) 2008-2010
+ * Copyright (c) 2008-2015
  *
  * 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.
- * 
- * 
  *
  * 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.
- *
- * 
- * 
- * 
  */
 
 #include <stdio.h>
@@ -146,8 +140,7 @@ int notify_http_server(char *remoteurl,
 
                // Do substitutions
                help_subst(SOAPMessage, "^notifyuser", user);
-               help_subst(SOAPMessage, "^syncsource",
-                          config.c_funambol_source);
+               help_subst(SOAPMessage, "^syncsource", CtdlGetConfigStr("c_funambol_source"));
                help_subst(SOAPMessage, "^msgid", msgid);
                help_subst(SOAPMessage, "^msgnum", msgnumstr);
 
@@ -182,7 +175,7 @@ int notify_http_server(char *remoteurl,
        }
        else {
                help_subst(remoteurl, "^notifyuser", user);
-               help_subst(remoteurl, "^syncsource", config.c_funambol_source);
+               help_subst(remoteurl, "^syncsource", CtdlGetConfigStr("c_funambol_source"));
                help_subst(remoteurl, "^msgid", msgid);
                help_subst(remoteurl, "^msgnum", msgnumstr);
 
index 7f5da0fe84d604863b3ba68567a1f4d73d7fd570..8029b758383bdfdc101127a4480fcf6abf297431 100644 (file)
@@ -251,7 +251,7 @@ void do_fulltext_indexing(void) {
        /*
         * Don't do this if the site doesn't have it enabled.
         */
-       if (!config.c_enable_fulltext) {
+       if (!CtdlGetConfigInt("c_enable_fulltext")) {
                return;
        }
 
@@ -455,7 +455,7 @@ void cmd_srch(char *argbuf) {
 
        if (CtdlAccessCheck(ac_logged_in)) return;
 
-       if (!config.c_enable_fulltext) {
+       if (!CtdlGetConfigInt("c_enable_fulltext")) {
                cprintf("%d Full text index is not enabled on this server.\n",
                        ERROR + CMD_NOT_SUPPORTED);
                return;
@@ -489,7 +489,7 @@ void ft_delete_remove(char *room, long msgnum)
        if (room) return;
        
        /* Remove from fulltext index */
-       if (config.c_enable_fulltext) {
+       if (CtdlGetConfigInt("c_enable_fulltext")) {
                ft_index_message(msgnum, 0);
        }
 }
index 3f00d3f3f65c26380005589c3fc8d8d21bb1d37d..6708fbc4ea4a63f2b9d7cec5de10e1017ee1e46b 100644 (file)
@@ -2,21 +2,17 @@
  * Implements the FETCH command in IMAP.
  * This is a good example of the protocol's gratuitous complexity.
  *
- * Copyright (c) 2001-2011 by the citadel.org team
+ * Copyright (c) 2001-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 as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
+ * 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
+ * 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.
  */
 
 
@@ -363,8 +359,8 @@ void imap_output_envelope_from(struct CtdlMessage *msg) {
                process_rfc822_addr(msg->cm_fields[erFc822Addr], user, node, name);
                IPutStr(user, strlen(user));            /* mailbox name (user id) */
                IAPuts(" ");
-               if (!strcasecmp(node, config.c_nodename)) {
-                       IPutStr(CFG_KEY(c_fqdn));
+               if (!strcasecmp(node, CtdlGetConfigStr("c_nodename"))) {
+                       IPutStr(CtdlGetConfigStr("c_fqdn"), strlen(CtdlGetConfigStr("c_fqdn")));
                }
                else {
                        IPutStr(node, strlen(node));            /* host name */
index f4d501c9d3853dd56c8895e804ac0c5d943755ea..3665264554ddc574840d88acef5e64017c857a31 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1987-2011 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 as published by
  * 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
  */
 
 
@@ -341,7 +337,7 @@ void imap_append(int num_parms, ConstStr *Params) {
        
        IUnbuffer ();
 
-       client_read_blob(Imap->TransmittedMessage, literal_length, config.c_sleeping);
+       client_read_blob(Imap->TransmittedMessage, literal_length, CtdlGetConfigInt("c_sleeping"));
 
        if ((ret < 0) || (StrLength(Imap->TransmittedMessage) < literal_length)) {
                IReply("NO Read failed.");
@@ -377,19 +373,15 @@ void imap_append(int num_parms, ConstStr *Params) {
        CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL);
 
        /* If the user is locally authenticated, FORCE the From: header to
-        * show up as the real sender.  FIXME do we really want to do this?
-        * Probably should make it site-definable or even room-definable.
-        *
-        * For now, we allow "forgeries" if the room is one of the user's
-        * private mailboxes.
+        * show up as the real sender.  (Configurable setting)
         */
        if (CCC->logged_in) {
-          if ( ((CCC->room.QRflags & QR_MAILBOX) == 0) && (config.c_imap_keep_from == 0)) {
-
-               CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname));
-               CM_SetField(msg, eNodeName, CFG_KEY(c_nodename));
-               CM_SetField(msg, eHumanNode, CFG_KEY(c_humannode));
-           }
+               if ( ((CCC->room.QRflags & QR_MAILBOX) == 0) && (CtdlGetConfigInt("c_imap_keep_from") == 0))
+               {
+                       CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname));
+                       CM_SetField(msg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename")));
+                       CM_SetField(msg, eHumanNode, CtdlGetConfigStr("c_humannode"), strlen(CtdlGetConfigStr("c_humannode")));
+               }
        }
 
        /* 
index cad499ceb63ad2091768ae552a5d8c99b2243758..02240b1e8c887a6704f010e3a731a0eeed2995c4 100644 (file)
@@ -1,21 +1,15 @@
 /*
  * Implements IMAP's gratuitously complex SEARCH command.
  *
- * Copyright (c) 2001-2012 by the citadel.org team
+ * Copyright (c) 2001-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.
- *  
- *  
+ * 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.
  *
- *  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.
- *
- *  
- *  
- *  
+ * 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.
  */
 
 #include "ctdl_module.h"
@@ -157,7 +151,7 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg,
                /* If fulltext indexing is active, on this server,
                 *  all messages have already been qualified.
                 */
-               if (config.c_enable_fulltext) {
+               if (CtdlGetConfigInt("c_enable_fulltext")) {
                        match = 1;
                }
 
@@ -571,7 +565,7 @@ void imap_do_search(int num_items, ConstStr *itemlist, int is_uid) {
         * text index to disqualify messages that don't have any chance of
         * matching.  (Only do this if the index is enabled!!)
         */
-       if (config.c_enable_fulltext) for (i=0; i<(num_items-1); ++i) {
+       if (CtdlGetConfigInt("c_enable_fulltext")) for (i=0; i<(num_items-1); ++i) {
                if (!strcasecmp(itemlist[i].Key, "BODY")) {
                        CtdlModuleDoSearch(&fts_num_msgs, &fts_msgs, itemlist[i+1].Key, "fulltext");
                        if (fts_num_msgs > 0) {
index 278cc73323392b3883c08ff8ee58b75d1b8fa163..34c175dcbb94818d188295da9f89f7b1eedf17b3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * IMAP server for the Citadel system
  *
- * Copyright (C) 2000-2011 by Art Cancro and others.
+ * Copyright (C) 2000-2015 by Art Cancro and others.
  * This code is released under the terms of the GNU General Public License.
  *
  * WARNING: the IMAP protocol is badly designed.  No implementation of it
  * 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"
@@ -599,7 +595,7 @@ void imap_greeting(void)
 
        IAPuts("* OK [");
        imap_output_capability_string();
-       IAPrintf("] %s IMAP4rev1 %s ready\r\n", config.c_fqdn, CITADEL);
+       IAPrintf("] %s IMAP4rev1 %s ready\r\n", CtdlGetConfigStr("c_fqdn"), CITADEL);
        IUnbuffer();
 }
 
@@ -1675,7 +1671,7 @@ void imap_logout(int num_parms, ConstStr *Params)
        if (IMAP->selected) {
                imap_do_expunge();      /* yes, we auto-expunge at logout */
        }
-       IAPrintf("* BYE %s logging out\r\n", config.c_fqdn);
+       IAPrintf("* BYE %s logging out\r\n", CtdlGetConfigStr("c_fqdn"));
        IReply("OK Citadel IMAP session ended.");
        CC->kill_me = KILLME_CLIENT_LOGGED_OUT;
        return;
@@ -1744,10 +1740,10 @@ CTDL_MODULE_INIT(imap)
        if (!threading)
        {
                CtdlRegisterDebugFlagHook(HKEY("imapsrv"), SetIMAPDebugEnabled, &IMAPDebugEnabled);
-               CtdlRegisterServiceHook(config.c_imap_port,
+               CtdlRegisterServiceHook(CtdlGetConfigInt("c_imap_port"),
                                        NULL, imap_greeting, imap_command_loop, NULL, CitadelServiceIMAP);
 #ifdef HAVE_OPENSSL
-               CtdlRegisterServiceHook(config.c_imaps_port,
+               CtdlRegisterServiceHook(CtdlGetConfigInt("c_imaps_port"),
                                        NULL, imaps_greeting, imap_command_loop, NULL, CitadelServiceIMAPS);
 #endif
                CtdlRegisterSessionHook(imap_cleanup_function, EVT_STOP, PRIO_STOP + 30);
index 2c28600b665cc01d437439c6f5442499e46bfc20..9884785373f4701758aabdef6031e2f6b2103b77 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This module handles instant messaging between users.
  * 
- * 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.
@@ -11,6 +11,7 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  */
+
 #include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
@@ -174,7 +175,7 @@ void cmd_gexp(char *argbuf) {
                (long)ptr->timestamp,                   /* time sent */
                ptr->flags,                             /* flags */
                ptr->sender,                            /* sender of msg */
-               config.c_nodename,                      /* static for now (and possibly deprecated) */
+               CtdlGetConfigStr("c_nodename"),         /* static for now (and possibly deprecated) */
                ptr->sender_email                       /* email or jid of sender */
        );
 
@@ -478,7 +479,7 @@ void flush_individual_conversation(struct imlog *im) {
        }
 
        CM_SetField(msg, eOriginalRoom, HKEY(PAGELOGROOM));
-       CM_SetField(msg, eNodeName, CFG_KEY(c_nodename));
+       CM_SetField(msg, eNodeName, CtdlGetConfigStr("c_nodename"), strlen(CtdlGetConfigStr("c_nodename")));
        CM_SetAsFieldSB(msg, eMesageText, &FullMsgBuf); /* we own this memory now */
 
        /* Start with usernums[1] because it's guaranteed to be higher than usernums[0],
@@ -503,9 +504,9 @@ void flush_individual_conversation(struct imlog *im) {
        }
 
        /* Finally, if we're logging instant messages globally, do that now. */
-       if (!IsEmptyStr(config.c_logpages)) {
-               CtdlCreateRoom(config.c_logpages, 3, "", 0, 1, 1, VIEW_BBS);
-               CtdlSaveMsgPointerInRoom(config.c_logpages, msgnum, 0, NULL);
+       if (!IsEmptyStr(CtdlGetConfigStr("c_logpages"))) {
+               CtdlCreateRoom(CtdlGetConfigStr("c_logpages"), 3, "", 0, 1, 1, VIEW_BBS);
+               CtdlSaveMsgPointerInRoom(CtdlGetConfigStr("c_logpages"), msgnum, 0, NULL);
        }
 
 }
index 23f5f263c614b67b8db4ea489c3ff841bc33fae8..6bfe112643cc460a5a9d0c5958f971aa9a46a989 100644 (file)
@@ -6,7 +6,7 @@
  * as this draft expires with this writing, you might need to search for
  * the new one.
  *
- * Copyright (c) 2007-2012 by the citadel.org team
+ * Copyright (c) 2007-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.
@@ -651,7 +651,7 @@ CTDL_MODULE_INIT(managesieve)
 {
        if (!threading)
        {
-               CtdlRegisterServiceHook(config.c_managesieve_port,
+               CtdlRegisterServiceHook(CtdlGetConfigInt("c_managesieve_port"),
                                        NULL,
                                        managesieve_greeting,
                                        managesieve_command_loop,