Fix missing $a->data['user'] in mod/cal

This commit is contained in:
Hypolite Petovan 2018-08-05 15:55:11 +02:00
parent ef1c73fb6b
commit fb39124301

View file

@ -29,11 +29,11 @@ function cal_init(App $a)
}
if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
return;
System::httpExit(403, ['title' => L10n::t('Access denied.')]);
}
if ($a->argc < 2) {
System::httpExit(403, ["title" => L10n::t('Access denied.')]);
System::httpExit(403, ['title' => L10n::t('Access denied.')]);
}
Nav::setSelected('events');
@ -41,7 +41,7 @@ function cal_init(App $a)
$nick = $a->argv[1];
$user = DBA::selectFirst('user', [], ['nickname' => $nick, 'blocked' => false]);
if (!DBA::isResult($user)) {
return;
System::httpExit(404, ['title' => L10n::t('Page not found.')]);
}
$a->data['user'] = $user;