moved to define() for path vars. Also starting to hack sessions to be phpgw_info manager

This commit is contained in:
seek3r 2001-02-06 09:19:38 +00:00
parent ac60c67a5b
commit 00b23411ef
9 changed files with 55 additions and 55 deletions

View File

@ -12,15 +12,6 @@
/* $Id$ */
/**************************************************************************\
* !!!!!!! DONT TOUCH THESE LINES !!!!!!!! *
* This flushes out any vars from the url for security reason *
\**************************************************************************/
$sec_clean = $phpgw_info["flags"];
$phpgw_info = array();
$phpgw_info["flags"] = $sec_clean;
unset ($sec_clean);
/**************************************************************************\
* !!!!!!! EDIT THESE LINES !!!!!!!! *
* This setting allows you to easily move the include directory and the *
@ -28,8 +19,8 @@
* the absolute path to fit your site, and you should be up and running. *
\**************************************************************************/
$phpgw_info["server"]["server_root"] = "{SERVER_ROOT}";
$phpgw_info["server"]["include_root"] = "{INCLUDE_ROOT}";
define("PHPGW_SERVER_ROOT", "{SERVER_ROOT}");
define("PHPGW_INCLUDE_ROOT", "{INCLUDE_ROOT}");
$phpgw_info["server"]["header_admin_password"] = "{HEADER_ADMIN_PASSWORD}";
$phpgw_domain["default"] = array (
@ -79,13 +70,13 @@
/**************************************************************************\
* Do not edit these lines *
\**************************************************************************/
$phpgw_info["server"]["api_inc"] = $phpgw_info["server"]["include_root"]."/phpgwapi/inc";
include($phpgw_info["server"]["server_root"]."/version.inc.php");
$phpgw_info["server"]["versions"]["header"] = "1.10";
define("PHPGW_API_INC", PHPGW_INCLUDE_ROOT."/phpgwapi/inc");
include(PHPGW_SERVER_ROOT."/version.inc.php");
$phpgw_info["server"]["versions"]["header"] = "1.11";
// This is a fix for NT
if (!isset($phpgw_info["flags"]["noapi"]) ||
!$phpgw_info["flags"]["noapi"] == True){
include($phpgw_info["server"]["api_inc"] . "/functions.inc.php");
include(PHPGW_API_INC . "/functions.inc.php");
}
// Leave off the final php closing tag, some editors will add

View File

@ -1,4 +1,11 @@
<?php
include($phpgw_info["server"]["api_inc"]."/class.accounts_".$phpgw_info["server"]["account_repository"].".inc.php");
include($phpgw_info["server"]["api_inc"]."/class.accounts_shared.inc.php");
if (empty($phpgw_info["server"]["account_repository"])){
if (!empty($phpgw_info["server"]["auth_type"])){
$phpgw_info["server"]["account_repository"] = $phpgw_info["server"]["auth_type"];
}else{
$phpgw_info["server"]["account_repository"] = "sql";
}
}
include(PHPGW_API_INC."/class.accounts_".$phpgw_info["server"]["account_repository"].".inc.php");
include(PHPGW_API_INC."/class.accounts_shared.inc.php");
?>

View File

@ -1 +1,4 @@
<?php include($phpgw_info["server"]["api_inc"]."/class.auth_".$phpgw_info["server"]["auth_type"].".inc.php"); ?>
<?php
if (empty($phpgw_info["server"]["auth_type"])){$phpgw_info["server"]["auth_type"] = "sql";}
include(PHPGW_API_INC."/class.auth_".$phpgw_info["server"]["auth_type"].".inc.php");
?>

View File

@ -1 +1,4 @@
<?php include($phpgw_info["server"]["api_inc"]."/class.db_".$phpgw_info["server"]["db_type"].".inc.php"); ?>
<?php
if (empty($phpgw_info["server"]["db_type"])){$phpgw_info["server"]["db_type"] = "mysql";}
include(PHPGW_API_INC."/class.db_".$phpgw_info["server"]["db_type"].".inc.php");
?>

View File

@ -24,13 +24,6 @@
/* $Id$ */
/****************************************************************************\
* Required classes *
\****************************************************************************/
/* Load selected database class */
if (empty($phpgw_info["server"]["db_type"])){$phpgw_info["server"]["db_type"] = "mysql";}
if (empty($phpgw_info["server"]["translation_system"])){$phpgw_info["server"]["translation_system"] = "sql";}
/****************************************************************************\
* Our API class starts here *
\****************************************************************************/
@ -105,12 +98,7 @@
$this->common = CreateObject("phpgwapi.common");
$this->hooks = CreateObject("phpgwapi.hooks");
/* Load selected authentication class */
if (empty($phpgw_info["server"]["auth_type"])){$phpgw_info["server"]["auth_type"] = "sql";}
$this->auth = CreateObject("phpgwapi.auth");
/* Load selected accounts class */
if (empty($phpgw_info["server"]["account_repository"])){$phpgw_info["server"]["account_repository"] = $phpgw_info["server"]["auth_type"];}
$this->acl = CreateObject("phpgwapi.acl");
$this->accounts = CreateObject("phpgwapi.accounts");
$this->session = CreateObject("phpgwapi.sessions");

View File

@ -1 +1,4 @@
<?php include($phpgw_info["server"]["api_inc"]."/class.translation_".$phpgw_info["server"]["translation_system"].".inc.php"); ?>
<?php
if (empty($phpgw_info["server"]["translation_system"])){$phpgw_info["server"]["translation_system"] = "sql";}
include(PHPGW_API_INC."/class.translation_".$phpgw_info["server"]["translation_system"].".inc.php");
?>

View File

@ -24,14 +24,6 @@
/* $Id$ */
$d1 = strtolower(substr($phpgw_info["server"]["api_inc"],0,3));
$d2 = strtolower(substr($phpgw_info["server"]["server_root"],0,3));
$d3 = strtolower(substr($phpgw_info["server"]["app_inc"],0,3));
if($d1 == "htt" || $d1 == "ftp" || $d2 == "htt" || $d2 == "ftp" || $d3 == "htt" || $d3 == "ftp") {
echo "Failed attempt to break in via an old Security Hole!<br>\n";
exit;
} unset($d1);unset($d2);unset($d3);
/****************************************************************************\
* Direct functions, which are not part of the API class *
* because they are require to be availble at the lowest level. *
@ -43,7 +35,7 @@
$classname = $classpart[1];
if (!$phpgw_info["flags"]["included_classes"][$classname]){
$phpgw_info["flags"]["included_classes"][$classname] = True;
include($phpgw_info["server"]["include_root"]."/".$appname."/inc/class.".$classname.".inc.php");
include(PHPGW_INCLUDE_ROOT."/".$appname."/inc/class.".$classname.".inc.php");
}
if ($constructor_param == ""){ $obj = new $classname; }else{$obj = new $classname($constructor_param); }
return $obj;
@ -203,14 +195,24 @@
function phpgw_fillarray()
{
global $phpgw, $phpgw_info, $cd, $colspan;
$phpgw_info["server"]["template_dir"] = $phpgw->common->get_tpl_dir("phpgwapi");
$phpgw_info["server"]["images_dir"] = $phpgw->common->get_image_path("phpgwapi");
$phpgw_info["server"]["images_filedir"] = $phpgw->common->get_image_dir("phpgwapi");
$phpgw_info["server"]["app_root"] = $phpgw->common->get_app_dir();
$phpgw_info["server"]["app_inc"] = $phpgw->common->get_inc_dir();
$phpgw_info["server"]["app_tpl"] = $phpgw->common->get_tpl_dir();
$phpgw_info["server"]["app_images"] = $phpgw->common->get_image_path();
$phpgw_info["server"]["app_images_dir"] = $phpgw->common->get_image_dir();
define("PHPGW_TEMPLATE_DIR",$phpgw->common->get_tpl_dir("phpgwapi"));
define("PHPGW_IMAGES_DIR", $phpgw->common->get_image_path("phpgwapi"));
define("PHPGW_IMAGES_FILEDIR", $phpgw->common->get_image_dir("phpgwapi"));
define("PHPGW_APP_ROOT", $phpgw->common->get_app_dir());
define("PHPGW_APP_INC", $phpgw->common->get_inc_dir());
define("PHPGW_APP_TPL", $phpgw->common->get_tpl_dir());
define("PHPGW_IMAGES", $phpgw->common->get_image_path());
define("PHPGW_IMAGES_DIR", $phpgw->common->get_image_dir());
/* LEGACY SUPPORT!!! WILL BE DELETED AFTER 0.9.11 IS RELEASED !!! */
$phpgw_info["server"]["template_dir"] = PHPGW_TEMPLATE_DIR;
$phpgw_info["server"]["images_dir"] = PHPGW_IMAGES_DIR;
$phpgw_info["server"]["images_filedir"] = PHPGW_IMAGES_FILEDIR;
$phpgw_info["server"]["app_root"] = PHPGW_APP_ROOT;
$phpgw_info["server"]["app_inc"] = PHPGW_APP_INC;
$phpgw_info["server"]["app_tpl"] = PHPGW_APP_TPL;
$phpgw_info["server"]["app_images"] = PHPGW_IMAGES;
$phpgw_info["server"]["app_images_dir"] = PHPGW_IMAGES_DIR;
/* ********This sets the user variables******** */
$phpgw_info["user"]["private_dir"] = $phpgw_info["server"]["files_dir"] . "/users/"
@ -277,13 +279,13 @@
/*************************************************************************\
* These lines load up the themes *
\*************************************************************************/
include($phpgw_info["server"]["server_root"] . "/phpgwapi/themes/" .
include(PHPGW_SERVER_ROOT . "/phpgwapi/themes/" .
$phpgw_info["user"]["preferences"]["common"]["theme"] . ".theme");
if ($phpgw_info["theme"]["bg_color"] == "") {
/* Looks like there was a problem finding that theme. Try the default */
echo "Warning: error locating selected theme";
include ($phpgw_info["server"]["server_root"] . "/phpgwapi/themes/default.theme");
include (PHPGW_SERVER_ROOT . "/phpgwapi/themes/default.theme");
if ($phpgw_info["theme"]["bg_color"] == "") {
// Hope we don't get to this point. Better then the user seeing a
// complety back screen and not know whats going on
@ -326,12 +328,12 @@
\*************************************************************************/
/* Then the include file */
if (!preg_match ("/phpgwapi/i", $phpgw_info["server"]["app_inc"]) && file_exists ($phpgw_info["server"]["app_inc"]."/functions.inc.php")){
include($phpgw_info["server"]["app_inc"]."/functions.inc.php");
include(PHPGW_API_INC."/functions.inc.php");
}
if (!$phpgw_info["flags"]["noheader"] &&
!$phpgw_info["flags"]["noappheader"] &&
file_exists ($phpgw_info["server"]["app_inc"]."/header.inc.php")) {
include($phpgw_info["server"]["app_inc"]."/header.inc.php");
include(PHPGW_API_INC."/header.inc.php");
}
}
error_reporting(7);

View File

@ -152,7 +152,10 @@
$phpgw_info["server"]["db_type"] = $phpgw_domain[$phpgw_info["server"]["default_domain"]]["db_type"];
$phpgw_info["server"]["config_passwd"] = $phpgw_domain[$phpgw_info["server"]["default_domain"]]["config_passwd"];
}
if (!isset($phpgw_info["server"]["include_root"]) && $phpgw_info["server"]["header_version"] <= 1.6) {
if (defined("PHPGW_SERVER_ROOT")) {
$phpgw_info["server"]["server_root"] = PHPGW_SERVER_ROOT;
$phpgw_info["server"]["include_root"] = PHPGW_INCLUDE_ROOT;
}elseif (!isset($phpgw_info["server"]["include_root"]) && $phpgw_info["server"]["header_version"] <= 1.6) {
$phpgw_info["server"]["include_root"] = $phpgw_info["server"]["server_root"];
}elseif (!isset($phpgw_info["server"]["header_version"]) && $phpgw_info["server"]["header_version"] <= 1.6) {
$phpgw_info["server"]["include_root"] = $phpgw_info["server"]["server_root"];

View File

@ -12,4 +12,4 @@
/* $Id$ */
$phpgw_info["server"]["versions"]["phpgwapi"] = "0.9.10pre4";
$phpgw_info["server"]["versions"]["current_header"] = "1.10";
$phpgw_info["server"]["versions"]["current_header"] = "1.11";