} # burn access ? burned($id); exit(json_encode($id_tree)); } # RSS format of a shared folder (but not for a locked one) if (isset($_GET['rss']) && !empty($tree) && strlen($id) <= 23) { $rss = array('infos' => '', 'items' => ''); $rss['infos'] = array('title' => basename($f), 'description' => e('Rss feed of ', false) . basename($f), 'link' => htmlentities($_SESSION['home'] . '?f=' . $id . '&rss')); include 'core/Array2feed.php'; $upload_path_size = strlen($_SESSION['upload_path']); foreach ($tree as $branch) { $id_branch = file2id(substr($branch, $upload_path_size)); $rss['items'][] = array('title' => basename($branch), 'description' => '', 'pubDate' => makeRSSdate(date("d-m-Y H:i:s.", filemtime($branch))), 'link' => $_SESSION['home'] . '?f=' . $id_branch, 'guid' => $_SESSION['home'] . '?f=' . $id_branch); } array2feed($rss); # burn access ? burned($id); exit; } } } } else { $message = '<div class="error"> <br/> ' . e('This link is no longer available, sorry.', false) . ' <br/> </div>'; } } ?>
// affichage en json if ($view_json == true && isset($_GET['json']) && !empty($tree) && strlen($id) <= 23) { $upload_path_size = strlen($_SESSION['upload_root_path']); foreach ($tree as $branch) { $id_tree[file2id($branch)] = $branch; } echo json_encode($id_tree); } // affichage en flux rss if ($view_rss == true && isset($_GET['rss']) && !empty($tree) && strlen($id) <= 23) { $rss = ['infos' => '', 'items' => '']; $rss['infos'] = ['title' => basename($f), 'description' => e('Rss feed:', false) . basename($f), 'link' => htmlentities($_SESSION['home'] . '?f=' . $id . '&rss')]; require_once __DIR__ . '/Array2feed.php'; $upload_path_size = strlen($_SESSION['upload_root_path']); foreach ($tree as $branch) { $id_branch = file2id($branch); $rss['items'][] = ['title' => basename($branch), 'description' => '', 'pubDate' => makeRSSdate(date("d-m-Y H:i:s.", filemtime($branch))), 'link' => $_SESSION['home'] . '?f=' . $id_branch, 'guid' => $_SESSION['home'] . '?f=' . $id_branch]; } echo array2feed($rss); } } // page non bloqué par un mot de passe } else { require_once THEME_PATH . '/header.php'; echo '<div id="nolink">' . e('This link is no longer available, sorry.', false) . '</div>'; require_once THEME_PATH . '/footer.php'; } // l'id du fichier ou dossier est-il en accès unique ? burned($id); // on quitte exit;