X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=2014bcead5a630c4ed619d9a6228d2e908d61856;hb=0c45b01cc2af1d0c8771f4c20de3e8f732c93080;hp=69a53c56a70593f7954b8ca64aae730adde6a282;hpb=507849290c802b2a2a45541d6888108a9aef238b;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index 69a53c56..2014bcea 100644 --- a/index.php +++ b/index.php @@ -34,6 +34,7 @@ $GLOBALS['config']['UPDATECHECK_INTERVAL'] = 86400 ; // Updates check frequency // Note: You must have publisher.php in the same directory as Shaarli index.php $GLOBALS['config']['ARCHIVE_ORG'] = false; // For each link, add a link to an archived version on archive.org $GLOBALS['config']['ENABLE_RSS_PERMALINKS'] = true; // Enable RSS permalinks by default. This corresponds to the default behavior of shaarli before this was added as an option. +$GLOBALS['config']['DISABLE_PUBLIC_LINKS'] = false; // ----------------------------------------------------------------------------------------------- // You should not touch below (or at your own risks!) // Optional config file. @@ -1459,6 +1460,7 @@ function renderPage() $GLOBALS['privateLinkByDefault']=!empty($_POST['privateLinkByDefault']); $GLOBALS['config']['ENABLE_RSS_PERMALINKS']= !empty($_POST['enableRssPermalinks']); $GLOBALS['config']['ENABLE_UPDATECHECK'] = !empty($_POST['updateCheck']); + $GLOBALS['config']['DISABLE_PUBLIC_LINKS'] = !empty($_POST['disablePublicLinks']); writeConfig(); echo ''; exit; @@ -1899,9 +1901,13 @@ function buildLinkList($PAGE,$LINKSDB) } $search_type='permalink'; } + // We chose to disable all private links and the user isn't logged in, do not return any link. + else if ($GLOBALS['config']['DISABLE_PUBLIC_LINKS'] && !isLoggedIn()) + $linksToDisplay = array(); else $linksToDisplay = $LINKSDB; // Otherwise, display without filtering. + // Option: Show only private links if (!empty($_SESSION['privateonly'])) { @@ -2328,6 +2334,7 @@ function writeConfig() $config .= '$GLOBALS[\'privateLinkByDefault\']='.var_export($GLOBALS['privateLinkByDefault'],true).'; '; $config .= '$GLOBALS[\'config\'][\'ENABLE_RSS_PERMALINKS\']='.var_export($GLOBALS['config']['ENABLE_RSS_PERMALINKS'], true).'; '; $config .= '$GLOBALS[\'config\'][\'ENABLE_UPDATECHECK\']='.var_export($GLOBALS['config']['ENABLE_UPDATECHECK'], true).'; '; + $config .= '$GLOBALS[\'config\'][\'DISABLE_PUBLIC_LINKS\']='.var_export($GLOBALS['config']['DISABLE_PUBLIC_LINKS'], true).'; '; $config .= ' ?>'; if (!file_put_contents($GLOBALS['config']['CONFIG_FILE'],$config) || strcmp(file_get_contents($GLOBALS['config']['CONFIG_FILE']),$config)!=0) {