fixes authing against ldap

This commit is contained in:
skeeter 2001-02-09 03:11:59 +00:00
parent 5c9323a2c4
commit ea94c3fa4d
2 changed files with 19 additions and 14 deletions

View File

@ -59,20 +59,9 @@
function phpgw_()
{
global $phpgw_info, $sessionid, $login;
/************************************************************************\
* Required classes *
\************************************************************************/
$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;
}
$this->common = CreateObject("phpgwapi.common");
$this->hooks = CreateObject("phpgwapi.hooks");
$this->auth = createobject("phpgwapi.auth");
@ -87,6 +76,19 @@
/**************************************************************************\
* 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)
{
return htmlspecialchars(stripslashes($s));
@ -131,4 +133,4 @@
return $this->translation->translate($key);
}
} //end phpgw class
?>
?>

View File

@ -185,14 +185,17 @@
\****************************************************************************/
/* Load main class */
$phpgw = CreateObject("phpgwapi.phpgw");
$phpgw->phpgw_();
print_debug('main class loaded');
$phpgw->load_db();
/* Fill phpgw_info["server"] array */
$phpgw->db->query("select * from phpgw_config",__LINE__,__FILE__);
while ($phpgw->db->next_record()) {
$phpgw_info["server"][$phpgw->db->f("config_name")] = stripslashes($phpgw->db->f("config_value"));
}
$phpgw->phpgw_();
print_debug('main class loaded');
// Handy little shortcut
$sep = $phpgw_info["server"]["dir_separator"];