Fix lots of warnings all over the place, make inbound buffers of FMOUT const.
[citadel.git] / webcit / groupdav_main.c
index 313efe83c3216c3b503a6bcc24e2c78998885ab2..e673a38ff681f03f82783e74d9cccc7dcb4e3baa 100644 (file)
@@ -1,8 +1,21 @@
 /*
- * $Id$
- *
  * Entry point for GroupDAV functions
  *
+ * 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"
@@ -177,39 +190,20 @@ void groupdav_main(void)
  * Output our host prefix for globally absolute URL's.
  */  
 void groupdav_identify_host(void) {
-       wcsession *WCC = WC;
-
-       if (StrLength(WCC->Hdr->HR.http_host)!=0) {
-               wc_printf("%s://%s",
-                       (is_https ? "https" : "http"),
-                       ChrPtr(WCC->Hdr->HR.http_host));
-       }
+       wc_printf("%s", ChrPtr(site_prefix));
 }
 
 
 void tmplput_GROUPDAV_HOSTNAME(StrBuf *Target, WCTemplputParams *TP) 
 {
-       wcsession *WCC = WC;
-
-       if (StrLength(WCC->Hdr->HR.http_host)!=0) {
-               StrBufAppendPrintf(Target, 
-                                  "%s://%s",
-                                  (is_https ? "https" : "http"),
-                                  ChrPtr(WCC->Hdr->HR.http_host));
-       }
+       StrBufAppendPrintf(Target, "%s", ChrPtr(site_prefix));
 }
 
 /*
  * Output our host prefix for globally absolute URL's.
  */  
 void groupdav_identify_hosthdr(void) {
-       wcsession *WCC = WC;
-
-       if (StrLength(WCC->Hdr->HR.http_host)!=0) {
-               hprintf("%s://%s",
-                       (is_https ? "https" : "http"),
-                       ChrPtr(WCC->Hdr->HR.http_host));
-       }
+       hprintf("%s", ChrPtr(site_prefix));
 }
 
 
@@ -334,7 +328,9 @@ void
 InitModule_GROUPDAV
 (void)
 {
-//     WebcitAddUrlHandler(HKEY("groupdav"), "", 0, groupdav_main, XHTTP_COMMANDS|COOKIEUNNEEDED|FORCE_SESSIONCLOSE);
+/*
+       WebcitAddUrlHandler(HKEY("groupdav"), "", 0, groupdav_main, XHTTP_COMMANDS|COOKIEUNNEEDED|FORCE_SESSIONCLOSE);
+ */
        RegisterDAVNamespace(HKEY("groupdav"), HKEY("GroupDAV"), 
                             groupdav_main, GroupdavDispatchREST, 
                             XHTTP_COMMANDS|COOKIEUNNEEDED|FORCE_SESSIONCLOSE);