34 '); |
34 '); |
35 |
35 |
36 function decir_early_init(&$paths, &$session) |
36 function decir_early_init(&$paths, &$session) |
37 { |
37 { |
38 $paths->addAdminNode('Decir forum configuration', 'General settings', 'DecirGeneral'); |
38 $paths->addAdminNode('Decir forum configuration', 'General settings', 'DecirGeneral'); |
39 $paths->create_namespace('DecirForum', $paths->nslist['Special'] . 'Forum/ViewForum/'); |
39 $paths->nslist['DecirForum'] = $paths->nslist['Special'] . 'Forum/ViewForum/'; |
40 $paths->create_namespace('DecirPost', $paths->nslist['Special'] . 'Forum/Post/'); |
40 $paths->nslist['DecirPost'] = $paths->nslist['Special'] . 'Forum/Post/'; |
41 $paths->create_namespace('DecirTopic', $paths->nslist['Special'] . 'Forum/Topic/'); |
41 $paths->nslist['DecirTopic'] = $paths->nslist['Special'] . 'Forum/Topic/'; |
42 |
|
43 // Decir's ACL rules |
|
44 |
42 |
45 $session->register_acl_type('decir_see_forum', AUTH_ALLOW, 'See forum in index', Array('read'), 'DecirForum'); |
43 $session->register_acl_type('decir_see_forum', AUTH_ALLOW, 'See forum in index', Array('read'), 'DecirForum'); |
46 $session->register_acl_type('decir_view_forum', AUTH_ALLOW, 'View forum', Array('decir_see_forum'), 'DecirForum'); |
44 $session->register_acl_type('decir_view_forum', AUTH_ALLOW, 'View forum', Array('decir_see_forum'), 'DecirForum'); |
47 $session->register_acl_type('decir_post', AUTH_ALLOW, 'Post new topics', Array('decir_view_forum'), 'DecirForum'); |
45 $session->register_acl_type('decir_post', AUTH_ALLOW, 'Post new topics', Array('decir_view_forum'), 'DecirForum'); |
48 $session->register_acl_type('decir_reply', AUTH_ALLOW, 'Reply to topics', Array('decir_post'), 'DecirTopic'); |
46 $session->register_acl_type('decir_reply', AUTH_ALLOW, 'Reply to topics', Array('decir_post'), 'DecirTopic'); |
49 $session->register_acl_type('decir_edit_own', AUTH_ALLOW, 'Edit own posts', Array('decir_post'), 'DecirPost'); |
|
50 $session->register_acl_type('decir_edit_other', AUTH_DISALLOW, 'Edit others\' posts', Array('decir_post'), 'DecirPost'); |
|
51 $session->register_acl_type('decir_delete_own_post_soft', AUTH_ALLOW, 'Delete own posts (soft)', Array('decir_edit_own'), 'DecirPost'); |
|
52 $session->register_acl_type('decir_delete_own_post_hard', AUTH_DISALLOW, 'Delete own posts (hard)', Array('decir_delete_own_post_soft'), 'DecirPost'); |
|
53 $session->register_acl_type('decir_delete_other_post_soft', AUTH_DISALLOW, 'Delete others\' posts (soft)', Array('decir_edit_other'), 'DecirPost'); |
|
54 $session->register_acl_type('decir_delete_other_post_hard', AUTH_DISALLOW, 'Delete others\' posts (hard)', Array('decir_delete_other_post_soft'), 'DecirPost'); |
|
55 $session->register_acl_type('decir_undelete_own_post', AUTH_DISALLOW, 'Undelete own posts', Array('decir_edit_own'), 'DecirPost'); |
|
56 $session->register_acl_type('decir_undelete_other_post', AUTH_DISALLOW, 'Undelete others\' posts', Array('decir_edit_other'), 'DecirPost'); |
|
57 $session->register_acl_type('decir_undelete_own_topic', AUTH_DISALLOW, 'Undelete own topics', Array('read'), 'DecirTopic'); |
|
58 $session->register_acl_type('decir_undelete_other_topic', AUTH_DISALLOW, 'Undelete others\' topics', Array('read'), 'DecirTopic'); |
|
59 $session->register_acl_type('decir_see_deleted_post', AUTH_ALLOW, 'See placeholders for deleted posts', Array('read'), 'Special|DecirPost|DecirTopic|DecirForum'); |
|
60 $session->register_acl_type('decir_see_deleted_post_full', AUTH_DISALLOW, 'Read the full contents of deleted posts', Array('decir_see_deleted_post'), 'Special|DecirPost|DecirTopic|DecirForum'); |
|
61 $session->register_acl_type('decir_see_deleted_topic', AUTH_ALLOW, 'See placeholders for deleted topics', Array('read'), 'DecirTopic|DecirForum'); |
|
62 $session->register_acl_type('decir_see_deleted_topic_full', AUTH_DISALLOW, 'Read the full contents of deleted topics', Array('decir_see_deleted_topic'), 'Special|DecirTopic|DecirForum'); |
|
63 } |
47 } |
64 |
48 |
65 function page_Special_Forum() |
49 function page_Special_Forum() |
66 { |
50 { |
67 global $db, $session, $paths, $template, $plugins; // Common objects |
51 global $db, $session, $paths, $template, $plugins; // Common objects |