if ($list == 0) { // error while trying to extract the archive (most likely wrong format) $admin->print_error('UNABLE TO UNZIP FILE' . $archive->errorInfo(true)); } $sum_files = 0; // rename executable files! foreach ($list as $key => $val) { if ($val['folder'] && change_mode($val['filename'])) { $sum_dirs++; } elseif (is_writable($val['filename']) && $val['status'] == 'ok' && change_mode($val['filename'])) { $sum_files++; } } if (isset($_POST['delzip'])) { unlink($filename1); } $dir = dirname($filename1); if (file_exists($dir)) { $array = createFolderProtectFile($dir); } } unset($list); if ($sum_files == 1) { $admin->print_success($sum_files . ' ' . $MESSAGE['MEDIA_SINGLE_UPLOADED']); } elseif ($sum_files > 1) { $admin->print_success($sum_files . ' ' . $MESSAGE['MEDIA_UPLOADED']); } else { $admin->print_error($MESSAGE['MEDIA_NO_FILE_UPLOADED']); } // Print admin $admin->print_footer();
$name = trim(media_filename($name), '.'); // Target location $requestMethod = '_' . strtoupper($_SERVER['REQUEST_METHOD']); $target = isset(${$requestMethod}['target']) ? ${$requestMethod}['target'] : ''; if (!$admin->checkFTAN()) { $admin->print_header(); $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL); } // After check print the header $admin->print_header(); if (!check_media_path($target, false)) { $admin->print_error($MESSAGE['MEDIA_TARGET_DOT_DOT_SLASH']); } // Create relative path of the new dir name $directory = WB_PATH . $target . '/' . $name; // Check to see if the folder already exists if (file_exists($directory)) { $admin->print_error($MESSAGE['MEDIA_DIR_EXISTS']); } //if ( sizeof(createFolderProtectFile( $directory )) ) if (!make_dir($directory)) { $admin->print_error($MESSAGE['MEDIA_DIR_NOT_MADE']); } else { createFolderProtectFile($directory); $usedFiles = array(); // feature freeze // require_once(ADMIN_PATH.'/media/dse.php'); $admin->print_success($MESSAGE['MEDIA_DIR_MADE']); } // Print admin $admin->print_footer();
$module_directory = basename(dirname(__FILE__)); $aMsg = array(); require_once WB_PATH . '/framework/functions.php'; // COMPILED TEMPLATES $_CONFIG['quickskin_compiled'] = WB_PATH . '/temp/' . $module_name . '/_skins_tmp/'; if (!is_dir($_CONFIG['quickskin_compiled'])) { $msg = createFolderProtectFile($_CONFIG['quickskin_compiled']); if (sizeof($msg)) { // $admin->print_error($MESSAGE['GENERIC_BAD_PERMISSIONS'],$module_overview_link ); $aMsg[] = $msg; } } // CACHED FILES $_CONFIG['quickskin_cache'] = WB_PATH . '/temp/' . $module_name . '/_skins_cache/'; if (!is_dir($_CONFIG['quickskin_cache'])) { $msg = createFolderProtectFile($_CONFIG['quickskin_cache']); if (sizeof($msg)) { //$admin->print_error($MESSAGE['GENERIC_BAD_PERMISSIONS'],$module_overview_link ); $aMsg[] = $msg; } } $_CONFIG['cache_lifetime'] = 600; // EXTENTSIONS DIR $_CONFIG['extensions_dir'] = str_replace('\\', '/', dirname(__FILE__) . '/_lib/qx'); require_once WB_PATH . '/include/' . $module_directory . '/_lib/quickSkin_28/class.quickskin.php'; /** Comment out : will not work on all clients Must be also made dependent from the client browser SET UP COMPRESSION
} // Remove bad characters $name = trim(media_filename($name), '.'); // Target location $requestMethod = '_' . strtoupper($_SERVER['REQUEST_METHOD']); $target = isset(${$requestMethod}['target']) ? ${$requestMethod}['target'] : ''; if (!$admin->checkFTAN()) { $admin->print_header(); $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS']); } // After check print the header $admin->print_header(); if (!check_media_path($target, false)) { $admin->print_error($MESSAGE['MEDIA_TARGET_DOT_DOT_SLASH']); } // Create relative path of the new dir name $directory = WB_PATH . $target . '/' . $name; // Check to see if the folder already exists if (file_exists($directory)) { $admin->print_error($MESSAGE['MEDIA_DIR_EXISTS']); } if (sizeof(createFolderProtectFile($directory))) { $admin->print_error($MESSAGE['MEDIA_DIR_NOT_MADE']); } else { $usedFiles = array(); // feature freeze // require_once(ADMIN_PATH.'/media/dse.php'); $admin->print_success($MESSAGE['MEDIA_DIR_MADE']); } // Print admin $admin->print_footer();
function rebuildFolderProtectFile($dir = '') { global $MESSAGE; $retVal = array(); $dir = rtrim(str_replace('\\/\\', '/', $dir), '/'); try { $files = array(); $files[] = $dir; foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)) as $fileInfo) { $files[] = $fileInfo->getPath(); } $files = array_unique($files); foreach ($files as $file) { $protect_file = rtrim(str_replace('\\/\\', '/', $file), '/'); $retVal[] = createFolderProtectFile($protect_file, false); } } catch (Exception $e) { $retVal[] = $MESSAGE['MEDIA_DIR_ACCESS_DENIED']; } return $retVal; }