diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 34 |
1 files changed, 28 insertions, 6 deletions
@@ -716,7 +716,11 @@ function showRSS() | |||
716 | $cached = $cache->cachedVersion(); if (!empty($cached)) { echo $cached; exit; } | 716 | $cached = $cache->cachedVersion(); if (!empty($cached)) { echo $cached; exit; } |
717 | 717 | ||
718 | // If cached was not found (or not usable), then read the database and build the response: | 718 | // If cached was not found (or not usable), then read the database and build the response: |
719 | $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']); // Read links from database (and filter private links if user it not logged in). | 719 | $LINKSDB = new LinkDB( |
720 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], | ||
721 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] | ||
722 | ); | ||
723 | // Read links from database (and filter private links if user it not logged in). | ||
720 | 724 | ||
721 | // Optionally filter the results: | 725 | // Optionally filter the results: |
722 | $linksToDisplay=array(); | 726 | $linksToDisplay=array(); |
@@ -791,7 +795,11 @@ function showATOM() | |||
791 | $cached = $cache->cachedVersion(); if (!empty($cached)) { echo $cached; exit; } | 795 | $cached = $cache->cachedVersion(); if (!empty($cached)) { echo $cached; exit; } |
792 | // If cached was not found (or not usable), then read the database and build the response: | 796 | // If cached was not found (or not usable), then read the database and build the response: |
793 | 797 | ||
794 | $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']); // Read links from database (and filter private links if used it not logged in). | 798 | // Read links from database (and filter private links if used it not logged in). |
799 | $LINKSDB = new LinkDB( | ||
800 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], | ||
801 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] | ||
802 | ); | ||
795 | 803 | ||
796 | // Optionally filter the results: | 804 | // Optionally filter the results: |
797 | $linksToDisplay=array(); | 805 | $linksToDisplay=array(); |
@@ -872,7 +880,12 @@ function showDailyRSS() | |||
872 | $cache = new pageCache(pageUrl(),startsWith($query,'do=dailyrss') && !isLoggedIn()); | 880 | $cache = new pageCache(pageUrl(),startsWith($query,'do=dailyrss') && !isLoggedIn()); |
873 | $cached = $cache->cachedVersion(); if (!empty($cached)) { echo $cached; exit; } | 881 | $cached = $cache->cachedVersion(); if (!empty($cached)) { echo $cached; exit; } |
874 | // If cached was not found (or not usable), then read the database and build the response: | 882 | // If cached was not found (or not usable), then read the database and build the response: |
875 | $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']); // Read links from database (and filter private links if used it not logged in). | 883 | |
884 | // Read links from database (and filter private links if used it not logged in). | ||
885 | $LINKSDB = new LinkDB( | ||
886 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], | ||
887 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] | ||
888 | ); | ||
876 | 889 | ||
877 | /* Some Shaarlies may have very few links, so we need to look | 890 | /* Some Shaarlies may have very few links, so we need to look |
878 | back in time (rsort()) until we have enough days ($nb_of_days). | 891 | back in time (rsort()) until we have enough days ($nb_of_days). |
@@ -940,7 +953,10 @@ function showDailyRSS() | |||
940 | // "Daily" page. | 953 | // "Daily" page. |
941 | function showDaily() | 954 | function showDaily() |
942 | { | 955 | { |
943 | $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']); // Read links from database (and filter private links if used it not logged in). | 956 | $LINKSDB = new LinkDB( |
957 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], | ||
958 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] | ||
959 | ); | ||
944 | 960 | ||
945 | $day=Date('Ymd',strtotime('-1 day')); // Yesterday, in format YYYYMMDD. | 961 | $day=Date('Ymd',strtotime('-1 day')); // Yesterday, in format YYYYMMDD. |
946 | if (isset($_GET['day'])) $day=$_GET['day']; | 962 | if (isset($_GET['day'])) $day=$_GET['day']; |
@@ -1006,7 +1022,10 @@ function showDaily() | |||
1006 | // Render HTML page (according to URL parameters and user rights) | 1022 | // Render HTML page (according to URL parameters and user rights) |
1007 | function renderPage() | 1023 | function renderPage() |
1008 | { | 1024 | { |
1009 | $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']); // Read links from database (and filter private links if used it not logged in). | 1025 | $LINKSDB = new LinkDB( |
1026 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], | ||
1027 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] | ||
1028 | ); | ||
1010 | 1029 | ||
1011 | // -------- Display login form. | 1030 | // -------- Display login form. |
1012 | if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=login')) | 1031 | if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=login')) |
@@ -1584,7 +1603,10 @@ HTML; | |||
1584 | function importFile() | 1603 | function importFile() |
1585 | { | 1604 | { |
1586 | if (!(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'])) { die('Not allowed.'); } | 1605 | if (!(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'])) { die('Not allowed.'); } |
1587 | $LINKSDB = new LinkDB(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI']); // Read links from database (and filter private links if used it not logged in). | 1606 | $LINKSDB = new LinkDB( |
1607 | isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'], | ||
1608 | $GLOBALS['config']['HIDE_PUBLIC_LINKS'] | ||
1609 | ); | ||
1588 | $filename=$_FILES['filetoupload']['name']; | 1610 | $filename=$_FILES['filetoupload']['name']; |
1589 | $filesize=$_FILES['filetoupload']['size']; | 1611 | $filesize=$_FILES['filetoupload']['size']; |
1590 | $data=file_get_contents($_FILES['filetoupload']['tmp_name']); | 1612 | $data=file_get_contents($_FILES['filetoupload']['tmp_name']); |