X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.profile.php;h=77909bdbb5dedc9d52ea83c853ad096ae98cb444;hb=c76545c351fae4e2298624ff9ee5bf854dc5a5b6;hp=d686b1ce1b2b972c6d014b322130e60b18ae176b;hpb=32742f846e13a7806dde6b7b912c423a46f933d8;p=platal.git diff --git a/plugins/function.profile.php b/plugins/function.profile.php index d686b1c..77909bd 100644 --- a/plugins/function.profile.php +++ b/plugins/function.profile.php @@ -1,6 +1,6 @@ b('promo', false); + $with_sex = $params->b('sex', true); + $with_link = $params->b('link', true); + $with_groupperms = $params->b('groupperms', true); + $user = $params->v('user'); + if (is_int($user) || ctype_digit($user)) { + $user = User::getWithUID($user); + } - $name = pl_entities($user->fullName()); + $name = pl_entities($user->directoryName()); if ($with_sex && $user->isFemale()) { $name = '•' . $name; } @@ -43,7 +47,10 @@ function smarty_function_profile($params, &$smarty) $name = '' . $name . ''; } } - if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin') { + if ($user->lost) { + $name .= ' Patte cassée'; + } + if ($with_groupperms && $user instanceof User && $user->group_perms == 'admin' && !empty($name)) { $name = '' . $name . ''; } return $name;