Removed logging subsystem from webcit. It's all syslog now.
[citadel.git] / webcit / webcit.h
index d772b27ade7fe19d76f802796960fa828e02d5a2..53c0157d9215e1a6052652ceb7f5b82868838b2f 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * Copyright (c) 1987-2010 by the citadel.org team
+ * Copyright (c) 1987-2011 by the citadel.org team
  *
- * This program is free 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,
@@ -13,7 +13,7 @@
  *
  * 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"
@@ -50,6 +50,7 @@
 #include <stdarg.h>
 #include <pthread.h>
 #include <signal.h>
+#include <syslog.h>
 #include <sys/utsname.h>
 #include <libcitadel.h>
 
@@ -261,9 +262,10 @@ extern char *ssl_cipher_list;
 #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)"
 
@@ -453,6 +455,7 @@ typedef struct _ParsedHttpHdrs {
        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 */
@@ -473,14 +476,13 @@ struct wcsession {
        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;
 
 /* Session local Members */
        int serv_sock;                          /* Client socket to Citadel server */
-       StrBuf *ReadBuf;                        /* here we keep our stuff while reading linebuffered from the server. */
+       StrBuf *ReadBuf;                        /* linebuffered reads from the server */
        StrBuf *MigrateReadLineBuf;             /* here we buffer legacy server read stuff */
        const char *ReadPos;                    /* whats our read position in ReadBuf? */
        int last_chat_seq;                      /* When in chat - last message seq# we saw */
@@ -488,6 +490,7 @@ struct wcsession {
        time_t last_pager_check;                /* last time we polled for instant msgs */
        ServInfo *serv_info;                    /* Information about the citserver we're connected to */
        int is_ajax;                            /* are we doing an ajax request? */
+       StrBuf *PushedDestination;              /* Where to go after login, registration, etc. */
 
 /* Request local Members */
        StrBuf *CLineBuf;                       /* linebuffering client stuff */
@@ -500,7 +503,7 @@ struct wcsession {
        char ImportantMessage[SIZ];
        StrBuf *ImportantMsg;
        HashList *Directory;                    /* Parts of the directory URL in snippets */
-       const Floor *CurrentFloor;              /**< when Parsing REST, which floor are we on? */
+       const Floor *CurrentFloor;              /* when Parsing REST, which floor are we on? */
 
 /* accounting */
        StrBuf *wc_username;                    /* login name of current user */
@@ -594,6 +597,8 @@ enum {
 #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;
@@ -619,7 +624,6 @@ extern char wizard_filename[];
 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);
@@ -639,6 +643,7 @@ void become_logged_in(const StrBuf *user, const StrBuf *pass, StrBuf *serv_respo
 void openid_manual_create(void);
 void display_login(void);
 void display_openids(void);
+void display_default_landing_page(void);
 void do_welcome(void);
 void do_logout(void);
 void display_main_menu(void);
@@ -827,8 +832,6 @@ HashList *GetRoomListHashLKRA(StrBuf *Target, WCTemplputParams *TP);
 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);