/*
* Handles GroupDAV GET requests.
*
- * 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 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 "webcit.h"
* Fetch the entire contents of the room as one big ics file.
* This is for "webcal://" type access.
*/
-void groupdav_get_big_ics(void) {
+void dav_get_big_ics(void) {
char buf[1024];
serv_puts("ICAL getics");
serv_getln(buf, sizeof buf);
if (buf[0] != '1') {
hprintf("HTTP/1.1 404 not found\r\n");
- groupdav_common_headers();
+ dav_common_headers();
hprintf("Content-Type: text/plain\r\n");
begin_burst();
wc_printf("%s\r\n",
}
hprintf("HTTP/1.1 200 OK\r\n");
- groupdav_common_headers();
+ dav_common_headers();
hprintf("Content-type: text/calendar; charset=UTF-8\r\n");
begin_burst();
while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
/*
- * MIME parser callback function for groupdav_get()
+ * MIME parser callback function for dav_get()
* Helps identify the relevant section of a multipart message
*/
void extract_preferred(char *name, char *filename, char *partnum, char *disp,
* /groupdav/room_name/euid (GroupDAV)
* /groupdav/room_name (webcal)
*/
-void groupdav_get(void)
+void dav_get(void)
{
wcsession *WCC = WC;
StrBuf *dav_roomname;
if (StrBufNum_tokens(WCC->Hdr->HR.ReqLine, '/') < 2) {
hprintf("HTTP/1.1 404 not found\r\n");
- groupdav_common_headers();
+ dav_common_headers();
hprintf("Content-Type: text/plain\r\n");
wc_printf("The object you requested was not found.\r\n");
end_burst();
}
if (strcasecmp(ChrPtr(WCC->CurRoom.name), ChrPtr(dav_roomname))) {
hprintf("HTTP/1.1 404 not found\r\n");
- groupdav_common_headers();
+ dav_common_headers();
hprintf("Content-Type: text/plain\r\n");
wc_printf("There is no folder called \"%s\" on this server.\r\n",
ChrPtr(dav_roomname));
/** GET on the collection itself returns an ICS of the entire collection.
*/
if (StrLength(dav_uid) == 0) {
- groupdav_get_big_ics();
+ dav_get_big_ics();
FreeStrBuf(&dav_roomname);
FreeStrBuf(&dav_uid);
return;
serv_getln(buf, sizeof buf);
if (buf[0] != '1') {
hprintf("HTTP/1.1 404 not found\r\n");
- groupdav_common_headers();
+ dav_common_headers();
hprintf("Content-Type: text/plain\r\n");
wc_printf("Object \"%s\" was not found in the \"%s\" folder.\r\n",
ChrPtr(dav_uid),
/* Output headers common to single or multi part messages */
hprintf("HTTP/1.1 200 OK\r\n");
- groupdav_common_headers();
+ dav_common_headers();
hprintf("etag: \"%ld\"\r\n", dav_msgnum);
hprintf("Date: %s\r\n", date);