27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
33 $action =
GETPOST(
'action',
'aZ09');
34 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'usernote';
37 $langs->loadLangs(array(
'companies',
'members',
'bills',
'users'));
39 $object =
new User($db);
40 $object->fetch($id,
'',
'', 1);
44 if (($object->id != $user->id) && (!$user->hasRight(
"user",
"user",
"read"))) {
49 $permissionnote = $user->hasRight(
"user",
"self",
"write");
53 if ($user->socid > 0) {
54 $socid = $user->socid;
56 $feature2 = (($socid && $user->hasRight(
"user",
"self",
"write")) ?
'' :
'user');
58 $result =
restrictedArea($user,
'user', $id,
'user&user', $feature2);
61 $hookmanager->initHooks(array(
'usercard',
'usernote',
'globalcard'));
67 $parameters = array(
'id'=>$socid);
68 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
72 if (empty($reshook)) {
73 include DOL_DOCUMENT_ROOT.
'/core/actions_setnotes.inc.php';
88 $title = $langs->trans(
"User");
93 if ($user->hasRight(
"user",
"user",
"read") || $user->admin) {
94 $linkback =
'<a href="'.DOL_URL_ROOT.
'/user/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
97 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/user/vcard.php?id='.$object->id.
'" class="refid">';
98 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
99 $morehtmlref .=
'</a>';
101 dol_banner_tab($object,
'id', $linkback, $user->hasRight(
"user",
"user",
"read") || $user->admin,
'rowid',
'ref', $morehtmlref);
103 print
'<div class="underbanner clearboth"></div>';
105 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
106 print
'<input type="hidden" name="token" value="'.newToken().
'">';
108 print
'<div class="fichecenter">';
109 print
'<table class="border centpercent tableforfield">';
112 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
'</td>';
113 if (!empty($object->ldap_sid) && $object->statut == 0) {
114 print
'<td class="error">';
115 print $langs->trans(
"LoginAccountDisableInDolibarr");
120 if (property_exists($object,
'admin')) {
121 if (
isModEnabled(
'multicompany') && !empty($object->admin) && empty($object->entity)) {
122 $addadmin .=
img_picto($langs->trans(
"SuperAdministratorDesc"),
"redstar",
'class="paddingleft"');
123 } elseif (!empty($object->admin)) {
124 $addadmin .=
img_picto($langs->trans(
"AdministratorDesc"),
"star",
'class="paddingleft"');
140 include DOL_DOCUMENT_ROOT.
'/core/tpl/notes.tpl.php';
144 $langs->load(
"errors");
145 print $langs->trans(
"ErrorRecordNotFound");
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage Dolibarr users.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
isModEnabled($module)
Is Dolibarr module enabled.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
user_prepare_head(User $object)
Prepare array with list of tabs.