Let's say a user has Role1 and Role2.

How would I make an IMCE profile that would give that user access to /files/Role1 and /files/Role2.

I presume I would have to enter some PHP code in "Directory Path".

Could anyone give me a hint? Much appreciated.

Comments

SiFre’s picture

Status: Active » Fixed

As it turns out, IMCE allows an array as directory path...

This hacky line seems to work. It takes every role (skipping "authorized user") the user has and adds directory paths. It replaces the "æ" with a character that fits in a directory name, and replaces spaces, and finally adds a path in front of every directory.


php: $sfpa = str_replace(array("æ", " ",), array("ae", ""), array_slice($user->roles, 1)); foreach ($sfpa as &$sfpa2) { $sfpa2 = "Files_Directory/".$sfpa2; } return $sfpa;

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.