mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:04 +01:00
Im going to stick to using the phpgw.inc.php
This commit is contained in:
parent
e7e6373e52
commit
69769d81a0
@ -20,42 +20,18 @@
|
||||
exit;
|
||||
} unset($d1);unset($d2);unset($d3);
|
||||
|
||||
$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 *
|
||||
* for whatever reason. *
|
||||
\****************************************************************************/
|
||||
function CreateObject($classname, $val = "")
|
||||
{
|
||||
function CreateObject($classname, $val = ""){
|
||||
global $phpgw, $phpgw_info, $phpgw_domain;
|
||||
$classpart = explode (".", $classname);
|
||||
$classpart_count = count($classpart);
|
||||
if ($classpart_count >= 1){
|
||||
$includedChk = sprintf("%s_PHP3_INCLUDED", strtoupper($classpart[1]));
|
||||
}else{
|
||||
$includedChk = sprintf("%s_PHP3_INCLUDED", strtoupper($classpart[0]));
|
||||
}
|
||||
$includedChk = sprintf("%s_INC_PHP_INCLUDED", strtoupper($classpart[1]));
|
||||
//$includedChk = sprintf("%s_PHP3_INCLUDED", strtoupper($classpart[1]));
|
||||
if (!isset($GLOBALS["$includedChk"])){
|
||||
switch($classpart_count){
|
||||
case 1:
|
||||
include($phpgw_info["server"]["include_root"]."/".$phpgw_info["flags"]["currentapp"]."/inc/class.".$classpart[0].".inc.php");
|
||||
break;
|
||||
case 2:
|
||||
include($phpgw_info["server"]["include_root"]."/".$classpart[0]."/inc/class.".$classpart[1].".inc.php");
|
||||
break;
|
||||
}
|
||||
if ($classpart_count >= 1){
|
||||
$obj = new $classpart[1]($val);
|
||||
}else{
|
||||
$obj = new $classpart[0]($val);
|
||||
}
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user