00001 /* $Id: midgard_apache.h,v 1.4 2006/06/13 11:38:04 piotras Exp $ 00002 * 00003 * midgard/apache.h: apache helper routines and data structures 00004 * 00005 * Copyright (C) 1999 Jukka Zitting <jukka.zitting@iki.fi> 00006 * Copyright (C) 2000 The Midgard Project ry 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Library General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2 of the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Library General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this library; see the file COPYING. If not, write to 00020 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00021 * Boston, MA 02111-1307, USA. 00022 */ 00023 #ifndef MGD_APACHE_H 00024 #define MGD_APACHE_H 00025 #include <midgard/midgard.h> 00026 #include <midgard/types.h> 00027 #include <midgard/midgard_schema.h> 00028 #include <midgard/pageresolve.h> 00029 #include <midgard/authfailure.h> 00030 #include <midgard/midgard_datatypes.h> 00031 #include <midgard/midgard_type.h> 00032 #include <midgard/midgard_config.h> 00033 00034 #define MOD_MIDGARD_RESOURCE_PAGE 0 00035 #define MOD_MIDGARD_RESOURCE_PAGE_REDIRECT 1 00036 #define MOD_MIDGARD_RESOURCE_BLOB 2 00037 #define MOD_MIDGARD_RESOURCE_FILETEMPLATE 3 00038 00039 #define MIDGARD_HANDLER "application/x-httpd-php-midgard" 00040 00041 struct _midgard_database_connection; 00042 00043 typedef struct { 00044 char *username; 00045 char *password; 00046 char *hostname; 00047 int refcount; 00048 struct _midgard_database_connection *current; 00049 midgard *mgd; 00050 } midgard_database_handle; 00051 00052 typedef struct _midgard_database_connection { 00053 char *name; 00054 midgard_database_handle *handle; 00055 } midgard_database_connection; 00056 00057 typedef struct _server_config { 00058 char *default_realm; 00059 00060 struct { 00061 midgard_database_connection* page; 00062 midgard_database_connection* auth; 00063 midgard_database_connection* main; 00064 } database; 00065 00066 struct { 00067 int on, set; 00068 } forcedroot; 00069 00070 char *pagecache; 00071 char *ntlm_auth; 00072 gpointer ntlm_map_domains; 00073 midgard_auth_type authtype; 00074 int authtrusted; 00075 gpointer object; 00076 const gchar *pamfile; 00077 } midgard_server_config; 00078 00079 #define MGD_AUTH_SNOOP_NONE 0 00080 #define MGD_AUTH_SNOOP_OK 1 00081 #define MGD_AUTH_SNOOP_FAILED 2 00082 00083 typedef struct _request_config { 00084 gpointer req; 00085 gpointer pool; 00086 midgard *mgd; 00087 int host, style; 00088 int author; 00089 00090 struct { 00091 int required; 00092 int passed; 00093 int cookie; 00094 } auth; 00095 00096 int prelen; 00097 int self_len; 00098 00099 struct { 00100 int status; /*[eeh] obsolete in mod2 */ 00101 int id; /*[eeh] rename to page for mod2 */ 00102 int type; /*[eeh] obsolete in mod2 */ 00103 int active_page; /*[eeh] obsolete in mod2 */ 00104 const char *content_type; 00105 } resource; 00106 00107 const char *path; /*[eeh] obsolete in mod2 */ 00108 gpointer argv; 00109 int nelts; 00110 char **elts; 00111 char *uri; 00112 GHashTable *elements; 00113 midgard_style *mgd_style; 00114 midgard_server_config *scfg; 00115 00116 int preparser_active; 00117 00118 struct { 00119 midgard_database_connection* current; 00120 midgard_database_connection* page; 00121 midgard_database_connection* main; 00122 } database; 00123 } midgard_request_config; 00124 00125 typedef struct _directory_config { 00126 00127 struct { 00128 int on; 00129 int set; 00130 } engine; 00131 00132 struct { 00133 int on; 00134 int set; 00135 } extauth; 00136 00137 char *rootfile; 00138 char *templatefile; 00139 char *blobdir; 00140 char *parser; 00141 char *extension; 00142 #if HAVE_MIDGARD_VC 00143 char *cvs_script; 00144 #endif /* HAVE_MIDGARD_VC */ 00145 00146 struct { 00147 int on; 00148 int set; 00149 } quota; 00150 00151 struct { 00152 int on; 00153 int set; 00154 } attachmenthost; 00155 00156 char* ah_prefix; 00157 guint loglevel; 00158 const gchar *logfile; 00159 MidgardSchema *schema; 00160 const char *schemafile; 00161 gpointer object; 00162 } midgard_directory_config; 00163 00164 #endif
1.4.6