PDA

View Full Version : Bypass attachment size for Admins


Boofo
06-11-2002, 02:04 PM
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 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:


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. :)

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? :)

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. :)).

Originally posted by FireFly
Never mind, it is.