0) { $errors = array(); $messages = array(); for ($i=0; $i < $uploadsCount; $i++) { if ($_FILES["file"]["error"][$i] > 0) { $errors[] = i18n_r('ERROR_UPLOAD'); } else { //set variables $count = '1'; $base = clean_img_name(to7bit($_FILES["file"]["name"][$i])); $file_loc = $path . $base; //prevent overwriting while ( file_exists($file_loc) ) { $file_loc = $path . $count.'-'. $base; $base = $count.'-'. $base; $count++; } //validate file if (validate_safe_file($_FILES["file"]["tmp_name"][$i], $_FILES["file"]["name"][$i], $_FILES["file"]["type"][$i])) { move_uploaded_file($_FILES["file"]["tmp_name"][$i], $file_loc); if (defined('GSCHMOD')) { chmod($file_loc, GSCHMOD); } else { chmod($file_loc, 0644); } exec_action('file-uploaded'); // generate thumbnail require_once('inc/imagemanipulation.php'); genStdThumb($subFolder,$base); $messages[] = i18n_r('FILE_SUCCESS_MSG').': '. $SITEURL .'data/uploads/'.$subFolder.$base.''; } else { $messages[] = $_FILES["file"]["name"][$i] .' - '.i18n_r('ERROR_UPLOAD'); } //successfull message } } // after uploading all files process messages if(sizeof($messages) != 0) { foreach($messages as $msg) { $success = $msg.'
'; } } if(sizeof($errors) != 0) { foreach($errors as $msg) { $error = $msg.'
'; } } } } // if creating new folder if (isset($_GET['newfolder'])) { // check for csrf if (!defined('GSNOCSRF') || (GSNOCSRF == FALSE) ) { $nonce = $_GET['nonce']; if(!check_nonce($nonce, "createfolder")) { die("CSRF detected!"); } } $newfolder = $_GET['newfolder']; // check for invalid chars $cleanname = clean_url(to7bit(strippath($newfolder), "UTF-8")); if (file_exists($path.$cleanname) || $cleanname=='') { $error = i18n_r('ERROR_FOLDER_EXISTS'); } else { if (defined('GSCHMOD')) { $chmod_value = GSCHMOD; } else { $chmod_value = 0755; } if (mkdir($path . $cleanname, $chmod_value)) { //create folder for thumbnails $thumbFolder = GSTHUMBNAILPATH.$subFolder.$cleanname; if (!(file_exists($thumbFolder))) { mkdir($thumbFolder, $chmod_value); } $success = sprintf(i18n_r('FOLDER_CREATED'), $cleanname); } else { $error = i18n_r('ERROR_CREATING_FOLDER'); } } } get_template('header', cl($SITENAME).' » '.i18n_r('FILE_MANAGEMENT')); ?>

  /  

'; echo '
'; $pathParts = explode("/",$subPath); $urlPath = null; echo '
/ uploads / '; foreach ($pathParts as $pathPart){ if ($pathPart!=''){ $urlPath .= $pathPart.'/'; echo ''.$pathPart.' / '; } } echo '
'; echo ''; echo ''; echo ''; if (isDebug()){ echo ''; } echo ''; echo ''; if (count($dirsSorted) != 0) { $foldercount = 0; foreach ($dirsSorted as $upload) { # check to see if folder is empty $directory_delete = null; if ( check_empty_folder($path.$upload['name']) ) { $directory_delete = '×'; } $directory_size = ''.folder_items($path.$upload['name']).' '.i18n_r('ITEMS').''; echo ''; echo ''; echo ''; // get the file permissions. if ($isUnixHost && isDebug() && function_exists('posix_getpwuid')) { $filePerms = substr(sprintf('%o', fileperms($path.$upload['name'])), -4); $fileOwner = posix_getpwuid(fileowner($path.$upload['name'])); echo ''; } echo ''; echo ''; echo ''; $foldercount++; } } if (count($filesSorted) != 0) { foreach ($filesSorted as $upload) { $counter++; if ($upload['type'] == i18n_r('IMAGES') .' Images') { $cclass = 'iimage'; } else { $cclass = ''; } echo ''; echo ''; echo ''; // get the file permissions. if ($isUnixHost && isDebug() && function_exists('posix_getpwuid')) { $filePerms = substr(sprintf('%o', fileperms($path.$upload['name'])), -4); $fileOwner = posix_getpwuid(fileowner($path.$upload['name'])); echo ''; } echo ''; echo ''; echo ''; } } exec_action('file-extras'); echo '
'.i18n_r('FILE_NAME').''.i18n_r('FILE_SIZE').''.i18n_r('PERMS').''.i18n_r('DATE').'
'; $adm = substr($path . rawurlencode($upload['name']) , 16); echo ' '.htmlspecialchars($upload['name']).''.$directory_size.''.$fileOwner['name'].'/'.$filePerms.''. shtDate($upload['date']) .''.$directory_delete.'
'; if ($upload['type'] == i18n_r('IMAGES') .' Images') { $gallery = 'rel=" facybox_i"'; $pathlink = 'image.php?i='.rawurlencode($upload['name']).'&path='.$subPath; $thumbLink = $urlPath.'thumbsm.'.$upload['name']; $thumbLinkEncoded = $urlPath.'thumbsm.'.rawurlencode($upload['name']); if (file_exists(GSTHUMBNAILPATH.$thumbLink)) { $imgSrc=''; } else { $imgSrc=''; } echo ''.$imgSrc.''; } else { $gallery = ''; $controlpanel = ''; $pathlink = $path . $upload['name']; } echo ''.htmlspecialchars($upload['name']) .''. $upload['size'] .''.$fileOwner['name'].'/'.$filePerms.''. shtDate($upload['date']) .'×
'; if ($counter > 0) { $sizedesc = '('. fSize($totalsize) .')'; } else { $sizedesc = ''; } $totalcount = (int)$counter+(int)$foldercount; echo '

'. $totalcount .' '.i18n_r('TOTAL_FILES').' '.$sizedesc.'

'; ?>