ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilECSRemoteUser.php
Go to the documentation of this file.
1
<?php
2
8
class
ilECSRemoteUser
9
{
10
private
$eru_id
= 0;
11
private
$sid
= 0;
12
private
$mid
= 0;
13
private
$usr_id
= 0;
14
private
$remote_usr_id
=
''
;
15
16
20
public
function
__construct
($a_eru_id = 0)
21
{
22
$this->eru_id = $a_eru_id;
23
$this->
read
();
24
}
25
31
public
static
function
factory
($a_usr_id)
32
{
33
global
$ilDB
;
34
35
$query
=
'SELECT eru_id FROM ecs_remote_user '
.
36
'WHERE usr_id = '
. $ilDB->quote($a_usr_id,
'integer'
);
37
$res
= $ilDB->query(
$query
);
38
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
39
return
new
self
(
$row
->eru_id);
40
}
41
return
null;
42
}
43
47
public
function
exists
()
48
{
49
global
$ilDB
;
50
51
$query
=
'SELECT eru_id FROM ecs_remote_user '
.
52
'WHERE sid = '
. $ilDB->quote($this->
getServerId
(),
'integer'
) .
' '
.
53
'AND mid = '
. $ilDB->quote($this->
getMid
(),
'integer'
) .
' '
.
54
'AND usr_id = '
. $ilDB->quote($this->
getUserId
(),
'integer'
);
55
$res
= $ilDB->query(
$query
);
56
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
57
return
(
bool
)
$row
->eru_id;
58
}
59
return
false
;
60
}
61
62
63
public
function
getId
()
64
{
65
return
$this->eru_id
;
66
}
67
68
public
function
setServerId
($a_sid)
69
{
70
$this->sid = $a_sid;
71
}
72
73
public
function
getServerId
()
74
{
75
return
$this->sid
;
76
}
77
78
public
function
setMid
($a_mid)
79
{
80
$this->mid = $a_mid;
81
}
82
83
public
function
getMid
()
84
{
85
return
$this->mid
;
86
}
87
88
89
public
function
setUserId
($a_usr_id)
90
{
91
$this->usr_id = $a_usr_id;
92
}
93
94
public
function
getUserId
()
95
{
96
return
$this->usr_id
;
97
}
98
99
public
function
setRemoteUserId
($a_remote_id)
100
{
101
$this->remote_usr_id = $a_remote_id;
102
}
103
104
public
function
getRemoteUserId
()
105
{
106
return
$this->remote_usr_id
;
107
}
108
113
public
function
update
()
114
{
115
$query
=
'UPDATE ecs_remote_user SET '
.
116
'sid = '
.
$GLOBALS
[
'ilDB'
]->quote($this->
getServerId
(),
'integer'
) .
', '
.
117
'mid = '
.
$GLOBALS
[
'ilDB'
]->quote($this->
getMid
(),
'integer'
) .
', '
.
118
'usr_id = '
.
$GLOBALS
[
'ilDB'
]->quote($this->
getUserId
(),
'text'
) .
', '
.
119
'remote_usr_id = '
.
$GLOBALS
[
'ilDB'
]->quote($this->
getRemoteUserId
(),
'text'
) .
' '
.
120
'WHERE eru_id = '
.
$GLOBALS
[
'ilDB'
]->quote($this->
getId
());
121
$GLOBALS
[
'ilDB'
]->manipulate(
$query
);
122
return
true
;
123
}
124
128
public
function
create
()
129
{
130
$next_id =
$GLOBALS
[
'ilDB'
]->nextId(
'ecs_remote_user'
);
131
$query
=
'INSERT INTO ecs_remote_user (eru_id, sid, mid, usr_id, remote_usr_id) '
.
132
'VALUES( '
.
133
$GLOBALS
[
'ilDB'
]->quote($next_id) .
', '
.
134
$GLOBALS
[
'ilDB'
]->quote($this->
getServerId
(),
'integer'
) .
', '
.
135
$GLOBALS
[
'ilDB'
]->quote($this->
getMid
(),
'integer'
) .
', '
.
136
$GLOBALS
[
'ilDB'
]->quote($this->
getUserId
(),
'text'
) .
', '
.
137
$GLOBALS
[
'ilDB'
]->quote($this->
getRemoteUserId
(),
'text'
) .
' '
.
138
')'
;
139
$GLOBALS
[
'ilDB'
]->manipulate(
$query
);
140
}
141
146
protected
function
read
()
147
{
148
if
(!$this->
getId
()) {
149
return
false
;
150
}
151
152
$query
=
'SELECT * FROM ecs_remote_user '
.
153
'WHERE eru_id = '
.
$GLOBALS
[
'ilDB'
]->quote($this->
getId
(),
'integer'
);
154
$res
=
$GLOBALS
[
'ilDB'
]->query(
$query
);
155
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
156
$this->
setServerId
(
$row
->sid);
157
$this->
setMid
(
$row
->mid);
158
$this->
setUserId
(
$row
->usr_id);
159
$this->
setRemoteUserId
(
$row
->remote_usr_id);
160
}
161
}
162
}
ilECSRemoteUser\$sid
$sid
Definition:
class.ilECSRemoteUser.php:11
ilECSRemoteUser\getMid
getMid()
Definition:
class.ilECSRemoteUser.php:83
ilECSRemoteUser\getRemoteUserId
getRemoteUserId()
Definition:
class.ilECSRemoteUser.php:104
ilECSRemoteUser\setRemoteUserId
setRemoteUserId($a_remote_id)
Definition:
class.ilECSRemoteUser.php:99
ilECSRemoteUser\read
read()
Read data set.
Definition:
class.ilECSRemoteUser.php:146
ilECSRemoteUser\setMid
setMid($a_mid)
Definition:
class.ilECSRemoteUser.php:78
ilECSRemoteUser\getServerId
getServerId()
Definition:
class.ilECSRemoteUser.php:73
ilECSRemoteUser
Storage of ecs remote user.
Definition:
class.ilECSRemoteUser.php:8
$GLOBALS
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Definition:
generate-standalone.php:18
ilECSRemoteUser\update
update()
Update remote user entry.
Definition:
class.ilECSRemoteUser.php:113
ilECSRemoteUser\exists
exists()
Check if entry exists for user.
Definition:
class.ilECSRemoteUser.php:47
ilECSRemoteUser\getId
getId()
Definition:
class.ilECSRemoteUser.php:63
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilECSRemoteUser\$remote_usr_id
$remote_usr_id
Definition:
class.ilECSRemoteUser.php:14
ilECSRemoteUser\$mid
$mid
Definition:
class.ilECSRemoteUser.php:12
ilECSRemoteUser\$usr_id
$usr_id
Definition:
class.ilECSRemoteUser.php:13
$query
$query
Definition:
proxy_ylocal.php:13
ilECSRemoteUser\setServerId
setServerId($a_sid)
Definition:
class.ilECSRemoteUser.php:68
ilECSRemoteUser\getUserId
getUserId()
Definition:
class.ilECSRemoteUser.php:94
ilECSRemoteUser\$eru_id
$eru_id
Definition:
class.ilECSRemoteUser.php:10
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilECSRemoteUser\factory
static factory($a_usr_id)
Get instance for usr_id.
Definition:
class.ilECSRemoteUser.php:31
$row
$row
Definition:
10autofilter-selection-1.php:74
ilECSRemoteUser\setUserId
setUserId($a_usr_id)
Definition:
class.ilECSRemoteUser.php:89
ilECSRemoteUser\create
create()
Create nerw remote user entry.
Definition:
class.ilECSRemoteUser.php:128
ilECSRemoteUser\__construct
__construct($a_eru_id=0)
Constructor.
Definition:
class.ilECSRemoteUser.php:20
Services
WebServices
ECS
classes
class.ilECSRemoteUser.php
Generated on Sat Jan 18 2025 19:01:41 for ILIAS by
1.8.13 (using
Doxyfile
)