]> code.citadel.org Git - citadel.git/blob - webcit/groupdav_main.c
* Began laying the groundwork for http-authenticated GroupDAV sessions.
[citadel.git] / webcit / groupdav_main.c
1 /*
2  * $Id$
3  *
4  * Entry point for GroupDAV functions
5  *
6  */
7
8 #include <ctype.h>
9 #include <stdlib.h>
10 #include <unistd.h>
11 #include <stdio.h>
12 #include <fcntl.h>
13 #include <signal.h>
14 #include <sys/types.h>
15 #include <sys/wait.h>
16 #include <sys/socket.h>
17 #include <limits.h>
18 #include <string.h>
19 #include <pwd.h>
20 #include <errno.h>
21 #include <stdarg.h>
22 #include <time.h>
23 #include "webcit.h"
24 #include "webserver.h"
25
26 void groupdav_main(char *cmd) {
27
28         if (!WC->logged_in) {
29                 wprintf(
30                         "HTTP/1.1 401 Authorization Required\n"
31                         "WWW-Authenticate: Basic realm=\"GroupDAV\"\n"
32                         "Connection: close\n"
33                 );
34                 output_headers(0, 0, 0, 0, 0, 0, 0);
35                 wprintf("Content-Type: text/plain\n");
36                 wprintf("\n");
37                 wprintf("GroupDAV sessions require HTTP authentication.\n");
38                 wDumpContent(0);
39         }
40
41         output_static("smiley.gif");    /* FIXME */
42 }