/*
* Copyright (c) 1987-2011 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
+ * 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,
*
* 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sysdep.h"
#define NO_SUCH_SYSTEM 73
#define ALREADY_EXISTS 74
#define MESSAGE_NOT_FOUND 75
+
/*
* NLI is the string that shows up in a who's online listing for sessions
- * that are active, but for which no user has yet authenticated.
+ * that are active but do not (yet) have a user logged in.
*/
#define NLI "(not logged in)"
StrBuf *c_language;
StrBuf *this_page; /* URL of current page */
StrBuf *PlainArgs;
+ StrBuf *HostHeader;
HashList *urlstrings; /* variables passed to webcit in a URL */
HashList *HTTPHeaders; /* the headers the client sent us */
pthread_mutex_t SessionMutex; /* mutex for exclusive access */
int wc_session; /* WebCit session ID */
int killthis; /* Nonzero == purge this session */
- int is_mobile; /* Client is a handheld browser */
int ctdl_pid; /* Session ID on the Citadel server */
int nonce; /* session nonce (to prevent session riding) */
int SessionKey;
#define num_parms(source) num_tokens(source, '|')
#endif
+#define site_prefix (WC ? (WC->Hdr->HostHeader) : NULL)
+
/* Per-session data */
#define WC ((struct wcsession *)pthread_getspecific(MyConKey))
extern pthread_key_t MyConKey;
extern int follow_xff;
extern int num_threads_existing;
extern int num_threads_executing;
-extern StrBuf *site_prefix;
void InitialiseSemaphores(void);
void begin_critical_section(int which_one);
void webcit_fmt_date(char *buf, size_t siz, time_t thetime, int Format);
void summary(void);
-int is_mobile_ua(char *user_agent);
-
/* actual supported locales */
void TmplGettext(StrBuf *Target, WCTemplputParams *TP);
void offer_languages(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context, int ContextType);