diff --git a/header.inc.php.template b/header.inc.php.template index b713e9dcf0..0984c03233 100644 --- a/header.inc.php.template +++ b/header.inc.php.template @@ -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 diff --git a/phpgwapi/inc/class.accounts.inc.php b/phpgwapi/inc/class.accounts.inc.php index c35cd8a9b8..1be82c966f 100644 --- a/phpgwapi/inc/class.accounts.inc.php +++ b/phpgwapi/inc/class.accounts.inc.php @@ -1,4 +1,11 @@ \ No newline at end of file diff --git a/phpgwapi/inc/class.auth.inc.php b/phpgwapi/inc/class.auth.inc.php index dd53869297..a9946ab3b3 100644 --- a/phpgwapi/inc/class.auth.inc.php +++ b/phpgwapi/inc/class.auth.inc.php @@ -1 +1,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/phpgwapi/inc/class.db.inc.php b/phpgwapi/inc/class.db.inc.php index 050f4d04d1..07a5bb2cc3 100644 --- a/phpgwapi/inc/class.db.inc.php +++ b/phpgwapi/inc/class.db.inc.php @@ -1 +1,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/phpgwapi/inc/class.phpgw.inc.php b/phpgwapi/inc/class.phpgw.inc.php index 576fca6d78..4874c21fdd 100644 --- a/phpgwapi/inc/class.phpgw.inc.php +++ b/phpgwapi/inc/class.phpgw.inc.php @@ -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"); diff --git a/phpgwapi/inc/class.translation.inc.php b/phpgwapi/inc/class.translation.inc.php index f2ff21e9bd..fc6a3383ed 100644 --- a/phpgwapi/inc/class.translation.inc.php +++ b/phpgwapi/inc/class.translation.inc.php @@ -1 +1,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php index 639e38b9c0..98dcfe1b69 100644 --- a/phpgwapi/inc/functions.inc.php +++ b/phpgwapi/inc/functions.inc.php @@ -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!
\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); diff --git a/setup/manageheader.php b/setup/manageheader.php index 7875cac2e5..cd74c5844c 100644 --- a/setup/manageheader.php +++ b/setup/manageheader.php @@ -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"]; diff --git a/version.inc.php b/version.inc.php index e2da41a2bf..0044949474 100644 --- a/version.inc.php +++ b/version.inc.php @@ -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";