From 3aed9159d6601aa4db9822ec7d7bc8efe877b99f Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Willms Date: Thu, 16 Oct 2025 11:11:37 +0200 Subject: use message box instead of notification and ensure that buttons are readable, fixes #5945 Closes #5945 Merge request studip/studip!4546 --- app/controllers/start.php | 32 +++++++++++++++------- app/views/start/index.php | 3 ++ .../stylesheets/scss/system-notifications.scss | 2 +- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/app/controllers/start.php b/app/controllers/start.php index 550120f..0bd3ca9 100644 --- a/app/controllers/start.php +++ b/app/controllers/start.php @@ -98,30 +98,42 @@ class StartController extends AuthenticatedController )->asDialog(); } } - if ($GLOBALS['perm']->get_perm() == 'user') { - PageLayout::postInfo(_('Sie haben noch nicht auf Ihre Bestätigungsmail geantwortet.'), [ - _('Bitte holen Sie dies nach, um Stud.IP Funktionen wie das Belegen von Veranstaltungen nutzen zu können.'), - sprintf(_('Bei Problemen wenden Sie sich an: %s'), ''.$GLOBALS['UNI_CONTACT'].'') - ]); + + $this->messages = []; + + if (User::findCurrent()->perms == 'user') { + $this->messages[] = MessageBox::info( + _('Sie haben noch nicht auf Ihre Bestätigungsmail geantwortet.'), + [ + _('Bitte holen Sie dies nach, um Stud.IP Funktionen wie das Belegen von Veranstaltungen nutzen zu können.'), + sprintf(_('Bei Problemen wenden Sie sich an: %s'), ''.$GLOBALS['UNI_CONTACT'].'') + ] + ); $details = Studip\LinkButton::create( _('Bestätigungsmail erneut verschicken'), - $this->url_for('start/resend_validation_mail') + $this->resend_validation_mailURL() ); - if (!StudipAuthAbstract::CheckField('auth_user_md5.Email', $GLOBALS['user']->auth_plugin) && !LockRules::check($GLOBALS['user']->id, 'email')) { + if ( + !StudipAuthAbstract::CheckField('auth_user_md5.Email', User::findCurrent()->auth_plugin) + && !LockRules::check(User::findCurrent()->id, 'email') + ) { $details .= ' '; $details .= Studip\LinkButton::create( _('E-Mail-Adresse ändern'), - $this->url_for('start/edit_mail_address'), + $this->edit_mail_addressURL(), [ 'data-dialog' => 'size=auto', 'title' => _('E-Mail-Adresse') ] ); } - PageLayout::postInfo( - sprintf(_('Haben Sie die Bestätigungsmail an Ihre Adresse "%s" nicht erhalten?'), htmlReady($GLOBALS['user']->Email)), + $this->messages[] = MessageBox::info( + sprintf( + _('Haben Sie die Bestätigungsmail an Ihre Adresse "%s" nicht erhalten?'), + htmlReady(User::findCurrent()->email) + ), [$details] ); } diff --git a/app/views/start/index.php b/app/views/start/index.php index 6a177f6..7d6cb1a 100644 --- a/app/views/start/index.php +++ b/app/views/start/index.php @@ -2,6 +2,7 @@ /** * @var array $columns * @var Flexi\Template $widget_layout + * @var MessageBox[] $messages */ ?>

@@ -16,6 +17,8 @@

+ + BANNER_ADS_ENABLE) { diff --git a/resources/assets/stylesheets/scss/system-notifications.scss b/resources/assets/stylesheets/scss/system-notifications.scss index b1fbed1..24a15a7 100644 --- a/resources/assets/stylesheets/scss/system-notifications.scss +++ b/resources/assets/stylesheets/scss/system-notifications.scss @@ -141,7 +141,7 @@ display: none; } - a:not(.system-notification-message) { + a:not(.system-notification-message,.button) { color: var(--color--white); text-decoration-line: underline; -- cgit v1.0