2007-05-21 20:57:54 +00:00
|
|
|
<?php
|
|
|
|
|
/* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
2012-12-30 14:13:49 +00:00
|
|
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
2007-05-21 20:57:54 +00:00
|
|
|
*
|
|
|
|
|
* 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
|
2013-01-16 14:36:08 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2007-05-21 20:57:54 +00:00
|
|
|
* (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-07-31 23:19:04 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2007-05-21 20:57:54 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2009-08-17 17:32:38 +00:00
|
|
|
* \file htdocs/user/info.php
|
|
|
|
|
* \ingroup core
|
|
|
|
|
* \brief Page des informations d'un utilisateur
|
2011-08-27 16:15:06 +00:00
|
|
|
*/
|
2007-05-21 20:57:54 +00:00
|
|
|
|
2012-08-22 21:24:21 +00:00
|
|
|
require '../main.inc.php';
|
2012-08-22 21:11:24 +00:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
2007-05-21 20:57:54 +00:00
|
|
|
|
2008-04-01 12:09:33 +00:00
|
|
|
$langs->load("users");
|
2007-05-21 20:57:54 +00:00
|
|
|
|
2009-02-19 19:06:12 +00:00
|
|
|
// Security check
|
2011-11-02 19:17:55 +00:00
|
|
|
$id = GETPOST('id','int');
|
2007-10-13 11:41:27 +00:00
|
|
|
$fuser = new User($db);
|
2010-04-28 07:31:34 +00:00
|
|
|
$fuser->fetch($id);
|
2009-08-06 13:07:25 +00:00
|
|
|
|
|
|
|
|
// Security check
|
|
|
|
|
$socid=0;
|
|
|
|
|
if ($user->societe_id > 0) $socid = $user->societe_id;
|
|
|
|
|
$feature2 = (($socid && $user->rights->user->self->creer)?'':'user');
|
2011-11-02 19:24:51 +00:00
|
|
|
if ($user->id == $id) // A user can always read its own card
|
2009-08-17 17:32:38 +00:00
|
|
|
{
|
|
|
|
|
$feature2='';
|
|
|
|
|
}
|
2012-01-11 14:07:17 +00:00
|
|
|
$result = restrictedArea($user, 'user', $id, '&user', $feature2);
|
2009-08-06 13:07:25 +00:00
|
|
|
|
2007-10-13 00:25:16 +00:00
|
|
|
// 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();
|
2007-05-21 20:57:54 +00:00
|
|
|
|
2009-02-19 19:06:12 +00:00
|
|
|
|
2007-05-21 20:57:54 +00:00
|
|
|
|
|
|
|
|
/*
|
2009-02-19 19:06:12 +00:00
|
|
|
* View
|
2007-05-21 20:57:54 +00:00
|
|
|
*/
|
|
|
|
|
|
2007-10-13 00:25:16 +00:00
|
|
|
llxHeader();
|
|
|
|
|
|
2011-11-02 19:24:51 +00:00
|
|
|
$fuser->info($id);
|
2007-05-21 20:57:54 +00:00
|
|
|
|
2007-10-13 11:41:27 +00:00
|
|
|
$head = user_prepare_head($fuser);
|
2007-05-21 20:57:54 +00:00
|
|
|
|
2009-05-05 00:25:14 +00:00
|
|
|
$title = $langs->trans("User");
|
2009-08-05 17:19:55 +00:00
|
|
|
dol_fiche_head($head, 'info', $title, 0, 'user');
|
2007-05-21 20:57:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
print '<table width="100%"><tr><td>';
|
2009-01-07 10:57:36 +00:00
|
|
|
dol_print_object_info($fuser);
|
2007-05-21 20:57:54 +00:00
|
|
|
print '</td></tr></table>';
|
|
|
|
|
|
|
|
|
|
print '</div>';
|
|
|
|
|
|
|
|
|
|
$db->close();
|
|
|
|
|
|
2011-08-27 14:24:16 +00:00
|
|
|
llxFooter();
|
2007-05-21 20:57:54 +00:00
|
|
|
?>
|