Merge pull request #1348 from atm-alexis/3.5

Improper use of delete() function and ldap with multientity bug corrections
This commit is contained in:
Laurent Destailleur 2013-12-16 05:26:31 -08:00
commit ca36a4dd97
4 changed files with 12 additions and 3 deletions

View File

@ -2056,7 +2056,7 @@ class Propal extends CommonObject
{
// We remove directory
$ref = dol_sanitizeFileName($this->ref);
if ($conf->propal->dir_output)
if ($conf->propal->dir_output && !empty($this->ref))
{
$dir = $conf->propal->dir_output . "/" . $ref ;
$file = $dir . "/" . $ref . ".pdf";

View File

@ -2457,7 +2457,7 @@ class Commande extends CommonOrder
// On efface le repertoire de pdf provisoire
$comref = dol_sanitizeFileName($this->ref);
if ($conf->commande->dir_output)
if ($conf->commande->dir_output && !empty($this->ref))
{
$dir = $conf->commande->dir_output . "/" . $comref ;
$file = $conf->commande->dir_output . "/" . $comref . "/" . $comref . ".pdf";

View File

@ -1323,7 +1323,7 @@ class Facture extends CommonInvoice
{
// On efface le repertoire de pdf provisoire
$ref = dol_sanitizeFileName($this->ref);
if ($conf->facture->dir_output)
if ($conf->facture->dir_output && !empty($this->ref))
{
$dir = $conf->facture->dir_output . "/" . $ref;
$file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf";

View File

@ -168,6 +168,15 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
{
dol_syslog("functions_ldap::check_user_password_ldap Sync user found id=".$user->id);
// On verifie si le login a change et on met a jour les attributs dolibarr
if ($conf->multicompany->enabled) {
global $mc;
$ret=$mc->checkRight($user->id, $entitytotest);
if ($ret < 0) $login=false; // provoque l'echec de l'identification
}
if ($user->login != $ldap->login && $ldap->login)
{
$user->login = $ldap->login;