Changeset 1509 in ExiteCMS for branches/PLi-Fusion/getfile.php
- Timestamp:
- 07/02/08 18:27:06 (4 years ago)
- File:
-
- 1 edited
-
branches/PLi-Fusion/getfile.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/PLi-Fusion/getfile.php
r931 r1509 311 311 // parameter validation 312 312 if (!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>"); 314 314 } 315 315 if (!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>"); 317 317 } 318 318 … … 330 330 $attachment = dbarray(dbquery("SELECT * FROM ".$db_prefix."forum_attachments WHERE attach_id='$file_id'")); 331 331 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>"); 333 333 } 334 334 // check if the post this attachment belongs to exists, if so retrieve the information 335 335 $post = dbarray(dbquery("SELECT * FROM ".$db_prefix."posts WHERE thread_id = '".$attachment['thread_id']."' AND post_id='".$attachment['post_id']."'")); 336 336 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>"); 338 338 } 339 339 $forum = dbarray(dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_id = '".$post['forum_id']."'")); 340 340 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>"); 342 342 } 343 343 // if logged in, check if the user has access to this file. if not, print an error and give up 344 344 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>"); 346 346 } 347 347 // if not logged in, and authorisation required, check if userid and password is given and valid … … 362 362 $attachment = dbarray(dbquery("SELECT * FROM ".$db_prefix."pm_attachments WHERE pmattach_id='$file_id'")); 363 363 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>"); 365 365 } 366 366 // if not logged in, check if userid and password is given and valid (authorisation is required!) … … 372 372 $result = dbquery("SELECT * FROM ".$db_prefix."pm_index WHERE pm_id = '".$attachment['pm_id']."' AND pmindex_user_id = '".$userdata['user_id']."'"); 373 373 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>"); 375 375 } 376 376 // define the required parameters for the download … … 381 381 382 382 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>"); 384 384 } 385 385
Note: See TracChangeset
for help on using the changeset viewer.
