Fix: on ne pouvait plus créer de sociétés

This commit is contained in:
Regis Houssin 2007-06-08 07:57:14 +00:00
parent bb8bdd514e
commit a50443a646

View File

@ -1262,6 +1262,7 @@ function dol_loginfunction($notused,$pearstatus)
$user->getrights('commercial'); $user->getrights('commercial');
$socid = 0; $socid = 0;
$nocreate = 0;
if ($modulename == 'societe' && $objectid) $socid = $objectid; if ($modulename == 'societe' && $objectid) $socid = $objectid;
//si dbtable non défini, même nom que le module //si dbtable non défini, même nom que le module
@ -1273,6 +1274,7 @@ function dol_loginfunction($notused,$pearstatus)
} }
else if (!$user->rights->$modulename->creer) else if (!$user->rights->$modulename->creer)
{ {
$nocreate = 1;
if ($_GET["action"] == 'create' || $_POST["action"] == 'create') if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
{ {
accessforbidden(); accessforbidden();
@ -1314,7 +1316,7 @@ function dol_loginfunction($notused,$pearstatus)
} }
} }
} }
else if (!$objectid && $modulename == 'societe' && $list==0) else if ((!$objectid && $modulename == 'societe' && $list==0) && $nocreate == 1)
{ {
accessforbidden(); accessforbidden();
} }