Changeset 1509 in ExiteCMS for branches/PLi-Fusion/getfile.php


Ignore:
Timestamp:
07/02/08 18:27:06 (4 years ago)
Author:
hverton
Message:

Merged trunk revisions 1408:1508 into the PLi-Fusion branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PLi-Fusion/getfile.php

    r931 r1509  
    311311// parameter validation 
    312312if (!isset($file_id) || !isNum($file_id)) { 
    313     die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Invalid or missing file ID.</b></div>"); 
     313    terminate("<b>Invalid or missing file ID.</b>"); 
    314314} 
    315315if (!isset($type)) { 
    316     die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Missing file type.</b></div>"); 
     316    terminate("<b>Missing file type.</b>"); 
    317317} 
    318318 
     
    330330        $attachment = dbarray(dbquery("SELECT * FROM ".$db_prefix."forum_attachments WHERE attach_id='$file_id'")); 
    331331        if (!is_array($attachment)) { 
    332             die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Invalid file ID.</b></div>"); 
     332            terminate("<b>Invalid file ID.</b>"); 
    333333        } 
    334334        // check if the post this attachment belongs to exists, if so retrieve the information 
    335335        $post = dbarray(dbquery("SELECT * FROM ".$db_prefix."posts WHERE thread_id = '".$attachment['thread_id']."' AND post_id='".$attachment['post_id']."'")); 
    336336        if (!is_array($post)) { 
    337             die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Invalid file ID.</b></div>"); 
     337            terminate("<b>Invalid file ID.</b>"); 
    338338        } 
    339339        $forum = dbarray(dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_id = '".$post['forum_id']."'")); 
    340340        if (!is_array($forum)) { 
    341             die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Invalid file ID.</b></div>"); 
     341            terminate("<b>Invalid file ID.</b>"); 
    342342        } 
    343343        // if logged in, check if the user has access to this file. if not, print an error and give up 
    344344        if (iMEMBER && !getfilegroup($forum['forum_access'], $userdata['user_level'])) { 
    345             die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>You don't have access to the requested file ID.</b></div>"); 
     345            terminate("<b>You don't have access to the requested file ID.</b>"); 
    346346        } 
    347347        // if not logged in, and authorisation required, check if userid and password is given and valid 
     
    362362        $attachment = dbarray(dbquery("SELECT * FROM ".$db_prefix."pm_attachments WHERE pmattach_id='$file_id'")); 
    363363        if (!is_array($attachment)) { 
    364             die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Invalid file ID.</b></div>"); 
     364            terminate("<b>Invalid file ID.</b>"); 
    365365        } 
    366366        // if not logged in, check if userid and password is given and valid (authorisation is required!) 
     
    372372        $result = dbquery("SELECT * FROM ".$db_prefix."pm_index WHERE pm_id = '".$attachment['pm_id']."' AND pmindex_user_id = '".$userdata['user_id']."'"); 
    373373        if (dbrows($result) == 0) { 
    374             die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>You don't have access to the requested file ID.</b></div>"); 
     374            terminate("<b>You don't have access to the requested file ID.</b>"); 
    375375        } 
    376376        // define the required parameters for the download 
     
    381381 
    382382    default: 
    383         die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Invalid file type.</b></div>"); 
     383        die("<b>Invalid file type.</b>"); 
    384384} 
    385385 
Note: See TracChangeset for help on using the changeset viewer.