diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php
index eb135897a12..0fffd00604b 100644
--- a/htdocs/contact/fiche.php
+++ b/htdocs/contact/fiche.php
@@ -27,6 +27,21 @@ require (DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php");
$error = array();
+
+if ($_GET["action"] == 'create_user' && $user->admin)
+{
+ // Recuperation contact actuel
+ $contact = new Contact($db);
+ $result = $contact->fetch($_GET["id"]);
+
+ // Creation user
+ $nuser = new User($db);
+ $nuser->nom = $contact->nom;
+ $nuser->prenom = $contact->prenom;
+ $nuser->create_from_contact($contact);
+
+}
+
if ($_POST["action"] == 'add')
{
if (! $_POST["name"] && ! $_POST["firstname"]) {
@@ -103,16 +118,6 @@ if ($_POST["action"] == 'update')
if ($contact->error) { array_push($error,$contact->error); }
}
-if ($_GET["action"] == 'create_user')
-{
- $nuser = new User($db);
- $contact = new Contact($db);
- $nuser->nom = $contact->nom;
- $nuser->prenom = $contact->prenom;
- $result = $contact->fetch($contactid);
- $nuser->create_from_contact($contact);
-}
-
/*
*
*
@@ -297,6 +302,9 @@ else
if ($contact->jabberid)
print 'Jabber : '.$contact->jabberid ."
";
+ if($contact->user_id)
+ print 'Utilisateur avec accés : Fiche utilisateur
';
+
print '