diff options
author | Simon Rettberg | 2017-11-14 16:02:44 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-11-14 16:02:44 +0100 |
commit | eebe3608ea1687b6985ca0114094bec0e4bb3191 (patch) | |
tree | 06ec67224526a9a04789e3e189698d695d282996 /modules-available/dozmod | |
parent | [backup] Show warning on main page when last backup was more than 30 days ago (diff) | |
download | slx-admin-eebe3608ea1687b6985ca0114094bec0e4bb3191.tar.gz slx-admin-eebe3608ea1687b6985ca0114094bec0e4bb3191.tar.xz slx-admin-eebe3608ea1687b6985ca0114094bec0e4bb3191.zip |
[dozmod] Improve location & exam mode detection
Diffstat (limited to 'modules-available/dozmod')
-rw-r--r-- | modules-available/dozmod/api.inc.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules-available/dozmod/api.inc.php b/modules-available/dozmod/api.inc.php index de0883a6..74aaa003 100644 --- a/modules-available/dozmod/api.inc.php +++ b/modules-available/dozmod/api.inc.php @@ -149,10 +149,12 @@ function getListForLocations($locationIds, $raw) $key = 'lectures_' . cache_hash($locationIds); $examMode = Request::get('exams', 'normal-mode', 'string') !== 'normal-mode'; $clientServerMismatch = false; - if ($raw && Module::isAvailable('exams')) { + if (Module::isAvailable('exams')) { // If we have the exam mode module, we can enforce a server side check and make sure it agrees with the client $serverExamMode = Exams::isInExamMode($locationIds); - $clientServerMismatch = ($serverExamMode !== $examMode); + if ($raw) { + $clientServerMismatch = ($serverExamMode !== $examMode); + } $examMode = $serverExamMode; } // Only enforce exam mode validity check if the client requests the raw xml data @@ -276,7 +278,7 @@ if (substr($ip, 0, 7) === '::ffff:') { /* lookup location id(s) */ -$location_ids = Location::getFromIp($ip); +$location_ids = Location::getFromIp($ip, true); $location_ids = Location::getLocationRootChain($location_ids); if ($resource === 'list') { |