/*
- * Copyright (c) 1996-2012 by the citadel.org team
+ * Copyright (c) 1996-2013 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.
- *
- *
- *
- *
*/
#ifndef __CALENDAR_H__
/*
- * Data passed back and forth between dav_get() and its
- * callback functions called by the MIME parser
+ * Copyright (c) 1996-2013 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.
+ */
+
+
+/*
+ * Data passed back and forth between dav_get() and its callback functions called by the MIME parser
*/
struct epdata {
char desired_content_type_1[128];
+/*
+ * Copyright (c) 1996-2013 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.
+ */
+
extern CtxType CTX_MAILSUM;
extern CtxType CTX_MIME_ATACH;
extern HashList *MsgHeaderHandler;
/*
* parse urlparts and post data
*
- * Copyright (c) 1996-2012 by the citadel.org team
+ * Copyright (c) 1996-2013 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.
#include "webcit.h"
#include "webserver.h"
+/* uncomment to see all parameters sent to the server by the browser. */
+/* #define DEBUG_URLSTRINGS */
+
+
void free_url(void *U)
{
urlcontent *u = (urlcontent*) U;
*/
void ParseURLParams(StrBuf *url)
{
- const char *aptr, *bptr, *eptr, *up;
- int len, keylen;
- urlcontent *u;
+ const char *aptr, *bptr, *eptr, *up = NULL;
+ int len, keylen = 0;
+ urlcontent *u = NULL;
wcsession *WCC = WC;
- if (WCC->Hdr->urlstrings == NULL)
+ if (WCC->Hdr->urlstrings == NULL) {
WCC->Hdr->urlstrings = NewHash(1, NULL);
+ }
eptr = ChrPtr(url) + StrLength(url);
up = ChrPtr(url);
while ((up < eptr) && (!IsEmptyStr(up))) {
aptr = up;
- while ((aptr < eptr) && (*aptr != '\0') && (*aptr != '='))
+ while ((aptr < eptr) && (*aptr != '\0') && (*aptr != '=')) {
aptr++;
+ }
if (*aptr != '=') {
return;
}
bptr++;
}
keylen = aptr - up - 1; /* -1 -> '=' */
- if(keylen >= sizeof(u->url_key)) {
- syslog(LOG_WARNING, "invalid url_key from %s", ChrPtr(WCC->Hdr->HR.browser_host));
- return;
+ if (keylen > sizeof(u->url_key)) {
+ syslog(LOG_WARNING, "%s:%d: invalid url_key of size %d in string size %d",
+ __FILE__, __LINE__, keylen, sizeof(u->url_key)
+ );
}
u = (urlcontent *) malloc(sizeof(urlcontent));
memcpy(u->url_key, up, keylen);
u->url_key[keylen] = '\0';
if (keylen < 0) {
- syslog(LOG_WARNING, "invalid url_key from %s", ChrPtr(WCC->Hdr->HR.browser_host));
+ syslog(LOG_WARNING, "%s:%d: invalid url_key of size %d", __FILE__, __LINE__, keylen);
free(u);
return;
}
WCC->upload_filename = NewStrBufPlain(filename, -1);
safestrncpy(WCC->upload_content_type, cbtype, sizeof(WC->upload_content_type));
#ifdef DEBUG_URLSTRINGS
- syslog(LOG_DEBUG, "File: <%s> len: [%ld]", filename, length);
+ syslog(LOG_DEBUG, "File: <%s> len: [%ld]", filename, (long int)length);
#endif
}
void PutBstr(const char *key, long keylen, StrBuf *Value)
{
urlcontent *u;
- wcsession *WCC = WC;
if(keylen >= sizeof(u->url_key)) {
- syslog(LOG_WARNING, "invalid url_key from %s", ChrPtr(WCC->Hdr->HR.browser_host));
+ syslog(LOG_WARNING, "%s:%d: invalid url_key of size %ld", __FILE__, __LINE__, keylen);
FreeStrBuf(&Value);
return;
}
+/*
+ * Copyright (c) 1996-2013 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.
+ */
+
/* URL / Mime Post parsing -> paramhandling.c */
void upload_handler(char *name, char *filename, char *partnum, char *disp,
void *content, char *cbtype, char *cbcharset,
+/*
+ * Copyright (c) 1996-2013 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.
+ */
+
typedef enum _ePrefType{
PRF_UNSET = 0,
+/*
+ * Copyright (c) 1996-2013 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.
+ */
+
#define VIRTUAL_MY_FLOOR -1
/*
- * \brief This struct holds a list of rooms for \\\<G\\\>oto operations.
+ * This struct holds a list of rooms for "Goto" operations.
*/
struct march {
struct march *next; /* pointer to next in linked list */
int march_order; /* sequence in which we are to visit this room */
};
-/* *
- * \brief This struct holds a list of rooms for client display.
- * It is a binary tree.
+/*
+ * This struct holds a list of rooms for client display. It is a binary tree.
*/
struct roomlisting {
struct roomlisting *lnext; /* pointer to 'left' tree node */
long AlphaN;
} Floor;
-/**
- * \brief Data structure for roomlist-to-folderlist conversion
+/*
+ * Data structure for roomlist-to-folderlist conversion
*/
struct __ofolder {
int floor; /* which floor is it on */
-/**
- * \brief Data structure for roomlist-to-folderlist conversion
+/*
+ * Data structure for roomlist-to-folderlist conversion
*/
typedef struct _folder {
/* Data citserver tells us about the room */
int BumpUsers; /* if SETR set to 1 to make all users who knew this room to forget about it. */
HashList *IgnetCfgs[maxRoomNetCfg + 1];
-}folder;
+} folder;
HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP);
void vDeleteFolder(void *vFolder);
-/**
- * @defgroup subst Template processing functions
+/*
+ * Copyright (c) 1996-2013 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.
+ *
+ * subst template processing functions
*/
extern HashList *Conditionals;
+/*
+ * Copyright (c) 1996-2013 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.
+ */
+
int uds_connectsock(char *);
int tcp_connectsock(char *, char *);
int serv_getln(char *strbuf, int bufsize);
int StrBuf_ServGetln(StrBuf *buf);
-/**
- * @defgroup CoreSrv Core Server Functionality
+/*
+ * parse & check the server reply
+ *
+ * Line the line containing the server reply
+ * FullState if you need more than just the major number, this is returns it. Ignored if NULL.
+ * PutImportantMessage if you want to forward the text part of the server reply to the user, specify 1;
+ * the result will be put into the 'Important Message' framework.
+ * MajorOK in case of which major number not to put the ImportantMessage? 0 for all.
+ *
+ * returns the most significant digit of the server status
*/
-/**
- * @ingroup CoreSrv
- * @brief parse & check the server reply
- * @param Line the line containing the server reply
- * @param FullState if you need more than just the major number, this is returns it. Ignored if NULL.
- * @param PutImportantMessage if you want to forward the text part of the server reply to the user, specify 1;
- * the result will be put into the 'Important Message' framework.
- * @param MajorOK in case of which major number not to put the ImportantMessage? 0 for all.
- * @return the most significant digit of the server status
- */
int GetServerStatusMsg(StrBuf *Line, long* FullState, int PutImportantMessage, int MajorOK);
-/**
- * @ingroup CoreSrv
- * @brief to migrate old calls....
+
+/*
+ * to migrate old calls....
*/
#define GetServerStatus(a, b) GetServerStatusMsg(a, b, 0, 0)
+/*
+ * Copyright (c) 1996-2013 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.
+ */
+
void StrEscPuts(const StrBuf *strbuf);
void StrEscputs1(const StrBuf *strbuf, int nbsp, int nolinebreaks);
+/*
+ * Copyright (c) 1996-2013 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.
+ */
+
extern char *static_dirs[PATH_MAX]; /**< Web representation */
extern int ndirs;