forked from extern/egroupware
fixed createobject to only include any given file once
This commit is contained in:
parent
3e2952ece1
commit
156a6b6220
@ -99,18 +99,14 @@
|
|||||||
/* Load selected accounts class */
|
/* Load selected accounts class */
|
||||||
if (empty($phpgw_info["server"]["account_repository"])){$phpgw_info["server"]["account_repository"] = $phpgw_info["server"]["auth_type"];}
|
if (empty($phpgw_info["server"]["account_repository"])){$phpgw_info["server"]["account_repository"] = $phpgw_info["server"]["auth_type"];}
|
||||||
$this->accounts = CreateObject("phpgwapi.accounts");
|
$this->accounts = CreateObject("phpgwapi.accounts");
|
||||||
|
$this->preferences = CreateObject("phpgwapi.preferences", 0);
|
||||||
include($phpgw_info["server"]["api_inc"] . "/class.preferences.inc.php");
|
|
||||||
$this->preferences = new preferences(0);
|
|
||||||
//$this->preferences = CreateObject("phpgwapi.preferences", 0);
|
|
||||||
|
|
||||||
include($phpgw_info["server"]["api_inc"] . "/class.crypto.inc.php");
|
include($phpgw_info["server"]["api_inc"] . "/class.crypto.inc.php");
|
||||||
$this->session = CreateObject("phpgwapi.sessions");
|
$this->session = CreateObject("phpgwapi.sessions");
|
||||||
|
|
||||||
if ($phpgw_info["flags"]["currentapp"] == "login") {
|
if ($phpgw_info["flags"]["currentapp"] == "login") {
|
||||||
$log = explode("@",$login);
|
$log = explode("@",$login);
|
||||||
//$this->preferences = CreateObject("phpgwapi.preferences", $log[0]);
|
$this->preferences = CreateObject("phpgwapi.preferences", $log[0]);
|
||||||
$this->preferences = new preferences($log[0]);
|
|
||||||
}else{
|
}else{
|
||||||
if (! $this->session->verify()) {
|
if (! $this->session->verify()) {
|
||||||
$this->db->query("select config_value from config where config_name='webserver_url'",__LINE__,__FILE__);
|
$this->db->query("select config_value from config where config_name='webserver_url'",__LINE__,__FILE__);
|
||||||
@ -118,8 +114,7 @@
|
|||||||
Header("Location: " . $this->redirect($this->link($this->db->f("config_value")."/login.php","cd=10")));
|
Header("Location: " . $this->redirect($this->link($this->db->f("config_value")."/login.php","cd=10")));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
//$this->preferences = CreateObject("phpgwapi.preferences", intval($phpgw_info["user"]["account_id"]));
|
$this->preferences = CreateObject("phpgwapi.preferences", intval($phpgw_info["user"]["account_id"]));
|
||||||
$this->preferences = new preferences(intval($phpgw_info["user"]["account_id"]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->translation = CreateObject("phpgwapi.translation");
|
$this->translation = CreateObject("phpgwapi.translation");
|
||||||
|
@ -24,16 +24,15 @@
|
|||||||
* Direct functions, which are not part of the API class *
|
* Direct functions, which are not part of the API class *
|
||||||
* for whatever reason. *
|
* for whatever reason. *
|
||||||
\****************************************************************************/
|
\****************************************************************************/
|
||||||
function CreateObject($classname, $val = ""){
|
function CreateObject($classname, $constructor_param = ""){
|
||||||
global $phpgw, $phpgw_info, $phpgw_domain;
|
global $phpgw, $phpgw_info, $phpgw_domain;
|
||||||
$classpart = explode (".", $classname);
|
$classpart = explode (".", $classname);
|
||||||
$includedChk = sprintf("%s_INC_PHP_INCLUDED", strtoupper($classpart[1]));
|
if (!$phpgw_info["flags"]["included_classes"][$classpart[1]]){
|
||||||
//$includedChk = sprintf("%s_PHP3_INCLUDED", strtoupper($classpart[1]));
|
$phpgw_info["flags"]["included_classes"][$classpart[1]] = True;
|
||||||
if (!isset($GLOBALS["$includedChk"])){
|
|
||||||
include($phpgw_info["server"]["include_root"]."/".$classpart[0]."/inc/class.".$classpart[1].".inc.php");
|
include($phpgw_info["server"]["include_root"]."/".$classpart[0]."/inc/class.".$classpart[1].".inc.php");
|
||||||
$obj = new $classpart[1]($val);
|
|
||||||
return $obj;
|
|
||||||
}
|
}
|
||||||
|
$obj = new $classpart[1]($constructor_param);
|
||||||
|
return $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
function lang($key, $m1="", $m2="", $m3="", $m4="", $m5="", $m6="", $m7="", $m8="", $m9="", $m10="" )
|
function lang($key, $m1="", $m2="", $m3="", $m4="", $m5="", $m6="", $m7="", $m8="", $m9="", $m10="" )
|
||||||
|
Loading…
Reference in New Issue
Block a user