Browse Source

FIX A non admin user can not download files attached to user.

Laurent Destailleur 8 years ago
parent
commit
d390acc888
1 changed files with 1 additions and 1 deletions
  1. 1 1
      htdocs/core/lib/files.lib.php

+ 1 - 1
htdocs/core/lib/files.lib.php

@@ -1557,7 +1557,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
 	else if ($modulepart == 'user' && !empty($conf->user->dir_output))
 	{
         $canreaduser=(! empty($fuser->admin) || $fuser->rights->user->user->lire);
-        if ($user->id == (int) $refname) { $canreaduser=1; } // A user can always read its own card
+        if ($fuser->id == (int) $refname) { $canreaduser=1; } // A user can always read its own card
         if ($canreaduser || preg_match('/^specimen/i',$original_file))
 	    {
 	        $accessallowed=1;