graphics.o netconf.o siteconfig.o subst.o bbsview_renderer.o \
calendar.o calendar_tools.o calendar_view.o tasks.o event.o smtpqueue.o \
availability.o iconbar.o crypto.o inetconf.o notes.o wiki.o \
- dav_main.o dav_get.o dav_propfind.o fmt_date.o \
+ dav_main.o dav_get.o dav_propfind.o dav_report.o fmt_date.o \
dav_options.o autocompletion.o gettext.o tabs.o sieve.o sitemap.o \
dav_delete.o dav_put.o http_datestring.o setup_wizard.o \
downloads.o addressbook_popup.o pushemail.o sysdep.o openid.o \
graphics.o netconf.o preferences.o html2html.o openid.o bbsview_renderer.o \
summary.o calendar.o calendar_tools.o calendar_view.o tasks.o event.o wiki.o \
availability.o ical_dezonify.o iconbar.o crypto.o inetconf.o notes.o \
- dav_main.o dav_get.o dav_propfind.o dav_delete.o \
+ dav_main.o dav_get.o dav_propfind.o dav_report.o dav_delete.o \
dav_options.o autocompletion.o tabs.o smtpqueue.o sieve.o sitemap.o \
dav_put.o http_datestring.o setup_wizard.o fmt_date.o modules_init.o \
gettext.o downloads.o addressbook_popup.o pushemail.o sysdep.o decode.o \
"DELETE",
"HEAD",
"MOVE",
- "COPY"
+ "COPY",
+ "REPORT"
};
void
v = malloc(sizeof(long));
*v = eCOPY;
Put(HttpReqTypes, HKEY("COPY"), v, NULL);
+
+ v = malloc(sizeof(long));
+ *v = eREPORT;
+ Put(HttpReqTypes, HKEY("REPORT"), v, NULL);
}
void
void dav_delete(void);
void dav_propfind(void);
void dav_options(void);
+void dav_report(void);
long locate_message_by_uid(const char *);
void dav_folder_list(void);
case eDELETE:
dav_delete();
break;
- default:
+ /*
+ * The REPORT method tells us that Mike Shaver is a self-righteous asshole.
+ */
+ case eREPORT:
+ dav_report();
+ break;
+
+ default:
/*
* Couldn't find what we were looking for. Die in a car fire.
*/
/*
* Handles DAV OPTIONS requests (experimental -- not required by GroupDAV)
*
- * Copyright (c) 2005-2010 by the citadel.org team
+ * Copyright (c) 2005-2012 by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* We got to this point, which means that the client is requesting
* an OPTIONS on the room itself.
*/
- syslog(LOG_DEBUG, "\033[36mOPTIONS requested for room\033[0m");
+ syslog(LOG_DEBUG, "\033[36mOPTIONS requested for room '%s' (%slogged in)\033[0m",
+ ChrPtr(WC->CurRoom.name),
+ ((WC->logged_in) ? "" : "not ")
+ );
hprintf("HTTP/1.1 200 OK\r\n");
dav_common_headers();
hprintf("Date: %s\r\n", datestring);
*/
if ( (WC->CurRoom.view == VIEW_CALENDAR) || (WC->CurRoom.view == VIEW_CALBRIEF) ) {
hprintf("DAV: 1, calendar-access\r\n");
+ syslog(LOG_DEBUG, "\033[36mDAV: 1, calendar-access\033[0m");
}
else {
hprintf("DAV: 1\r\n");
+ syslog(LOG_DEBUG, "\033[36mDAV: 1\033[0m");
}
- hprintf("Allow: OPTIONS, PROPFIND, GET, PUT\r\n");
+ hprintf("Allow: OPTIONS, PROPFIND, GET, PUT, REPORT\r\n");
begin_burst();
- wc_printf("\r\n");
end_burst();
}
--- /dev/null
+/*
+ * Handles GroupDAV REPORT requests.
+ *
+ * Copyright (c) 2005-2012 by the citadel.org team
+ *
+ * This program is open source software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+
+/* SAMPLE QUERIES TO WORK WITH *
+
+REPORT /groupdav/calendar/ HTTP/1.1
+Content-type: application/xml
+Content-length: 349
+
+<C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV:">
+ <D:prop>
+ <D:getetag/>
+ </D:prop>
+ <C:filter>
+ <C:comp-filter name="VCALENDAR">
+ <C:comp-filter name="VEVENT">
+ <C:time-range start="20111129T231445Z" end="20120207T231445Z"/>
+ </C:comp-filter>
+ </C:comp-filter>
+ </C:filter>
+</C:calendar-query>
+
+
+REPORT /groupdav/calendar/ HTTP/1.1
+Content-type: application/xml
+Content-length: 255
+
+<C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV:">
+ <D:prop>
+ <D:getetag/>
+ </D:prop>
+ <C:filter>
+ <C:comp-filter name="VCALENDAR">
+ <C:comp-filter name="VEVENT"/>
+ </C:comp-filter>
+ </C:filter>
+</C:calendar-query>
+
+*/
+
+#include "webcit.h"
+#include "webserver.h"
+#include "dav.h"
+
+
+/*
+ * The pathname is always going to be /groupdav/room_name/msg_num
+ */
+void dav_report(void)
+{
+ char datestring[256];
+ time_t now = time(NULL);
+
+ http_datestring(datestring, sizeof datestring, now);
+ const char *req = ChrPtr(WC->upload);
+
+ syslog(LOG_DEBUG, "REPORT: \033[31m%s\033[0m", req);
+
+ hprintf("HTTP/1.1 500 Internal Server Error\r\n");
+ dav_common_headers();
+ hprintf("Date: %s\r\n", datestring);
+ hprintf("Content-Type: text/plain\r\n");
+ wc_printf("An internal error has occurred at %s:%d.\r\n", __FILE__ , __LINE__ );
+ end_burst();
+ return;
+}
+
+
+
+extern int ParseMessageListHeaders_EUID(StrBuf *Line,
+ const char **pos,
+ message_summary *Msg,
+ StrBuf *ConversionBuffer);
+
+extern int DavUIDL_GetParamsGetServerCall(SharedMessageStatus *Stat,
+ void **ViewSpecific,
+ long oper,
+ char *cmd,
+ long len);
+
+extern int DavUIDL_RenderView_or_Tail(SharedMessageStatus *Stat,
+ void **ViewSpecific,
+ long oper);
+
+extern int DavUIDL_Cleanup(void **ViewSpecific);
+
+
+
+void
+InitModule_REPORT
+(void)
+{
+ RegisterReadLoopHandlerset(
+ eReadEUIDS,
+ DavUIDL_GetParamsGetServerCall,
+ NULL,
+ ParseMessageListHeaders_EUID,
+ NULL,
+ DavUIDL_RenderView_or_Tail,
+ DavUIDL_Cleanup
+ );
+
+}
char nnn[64];
char buf[SIZ];
int nUsed;
- long len;
NodeConf *Node;
serv_puts("CONF getsys|application/x-citadel-ignet-config");
Hash = NewHash(1, NULL);
Buf = NewStrBuf();
- while (len = StrBuf_ServGetln(Buf), strcmp(ChrPtr(Buf), "000")) {
+ while (StrBuf_ServGetln(Buf), strcmp(ChrPtr(Buf), "000")) {
Node = NewNode(Buf);
if (Node != NULL) {
nUsed = GetCount(Hash);
char levels[SIZ];
char state[SIZ];
char prog[SIZ];
- int rv;
inittab = strdup("");
if (inittab == NULL) return;
fclose(fp);
fp = fopen("/etc/inittab", "w");
if (fp != NULL) {
- rv = fwrite(inittab, strlen(inittab), 1, fp);
+ fwrite(inittab, strlen(inittab), 1, fp);
fclose(fp);
kill(1, SIGHUP); /* Tell init to re-read /etc/inittab */
}
char dialog_result[PATH_MAX];
char setupmsg[SIZ];
FILE *fp;
- int rv;
strcpy(setupmsg, "");
prompt,
str,
dialog_result);
- rv = system(buf);
+ system(buf);
fp = fopen(dialog_result, "r");
if (fp != NULL) {
if (fgets(str, sizeof buf, fp)){
FILE *fp;
int i = 0;
int offs = 0;
- int rv;
-
nLocales = 0;
while (!IsEmptyStr(AvailLang[nLocales]))
ChrPtr(Buf),
0L,
dialog_result);
- rv = system(buf);
+ system(buf);
fp = fopen(dialog_result, "r");
if (fp != NULL) {
char *str = &buf[0];
void important_message(char *title, char *msgtext)
{
char buf[SIZ];
- int rv;
switch (setup_type) {
sprintf(buf, "exec %s --msgbox '%s' 19 72",
getenv("CTDL_DIALOG"),
msgtext);
- rv = system(buf);
+ system(buf);
break;
}
}
struct stat etcinitd;
FILE *fp;
char *initfile = "/etc/init.d/webcit";
- int rv;
fp = fopen(initfile, "r");
if (fp != NULL) {
chmod(initfile, 0755);
/* Set up the run levels. */
- rv = system("/bin/rm -f /etc/rc?.d/[SK]??webcit 2>/dev/null");
+ system("/bin/rm -f /etc/rc?.d/[SK]??webcit 2>/dev/null");
snprintf(command, sizeof(command), "for x in 2 3 4 5 ; do [ -d /etc/rc$x.d ] && ln -s %s /etc/rc$x.d/S84webcit ; done 2>/dev/null", initfile);
- rv = system(command);
+ system(command);
snprintf(command, sizeof(command), "for x in 0 6 S; do [ -d /etc/rc$x.d ] && ln -s %s /etc/rc$x.d/K15webcit ; done 2>/dev/null", initfile);
- rv = system(command);
+ system(command);
}
int a;
char aaa[256];
int info_only = 0;
- int rv;
strcpy(suggested_url, "http://<your_host_name>:<port>/");
install_init_scripts();
if (!access("/etc/init.d/webcit", X_OK)) {
- rv = system("/etc/init.d/webcit stop");
- rv = system("/etc/init.d/webcit start");
+ system("/etc/init.d/webcit stop");
+ system("/etc/init.d/webcit start");
}
sprintf(aaa,
pid_t child = 0;
FILE *fp;
int do_restart = 0;
- int rv;
- FILE *rvfp = NULL;
current_child = 0;
* We don't just call close() because we don't want these fd's
* to be reused for other files.
*/
- rv = chdir("/");
+ chdir("/");
signal(SIGHUP, SIG_IGN);
signal(SIGINT, SIG_IGN);
setsid();
umask(0);
- rvfp = freopen("/dev/null", "r", stdin);
- rvfp = freopen("/dev/null", "w", stdout);
- rvfp = freopen("/dev/null", "w", stderr);
+ freopen("/dev/null", "r", stdin);
+ freopen("/dev/null", "w", stdout);
+ freopen("/dev/null", "w", stderr);
signal(SIGTERM, graceful_shutdown_watcher);
signal(SIGHUP, graceful_shutdown_watcher);
/*
- * Copyright (c) 1987-2011 by the citadel.org team
+ * Copyright (c) 1987-2012 by the citadel.org team
*
* This program is open source software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * modify it under the terms of the GNU General Public License version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sysdep.h"
eHEAD,
eMOVE,
eCOPY,
+ eREPORT,
eNONE
};
extern const char *ReqStrs[eNONE];
const char *basedir = NULL;
char uds_listen_path[PATH_MAX]; /* listen on a unix domain socket? */
const char *I18nDumpFile = NULL;
- int rv = 0;
WildFireInitBacktrace(argv[0], 2);
syslog(1, "***********************************************\n");
return -1;
}
- rv = fwrite(ChrPtr(I18nDump), 1, StrLength(I18nDump), fd);
+ fwrite(ChrPtr(I18nDump), 1, StrLength(I18nDump), fd);
fclose(fd);
return 0;
}