New header.inc.php template

- I dont force the update (updating version in phpgwapi/setup/setup.inc.php),
  as the old one still works through diverse defaults and I want to wait
  for the rewrite of a db-based session handler and making mcrpyt
  available for sessions again (currently not used)
- required includes for xmlrpc and soap are moved to the callbacks of
  this services, as they are NOT required by the rest of eGroupware
This commit is contained in:
Ralf Becker 2008-08-21 06:21:32 +00:00
parent e433a67c7a
commit 80dd3d1fe2
3 changed files with 118 additions and 111 deletions

View File

@ -1,131 +1,132 @@
<?php <?php
/**************************************************************************\ /**
* eGroupWare * * eGroupWare - configuration file
* http://www.egroupware.org * *
* This file was originaly written by Dan Kuykendall * * Use eGroupWare's setup to create or edit this configuration file.
* -------------------------------------------- * * You do NOT need to copy and edit this file manually!
* 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 * * @link http://www.egroupware.org
* Free Software Foundation; either version 2 of the License, or (at your * * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* option) any later version. * * @author RalfBecker@outdoor-training.de
\**************************************************************************/ * (This file was originaly written by Dan Kuykendall)
/* $Id$ */ * @version $Id$
*/
/**************************************************************************\ // allow to migrate from phpgw_info to egw_info
* !!!!!!! EDIT THESE LINES !!!!!!!! * if (!isset($GLOBALS['egw_info']) || isset($GLOBALS['egw_info']['flags']['phpgw_compatibility']) ||
* This setting allows you to easily move the include directory and the * in_array($GLOBALS['egw_info']['flags']['currentapp'],array('jinn','mydms','tts')))
* base of the eGroupWare install. Simple edit the following 2 lines with * {
* the absolute path to fit your site, and you should be up and running. * $GLOBALS['egw_info'] =& $GLOBALS['phpgw_info'];
\**************************************************************************/ $GLOBALS['egw_info']['flags']['phpgw_compatibility'] = true;
}
// allow to migrate from phpgw_info to egw_info // eGW install dir, need to be changed if you copy the server to an other directory
if (isset($GLOBALS['egw_info'])) define('EGW_SERVER_ROOT','{SERVER_ROOT}');
{
$GLOBALS['phpgw_info'] =& $GLOBALS['egw_info'];
}
else
{
$GLOBALS['egw_info'] =& $GLOBALS['phpgw_info'];
}
define('EGW_SERVER_ROOT','{SERVER_ROOT}'); // other pathes depending on the one above
define('EGW_INCLUDE_ROOT','{INCLUDE_ROOT}'); define('EGW_INCLUDE_ROOT',EGW_SERVER_ROOT);
define('PHPGW_SERVER_ROOT','{SERVER_ROOT}'); define('EGW_API_INC',EGW_INCLUDE_ROOT.'/phpgwapi/inc');
define('PHPGW_INCLUDE_ROOT','{INCLUDE_ROOT}');
$GLOBALS['egw_info']['server']['header_admin_user'] = '{HEADER_ADMIN_USER}';
$GLOBALS['egw_info']['server']['header_admin_password'] = '{HEADER_ADMIN_PASSWORD}';
$GLOBALS['egw_info']['server']['setup_acl'] = '{SETUP_ACL}';
/* eGroupWare domain-specific db settings */{domains} // who is allowed to make changes to THIS config file via eGW's setup
/* $GLOBALS['egw_info']['server']['header_admin_user'] = '{HEADER_ADMIN_USER}';
** If you want to have your domains in a select box, change to True $GLOBALS['egw_info']['server']['header_admin_password'] = '{HEADER_ADMIN_PASSWORD}';
** If not, users will have to login as user@domain
** Note: This is only for virtual domain support, default domain users can login only using
** there loginid.
*/
$GLOBALS['egw_info']['server']['show_domain_selectbox'] = {DOMAIN_SELECTBOX};
$GLOBALS['egw_info']['server']['db_persistent'] = {DB_PERSISTENT}; // restrict the access to setup to certain (comma separated) IPs or domains
$GLOBALS['egw_info']['server']['setup_acl'] = '{SETUP_ACL}';
/* /* eGroupWare domain-specific db settings */{domains}
** eGroupWare can handle session management using the database or
** the session support built into PHP4 which usually gives better
** performance.
** Your choices are 'db', 'php4' or 'php4-restore'
*/
$GLOBALS['egw_info']['server']['sessions_type'] = '{SESSIONS_TYPE}';
/* Select which login template set you want, most people will use default */ /*
$GLOBALS['egw_info']['login_template_set'] = 'idots'; ** If you want to have your domains in a select box, change to True
** If not, users will have to login as user@domain
** Note: This is only for virtual domain support, default domain users (that's everyone
** form the first domain or if you have only one) can login only using just there loginid.
*/
$GLOBALS['egw_info']['server']['show_domain_selectbox'] = {DOMAIN_SELECTBOX};
/* This is used to control mcrypt's use */ $GLOBALS['egw_info']['server']['db_persistent'] = {DB_PERSISTENT};
$GLOBALS['egw_info']['server']['mcrypt_enabled'] = {ENABLE_MCRYPT};
/* Set this to 'old' for versions < 2.4, otherwise the exact mcrypt version you use. */
$GLOBALS['egw_info']['server']['versions']['mcrypt'] = '{MCRYPT_VERSION}';
/* /*
** This is a random string used as the initialization vector for mcrypt ** used session handler: egw_session_files works for all build in php session handlers
** feel free to change it when setting up eGrouWare on a clean database, ** other handlers (like egw_session_memcache) can be enabled here
** but you must not change it after that point! */
** It should be around 30 bytes in length. $GLOBALS['egw_info']['server']['session_handler'] = '{SESSION_HANDLER}';
*/
$GLOBALS['egw_info']['server']['mcrypt_iv'] = '{MCRYPT_IV}';
if(!isset($GLOBALS['egw_info']['flags']['nocachecontrol']) || !$GLOBALS['egw_info']['flags']['nocachecontrol']) /* Select which login template set you want, most people will use idots */
{ $GLOBALS['egw_info']['login_template_set'] = 'idots';
header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1
header('Pragma: no-cache'); // HTTP/1.0 /* This is used to control mcrypt's use */
} $GLOBALS['egw_info']['server']['mcrypt_enabled'] = {ENABLE_MCRYPT};
else
{ /*
// allow caching by browser ** This is a random string used as the initialization vector for mcrypt
session_cache_limiter('private_no_expire'); ** feel free to change it when setting up eGrouWare on a clean database,
} ** but you must not change it after that point!
** It should be around 30 bytes in length.
*/
$GLOBALS['egw_info']['server']['mcrypt_iv'] = '{MCRYPT_IV}';
if(!isset($GLOBALS['egw_info']['flags']['nocachecontrol']) || !$GLOBALS['egw_info']['flags']['nocachecontrol'])
{
header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1
header('Pragma: no-cache'); // HTTP/1.0
}
else
{
// allow caching by browser
session_cache_limiter('private_no_expire');
}
$GLOBALS['egw_info']['flags']['page_start_time'] = microtime(true);
define('DEBUG_API', False);
define('DEBUG_APP', False);
include(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php');
$GLOBALS['egw_info']['server']['versions']['phpgwapi'] = $setup_info['phpgwapi']['version'];
$GLOBALS['egw_info']['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header'];
unset($setup_info);
$GLOBALS['egw_info']['server']['versions']['header'] = '1.29';
// some not longer necessary defines
if ($GLOBALS['egw_info']['flags']['phpgw_compatibility'])
{
define('PHPGW_API_INC',EGW_API_INC);
define('PHPGW_SERVER_ROOT',EGW_SERVER_ROOT);
define('PHPGW_INCLUDE_ROOT',EGW_INCLUDE_ROOT);
/* debugging settings */ /* debugging settings */
define('DEBUG_APP', False);
define('DEBUG_API', False);
define('DEBUG_DATATYPES', True); define('DEBUG_DATATYPES', True);
define('DEBUG_LEVEL', 3); define('DEBUG_LEVEL', 3);
define('DEBUG_OUTPUT', 2); /* 1 = screen, 2 = DB. For both use 3. */ define('DEBUG_OUTPUT', 2); /* 1 = screen, 2 = DB. For both use 3. */
define('DEBUG_TIMER', False); define('DEBUG_TIMER', False);
}
$GLOBALS['egw_info']['flags']['page_start_time'] = microtime(true); if(!isset($GLOBALS['egw_info']['flags']['noapi']) || !$GLOBALS['egw_info']['flags']['noapi'])
{
ob_start(); // to prevent error messages to be send before our headers
include(EGW_API_INC . '/functions.inc.php');
}
else
{
require_once(EGW_API_INC . '/common_functions.inc.php');
}
/**************************************************************************\ /*
* Do not edit these lines * Leave off the final php closing tag, some editors will add
\**************************************************************************/ a \n or space after which will mess up cookies later on
define('EGW_API_INC',EGW_INCLUDE_ROOT.'/phpgwapi/inc'); */<!-- BEGIN domain -->
define('PHPGW_API_INC',EGW_INCLUDE_ROOT.'/phpgwapi/inc'); $GLOBALS['egw_domain']['{DB_DOMAIN}'] = array(
include(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'); 'db_host' => '{DB_HOST}',
$GLOBALS['egw_info']['server']['versions']['phpgwapi'] = $setup_info['phpgwapi']['version']; 'db_port' => '{DB_PORT}',
$GLOBALS['egw_info']['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header']; 'db_name' => '{DB_NAME}',
unset($setup_info); 'db_user' => '{DB_USER}',
$GLOBALS['egw_info']['server']['versions']['header'] = '1.28'; 'db_pass' => '{DB_PASS}',
/* This is a fix for NT */ // Look at the README file
if(!isset($GLOBALS['egw_info']['flags']['noapi']) || !$GLOBALS['egw_info']['flags']['noapi'] == True) 'db_type' => '{DB_TYPE}',
{ // This will limit who is allowed to make configuration modifications
ob_start(); // to prevent error messages to be send before our headers 'config_user' => '{CONFIG_USER}',
include(EGW_API_INC . '/functions.inc.php'); 'config_passwd' => '{CONFIG_PASS}'
include(EGW_API_INC . '/xml_functions.inc.php'); );
include(EGW_API_INC . '/soap_functions.inc.php');
}
/*
Leave off the final php closing tag, some editors will add
a \n or space after which will mess up cookies later on
*/<!-- BEGIN domain -->
$GLOBALS['egw_domain']['{DB_DOMAIN}'] = array(
'db_host' => '{DB_HOST}',
'db_port' => '{DB_PORT}',
'db_name' => '{DB_NAME}',
'db_user' => '{DB_USER}',
'db_pass' => '{DB_PASS}',
// Look at the README file
'db_type' => '{DB_TYPE}',
// This will limit who is allowed to make configuration modifications
'config_user' => '{CONFIG_USER}',
'config_passwd' => '{CONFIG_PASS}'
);
<!-- END domain --> <!-- END domain -->

View File

@ -22,6 +22,9 @@
); );
include('./header.inc.php'); include('./header.inc.php');
include_once(EGW_API_INC . '/xml_functions.inc.php'); // not sure that's neccessary, but I have no way to test
include_once(EGW_API_INC . '/soap_functions.inc.php');
$GLOBALS['server'] = CreateObject('phpgwapi.soap_server'); $GLOBALS['server'] = CreateObject('phpgwapi.soap_server');
/* _debug_array($GLOBALS['server']);exit; */ /* _debug_array($GLOBALS['server']);exit; */
/* include(EGW_API_INC . '/soaplib.soapinterop.php'); */ /* include(EGW_API_INC . '/soaplib.soapinterop.php'); */

View File

@ -22,7 +22,10 @@
'disable_Template_class' => True 'disable_Template_class' => True
) )
); );
include('header.inc.php'); include('./header.inc.php');
include_once(EGW_API_INC . '/xml_functions.inc.php');
include_once(EGW_API_INC . '/soap_functions.inc.php'); // not sure that's neccessary, but I have no way to test
//viniciuscb: a secure way to know if we're in a xmlrpc call... //viniciuscb: a secure way to know if we're in a xmlrpc call...
$GLOBALS['egw_info']['server']['xmlrpc'] = true; $GLOBALS['egw_info']['server']['xmlrpc'] = true;