Kunena 7.0.9 & Kunena 6.4.14 – Security Updates Released

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

Solved Adding Kunena topics via SQL injection

More
5 years 7 months ago #215967 by antifm
I have kunena installed for some time now into Joomla but there is another section of the site i would like to tie to it. Its essentially a list of topics that exist outside of the Joomla function. To import or inject these topics into Kunena, I would need to go into my PHPAdmin panel on the server and run a few SQL commands.
Ok no problem there but as i am trying to do the, i keep getting something funny and i think its because of my understanding of the Kunena Topics SQL table columns.
So maybe someone can help me clarify them.

I have over 3,000 topics i need to add into Kunena and here is what i did.
I went into the PHPAdmin area and downloaded an sql copy of the "xx_kunena_topics" table. I can use this as a template to write additional topic IDs and their needed information.
xx_kunena_topics has COLUMS with the following names and most of them, i know what they represent. But there is a couple which i am wrong about. I need to know what the colums are looking for.

Below i have typed up my understanding of each of the comumn ROWS but 3 of them i think i am getting incorrect when i creat my write up my SQL INSERT command.

fist_post_id 
last_post_id
last_post_time

The reason that i said if you have 100 topics, you dont nessasarily have 100 topics in your SQL table. If you created a topic and its ID was 100 but then deleted the topic, when you create another one, it becomes 101. It does NOT take the place in the system becoming
topic ID number 100 
and
last post ID 100

So i think thats where i am going wrong. I was able to test this by creating TWO lines of SQL INSERT commands that would create 2 topics into a specific category FROM the PHPadmin area.
I ran the code, and SUCCESS!
I see on the front end that the two topics are created correctly in the right area, with appropriate name and ID in the URL
but when i click them:
first it kept showing the BODY of the very first TOPIC so i corrected that.
Then it created it with the right topic + ID + URL+  everything else, however because of the TIMESTAMP i applied for
first_post_time
last_post_time
It told me i dont have access to the message. I believe this is also related to the FIRST and LAST post_id) Keep in mind, the post ID is relative to HOW MANY ACUTAL POSTS were created INCLUDING any deleted topics.

So my questions are below.




id - topic id number (the first topic created would be id = 1) If there is 100 topics, the last one would NOT be 100 however and below you will see why.
category_id = category ID number from the categories admin area. I am working with category number 9
subject = The text of the subject of topic name.
icon_id = denotes WHICH icon your topic uses. I have NO topic icons so this is 0
label_id = As above. This is 0
locked = These will not be locked. So this is 0
hold = Not on hold so this is 0
ordering = no particular ordering so this is 0
posts = I believ this means HOW MANY POSTS or REPLIES are tied to this topic. I am creating new topics sothis is 0
hits = the number of times this topic has been clicked to view
attachments = None so this will be 0
poll_id = As above so this is 0
moved_id = this was not moved from another category so this is 0
first_post_id = WHAT IS THIS ASKING FOR?
first_post_time = The number of seconds since Jan 1st 2021 to the time of this topic created
first_post_userid = User Id of the person creating the post
first_post_message = The BODY of the topic.
first_post_guest_name = the USERNAME tied to that USER ID
last_post_id = WHAT IS THIS ASKING FOR?
last_post_time = Is this the same as FIRST_POST_TIME ?

last_post_userid = again the USER ID tied to the USERNAME for this post
last_post_message = Same as first_post_message
last_post_guest_name = Sane as first_post_guest_name
rating = I am not using RATING so this is 0
params = this is blank

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

More
5 years 7 months ago - 5 years 7 months ago #215969 by antifm
Here is the error i am currently getting.
After inserting the (almost correct) sql into the table to create additional 2 topics. They show on the forum index as created in a category.
ok great
When i go to the category i can see the topics
ok great
when i scroll over the topic links, they have the appropriate URL for thei Topic ID number.
when i click on the topic i see this error message and i think the problem is the POST_TIME that im using.
I used a time of 1614286038 which is apparently 5 hours ago and thats fine but it doesnt work


404 Not Found
You may not be able to visit this page because of:

an out-of-date bookmark/favourite
a search engine that has an out-of-date listing for this site
a mistyped address
you have no access to this page
The requested resource was not found.
An error has occurred while processing your request.
If difficulties persist, please contact the System Administrator of this site and report the error below.
Last edit: 5 years 7 months ago by antifm.

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

More
5 years 7 months ago #215979 by antifm
So i have been able to trace doen the priblem.

When i INSERT SQL COMMAND to create new tables, the
first_post_message
And
last_post_message

Are not being recognized so the information in the sql table is blank. Thats why i get the error when i try to view the topic.

Any ideas?

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

More
5 years 7 months ago - 5 years 7 months ago #215992 by rich

first_post_id = WHAT IS THIS ASKING FOR?
last_post_id = WHAT IS THIS ASKING FOR?
last_post_time = Is this the same as FIRST_POST_TIME ?

first_post_id is the id of the first message in a topic
last_post_id is the last message id in a topic
last_post_time is the posting time of the last message in this topic

Important! Always create a backup before you make any changes to your website!
Last edit: 5 years 7 months ago by rich.

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

More
5 years 3 months ago #217970 by antifm
Rich. Thanks for that explanation but still a couple questions.

first_post_id is the id of the first message in a topic
(I guess this is the ID Number according to the number of topics posted to the forum over all)

last_post_id is the last message id in a topic
(If there are NO MESSAGES other than the first, i guess this would be the same ID NUMBER as "first post id") correct?

last_post_time is the posting time of the last message in this topic
This is where i got lots as well. What is the format the SQL table wants to use to understand?

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

More
5 years 3 months ago - 5 years 3 months ago #217971 by rich
Sorry, maybe I was vague about it. The IDs are assigned continuously for all posts for the complete forum. You may not use the same ID for different posts.
Example, if you have a clean Forum:

If you create the first topic without answer, you have
First post ID 1
Last post ID 1 (and the posting time)

If you write an answer, you see
First post ID 1
Last post ID 2 (and the posting time)

Now create a second topic with an answer, and you see
First post ID 3
Last post ID 4

If you now answer again to the first topic you get
First post ID 1
Last post ID 5 (and the posting time)

In this example, the messages of the first topic have the IDs 1 2 5 and messages in the second topic ID 3 and 4

Important! Always create a backup before you make any changes to your website!
Last edit: 5 years 3 months ago by rich.

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

Time to create page: 0.241 seconds