News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Moving Post with File-Attachment

Started by AllMassive, August 05, 2007, 11:05:01 AM

Previous topic - Next topic

AllMassive

Hi

I think i found a Bug in SMF 1.1.3.

I created a Post with a attached File inside a Board which is restricted to Global-Moderators only.
Then i moved this Post to a Public-Section inside the Board - but not viewable to Guests, ppl still need to be registered to see the Post+Download.

Regular Members were not able to download it - the 'Register'-Page popped up. There is no entry in the 'Forum Error Log'.

I needed to delete the whole Post and re-create it in the Public-Section - now Download is working for registerd Users.
I dont know if this should be the normal behavior - to me it seems like a Bug.

SleePy

Register page sounds like they are logged out. Did it say they couldn't view this or only certain people can do this or just say they need to login?

It shouldn't do this as the topic is attached to the attachment info so it checks if the user can view that attachment.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

AllMassive

#2
Thats what i did.
Regular Users do have the right to view attachments.
I logged on as a regular User and was able to see the file, attached to the Topic - after hitting 'Download' the  Login-Screen came up. Using my Administrator-Account i was able to Download it from the same Public-Post.

I think it has something to do that i first created it in a 'Administrator-Only' Board - and then moved to the Public-Board.

SleePy

It doesn't have anything to do if it started in the admin board or not.

From Display.php

// This is just a regular attachment...
else
{
isAllowedTo('view_attachments');

// Make sure this attachment is on this board.
$request = db_query("
SELECT a.filename, a.ID_ATTACH, a.attachmentType
FROM ({$db_prefix}boards AS b, {$db_prefix}messages AS m, {$db_prefix}attachments AS a)
WHERE b.ID_BOARD = m.ID_BOARD
AND $user_info[query_see_board]
AND m.ID_MSG = a.ID_MSG
AND a.ID_ATTACH = $_REQUEST[attach]
LIMIT 1", __FILE__, __LINE__);
}


It checks the ID_MSG from attachments with the ID_MESSAGE that has the ID_ATTACH you are trying to use from the board you are viewing.

Any errors in the error log?
Using any customizations? If you are using any customizations (mods and themes) please uninstall them.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

AllMassive

Sure i use MODs, but no others Themes.
I dont have any error-logs.
I searched through my Display.php and i've found exact the same Code.

SleePy

What Mods? They could be the cause of the error.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

AllMassive

These are my installed MODs:

Mod Name  Version 
1. Deutsche Kalender Tage! 1.00
2. SMF 1.1.2 Update Package 1.1.2
3. 3guks PJIRC Integrated Chat Mod 1.1
4. Trim Url 1.0.2
5. Users Online Today Mod 1.4.0
6. Seo 4 SMF 0.2.9.8
7. Search Topic 1.01
8. YouTube BBC Tag (XHTML Compliant) 1.2
9. Streaming 3 4.2.2b
10. Merge Double Posts 1.0.8
11. SMF Arcade 2.0.9
12. SMF Arcade PM Switch 1.0.1
13. MyVideo BBC Tag (XHTML Compliant) 1.3
14. Clipfish BBC Tag (XHTML Compliant) 1.3
15. Merge Double Posts German Pack 1.0.8
16. mp3 Flash Player BBC Tag (XHTML Compliant) 1.0
17. SMF 1.0.11 / 1.1.3 Update 1.1
18. Read Topic Permission Mod 1.0.4
19. Google Member Map 0.60
20. MySpace Field 2.4
21. URL Popup 1.0


Just noticed 'your' Read-Topic-Permission MOD on the list  - settings are: guests cant see nothing, regular users can read sticky+normal posts. (i dont even know why its still installed, i wanted guests to read certain posts but i now did it with a seperate guest-readonly-board.)

seo2smf: 'Beautifying url for forum actions' is disabled.

SleePy

You need to try to reproduce this on a site without mods.
I can't get this to happen on any of my sites/test sites.

Try to uninstall some mods. I am sure its a mod issue and not a bug.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

AllMassive


Advertisement: