summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2016-06-09 14:38:33 +0200
committerSimon Rettberg2016-06-09 14:38:33 +0200
commitae715f73502b26d7cf76b36fc8ba45b4bc9831bc (patch)
treebfddb909ee76f3388b704ae85488e3aee0dcae20
parent[dozmod/api] Formatting (diff)
downloadslx-admin-ae715f73502b26d7cf76b36fc8ba45b4bc9831bc.tar.gz
slx-admin-ae715f73502b26d7cf76b36fc8ba45b4bc9831bc.tar.xz
slx-admin-ae715f73502b26d7cf76b36fc8ba45b4bc9831bc.zip
[dozmod/api] Get actual location list
-rw-r--r--modules-available/dozmod/api.inc.php5
-rw-r--r--modules-available/locations/inc/location.inc.php2
2 files changed, 4 insertions, 3 deletions
diff --git a/modules-available/dozmod/api.inc.php b/modules-available/dozmod/api.inc.php
index a3e30dfa..cadd8943 100644
--- a/modules-available/dozmod/api.inc.php
+++ b/modules-available/dozmod/api.inc.php
@@ -144,10 +144,11 @@ $request = ['resource' => filter_var(strtolower(trim($_REQUEST['resource'])), FI
/* lookup location id(s) */
-$location_ids = Location::getFromIP($request['ip']);
+$location_ids = Location::getFromIp($request['ip']);
+$location_ids = Location::getLocationRootChain($location_ids);
/* lookup lecture uuids */
-$lectures = getLecturesForLocations(array($location_ids));
+$lectures = getLecturesForLocations();
/* validate request -------------------------------------------- */
/* check resources */
diff --git a/modules-available/locations/inc/location.inc.php b/modules-available/locations/inc/location.inc.php
index 25e888d8..3a282df1 100644
--- a/modules-available/locations/inc/location.inc.php
+++ b/modules-available/locations/inc/location.inc.php
@@ -183,7 +183,7 @@ class Location
* @param int $locationId
* @return int[] location ids, including $locationId
*/
- public function getLocationRootChain($locationId)
+ public static function getLocationRootChain($locationId)
{
settype($locationId, 'integer');
$locations = Location::getLocationsAssoc();