dolibarr  13.0.2
info.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2005-2015 Regis Houssin <regis.houssin@inodbox.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
25 require '../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
28 require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
29 
30 // Load translation files required by page
31 $langs->load("users");
32 
33 // Security check
34 $id = GETPOST('id', 'int');
35 $object = new User($db);
36 if ($id > 0 || !empty($ref))
37 {
38  $result = $object->fetch($id, $ref, '', 1);
39  $object->getrights();
40 }
41 
42 // Security check
43 $socid = 0;
44 if ($user->socid > 0) $socid = $user->socid;
45 $feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user');
46 
47 $result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
48 
49 // If user is not user that read and no permission to read other users, we stop
50 if (($object->id != $user->id) && (!$user->rights->user->user->lire))
52 
53 
54 
55 /*
56  * View
57  */
58 
59 $form = new Form($db);
60 
61 llxHeader();
62 
63 $head = user_prepare_head($object);
64 
65 $title = $langs->trans("User");
66 print dol_get_fiche_head($head, 'info', $title, -1, 'user');
67 
68 
69 $linkback = '';
70 
71 if ($user->rights->user->user->lire || $user->admin) {
72  $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
73 }
74 
75 dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
76 
77 
78 $object->info($id); // This overwrite ->ref with login instead of id
79 
80 
81 print '<div class="fichecenter">';
82 print '<div class="underbanner clearboth"></div>';
83 
84 print '<br>';
85 
86 dol_print_object_info($object);
87 
88 print '</div>';
89 
90 
92 
93 // End of page
94 llxFooter();
95 $db->close();
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.
dol_print_object_info($object, $usetable=0)
Show informations on an object TODO Move this into html.formother.
Class to manage Dolibarr users.
Definition: user.class.php:44
llxHeader()
Empty header.
Definition: wrapper.php:45
Class to manage generation of HTML components Only common components must be here.
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_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.
Definition: index.php:89
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.
llxFooter()
Empty footer.
Definition: wrapper.php:59