Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
49f40ee429
@ -265,8 +265,6 @@ $head[$h][2] = 'marketplace';
|
||||
$h++;
|
||||
|
||||
|
||||
// Show warning about external users
|
||||
print showModulesExludedForExternal($modules).'<br>'."\n";
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
@ -500,6 +498,10 @@ else
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Show warning about external users
|
||||
print showModulesExludedForExternal($modules).'<br>'."\n";
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -742,7 +742,7 @@ if ($id > 0)
|
||||
if (! empty($conf->propal->enabled) && $user->rights->propal->creer)
|
||||
{
|
||||
$langs->load("propal");
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$object->id.'&action=create">'.$langs->trans("AddProp").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$object->id.'&action=create">'.$langs->trans("AddProp").'</a>';
|
||||
}
|
||||
|
||||
if (! empty($conf->commande->enabled) && $user->rights->commande->creer)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -296,7 +296,7 @@ if ($socid > 0)
|
||||
|
||||
if (! empty($conf->propal->enabled) && $user->rights->propale->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$object->id.'&action=create">'.$langs->trans("AddProp").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$object->id.'&action=create">'.$langs->trans("AddProp").'</a>';
|
||||
}
|
||||
|
||||
// Add action
|
||||
|
||||
@ -264,6 +264,7 @@ function dol_mimetype($file,$default='application/octet-stream',$mode=0)
|
||||
if (preg_match('/\.(h)$/i',$tmpfile)) { $mime='text/plain'; $imgmime='text.png'; $srclang='h'; }
|
||||
if (preg_match('/\.(java|jsp)$/i',$tmpfile)) { $mime='text/plain'; $imgmime='text.png'; $srclang='java'; }
|
||||
if (preg_match('/\.php([0-9]{1})?$/i',$tmpfile)) { $mime='text/plain'; $imgmime='php.png'; $srclang='php'; }
|
||||
if (preg_match('/\.phtml$/i',$tmpfile)) { $mime='text/plain'; $imgmime='php.png'; $srclang='php'; }
|
||||
if (preg_match('/\.(pl|pm)$/i',$tmpfile)) { $mime='text/plain'; $imgmime='pl.png'; $srclang='perl'; }
|
||||
if (preg_match('/\.sql$/i',$tmpfile)) { $mime='text/plain'; $imgmime='text.png'; $srclang='sql'; }
|
||||
if (preg_match('/\.js$/i',$tmpfile)) { $mime='text/x-javascript'; $imgmime='jscript.png'; $srclang='js'; }
|
||||
|
||||
@ -148,6 +148,8 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
|
||||
// ldap2dolibarr synchronisation
|
||||
if ($login && ! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr')
|
||||
{
|
||||
dol_syslog("functions_ldap::check_user_password_ldap Sync ldap2dolibarr");
|
||||
|
||||
// On charge les attributs du user ldap
|
||||
if ($ldapdebug) print "DEBUG: login ldap = ".$login."<br>\n";
|
||||
$resultFetchLdapUser = $ldap->fetch($login,$userSearchFilter);
|
||||
@ -164,6 +166,7 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
|
||||
$resultFetchUser=$user->fetch('',$login,$sid);
|
||||
if ($resultFetchUser > 0)
|
||||
{
|
||||
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 ($user->login != $ldap->login && $ldap->login)
|
||||
{
|
||||
@ -171,7 +174,8 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
|
||||
$user->update($user);
|
||||
// TODO Que faire si update echoue car on update avec un login deja existant.
|
||||
}
|
||||
//$resultUpdate = $user->update_ldap2dolibarr();
|
||||
|
||||
//$resultUpdate = $user->update_ldap2dolibarr($ldap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -836,7 +836,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
{
|
||||
$langs->load("propal");
|
||||
$newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Prop"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals');
|
||||
$newmenu->add("/societe/societe.php?leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer);
|
||||
$newmenu->add("/comm/propal.php?action=create&leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer);
|
||||
$newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire);
|
||||
if ($leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire);
|
||||
if ($leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=1", $langs->trans("PropalsOpened"), 2, $user->rights->propale->lire);
|
||||
|
||||
@ -90,4 +90,8 @@ CategId=Id categoria
|
||||
CatSupList=Llista de categories de proveïdors
|
||||
CatCusList=Llista de categories de clients/potencials
|
||||
CatProdList=Llista de categories de productes
|
||||
CatMemberList=Llista de categories de membres
|
||||
CatMemberList=Llista de categories de membres
|
||||
# Imports
|
||||
CatProdLinks=Productes
|
||||
CatCusLinks=Clients/Clients potencials
|
||||
CatSupLinks=Proveïdors
|
||||
@ -95,4 +95,8 @@ CatMemberList=List of members categories
|
||||
CatSupLinks=Links between suppliers and categories
|
||||
CatCusLinks=Links between customers/prospects and categories
|
||||
CatProdLinks=Links between products/services and categories
|
||||
CatMemberLinks=Links between members and categories
|
||||
CatMemberLinks=Links between members and categories
|
||||
# Imports
|
||||
CatProdLinks=Products
|
||||
CatCusLinks=Customer/Prospects
|
||||
CatSupLinks=Suppliers
|
||||
@ -90,4 +90,8 @@ CategId=Id categoría
|
||||
CatSupList=Listado categorías de proveedores
|
||||
CatCusList=Listado categorías de clientes/potenciales
|
||||
CatProdList=Listado categorías de productos
|
||||
CatMemberList=Listado categorías de miembros
|
||||
CatMemberList=Listado categorías de miembros
|
||||
# Imports
|
||||
CatProdLinks=Productos
|
||||
CatCusLinks=Clientes/Clientes potenciales
|
||||
CatSupLinks=Proveedores
|
||||
@ -95,4 +95,8 @@ CatMemberList=Liste des catégories adhérents
|
||||
CatSupLinks=Liens entre les fournisseurs et les catégories
|
||||
CatCusLinks=Liens entre les clients/prospects et les catégories
|
||||
CatProdLinks=Liens entre les produits/services et les catégories
|
||||
CatMemberLinks=Links entre les adhérents et les catégories
|
||||
CatMemberLinks=Links entre les adhérents et les catégories
|
||||
# Imports
|
||||
CatProdLinks=Produits
|
||||
CatCusLinks=Clients/Prospects
|
||||
CatSupLinks=Fournisseurs
|
||||
@ -265,7 +265,7 @@ foreach ($listofreferent as $key => $value)
|
||||
{
|
||||
if ($key == 'propal' && ! empty($conf->propal->enabled) && $user->rights->propale->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$project->societe->id.'&action=create&origin='.$project->element.'&originid='.$project->id.'">'.$langs->trans("AddProp").'</a>';
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$project->societe->id.'&action=create&origin='.$project->element.'&originid='.$project->id.'">'.$langs->trans("AddProp").'</a>';
|
||||
}
|
||||
if ($key == 'order' && ! empty($conf->commande->enabled) && $user->rights->commande->creer)
|
||||
{
|
||||
|
||||
@ -1153,7 +1153,7 @@ class User extends CommonObject
|
||||
{
|
||||
// Si mot de passe saisi et different de celui en base
|
||||
$result=$this->setPassword($user,$this->pass,0,$notrigger,$nosyncmemberpass);
|
||||
if (! $nbrowsaffected) $nbrowsaffected++;
|
||||
if (! $nbrowsaffected) $nbrowsaffected++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2070,6 +2070,34 @@ class User extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update user using data from the LDAP
|
||||
* // TODO: Voir pourquoi le update met à jour avec toutes les valeurs vide (global $user écrase ?)
|
||||
*/
|
||||
function update_ldap2dolibarr(&$ldapuser) {
|
||||
global $user, $conf;
|
||||
|
||||
$this->firstname=$ldapuser->{$conf->global->LDAP_FIELD_FIRSTNAME};
|
||||
$this->lastname=$ldapuser->{$conf->global->LDAP_FIELD_NAME};
|
||||
$this->login=$ldapuser->{$conf->global->LDAP_FIELD_LOGIN};
|
||||
$this->pass=$ldapuser->{$conf->global->LDAP_FIELD_PASSWORD};
|
||||
$this->pass_indatabase_crypted=$ldapuser->{$conf->global->LDAP_FIELD_PASSWORD_CRYPTED};
|
||||
|
||||
$this->office_phone=$ldapuser->{$conf->global->LDAP_FIELD_PHONE};
|
||||
$this->user_mobile=$ldapuser->{$conf->global->LDAP_FIELD_MOBILE};
|
||||
$this->office_fax=$ldapuser->{$conf->global->LDAP_FIELD_FAX};
|
||||
$this->email=$ldapuser->{$conf->global->LDAP_FIELD_MAIL};
|
||||
$this->ldap_sid=$ldapuser->{$conf->global->LDAP_FIELD_SID};
|
||||
|
||||
$this->job=$ldapuser->{$conf->global->LDAP_FIELD_TITLE};
|
||||
$this->note=$ldapuser->{$conf->global->LDAP_FIELD_DESCRIPTION};
|
||||
|
||||
$result = $this->update($user);
|
||||
|
||||
dol_syslog(get_class($this)."::update_ldap2dolibarr result=".$result, LOG_DEBUG);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -324,7 +324,9 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
$object->firstname = GETPOST("prenom");
|
||||
$object->login = GETPOST("login");
|
||||
$object->pass = GETPOST("password");
|
||||
$object->admin = GETPOST("admin");
|
||||
if($user->admin == 1) { // A user can only be set admin by an admin
|
||||
$object->admin = GETPOST("admin");
|
||||
}
|
||||
$object->office_phone=GETPOST("office_phone");
|
||||
$object->office_fax = GETPOST("office_fax");
|
||||
$object->user_mobile= GETPOST("user_mobile");
|
||||
|
||||
@ -200,6 +200,7 @@ if ($result >= 0)
|
||||
$fuser->user_mobile=$ldapuser[$conf->global->LDAP_FIELD_MOBILE];
|
||||
$fuser->office_fax=$ldapuser[$conf->global->LDAP_FIELD_FAX];
|
||||
$fuser->email=$ldapuser[$conf->global->LDAP_FIELD_MAIL];
|
||||
$fuser->ldap_sid=$ldapuser[$conf->global->LDAP_FIELD_SID];
|
||||
|
||||
$fuser->job=$ldapuser[$conf->global->LDAP_FIELD_TITLE];
|
||||
$fuser->note=$ldapuser[$conf->global->LDAP_FIELD_DESCRIPTION];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user