vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Conflict with attachment permissions (https://vborg.vbsupport.ru/showthread.php?t=228550)

sparklywater 11-21-2009 05:16 PM

Conflict with attachment permissions
 
I'm using the following plugin code at hook location 'global_start' to make attachments work in PMs:

PHP Code:

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.


All times are GMT. The time now is 06:56 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01116 seconds
  • Memory Usage 1,728KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete