diff --git a/htdocs/lib/usergroups.lib.php b/htdocs/lib/usergroups.lib.php index 68d1b951594..076a8284c15 100644 --- a/htdocs/lib/usergroups.lib.php +++ b/htdocs/lib/usergroups.lib.php @@ -76,6 +76,11 @@ function user_prepare_head($user) $h++; } + $head[$h][0] = DOL_URL_ROOT.'/user/info.php?id='.$user->id; + $head[$h][1] = $langs->trans("Info"); + $head[$h][2] = 'info'; + $h++; + return $head; } diff --git a/htdocs/user.class.php b/htdocs/user.class.php index 9e49497a7aa..e7de98dba8d 100644 --- a/htdocs/user.class.php +++ b/htdocs/user.class.php @@ -1,7 +1,7 @@ * Copyright (c) 2002-2003 Jean-Louis Bergamo - * Copyright (c) 2004-2006 Laurent Destailleur + * Copyright (c) 2004-2007 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2006 Regis Houssin @@ -1496,6 +1496,40 @@ class User return $err; } + + /* + * \brief Charge les informations d'ordre info dans l'objet user + * \param id id du user a charger + */ + function info($id) + { + $sql = "SELECT u.rowid, u.login as ref, ".$this->db->pdate("datec")." as datec,"; + $sql.= $this->db->pdate("u.tms")." as date_modification"; + $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; + $sql.= " WHERE u.rowid = ".$id; + + $result=$this->db->query($sql); + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); + + $this->id = $obj->rowid; + + $this->ref = (! $obj->ref) ? $obj->rowid : $obj->ref; + $this->date_creation = $obj->datec; + $this->date_modification = $obj->date_modification; + } + + $this->db->free($result); + + } + else + { + dolibarr_print_error($this->db); + } + } }