summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.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/inc/coursebackend/coursebackend_davinci.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/inc/coursebackend/coursebackend_davinci.inc.php')
-rw-r--r--modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php
index db75c19d..77928b39 100644
--- a/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php
@@ -3,14 +3,16 @@
class CourseBackend_Davinci extends CourseBackend
{
- public function setCredentials($data, $location, $serverId)
+ private $location;
+
+ public function setCredentialsInternal($data)
{
- if (empty($location)) {
+ if (empty($data['baseUrl'])) {
$this->error = "No url is given";
return false;
}
+ $location = preg_replace('#/+(davinciis\.dll)?\W*$#i', '', $data['baseUrl']);
$this->location = $location . "/DAVINCIIS.dll?";
- $this->serverId = $serverId;
//Davinci doesn't have credentials
return true;
}
@@ -30,7 +32,9 @@ class CourseBackend_Davinci extends CourseBackend
public function getCredentials()
{
- return array();
+ return [
+ new BackendProperty('baseUrl', 'string')
+ ];
}
public function getDisplayName()