// Is the user logged in? (used to filter private links)
private $loggedIn;
+ // Hide public links
+ private $hidePublicLinks;
+
/**
* Creates a new LinkDB
*
*
* @param $isLoggedIn is the user logged in?
*/
- function __construct($isLoggedIn)
+ function __construct($isLoggedIn, $hidePublicLinks)
{
// FIXME: do not access $GLOBALS, pass the datastore instead
$this->loggedIn = $isLoggedIn;
+ $this->hidePublicLinks = $hidePublicLinks;
$this->checkDB();
$this->readdb();
}
{
// Public links are hidden and user not logged in => nothing to show
- if ($GLOBALS['config']['HIDE_PUBLIC_LINKS'] && !isLoggedIn()) {
+ if ($this->hidePublicLinks && !$this->loggedIn) {
$this->links = array();
return;
}