28 require
'../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
35 $langs->loadLangs(array(
'users',
'other'));
37 $action =
GETPOST(
'action',
'aZ09');
41 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'userdoc';
44 $canadduser = (!empty($user->admin) || $user->rights->user->user->creer);
45 $canreaduser = (!empty($user->admin) || $user->rights->user->user->lire);
46 $canedituser = (!empty($user->admin) || $user->rights->user->user->creer);
47 $candisableuser = (!empty($user->admin) || $user->rights->user->user->supprimer);
48 $canreadgroup = $canreaduser;
49 $caneditgroup = $canedituser;
50 if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS))
52 $canreadgroup = (!empty($user->admin) || $user->rights->user->group_advance->read);
53 $caneditgroup = (!empty($user->admin) || $user->rights->user->group_advance->write);
59 $caneditfield = ((($user->id == $id) && $user->rights->user->self->creer)
60 || (($user->id != $id) && $user->rights->user->user->creer));
61 $caneditpassword = ((($user->id == $id) && $user->rights->user->self->password)
62 || (($user->id != $id) && $user->rights->user->user->password));
67 if ($user->socid > 0) $socid = $user->socid;
70 $result =
restrictedArea($user,
'user', $id,
'user&user', $feature2);
75 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
76 $sortfield =
GETPOST(
"sortfield",
'alpha');
77 $sortorder =
GETPOST(
"sortorder",
'alpha');
79 if (empty($page) || $page == -1) { $page = 0; }
80 $offset = $limit * $page;
81 $pageprev = $page - 1;
82 $pagenext = $page + 1;
83 if (!$sortorder) $sortorder =
"ASC";
84 if (!$sortfield) $sortfield =
"position_name";
86 $object =
new User($db);
87 if ($id > 0 || !empty($ref))
89 $result = $object->fetch($id, $ref,
'', 1);
93 $upload_dir = $conf->user->dir_output.
"/".$object->id;
97 $hookmanager->initHooks(array(
'usercard',
'userdoc',
'globalcard'));
104 $parameters = array(
'id'=>$socid);
105 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
106 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
108 if (empty($reshook)) {
109 include_once DOL_DOCUMENT_ROOT.
'/core/actions_linkedfiles.inc.php';
117 $form =
new Form($db);
119 llxHeader(
'', $langs->trans(
"UserCard").
' - '.$langs->trans(
"Files"));
126 if (!empty($conf->notification->enabled)) $langs->load(
"mails");
129 $form =
new Form($db);
134 if ($user->rights->user->user->lire || $user->admin) {
135 $linkback =
'<a href="'.DOL_URL_ROOT.
'/user/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
138 dol_banner_tab($object,
'id', $linkback, $user->rights->user->user->lire || $user->admin);
140 print '<div class="fichecenter">';
141 print '<div class="underbanner clearboth"></div>';
144 $filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) ==
'desc' ?SORT_DESC:SORT_ASC), 1);
146 foreach ($filearray as $key => $file)
148 $totalsize += $file[
'size'];
152 print '<table class="border tableforfield centpercent">';
155 print '<tr><td class="titlefield">'.$langs->trans(
"Login").
'</td><td class="valeur">'.$object->login.
' </td></tr>';
158 print '<tr><td>'.$langs->trans(
"NbOfAttachedFiles").
'</td><td>'.count($filearray).
'</td></tr>';
161 print '<tr><td>'.$langs->trans(
"TotalSizeOfAttachedFiles").
'</td><td>'.
dol_print_size($totalsize, 1, 1).
'</td></tr>';
169 $modulepart =
'user';
170 $permission = $user->rights->user->user->creer;
171 $permtoedit = $user->rights->user->user->creer;
172 $param =
'&id='.$object->id;
173 include_once DOL_DOCUMENT_ROOT.
'/core/tpl/document_actions_post_headers.tpl.php';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
user_prepare_head($object)
Prepare array with list of tabs.
Class to manage Dolibarr users.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=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 Calling this function terminate execution ...
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_print_size($size, $shortvalue=0, $shortunit=0)
Return string with formated size.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.