I've got D6.10 with IMCE 6.x-1.2 running with FCKeditor.
I have multiple users in a role of Contributor, but different subgroups of Contributors need to be limited to different subdirectories. For example, there are users in Contributor role across 20 company locations. Each time a Contributor role desires to upload, they should only have access to a limited subdirectory (i.e. sites/example.com/files/images/la or sites/example.com/files/images/nyc). The hard way to do it is to configure an IMCE profile for each geographic location with hardcoded limitations for IMCE directory uploads and divide Contributor role into 20 roles, then link them up 1-to-1. (Unless I am missing something obvious!)
Or...
Keep one Contributor role, with one IMCE configuration profile and use custom field in the path (returning geographic location in my case such as la, nyc, etc.) such as php: return 'images/' .$account->profile_branch;
In order to construct the directory path with custom fields created in the Profile Module, the $user variable needs to be replaced with $account (referenced from http://drupal.org/node/35742).
Can the code accommodate using $account for expanded feature list of using custom fields from the Profile Module?
Many thanks for an excellent module!
Comments
Comment #1
ufku commented$user object should have profile fields. if not call profile_load_profile($user) before using it.
php: if (!isset($user->profile_branch)) profile_load_profile($user); return 'images/' .$user->profile_branch;Comment #2
Slovak commentedThat solution appears to be working well! Many thanks for prompt assistance!