diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -287,6 +287,7 @@ function logout() { | |||
287 | unset($_SESSION['ip']); | 287 | unset($_SESSION['ip']); |
288 | unset($_SESSION['username']); | 288 | unset($_SESSION['username']); |
289 | unset($_SESSION['privateonly']); | 289 | unset($_SESSION['privateonly']); |
290 | unset($_SESSION['untaggedonly']); | ||
290 | } | 291 | } |
291 | setcookie('shaarli_staySignedIn', FALSE, 0, WEB_PATH); | 292 | setcookie('shaarli_staySignedIn', FALSE, 0, WEB_PATH); |
292 | } | 293 | } |
@@ -1017,6 +1018,19 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history) | |||
1017 | exit; | 1018 | exit; |
1018 | } | 1019 | } |
1019 | 1020 | ||
1021 | // -------- User wants to see only untagged links (toggle) | ||
1022 | if (isset($_GET['untaggedonly'])) { | ||
1023 | $_SESSION['untaggedonly'] = !$_SESSION['untaggedonly']; | ||
1024 | |||
1025 | if (! empty($_SERVER['HTTP_REFERER'])) { | ||
1026 | $location = generateLocation($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'], array('untaggedonly')); | ||
1027 | } else { | ||
1028 | $location = '?'; | ||
1029 | } | ||
1030 | header('Location: '. $location); | ||
1031 | exit; | ||
1032 | } | ||
1033 | |||
1020 | // -------- Handle other actions allowed for non-logged in users: | 1034 | // -------- Handle other actions allowed for non-logged in users: |
1021 | if (!isLoggedIn()) | 1035 | if (!isLoggedIn()) |
1022 | { | 1036 | { |
@@ -1651,7 +1665,7 @@ function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager) | |||
1651 | 'searchtags' => $searchtags, | 1665 | 'searchtags' => $searchtags, |
1652 | 'searchterm' => $searchterm, | 1666 | 'searchterm' => $searchterm, |
1653 | ]; | 1667 | ]; |
1654 | $linksToDisplay = $LINKSDB->filterSearch($request, false, $visibility); | 1668 | $linksToDisplay = $LINKSDB->filterSearch($request, false, $visibility, !empty($_SESSION['untaggedonly'])); |
1655 | } | 1669 | } |
1656 | 1670 | ||
1657 | // ---- Handle paging. | 1671 | // ---- Handle paging. |