0bf7c13d340d4a3f8527470f887a1076f8f9a0b5
[citadel.git] / citadel / control.c
1 /*
2  * $Id$
3  *
4  * This module handles states which are global to the entire server.
5  *
6  * Copyright (c) 1987-2010 by the citadel.org team
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 3 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #include "sysdep.h"
24 #include <stdlib.h>
25 #include <unistd.h>
26 #include <stdio.h>
27 #include <fcntl.h>
28 #include <signal.h>
29
30 #if TIME_WITH_SYS_TIME
31 # include <sys/time.h>
32 # include <time.h>
33 #else
34 # if HAVE_SYS_TIME_H
35 #  include <sys/time.h>
36 # else
37 #  include <time.h>
38 # endif
39 #endif
40
41 #include <ctype.h>
42 #include <string.h>
43 #include <errno.h>
44 #include <limits.h>
45 #include <sys/types.h>
46 #include <sys/file.h>
47 #include <sys/stat.h>
48 #include <libcitadel.h>
49 #include "citadel.h"
50 #include "server.h"
51 #include "control.h"
52 #include "sysdep_decls.h"
53 #include "support.h"
54 #include "config.h"
55 #include "msgbase.h"
56 #include "citserver.h"
57 #include "room_ops.h"
58 #include "user_ops.h"
59 #include "database.h"
60 #include "threads.h"
61
62 #ifndef HAVE_SNPRINTF
63 #include "snprintf.h"
64 #endif
65
66 #include "ctdl_module.h"
67
68 struct CitControl CitControl;
69 extern struct config config;
70 FILE *control_fp = NULL;
71 long control_highest_user = 0;
72
73
74 /*
75  * lock_control  -  acquire a lock on the control record file.
76  *                  This keeps multiple citservers from running concurrently.
77  */
78 void lock_control(void)
79 {
80 #if defined(LOCK_EX) && defined(LOCK_NB)
81         if (flock(fileno(control_fp), (LOCK_EX | LOCK_NB))) {
82                 CtdlLogPrintf(CTDL_EMERG, "citserver: unable to lock %s.\n", file_citadel_control);
83                 CtdlLogPrintf(CTDL_EMERG, "Is another citserver already running?\n");
84                 exit(CTDLEXIT_CONTROL);
85         }
86 #endif
87 }
88
89 /*
90  * callback to get highest room number when rebuilding control file
91  */
92 void control_find_highest(struct ctdlroom *qrbuf, void *data)
93 {
94         struct ctdlroom room;
95         struct cdbdata *cdbfr;
96         long *msglist;
97         int num_msgs=0;
98         int c;
99         int room_fixed = 0;
100         int message_fixed = 0;
101         
102         if (qrbuf->QRnumber > CitControl.MMnextroom)
103         {
104                 CitControl.MMnextroom = qrbuf->QRnumber;
105                 room_fixed = 1;
106         }
107                 
108         CtdlGetRoom (&room, qrbuf->QRname);
109         
110         /* Load the message list */
111         cdbfr = cdb_fetch(CDB_MSGLISTS, &room.QRnumber, sizeof(long));
112         if (cdbfr != NULL) {
113                 msglist = (long *) cdbfr->ptr;
114                 num_msgs = cdbfr->len / sizeof(long);
115         } else {
116                 return; /* No messages at all?  No further action. */
117         }
118
119         if (num_msgs>0)
120         {
121                 for (c=0; c<num_msgs; c++)
122                 {
123                         if (msglist[c] > CitControl.MMhighest)
124                         {
125                                 CitControl.MMhighest = msglist[c];
126                                 message_fixed = 1;
127                         }
128                 }
129         }
130         cdb_free(cdbfr);
131         if (room_fixed)
132                 CtdlLogPrintf(CTDL_INFO, "Control record checking....Fixed room counter\n");
133         if (message_fixed)
134                 CtdlLogPrintf(CTDL_INFO, "Control record checking....Fixed message count\n");
135         return;
136 }
137
138
139 /*
140  * Callback to get highest user number.
141  */
142  
143 void control_find_user (struct ctdluser *EachUser, void *out_data)
144 {
145         int user_fixed = 0;
146         
147         if (EachUser->usernum > CitControl.MMnextuser)
148         {
149                 CitControl.MMnextuser = EachUser->usernum;
150                 user_fixed = 1;
151         }
152         if(user_fixed)
153                 CtdlLogPrintf(CTDL_INFO, "Control record checking....Fixed user count\n");
154 }
155
156
157 /*
158  * get_control  -  read the control record into memory.
159  */
160 void get_control(void)
161 {
162         static int already_have_control = 0;
163         int rv = 0;
164
165         /*
166          * If we already have the control record in memory, there's no point
167          * in reading it from disk again.
168          */
169         if (already_have_control) return;
170
171         /* Zero it out.  If the control record on disk is missing or short,
172          * the system functions with all control record fields initialized
173          * to zero.
174          */
175         memset(&CitControl, 0, sizeof(struct CitControl));
176         if (control_fp == NULL) {
177                 control_fp = fopen(file_citadel_control, "rb+");
178                 if (control_fp != NULL) {
179                         lock_control();
180                         rv = fchown(fileno(control_fp), config.c_ctdluid, -1);
181                         rv = fchmod(fileno(control_fp), S_IRUSR|S_IWUSR);
182                 }
183         }
184         if (control_fp == NULL) {
185                 control_fp = fopen(file_citadel_control, "wb+");
186                 if (control_fp != NULL) {
187                         lock_control();
188                         rv = fchown(fileno(control_fp), config.c_ctdluid, -1);
189                         rv = fchmod(fileno(control_fp), S_IRUSR|S_IWUSR);
190                         memset(&CitControl, 0, sizeof(struct CitControl));
191                         rv = fwrite(&CitControl, sizeof(struct CitControl), 1, control_fp);
192                         rewind(control_fp);
193                 }
194         }
195         if (control_fp == NULL) {
196                 CtdlLogPrintf(CTDL_ALERT, "ERROR opening %s: %s\n", file_citadel_control, strerror(errno));
197                 return;
198         }
199
200         rewind(control_fp);
201         rv = fread(&CitControl, sizeof(struct CitControl), 1, control_fp);
202         already_have_control = 1;
203         rv = chown(file_citadel_control, config.c_ctdluid, (-1));
204         
205 }
206
207 /*
208  * put_control  -  write the control record to disk.
209  */
210 void put_control(void)
211 {
212         int rv = 0;
213
214         if (control_fp != NULL) {
215                 rewind(control_fp);
216                 rv = fwrite(&CitControl, sizeof(struct CitControl), 1, control_fp);
217                 fflush(control_fp);
218         }
219 }
220
221
222 /*
223  * check_control   -  check the control record has sensible values for message, user and room numbers
224  */
225 void check_control(void)
226 {
227         CtdlLogPrintf(CTDL_INFO, "Checking/re-building control record\n");
228         get_control();
229         // Find highest room number and message number.
230         CtdlForEachRoom(control_find_highest, NULL);
231         ForEachUser(control_find_user, NULL);
232         put_control();
233 }
234
235
236 /*
237  * release_control - close our fd on exit
238  */
239 void release_control(void)
240 {
241         if (control_fp != NULL) {
242                 fclose(control_fp);
243         }
244         control_fp = NULL;
245 }
246
247 /*
248  * get_new_message_number()  -  Obtain a new, unique ID to be used for a message.
249  */
250 long get_new_message_number(void)
251 {
252         long retval = 0L;
253         begin_critical_section(S_CONTROL);
254         get_control();
255         retval = ++CitControl.MMhighest;
256         put_control();
257         end_critical_section(S_CONTROL);
258         return(retval);
259 }
260
261
262 /*
263  * CtdlGetCurrentMessageNumber()  -  Obtain the current highest message number in the system
264  * This provides a quick way to initialise a variable that might be used to indicate
265  * messages that should not be processed. EG. a new Sieve script will use this
266  * to record determine that messages older than this should not be processed.
267  */
268 long CtdlGetCurrentMessageNumber(void)
269 {
270         long retval = 0L;
271         begin_critical_section(S_CONTROL);
272         get_control();
273         retval = CitControl.MMhighest;
274         end_critical_section(S_CONTROL);
275         return(retval);
276 }
277
278
279 /*
280  * get_new_user_number()  -  Obtain a new, unique ID to be used for a user.
281  */
282 long get_new_user_number(void)
283 {
284         long retval = 0L;
285         begin_critical_section(S_CONTROL);
286         get_control();
287         retval = ++CitControl.MMnextuser;
288         put_control();
289         end_critical_section(S_CONTROL);
290         return(retval);
291 }
292
293
294
295 /*
296  * get_new_room_number()  -  Obtain a new, unique ID to be used for a room.
297  */
298 long get_new_room_number(void)
299 {
300         long retval = 0L;
301         begin_critical_section(S_CONTROL);
302         get_control();
303         retval = ++CitControl.MMnextroom;
304         put_control();
305         end_critical_section(S_CONTROL);
306         return(retval);
307 }
308
309
310
311 /* 
312  * Get or set global configuration options
313  */
314 void cmd_conf(char *argbuf)
315 {
316         char cmd[16];
317         char buf[256];
318         int a;
319         char *confptr;
320         char confname[128];
321
322         if (CtdlAccessCheck(ac_aide)) return;
323
324         extract_token(cmd, argbuf, 0, '|', sizeof cmd);
325         if (!strcasecmp(cmd, "GET")) {
326                 cprintf("%d Configuration...\n", LISTING_FOLLOWS);
327                 cprintf("%s\n", config.c_nodename);
328                 cprintf("%s\n", config.c_fqdn);
329                 cprintf("%s\n", config.c_humannode);
330                 cprintf("%s\n", config.c_phonenum);
331                 cprintf("%d\n", config.c_creataide);
332                 cprintf("%d\n", config.c_sleeping);
333                 cprintf("%d\n", config.c_initax);
334                 cprintf("%d\n", config.c_regiscall);
335                 cprintf("%d\n", config.c_twitdetect);
336                 cprintf("%s\n", config.c_twitroom);
337                 cprintf("%s\n", config.c_moreprompt);
338                 cprintf("%d\n", config.c_restrict);
339                 cprintf("%s\n", config.c_site_location);
340                 cprintf("%s\n", config.c_sysadm);
341                 cprintf("%d\n", config.c_maxsessions);
342                 cprintf("xxx\n"); /* placeholder -- field no longer in use */
343                 cprintf("%d\n", config.c_userpurge);
344                 cprintf("%d\n", config.c_roompurge);
345                 cprintf("%s\n", config.c_logpages);
346                 cprintf("%d\n", config.c_createax);
347                 cprintf("%ld\n", config.c_maxmsglen);
348                 cprintf("%d\n", config.c_min_workers);
349                 cprintf("%d\n", config.c_max_workers);
350                 cprintf("%d\n", config.c_pop3_port);
351                 cprintf("%d\n", config.c_smtp_port);
352                 cprintf("%d\n", config.c_rfc822_strict_from);
353                 cprintf("%d\n", config.c_aide_zap);
354                 cprintf("%d\n", config.c_imap_port);
355                 cprintf("%ld\n", config.c_net_freq);
356                 cprintf("%d\n", config.c_disable_newu);
357                 cprintf("1\n"); /* niu */
358                 cprintf("%d\n", config.c_purge_hour);
359 #ifdef HAVE_LDAP
360                 cprintf("%s\n", config.c_ldap_host);
361                 cprintf("%d\n", config.c_ldap_port);
362                 cprintf("%s\n", config.c_ldap_base_dn);
363                 cprintf("%s\n", config.c_ldap_bind_dn);
364                 cprintf("%s\n", config.c_ldap_bind_pw);
365 #else
366                 cprintf("\n");
367                 cprintf("0\n");
368                 cprintf("\n");
369                 cprintf("\n");
370                 cprintf("\n");
371 #endif
372                 cprintf("%s\n", config.c_ip_addr);
373                 cprintf("%d\n", config.c_msa_port);
374                 cprintf("%d\n", config.c_imaps_port);
375                 cprintf("%d\n", config.c_pop3s_port);
376                 cprintf("%d\n", config.c_smtps_port);
377                 cprintf("%d\n", config.c_enable_fulltext);
378                 cprintf("%d\n", config.c_auto_cull);
379                 cprintf("%d\n", config.c_instant_expunge);
380                 cprintf("%d\n", config.c_allow_spoofing);
381                 cprintf("%d\n", config.c_journal_email);
382                 cprintf("%d\n", config.c_journal_pubmsgs);
383                 cprintf("%s\n", config.c_journal_dest);
384                 cprintf("%s\n", config.c_default_cal_zone);
385                 cprintf("%d\n", config.c_pftcpdict_port);
386                 cprintf("%d\n", config.c_managesieve_port);
387                 cprintf("%d\n", config.c_auth_mode);
388                 cprintf("%s\n", config.c_funambol_host);
389                 cprintf("%d\n", config.c_funambol_port);
390                 cprintf("%s\n", config.c_funambol_source);
391                 cprintf("%s\n", config.c_funambol_auth);
392                 cprintf("%d\n", config.c_rbl_at_greeting);
393                 cprintf("%s\n", config.c_master_user);
394                 cprintf("%s\n", config.c_master_pass);
395                 cprintf("%s\n", config.c_pager_program);
396                 cprintf("%d\n", config.c_imap_keep_from);
397                 cprintf("%d\n", config.c_xmpp_c2s_port);
398                 cprintf("%d\n", config.c_xmpp_s2s_port);
399                 cprintf("%ld\n", config.c_pop3_fetch);
400                 cprintf("%ld\n", config.c_pop3_fastest);
401                 cprintf("%d\n", config.c_spam_flag_only);
402                 cprintf("000\n");
403         }
404
405         else if (!strcasecmp(cmd, "SET")) {
406                 unbuffer_output();
407                 cprintf("%d Send configuration...\n", SEND_LISTING);
408                 a = 0;
409                 while (client_getln(buf, sizeof buf) >= 0 && strcmp(buf, "000")) {
410                         switch (a) {
411                         case 0:
412                                 safestrncpy(config.c_nodename, buf,
413                                             sizeof config.c_nodename);
414                                 break;
415                         case 1:
416                                 safestrncpy(config.c_fqdn, buf,
417                                             sizeof config.c_fqdn);
418                                 break;
419                         case 2:
420                                 safestrncpy(config.c_humannode, buf,
421                                             sizeof config.c_humannode);
422                                 break;
423                         case 3:
424                                 safestrncpy(config.c_phonenum, buf,
425                                             sizeof config.c_phonenum);
426                                 break;
427                         case 4:
428                                 config.c_creataide = atoi(buf);
429                                 break;
430                         case 5:
431                                 config.c_sleeping = atoi(buf);
432                                 break;
433                         case 6:
434                                 config.c_initax = atoi(buf);
435                                 if (config.c_initax < 1)
436                                         config.c_initax = 1;
437                                 if (config.c_initax > 6)
438                                         config.c_initax = 6;
439                                 break;
440                         case 7:
441                                 config.c_regiscall = atoi(buf);
442                                 if (config.c_regiscall != 0)
443                                         config.c_regiscall = 1;
444                                 break;
445                         case 8:
446                                 config.c_twitdetect = atoi(buf);
447                                 if (config.c_twitdetect != 0)
448                                         config.c_twitdetect = 1;
449                                 break;
450                         case 9:
451                                 safestrncpy(config.c_twitroom, buf,
452                                             sizeof config.c_twitroom);
453                                 break;
454                         case 10:
455                                 safestrncpy(config.c_moreprompt, buf,
456                                             sizeof config.c_moreprompt);
457                                 break;
458                         case 11:
459                                 config.c_restrict = atoi(buf);
460                                 if (config.c_restrict != 0)
461                                         config.c_restrict = 1;
462                                 break;
463                         case 12:
464                                 safestrncpy(config.c_site_location, buf,
465                                             sizeof config.c_site_location);
466                                 break;
467                         case 13:
468                                 safestrncpy(config.c_sysadm, buf,
469                                             sizeof config.c_sysadm);
470                                 break;
471                         case 14:
472                                 config.c_maxsessions = atoi(buf);
473                                 if (config.c_maxsessions < 0)
474                                         config.c_maxsessions = 0;
475                                 break;
476                         case 15:
477                                 /* placeholder -- field no longer in use */
478                                 break;
479                         case 16:
480                                 config.c_userpurge = atoi(buf);
481                                 break;
482                         case 17:
483                                 config.c_roompurge = atoi(buf);
484                                 break;
485                         case 18:
486                                 safestrncpy(config.c_logpages, buf,
487                                             sizeof config.c_logpages);
488                                 break;
489                         case 19:
490                                 config.c_createax = atoi(buf);
491                                 if (config.c_createax < 1)
492                                         config.c_createax = 1;
493                                 if (config.c_createax > 6)
494                                         config.c_createax = 6;
495                                 break;
496                         case 20:
497                                 if (atoi(buf) >= 8192)
498                                         config.c_maxmsglen = atoi(buf);
499                                 break;
500                         case 21:
501                                 if (atoi(buf) >= 2)
502                                         config.c_min_workers = atoi(buf);
503                         case 22:
504                                 if (atoi(buf) >= config.c_min_workers)
505                                         config.c_max_workers = atoi(buf);
506                         case 23:
507                                 config.c_pop3_port = atoi(buf);
508                                 break;
509                         case 24:
510                                 config.c_smtp_port = atoi(buf);
511                                 break;
512                         case 25:
513                                 config.c_rfc822_strict_from = atoi(buf);
514                                 break;
515                         case 26:
516                                 config.c_aide_zap = atoi(buf);
517                                 if (config.c_aide_zap != 0)
518                                         config.c_aide_zap = 1;
519                                 break;
520                         case 27:
521                                 config.c_imap_port = atoi(buf);
522                                 break;
523                         case 28:
524                                 config.c_net_freq = atol(buf);
525                                 break;
526                         case 29:
527                                 config.c_disable_newu = atoi(buf);
528                                 if (config.c_disable_newu != 0)
529                                         config.c_disable_newu = 1;
530                                 break;
531                         case 30:
532                                 /* niu */
533                                 break;
534                         case 31:
535                                 if ((config.c_purge_hour >= 0)
536                                    && (config.c_purge_hour <= 23)) {
537                                         config.c_purge_hour = atoi(buf);
538                                 }
539                                 break;
540 #ifdef HAVE_LDAP
541                         case 32:
542                                 safestrncpy(config.c_ldap_host, buf,
543                                             sizeof config.c_ldap_host);
544                                 break;
545                         case 33:
546                                 config.c_ldap_port = atoi(buf);
547                                 break;
548                         case 34:
549                                 safestrncpy(config.c_ldap_base_dn, buf,
550                                             sizeof config.c_ldap_base_dn);
551                                 break;
552                         case 35:
553                                 safestrncpy(config.c_ldap_bind_dn, buf,
554                                             sizeof config.c_ldap_bind_dn);
555                                 break;
556                         case 36:
557                                 safestrncpy(config.c_ldap_bind_pw, buf,
558                                             sizeof config.c_ldap_bind_pw);
559                                 break;
560 #endif
561                         case 37:
562                                 safestrncpy(config.c_ip_addr, buf,
563                                                 sizeof config.c_ip_addr);
564                         case 38:
565                                 config.c_msa_port = atoi(buf);
566                                 break;
567                         case 39:
568                                 config.c_imaps_port = atoi(buf);
569                                 break;
570                         case 40:
571                                 config.c_pop3s_port = atoi(buf);
572                                 break;
573                         case 41:
574                                 config.c_smtps_port = atoi(buf);
575                                 break;
576                         case 42:
577                                 config.c_enable_fulltext = atoi(buf);
578                                 break;
579                         case 43:
580                                 config.c_auto_cull = atoi(buf);
581                                 break;
582                         case 44:
583                                 config.c_instant_expunge = atoi(buf);
584                                 break;
585                         case 45:
586                                 config.c_allow_spoofing = atoi(buf);
587                                 break;
588                         case 46:
589                                 config.c_journal_email = atoi(buf);
590                                 break;
591                         case 47:
592                                 config.c_journal_pubmsgs = atoi(buf);
593                                 break;
594                         case 48:
595                                 safestrncpy(config.c_journal_dest, buf,
596                                                 sizeof config.c_journal_dest);
597                         case 49:
598                                 safestrncpy(config.c_default_cal_zone, buf,
599                                                 sizeof config.c_default_cal_zone);
600                                 break;
601                         case 50:
602                                 config.c_pftcpdict_port = atoi(buf);
603                                 break;
604                         case 51:
605                                 config.c_managesieve_port = atoi(buf);
606                                 break;
607                         case 52:
608                                 config.c_auth_mode = atoi(buf);
609                         case 53:
610                                 safestrncpy(config.c_funambol_host, buf,
611                                         sizeof config.c_funambol_host);
612                                 break;
613                         case 54:
614                                 config.c_funambol_port = atoi(buf);
615                                 break;
616                         case 55:
617                                 safestrncpy(config.c_funambol_source,
618                                         buf, 
619                                         sizeof config.c_funambol_source);
620                                 break;
621                         case 56:
622                                 safestrncpy(config.c_funambol_auth,
623                                         buf,
624                                         sizeof config.c_funambol_auth);
625                                 break;
626                         case 57:
627                                 config.c_rbl_at_greeting = atoi(buf);
628                                 break;
629                         case 58:
630                                 safestrncpy(config.c_master_user, buf, sizeof config.c_master_user);
631                                 break;
632                         case 59:
633                                 safestrncpy(config.c_master_pass, buf, sizeof config.c_master_pass);
634                                 break;
635                         case 60:
636                                 safestrncpy(config.c_pager_program,
637                                         buf,
638                                         sizeof config.c_pager_program);
639                                 break;
640                         case 61:
641                                 config.c_imap_keep_from = atoi(buf);
642                                 break;
643                         case 62:
644                                 config.c_xmpp_c2s_port = atoi(buf);
645                                 break;
646                         case 63:
647                                 config.c_xmpp_s2s_port = atoi(buf);
648                                 break;
649                         case 64:
650                                 config.c_pop3_fetch = atol(buf);
651                                 break;
652                         case 65:
653                                 config.c_pop3_fastest = atol(buf);
654                                 break;
655                         case 66:
656                                 config.c_spam_flag_only = atoi(buf);
657                                 break;
658                         }
659                         ++a;
660                 }
661                 put_config();
662                 snprintf(buf, sizeof buf,
663                          "The global system configuration has been edited by %s.\n",
664                          CC->curr_user);
665                 CtdlAideMessage(buf,"Citadel Configuration Manager Message");
666
667                 if (!IsEmptyStr(config.c_logpages))
668                         CtdlCreateRoom(config.c_logpages, 3, "", 0, 1, 1, VIEW_BBS);
669
670                 /* If full text indexing has been disabled, invalidate the
671                  * index so it doesn't try to use it later.
672                  */
673                 if (config.c_enable_fulltext == 0) {
674                         CitControl.fulltext_wordbreaker = 0;
675                         put_control();
676                 }
677         }
678
679         else if (!strcasecmp(cmd, "GETSYS")) {
680                 extract_token(confname, argbuf, 1, '|', sizeof confname);
681                 confptr = CtdlGetSysConfig(confname);
682                 if (confptr != NULL) {
683                         cprintf("%d %s\n", LISTING_FOLLOWS, confname);
684                         client_write(confptr, strlen(confptr));
685                         if (confptr[strlen(confptr) - 1] != 10)
686                                 client_write("\n", 1);
687                         cprintf("000\n");
688                         free(confptr);
689                 } else {
690                         cprintf("%d No such configuration.\n",
691                                 ERROR + ILLEGAL_VALUE);
692                 }
693         }
694
695         else if (!strcasecmp(cmd, "PUTSYS")) {
696                 extract_token(confname, argbuf, 1, '|', sizeof confname);
697                 unbuffer_output();
698                 cprintf("%d %s\n", SEND_LISTING, confname);
699                 confptr = CtdlReadMessageBody(HKEY("000"), config.c_maxmsglen, NULL, 0, 0);
700                 CtdlPutSysConfig(confname, confptr);
701                 free(confptr);
702         }
703
704         else {
705                 cprintf("%d Illegal option(s) specified.\n",
706                         ERROR + ILLEGAL_VALUE);
707         }
708 }
709
710
711 /*****************************************************************************/
712 /*                      MODULE INITIALIZATION STUFF                          */
713 /*****************************************************************************/
714
715
716 CTDL_MODULE_INIT(control)
717 {
718         if (!threading) {
719                 CtdlRegisterProtoHook(cmd_conf, "CONF", "get/set system configuration");
720         }
721         /* return our Subversion id for the Log */
722         return "$Id$";
723 }