Fix: Echec des triggers quand il y a 2 triggers avec meme nom
Fix: Mauvais triggers appelé quand creation user.
This commit is contained in:
parent
1f7a2b715c
commit
d7edb59b09
@ -35,8 +35,7 @@
|
|||||||
|
|
||||||
class Interfaces
|
class Interfaces
|
||||||
{
|
{
|
||||||
//! Repertoire contenant les definitions des triggers
|
var $dir; // Repertoire contenant les fichiers triggers
|
||||||
var $dir;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Constructeur.
|
* \brief Constructeur.
|
||||||
@ -72,11 +71,18 @@ class Interfaces
|
|||||||
$modName = "Interface".ucfirst($reg[1]);
|
$modName = "Interface".ucfirst($reg[1]);
|
||||||
//print "file=$file"; print "modName=$modName"; exit;
|
//print "file=$file"; print "modName=$modName"; exit;
|
||||||
if ($modName)
|
if ($modName)
|
||||||
|
{
|
||||||
|
if (in_array($modName,$modules))
|
||||||
|
{
|
||||||
|
dolibarr_syslog("Error: Trigger file with name '$modName' already launched. Remove duplicate file.");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
include_once($this->dir."/".$file);
|
include_once($this->dir."/".$file);
|
||||||
$objMod = new $modName($this->db);
|
$objMod = new $modName($this->db);
|
||||||
if ($objMod)
|
if ($objMod)
|
||||||
{
|
{
|
||||||
|
$modules[$i] = $modName;
|
||||||
if ($objMod->run_trigger($action,$object,$user,$lang,$conf) > 0)
|
if ($objMod->run_trigger($action,$object,$user,$lang,$conf) > 0)
|
||||||
{
|
{
|
||||||
$nbok++;
|
$nbok++;
|
||||||
@ -85,6 +91,8 @@ class Interfaces
|
|||||||
{
|
{
|
||||||
$nbko++;
|
$nbko++;
|
||||||
}
|
}
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -652,6 +652,7 @@ class User
|
|||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."user (datec,login,ldap_sid) VALUES(now(),'".addslashes($this->login)."','".$this->ldap_sid."')";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."user (datec,login,ldap_sid) VALUES(now(),'".addslashes($this->login)."','".$this->ldap_sid."')";
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
|
|
||||||
|
dolibarr_syslog("User.class::create sql=".$sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$table = "".MAIN_DB_PREFIX."user";
|
$table = "".MAIN_DB_PREFIX."user";
|
||||||
@ -666,7 +667,7 @@ class User
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update minor fields
|
// Update minor fields
|
||||||
if ($this->update() < 0)
|
if ($this->update(1) < 0)
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->error();
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
|
|||||||
@ -166,7 +166,7 @@ if ($_POST["action"] == 'add' && $canadduser)
|
|||||||
$db->rollback();
|
$db->rollback();
|
||||||
|
|
||||||
//$message='<div class="error">'.$langs->trans("ErrorLoginAlreadyExists",$edituser->login).'</div>';
|
//$message='<div class="error">'.$langs->trans("ErrorLoginAlreadyExists",$edituser->login).'</div>';
|
||||||
$message='<div class="error">'.$edituser->error.$id.'</div>';
|
$message='<div class="error">'.$edituser->error.'</div>';
|
||||||
|
|
||||||
$action="create"; // Go back to create page
|
$action="create"; // Go back to create page
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user