add(ERROR_FILENAME_EMPTY, 'error'); } break; case 'processuploads': for ($i=1; $i<6; $i++) { if (is_uploaded_file($HTTP_POST_FILES['file_' . $i]['tmp_name'])) { new upload('file_' . $i, $current_path); } } tep_redirect(tep_href_link(FILENAME_FILE_MANAGER)); break; case 'download': header('Content-type: application/x-octet-stream'); header('Content-disposition: attachment; filename=' . urldecode($HTTP_GET_VARS['filename'])); readfile($current_path . '/' . urldecode($HTTP_GET_VARS['filename'])); exit; break; case 'upload': case 'new_folder': case 'new_file': $directory_writeable = true; if (!is_writeable($current_path)) { $directory_writeable = false; $messageStack->add(sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $current_path), 'error'); } break; case 'edit': if (strstr($HTTP_GET_VARS['info'], '..')) tep_redirect(tep_href_link(FILENAME_FILE_MANAGER)); $file_writeable = true; if (!is_writeable($current_path . '/' . $HTTP_GET_VARS['info'])) { $file_writeable = false; $messageStack->add(sprintf(ERROR_FILE_NOT_WRITEABLE, $current_path . '/' . $HTTP_GET_VARS['info']), 'error'); } break; case 'delete': if (strstr($HTTP_GET_VARS['info'], '..')) tep_redirect(tep_href_link(FILENAME_FILE_MANAGER)); break; } } $in_directory = substr(substr(DIR_FS_DOCUMENT_ROOT, strrpos(DIR_FS_DOCUMENT_ROOT, '/')), 1); $current_path_array = explode('/', $current_path); $document_root_array = explode('/', DIR_FS_DOCUMENT_ROOT); $goto_array = array(array('id' => DIR_FS_DOCUMENT_ROOT, 'text' => $in_directory)); for ($i=0, $n=sizeof($current_path_array); $i<$n; $i++) { if ((isset($document_root_array[$i]) && ($current_path_array[$i] != $document_root_array[$i])) || !isset($document_root_array[$i])) { $goto_array[] = array('id' => implode('/', array_slice($current_path_array, 0, $i+1)), 'text' => $current_path_array[$i]); } } ?> > <?php echo TITLE; ?>
read()) { if ( ($file != '.') && ($file != 'CVS') && ( ($file != '..') || ($current_path != DIR_FS_DOCUMENT_ROOT) ) ) { $file_size = number_format(filesize($current_path . '/' . $file)) . ' bytes'; $permissions = tep_get_file_permissions(fileperms($current_path . '/' . $file)); if ($showuser) { $user = @posix_getpwuid(fileowner($current_path . '/' . $file)); $group = @posix_getgrgid(filegroup($current_path . '/' . $file)); } else { $user = $group = array(); } $contents[] = array('name' => $file, 'is_dir' => is_dir($current_path . '/' . $file), 'last_modified' => strftime(DATE_TIME_FORMAT, filemtime($current_path . '/' . $file)), 'size' => $file_size, 'permissions' => $permissions, 'user' => $user['name'], 'group' => $group['name']); } } function tep_cmp($a, $b) { return strcmp( ($a['is_dir'] ? 'D' : 'F') . $a['name'], ($b['is_dir'] ? 'D' : 'F') . $b['name']); } usort($contents, 'tep_cmp'); ?>
' . $current_path . ''; ?>
' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''; ?>
'' . $fInfo->name . ''); $contents = array('form' => tep_draw_form('file', FILENAME_FILE_MANAGER, 'info=' . urlencode($fInfo->name) . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_DELETE_INTRO); $contents[] = array('text' => '
' . $fInfo->name . ''); $contents[] = array('align' => 'center', 'text' => '
' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; case 'new_folder': $heading[] = array('text' => '' . TEXT_NEW_FOLDER . ''); $contents = array('form' => tep_draw_form('folder', FILENAME_FILE_MANAGER, 'action=insert')); $contents[] = array('text' => TEXT_NEW_FOLDER_INTRO); $contents[] = array('text' => '
' . TEXT_FILE_NAME . '
' . tep_draw_input_field('folder_name')); $contents[] = array('align' => 'center', 'text' => '
' . (($directory_writeable == true) ? tep_image_submit('button_save.gif', IMAGE_SAVE) : '') . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; case 'upload': $heading[] = array('text' => '' . TEXT_INFO_HEADING_UPLOAD . ''); $contents = array('form' => tep_draw_form('file', FILENAME_FILE_MANAGER, 'action=processuploads', 'post', 'enctype="multipart/form-data"')); $contents[] = array('text' => TEXT_UPLOAD_INTRO); $file_upload = ''; for ($i=1; $i<6; $i++) $file_upload .= tep_draw_file_field('file_' . $i) . '
'; $contents[] = array('text' => '
' . $file_upload); $contents[] = array('align' => 'center', 'text' => '
' . (($directory_writeable == true) ? tep_image_submit('button_upload.gif', IMAGE_UPLOAD) : '') . ' ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . ''); break; default: if (isset($fInfo) && is_object($fInfo)) { $heading[] = array('text' => '' . $fInfo->name . ''); if (!$fInfo->is_dir) $contents[] = array('align' => 'center', 'text' => '' . tep_image_button('button_edit.gif', IMAGE_EDIT) . ''); $contents[] = array('text' => '
' . TEXT_FILE_NAME . ' ' . $fInfo->name . ''); if (!$fInfo->is_dir) $contents[] = array('text' => '
' . TEXT_FILE_SIZE . ' ' . $fInfo->size . ''); $contents[] = array('text' => '
' . TEXT_LAST_MODIFIED . ' ' . $fInfo->last_modified); } } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo ' ' . "\n"; } ?>
name)) { if ($fInfo->is_dir) { echo ' ' . "\n"; $onclick_link = 'goto=' . $goto_link; } else { echo ' ' . "\n"; $onclick_link = 'info=' . urlencode($fInfo->name) . '&action=edit'; } } else { echo ' ' . "\n"; $onclick_link = 'info=' . urlencode($contents[$i]['name']); } if ($contents[$i]['is_dir']) { if ($contents[$i]['name'] == '..') { $icon = tep_image(DIR_WS_ICONS . 'previous_level.gif', ICON_PREVIOUS_LEVEL); } else { $icon = (isset($fInfo) && is_object($fInfo) && ($contents[$i]['name'] == $fInfo->name) ? tep_image(DIR_WS_ICONS . 'current_folder.gif', ICON_CURRENT_FOLDER) : tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER)); } $link = tep_href_link(FILENAME_FILE_MANAGER, 'goto=' . $goto_link); } else { $icon = tep_image(DIR_WS_ICONS . 'file_download.gif', ICON_FILE_DOWNLOAD); $link = tep_href_link(FILENAME_FILE_MANAGER, 'action=download&filename=' . urlencode($contents[$i]['name'])); } ?>
 
' . $icon . ' ' . $contents[$i]['name']; ?> ' . tep_image(DIR_WS_ICONS . 'delete.gif', ICON_DELETE) . ' '; if (isset($fInfo) && is_object($fInfo) && ($fInfo->name == $contents[$i]['name'])) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . ''; } ?> 
' . tep_image_button('button_reset.gif', IMAGE_RESET) . ''; ?> ' . tep_image_button('button_upload.gif', IMAGE_UPLOAD) . ' ' . tep_image_button('button_new_file.gif', IMAGE_NEW_FILE) . ' ' . tep_image_button('button_new_folder.gif', IMAGE_NEW_FOLDER) . ''; ?>
' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo '