getValue('SELECT id FROM file_folder_share WHERE access_key = '.$db->quote($sharekey).' AND folder_id = '.(int)$folder->id.' LIMIT 1'); if($isValid) { $db->query('UPDATE file_folder_share SET last_accessed = NOW() WHERE id = '.(int)$isValid.' LIMIT 1'); $_SESSION['sharekey'.$folder->id] = true; $_SESSION['sharekeyOriginalUrl'] = $folder->getFolderUrl().'?sharekey='.$sharekey; } } } // clear it if we don't have it if($isValid == false) { $_SESSION['sharekey'.$folder->id] = false; $_SESSION['sharekeyOriginalUrl'] = ''; unset($_SESSION['sharekey'.$folder->id]); unset($_SESSION['sharekeyOriginalUrl']); } // make sure it's a public folder or the owner is logged in/has a matching access key if ($folderId) { $fileFolder = fileFolder::loadById($folderId); if (!$fileFolder) { // failed lookup of the fileFolder coreFunctions::redirect(WEB_ROOT . '/index.' . SITE_CONFIG_PAGE_EXTENSION); } // privacy if(((int)$folder->userId > 0) && ($folder->userId != $Auth->id)) { if(coreFunctions::getOverallPublicStatus($folder->userId, $folder->id) == false) { coreFunctions::redirect(WEB_ROOT . '/index.' . SITE_CONFIG_PAGE_EXTENSION); } } } else { coreFunctions::redirect(WEB_ROOT . '/index.' . SITE_CONFIG_PAGE_EXTENSION); } // check for password if we need it $showFolder = true; if (strlen($fileFolder->accessPassword) > 0) { /* check folder password */ if ((int) $_REQUEST['passwordSubmit']) { // check password $folderPassword = trim($_REQUEST['folderPassword']); if (!strlen($folderPassword)) { notification::setError(t("please_enter_the_folder_password", "Please enter the folder password")); } else { if (md5($folderPassword) == $fileFolder->accessPassword) { // successful $_SESSION['folderPassword'] = md5($folderPassword); } else { // login failed notification::setError(t("password_is_invalid", "The folder password is invalid")); } } } // figure out whether to show the folder $showFolder = false; if (isset($_SESSION['folderPassword'])) { // check password if ($_SESSION['folderPassword'] == $fileFolder->accessPassword) { $showFolder = true; } } } // if the owner is logged in, ignore the password prompt if ($fileFolder->userId == $Auth->id) { $showFolder = true; } // setup page define("PAGE_NAME", t("view_folder_page_name", "View Folder")); define("PAGE_DESCRIPTION", t("view_folder_meta_description", "View Folder")); define("PAGE_KEYWORDS", t("account_home_meta_keywords", "folder, view, file, your, interface, upload, download, site")); define("TITLE_DESCRIPTION_LEFT", t("view_folder_title_page_description_left", "")); define("TITLE_DESCRIPTION_RIGHT", t("view_folder_title_page_description_right", "")); // page OG info (for facebook) define("PAGE_OG_TITLE", $folder->folderName.' '.t("folder_page_name", "Folder")); define("PAGE_OG_SITE_NAME", SITE_CONFIG_SITE_NAME); define("PAGE_OG_DESCRIPTION", PAGE_DESCRIPTION); // include header require_once(SITE_TEMPLATES_PATH . '/partial/_header.inc.php'); // show login box if password required if ($showFolder == false) { ?>

" type="password"/>

'folderName); ?>'

userId == $Auth->id): ?>

isPublic == 0) { echo t('folder_share_this_folder_can_not_be_shared_as_it_is_not_publicly_accessible', 'This folder can not be shared as it is not set to a publicly accessible folder. Only users with access to your account can see this listing.'); } else { echo t('folder_share_you_can_share_this_page_with_other_external_users', 'You can share this page with other users who do not have access to your account. Just copy the website url in the url bar and provide this via email or other sharing method.'); if (strlen($fileFolder->accessPassword)) { echo '

'; echo t('folder_share_as_youve_set_a_password_on_this_folder', 'Note: As you\'ve set a password on this folder, users will need to correctly enter this before they gain access to this page.'); } } ?>

'; echo ''; echo ''; echo '' . t('download_url_filename', 'Download Url/Filename:') . ''; echo '' . t('options', 'Options:') . ''; echo ''; echo ''; foreach ($childFolders AS $childFolder) { // hydrate folder $fileFolder = fileFolder::hydrate($childFolder); // get total files $totalFiles = 0; $allFiles = file::loadAllActiveByFolderId($fileFolder->id); if ($allFiles) { $totalFiles = COUNT($allFiles); } echo ''; echo ''; echo ' '; echo ''; echo ''; echo '' . validation::safeOutputToScreen($fileFolder->folderName) . ''; echo '
' . $totalFiles . ' file' . ($totalFiles != 1 ? 's' : '') . ''; echo ''; $links = array(); $links[] = ''; echo '' . implode(" ", $links) . ''; echo ''; } foreach ($files AS $file) { if($file['isPublic'] == 1) { $fileUrl = file::getFileUrl($file['id']); echo ''; echo ''; $fileTypePath = DOC_ROOT . '/themes/' . SITE_CONFIG_SITE_THEME . '/images/file_icons/32px/' . $file['extension'] . '.png'; if (file_exists($fileTypePath)) { echo ' '; } else { echo ' '; } echo ''; echo ''; echo '' . validation::safeOutputToScreen($file['originalFilename']) .'  (' . coreFunctions::formatSize($file['fileSize']) . ')'; echo '
' . str_replace(array('http://', 'https://'), '', file::getFileUrl($file['id'])); echo ''; echo ''; $links = array(); $links[] = ''; $links[] = ''; echo '' . implode(" ", $links) . ''; echo ''; } } echo ''; echo ''; } else { echo '- ' . t('there_are_no_files_within_this_folder', 'There are no files within this folder.') . ''; } ?>