correction de la fonction getdsn()
ajout de la focntion getdsn modifie dans pgsql.lib et mysql.lib modification de getdsn dans main.inc.php
This commit is contained in:
parent
633d0cbe24
commit
40f5f512cc
@ -469,9 +469,11 @@ class DoliDb {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getdsn()
|
function getdsn($db_type,$db_user,$db_pass,$db_host,$dbname)
|
||||||
{
|
{
|
||||||
$pear = $dolibarr_main_db_type.'://'.$dolibarr_main_db_user.':'.$dolibarr_main_db_pass.'@'.$dolibarr_main_db_host.'/'.$dolibarr_main_db_name;
|
$pear = $db_type.'://'.$db_user.':'.$db_pass.'@'.
|
||||||
|
$db_host.'/'.$db_name;
|
||||||
|
|
||||||
return $pear;
|
return $pear;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -488,11 +488,13 @@ class DoliDb {
|
|||||||
return pg_affected_rows($this->db);
|
return pg_affected_rows($this->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getdsn()
|
function getdsn($db_type,$db_user,$db_pass,$db_host,$dbname)
|
||||||
{
|
{
|
||||||
$pear = $dolibarr_main_db_type.'://'.$dolibarr_main_db_user.':'.$dolibarr_main_db_pass.'@'.$dolibarr_main_db_host.'/'.$dolibarr_main_db_name;
|
$pear = $db_type.'://'.$db_user.':'.$db_pass.'@'.
|
||||||
return $pear;
|
$db_host.'/'.$db_name;
|
||||||
}
|
|
||||||
|
return $pear;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -129,19 +129,21 @@ else
|
|||||||
require_once DOL_DOCUMENT_ROOT."/includes/pear/Auth/Auth.php";
|
require_once DOL_DOCUMENT_ROOT."/includes/pear/Auth/Auth.php";
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
"dsn" => $conf->db->getdsn(),
|
// "dsn" => $conf->db->getdsn(),
|
||||||
|
"dsn" => $db->getdsn($dolibarr_main_db_type,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_host,$dolibarr_main_db_name),
|
||||||
"table" => MAIN_DB_PREFIX."user",
|
"table" => MAIN_DB_PREFIX."user",
|
||||||
"usernamecol" => "login",
|
"usernamecol" => "login",
|
||||||
"passwordcol" => "pass",
|
"passwordcol" => "pass",
|
||||||
"cryptType" => "none",
|
"cryptType" => "none",
|
||||||
);
|
);
|
||||||
|
|
||||||
$aDol = new DOLIAuth("DB", $params, "loginfunction");
|
$aDol = new DOLIAuth("DB", $params, "loginfunction");
|
||||||
$aDol->start();
|
$aDol->start();
|
||||||
$result = $aDol->getAuth();
|
$result = $aDol->getAuth();
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
// Authentification Auth OK, on va chercher les infos du user
|
// Authentification Auth OK, on va chercher les infos du user
|
||||||
|
dolibarr_syslog ("auth demarre va chercher les infos du user");
|
||||||
$user->fetch($aDol->getUsername());
|
$user->fetch($aDol->getUsername());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user