1 // Main Citadel header file
3 // Copyright (c) 1987-2021 by the citadel.org team
5 // This program is open source software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License version 3.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
13 /* system customizations are in sysconfig.h */
17 /* #include <dmalloc.h> uncomment if using dmalloc */
21 #include "sysconfig.h"
30 * Text description of this software
31 * (We used to define this ourselves, but why bother when the build tools do it for us?)
33 #define CITADEL PACKAGE_STRING
35 #define REV_LEVEL 940 // This version
36 #define REV_MIN 591 // Oldest compatible database
37 #define EXPORT_REV_MIN 931 // Oldest compatible export files
38 #define LIBCITADEL_MIN 931 // Minimum required version of libcitadel
39 #define SERVER_TYPE 0 // zero for stock Citadel; other developers please obtain SERVER_TYPE codes for your implementations
41 #ifdef LIBCITADEL_VERSION_NUMBER
42 #if LIBCITADEL_VERSION_NUMBER < LIBCITADEL_MIN
43 #error libcitadel is too old. Please upgrade it before continuing.
48 * This is the user name and password for the default administrator account
49 * that is created when Citadel Server is started with an empty database.
51 #define DEFAULT_ADMIN_USERNAME "admin"
52 #define DEFAULT_ADMIN_PASSWORD "citadel"
54 /* Various length constants */
56 #define ROOMNAMELEN 128 /* The size of a roomname string */
57 #define USERNAME_SIZE 64 /* The size of a username string */
58 #define MAX_EDITORS 5 /* number of external editors supported ; must be at least 1 */
61 * Message expiration policy stuff
63 typedef struct ExpirePolicy ExpirePolicy;
69 #define EXPIRE_NEXTLEVEL 0 // Inherit expiration policy
70 #define EXPIRE_MANUAL 1 // Don't expire messages at all
71 #define EXPIRE_NUMMSGS 2 // Keep only latest n messages
72 #define EXPIRE_AGE 3 // Expire messages after n days
78 typedef struct ctdluser ctdluser;
79 struct ctdluser { // User record
80 int version; // Citadel version which created this record
81 uid_t uid; // Associate with a unix account?
82 char password[32]; // password
83 unsigned flags; // See US_ flags below
84 long timescalled; // Total number of logins
85 long posted; // Number of messages ever submitted
86 cit_uint8_t axlevel; // Access level
87 long usernum; // User number (never recycled)
88 time_t lastcall; // Date/time of most recent login
89 int USuserpurge; // Purge time (in days) for user
90 char fullname[64]; // Display name (primary identifier)
91 long msgnum_bio; // msgnum of user's profile (bio)
92 long msgnum_pic; // msgnum of user's avatar (photo)
93 char emailaddrs[512]; // Internet email addresses
94 long msgnum_inboxrules; // msgnum of user's inbox filtering rules
95 long lastproc_inboxrules; // msgnum of last message filtered
99 /* Bits which may appear in MMflags.
101 #define MM_VALID 4 // New users need validating
106 typedef struct ctdlroom ctdlroom;
108 char QRname[ROOMNAMELEN]; // Name of room
109 char QRpasswd[10]; // Only valid if it's a private rm
110 long QRroomaide; // User number of room aide
111 long QRhighest; // Highest message NUMBER in room
112 time_t QRgen; // Generation number of room
113 unsigned QRflags; // See flag values below
114 char QRdirname[15]; // Directory name, if applicable
115 long msgnum_info; // msgnum of room banner (info file)
116 char QRfloor; // Which floor this room is on
117 time_t QRmtime; // Date/time of last post
118 struct ExpirePolicy QRep; // Message expiration policy
119 long QRnumber; // Globally unique room number
120 char QRorder; // Sort key for room listing order
121 unsigned QRflags2; // Additional flags
122 int QRdefaultview; // How to display the contents
123 long msgnum_pic; // msgnum of room picture or icon
126 /* Private rooms are always flagged with QR_PRIVATE. If neither QR_PASSWORDED
127 * or QR_GUESSNAME is set, then it is invitation-only. Passworded rooms are
128 * flagged with both QR_PRIVATE and QR_PASSWORDED while guess-name rooms are
129 * flagged with both QR_PRIVATE and QR_GUESSNAME. NEVER set all three flags.
135 #define MES_NORMAL 65 // Normal message
136 #define MES_ANONONLY 66 // "****" header
137 #define MES_ANONOPT 67 // "Anonymous" header
139 /****************************************************************************/
142 * Floor record. The floor number is implicit in its location in the file.
144 typedef struct floor floor;
146 unsigned short f_flags; // flags
147 char f_name[256]; // name of floor
148 int f_ref_count; // reference count
149 struct ExpirePolicy f_ep; // default expiration policy
152 #define F_INUSE 1 // floor is in use
156 * Values used internally for function call returns, etc.
158 #define NEWREGISTER 0 // new user to register
159 #define REREGISTER 1 // existing user reregistering
161 /* number of items which may be handled by the CONF command */
162 #define NUM_CONFIGS 71
164 #define TRACE syslog(LOG_DEBUG, "\033[7m Checkpoint: %s : %d \033[0m", __FILE__, __LINE__)
167 #define LONG_MAX 2147483647L
171 * Authentication modes
173 #define AUTHMODE_NATIVE 0 // Native (self-contained or "black box")
174 #define AUTHMODE_HOST 1 // Authenticate against the host OS user database
175 #define AUTHMODE_LDAP 2 // Authenticate using LDAP server with RFC 2307 schema
176 #define AUTHMODE_LDAP_AD 3 // Authenticate using LDAP server with Active Directory schema
183 #pragma GCC diagnostic push
184 #pragma GCC diagnostic ignored "-Wformat-truncation"
187 #endif /* CITADEL_H */