diff --git a/controllers/matrix_chat.php b/controllers/matrix_chat.php index f80088b592e658d19e918d0d8399480acd8f6eb5..83836ffd83a21a8a595e17e1fa1c10577f2b4718 100644 --- a/controllers/matrix_chat.php +++ b/controllers/matrix_chat.php @@ -44,6 +44,10 @@ class MatrixChatController extends AuthenticatedController $member = CourseMember::find([$this->course->id, User::findCurrent()->id]); + if (!$member || $GLOBALS['perm']->have_perm('admin')) { + $this->noMemberHint = true; + } + // Chat can only be used if user is visible (Matrix has no privacy settings in chat) if ($member->visible == 'yes' || $member->visible == 'unknown' && Config::get()->USER_VISIBILITY_UNKNOWN) { diff --git a/plugin.manifest b/plugin.manifest index 251380b3f3529accc5b186fa33171f5ed73327e7..82b8eb1ef96cf70b538c557dc18c8d9ba3d33d54 100644 --- a/plugin.manifest +++ b/plugin.manifest @@ -1,7 +1,7 @@ pluginname=Matrix-Chat pluginclassname=MatrixPlugin origin=data-quest -version=1.0 +version=1.1.q screenshot=assets/images/matrix_logo.png description=Matrix chat for Stud.IP courses studipMinVersion=4.5 diff --git a/views/matrix_chat/index.php b/views/matrix_chat/index.php index c5eb6c38853a8a282b173427084ce56aee053506..f19f183e78a1278bd9df8d87c76631d5434bf924 100644 --- a/views/matrix_chat/index.php +++ b/views/matrix_chat/index.php @@ -1,3 +1,12 @@ +<? if ($noMemberHint) : ?> + <div class="messagebox messagebox_warning"> + <p> + <?= dgettext('matrix', 'Sie sind nicht als teilnehmende Person in dieser Veranstaltung ' . + 'eingetragen und können daher den zu dieser Veranstaltung gehörenden Matrixraum nicht nutzen. Das ' . + 'kann daran liegen, dass Sie eine Admin- oder Rootkennung nutzen.') ?> + </p> + </div> +<? endif ?> <? if ($showAccountHint) : ?> <div class="messagebox messagebox_warning"> <p>