Add possibility to limit active users
This commit is contained in:
parent
b2bd7e0d25
commit
30b4679522
@ -108,4 +108,4 @@ ConfirmCreateThirdParty=Are you sure you want to create a third party for this m
|
|||||||
LoginToCreate=Login to create
|
LoginToCreate=Login to create
|
||||||
NameToCreate=Name of third party to create
|
NameToCreate=Name of third party to create
|
||||||
YourRole=Your roles
|
YourRole=Your roles
|
||||||
YourQuotaOfUsersIsReached=Your quota of users is reached !
|
YourQuotaOfUsersIsReached=Your quota of active users is reached !
|
||||||
@ -108,4 +108,4 @@ ConfirmCreateThirdParty=Êtes-vous sûr de vouloir créer un tiers pour cet adh
|
|||||||
LoginToCreate=Login à créer
|
LoginToCreate=Login à créer
|
||||||
NameToCreate=Nom du tiers à créer
|
NameToCreate=Nom du tiers à créer
|
||||||
YourRole=Vos rôles
|
YourRole=Vos rôles
|
||||||
YourQuotaOfUsersIsReached=Votre quota d'utilisateurs est atteint !
|
YourQuotaOfUsersIsReached=Votre quota d'utilisateurs actifs est atteint !
|
||||||
@ -110,11 +110,26 @@ if ($_REQUEST["action"] == 'confirm_enable' && $_REQUEST["confirm"] == "yes")
|
|||||||
{
|
{
|
||||||
if ($_GET["id"] <> $user->id)
|
if ($_GET["id"] <> $user->id)
|
||||||
{
|
{
|
||||||
|
$message='';
|
||||||
|
|
||||||
$edituser = new User($db);
|
$edituser = new User($db);
|
||||||
$edituser->fetch($_GET["id"]);
|
$edituser->fetch($_GET["id"]);
|
||||||
$edituser->setstatus(1);
|
|
||||||
Header("Location: ".DOL_URL_ROOT.'/user/fiche.php?id='.$_GET["id"]);
|
if (!empty($conf->file->main_limit_users))
|
||||||
exit;
|
{
|
||||||
|
$nb = $edituser->getNbOfUsers(1);
|
||||||
|
if ($nb >= $conf->file->main_limit_users)
|
||||||
|
{
|
||||||
|
$message='<div class="error">'.$langs->trans("YourQuotaOfUsersIsReached").'</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $message)
|
||||||
|
{
|
||||||
|
$edituser->setstatus(1);
|
||||||
|
Header("Location: ".DOL_URL_ROOT.'/user/fiche.php?id='.$_GET["id"]);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -816,7 +831,6 @@ else
|
|||||||
$title = $langs->trans("User");
|
$title = $langs->trans("User");
|
||||||
dol_fiche_head($head, 'user', $title, 0, 'user');
|
dol_fiche_head($head, 'user', $title, 0, 'user');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirmation reinitialisation mot de passe
|
* Confirmation reinitialisation mot de passe
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user