dolibarr/htdocs/user/info.php

77 lines
2.0 KiB
PHP
Raw Normal View History

<?php
/* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
2012-01-11 15:07:17 +01:00
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2011-08-01 01:19:04 +02:00
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/user/info.php
* \ingroup core
* \brief Page des informations d'un utilisateur
*/
require("../main.inc.php");
2011-10-24 10:45:06 +02:00
require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
2011-10-24 12:59:44 +02:00
require_once(DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php');
2010-04-29 17:23:21 +02:00
require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php");
2008-04-01 14:09:33 +02:00
$langs->load("users");
2009-02-19 20:06:12 +01:00
// Security check
2011-11-02 20:17:55 +01:00
$id = GETPOST('id','int');
$fuser = new User($db);
$fuser->fetch($id);
// Security check
$socid=0;
if ($user->societe_id > 0) $socid = $user->societe_id;
$feature2 = (($socid && $user->rights->user->self->creer)?'':'user');
2011-11-02 20:24:51 +01:00
if ($user->id == $id) // A user can always read its own card
{
$feature2='';
}
2012-01-11 15:07:17 +01:00
$result = restrictedArea($user, 'user', $id, '&user', $feature2);
// If user is not user read and no permission to read other users, we stop
if (($fuser->id != $user->id) && (! $user->rights->user->user->lire))
accessforbidden();
2009-02-19 20:06:12 +01:00
/*
2009-02-19 20:06:12 +01:00
* View
*/
llxHeader();
2011-11-02 20:24:51 +01:00
$fuser->info($id);
$head = user_prepare_head($fuser);
$title = $langs->trans("User");
2009-08-05 19:19:55 +02:00
dol_fiche_head($head, 'info', $title, 0, 'user');
print '<table width="100%"><tr><td>';
dol_print_object_info($fuser);
print '</td></tr></table>';
print '</div>';
$db->close();
llxFooter();
?>