summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/api.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2017-04-19 23:43:24 +0200
committerSimon Rettberg2017-04-19 23:43:24 +0200
commitc781a551ae84127ef05eaa36909dca44e49e1200 (patch)
tree81992a3b781285c2ce6e1916b5d5fd349d5ac45d /modules-available/locationinfo/api.inc.php
parent[locationinfo] Enable 30 minutes caching for davinci (diff)
downloadslx-admin-c781a551ae84127ef05eaa36909dca44e49e1200.tar.gz
slx-admin-c781a551ae84127ef05eaa36909dca44e49e1200.tar.xz
slx-admin-c781a551ae84127ef05eaa36909dca44e49e1200.zip
[locationinfo] Better backend-specific property handling, get rid of URL
- The backend URL still had special treatment for legacy reasons, when it would be perfectly fine to make it just another generic property the backend has to define. - Allow for the backend to declare a default value for properties. - Base class will now check and sanitize the setCredentials() input.
Diffstat (limited to 'modules-available/locationinfo/api.inc.php')
-rw-r--r--modules-available/locationinfo/api.inc.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules-available/locationinfo/api.inc.php b/modules-available/locationinfo/api.inc.php
index a6e2fda3..412b20bf 100644
--- a/modules-available/locationinfo/api.inc.php
+++ b/modules-available/locationinfo/api.inc.php
@@ -238,7 +238,7 @@ function formatOpeningtime($openingtime)
*/
function getConfig($locationID)
{
- $dbresult = Database::queryFirst("SELECT l.locationname, li.config, li.serverroomid, s.servertype, s.serverurl FROM `location_info` AS li
+ $dbresult = Database::queryFirst("SELECT l.locationname, li.config, li.serverroomid, s.servertype FROM `location_info` AS li
RIGHT JOIN `location` AS l ON l.locationid=li.locationid
LEFT JOIN `setting_location_info` AS s ON s.serverid=li.serverid
WHERE l.locationid=:locationID", array('locationID' => $locationID));
@@ -364,7 +364,7 @@ function getCalendar($idList)
if (!empty($idList)) {
// Build SQL query for multiple ids.
$qs = '?' . str_repeat(',?', count($idList) - 1);
- $query = "SELECT l.locationid, l.serverid, l.serverroomid, s.serverurl, s.servertype, s.credentials
+ $query = "SELECT l.locationid, l.serverid, l.serverroomid, s.servertype, s.credentials
FROM `location_info` AS l
INNER JOIN setting_location_info AS s ON (s.serverid = l.serverid)
WHERE l.hidden = 0 AND l.locationid IN ($qs)
@@ -376,7 +376,6 @@ function getCalendar($idList)
if (!isset($serverList[$dbresult['serverid']])) {
$serverList[$dbresult['serverid']] = array(
'credentials' => json_decode($dbresult['credentials'], true),
- 'url' => $dbresult['serverurl'],
'type' => $dbresult['servertype'],
'idlist' => array()
);
@@ -395,7 +394,7 @@ function getCalendar($idList)
array('lid' => $server['locationid']));
continue;
}
- $credentialsOk = $serverInstance->setCredentials($server['credentials'], $server['url'], $serverid);
+ $credentialsOk = $serverInstance->setCredentials($serverid, $server['credentials']);
if ($credentialsOk) {
$calendarFromBackend = $serverInstance->fetchSchedule($server['idlist']);