forked from extern/egroupware
make this a tiny bit cleaner
This commit is contained in:
parent
ea94c3fa4d
commit
b88aeb3515
@ -57,7 +57,20 @@
|
|||||||
// You could redirect them to login.php with code 2 or use the default
|
// You could redirect them to login.php with code 2 or use the default
|
||||||
// I recommend using the default until all of the bugs are worked out.
|
// I recommend using the default until all of the bugs are worked out.
|
||||||
|
|
||||||
function phpgw_()
|
function phpgw() {
|
||||||
|
global $phpgw_info;
|
||||||
|
$this->db = CreateObject("phpgwapi.db");
|
||||||
|
$this->db->Host = $phpgw_info["server"]["db_host"];
|
||||||
|
$this->db->Type = $phpgw_info["server"]["db_type"];
|
||||||
|
$this->db->Database = $phpgw_info["server"]["db_name"];
|
||||||
|
$this->db->User = $phpgw_info["server"]["db_user"];
|
||||||
|
$this->db->Password = $phpgw_info["server"]["db_pass"];
|
||||||
|
if ($this->debug) {
|
||||||
|
$this->db->Debug = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function load_core_objects()
|
||||||
{
|
{
|
||||||
/************************************************************************\
|
/************************************************************************\
|
||||||
* Required classes *
|
* Required classes *
|
||||||
@ -77,18 +90,6 @@
|
|||||||
* Core functions *
|
* Core functions *
|
||||||
\**************************************************************************/
|
\**************************************************************************/
|
||||||
|
|
||||||
function load_db() {
|
|
||||||
global $phpgw_info;
|
|
||||||
$this->db = CreateObject("phpgwapi.db");
|
|
||||||
$this->db->Host = $phpgw_info["server"]["db_host"];
|
|
||||||
$this->db->Type = $phpgw_info["server"]["db_type"];
|
|
||||||
$this->db->Database = $phpgw_info["server"]["db_name"];
|
|
||||||
$this->db->User = $phpgw_info["server"]["db_user"];
|
|
||||||
$this->db->Password = $phpgw_info["server"]["db_pass"];
|
|
||||||
if ($this->debug) {
|
|
||||||
$this->db->Debug = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function strip_html($s)
|
function strip_html($s)
|
||||||
{
|
{
|
||||||
return htmlspecialchars(stripslashes($s));
|
return htmlspecialchars(stripslashes($s));
|
||||||
|
@ -185,7 +185,6 @@
|
|||||||
\****************************************************************************/
|
\****************************************************************************/
|
||||||
/* Load main class */
|
/* Load main class */
|
||||||
$phpgw = CreateObject("phpgwapi.phpgw");
|
$phpgw = CreateObject("phpgwapi.phpgw");
|
||||||
$phpgw->load_db();
|
|
||||||
|
|
||||||
/* Fill phpgw_info["server"] array */
|
/* Fill phpgw_info["server"] array */
|
||||||
$phpgw->db->query("select * from phpgw_config",__LINE__,__FILE__);
|
$phpgw->db->query("select * from phpgw_config",__LINE__,__FILE__);
|
||||||
@ -193,7 +192,7 @@
|
|||||||
$phpgw_info["server"][$phpgw->db->f("config_name")] = stripslashes($phpgw->db->f("config_value"));
|
$phpgw_info["server"][$phpgw->db->f("config_name")] = stripslashes($phpgw->db->f("config_value"));
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpgw->phpgw_();
|
$phpgw->load_core_objects();
|
||||||
print_debug('main class loaded');
|
print_debug('main class loaded');
|
||||||
|
|
||||||
// Handy little shortcut
|
// Handy little shortcut
|
||||||
|
Loading…
Reference in New Issue
Block a user