vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Bypass attachment size for Admins (https://vborg.vbsupport.ru/showthread.php?t=39721)

Boofo 06-11-2002 02:04 PM

Bypass attachment size for Admins
 
Can someone please help me make it so Admins can bypass the limit of attachment file size? I have it so Admins can bypass the size of avatars, but not the file size limit. The following code is what is in my functions.php right now:

Code:

code I have now:

$filesize=filesize($attachment);
    if ($maxattachsize!=0 and $filesize>$maxattachsize) {
      // too big!
      eval("standarderror(\"".gettemplate("error_attachtoobig")."\");");
      unlink($attachment);
      exit;
    }

The following is what I was told to change it to before I added whatever hack changed my original code to the code above:

Code:

if ($maxattachsize!=0 and $filesize>$maxattachsize and $bbuserinfo[usergroupid]!=6) {
      // too big!
      eval("standarderror(\"".gettemplate("error_attachtoobig")."\");");
      exit;
    }
    if ($filesize!=$attachment_size and $bbuserinfo[usergroupid]!=6) {


Logician 06-12-2002 10:01 AM

In your new code, Replace

if ($maxattachsize!=0 and $filesize>$maxattachsize) {

AS

if ($maxattachsize!=0 and $filesize>$maxattachsize and $bbuserinfo[usergroupid]!=6) {

Boofo 06-12-2002 11:16 AM

That's what I thought I should do, but I wanted to make sure before I messed with it. Thank you for the confirmation. :)

Quote:

Originally posted by Logician
In your new code, Replace

if ($maxattachsize!=0 and $filesize>$maxattachsize) {

AS

if ($maxattachsize!=0 and $filesize>$maxattachsize and $bbuserinfo[usergroupid]!=6) {


Admin 06-12-2002 12:14 PM

Make sure $bbuserinfo is a global in that function, I'm not sure it is.

Boofo 06-12-2002 12:16 PM

And how would I do that? :)

Quote:

Originally posted by FireFly
Make sure $bbuserinfo is a global in that function, I'm not sure it is.

Admin 06-12-2002 12:18 PM

Never mind, it is.

Boofo 06-12-2002 12:25 PM

Ok, if you say so. :) (That question went way over me head, anyway. :)).

Quote:

Originally posted by FireFly
Never mind, it is.


All times are GMT. The time now is 10:03 AM.

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.01027 seconds
  • Memory Usage 1,724KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_quote_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