]> code.citadel.org Git - citadel.git/blobdiff - webcit/groupdav_put.c
Room links in iconbar roomlist now properly escaped with encodeURIcomponent()
[citadel.git] / webcit / groupdav_put.c
index d79d17fa855b6e2280680f80a9089724aedb8f59..f0bd712e427f4269a6aca7618a613b07e8823b18 100644 (file)
@@ -1,8 +1,21 @@
 /*
- * $Id$
- *
  * Handles GroupDAV PUT requests.
  *
+ * Copyright (c) 2005-2010 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.
+ *
+ * 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"
@@ -44,7 +57,7 @@ void groupdav_put_bigics(void)
 
        /* Report success and not much else. */
        hprintf("HTTP/1.1 204 No Content\r\n");
-       lprintf(9, "HTTP/1.1 204 No Content\r\n");
+       syslog(9, "HTTP/1.1 204 No Content\r\n");
        groupdav_common_headers();
        begin_burst();
        end_burst();
@@ -87,10 +100,10 @@ void groupdav_put(void)
        }
 
        /* Go to the correct room. */
-       if (strcasecmp(ChrPtr(WC->wc_roomname), ChrPtr(dav_roomname))) {
+       if (strcasecmp(ChrPtr(WC->CurRoom.name), ChrPtr(dav_roomname))) {
                gotoroom(dav_roomname);
        }
-       if (strcasecmp(ChrPtr(WC->wc_roomname), ChrPtr(dav_roomname))) {
+       if (strcasecmp(ChrPtr(WC->CurRoom.name), ChrPtr(dav_roomname))) {
                hprintf("HTTP/1.1 404 not found\r\n");
                groupdav_common_headers();
                hprintf("Content-Type: text/plain\r\n");
@@ -111,12 +124,12 @@ void groupdav_put(void)
         * version, so we fail...
         */
        if (StrLength(WCC->Hdr->HR.dav_ifmatch) > 0) {
-               lprintf(9, "dav_ifmatch: %s\n", WCC->Hdr->HR.dav_ifmatch);
+               syslog(9, "dav_ifmatch: %s\n", ChrPtr(WCC->Hdr->HR.dav_ifmatch));
                old_msgnum = locate_message_by_uid(ChrPtr(dav_uid));
-               lprintf(9, "old_msgnum:  %ld\n", old_msgnum);
+               syslog(9, "old_msgnum:  %ld\n", old_msgnum);
                if (StrTol(WCC->Hdr->HR.dav_ifmatch) != old_msgnum) {
                        hprintf("HTTP/1.1 412 Precondition Failed\r\n");
-                       lprintf(9, "HTTP/1.1 412 Precondition Failed (ifmatch=%ld, old_msgnum=%ld)\r\n",
+                       syslog(9, "HTTP/1.1 412 Precondition Failed (ifmatch=%ld, old_msgnum=%ld)\r\n",
                                StrTol(WCC->Hdr->HR.dav_ifmatch), old_msgnum);
                        groupdav_common_headers();
                        
@@ -167,7 +180,7 @@ void groupdav_put(void)
                        new_msgnum = atol(buf);
                        break;
                case 1: 
-                       lprintf(9, "new_msgnum=%ld (%s)\n", new_msgnum, buf);
+                       syslog(9, "new_msgnum=%ld (%s)\n", new_msgnum, buf);
                        break;
                case 2: 
                        StrBufAppendBufPlain(dav_uid, buf, -1, 0);
@@ -197,7 +210,7 @@ void groupdav_put(void)
        if (old_msgnum < 0L) {
                char escaped_uid[1024];
                hprintf("HTTP/1.1 201 Created\r\n");
-               lprintf(9, "HTTP/1.1 201 Created\r\n");
+               syslog(9, "HTTP/1.1 201 Created\r\n");
                groupdav_common_headers();
                hprintf("etag: \"%ld\"\r\n", new_msgnum);
                hprintf("Location: ");
@@ -214,7 +227,7 @@ void groupdav_put(void)
 
        /* We modified an existing item. */
        hprintf("HTTP/1.1 204 No Content\r\n");
-       lprintf(9, "HTTP/1.1 204 No Content\r\n");
+       syslog(9, "HTTP/1.1 204 No Content\r\n");
        groupdav_common_headers();
        hprintf("Etag: \"%ld\"\r\n", new_msgnum);
        /* The item we replaced has probably already been deleted by