diff --git a/messages/faq/de-de-formal.msg b/messages/faq/de-de-formal.msg index 092366c09..bc424609f 100644 --- a/messages/faq/de-de-formal.msg +++ b/messages/faq/de-de-formal.msg @@ -1,6 +1,8 @@ FAQNoCampusAccount: Ich habe keine LMU-Benutzerkennung (ehem. Campus-Kennung); kann ich trotzdem Zugang zum System erhalten? FAQForgottenPassword: Ich habe mein Passwort vergessen FAQCampusCantLogin: Ich kann mich mit meiner LMU-Benutzerkennung (ehem. Campus-Kennung) nicht anmelden -FAQCourseCorrectorsTutors: Wie kann ich Tutoren oder Korrektoren für meinen Kurs einstellen? +FAQCourseCorrectorsTutors: Wie kann ich Tutoren oder Korrektoren für meinen Kurs konfigurieren? FAQNotLecturerHowToCreateCourses: Wie kann ich einen neuen Kurs anlegen? -FAQExamPoints: Warum kann ich bei meiner Klausur keine Punkte eintragen? \ No newline at end of file +FAQExamPoints: Warum kann ich bei meiner Klausur keine Punkte eintragen? +FAQInvalidCredentialsAdAccountDisabled: Ich kann mich nicht anmelden und bekomme die Meldung „Benutzereintrag gesperrt“ +FAQAllocationNoPlaces: Ich habe über eine Zentralanmeldung keine Plätze/nicht die Plätze, die ich möchte, erhalten \ No newline at end of file diff --git a/messages/faq/en-eu.msg b/messages/faq/en-eu.msg index 1cce5d04b..51c56628f 100644 --- a/messages/faq/en-eu.msg +++ b/messages/faq/en-eu.msg @@ -4,3 +4,5 @@ FAQCampusCantLogin: I can't log in using my LMU user ID (formerly Campus-ID) FAQCourseCorrectorsTutors: How can I add tutors or correctors to my course? FAQNotLecturerHowToCreateCourses: How can I create new courses? FAQExamPoints: Why can't I enter achievements for my exam as points? +FAQInvalidCredentialsAdAccountDisabled: I can't log in and am instead given the message “Account disabled” +FAQAllocationNoPlaces: I did not receive any places/the places I wanted from a central allocation \ No newline at end of file diff --git a/messages/uniworx/de-de-formal.msg b/messages/uniworx/de-de-formal.msg index c6107bd5e..6d76bf8c5 100644 --- a/messages/uniworx/de-de-formal.msg +++ b/messages/uniworx/de-de-formal.msg @@ -206,6 +206,7 @@ CourseAllocationMinCapacityTip: Wenn der Veranstaltung bei der Zentralanmeldung CourseAllocationMinCapacityMustBeNonNegative: Minimale Teilnehmeranzahl darf nicht negativ sein CourseAllocationCourseAcceptsSubstitutesUntil: Akzeptiert Nachrücker bis CourseAllocationCourseAcceptsSubstitutesNever: Akzeptiert keine Nachrücker +CourseAllocationCourseParticipants: Teilnehmer CourseApplicationInstructions: Anweisungen zur Bewerbung/Anmeldung CourseApplicationInstructionsTip: Wird den Studierenden angezeigt, wenn diese sich für Ihre Veranstaltung bewerben bzw. bei dieser anmelden CourseApplicationTemplate: Bewerbungsvorlagen @@ -2271,6 +2272,7 @@ AllocationNotificationNewCourseCurrentlyOn: Aktuell würden Sie benachrichtigt w AllocationNotificationLoginFirst: Um Ihre Benachrichtigungseinstellungen zu ändern, loggen Sie sich bitte zunächst ein. AllocationNextSubstitutesDeadline: Nächster Kurs akzeptiert Nachrücker bis AllocationNextSubstitutesDeadlineNever: Keine Kurse akzeptieren mehr Nachrücker +AllocationFreeCapacity: Freie Plätze AllocationSchoolShort: Institut Allocation: Zentralanmeldung diff --git a/messages/uniworx/en-eu.msg b/messages/uniworx/en-eu.msg index 989eb2b61..e823b35ba 100644 --- a/messages/uniworx/en-eu.msg +++ b/messages/uniworx/en-eu.msg @@ -206,6 +206,7 @@ CourseAllocationMinCapacityTip: If fewer students than this number were to be as CourseAllocationMinCapacityMustBeNonNegative: Minimum number of participants must not be negative CourseAllocationCourseAcceptsSubstitutesUntil: Accepts substitutes until CourseAllocationCourseAcceptsSubstitutesNever: Does not accept substitutes +CourseAllocationCourseParticipants: Participants CourseApplicationInstructions: Instructions for application CourseApplicationInstructionsTip: Will be shown to students if they decide to apply for this course CourseApplicationTemplate: Application template @@ -2270,6 +2271,7 @@ AllocationNotificationNewCourseCurrentlyOn: Currently you would be notified. AllocationNotificationLoginFirst: To change your notification settings, please log in first. AllocationNextSubstitutesDeadline: Next course accepts substitutes until AllocationNextSubstitutesDeadlineNever: No course currently accepts substitutes +AllocationFreeCapacity: Free capacity AllocationSchoolShort: Department Allocation: Central allocation diff --git a/src/Auth/LDAP.hs b/src/Auth/LDAP.hs index 471e59dd7..597163cd4 100644 --- a/src/Auth/LDAP.hs +++ b/src/Auth/LDAP.hs @@ -160,6 +160,7 @@ campusUserMatr' pool mode newtype ADInvalidCredentials = ADInvalidCredentials ADError deriving (Eq, Ord, Read, Show, Generic, Typeable) + deriving newtype (Universe, Finite, Enum, Bounded, PathPiece, ToJSON, FromJSON, ToJSONKey, FromJSONKey) isUnusualADError :: ADError -> Bool isUnusualADError = flip notElem [ADNoSuchObject, ADLogonFailure] @@ -220,7 +221,7 @@ campusLogin pool mode = AuthPlugin{..} $logInfoS apName [st|#{campusIdent}: #{toPathPiece adError}|] observeLoginOutcome apName LoginADInvalidCredentials MsgRenderer mr <- liftHandler getMsgRenderer - setSessionJson SessionError . PermissionDenied . mr $ ADInvalidCredentials adError + setSessionJson SessionError . PermissionDenied . toPathPiece $ ADInvalidCredentials adError loginErrorMessage (tp LoginR) . mr $ ADInvalidCredentials adError Right (Left bindErr) -> do case bindErr of diff --git a/src/Handler/Info.hs b/src/Handler/Info.hs index 99a748da2..43110c6cc 100644 --- a/src/Handler/Info.hs +++ b/src/Handler/Info.hs @@ -14,6 +14,8 @@ import qualified Database.Esqueleto.Utils as E import Development.GitRev +import Auth.LDAP (ADError(..), ADInvalidCredentials(..)) + -- | Versionsgeschichte getVersionR :: Handler TypedContent getVersionR = selectRep $ do @@ -181,6 +183,26 @@ showFAQ (CExamR tid ssh csh examn _) FAQExamPoints E.&&. course E.^. CourseSchool E.==. E.val ssh E.&&. course E.^. CourseShorthand E.==. E.val csh E.&&. exam E.^. ExamName E.==. E.val examn +showFAQ _ FAQInvalidCredentialsAdAccountDisabled = maybeT (return False) $ do + guardM $ is _Nothing <$> maybeAuthId + sessionError <- MaybeT $ lookupSessionJson SessionError + guard $ sessionError == PermissionDenied (toPathPiece $ ADInvalidCredentials ADAccountDisabled) + return True +showFAQ _ FAQAllocationNoPlaces = maybeT (return False) $ do + uid <- MaybeT maybeAuthId + now <- liftIO getCurrentTime + liftHandler . runDB . E.selectExists . E.from $ \allocation -> do + let doneSince = E.subSelectMaybe . E.from $ \participant -> do + E.where_ $ participant E.^. CourseParticipantAllocated E.==. E.just (allocation E.^. AllocationId) + return . E.max_ $ participant E.^. CourseParticipantRegistration + isAllocationUser = E.exists . E.from $ \allocationUser -> + E.where_ $ allocationUser E.^. AllocationUserAllocation E.==. allocation E.^. AllocationId + E.&&. allocationUser E.^. AllocationUserUser E.==. E.val uid + isApplicant = E.exists . E.from $ \courseApplication -> + E.where_ $ courseApplication E.^. CourseApplicationAllocation E.==. E.just (allocation E.^. AllocationId) + E.&&. courseApplication E.^. CourseApplicationUser E.==. E.val uid + E.where_ $ isAllocationUser E.||. isApplicant + E.where_ $ E.maybe E.false (\done -> done E.>=. E.val (addUTCTime (-7 * nominalDay) now)) doneSince showFAQ _ _ = return False prioFAQ :: Monad m @@ -191,3 +213,5 @@ prioFAQ _ FAQForgottenPassword = return 1 prioFAQ _ FAQNotLecturerHowToCreateCourses = return 1 prioFAQ _ FAQCourseCorrectorsTutors = return 1 prioFAQ _ FAQExamPoints = return 2 +prioFAQ _ FAQAllocationNoPlaces = return 2 +prioFAQ _ FAQInvalidCredentialsAdAccountDisabled = return 3 diff --git a/templates/i18n/faq/allocation-no-places.de-de-formal.hamlet b/templates/i18n/faq/allocation-no-places.de-de-formal.hamlet new file mode 100644 index 000000000..55c53c6e5 --- /dev/null +++ b/templates/i18n/faq/allocation-no-places.de-de-formal.hamlet @@ -0,0 +1,108 @@ +$newline never +

+ Die Plätze in den Zentralanmeldungen werden nach den folgenden # + Kriterien verteilt (in grober Reihenfolge des Einfluss, den sie auf # + die Verteilung haben): + +