PDA

View Full Version : Set Category Image - Permissions Issue


tfw2005
03-01-2011, 12:37 PM
A user goes in and adds a story, uploads an attachment, sets a category image.

I then go into their story, and attempt to change the category image to a different one.

System doesn't allow me to do it. Page refreshes, original category image is still selected.

I can understand this functionality on co-equal, non-admin usergroups, but admins should be able to bypass this.

I tried looking in newattachment.php, didn't find anything yet.

Is there any way to make it so an admin can override and re-choose the category image on a story whenever they want, regardless of other variables?

tfw2005
03-01-2011, 12:53 PM
Hehe, I always post then find something.

Around line 415 of newattachment.php

I changed this:

$entryattachid = 0;
// Entry attachment id
if ($vbulletin->GPC['entryattach'])
{
$entryattach = $db->query_first("
SELECT attachmentid FROM " . ADV_DYNA_TABLE_PREFIX . "attachments
WHERE attachmentid = " . $vbulletin->GPC['entryattach'] . "
AND userid = " . $vbulletin->userinfo['userid']
);
$entryattachid = intval($entryattach['attachmentid']);
}


To This:

$entryattachid = 0;
// Entry attachment id
if ($vbulletin->GPC['entryattach'])
{
$entryattach = $db->query_first("
SELECT attachmentid FROM " . ADV_DYNA_TABLE_PREFIX . "attachments
WHERE attachmentid = " . $vbulletin->GPC['entryattach']
//AND userid = " . $vbulletin->userinfo['userid']
);
$entryattachid = intval($entryattach['attachmentid']);

Basically cuttting out the userid check from the query.

Is that proper, and are there any negative affects of doing this?

Seems to have fixed the above issue otherwise.

Thanks in advance.