X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=dd3ec3a41a4fd3bc2e2a641707e52d7768aba94f;hb=eaefcba724e93c5f6b426ad8855ab1af8ac8212a;hp=39b01a2eb0eb3c3457a78da481f459367220d538;hpb=5f85fcd863fe261921953ea3bd1742f3e1b7cf68;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index 39b01a2e..dd3ec3a4 100644 --- a/index.php +++ b/index.php @@ -716,7 +716,11 @@ function showRSS() $cached = $cache->cachedVersion(); if (!empty($cached)) { echo $cached; exit; } // If cached was not found (or not usable), then read the database and build the response: - $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']); // Read links from database (and filter private links if user it not logged in). + $LINKSDB = new LinkDB( + isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], + $GLOBALS['config']['HIDE_PUBLIC_LINKS'] + ); + // Read links from database (and filter private links if user it not logged in). // Optionally filter the results: $linksToDisplay=array(); @@ -791,7 +795,11 @@ function showATOM() $cached = $cache->cachedVersion(); if (!empty($cached)) { echo $cached; exit; } // If cached was not found (or not usable), then read the database and build the response: - $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']); // Read links from database (and filter private links if used it not logged in). +// Read links from database (and filter private links if used it not logged in). + $LINKSDB = new LinkDB( + isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], + $GLOBALS['config']['HIDE_PUBLIC_LINKS'] + ); // Optionally filter the results: $linksToDisplay=array(); @@ -872,7 +880,12 @@ function showDailyRSS() $cache = new pageCache(pageUrl(),startsWith($query,'do=dailyrss') && !isLoggedIn()); $cached = $cache->cachedVersion(); if (!empty($cached)) { echo $cached; exit; } // If cached was not found (or not usable), then read the database and build the response: - $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']); // Read links from database (and filter private links if used it not logged in). + +// Read links from database (and filter private links if used it not logged in). + $LINKSDB = new LinkDB( + isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], + $GLOBALS['config']['HIDE_PUBLIC_LINKS'] + ); /* Some Shaarlies may have very few links, so we need to look back in time (rsort()) until we have enough days ($nb_of_days). @@ -940,7 +953,10 @@ function showDailyRSS() // "Daily" page. function showDaily() { - $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']); // Read links from database (and filter private links if used it not logged in). + $LINKSDB = new LinkDB( + isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], + $GLOBALS['config']['HIDE_PUBLIC_LINKS'] + ); $day=Date('Ymd',strtotime('-1 day')); // Yesterday, in format YYYYMMDD. if (isset($_GET['day'])) $day=$_GET['day']; @@ -1006,7 +1022,10 @@ function showDaily() // Render HTML page (according to URL parameters and user rights) function renderPage() { - $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']); // Read links from database (and filter private links if used it not logged in). + $LINKSDB = new LinkDB( + isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], + $GLOBALS['config']['HIDE_PUBLIC_LINKS'] + ); // -------- Display login form. if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=login')) @@ -1584,7 +1603,10 @@ HTML; function importFile() { if (!(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'])) { die('Not allowed.'); } - $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']); // Read links from database (and filter private links if used it not logged in). + $LINKSDB = new LinkDB( + isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], + $GLOBALS['config']['HIDE_PUBLIC_LINKS'] + ); $filename=$_FILES['filetoupload']['name']; $filesize=$_FILES['filetoupload']['size']; $data=file_get_contents($_FILES['filetoupload']['tmp_name']);