PHP Classes

File: upload/plugins/bulletinboard/api_libs/bb_delete_attach_files_temp.php

Recommend this page to a friend!
  Classes of James Brows   PHP Bulletin Board   upload/plugins/bulletinboard/api_libs/bb_delete_attach_files_temp.php   Download  
File: upload/plugins/bulletinboard/api_libs/bb_delete_attach_files_temp.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Bulletin Board
Manage and post messages in multi-user forums
Author: By
Last change:
Date: 2 years ago
Size: 835 bytes
 

Contents

Class file image Download
<?php

function bb_delete_attach_files_temp()
{
   
  
$username=isset(Configs::$_['user_data']['user_id'])?Configs::$_['user_data']['user_id']:'';

// useClass('EmailSystem');

    // try {
    // isValidAccessAPI();
    // } catch (\Exception $e) {
    // echo responseData($e->getMessage(),'yes');return false;
    // }
    // Check default post status of user group
  
$status='1';

  
$file_path=addslashes(getPost('file_path'));


 
   if(!isset(
$file_path[2]))
   {
       return
'File not valid!';
   }

  
$split=explode('uploads',$file_path);

   if(
count($split) < 2)
   {
       return
'File not valid!';
   }

  
$file_path=str_replace('..','',$file_path);

  
$file_path=ROOT_PATH.str_replace(SITE_URL,"",$file_path);

   if(
file_exists($file_path))
   {
      
unlink($file_path);
   }

   return
'Done';
}