This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, 6.1 has been updated
       via  fec7bc9a52832eea0d1b60d8aecf0ce8458b42d0 (commit)
      from  25b385fbf28132d7228f3bf834abd7951553ef8f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=fec7bc9a52832eea0d1b60d8aecf0ce8458b42d0

commit fec7bc9a52832eea0d1b60d8aecf0ce8458b42d0
Author: Franck Villaume <[email protected]>
Date:   Sun Oct 1 14:08:32 2017 +0200

    util_display_user: add missing check if user is real. check 
restrict_users_visibility too

diff --git a/src/common/include/utils.php b/src/common/include/utils.php
index 1a8447d..2c88eab 100644
--- a/src/common/include/utils.php
+++ b/src/common/include/utils.php
@@ -1078,6 +1078,30 @@ function util_make_link_u($username, $user_id, $text) {
  * @return     string
  */
 function util_display_user($username, $user_id = 0, $text = '', $size = 'xs') {
+       $user = user_get_object_by_name($username);
+       if (!$user || !is_object($user) || $user->isError() || 
!$user->isActive()) {
+               return $text;
+       }
+       if (forge_get_config('restrict_users_visibility')) {
+               if (!session_loggedin()) {
+                       return '';
+               }
+
+               $u2 = $user->getID();
+
+               $u2gl = $user->getGroupIds();
+               $seen = false;
+               foreach ($u2gl as $u2g) {
+                       if (forge_check_perm('project_read', $u2g)) {
+                               $seen = true;
+                               break;
+                       }
+               }
+               if ($seen == false) {
+                       return '';
+               }
+       }
+       
        // Invoke user_link_with_tooltip plugin
        $hook_params = array('resource_type' => 'user', 'username' => 
$username, 'user_id' => $user_id, 'size' => $size, 'link_text' => $text, 
'user_link' => '');
        plugin_hook_by_reference('user_link_with_tooltip', $hook_params);

-----------------------------------------------------------------------

Summary of changes:
 src/common/include/utils.php | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to