Kunena 6.2.6 released

The Kunena team has announce the arrival of Kunena 6.2.6 [K 6.2.6] which is now available for download as a native Joomla extension for J! 4.4.x/5.0.x. This version addresses most of the issues that were discovered in K 6.1 / K 6.2 and issues discovered during the last development stages of K 6.2

This category for technical discussions among experienced, skilled developers who either want to integrate own their software with Kunena or who are developing new features for Kunena.

Please introduce yourself and your goals before asking the questions.

Please do not ask questions about when new versions of Kunena will be released. They will not be answered here and may result in locking the topic from further discussion.

Question Automatically create topic in moderator-forum when user reports a post

More
11 years 7 months ago #1 by rjdevries
I've added some code to the com_kunena/controllers/topic.php report function that creates a new topic in the moderator-forum when a user or moderator reports a post.
This way we can discuss reported posts.

This works fine when a moderator reports the post. But when a user reports the post Kunena does not create the topic in the moderator-forum.
This has to do with the moderator-forum rights that does not allow a user to place a topic there.

My question is how to bypass this in the code?
So that the topic will be created even if the user does not have the right to place a topic in the category.


Here is the basic code:
Code:
kimport('kunena.forum.category.helper'); $rjCategory = KunenaForumCategoryHelper::get($catid = 5); if (!$rjCategory->authorise('topic.create')) { return $rjCategory->getError(); } $rjFields = array( 'subject' => "" . JText::_ ( 'COM_KUNENA_REPORT_POST_SUBJECT' ) . ": " . $topic->subject . "" . JText::_ ( 'COM_KUNENA_REPORT_RSENDER' ) . " {$this->me->username} ({$this->me->name})", 'message' => "" . JText::_ ( 'COM_KUNENA_REPORT_RMESSAGE' ) . " " . $text ); list ($topic, $message) = $rjCategory->newTopic($rjFields); if (!$message->save()) { return $message->getError; }

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #2 by sozzled
Interesting idea. I have submitted this as an issue for discussion on GitHub: github.com/Kunena/Kunena-2.0/issues/1077

Please Log in or Create an account to join the conversation.

Time to create page: 0.337 seconds