Skip to:
Content

bbPress.org

Changeset 225


Ignore:
Timestamp:
08/14/2005 05:30:28 AM (16 years ago)
Author:
mdawaffe
Message:

Fork caps edit_topic into edit_topic and manage_topics. Same for posts. Fixe time_lock bug: Fixes #123.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-admin/delete-post.php

    r222 r225  
    1313    die('There is a problem with that post, pardner.');
    1414
    15 if ( !current_user_can( 'edit_post', $post_id ) ) {
     15if ( !current_user_can('manage_posts') ) {
    1616    header('Location: ' . bb_get_option('uri') );
    1717    exit();
  • trunk/bb-admin/delete-topic.php

    r220 r225  
    1313    die('There is a problem with that topic, pardner.');
    1414
    15 if ( !current_user_can( 'edit_topic', $topic_id ) ) {
     15if ( !current_user_can('manage_topics') ) {
    1616    header('Location: ' . bb_get_option('uri') );
    1717    exit();
  • trunk/bb-admin/sticky.php

    r220 r225  
    88    die('There is a problem with that topic, pardner.');
    99
    10 if ( !current_user_can( 'edit_topic', $topic_id ) ) {
     10if ( !current_user_can('manage_topic') ) {
    1111    header('Location: ' . bb_get_option('uri') );
    1212    exit();
  • trunk/bb-admin/topic-move.php

    r220 r225  
    1414    die('Your topic or forum caused all manner of confusion');
    1515
    16 if ( !current_user_can( 'edit_topic', $topic_id ) ) {
     16if ( !current_user_can('manage_topics') ) {
    1717    header('Location: ' . bb_get_option('uri') );
    1818    exit();
  • trunk/bb-admin/topic-toggle.php

    r220 r225  
    88    die('There is a problem with that topic, pardner.');
    99
    10 if ( !current_user_can( 'edit_topic', $topic_id ) ) {
     10if ( !current_user_can('manage_topics') ) {
    1111    header('Location: ' . bb_get_option('uri') );
    1212    exit();
  • trunk/bb-includes/capabilities.php

    r222 r225  
    3636                        'browse_deleted' => true,   // Use 'deleted' View
    3737                        'view_by_ip' => true,       // view-ip.php
     38                        'manage_topics' => true,    // Delete/Close/Stick
    3839                        'edit_others_tags' => true,
    3940                        'edit_others_topics' => true,
     41                        'manage_posts' => true,
    4042                        'ignore_edit_lock' => true,
    4143                        'edit_others_posts' => true,
     
    5961                        'browse_deleted' => true,
    6062                        'view_by_ip' => true,
     63                        'manage_topics' => true,
    6164                        'edit_others_tags' => true,
    6265                        'edit_others_topics' => true,
     66                        'manage_posts' => true,
    6367                        'ignore_edit_lock' => true,
    6468                        'edit_others_posts' => true,
     
    7983                        'browse_deleted' => true,   //+
    8084                        'view_by_ip' => true,       //+
     85                        'manage_topics' => true,    //+
    8186                        'edit_others_tags' => true, //+
    8287                        'edit_others_topics' => true,   //+
     88                        'manage_posts' => true,     //+
    8389                        'ignore_edit_lock' => true, //+
    8490                        'edit_others_posts' => true,    //+
     
    270276    }
    271277   
    272     //has_cap(capability_or_role_name) or
    273     //has_cap('edit_post', post_id)
    274278    function has_cap($cap) {
    275279        global $bb_roles;
     
    308312        if ( !topic_is_open( $post->topic_id ) )
    309313            $caps = array_merge($caps, map_meta_cap( 'edit_topic', $user_id, $post->topic_id ));
    310         $post_time = strtotime($post->post_time);
     314        $post_time = strtotime($post->post_time . '+0000');
    311315        $curr_time = time();
    312316                if ( $curr_time - $post_time > bb_get_option( 'edit_lock' ) * 60 )
  • trunk/bb-includes/template-functions.php

    r222 r225  
    423423function topic_delete_link() {
    424424    global $current_user, $topic;
    425     if ( !current_user_can( 'edit_topic', $topic->topic_id ) )
     425    if ( !current_user_can('manage_topics') )
    426426        return;
    427427
     
    434434function topic_close_link() {
    435435    global $current_user, $topic;
    436     if ( !current_user_can( 'edit_topic', $topic->topic_id ) )
     436    if ( !current_user_can('manage_topic') )
    437437        return;
    438438
     
    446446function topic_sticky_link() {
    447447    global $current_user, $topic;
    448     if ( !current_user_can( 'edit_topic', $topic->topic_id ) )
     448    if ( !current_user_can('manage_topic') )
    449449        return;
    450450
     
    468468function topic_move_dropdown() {
    469469    global $current_user, $forum_id, $topic;
    470     if ( !current_user_can( 'edit_topic', $topic->topic_id ) )
     470    if ( !current_user_can('manage_topic') )
    471471        return;
    472472    $forum_id = $topic->forum_id;
     
    567567function post_delete_link() {
    568568    global $current_user, $post;
    569     if ( !current_user_can( 'edit_post', $post->post_id ) )
     569    if ( !current_user_can('manage_posts') )
    570570        return;
    571571
Note: See TracChangeset for help on using the changeset viewer.