diff options
author | Simon Rettberg | 2017-04-19 23:43:24 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-04-19 23:43:24 +0200 |
commit | c781a551ae84127ef05eaa36909dca44e49e1200 (patch) | |
tree | 81992a3b781285c2ce6e1916b5d5fd349d5ac45d /modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php | |
parent | [locationinfo] Enable 30 minutes caching for davinci (diff) | |
download | slx-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_dummy.inc.php')
-rw-r--r-- | modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php index 5bceac3e..b8329196 100644 --- a/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php +++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php @@ -13,7 +13,7 @@ class CourseBackend_Dummy extends CourseBackend * @param int $serverId ID of the server * @returns bool if the credentials were in the correct format */ - public function setCredentials($json, $location, $serverId) + public function setCredentialsInternal($json) { $x = $json; $this->pw = $x['password']; @@ -47,15 +47,14 @@ class CourseBackend_Dummy extends CourseBackend public function getCredentials() { $options = ["opt1", "opt2", "opt3", "opt4", "opt5", "opt6", "opt7", "opt8"]; - $credentials = [ - "username" => "string", - "password" => "password", - "integer" => "int", - "option" => $options, - "CheckTheBox" => "bool", - "CB2 t" => "bool" + return [ + new BackendProperty('username', 'string', 'default-user'), + new BackendProperty('password', 'password'), + new BackendProperty('integer', 'int', 7), + new BackendProperty('option', $options), + new BackendProperty('CheckTheBox', 'bool'), + new BackendProperty('CB2t', 'bool', true) ]; - return $credentials; } /** |