Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 12.0
This commit is contained in:
commit
e388123a3a
@ -155,7 +155,7 @@ class FactureRec extends CommonInvoice
|
||||
'note_private' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>105),
|
||||
'note_public' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110),
|
||||
'modelpdf' =>array('type'=>'varchar(255)', 'label'=>'Modelpdf', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
|
||||
'last_gen' =>array('type'=>'varchar(7)', 'label'=>'Last gen', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
|
||||
'date_last_gen' =>array('type'=>'varchar(7)', 'label'=>'Last gen', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
|
||||
'unit_frequency' =>array('type'=>'varchar(2)', 'label'=>'Unit frequency', 'enabled'=>1, 'visible'=>-1, 'position'=>125),
|
||||
'date_when' =>array('type'=>'datetime', 'label'=>'Date when', 'enabled'=>1, 'visible'=>-1, 'position'=>130),
|
||||
'date_last_gen' =>array('type'=>'datetime', 'label'=>'Date last gen', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
|
||||
|
||||
@ -55,6 +55,10 @@ class Ldap
|
||||
/**
|
||||
* Version du protocole ldap
|
||||
*/
|
||||
public $ldapProtocolVersion;
|
||||
/**
|
||||
* Server DN
|
||||
*/
|
||||
public $domain;
|
||||
/**
|
||||
* User administrateur Ldap
|
||||
@ -466,8 +470,6 @@ class Ldap
|
||||
*/
|
||||
public function modify($dn, $info, $user)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
dol_syslog(get_class($this)."::modify dn=".$dn." info=".join(',', $info));
|
||||
|
||||
// Check parameters
|
||||
@ -492,7 +494,11 @@ class Ldap
|
||||
$this->dump($dn, $info);
|
||||
|
||||
//print_r($info);
|
||||
$result = @ldap_modify($this->connection, $dn, $info);
|
||||
// For better compatibility with Samba4 AD
|
||||
if ($this->serverType == "activedirectory") {
|
||||
unset($info['cn']); // For avoid error : Operation not allowed on RDN (Code 67)
|
||||
}
|
||||
$result=@ldap_modify($this->connection, $dn, $info);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
@ -520,9 +526,7 @@ class Ldap
|
||||
*/
|
||||
public function rename($dn, $newrdn, $newparent, $user, $deleteoldrdn = true)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
dol_syslog(get_class($this)."::modify dn=".$dn." newrdn=".$newrdn." newparent=".$newparent." deleteoldrdn=".($deleteoldrdn ? 1 : 0));
|
||||
dol_syslog(get_class($this)."::modify dn=".$dn." newrdn=".$newrdn." newparent=".$newparent." deleteoldrdn=".($deleteoldrdn?1:0));
|
||||
|
||||
// Check parameters
|
||||
if (!$this->connection)
|
||||
@ -571,8 +575,6 @@ class Ldap
|
||||
*/
|
||||
public function update($dn, $info, $user, $olddn, $newrdn = false, $newparent = false)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
dol_syslog(get_class($this)."::update dn=".$dn." olddn=".$olddn);
|
||||
|
||||
// Check parameters
|
||||
@ -589,7 +591,7 @@ class Ldap
|
||||
|
||||
if (!$olddn || $olddn != $dn)
|
||||
{
|
||||
if (!empty($olddn) && !empty($newrdn) && !empty($newparent) && $conf->global->LDAP_SERVER_PROTOCOLVERSION === '3')
|
||||
if (! empty($olddn) && ! empty($newrdn) && ! empty($newparent) && $this->ldapProtocolVersion === '3')
|
||||
{
|
||||
// This function currently only works with LDAPv3
|
||||
$result = $this->rename($olddn, $newrdn, $newparent, $user, true);
|
||||
@ -631,8 +633,6 @@ class Ldap
|
||||
*/
|
||||
public function delete($dn)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
dol_syslog(get_class($this)."::delete Delete LDAP entry dn=".$dn);
|
||||
|
||||
// Check parameters
|
||||
|
||||
@ -567,14 +567,14 @@ class FichinterRec extends Fichinter
|
||||
if ($user->rights->fichinter->creer) {
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter_rec ";
|
||||
$sql .= " SET frequency='".$this->db->escape($freq)."'";
|
||||
$sql .= ", last_gen='".$this->db->escape($courant)."'";
|
||||
$sql .= ", date_last_gen='".$this->db->escape($courant)."'";
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if ($resql) {
|
||||
$this->frequency = $freq;
|
||||
$this->last_gen = $courant;
|
||||
$this->date_last_gen = $courant;
|
||||
return 0;
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user