ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilECSParticipantSetting.php
Go to the documentation of this file.
1
<?
php
2
/*
3
+-----------------------------------------------------------------------------+
4
| ILIAS open source |
5
+-----------------------------------------------------------------------------+
6
| Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7
| |
8
| This program is free software; you can redistribute it and/or |
9
| modify it under the terms of the GNU General Public License |
10
| as published by the Free Software Foundation; either version 2 |
11
| of the License, or (at your option) any later version. |
12
| |
13
| This program is distributed in the hope that it will be useful, |
14
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
| GNU General Public License for more details. |
17
| |
18
| You should have received a copy of the GNU General Public License |
19
| along with this program; if not, write to the Free Software |
20
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21
+-----------------------------------------------------------------------------+
22
*/
23
32
class
ilECSParticipantSetting
33
{
34
const
AUTH_VERSION_4
= 1;
35
const
AUTH_VERSION_5
= 2;
36
37
const
PERSON_EPPN
= 1;
38
const
PERSON_LUID
= 2;
39
const
PERSON_LOGIN
= 3;
40
const
PERSON_UID
= 4;
41
42
protected
static
$instances
= array();
43
44
45
// :TODO: what types are needed?
46
const
IMPORT_UNCHANGED
= 0;
47
const
IMPORT_RCRS
= 1;
48
const
IMPORT_CRS
= 2;
49
const
IMPORT_CMS
= 3;
50
51
private
$server_id
= 0;
52
private
$mid
= 0;
53
private
$export
=
false
;
54
private
$import
=
false
;
55
private
$import_type
= 1;
56
private
$title
=
''
;
57
private
$cname
=
''
;
58
private
$token
=
true
;
59
private
$dtoken
=
true
;
60
61
private
$auth_version
= self::AUTH_VERSION_4;
62
private
$person_type
= self::PERSON_UID;
63
64
65
private
$export_types
= array();
66
private
$import_types
= array();
67
68
private
$exists
=
false
;
69
70
77
public
function
__construct
($a_server_id,
$mid
)
78
{
79
$this->server_id = $a_server_id;
80
$this->mid =
$mid
;
81
$this->
read
();
82
}
83
90
public
static
function
getInstance
($a_server_id,
$mid
)
91
{
92
if
(self::$instances[$a_server_id .
'_'
.
$mid
]) {
93
return
self::$instances[$a_server_id .
'_'
.
$mid
];
94
}
95
return
self::$instances[$a_server_id .
'_'
.
$mid
] =
new
self
($a_server_id,
$mid
);
96
}
97
98
103
public
function
getServerId
()
104
{
105
return
$this->server_id
;
106
}
107
108
public
function
setMid
($a_mid)
109
{
110
$this->mid = $a_mid;
111
}
112
113
public
function
getMid
()
114
{
115
return
$this->mid
;
116
}
117
118
public
function
enableExport
($a_status)
119
{
120
$this->export = $a_status;
121
}
122
123
public
function
isExportEnabled
()
124
{
125
return
(
bool
)
$this->export
;
126
}
127
128
public
function
enableImport
($a_status)
129
{
130
$this->
import
= $a_status;
131
}
132
133
public
function
isImportEnabled
()
134
{
135
return
$this->import
;
136
}
137
138
public
function
setImportType
(
$a_type
)
139
{
140
if
(
$a_type
!= self::IMPORT_UNCHANGED) {
141
$this->import_type =
$a_type
;
142
}
143
}
144
145
public
function
getImportType
()
146
{
147
return
$this->import_type
;
148
}
149
150
public
function
setTitle
($a_title)
151
{
152
$this->title = $a_title;
153
}
154
155
public
function
getTitle
()
156
{
157
return
$this->title
;
158
}
159
160
public
function
getCommunityName
()
161
{
162
return
$this->cname
;
163
}
164
165
public
function
setCommunityName
($a_name)
166
{
167
$this->cname = $a_name;
168
}
169
170
public
function
isTokenEnabled
()
171
{
172
return
(
bool
)
$this->token
;
173
}
174
175
public
function
enableToken
($a_stat)
176
{
177
$this->token = $a_stat;
178
}
179
180
public
function
setExportTypes
($a_types)
181
{
182
$this->export_types = $a_types;
183
}
184
185
public
function
getExportTypes
()
186
{
187
return
$this->export_types
;
188
}
189
190
public
function
setImportTypes
($a_types)
191
{
192
$this->import_types = $a_types;
193
}
194
195
public
function
isDeprecatedTokenEnabled
()
196
{
197
return
(
bool
)
$this->dtoken
;
198
}
199
200
public
function
enableDeprecatedToken
($a_stat)
201
{
202
$this->dtoken = $a_stat;
203
}
204
205
public
function
getImportTypes
()
206
{
207
return
$this->import_types
;
208
}
209
210
private
function
exists
()
211
{
212
return
$this->exists
;
213
}
214
219
public
function
update
()
220
{
221
global
$DIC
;
222
223
$ilDB
= $DIC[
'ilDB'
];
224
225
if
(!$this->
exists
()) {
226
return
$this->
create
();
227
}
228
$query
=
'UPDATE ecs_part_settings '
.
229
'SET '
.
230
'sid = '
.
$ilDB
->quote((
int
) $this->
getServerId
(),
'integer'
) .
', '
.
231
'mid = '
.
$ilDB
->quote((
int
) $this->
getMid
(),
'integer'
) .
', '
.
232
'export = '
.
$ilDB
->quote((
int
) $this->
isExportEnabled
(),
'integer'
) .
', '
.
233
'import = '
.
$ilDB
->quote((
int
) $this->
isImportEnabled
(),
'integer'
) .
', '
.
234
'import_type = '
.
$ilDB
->quote((
int
) $this->
getImportType
(),
'integer'
) .
', '
.
235
'title = '
.
$ilDB
->quote($this->
getTitle
(),
'text'
) .
', '
.
236
'cname = '
.
$ilDB
->quote($this->
getCommunityName
(),
'text'
) .
', '
.
237
'token = '
.
$ilDB
->quote($this->
isTokenEnabled
(),
'integer'
) .
', '
.
238
'dtoken = '
.
$ilDB
->quote($this->
isDeprecatedTokenEnabled
(),
'integer'
) .
', '
.
239
'export_types = '
.
$ilDB
->quote(serialize($this->
getExportTypes
()),
'text'
) .
', '
.
240
'import_types = '
.
$ilDB
->quote(serialize($this->
getImportTypes
()),
'text'
) .
' '
.
241
'WHERE sid = '
.
$ilDB
->quote((
int
) $this->
getServerId
(),
'integer'
) .
' '
.
242
'AND mid = '
.
$ilDB
->quote((
int
) $this->
getMid
(),
'integer'
);
243
$aff =
$ilDB
->manipulate(
$query
);
244
return
true
;
245
}
246
247
private
function
create
()
248
{
249
global
$DIC
;
250
251
$ilDB
= $DIC[
'ilDB'
];
252
253
$query
=
'INSERT INTO ecs_part_settings '
.
254
'(sid,mid,export,import,import_type,title,cname,token,dtoken,export_types, import_types) '
.
255
'VALUES( '
.
256
$ilDB
->quote($this->
getServerId
(),
'integer'
) .
', '
.
257
$ilDB
->quote($this->
getMid
(),
'integer'
) .
', '
.
258
$ilDB
->quote((
int
) $this->
isExportEnabled
(),
'integer'
) .
', '
.
259
$ilDB
->quote((
int
) $this->
isImportEnabled
(),
'integer'
) .
', '
.
260
$ilDB
->quote((
int
) $this->
getImportType
(),
'integer'
) .
', '
.
261
$ilDB
->quote($this->
getTitle
(),
'text'
) .
', '
.
262
$ilDB
->quote($this->
getCommunityName
(),
'text'
) .
', '
.
263
$ilDB
->quote($this->
isTokenEnabled
(),
'integer'
) .
', '
.
264
$ilDB
->quote($this->
isDeprecatedTokenEnabled
(),
'integer'
) .
', '
.
265
$ilDB
->quote(serialize($this->
getExportTypes
()),
'text'
) .
', '
.
266
$ilDB
->quote(serialize($this->
getImportTypes
()),
'text'
) .
' '
.
267
')'
;
268
$aff =
$ilDB
->manipulate(
$query
);
269
return
true
;
270
}
271
277
public
function
delete
()
278
{
279
global
$DIC
;
280
281
$ilDB
= $DIC[
'ilDB'
];
282
283
$query
=
'DELETE FROM ecs_part_settings '
.
284
'WHERE sid = '
.
$ilDB
->quote($this->
getServerId
(),
'integer'
) .
' '
.
285
'AND mid = '
.
$ilDB
->quote($this->
getMid
(),
'integer'
);
286
$ilDB
->manipulate(
$query
);
287
return
true
;
288
}
289
294
public
function
read
()
295
{
296
global
$DIC
;
297
298
$ilDB
= $DIC[
'ilDB'
];
299
300
$query
=
'SELECT * FROM ecs_part_settings '
.
301
'WHERE sid = '
.
$ilDB
->quote($this->
getServerId
(),
'integer'
) .
' '
.
302
'AND mid = '
.
$ilDB
->quote($this->
getMid
(),
'integer'
);
303
304
$res
=
$ilDB
->query(
$query
);
305
306
$this->
exists
= (
$res
->numRows() ? true :
false
);
307
308
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
309
$this->
enableExport
(
$row
->export);
310
$this->
enableImport
(
$row
->import);
311
$this->
setImportType
(
$row
->import_type);
312
$this->
setTitle
(
$row
->title);
313
$this->
setCommunityName
(
$row
->cname);
314
$this->
enableToken
(
$row
->token);
315
$this->
enableDeprecatedToken
(
$row
->dtoken);
316
317
$this->
setExportTypes
((array) unserialize(
$row
->export_types));
318
$this->
setImportTypes
((array) unserialize(
$row
->import_types));
319
}
320
return
true
;
321
}
322
323
public
static
function
deleteByServerId
($a_server_id)
324
{
325
global
$DIC
;
326
327
$ilDB
= $DIC[
'ilDB'
];
328
329
$query
=
'DELETE FROM ecs_events'
.
330
' WHERE server_id = '
.
$ilDB
->quote($a_server_id,
'integer'
);
331
$ilDB
->manipulate(
$query
);
332
return
true
;
333
}
334
}
ilECSParticipantSetting\enableDeprecatedToken
enableDeprecatedToken($a_stat)
Definition:
class.ilECSParticipantSetting.php:200
ilECSParticipantSetting\$import_type
$import_type
Definition:
class.ilECSParticipantSetting.php:55
ilECSParticipantSetting\deleteByServerId
static deleteByServerId($a_server_id)
Definition:
class.ilECSParticipantSetting.php:323
ilECSParticipantSetting\$exists
$exists
Definition:
class.ilECSParticipantSetting.php:68
ilECSParticipantSetting\$import
$import
Definition:
class.ilECSParticipantSetting.php:54
ilECSParticipantSetting\setMid
setMid($a_mid)
Definition:
class.ilECSParticipantSetting.php:108
ilECSParticipantSetting\getCommunityName
getCommunityName()
Definition:
class.ilECSParticipantSetting.php:160
ilECSParticipantSetting\IMPORT_RCRS
const IMPORT_RCRS
Definition:
class.ilECSParticipantSetting.php:47
$DIC
global $DIC
Definition:
saml.php:7
ilECSParticipantSetting\isDeprecatedTokenEnabled
isDeprecatedTokenEnabled()
Definition:
class.ilECSParticipantSetting.php:195
ilECSParticipantSetting\$export
$export
Definition:
class.ilECSParticipantSetting.php:53
ilECSParticipantSetting\exists
exists()
Definition:
class.ilECSParticipantSetting.php:210
ilECSParticipantSetting\getMid
getMid()
Definition:
class.ilECSParticipantSetting.php:113
ilECSParticipantSetting\PERSON_LOGIN
const PERSON_LOGIN
Definition:
class.ilECSParticipantSetting.php:39
ilECSParticipantSetting\update
update()
Update Calls create automatically when no entry exists.
Definition:
class.ilECSParticipantSetting.php:219
ilECSParticipantSetting\$instances
static $instances
Definition:
class.ilECSParticipantSetting.php:42
ilECSParticipantSetting\create
create()
Definition:
class.ilECSParticipantSetting.php:247
ilECSParticipantSetting\$mid
$mid
Definition:
class.ilECSParticipantSetting.php:52
ilECSParticipantSetting\enableImport
enableImport($a_status)
Definition:
class.ilECSParticipantSetting.php:128
ilECSParticipantSetting\$auth_version
$auth_version
Definition:
class.ilECSParticipantSetting.php:61
ilECSParticipantSetting\IMPORT_CRS
const IMPORT_CRS
Definition:
class.ilECSParticipantSetting.php:48
ilECSParticipantSetting\PERSON_UID
const PERSON_UID
Definition:
class.ilECSParticipantSetting.php:40
ilECSParticipantSetting
Definition:
class.ilECSParticipantSetting.php:32
ilECSParticipantSetting\isExportEnabled
isExportEnabled()
Definition:
class.ilECSParticipantSetting.php:123
$a_type
$a_type
Definition:
workflow.php:92
ilECSParticipantSetting\$import_types
$import_types
Definition:
class.ilECSParticipantSetting.php:66
ilECSParticipantSetting\AUTH_VERSION_4
const AUTH_VERSION_4
Definition:
class.ilECSParticipantSetting.php:34
ilECSParticipantSetting\$dtoken
$dtoken
Definition:
class.ilECSParticipantSetting.php:59
ilECSParticipantSetting\setTitle
setTitle($a_title)
Definition:
class.ilECSParticipantSetting.php:150
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilECSParticipantSetting\AUTH_VERSION_5
const AUTH_VERSION_5
Definition:
class.ilECSParticipantSetting.php:35
ilECSParticipantSetting\getInstance
static getInstance($a_server_id, $mid)
Get instance by server id and mid.
Definition:
class.ilECSParticipantSetting.php:90
ilECSParticipantSetting\isTokenEnabled
isTokenEnabled()
Definition:
class.ilECSParticipantSetting.php:170
ilECSParticipantSetting\$server_id
$server_id
Definition:
class.ilECSParticipantSetting.php:51
ilECSParticipantSetting\getImportTypes
getImportTypes()
Definition:
class.ilECSParticipantSetting.php:205
ilECSParticipantSetting\setExportTypes
setExportTypes($a_types)
Definition:
class.ilECSParticipantSetting.php:180
ilECSParticipantSetting\getServerId
getServerId()
Get server id.
Definition:
class.ilECSParticipantSetting.php:103
ilECSParticipantSetting\read
read()
Read stored entry.
Definition:
class.ilECSParticipantSetting.php:294
ilECSParticipantSetting\enableToken
enableToken($a_stat)
Definition:
class.ilECSParticipantSetting.php:175
ilECSParticipantSetting\getExportTypes
getExportTypes()
Definition:
class.ilECSParticipantSetting.php:185
ilECSParticipantSetting\enableExport
enableExport($a_status)
Definition:
class.ilECSParticipantSetting.php:118
$query
$query
Definition:
proxy_ylocal.php:13
ilECSParticipantSetting\$title
$title
Definition:
class.ilECSParticipantSetting.php:56
ilECSParticipantSetting\setImportType
setImportType($a_type)
Definition:
class.ilECSParticipantSetting.php:138
ilECSParticipantSetting\__construct
__construct($a_server_id, $mid)
Constructor.
Definition:
class.ilECSParticipantSetting.php:77
ilECSParticipantSetting\getTitle
getTitle()
Definition:
class.ilECSParticipantSetting.php:155
ilECSParticipantSetting\$token
$token
Definition:
class.ilECSParticipantSetting.php:58
ilECSParticipantSetting\setImportTypes
setImportTypes($a_types)
Definition:
class.ilECSParticipantSetting.php:190
$row
$row
Definition:
migrateto20.php:360
ilECSParticipantSetting\PERSON_EPPN
const PERSON_EPPN
Definition:
class.ilECSParticipantSetting.php:37
ilECSParticipantSetting\setCommunityName
setCommunityName($a_name)
Definition:
class.ilECSParticipantSetting.php:165
ilECSParticipantSetting\IMPORT_CMS
const IMPORT_CMS
Definition:
class.ilECSParticipantSetting.php:49
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilECSParticipantSetting\IMPORT_UNCHANGED
const IMPORT_UNCHANGED
Definition:
class.ilECSParticipantSetting.php:46
ilECSParticipantSetting\isImportEnabled
isImportEnabled()
Definition:
class.ilECSParticipantSetting.php:133
ilECSParticipantSetting\getImportType
getImportType()
Definition:
class.ilECSParticipantSetting.php:145
php
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilECSParticipantSetting\$export_types
$export_types
Definition:
class.ilECSParticipantSetting.php:65
ilECSParticipantSetting\$cname
$cname
Definition:
class.ilECSParticipantSetting.php:57
ilECSParticipantSetting\$person_type
$person_type
Definition:
class.ilECSParticipantSetting.php:62
ilECSParticipantSetting\PERSON_LUID
const PERSON_LUID
Definition:
class.ilECSParticipantSetting.php:38
Services
WebServices
ECS
classes
class.ilECSParticipantSetting.php
Generated on Thu Jan 16 2025 19:02:34 for ILIAS by
1.8.13 (using
Doxyfile
)