Skip to content
Snippets Groups Projects
Commit 27ac09cd authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

Merge remote-tracking branch 'studip/5.5' into 5.5

parents 5a83ec8c 68adf29f
Branches
No related tags found
No related merge requests found
Showing
with 239 additions and 66 deletions
...@@ -223,7 +223,7 @@ phpstan: ...@@ -223,7 +223,7 @@ phpstan:
- *mkdir-caches - *mkdir-caches
- *mkdir-reports - *mkdir-reports
- *install-composer - *install-composer
- 'echo "includes:\n - phpstan.neon.dist\n\nparameters:\n tmpDir: $PHPSTAN_CACHE_PATH" > phpstan.neon' - 'echo -e "includes:\n - phpstan.neon.dist\n\nparameters:\n tmpDir: $PHPSTAN_CACHE_PATH" > phpstan.neon'
script: script:
- php - php
composer/bin/phpstan analyse composer/bin/phpstan analyse
......
# 03.09.2024 v 5.5.2
https://gitlab.studip.de/studip/studip/-/issues?milestone_title=Stud.IP+5.5.2&state=all
- Courseware: Fokusmodus bietet zwar Bearbeiten an, bricht dann aber ab/beendet bearbeiten [#1461]
- Wiki: Das automatische Speichern ist standardmäßig angeschaltet [#4166]
- Courseware: TypeError beim Weiterschalten der Seite [#4192]
- „Anmerkungen aktivieren“ funktioniert nicht [#4400]
- Courseware: in der neuen Block-Auswahl-Liste ist für mich unten der letzte Eintrag nicht richtig sichtbar [#4401]
- Courseware: Anzeige einer Sperre beim Löschen einer Seite [#4406]
- Courseware: Fehler in der JSON-API durch Warnungen in PHP 8 [#4408]
- Wiki: Neue Seiten zeigt falsche Autorenzuordnung an [#4410]
- Wiki: InvalidArgumentException beim Anklicken eines Links [#4411]
- Blubber: Eingabefeld wächst bei jedem eingegeben Zeichen [#4413]
- Blubber-Thread: Das Lade-Icon dreht sich dauerhaft [#4414]
- Courseware: Quelltext-Block zeigt kein Highlighting mehr an [#4439]
- Probleme beim Eintragen von Terminen [#4484]
- Fehler beim Import von Terminen [#4485]
- Wiki ermöglicht, alte Zwischenversionen der Seite zu löschen [#4486]
- Suche nach Matrikelnummer in der Nutzerverwaltung nicht möglich [#4497]
- Update verändert erste Seite einer Courseware [#4499]
- Externe Seiten: Fatal error: Allowed memory size exhausted [#4518]
- PHP8: Warnungen in JSON-API Route des Dateibereichs [#4519]
- Wiki: Keine Warnung beim Verlassen der Seite bei ungespeicherten Änderungen [#4522]
- PHP8 - Warnungen im WIKI [#4535]
- PHP8 - Warnungen im CourseMember [#4536]
- CalendarDate::garbageCollect() wird nicht verwendet [#4539]
- Wiki: Warnung beim Speichern der Seite [#4543]
# 03.09.2024 v 5.4.5
https://gitlab.studip.de/studip/studip/-/issues?milestone_title=Stud.IP+5.4.5&state=all
- Verwaltung von Veranstaltungen: Spalte "Inhalte" bricht um [#3078]
- Galerie Block Gitter Layout defekt [#3184]
- Courseware: Export des Lernmaterials ist kaputt, wenn ein Bild aus dem Bilderpool gewählt wurde [#3743]
- Admin-VA CSV-Export ist unsortiert [#3994]
- Bei einem leeren Blubber-Thread dreht sich dauerhaft das Lade-Icon am linken Rand des Hauptbereiches [#4191]
- JSON-API controller RangeTreeIndex StudyAreasIndex haben eine irreführende und zu kurze Beschreibung im DocBlock [#4396]
- JSON-API Controller RangeTreeIndex ist nicht eingebunden [#4397]
- Veranstaltungsverwaltung: ursprünglicher Werkzeugname zeigt nichts an [#4419]
- Werkzeuge: Einstellung für Sichtbarkeit wird auch in Einrichtungen angeboten [#4420]
- kompakte/mobile Navigation: Verwaltung ist ganz unten im Menü [#4422]
- "Mehrere Gruppen anlegen" wirft Fehler bei Einzelterminen wegen fehlender Description [#4449]
- Adminverwaltungsseite für Veranstaltungen: Zurücksetzen der Suche setzt diese nicht unmittelbar zurück [#4460]
- Werkzeuge: Zusätzliche Kategorie "Sonstige" [#4469]
- Das Feedback-Modul ist kaputt [#4475]
- Hauptordner in Veranstaltung gehört Studierendem statt Dozierendem [#4479]
- Veranstaltungs-Stundenplan zeigt keine Treffer, wenn auf der Veranstaltungsverwaltungsseite ein Suchbegriff eingegeben wurde [#4515]
- PHP8 - Warnungen auf der Teilnehmerseite [#4533]
- PHP8 - Warnungen in den Raumberechtigungen [#4538]
# 03.09.2023 v 5.3.8
https://gitlab.studip.de/studip/studip/-/issues?milestone_title=Stud.IP+5.3.8&state=all
- Courseware: Falsche Berechtigungen für nicht im Kurs eingetragene Personen [#889]
- Globale Suche/Schnellsuche: Graue Texte entfernen [#1382]
- WYSIWYG: Unterschiedliche Darstellung Editor/Lesemodus [#1607]
- Zusammenführen von Accounts nimmt keine Courseware-Inhalte mit [#2492]
- Beschreibung des Lernmaterials nur beim Import nicht zwingend erforderlich. [#2776]
- Aktion "Inhalt kopieren" bei einer abgegebenen Aufgabe funktioniert nicht [#2805]
- Courseware Dateiordner Block Darstellungsfehler [#2823]
- Courseware: Kopieren von Abschnitten generiert `null`-Einträge in der Payload [#2842]
- Verschieben von Blöcken direkt nach dem Anlegen funktioniert nicht [#3000]
- Exportierter Kalender kann nicht in einem anderen Account importiert werden [#3103]
- Beschreibung im Block Karriere wird nicht angeziegt [#3144]
- Courseware: "Lerninhalte kopieren"-Wizard kann verschoben werden, Dropdownmenü bleibt sticky [#3174]
- Courseware: "Error: Undefined data type" im Block "Ziele" [#3181]
- DOMDocument::loadHTML(): Empty string supplied as input [#3194]
- Courseware: verlängerte Aufgabe kann von Studi nicht mehr abgegeben werden (Aktionsmenü fehlt) [#3269]
- Shibboleth: Logout beendet Session nicht [#3624]
- Courseware: PDF-Export exportiert "unsichtbare" Blöcke [#3726]
- Implementierungen des Serializable-Interfaces erzeugen unter PHP 8.1 Deprecation Warnings [#4135]
- PHP 8: Warnungen in JSON-API Route der Courseware [#4268]
- Memcached-Cache: Änderung der Einstellungen wird nicht aktiv [#4284]
- Memcached-Cache: Eintragen von mehr als einem Server führt zu einem nicht funktionieren System [#4286]
- Suche findet eigene Veranstaltungen nicht immer [#4384]
- PHP8 Warning bei Export von Ablaufplan [#4399]
- Courseware: Quelltext-Block rendert HTML statt es mit Syntaxhervorhebung darzustellen [#4437]
- Evaluationsblock trotz global deaktivierter Evaluationsfunktion in Veranstaltungskurzinfo sichtbar [#4440]
- PHP8 Fehler in AuthPlugin: method_exists(): Argument #2 ($method) must be of type string, Closure given [#4442]
- Raumverwaltung: Dokumente zu Räumen haben "Größe" als Standardsortierung [#4450]
- Fragebogen: Nicht-Pflicht Antwort wird auf erste Option gesetzt [#4452]
- Verwaltungsfunktionen von Einrichtungen sind auch für nicht berechtigte Nutzer sichtbar [#4458]
- LTI-Schnittstelle: Parameter lis_course_section_sourcedid ergänzen [#4461]
- Courseware: keine Anzeige bei Lernmaterialien [#4466]
- Regelmäßige Termine lassen sich nicht bearbeiten [#4471]
- Fehler "Only variables should be passed by reference" in der Übersicht der Module [#4472]
- Bearbeiten von vielen Modulen ist kompliziert [#4473]
- PHP8-Warning beim Login via SSO [#4480]
- „Neue Nachricht schreiben“: Pflichtfelder werden nicht barrierearm ausgezeichnet [#4488]
- Studiengruppen: Liste der teilnehmenden Personen als Gallerie ist zu starr [#4489]
- PHP-Warnungen in den Umfragen [#4492]
- Ausgabe der Ankündigungen auf externen Seiten ist defekt [#4496]
- Zugriffsbeschränkung der SOAP/XML-RPC Web-Services funktioniert nicht mit IPv6 [#4500]
- Veranstaltung: Übersichtsseite hat Textstrings mit Positionsangaben und bei Evaluationen fehlt die Icon-Bezeichnung [#4505]
- Standardeinrichtung beim Anlegen von LV ist für Dozenten nicht vorgewählt [#4506]
- JSUpdater leert den Flash [#4507]
- CoreScm: Entfer nicht verwendete Methode [#4508]
- PHP8-Warnungen bei Raumzeit [#4521]
- Eintragen von IPv6 Bereich bei den Webservices nicht möglich [#4524]
- Links in formatiertem Text haben falsche vertikale Position [#4531]
- PHP8 - Warnungen in den Institute-Klasse [#4534]
- StudipArrayObject unserialize wirft fehler [#4537]
- Fehlende Schriftarten ergänzen [#4542]
- PHP8 - Warnungen bei widget-layout [#4544]
- CSRF-Protection wird an diversen Stellen falsch verwendet [#4545]
- CSRF-Protection wird an noch mehr Stellen falsch verwendet [#4548]
# 25.07.2024 v 5.5.1 # 25.07.2024 v 5.5.1
https://gitlab.studip.de/studip/studip/-/issues?milestone_title=Stud.IP+5.5.1&state=all https://gitlab.studip.de/studip/studip/-/issues?milestone_title=Stud.IP+5.5.1&state=all
......
RELEASE 5.5.1 RELEASE 5.5.2
...@@ -594,7 +594,8 @@ class Course_BasicdataController extends AuthenticatedController ...@@ -594,7 +594,8 @@ class Course_BasicdataController extends AuthenticatedController
public function add_member_action($course_id, $status = 'dozent') public function add_member_action($course_id, $status = 'dozent')
{ {
CSRFProtection::verifyUnsafeRequest(); // We don't need to check the csrf protection at this point since it
// is already checked by the multiperson search endpoint
// load MultiPersonSearch object // load MultiPersonSearch object
$mp = MultiPersonSearch::load("add_member_{$status}{$course_id}"); $mp = MultiPersonSearch::load("add_member_{$status}{$course_id}");
......
<?php <?php
/** /**
* @var Admin_UserController $controller * @var Admin_UserController $controller
* @var array $course_files * @var array<string, array<string, array{course: Course, files: int}>> $course_files
* @var array $params * @var array $params
* @var User $user * @var User $user
*/ */
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<?= _('Dateiübersicht Veranstaltungen') ?> <?= _('Dateiübersicht Veranstaltungen') ?>
</h1> </h1>
</header> </header>
<? foreach ($course_files as $semester_name => $file_date) : ?> <? foreach ($course_files as $semester_name => $file_data) : ?>
<article id="<?= $semester_name ?>" class="<?= ContentBoxHelper::classes($semester_name) ?>"> <article id="<?= htmlReady($semester_name) ?>" class="<?= ContentBoxHelper::classes($semester_name) ?>">
<header> <header>
<h1> <h1>
<a href="<?= ContentBoxHelper::href($semester_name) ?>"> <a href="<?= ContentBoxHelper::href($semester_name) ?>">
...@@ -40,11 +40,17 @@ ...@@ -40,11 +40,17 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<? foreach ($file_date as $data): ?> <? foreach ($file_data as $data): ?>
<tr> <tr>
<td><?= htmlReady($data['course']->veranstaltungsnummer) ?></td>
<td> <td>
<a href="<?= URLHelper::getLink('seminar_main.php', ['auswahl' => $data['course']->id]) ?>">
<?= htmlReady($data['course']->veranstaltungsnummer) ?>
</a>
</td>
<td>
<a href="<?= URLHelper::getLink('seminar_main.php', ['auswahl' => $data['course']->id]) ?>">
<?= htmlReady($data['course']->name) ?> <?= htmlReady($data['course']->name) ?>
</a>
</td> </td>
<td> <td>
<?= htmlReady($data['course']->getSemType()['name'])?> <?= htmlReady($data['course']->getSemType()['name'])?>
...@@ -58,22 +64,22 @@ ...@@ -58,22 +64,22 @@
</td> </td>
<td class="actions"> <td class="actions">
<? if ($data['files']) : ?> <? if ($data['files']) : ?>
<? <?= ActionMenu::get()
$actionMenu = ActionMenu::get()->setContext($data['course']->name); ->setContext($data['course']->name)
$actionMenu->addLink($controller->url_for('admin/user/list_files/' . $user['user_id'] . '/' . $data['course']->id, $params), ->addLink(
$controller->list_filesURL($user->id, $data['course']->id, $params),
_('Dateien auflisten'), _('Dateien auflisten'),
Icon::create('folder-full', 'clickable'), Icon::create('folder-full'),
['data-dialog' => 'size=50%']); ['data-dialog' => 'size=50%']
$actionMenu->addLink($controller->url_for('admin/user/download_user_files/' . $user['user_id'] . '/' . $data['course']->id), )
->addLink(
$controller->download_user_filesURL($user->id, $data['course']->id),
_('Dateien als ZIP herunterladen'), _('Dateien als ZIP herunterladen'),
Icon::create('download', 'clickable')); Icon::create('download')
)
?> ?>
<?= $actionMenu->render() ?>
<? endif ?> <? endif ?>
</td> </td>
</tr> </tr>
<? endforeach; ?> <? endforeach; ?>
</tbody> </tbody>
......
<?php <?php
/** /**
* @var Admin_UserController $controller * @var Admin_UserController $controller
* @var Institute[] $institutes * @var array<int, array{Institut_id: string, Name: string, files: int}> $institutes
* @var User $user * @var User $user
* @var array $params * @var array $params
*/ */
...@@ -32,10 +32,12 @@ ...@@ -32,10 +32,12 @@
<? foreach ($institutes as $institute): ?> <? foreach ($institutes as $institute): ?>
<tr> <tr>
<td> <td>
<a href="<?= URLHelper::getLink('dispatch.php/institute/overview', ['auswahl' => $institute['Institut_id']]) ?>">
<?= htmlReady($institute['Name']) ?> <?= htmlReady($institute['Name']) ?>
</a>
</td> </td>
<td> <td>
<? if ((int)$institute['files']) : ?> <? if ($institute['files']) : ?>
<?= sprintf('%u %s', $institute['files'], _('Dokumente')) ?> <?= sprintf('%u %s', $institute['files'], _('Dokumente')) ?>
<? else : ?> <? else : ?>
- -
...@@ -43,18 +45,20 @@ ...@@ -43,18 +45,20 @@
</td> </td>
<td class="actions"> <td class="actions">
<? if ($institute['files']) : ?> <? if ($institute['files']) : ?>
<? <?= ActionMenu::get()
$actionMenu = ActionMenu::get()->setContext($institute['Name']); ->setContext($institute['Name'])
$actionMenu->addLink($controller->url_for('admin/user/list_files/' . $user['user_id'] . '/' . $institute['Institut_id'] , $params), ->addLink(
$controller->list_filesURL($user->id, $institute['Institut_id'], $params),
_('Dateien auflisten'), _('Dateien auflisten'),
Icon::create('folder-full'), Icon::create('folder-full'),
['data-dialog' => 'size=50%']); ['data-dialog' => 'size=50%']
$actionMenu->addLink($controller->url_for('admin/user/download_user_files/' . $user['user_id'] . '/' . $institute['Institut_id']), )
->addLink(
$controller->download_user_filesURL($user->id, $institute['Institut_id']),
_('Dateien als ZIP herunterladen'), _('Dateien als ZIP herunterladen'),
Icon::create('download')); Icon::create('download')
)
?> ?>
<?= $actionMenu->render() ?>
<? endif ?> <? endif ?>
</td> </td>
</tr> </tr>
......
<form class="default" method="post" action="<?= $controller->link_for('contact/editGroup/' . $group->id) ?>"> <form class="default" method="post" action="<?= $controller->link_for('contact/editGroup/' . $group->id) ?>">
<? CSRFProtection::tokenTag() ?> <?= CSRFProtection::tokenTag() ?>
<fieldset> <fieldset>
<legend class="hide-in-dialog"> <legend class="hide-in-dialog">
<? if ($group->isNew()) : ?> <? if ($group->isNew()) : ?>
......
...@@ -200,6 +200,9 @@ ...@@ -200,6 +200,9 @@
</thead> </thead>
<tbody> <tbody>
<? foreach ($permissions as $permission): ?> <? foreach ($permissions as $permission): ?>
<?
$resource = $permission->resource->getDerivedClassInstance();
?>
<tr> <tr>
<td> <td>
<input type="checkbox" name="resource_ids[]" <input type="checkbox" name="resource_ids[]"
...@@ -207,7 +210,7 @@ ...@@ -207,7 +210,7 @@
title="<?= htmlReady(sprintf(_('Berechtigung für %s auswählen'), $resource)) ?>"> title="<?= htmlReady(sprintf(_('Berechtigung für %s auswählen'), $resource)) ?>">
</td> </td>
<td> <td>
<?= htmlReady($permission->resource->getDerivedClassInstance()) ?> <?= htmlReady($resource) ?>
</td> </td>
<td> <td>
<?= htmlReady($permission->perms) ?> <?= htmlReady($permission->perms) ?>
......
...@@ -366,15 +366,19 @@ $STUDIP_AUTH_CONFIG_LTI = [ ...@@ -366,15 +366,19 @@ $STUDIP_AUTH_CONFIG_LTI = [
] ]
]; ];
$STUDIP_AUTH_CONFIG_SHIB = array("session_initiator" => "https://sp.studip.de/Shibboleth.sso/WAYF/DEMO", $STUDIP_AUTH_CONFIG_SHIB = [
"validate_url" => "https://sp.studip.de/auth/studip-sp.php", 'session_initiator' => 'https://sp.studip.de/Shibboleth.sso/WAYF/DEMO',
"local_domain" => "studip.de", 'validate_url' => 'https://sp.studip.de/auth/studip-sp.php',
"user_data_mapping" => 'logout_url' => 'https://sp.studip.de/Shibboleth.sso/Logout',
array( "auth_user_md5.username" => array("callback" => "dummy", "map_args" => ""), 'local_domain' => 'studip.de',
"auth_user_md5.password" => array("callback" => "dummy", "map_args" => ""), 'user_data_mapping' => [
"auth_user_md5.Vorname" => array("callback" => "getUserData", "map_args" => "givenname"), 'auth_user_md5.username' => ['callback' => 'dummy', 'map_args' => ''],
"auth_user_md5.Nachname" => array("callback" => "getUserData", "map_args" => "surname"), 'auth_user_md5.password' => ['callback' => 'dummy', 'map_args' => ''],
"auth_user_md5.Email" => array("callback" => "getUserData", "map_args" => "email"))); 'auth_user_md5.Vorname' => ['callback' => 'getUserData', 'map_args' => 'givenname'],
'auth_user_md5.Nachname' => ['callback' => 'getUserData', 'map_args' => 'surname'],
'auth_user_md5.Email' => ['callback' => 'getUserData', 'map_args' => 'email']
],
];
$STUDIP_AUTH_CONFIG_IP = array('allowed_users' => $STUDIP_AUTH_CONFIG_IP = array('allowed_users' =>
array ('root' => array('127.0.0.1', '::1'))); array ('root' => array('127.0.0.1', '::1')));
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
const DEFAULT_ENV = 'production'; const DEFAULT_ENV = 'production';
//software version - please leave it as it is! //software version - please leave it as it is!
$SOFTWARE_VERSION = '5.5.1'; $SOFTWARE_VERSION = '5.5.2';
// Store startup time // Store startup time
$STUDIP_STARTUP_TIME = microtime(true); $STUDIP_STARTUP_TIME = microtime(true);
......
...@@ -68,7 +68,7 @@ class ThreadsUpdate extends JsonApiController ...@@ -68,7 +68,7 @@ class ThreadsUpdate extends JsonApiController
return $this->getContentResponse($thread); return $this->getContentResponse($thread);
} }
protected function validateResourceDocument($json) protected function validateResourceDocument($json, $data)
{ {
if (self::arrayHas($json, 'data.attributes.visited-at')) { if (self::arrayHas($json, 'data.attributes.visited-at')) {
$visitedAt = self::arrayGet($json, 'data.attributes.visited-at'); $visitedAt = self::arrayGet($json, 'data.attributes.visited-at');
......
...@@ -148,10 +148,11 @@ class StudipFileCache implements StudipCache ...@@ -148,10 +148,11 @@ class StudipFileCache implements StudipCache
*/ */
public function write($arg, $content, $expire = self::DEFAULT_EXPIRATION) public function write($arg, $content, $expire = self::DEFAULT_EXPIRATION)
{ {
$key = $this->getCacheKey($arg); $this->expire($arg);
$this->expire($key); $key = $this->getCacheKey($arg);
$file = $this->getPathAndFile($key, $expire); $file = $this->getPathAndFile($key, $expire);
return @file_put_contents($file, serialize($content), LOCK_EX); return @file_put_contents($file, serialize($content), LOCK_EX);
} }
......
...@@ -80,7 +80,7 @@ class StudipAuthCAS extends StudipAuthSSO ...@@ -80,7 +80,7 @@ class StudipAuthCAS extends StudipAuthSSO
return $this->userdata->getUserData($key, phpCAS::getUser()); return $this->userdata->getUserData($key, phpCAS::getUser());
} }
function logout() public function logout(): void
{ {
// do a global cas logout // do a global cas logout
phpCAS::client(CAS_VERSION_2_0, $this->host, $this->port, $this->uri, false); phpCAS::client(CAS_VERSION_2_0, $this->host, $this->port, $this->uri, false);
......
...@@ -68,7 +68,6 @@ class StudipAuthOIDC extends StudipAuthSSO ...@@ -68,7 +68,6 @@ class StudipAuthOIDC extends StudipAuthSSO
*/ */
public function verifyUsername($username) public function verifyUsername($username)
{ {
$this->oidc->authenticate(); $this->oidc->authenticate();
$this->userdata = (array)$this->oidc->requestUserInfo(); $this->userdata = (array)$this->oidc->requestUserInfo();
if (isset($this->userdata['sub'])) { if (isset($this->userdata['sub'])) {
...@@ -109,4 +108,9 @@ class StudipAuthOIDC extends StudipAuthSSO ...@@ -109,4 +108,9 @@ class StudipAuthOIDC extends StudipAuthSSO
{ {
return $this->userdata[$key]; return $this->userdata[$key];
} }
public function logout(): void
{
$this->oidc->signOut($this->oidc->getIdToken(), null);
}
} }
...@@ -36,7 +36,7 @@ abstract class StudipAuthSSO extends StudipAuthAbstract ...@@ -36,7 +36,7 @@ abstract class StudipAuthSSO extends StudipAuthAbstract
* Check whether this user can be authenticated. The default * Check whether this user can be authenticated. The default
* implementation just checks whether $username is not empty. * implementation just checks whether $username is not empty.
*/ */
function isAuthenticated ($username, $password) public function isAuthenticated ($username, $password)
{ {
return !empty($username); return !empty($username);
} }
...@@ -44,8 +44,15 @@ abstract class StudipAuthSSO extends StudipAuthAbstract ...@@ -44,8 +44,15 @@ abstract class StudipAuthSSO extends StudipAuthAbstract
/** /**
* SSO auth plugins cannot determine if a username is used. * SSO auth plugins cannot determine if a username is used.
*/ */
function isUsedUsername ($username) public function isUsedUsername ($username)
{ {
return false; return false;
} }
/**
* Use this to log out the user
*/
public function logout(): void
{
}
} }
...@@ -18,6 +18,7 @@ class StudipAuthShib extends StudipAuthSSO ...@@ -18,6 +18,7 @@ class StudipAuthShib extends StudipAuthSSO
public $local_domain; public $local_domain;
public $session_initiator; public $session_initiator;
public $validate_url; public $validate_url;
public ?string $logout_url = null;
public $userdata; public $userdata;
public $username_attribute = 'username'; public $username_attribute = 'username';
...@@ -139,4 +140,12 @@ class StudipAuthShib extends StudipAuthSSO ...@@ -139,4 +140,12 @@ class StudipAuthShib extends StudipAuthSSO
return $data[0]; return $data[0];
} }
public function logout(): void
{
if (!empty($this->logout_url)) {
header('Location: ' . URLHelper::getURL($this->logout_url, ['return' => Request::url()]));
exit();
}
}
} }
...@@ -29,6 +29,24 @@ class ConsultationEvent extends SimpleORMap ...@@ -29,6 +29,24 @@ class ConsultationEvent extends SimpleORMap
'on_delete' => 'delete', 'on_delete' => 'delete',
]; ];
$config['registered_callbacks'] = [
'before_delete' => [
function (ConsultationEvent $event) {
// Suppress all mails from calendar for users that do not
// want to receive emails about consultation bookings
$event->event->calendars->each(function (CalendarDateAssignment $assignment) {
if (
$assignment->user
&& !$assignment->user->getConfiguration()->CONSULTATION_SEND_MESSAGES
) {
$assignment->suppress_mails = true;
$assignment->delete();
}
});
},
],
];
parent::configure($config); parent::configure($config);
} }
} }
...@@ -194,6 +194,10 @@ class ConsultationSlot extends SimpleORMap ...@@ -194,6 +194,10 @@ class ConsultationSlot extends SimpleORMap
$calendar_event = new CalendarDateAssignment(); $calendar_event = new CalendarDateAssignment();
$calendar_event->range_id = $user->id; $calendar_event->range_id = $user->id;
$calendar_event->calendar_date_id = $event->id; $calendar_event->calendar_date_id = $event->id;
// Suppress mails for users that do not want mails from the consultations
$calendar_event->suppress_mails = !$user->getConfiguration()->CONSULTATION_SEND_MESSAGES;
$calendar_event->store(); $calendar_event->store();
return $event; return $event;
......
...@@ -79,8 +79,8 @@ class MvvFile extends ModuleManagementModel ...@@ -79,8 +79,8 @@ class MvvFile extends ModuleManagementModel
*/ */
public function getDisplayName() public function getDisplayName()
{ {
if ($this->file_refs) { if (count($this->file_refs) > 0) {
return $this->file_refs[0]->name; return $this->file_refs->first()->name;
} }
return ''; return '';
} }
......
...@@ -38,6 +38,11 @@ ...@@ -38,6 +38,11 @@
* @property string mkdate database column * @property string mkdate database column
* @property string chdate database column * @property string chdate database column
* @property string import_date database column * @property string import_date database column
*
* @property User $author
* @property User $editor
* @property CalendarDateAssignment[]|SimpleORMapCollection $calendars
* @property CalendarDateException[]|SimpleORMapCollection $exceptions
*/ */
class CalendarDate extends SimpleORMap implements PrivacyObject class CalendarDate extends SimpleORMap implements PrivacyObject
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment