don't whitescreen search page when not logged in.

This commit is contained in:
Mike Macgirvin 2023-04-28 06:22:11 +10:00
parent fbc5c0777f
commit 78988410c4
2 changed files with 4 additions and 12 deletions

View file

@ -106,16 +106,7 @@ class Home extends Controller
}
}
else {
$randfunc = db_getfunc('rand');
$r = q("select * from channel where channel_id in ( select abook_channel from abook where abook_xchan = '%s') and channel_system = 0 and channel_removed = 0 orber by $randfunc limit 1",
dbesc(get_observer_hash())
);
if ($r) {
goaway(z_root() . '/channel/' . $r[0]['channel_hash']);
}
else {
goaway(z_root() . '/search');
}
goaway(z_root() . '/apps');
}
}
@ -174,7 +165,7 @@ class Home extends Controller
}
$loginbox = get_config('system', 'login_on_homepage');
if (intval($loginbox) || $loginbox === false) {
if ((intval($loginbox) || $loginbox === false) && !get_observer_hash()) {
$o .= login(true);
}

View file

@ -92,7 +92,8 @@ class Search extends Controller
$clone = Channel::from_hash(get_observer_hash());
}
if (!$clone && !local_channel()) {
http_status_exit(403, 'Permission denied.');
notice (t('Permission denied'));
return '';
}
}
}