• Resolved walle0301

    (@walle0301)


    If “force_user_login” has been set and user has not the Capability “publish_posts”, changes of post-status to “publish” or “future” are still possible.

    To check the capability, i have made 3 small changes:

    postie.class.php (near line 706):

    // Added Parameter $config, see also postie-tags.php
    $post_status = tag_Status($content, $config['post_status'], $config);

    postie-tag.php (near line 110)

    // Added Parameter $config, see also postie.class.php
    function tag_Status(&$content, $currentstatus, $config) {

    postie-tag.php (near line 125)

    // ===========================================================
    if ($config['force_user_login'])
      if (strcasecmp($poststatus, "publish") or strcasecmp($poststatus, "future"))
        if (!current_user_can('publish_posts'))
          $poststatus = "pending";
    // ===========================================================
    
    return $poststatus;

    It would be nice to integrate the verification of the capability in a next release.

    Thanks a lot for your work!

    • This topic was modified 8 years, 9 months ago by walle0301.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Wayne Allen

    (@wayneallen-1)

    Thanks for the improvement. I’ve added this to the next release.

    Thread Starter walle0301

    (@walle0301)

    Mea culpa, the line with strcasecmp is wrong, please replace by following

    if ( stristr("publish|future", strtolower($poststatus)) )

    Plugin Author Wayne Allen

    (@wayneallen-1)

    Seems like if the user doesn’t have publish_posts capability then it doesn’t matter what $poststatus is. It should always be set to pending.

    Thread Starter walle0301

    (@walle0301)

    In my humble opinion, this is not correct.

    Sometimes a user only want to send a draft for further editing und using.

    If you always set “pending”, it may occur, the admin publish the post.

    Plugin Author Wayne Allen

    (@wayneallen-1)

    You make a good argument. I have added this feature.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘post-status – User Capability’ is closed to new replies.