cookie_conversion.o locate_host.o floors.o \
webcit.o auth.o tcp_sockets.o mainmenu.o serv_func.o who.o \
roomops.o messages.o userlist.o paging.o sysmsgs.o useredit.o \
- vcard.o vcard_edit.o preferences.o html2html.o \
+ vcard.o vcard_edit.o preferences.o html2html.o listsub.o \
mime_parser.o graphics.o netconf.o siteconfig.o subst.o $(LIBOBJS)
$(CC) webserver.o context_loop.o tools.o cookie_conversion.o \
- webcit.o auth.o tcp_sockets.o mainmenu.o serv_func.o who.o \
+ webcit.o auth.o tcp_sockets.o mainmenu.o serv_func.o who.o listsub.o \
roomops.o messages.o userlist.o paging.o sysmsgs.o useredit.o \
locate_host.o siteconfig.o subst.o vcard.o vcard_edit.o floors.o \
mime_parser.o graphics.o netconf.o preferences.o html2html.o \
}
/* Do the non-root-cookie check now. */
- else if ( (strcmp(buf, "/")) && (got_cookie == 0)) {
+ else if ( (strcmp(buf, "/"))
+ && (strncasecmp(buf, "/listsub", 8))
+ && (got_cookie == 0)) {
strcpy(req->line, "GET /static/nocookies.html"
"?force_close_session=yes HTTP/1.0");
}
pthread_mutex_unlock(&SessionListMutex);
}
-
/*
- *
- * FIX ... check session integrity here before continuing
- *
+ * A future improvement might be to check the session integrity
+ * at this point before continuing.
*/
-
/*
* Bind to the session and perform the transaction
*/
--- /dev/null
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <limits.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <string.h>
+#include <pwd.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <pthread.h>
+#include <signal.h>
+#include "webcit.h"
+
+
+
+/*
+ * List subscription handling
+ */
+void do_listsub(void)
+{
+ char cmd[SIZ];
+ char room[SIZ];
+ char token[SIZ];
+ char email[SIZ];
+ char subtype[SIZ];
+
+ strcpy(WC->wc_username, "");
+ strcpy(WC->wc_password, "");
+ strcpy(WC->wc_roomname, "");
+
+ output_headers(2); /* note "2" causes cookies to be unset */
+
+ strcpy(cmd, bstr("cmd"));
+ strcpy(room, bstr("room"));
+ strcpy(token, bstr("token"));
+ strcpy(email, bstr("email"));
+ strcpy(subtype, bstr("subtype"));
+
+ wprintf("cmd: %s<BR>\n", cmd);
+ wprintf("room: %s<BR>\n", room);
+ wprintf("token: %s<BR>\n", token);
+ wprintf("email: %s<BR>\n", email);
+ wprintf("subtype: %s<BR>\n", subtype);
+
+ /*
+ * Since this isn't part of a normal Citadel session, we bail right
+ * out without maintaining any state.
+ */
+ wDumpContent(2);
+ end_webcit_session();
+}
}
}
+ /*
+ * Functions which can be performed without logging in
+ */
+ if (!strcasecmp(action, "listsub")) {
+ do_listsub();
+ goto SKIP_ALL_THIS_CRAP;
+ }
+
check_for_express_messages();
/*
output_static(buf);
} else if (!strcasecmp(action, "image")) {
output_image();
+
+ /*
+ * All functions handled below this point ... make sure we log in
+ * before doing anything else!
+ */
} else if ((!WC->logged_in) && (!strcasecmp(action, "login"))) {
do_login();
} else if (!WC->logged_in) {
display_login(NULL);
}
- /* Various commands... */
+
+ /*
+ * Various commands...
+ */
else if (!strcasecmp(action, "do_welcome")) {
do_welcome();
void delete_floor(void);
void create_floor(void);
void rename_floor(void);
+void do_listsub(void);