ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ 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
$ilDB
;
222
223
if
(!$this->
exists
()) {
224
return
$this->
create
();
225
}
226
$query
=
'UPDATE ecs_part_settings '
.
227
'SET '
.
228
'sid = '
. $ilDB->quote((
int
) $this->
getServerId
(),
'integer'
) .
', '
.
229
'mid = '
. $ilDB->quote((
int
) $this->
getMid
(),
'integer'
) .
', '
.
230
'export = '
. $ilDB->quote((
int
) $this->
isExportEnabled
(),
'integer'
) .
', '
.
231
'import = '
. $ilDB->quote((
int
) $this->
isImportEnabled
(),
'integer'
) .
', '
.
232
'import_type = '
. $ilDB->quote((
int
) $this->
getImportType
(),
'integer'
) .
', '
.
233
'title = '
. $ilDB->quote($this->
getTitle
(),
'text'
) .
', '
.
234
'cname = '
. $ilDB->quote($this->
getCommunityName
(),
'text'
) .
', '
.
235
'token = '
. $ilDB->quote($this->
isTokenEnabled
(),
'integer'
) .
', '
.
236
'dtoken = '
. $ilDB->quote($this->
isDeprecatedTokenEnabled
(),
'integer'
) .
', '
.
237
'export_types = '
. $ilDB->quote(serialize($this->
getExportTypes
()),
'text'
) .
', '
.
238
'import_types = '
. $ilDB->quote(serialize($this->
getImportTypes
()),
'text'
) .
' '
.
239
'WHERE sid = '
. $ilDB->quote((
int
) $this->
getServerId
(),
'integer'
) .
' '
.
240
'AND mid = '
. $ilDB->quote((
int
) $this->
getMid
(),
'integer'
);
241
$aff =
$ilDB
->manipulate(
$query
);
242
return
true
;
243
}
244
245
private
function
create
()
246
{
247
global
$ilDB
;
248
249
$query
=
'INSERT INTO ecs_part_settings '
.
250
'(sid,mid,export,import,import_type,title,cname,token,dtoken,export_types, import_types) '
.
251
'VALUES( '
.
252
$ilDB
->quote($this->
getServerId
(),
'integer'
) .
', '
.
253
$ilDB->quote($this->
getMid
(),
'integer'
) .
', '
.
254
$ilDB->quote((
int
) $this->
isExportEnabled
(),
'integer'
) .
', '
.
255
$ilDB->quote((
int
) $this->
isImportEnabled
(),
'integer'
) .
', '
.
256
$ilDB->quote((
int
) $this->
getImportType
(),
'integer'
) .
', '
.
257
$ilDB->quote($this->
getTitle
(),
'text'
) .
', '
.
258
$ilDB->quote($this->
getCommunityName
(),
'text'
) .
', '
.
259
$ilDB->quote($this->
isTokenEnabled
(),
'integer'
) .
', '
.
260
$ilDB->quote($this->
isDeprecatedTokenEnabled
(),
'integer'
) .
', '
.
261
$ilDB->quote(serialize($this->
getExportTypes
()),
'text'
) .
', '
.
262
$ilDB->quote(serialize($this->
getImportTypes
()),
'text'
) .
' '
.
263
')'
;
264
$aff =
$ilDB
->manipulate(
$query
);
265
return
true
;
266
}
267
273
public
function
delete
()
274
{
275
global
$ilDB
;
276
277
$query
=
'DELETE FROM ecs_part_settings '
.
278
'WHERE sid = '
.
$ilDB
->quote($this->
getServerId
(),
'integer'
) .
' '
.
279
'AND mid = '
. $ilDB->quote($this->getMid(),
'integer'
);
280
$ilDB
->manipulate(
$query
);
281
return
true
;
282
}
283
288
public
function
read
()
289
{
290
global
$ilDB
;
291
292
$query
=
'SELECT * FROM ecs_part_settings '
.
293
'WHERE sid = '
.
$ilDB
->quote($this->
getServerId
(),
'integer'
) .
' '
.
294
'AND mid = '
. $ilDB->quote($this->
getMid
(),
'integer'
);
295
296
$res
= $ilDB->query(
$query
);
297
298
$this->
exists
= (
$res
->numRows() ? true :
false
);
299
300
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
301
$this->
enableExport
(
$row
->export);
302
$this->
enableImport
(
$row
->import);
303
$this->
setImportType
(
$row
->import_type);
304
$this->
setTitle
(
$row
->title);
305
$this->
setCommunityName
(
$row
->cname);
306
$this->
enableToken
(
$row
->token);
307
$this->
enableDeprecatedToken
(
$row
->dtoken);
308
309
$this->
setExportTypes
((array) unserialize(
$row
->export_types));
310
$this->
setImportTypes
((array) unserialize(
$row
->import_types));
311
}
312
return
true
;
313
}
314
315
public
static
function
deleteByServerId
($a_server_id)
316
{
317
global
$ilDB
;
318
319
$query
=
'DELETE FROM ecs_events'
.
320
' WHERE server_id = '
.
$ilDB
->quote($a_server_id,
'integer'
);
321
$ilDB
->manipulate(
$query
);
322
return
true
;
323
}
324
}
$row
$row
Definition:
10autofilter-selection-1.php:74
php
An exception for terminatinating execution or to throw for unit testing.
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilECSParticipantSetting
Definition:
class.ilECSParticipantSetting.php:33
ilECSParticipantSetting\IMPORT_RCRS
const IMPORT_RCRS
Definition:
class.ilECSParticipantSetting.php:47
ilECSParticipantSetting\PERSON_LUID
const PERSON_LUID
Definition:
class.ilECSParticipantSetting.php:38
ilECSParticipantSetting\$mid
$mid
Definition:
class.ilECSParticipantSetting.php:52
ilECSParticipantSetting\exists
exists()
Definition:
class.ilECSParticipantSetting.php:210
ilECSParticipantSetting\read
read()
Read stored entry.
Definition:
class.ilECSParticipantSetting.php:288
ilECSParticipantSetting\isTokenEnabled
isTokenEnabled()
Definition:
class.ilECSParticipantSetting.php:170
ilECSParticipantSetting\getTitle
getTitle()
Definition:
class.ilECSParticipantSetting.php:155
ilECSParticipantSetting\setImportType
setImportType($a_type)
Definition:
class.ilECSParticipantSetting.php:138
ilECSParticipantSetting\setMid
setMid($a_mid)
Definition:
class.ilECSParticipantSetting.php:108
ilECSParticipantSetting\create
create()
Definition:
class.ilECSParticipantSetting.php:245
ilECSParticipantSetting\$auth_version
$auth_version
Definition:
class.ilECSParticipantSetting.php:61
ilECSParticipantSetting\$import_types
$import_types
Definition:
class.ilECSParticipantSetting.php:66
ilECSParticipantSetting\AUTH_VERSION_5
const AUTH_VERSION_5
Definition:
class.ilECSParticipantSetting.php:35
ilECSParticipantSetting\$export
$export
Definition:
class.ilECSParticipantSetting.php:53
ilECSParticipantSetting\$cname
$cname
Definition:
class.ilECSParticipantSetting.php:57
ilECSParticipantSetting\isExportEnabled
isExportEnabled()
Definition:
class.ilECSParticipantSetting.php:123
ilECSParticipantSetting\PERSON_LOGIN
const PERSON_LOGIN
Definition:
class.ilECSParticipantSetting.php:39
ilECSParticipantSetting\getExportTypes
getExportTypes()
Definition:
class.ilECSParticipantSetting.php:185
ilECSParticipantSetting\$exists
$exists
Definition:
class.ilECSParticipantSetting.php:68
ilECSParticipantSetting\IMPORT_UNCHANGED
const IMPORT_UNCHANGED
Definition:
class.ilECSParticipantSetting.php:46
ilECSParticipantSetting\AUTH_VERSION_4
const AUTH_VERSION_4
Definition:
class.ilECSParticipantSetting.php:34
ilECSParticipantSetting\$instances
static $instances
Definition:
class.ilECSParticipantSetting.php:42
ilECSParticipantSetting\isDeprecatedTokenEnabled
isDeprecatedTokenEnabled()
Definition:
class.ilECSParticipantSetting.php:195
ilECSParticipantSetting\setCommunityName
setCommunityName($a_name)
Definition:
class.ilECSParticipantSetting.php:165
ilECSParticipantSetting\$token
$token
Definition:
class.ilECSParticipantSetting.php:58
ilECSParticipantSetting\update
update()
Update Calls create automatically when no entry exists.
Definition:
class.ilECSParticipantSetting.php:219
ilECSParticipantSetting\$dtoken
$dtoken
Definition:
class.ilECSParticipantSetting.php:59
ilECSParticipantSetting\enableToken
enableToken($a_stat)
Definition:
class.ilECSParticipantSetting.php:175
ilECSParticipantSetting\IMPORT_CMS
const IMPORT_CMS
Definition:
class.ilECSParticipantSetting.php:49
ilECSParticipantSetting\setImportTypes
setImportTypes($a_types)
Definition:
class.ilECSParticipantSetting.php:190
ilECSParticipantSetting\getMid
getMid()
Definition:
class.ilECSParticipantSetting.php:113
ilECSParticipantSetting\PERSON_EPPN
const PERSON_EPPN
Definition:
class.ilECSParticipantSetting.php:37
ilECSParticipantSetting\PERSON_UID
const PERSON_UID
Definition:
class.ilECSParticipantSetting.php:40
ilECSParticipantSetting\isImportEnabled
isImportEnabled()
Definition:
class.ilECSParticipantSetting.php:133
ilECSParticipantSetting\$import
$import
Definition:
class.ilECSParticipantSetting.php:54
ilECSParticipantSetting\$export_types
$export_types
Definition:
class.ilECSParticipantSetting.php:65
ilECSParticipantSetting\enableDeprecatedToken
enableDeprecatedToken($a_stat)
Definition:
class.ilECSParticipantSetting.php:200
ilECSParticipantSetting\$server_id
$server_id
Definition:
class.ilECSParticipantSetting.php:51
ilECSParticipantSetting\getInstance
static getInstance($a_server_id, $mid)
Get instance by server id and mid.
Definition:
class.ilECSParticipantSetting.php:90
ilECSParticipantSetting\getServerId
getServerId()
Get server id.
Definition:
class.ilECSParticipantSetting.php:103
ilECSParticipantSetting\setExportTypes
setExportTypes($a_types)
Definition:
class.ilECSParticipantSetting.php:180
ilECSParticipantSetting\$title
$title
Definition:
class.ilECSParticipantSetting.php:56
ilECSParticipantSetting\deleteByServerId
static deleteByServerId($a_server_id)
Definition:
class.ilECSParticipantSetting.php:315
ilECSParticipantSetting\__construct
__construct($a_server_id, $mid)
Constructor.
Definition:
class.ilECSParticipantSetting.php:77
ilECSParticipantSetting\setTitle
setTitle($a_title)
Definition:
class.ilECSParticipantSetting.php:150
ilECSParticipantSetting\$person_type
$person_type
Definition:
class.ilECSParticipantSetting.php:62
ilECSParticipantSetting\getImportType
getImportType()
Definition:
class.ilECSParticipantSetting.php:145
ilECSParticipantSetting\$import_type
$import_type
Definition:
class.ilECSParticipantSetting.php:55
ilECSParticipantSetting\enableImport
enableImport($a_status)
Definition:
class.ilECSParticipantSetting.php:128
ilECSParticipantSetting\enableExport
enableExport($a_status)
Definition:
class.ilECSParticipantSetting.php:118
ilECSParticipantSetting\IMPORT_CRS
const IMPORT_CRS
Definition:
class.ilECSParticipantSetting.php:48
ilECSParticipantSetting\getImportTypes
getImportTypes()
Definition:
class.ilECSParticipantSetting.php:205
ilECSParticipantSetting\getCommunityName
getCommunityName()
Definition:
class.ilECSParticipantSetting.php:160
$query
$query
Definition:
proxy_ylocal.php:13
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
$ilDB
global $ilDB
Definition:
storeScorm2004.php:19
$a_type
$a_type
Definition:
workflow.php:92
Services
WebServices
ECS
classes
class.ilECSParticipantSetting.php
Generated on Tue Sep 30 2025 19:01:21 for ILIAS by
1.9.4 (using
Doxyfile
)