';
// Ref
- print '| '.$langs->trans("Ref").' | '.$adh->id.' |
';
+ print '| '.$langs->trans("Ref").' | '.$adh->id.' |
';
+
+ // Physique-Moral
+ $morphys["phy"] = $langs->trans("Physical");
+ $morphys["mor"] = $langs->trans("Morale");
+ print "| ".$langs->trans("Person").'* | ';
+ $html->select_array("morphy", $morphys, $adh->morphy);
+ print " |
";
+
+ // Societe
+ print '| '.$langs->trans("Company").' | |
';
// Nom
print '| '.$langs->trans("Lastname").'* | | ';
// Photo
- $rowspan=16;
- $rowspan+=sizeof($adho->attribute_label);
print '';
if (file_exists($conf->adherent->dir_output."/".$adh->id.".jpg"))
{
@@ -629,7 +652,7 @@ if ($action == 'edit')
print ' |
| '.$langs->trans("Type").'* | ';
if ($user->rights->adherent->creer) // If $user->rights->adherent->self->creer, we do not allow.
{
- $htmls->select_array("typeid", $adht->liste_array(), $adh->typeid);
+ $html->select_array("typeid", $adht->liste_array(), $adh->typeid);
}
else
{
@@ -638,16 +661,6 @@ if ($action == 'edit')
}
print " |
";
- // Physique-Moral
- $morphys["phy"] = $langs->trans("Physical");
- $morphys["mor"] = $langs->trans("Morale");
- print "| ".$langs->trans("Person")."* | ";
- $htmls->select_array("morphy", $morphys, $adh->morphy);
- print " |
";
-
- // Societe
- print '| '.$langs->trans("Company").' | |
';
-
// Adresse
print '| '.$langs->trans("Address").' | ';
print ' |
';
@@ -657,7 +670,7 @@ if ($action == 'edit')
// Pays
print '| '.$langs->trans("Country").' | ';
- $htmls->select_pays($adh->pays_code?$adh->pays_code:$mysoc->pays_code,'pays');
+ $html->select_pays($adh->pays_code?$adh->pays_code:$mysoc->pays_code,'pays');
print ' |
';
// Tel
@@ -674,12 +687,12 @@ if ($action == 'edit')
// Date naissance
print "| ".$langs->trans("Birthday")." | \n";
- $htmls->select_date(($adh->naiss ? $adh->naiss : -1),'naiss','','',1,'update');
+ $html->select_date(($adh->naiss ? $adh->naiss : -1),'naiss','','',1,'update');
print " |
\n";
// Profil public
print "| ".$langs->trans("Public")." | \n";
- print $htmls->selectyesno("public",$adh->public,1);
+ print $html->selectyesno("public",$adh->public,1);
print " |
\n";
// Attributs supplementaires
@@ -688,6 +701,19 @@ if ($action == 'edit')
print "| $value | array_options["options_$key"]."\"> |
\n";
}
+ // Third party Dolibarr
+ if ($conf->societe->enabled)
+ {
+ print '| '.$langs->trans("LinkedToDolibarrThirdParty").' | ';
+ print $html->select_societes($adh->fk_soc,'socid','',1);
+ print ' |
';
+ }
+
+ // Login Dolibarr
+ print '| '.$langs->trans("LinkedToDolibarrUser").' | ';
+ print $html->select_users($adh->user_id,'userid',1);
+ print ' |
';
+
print '| ';
print '';
print ' ';
@@ -709,16 +735,25 @@ if ($action == 'create')
/* */
/* ************************************************************************** */
- $htmls = new Form($db);
$adht = new AdherentType($db);
print_fiche_titre($langs->trans("NewMember"));
- print '';
@@ -1122,19 +1160,6 @@ if ($rowid && $action != 'edit')
}
}
- // Create user
- if (! $user->societe_id && ! $adh->user_id)
- {
- if ($user->rights->user->user->creer)
- {
- print ''.$langs->trans("CreateDolibarrLogin").'';
- }
- else
- {
- print "".$langs->trans("CreateDolibarrLogin")."";
- }
- }
-
// Create third party
if ($conf->societe->enabled && ! $adh->fk_soc)
{
@@ -1148,6 +1173,19 @@ if ($rowid && $action != 'edit')
}
}
+ // Create user
+ if (! $user->societe_id && ! $adh->user_id)
+ {
+ if ($user->rights->user->user->creer)
+ {
+ print ''.$langs->trans("CreateDolibarrLogin").'';
+ }
+ else
+ {
+ print "".$langs->trans("CreateDolibarrLogin")."";
+ }
+ }
+
// Supprimer
if ($user->rights->adherent->supprimer)
{
diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php
index a0a23f0f068..8827b2199c3 100644
--- a/htdocs/admin/const.php
+++ b/htdocs/admin/const.php
@@ -105,19 +105,22 @@ print '';
# Affiche lignes des constantes
-if ($all==1){
+if ($all==1)
+{
$sql = "SELECT rowid, name, value, note, entity ";
$sql.= "FROM llx_const ";
$sql.= "WHERE entity IN (0,".$conf->entity.") ";
$sql.= "ORDER BY name ASC";
-}else{
+}
+else
+{
$sql = "SELECT rowid, name, value, note, entity ";
$sql.= "FROM llx_const ";
$sql.= "WHERE visible = 1 ";
$sql.= "AND entity IN (0,".$conf->entity.") ";
$sql.= "ORDER BY name ASC";
}
-dol_syslog("Const::listConstant sql=".$sql,LOG_DEBUG);
+dol_syslog("Const::listConstant sql=".$sql);
$result = $db->query($sql);
if ($result)
{
@@ -130,22 +133,23 @@ if ($result)
$obj = $db->fetch_object($result);
$var=!$var;
- print '';
+ print "\n";
$i++;
}
}
diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang
index cbe9598462f..f41561fd5e8 100755
--- a/htdocs/langs/en_US/users.lang
+++ b/htdocs/langs/en_US/users.lang
@@ -71,8 +71,12 @@ ListOfGroupsForUser=List of groups for this user
UsersToAdd=Users to add to this group
GroupsToAdd=Groups to add to this user
NoLogin=No login
-CreateDolibarrLogin=Create Dolibarr account
-CreateDolibarrThirdParty=Create third party
+LinkToCompanyContact=Link to third party / contact
+LinkedToDolibarrMember=Link to member
+LinkedToDolibarrUser=Link to Dolibarr user
+LinkedToDolibarrThirdParty=Link to Dolibarr third party
+CreateDolibarrLogin=Create a user
+CreateDolibarrThirdParty=Create a third party
LoginAccountDisable=Account disabled, put a new login to activate it.
LoginAccountDisableInDolibarr=Account disabled in Dolibarr.
LoginAccountDisableInLdap=Account disabled in the domain.
diff --git a/htdocs/langs/fr_FR/users.lang b/htdocs/langs/fr_FR/users.lang
index b3a7dc1ec4f..937e21d1501 100755
--- a/htdocs/langs/fr_FR/users.lang
+++ b/htdocs/langs/fr_FR/users.lang
@@ -71,7 +71,11 @@ ListOfGroupsForUser=Liste des groupes pour cet utilisateur
UsersToAdd=Utilisateur à ajouter à ce groupe
GroupsToAdd=Groupes à ajouter pour cet utilisateur
NoLogin=Pas de login
-CreateDolibarrLogin=Créer un compte Dolibarr
+LinkToCompanyContact=Lien tiers / contact
+LinkedToDolibarrMember=Lien adhérent
+LinkedToDolibarrUser=Lien utilisateur Dolibarr
+LinkedToDolibarrThirdParty=Lien tiers Dolibarr
+CreateDolibarrLogin=Créer un compte utilisateur
CreateDolibarrThirdParty=Créer un tiers
LoginAccountDisable=Le compte est désactivé, mettre un nouveau login pour l'activer.
LoginAccountDisableInDolibarr=Le compte est désactivé sur Dolibarr.
diff --git a/htdocs/lib/security.lib.php b/htdocs/lib/security.lib.php
index 494818808cd..26e19084246 100644
--- a/htdocs/lib/security.lib.php
+++ b/htdocs/lib/security.lib.php
@@ -154,7 +154,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
print ' |
| '.$langs->trans("Entity").' | ';
print '';
- $html->select_array('entity',$entity);
+ print $html->selectarray('entity',$entity);
print ' |
';
}
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 871c20bf597..c7dc6a809a5 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -81,21 +81,21 @@ function analyse_sql_injection(&$var)
$result = array();
foreach ($var as $key => $value)
{
- if (test_sql_inject($key) > 0)
- {
- unset($var[$key]);
- }
- else
- {
- if (analyse_sql_injection($value))
- {
- $var[$key] = $value;
- }
- else
- {
- unset($var[$key]);
- }
- }
+ if (test_sql_inject($key) > 0)
+ {
+ unset($var[$key]);
+ }
+ else
+ {
+ if (analyse_sql_injection($value))
+ {
+ $var[$key] = $value;
+ }
+ else
+ {
+ unset($var[$key]);
+ }
+ }
}
return true;
}
@@ -112,12 +112,8 @@ analyse_sql_injection($_POST);
// This is to make Dolibarr working with Plesk
set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
-// Retrieve the entity in login form, and after in the cookie
-$entityCookieName = "DOLENTITYID_dolibarr";
-if (isset($_POST["entity"])) $_SESSION["dol_entity"] = $_POST["entity"];
-if (isset($_COOKIE[$entityCookieName])) $_SESSION["dol_entity"] = $_COOKIE[$entityCookieName];
-
// Set and init common variables
+// This include will set $conf, $langs and $mysoc objects
require_once("master.inc.php");
// Check if HTTPS
@@ -166,7 +162,27 @@ session_name($sessionname);
session_start();
dol_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".(isset($_SESSION["dol_login"])?$_SESSION["dol_login"]:'').", ".ini_get("session.gc_maxlifetime"));
-// Disable modules (this must be after session_start)
+// Retrieve the entity in login form and in the cookie.
+// This must be after the init of session (session_start) or this create serious pb of corrupted session.
+$entityCookieName = "DOLENTITYID_dolibarr";
+if (isset($_POST["loginfunction"]) && isset($_POST["entity"]))
+{
+ $_SESSION["dol_entity"] = $_POST["entity"];
+ $conf->entity=$_SESSION["dol_entity"];
+ dol_syslog("Will work on entity ".$conf->entity);
+ // Now we need to reload the conf with the choosed entity
+ $conf->setValues($db);
+}
+elseif (isset($_COOKIE[$entityCookieName]))
+{
+ $_SESSION["dol_entity"] = $_COOKIE[$entityCookieName];
+ $conf->entity=$_SESSION["dol_entity"];
+ dol_syslog("Will work on entity ".$conf->entity);
+ // Now we need to reload the conf with the choosed entity
+ $conf->setValues($db);
+}
+
+// Disable modules (this must be after session_start and after conf has been reloaded)
if (! empty($_REQUEST["disablemodules"])) $_SESSION["disablemodules"]=$_REQUEST["disablemodules"];
if (! empty($_SESSION["disablemodules"]))
{
@@ -663,7 +679,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
{
print "\n";
- print "\n";
+ print "\n";
// Affiche meta
print ''."\n"; // Evite indexation par robots
@@ -1088,8 +1104,8 @@ function llxFooter($foot='')
}
print '"'."\n";
- // Add Xdebug coverage of code
- if (defined('XDEBUGCOVERAGE')) { var_dump(xdebug_get_code_coverage()); }
+ // Add Xdebug coverage of code
+ if (defined('XDEBUGCOVERAGE')) { var_dump(xdebug_get_code_coverage()); }
}
if ($conf->use_javascript_ajax)
@@ -1098,21 +1114,21 @@ function llxFooter($foot='')
}
// If there is some logs in buffer to show
- if (sizeof($conf->logbuffer))
- {
+ if (sizeof($conf->logbuffer))
+ {
print "\n";
print "\n";
- }
+ }
print "\n";
- if ($foot) print ''."\n";
+ if ($foot) print ''."\n";
print "\n";
print "