dolibarr  16.0.5
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 $ref = GETPOST('ref', 'alpha');
36 
37 $object = new User($db);
38 if ($id > 0 || !empty($ref)) {
39  $result = $object->fetch($id, $ref, '', 1);
40  $object->getrights();
41 }
42 
43 // Security check
44 $socid = 0;
45 if ($user->socid > 0) {
46  $socid = $user->socid;
47 }
48 $feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user');
49 
50 $result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
51 
52 // If user is not user that read and no permission to read other users, we stop
53 if (($object->id != $user->id) && (!$user->rights->user->user->lire)) {
55 }
56 
57 
58 
59 /*
60  * View
61  */
62 
63 $form = new Form($db);
64 
65 llxHeader();
66 
67 $head = user_prepare_head($object);
68 
69 $title = $langs->trans("User");
70 print dol_get_fiche_head($head, 'info', $title, -1, 'user');
71 
72 
73 $linkback = '';
74 
75 if ($user->rights->user->user->lire || $user->admin) {
76  $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
77 }
78 
79 $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
80 $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
81 $morehtmlref .= '</a>';
82 
83 dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref);
84 
85 
86 $object->info($id); // This overwrite ->ref with login instead of id
87 
88 
89 print '<div class="fichecenter">';
90 print '<div class="underbanner clearboth"></div>';
91 
92 print '<br>';
93 
94 dol_print_object_info($object);
95 
96 print '</div>';
97 
98 
99 print dol_get_fiche_end();
100 
101 // End of page
102 llxFooter();
103 $db->close();
restrictedArea
restrictedArea($user, $features, $objectid=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.
Definition: security.lib.php:234
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
user_prepare_head
user_prepare_head(User $object)
Prepare array with list of tabs.
Definition: usergroups.lib.php:35
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
dol_banner_tab
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.
Definition: functions.lib.php:2046
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2018
User
Class to manage Dolibarr users.
Definition: user.class.php:44
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
dol_print_object_info
dol_print_object_info($object, $usetable=0)
Show informations on an object TODO Move this into html.formother.
Definition: functions2.lib.php:205
accessforbidden
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 ...
Definition: security.lib.php:933
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59