PDA

View Full Version : Conflict with attachment permissions


sparklywater
11-21-2009, 05:16 PM
I'm using the following plugin code at hook location 'global_start' to make attachments work in PMs:

if (THIS_SCRIPT == 'newattachment' AND $_REQUEST['type'] == 'pm')

{
$threadid = -1;
$vbulletin->userinfo['forumpermissions']['pm'] |= $vbulletin->bf_ugp_forumpermissions['canpostattachment'] + $vbulletin->bf_ugp_forumpermissions['canview'] + $vbulletin->bf_ugp_forumpermissions['canviewthreads'] + $vbulletin->bf_ugp_forumpermissions['canviewothers'] + $vbulletin->bf_ugp_forumpermissions['canreplyothers'] + $vbulletin->bf_ugp_forumpermissions['canreplyown'] + $vbulletin->bf_ugp_forumpermissions['canpostnew'];
$foruminfo['allowposting'] = 1;
$foruminfo['cancontainthreads'] = 1;
$foruminfo['forumid'] = 'pm';
}

Something in this code causes an error message when uploading attachments to thread posts: 'you don't have sufficient privileges / permissions to perform this action'. When the above plugin is disabled, there is no longer an error message on uploading attachments.

Here is the mod page: https://vborg.vbsupport.ru/showthread.php?t=127113

PitchouneN64ngc
11-21-2009, 07:01 PM
I'm not a PHP expert but.... Why do you use '|=' as operator?

sparklywater
11-21-2009, 07:10 PM
I tried removing the | but it made no difference.
I didn't write the code myself.

ForumsMods
11-21-2009, 07:33 PM
All the code must be rewritten to fit the new syntax.

sparklywater
11-21-2009, 07:41 PM
I'm not using vB4, i'm using 3.7. The mod otherwise works well, with ability to attach files to PMs. It's just this small permissions clash with the code above, which i can't figure out.

Lynne
11-21-2009, 07:44 PM
You should have posted in the vb3 section if you wanted help with vb3 code. This is the vb4 section.

Moving....

And since this is a problem with the modification, you should be posting in the modification for help, not out here in the main forums.

sparklywater
11-21-2009, 08:08 PM
Sorry I didn't notice the new vb4 section, thought it was the old one.

I did post in the mod thread, but sometimes it's better to ask here because there is broader range of knowledge from members and that thread isn't visited often by others. It could be just a general clash of some permissions...anyone might know the answer.