//==================================================================================================
function setup_login_state() {
- $userIsLoggedIn = false; // By default, we do not consider the user as logged in;
- $loginFailure = false; // If set to true, every attempt to authenticate the user will fail. This indicates that an important condition isn't met.
if ($GLOBALS['config']['OPEN_SHAARLI']) {
- $userIsLoggedIn = true;
+ return true;
}
+ $userIsLoggedIn = false; // By default, we do not consider the user as logged in;
+ $loginFailure = false; // If set to true, every attempt to authenticate the user will fail. This indicates that an important condition isn't met.
if (!isset($GLOBALS['login'])) {
$userIsLoggedIn = false; // Shaarli is not configured yet.
$loginFailure = true;
// If cached was not found (or not usable), then read the database and build the response:
$LINKSDB = new LinkDB(
$GLOBALS['config']['DATASTORE'],
- isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'],
+ isLoggedIn(),
$GLOBALS['config']['HIDE_PUBLIC_LINKS']
);
// Read links from database (and filter private links if user it not logged in).
// Read links from database (and filter private links if used it not logged in).
$LINKSDB = new LinkDB(
$GLOBALS['config']['DATASTORE'],
- isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'],
+ isLoggedIn(),
$GLOBALS['config']['HIDE_PUBLIC_LINKS']
);
// Read links from database (and filter private links if used it not logged in).
$LINKSDB = new LinkDB(
$GLOBALS['config']['DATASTORE'],
- isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'],
+ isLoggedIn(),
$GLOBALS['config']['HIDE_PUBLIC_LINKS']
);
{
$LINKSDB = new LinkDB(
$GLOBALS['config']['DATASTORE'],
- isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'],
+ isLoggedIn(),
$GLOBALS['config']['HIDE_PUBLIC_LINKS']
);
{
$LINKSDB = new LinkDB(
$GLOBALS['config']['DATASTORE'],
- isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'],
+ isLoggedIn(),
$GLOBALS['config']['HIDE_PUBLIC_LINKS']
);
// Process the import file form.
function importFile()
{
- if (!(isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'])) { die('Not allowed.'); }
+ if (!isLoggedIn()) { die('Not allowed.'); }
$LINKSDB = new LinkDB(
$GLOBALS['config']['DATASTORE'],
- isLoggedIn() || $GLOBALS['config']['OPEN_SHAARLI'],
+ isLoggedIn(),
$GLOBALS['config']['HIDE_PUBLIC_LINKS']
);
$filename=$_FILES['filetoupload']['name'];