Skip to content

Commit 965db7b

Browse files
committed
CSCEXAM-1555 Fix local user examination login behavior (wrong IP)
1 parent 1d3a2e9 commit 965db7b

File tree

4 files changed

+564
-523
lines changed

4 files changed

+564
-523
lines changed

app/repository/EnrolmentRepository.scala

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,21 @@ class EnrolmentRepository @Inject() (
219219
// IP is not known
220220
val local = configReader.isLocalUser(eppn)
221221
val zone = DateTimeZone.forID(room.getLocalTimezone)
222-
val start =
222+
val start = {
223223
ISODateTimeFormat.dateTime().withZone(zone).print(new DateTime(
224224
enrolment.getReservation.getStartAt
225225
))
226-
val msg =
227-
s"${enrolment.getId}:::${room.getCampus}:::${room.getBuildingName}:::${room.getRoomCode}:::${examMachine.getName}:::$start:::${zone.getID}:::${if local then "false" else enrolment.getId}"
226+
}
227+
val msg = Seq(
228+
enrolment.getId,
229+
room.getCampus,
230+
room.getBuildingName,
231+
room.getRoomCode,
232+
examMachine.getName,
233+
start,
234+
zone.getID,
235+
if local then "true" else enrolment.getId
236+
).mkString(":::")
228237
("x-exam-unknown-machine", msg)
229238
case Some(lookedUp) if lookedUp.getRoom.getId == room.getId =>
230239
// Right room, wrong machine

0 commit comments

Comments
 (0)