Fix: On rend obligatoire les paramètre de DoliDb afin de permettre l'utilisation d'un mot de passe vide.
This commit is contained in:
parent
f424c9550a
commit
82579a6958
@ -71,33 +71,19 @@ class DoliDb
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Ouverture d'une connection vers le serveur et éventuellement une database.
|
\brief Ouverture d'une connection vers le serveur et éventuellement une database.
|
||||||
\param type type de base de données (mysql ou pgsql)
|
\param type type de base de données (mysql ou pgsql)
|
||||||
\param host addresse de la base de données
|
\param host addresse de la base de données
|
||||||
\param user nom de l'utilisateur autorisé
|
\param user nom de l'utilisateur autorisé
|
||||||
\param pass mot de passe
|
\param pass mot de passe
|
||||||
\param name nom de la database
|
\param name nom de la database
|
||||||
\return int 1 en cas de succès, 0 sinon
|
\return int 1 en cas de succès, 0 sinon
|
||||||
*/
|
*/
|
||||||
function DoliDb($type = 'mysql', $host = '', $user = '', $pass = '', $name = '', $newlink=0)
|
function DoliDb($type='mysql', $host, $user, $pass, $name='', $newlink=0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$this->transaction_opened=0;
|
$this->transaction_opened=0;
|
||||||
|
|
||||||
if (! $host) $host = $conf->db->host;
|
|
||||||
if (! $user) $user = $conf->db->user;
|
|
||||||
if (! $pass) $pass = $conf->db->pass;
|
|
||||||
if (! $name) $name = $conf->db->name;
|
|
||||||
|
|
||||||
//print "Name DB: $host,$user,$pass,$name<br>";
|
|
||||||
if (! $host)
|
|
||||||
{
|
|
||||||
$this->connected = 0;
|
|
||||||
$this->ok = 0;
|
|
||||||
dolibarr_syslog("DoliDB::DoliDB : Erreur Connect, wrong host parameters");
|
|
||||||
return $this->ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Essai connexion serveur
|
// Essai connexion serveur
|
||||||
$this->db = $this->connect($host, $user, $pass, $newlink);
|
$this->db = $this->connect($host, $user, $pass, $newlink);
|
||||||
|
|
||||||
|
|||||||
@ -63,16 +63,11 @@ class DoliDb
|
|||||||
\param name nom de la database
|
\param name nom de la database
|
||||||
\return int 1 en cas de succès, 0 sinon
|
\return int 1 en cas de succès, 0 sinon
|
||||||
*/
|
*/
|
||||||
function DoliDb($type = 'pgsql', $host = '', $user = '', $pass = '', $name = '')
|
function DoliDb($type='pgsql', $host, $user, $pass, $name='')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$this->transaction_opened=0;
|
$this->transaction_opened=0;
|
||||||
|
|
||||||
if (! $host) $host = $conf->db->host;
|
|
||||||
if (! $user) $user = $conf->db->user;
|
|
||||||
if (! $pass) $pass = $conf->db->pass;
|
|
||||||
if (! $name) $name = $conf->db->name;
|
|
||||||
|
|
||||||
//print "Name DB: $host,$user,$pass,$name<br>";
|
//print "Name DB: $host,$user,$pass,$name<br>";
|
||||||
if (! $host)
|
if (! $host)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -107,7 +107,7 @@ require_once(DOL_DOCUMENT_ROOT ."/notify.class.php");
|
|||||||
require_once(DOL_DOCUMENT_ROOT ."/address.class.php");
|
require_once(DOL_DOCUMENT_ROOT ."/address.class.php");
|
||||||
|
|
||||||
|
|
||||||
$db = new DoliDb();
|
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||||
$user = new User($db);
|
$user = new User($db);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -32,8 +32,11 @@ require("../../retourbplc.class.php");
|
|||||||
require("../../don.class.php");
|
require("../../don.class.php");
|
||||||
|
|
||||||
$conf = new Conf();
|
$conf = new Conf();
|
||||||
|
$conf->db->type = $dolibarr_main_db_type;
|
||||||
conf->db->type = $dolibarr_main_db_type;
|
$conf->db->host = $dolibarr_main_db_host;
|
||||||
|
$conf->db->name = $dolibarr_main_db_name;
|
||||||
|
$conf->db->user = $dolibarr_main_db_user;
|
||||||
|
$conf->db->pass = $dolibarr_main_db_pass;
|
||||||
|
|
||||||
// Si type non défini (pour compatibilité avec ancienne install), on
|
// Si type non défini (pour compatibilité avec ancienne install), on
|
||||||
// travail avec mysql
|
// travail avec mysql
|
||||||
@ -41,7 +44,7 @@ if (! $conf->db->type) { $conf->db->type = 'mysql'; }
|
|||||||
|
|
||||||
require (DOL_DOCUMENT_ROOT ."/lib/".$dolibarr_main_db_type.".lib.php");
|
require (DOL_DOCUMENT_ROOT ."/lib/".$dolibarr_main_db_type.".lib.php");
|
||||||
|
|
||||||
$db = new DoliDb();
|
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||||
|
|
||||||
$retbplc = new Retourbplc($db);
|
$retbplc = new Retourbplc($db);
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,13 @@
|
|||||||
|
|
||||||
|
|
||||||
$conf = new Conf();
|
$conf = new Conf();
|
||||||
$db = new DoliDb();
|
$conf->db->type = $dolibarr_main_db_type;
|
||||||
|
$conf->db->host = $dolibarr_main_db_host;
|
||||||
|
$conf->db->name = $dolibarr_main_db_name;
|
||||||
|
$conf->db->user = $dolibarr_main_db_user;
|
||||||
|
$conf->db->pass = $dolibarr_main_db_pass;
|
||||||
|
|
||||||
|
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||||
$a = setlocale(LC_TIME, "fr_FR");
|
$a = setlocale(LC_TIME, "fr_FR");
|
||||||
$sql = "SELECT ".$db->pdate("f.datef")." as datef, s.nom, f.total, f.note, f.paye";
|
$sql = "SELECT ".$db->pdate("f.datef")." as datef, s.nom, f.total, f.note, f.paye";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s";
|
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s";
|
||||||
|
|||||||
@ -22,7 +22,14 @@
|
|||||||
|
|
||||||
|
|
||||||
$conf = new Conf();
|
$conf = new Conf();
|
||||||
$db = new DoliDb();
|
$conf->db->type = $dolibarr_main_db_type;
|
||||||
|
$conf->db->host = $dolibarr_main_db_host;
|
||||||
|
$conf->db->name = $dolibarr_main_db_name;
|
||||||
|
$conf->db->user = $dolibarr_main_db_user;
|
||||||
|
$conf->db->pass = $dolibarr_main_db_pass;
|
||||||
|
|
||||||
|
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||||
|
|
||||||
$a = setlocale(LC_TIME, "fr_FR");
|
$a = setlocale(LC_TIME, "fr_FR");
|
||||||
$sql = "SELECT ".$db->pdate("d.datedon")." as datedon, d.nom, d.prenom, d.amount, d.public, d.societe";
|
$sql = "SELECT ".$db->pdate("d.datedon")." as datedon, d.nom, d.prenom, d.amount, d.public, d.societe";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."don as d";
|
$sql .= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||||
|
|||||||
@ -24,8 +24,11 @@ require("../../don.class.php");
|
|||||||
require("../../conf/conf.class.php");
|
require("../../conf/conf.class.php");
|
||||||
|
|
||||||
$conf = new Conf();
|
$conf = new Conf();
|
||||||
|
$conf->db->type = $dolibarr_main_db_type;
|
||||||
conf->db->type = $dolibarr_main_db_type;
|
$conf->db->host = $dolibarr_main_db_host;
|
||||||
|
$conf->db->name = $dolibarr_main_db_name;
|
||||||
|
$conf->db->user = $dolibarr_main_db_user;
|
||||||
|
$conf->db->pass = $dolibarr_main_db_pass;
|
||||||
|
|
||||||
// Si type non défini (pour compatibilité avec ancienne install), on
|
// Si type non défini (pour compatibilité avec ancienne install), on
|
||||||
// travail avec mysql
|
// travail avec mysql
|
||||||
@ -36,7 +39,8 @@ require("../../lib/.$dolibarr_main_db_type.lib.php");
|
|||||||
if ($conf->don->enabled)
|
if ($conf->don->enabled)
|
||||||
{
|
{
|
||||||
|
|
||||||
$db = new DoliDb();
|
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||||
|
|
||||||
$don = new Don($db);
|
$don = new Don($db);
|
||||||
|
|
||||||
$don->projetid = $_POST["projetid"];
|
$don->projetid = $_POST["projetid"];
|
||||||
|
|||||||
@ -62,7 +62,14 @@ if (file_exists ($thermlib))
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$conf = new Conf();
|
$conf = new Conf();
|
||||||
$dbt = new DoliDb();
|
$conf->db->type = $dolibarr_main_db_type;
|
||||||
|
$conf->db->host = $dolibarr_main_db_host;
|
||||||
|
$conf->db->name = $dolibarr_main_db_name;
|
||||||
|
$conf->db->user = $dolibarr_main_db_user;
|
||||||
|
$conf->db->pass = $dolibarr_main_db_pass;
|
||||||
|
|
||||||
|
$dbt = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||||
|
|
||||||
$dontherm = new Don($dbt);
|
$dontherm = new Don($dbt);
|
||||||
|
|
||||||
$actualValue = $dontherm->sum_actual();
|
$actualValue = $dontherm->sum_actual();
|
||||||
|
|||||||
@ -51,9 +51,11 @@ class ProcessGraphClients
|
|||||||
|
|
||||||
function ProcessGraphClients( $ident , $cpc)
|
function ProcessGraphClients( $ident , $cpc)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$this->ident = $ident;
|
$this->ident = $ident;
|
||||||
$this->cpc = $cpc;
|
$this->cpc = $cpc;
|
||||||
$this->db = new DoliDb('','','','','',1);
|
$this->db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function go()
|
function go()
|
||||||
|
|||||||
@ -50,9 +50,11 @@ class ProcessGraphContrats
|
|||||||
|
|
||||||
function ProcessGraphContrats( $ident , $cpc)
|
function ProcessGraphContrats( $ident , $cpc)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$this->ident = $ident;
|
$this->ident = $ident;
|
||||||
$this->cpc = $cpc;
|
$this->cpc = $cpc;
|
||||||
$this->db = new DoliDb('','','','','',1);
|
$this->db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function go($contrat_id = 0)
|
function go($contrat_id = 0)
|
||||||
|
|||||||
@ -50,9 +50,11 @@ class ProcessGraphLignes
|
|||||||
|
|
||||||
function ProcessGraphLignes( $ident , $cpc)
|
function ProcessGraphLignes( $ident , $cpc)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$this->ident = $ident;
|
$this->ident = $ident;
|
||||||
$this->cpc = $cpc;
|
$this->cpc = $cpc;
|
||||||
$this->db = new DoliDb('','','','','',1);
|
$this->db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function go()
|
function go()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user