here be more migration
authorArt Cancro <ajc@uncensored.citadel.org>
Tue, 5 May 2015 02:24:18 +0000 (22:24 -0400)
committerArt Cancro <ajc@uncensored.citadel.org>
Tue, 5 May 2015 02:24:18 +0000 (22:24 -0400)
citadel/modules/openid/serv_openid_rp.c
citadel/modules/pop3/serv_pop3.c
citadel/modules/pop3client/serv_pop3client.c

index d43448d8d1eb4fd7f80201475e994c3771d1406c..748da3bed81af4be1ee30a0e849bb4275ec343d5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This is an implementation of OpenID 2.0 relying party support in stateless mode.
  *
- * 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 as published by
@@ -211,7 +211,7 @@ void cmd_oidl(char *argbuf) {
        struct cdbdata *cdboi;
        long usernum = 0L;
 
-       if (config.c_disable_newu)
+       if (CtdlGetConfigInt("c_disable_newu"))
        {
                cprintf("%d this system does not support openid.\n",
                        ERROR + CMD_NOT_SUPPORTED);
@@ -243,7 +243,7 @@ void cmd_oida(char *argbuf) {
        long usernum;
        struct ctdluser usbuf;
 
-       if (config.c_disable_newu)
+       if (CtdlGetConfigInt("c_disable_newu"))
        {
                cprintf("%d this system does not support openid.\n",
                        ERROR + CMD_NOT_SUPPORTED);
@@ -278,7 +278,7 @@ void cmd_oida(char *argbuf) {
 void cmd_oidc(char *argbuf) {
        ctdl_openid *oiddata = (ctdl_openid *) CC->openid_data;
 
-       if (config.c_disable_newu)
+       if (CtdlGetConfigInt("c_disable_newu"))
        {
                cprintf("%d this system does not support openid.\n",
                        ERROR + CMD_NOT_SUPPORTED);
@@ -311,7 +311,7 @@ void cmd_oidd(char *argbuf) {
        int this_is_mine = 0;
        long usernum = 0L;
 
-       if (config.c_disable_newu)
+       if (CtdlGetConfigInt("c_disable_newu"))
        {
                cprintf("%d this system does not support openid.\n",
                        ERROR + CMD_NOT_SUPPORTED);
@@ -358,8 +358,8 @@ int openid_create_user_via_ax(StrBuf *claimed_id, HashList *sreg_keys)
        const char *Key;
        void *Value;
 
-       if (config.c_auth_mode != AUTHMODE_NATIVE) return(1);
-       if (config.c_disable_newu) return(2);
+       if (CtdlGetConfigInt("c_auth_mode") != AUTHMODE_NATIVE) return(1);
+       if (CtdlGetConfigInt("c_disable_newu")) return(2);
        if (CC->logged_in) return(3);
 
        HashPos *HashPos = GetNewHashPos(sreg_keys, 0);
@@ -553,12 +553,12 @@ CURL *ctdl_openid_curl_easy_init(char *errmsg) {
        curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30);            /* die after 30 seconds */
 
        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"))
+               (!IsEmptyStr(CtdlGetConfigStr("c_ip_addr")))
+               && (strcmp(CtdlGetConfigStr("c_ip_addr"), "*"))
+               && (strcmp(CtdlGetConfigStr("c_ip_addr"), "::"))
+               && (strcmp(CtdlGetConfigStr("c_ip_addr"), "0.0.0.0"))
        ) {
-               curl_easy_setopt(curl, CURLOPT_INTERFACE, config.c_ip_addr);
+               curl_easy_setopt(curl, CURLOPT_INTERFACE, CtdlGetConfigStr("c_ip_addr"));
        }
 
        return(curl);
@@ -832,7 +832,7 @@ void cmd_oids(char *argbuf) {
        ctdl_openid *oiddata;
        int discovery_succeeded = 0;
 
-       if (config.c_disable_newu)
+       if (CtdlGetConfigInt("c_disable_newu"))
        {
                cprintf("%d this system does not support openid.\n",
                        ERROR + CMD_NOT_SUPPORTED);
@@ -963,7 +963,7 @@ void cmd_oidf(char *argbuf) {
        void *Value;
        ctdl_openid *oiddata = (ctdl_openid *) CC->openid_data;
 
-       if (config.c_disable_newu)
+       if (CtdlGetConfigInt("c_disable_newu"))
        {
                cprintf("%d this system does not support openid.\n",
                        ERROR + CMD_NOT_SUPPORTED);
@@ -1108,7 +1108,7 @@ void cmd_oidf(char *argbuf) {
                         * If this system does not allow self-service new user registration, the
                         * remaining modes do not apply, so fail here and now.
                         */
-                       else if (config.c_disable_newu) {
+                       else if (CtdlGetConfigInt("c_disable_newu")) {
                                cprintf("fail\n");
                                syslog(LOG_DEBUG, "Creating user failed due to local policy");
                        }
@@ -1169,7 +1169,7 @@ CTDL_MODULE_INIT(openid_rp)
 // evcurl call this for us. curl_global_init(CURL_GLOBAL_ALL);
 
                /* Only enable the OpenID command set when native mode authentication is in use. */
-               if (config.c_auth_mode == AUTHMODE_NATIVE) {
+               if (CtdlGetConfigInt("c_auth_mode") == AUTHMODE_NATIVE) {
                        CtdlRegisterProtoHook(cmd_oids, "OIDS", "Setup OpenID authentication");
                        CtdlRegisterProtoHook(cmd_oidf, "OIDF", "Finalize OpenID authentication");
                        CtdlRegisterProtoHook(cmd_oidl, "OIDL", "List OpenIDs associated with an account");
index d3e3e0b50efea70002f649b28b3d4fdea1e0ffb5..13230126320254368a75848633b13f2487d1a2a4 100644 (file)
@@ -1,21 +1,15 @@
 /*
  * POP3 service for the Citadel system
  *
- * 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.
  *
  * Current status of standards conformance:
  *
@@ -721,14 +715,14 @@ CTDL_MODULE_INIT(pop3)
        {
                CtdlRegisterDebugFlagHook(HKEY("pop3srv"), SetPOP3DebugEnabled, &POP3DebugEnabled);
 
-               CtdlRegisterServiceHook(config.c_pop3_port,
+               CtdlRegisterServiceHook(CtdlGetConfigInt("c_pop3_port"),
                                        NULL,
                                        pop3_greeting,
                                        pop3_command_loop,
                                        NULL,
                                        CitadelServicePop3);
 #ifdef HAVE_OPENSSL
-               CtdlRegisterServiceHook(config.c_pop3s_port,
+               CtdlRegisterServiceHook(CtdlGetConfigInt("c_pop3s_port"),
                                        NULL,
                                        pop3s_greeting,
                                        pop3_command_loop,
index 950436dd8ed65d5eaa4954b5cdbba915efc9af56..f7587b7f27a9c95c9012fec225f84f59183805ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Consolidate mail from remote POP3 accounts.
  *
- * Copyright (c) 2007-2011 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 as published
  * 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 <stdlib.h>
@@ -572,7 +568,7 @@ eNextState POP3C_ReadMessageBodyFollowing(pop3aggr *RecvMsg)
        if (!POP3C_OK) return eTerminateConnection;
        RecvMsg->IO.ReadMsg = NewAsyncMsg(HKEY("."),
                                          RecvMsg->CurrMsg->MSGSize,
-                                         config.c_maxmsglen,
+                                         CtdlGetConfigLong("c_maxmsglen"),
                                          NULL, -1,
                                          1);
 
@@ -1148,10 +1144,10 @@ void pop3client_scan(void) {
 
        become_session(&pop3_client_CC);
 
-       if (config.c_pop3_fastest < config.c_pop3_fetch)
-               fastest_scan = config.c_pop3_fastest;
+       if (CtdlGetConfigLong("c_pop3_fastest") < CtdlGetConfigLong("c_pop3_fetch"))
+               fastest_scan = CtdlGetConfigLong("c_pop3_fastest");
        else
-               fastest_scan = config.c_pop3_fetch;
+               fastest_scan = CtdlGetConfigLong("c_pop3_fetch");
 
        /*
         * Run POP3 aggregation no more frequently than once every n seconds
@@ -1184,7 +1180,7 @@ void pop3client_scan(void) {
 
 /*
        if ((palist->interval && time(NULL) > (last_run + palist->interval))
-                       || (time(NULL) > last_run + config.c_pop3_fetch))
+                       || (time(NULL) > last_run + CtdlGetConfigLong("c_pop3_fetch")))
                        pop3_do_fetching(palist->roomname, palist->pop3host,
                        palist->pop3user, palist->pop3pass, palist->keep);
                pptr = palist;