| 1 |
<?php |
<?php |
| 2 |
// $Id: forum_access.module,v 1.45 2009/05/22 21:56:01 salvis Exp $ |
// $Id: forum_access.module,v 1.46 2009/07/20 23:55:35 salvis Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file forum_access.module |
* @file forum_access.module |
| 78 |
break; |
break; |
| 79 |
|
|
| 80 |
case 'comment': |
case 'comment': |
| 81 |
|
if (variable_get('forum_access_D5_legacy_mode', FALSE)) { |
| 82 |
|
return; // disable comment access control |
| 83 |
|
} |
| 84 |
if ((arg(1) == 'edit' || arg(1) == 'delete') && !user_access('administer comments')) { |
if ((arg(1) == 'edit' || arg(1) == 'delete') && !user_access('administer comments')) { |
| 85 |
if (is_numeric($cid = arg(2))) { // comment/edit/%, comment/delete/% |
if (is_numeric($cid = arg(2))) { // comment/edit/%, comment/delete/% |
| 86 |
$access[] = (arg(1) == 'edit' ? 'update' : 'delete'); |
$access[] = (arg(1) == 'edit' ? 'update' : 'delete'); |
| 144 |
module_load_include('node.inc', 'forum_access'); |
module_load_include('node.inc', 'forum_access'); |
| 145 |
_forum_access_node_form($form, $form_state); |
_forum_access_node_form($form, $form_state); |
| 146 |
} |
} |
| 147 |
else if ($form_id == 'comment_form') { |
else if ($form_id == 'comment_form' && !variable_get('forum_access_D5_legacy_mode', FALSE)) { |
| 148 |
module_load_include('node.inc', 'forum_access'); |
module_load_include('node.inc', 'forum_access'); |
| 149 |
_forum_access_comment_form($form, $form_state); |
_forum_access_comment_form($form, $form_state); |
| 150 |
} |
} |
| 160 |
module_load_include('admin.inc', 'forum_access'); |
module_load_include('admin.inc', 'forum_access'); |
| 161 |
_forum_access_forum_form($form, $form_state, FALSE); |
_forum_access_forum_form($form, $form_state, FALSE); |
| 162 |
} |
} |
| 163 |
|
else if ($form_id == 'forum_admin_settings') { |
| 164 |
|
module_load_include('admin.inc', 'forum_access'); |
| 165 |
|
_forum_access_forum_admin_settings_form($form, $form_state); |
| 166 |
|
} |
| 167 |
else if ($form_id == 'user_admin_role') { |
else if ($form_id == 'user_admin_role') { |
| 168 |
module_load_include('admin.inc', 'forum_access'); |
module_load_include('admin.inc', 'forum_access'); |
| 169 |
_forum_access_user_admin_role_form($form, $form_state); |
_forum_access_user_admin_role_form($form, $form_state); |
| 290 |
} |
} |
| 291 |
} |
} |
| 292 |
|
|
| 293 |
|
if (!variable_get('forum_access_D5_legacy_mode', FALSE)) |
| 294 |
|
{ // LEGACY-MODE disables these methods |
| 295 |
|
|
| 296 |
/** |
/** |
| 297 |
* Implementation of hook_link_alter(). |
* Implementation of hook_link_alter(). |
| 298 |
* |
* |
| 333 |
} |
} |
| 334 |
} |
} |
| 335 |
|
|
| 336 |
|
} // End of !LEGACY-MODE |
| 337 |
|
|
| 338 |
/** |
/** |
| 339 |
* This is also required by ACL module. |
* This is also required by ACL module. |
| 340 |
*/ |
*/ |