If a user has an OGR role which allows file download, the user was unable to download private files because those files were outside of group context.

Fixed this problem by creating group context when user clicks on anything in files path. May need to modify this in the future since the files path may not necessarily be in a directory titled files.

In og_user_roles_all_roles($user):

// Files
if (arg(0) == 'files' || arg(1) == 'files') {
$location = 162;
if ($_SESSION['og_last']) {
$gid = $_SESSION['og_last']->nid;
$group_node = node_load($gid);
og_set_group_context($group_node);
}
}

Comments

somebodysysop’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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