1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
<?php
class Coursebackend_Dummy extends CourseBackend {
private $pw;
public function setCredentials($json,$location,$serverID) {
$x = $json;
$this->pw = $x['password_str'];
if ($this->pw == "mfg") {
$this->error = false;
return true;
} else {
$this->errormsg = "USE mfg as password!";
$this->error = true;
return false;
}
}
public function checkConnection(){
if ($this->pw == "mfg") {
$this->error = false;
return true;
} else {
$this->errormsg = "USE mfg as password!";
$this->error = true;
return false;
}
}
public function getCredentials(){
$options = ["opt1", "opt2", "opt3", "opt4", "opt5", "opt6", "opt7", "opt8"];
$credentials = ["username" => ["string", "This is a helptext.", false],"password_str"=>["string", "SOME SECRET PW U WILL NEVER KNOW!", true],"password_int"=>["int", "INT PW", true],"option"=>[$options, "OMG WHAT THE", false], "CheckTheBox" => ["bool", "Test with a cb", false]];
return $credentials;
}
public function getDisplayName(){
return'Dummy with array';
}
public function getCacheTime(){
return 0;
}
public function getRefreshTime(){
return 0;
}
public function fetchSchedulesInternal($roomId){
$a = array();
foreach ($roomId as $id) {
$x['id'] = $id;
$calendar['title'] = "test exam";
$calendar['start'] = "2017-3-08 13:00:00";
$calendar['end'] = "2017-3-08 16:00:00";
$calarray = array();
$calarray[] = $calendar;
$x['calendar'] = $calarray;
$a[$id] = $calarray;
}
return $a;
}
}
?>
|