function _spaces_og_enforce_privacy in Spaces 7.3
Same name and namespace in other branches
- 6.3 spaces_og/spaces_og.module \_spaces_og_enforce_privacy()
- 7 spaces_og/spaces_og.module \_spaces_og_enforce_privacy()
Enforces OG group and privacy settings on a node.
1 call to _spaces_og_enforce_privacy()
- spaces_og_node_presave in spaces_og/
spaces_og.module - Implements hook_node_presave().
File
- spaces_og/
spaces_og.module, line 492
Code
function _spaces_og_enforce_privacy($gid, &$node) {
if ($group = node_load($gid)) {
if ($group->og_private) {
$node->og_public = OG_VISIBLE_GROUPONLY;
}
else {
$node->og_public = OG_VISIBLE_BOTH;
}
$node->og_groups = array(
$gid => $gid,
);
return TRUE;
}
return FALSE;
}