Skip to content
Snippets Groups Projects
Commit fd65f4d4 authored by Thomas Hackl's avatar Thomas Hackl
Browse files

PHP8: properly initialize all values for view

parent 63520aff
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,10 @@ class MatrixChatController extends AuthenticatedController
Navigation::activateItem('/course/matrix/matrix_chat');
$this->noChat = false;
$this->noMemberHint = false;
$this->showAccountHint = false;
$this->account = null;
$this->hasToCreate = false;
$member = CourseMember::find([$this->course->id, User::findCurrent()->id]);
......@@ -71,13 +75,10 @@ class MatrixChatController extends AuthenticatedController
$this->account->store();
}
$this->hasToCreate = false;
if ($this->account || !Config::get()->MATRIX_AUTO_CREATE_ACCOUNTS) {
if (!($room = MatrixRoom::findOneByRange_id(Course::findCurrent()->id))) {
$this->hasToCreate = true;
} else {
$this->hasToCreate = false;
if ($this->account) {
if (Config::get()->MATRIX_AUTO_CREATE_ACCOUNTS) {
$room->requireMembership($this->account->getLinkedAccount());
......
<?php
/**
* @var bool $noMemberHint
* @var bool $showAccountHint
* @var MatrixAccount $account
* @var MatrixChatController $controller
* @var bool $no_account_wanted
* @var bool $hasToCreate
* @var bool $noChat
*/
?>
<? if ($noMemberHint) : ?>
<div class="messagebox messagebox_warning">
<p>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment