mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:15:51 +00:00
don't whitescreen search page when not logged in.
This commit is contained in:
parent
fbc5c0777f
commit
78988410c4
2 changed files with 4 additions and 12 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue