$Log$
+ Revision 601.69 2002/11/21 05:38:13 ajc
+ * Added support for a "New User Greetings" room. See docs/install.txt
+
Revision 601.68 2002/11/15 11:24:40 error
* serv_rwho.c: cmd_rwho(): move logged_in from param 8 to param 11
(see RWHO in techdoc/session.txt)
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
modules/libnetwork.la \
modules/liblistsub.la \
modules/libnetfilter.la \
+ modules/libnewuser.la \
modules/libpas2.la \
modules/libinetcfg.la \
modules/librwho.la \
logging.c messages.c msgbase.c msgform.c serv_spam.c \
policy.c readlog.c migratenet.c screen.c serv_mrtg.c \
room_ops.c rooms.c routines.c routines2.c serv_chat.c serv_crypto.c \
- serv_test.c setup.c snprintf.c stats.c serv_vcard.c \
+ serv_test.c setup.c snprintf.c stats.c serv_vcard.c serv_newuser.c \
support.c sysdep.c tools.c user_ops.c userlist.c serv_expire.c \
whobbs.c sendcommand.c mime_parser.c base64.c getutline.c \
auth.c chkpwd.c html.c vcard.c serv_upgrade.c serv_vandelay.c \
modules/libnetfilter.la: serv_netfilter.lo $(LIBTOOL) libcitserver.la
$(LTSHARE) -o libnetfilter.la ../serv_netfilter.lo ../libcitserver.la
+modules/libnewuser.la: serv_newuser.lo $(LIBTOOL) libcitserver.la
+ $(LTSHARE) -o libnewuser.la ../serv_newuser.lo ../libcitserver.la
+
modules/libupgrade.la: serv_upgrade.lo $(LIBTOOL) libcitserver.la
$(LTSHARE) -o libupgrade.la ../serv_upgrade.lo ../libcitserver.la
(Aide). This overcomes some obvious logistical problems - normally, Aide
access is given by another Aide, but since there aren't any on your system
yet, this isn't possible.
+
+
+ WELCOMING NEW USERS
+
+ Sometimes you might decide that you want a welcome message (or several
+different messages) automatically mailed to new users upon their first login.
+Now there is a way to do this. If you create a room called
+"New User Greetings", and it is a *private* room (invitation-only probably
+makes the most sense), any messages you enter into that room will automatically
+be delivered to all new users upon registration.
+
+ You can put anything you want there: a welcome message, system policies,
+special information, etc. You can also put as many messages there as you
+want to (although it really doesn't make sense to clutter new users' mailboxes
+with lots of junk).
+
+ Don't worry about wasting disk space, either. Citadel has a single-instance
+message store, so all the new users are actually looking at the same copy of
+the message on disk.
+
-
SPACE FOR ADDING YOUR OWN FEATURES (doors)
*** PLEASE TAKE NOTE!! *** This function really represents the "old"
char attendee_string[SIZ];
icalproperty *organizer = NULL;
char organizer_string[SIZ];
+ icalproperty *summary = NULL;
+ char summary_string[SIZ];
icalproperty *me_attend = NULL;
struct recptypes *recp = NULL;
icalparameter *partstat = NULL;
struct recptypes *valid = NULL;
strcpy(organizer_string, "");
+ strcpy(summary_string, "Calendar item");
if (request == NULL) {
lprintf(3, "ERROR: trying to reply to NULL event?\n");
} else {
strcpy(organizer_string, "");
}
+
+ /* Extract the summary string -- we'll use it as the
+ * message subject for the reply
+ */
+ summary = icalcomponent_get_first_property(vevent, ICAL_SUMMARY_PROPERTY);
+ if (summary != NULL) {
+ if (icalproperty_get_summary(summary)) {
+ strcpy(summary_string,
+ icalproperty_get_summary(summary) );
+ }
+ }
+
}
/* Now generate the reply message and send it out. */
msg = CtdlMakeMessage(&CC->usersupp, organizer_string,
CC->quickroom.QRname, 0, FMT_RFC822,
- "", "FIXME subject", reply_message_text);
+ "",
+ summary_string, /* Use summary for subject */
+ reply_message_text);
if (msg != NULL) {
valid = validate_recipients(organizer_string);
--- /dev/null
+/*
+ * $Id$
+ *
+ * A skeleton module to test the dynamic loader.
+ *
+ */
+
+/*
+ * Name of the New User Greetings room.
+ */
+#define NEWUSERGREETINGS "New User Greetings"
+
+
+#include "sysdep.h"
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <pwd.h>
+#include <errno.h>
+#include <sys/types.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#include <sys/wait.h>
+#include <string.h>
+#include <limits.h>
+#include "citadel.h"
+#include "server.h"
+#include "sysdep_decls.h"
+#include "citserver.h"
+#include "support.h"
+#include "config.h"
+#include "dynloader.h"
+#include "room_ops.h"
+#include "user_ops.h"
+#include "policy.h"
+#include "database.h"
+#include "msgbase.h"
+
+extern struct CitContext *ContextList;
+
+
+/*
+ * Copy the contents of the New User Greetings> room to the user's Mail> room.
+ */
+void CopyNewUserGreetings(void) {
+ struct cdbdata *cdbfr;
+ long *msglist = NULL;
+ int num_msgs = 0;
+ int i;
+ char mailboxname[ROOMNAMELEN];
+
+
+ /* Only do this for new users. */
+ if (CC->usersupp.timescalled != 1) return;
+
+ /* This user's mailbox. */
+ MailboxName(mailboxname, sizeof mailboxname, &CC->usersupp, MAILROOM);
+
+ /* Go to the source room ... bail out silently if it's not there,
+ * or if it's not private.
+ */
+ if (getroom(&CC->quickroom, NEWUSERGREETINGS) != 0) return;
+ if (! CC->quickroom.QRflags & QR_PRIVATE ) return;
+
+ cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->quickroom.QRnumber, sizeof(long));
+
+ if (cdbfr != NULL) {
+ msglist = mallok(cdbfr->len);
+ memcpy(msglist, cdbfr->ptr, cdbfr->len);
+ num_msgs = cdbfr->len / sizeof(long);
+ cdb_free(cdbfr);
+ }
+
+ if (num_msgs > 0) {
+ for (i = 0; i < num_msgs; ++i) {
+ CtdlCopyMsgToRoom(msglist[i], mailboxname);
+ }
+ }
+
+ /* Now free the memory we used, and go away. */
+ if (msglist != NULL) phree(msglist);
+}
+
+
+char *Dynamic_Module_Init(void)
+{
+ CtdlRegisterSessionHook(CopyNewUserGreetings, EVT_LOGIN);
+ return "$Id$";
+}
}
lputuser(&CC->usersupp);
- /* Run any startup routines registered by loadable modules */
- PerformSessionHooks(EVT_LOGIN);
-
/* Create any personal rooms required by the system.
* (Technically, MAILROOM should be there already, but just in case...)
*/
create_room(MAILROOM, 4, "", 0, 1, 0);
create_room(SENTITEMS, 4, "", 0, 1, 0);
+ /* Run any startup routines registered by loadable modules */
+ PerformSessionHooks(EVT_LOGIN);
+
/* Enter the lobby */
usergoto(config.c_baseroom, 0, 0, NULL, NULL);