plugins/Decir.php
changeset 3 88b85b9b9272
parent 2 253118325c65
child 4 c31210950118
equal deleted inserted replaced
2:253118325c65 3:88b85b9b9272
    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->create_namespace('DecirForum', $paths->nslist['Special'] . 'Forum/ViewForum/');
    40   $paths->create_namespace('DecirPost',  $paths->nslist['Special'] . 'Forum/Post/');
    40   $paths->create_namespace('DecirPost',  $paths->nslist['Special'] . 'Forum/Post/');
    41   $paths->create_namespace('DecirTopic', $paths->nslist['Special'] . 'Forum/Topic/');
    41   $paths->create_namespace('DecirTopic', $paths->nslist['Special'] . 'Forum/Topic/');
    42   
    42   
       
    43   // Decir's ACL rules
       
    44   
    43   $session->register_acl_type('decir_see_forum',  AUTH_ALLOW, 'See forum in index', Array('read'),             'DecirForum');
    45   $session->register_acl_type('decir_see_forum',  AUTH_ALLOW, 'See forum in index', Array('read'),             'DecirForum');
    44   $session->register_acl_type('decir_view_forum', AUTH_ALLOW, 'View forum',         Array('decir_see_forum'),  'DecirForum');
    46   $session->register_acl_type('decir_view_forum', AUTH_ALLOW, 'View forum',         Array('decir_see_forum'),  'DecirForum');
    45   $session->register_acl_type('decir_post',       AUTH_ALLOW, 'Post new topics',    Array('decir_view_forum'), 'DecirForum');
    47   $session->register_acl_type('decir_post',       AUTH_ALLOW, 'Post new topics',    Array('decir_view_forum'), 'DecirForum');
    46   $session->register_acl_type('decir_reply',      AUTH_ALLOW, 'Reply to topics',    Array('decir_post'),       'DecirTopic');
    48   $session->register_acl_type('decir_reply',      AUTH_ALLOW, 'Reply to topics',    Array('decir_post'),       'DecirTopic');
    47   $session->register_acl_type('decir_edit_own',   AUTH_ALLOW, 'Edit own posts',     Array('decir_post'),       'DecirPost');
    49   $session->register_acl_type('decir_edit_own',   AUTH_ALLOW, 'Edit own posts',     Array('decir_post'),       'DecirPost');
    48   $session->register_acl_type('decir_edit_other', AUTH_DISALLOW, 'Edit others\' 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'), 'DecirTopic|DecirForum');
    49 }
    63 }
    50 
    64 
    51 function page_Special_Forum()
    65 function page_Special_Forum()
    52 {
    66 {
    53   global $db, $session, $paths, $template, $plugins; // Common objects
    67   global $db, $session, $paths, $template, $plugins; // Common objects