Commit 004e94d0 authored by Shawn Kwang's avatar Shawn Kwang

Drupal: Modified forum_access module to ignore nodes/forum threads that are locked.

Fixes a bug in DBOINCP-298.
parent 48a743ce
......@@ -432,6 +432,14 @@ function forum_access_link_alter(&$links, $node, $comment = NULL) {
'update' => 'comment_edit',
'delete' => 'comment_delete',
);
// If node/forum thread is locked, then use an empty array and set
// link_is_missing to false.
if (node_load($node->nid, NULL, TRUE)->comment < 2) {
$required_keys = array();
$link_is_missing = FALSE;
}
foreach ($required_keys as $access => $key) {
if (!forum_access_access($tid, $access) && !($access == 'update' && comment_access('edit', $comment)) && !($access == 'comment_create' && forum_access_access($tid, 'create') && ($node->uid==$user->uid)) ) {
unset($links[$required_keys[$access]]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment