Jump to content

classPost.php has some serious shortcomings


Michael

Recommended Posts

Posted

I think my request is going to be pretty simple, so please bear with the lengthy explanation. I have been working on an application that is trying to utilize the classPost.php file for creating topics, creating replies, and editing posts. It is convenient in that I can set just a few flags and have it do the work for me, but it seems to be a big pain to use it as a real API. The code is littered with all kinds of permission checks that stop me from doing these functions.

For example, I'm trying to create a tool that will loop through a series of forum topics and rebuild the content of their first post. I am able to set the content, tell who the author was, what topic ID it was and all that, but the problem is that it's checking to see if the 'author' has edit permissions. The author of the post in question may not, they may even be a guest. But I need my tool, which resides in the ACP, to not check those permissions; just frickin' edit the post already. :P

I've already reported one problem with this file and how it forces the 'author' to have 'start topic' permissions in order to create a new topic, here, but that's flagged for a future version, and I fear that future version that it may be considered for is months away, if it will be added at all. This issue I'm running into now is similar, but I haven't been able to hack a workaround for it yet.

My request is simple: please add some flag to that file, false by default, that when set to true it bypasses these checks which don't make any sense when the class is being used as an API. I want to be able to use this class to just make new topics, posts, and edits without having to jump through hoops, and I really don't want to have to re-write all of the code without these checks and use it in my application instead.

Posted

[quote name='Μichael' date='29 September 2009 - 07:22 PM' timestamp='1254248552' post='1862126']
Huzzah!
[/quote]

[quote name='bfarber' date='29 September 2009 - 08:36 PM' timestamp='1254252969' post='1862145']
Woohoo. [img]http://community.invisionpower.com/public/style_emoticons/default/whistle.png[/img]
[/quote]

"Talk like a Pirate Day" was last week. :cool:

  • Management
Posted

Ok, that's done. From 3.0.4 you can use:

$postClass->setBypassPermissionCheck( true );

And it will not bother you with user based permission errors. It still ensures you sent across a proper user and that the forum is capable of receiving a topic/reply/edit.

  • Management
Posted

I only did this because you like Radiohead, by the way. If your favourite band was the "cheeky girls", I would not have done it and furthermore, I would have changed all method functions to private just to be spiteful.

Posted

[quote name='Μichael' date='01 October 2009 - 01:43 PM' timestamp='1254401038' post='1862630']
I knew my blatant pandering to your fondness for Radiohead would pay off. :) :frantics:


What are you going to offer me to stop me telling Matt that Pink Floyd are really your favourites?

Posted

[quote name='Matt' date='01 October 2009 - 01:41 PM' timestamp='1254400915' post='1862629']
I only did this because you like Radiohead, by the way. If your favourite band was the "cheeky girls", I would not have done it and furthermore, I would have changed all method functions to private just to be spiteful.


Quick Michael - put in all your other requests ;)

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...