ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilECSRemoteUser Class Reference

Storage of ecs remote user. More...

+ Collaboration diagram for ilECSRemoteUser:

Public Member Functions

 __construct ($a_eru_id=0)
 Constructor. More...
 
 exists ()
 Check if entry exists for user. More...
 
 getId ()
 
 setServerId ($a_sid)
 
 getServerId ()
 
 setMid ($a_mid)
 
 getMid ()
 
 setUserId ($a_usr_id)
 
 getUserId ()
 
 setRemoteUserId ($a_remote_id)
 
 getRemoteUserId ()
 
 update ()
 Update remote user entry. More...
 
 create ()
 Create nerw remote user entry. More...
 

Static Public Member Functions

static factory ($a_usr_id)
 Get instance for usr_id. More...
 

Protected Member Functions

 read ()
 Read data set. More...
 

Private Attributes

 $eru_id = 0
 
 $sid = 0
 
 $mid = 0
 
 $usr_id = 0
 
 $remote_usr_id = ''
 

Detailed Description

Storage of ecs remote user.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e $Id$

Definition at line 8 of file class.ilECSRemoteUser.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSRemoteUser::__construct (   $a_eru_id = 0)

Constructor.

Definition at line 20 of file class.ilECSRemoteUser.php.

21 {
22 $this->eru_id = $a_eru_id;
23 $this->read();
24 }

References read().

+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilECSRemoteUser::create ( )

Create nerw remote user entry.

Definition at line 132 of file class.ilECSRemoteUser.php.

133 {
134 $next_id = $GLOBALS['DIC']['ilDB']->nextId('ecs_remote_user');
135 $query = 'INSERT INTO ecs_remote_user (eru_id, sid, mid, usr_id, remote_usr_id) ' .
136 'VALUES( ' .
137 $GLOBALS['DIC']['ilDB']->quote($next_id) . ', ' .
138 $GLOBALS['DIC']['ilDB']->quote($this->getServerId(), 'integer') . ', ' .
139 $GLOBALS['DIC']['ilDB']->quote($this->getMid(), 'integer') . ', ' .
140 $GLOBALS['DIC']['ilDB']->quote($this->getUserId(), 'text') . ', ' .
141 $GLOBALS['DIC']['ilDB']->quote($this->getRemoteUserId(), 'text') . ' ' .
142 ')';
143 $GLOBALS['DIC']['ilDB']->manipulate($query);
144 }
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
$query

References $GLOBALS, $query, getMid(), getRemoteUserId(), getServerId(), and getUserId().

+ Here is the call graph for this function:

◆ exists()

ilECSRemoteUser::exists ( )

Check if entry exists for user.

Definition at line 49 of file class.ilECSRemoteUser.php.

50 {
51 global $DIC;
52
53 $ilDB = $DIC['ilDB'];
54
55 $query = 'SELECT eru_id FROM ecs_remote_user ' .
56 'WHERE sid = ' . $ilDB->quote($this->getServerId(), 'integer') . ' ' .
57 'AND mid = ' . $ilDB->quote($this->getMid(), 'integer') . ' ' .
58 'AND usr_id = ' . $ilDB->quote($this->getUserId(), 'integer');
59 $res = $ilDB->query($query);
60 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
61 return (bool) $row->eru_id;
62 }
63 return false;
64 }
$row
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
global $ilDB

References $DIC, $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, getMid(), getServerId(), and getUserId().

+ Here is the call graph for this function:

◆ factory()

static ilECSRemoteUser::factory (   $a_usr_id)
static

Get instance for usr_id.

Parameters
type$a_usr_id
Returns
\self|null

Definition at line 31 of file class.ilECSRemoteUser.php.

32 {
33 global $DIC;
34
35 $ilDB = $DIC['ilDB'];
36
37 $query = 'SELECT eru_id FROM ecs_remote_user ' .
38 'WHERE usr_id = ' . $ilDB->quote($a_usr_id, 'integer');
39 $res = $ilDB->query($query);
40 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
41 return new self($row->eru_id);
42 }
43 return null;
44 }

References $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSAppEventListener\updateEnrolmentStatus().

+ Here is the caller graph for this function:

◆ getId()

ilECSRemoteUser::getId ( )

Definition at line 67 of file class.ilECSRemoteUser.php.

68 {
69 return $this->eru_id;
70 }

References $eru_id.

Referenced by read(), and update().

+ Here is the caller graph for this function:

◆ getMid()

ilECSRemoteUser::getMid ( )

Definition at line 87 of file class.ilECSRemoteUser.php.

88 {
89 return $this->mid;
90 }

References $mid.

Referenced by create(), exists(), and update().

+ Here is the caller graph for this function:

◆ getRemoteUserId()

ilECSRemoteUser::getRemoteUserId ( )

Definition at line 108 of file class.ilECSRemoteUser.php.

109 {
111 }

References $remote_usr_id.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getServerId()

ilECSRemoteUser::getServerId ( )

Definition at line 77 of file class.ilECSRemoteUser.php.

78 {
79 return $this->sid;
80 }

References $sid.

Referenced by create(), exists(), and update().

+ Here is the caller graph for this function:

◆ getUserId()

ilECSRemoteUser::getUserId ( )

Definition at line 98 of file class.ilECSRemoteUser.php.

99 {
100 return $this->usr_id;
101 }

References $usr_id.

Referenced by create(), exists(), and update().

+ Here is the caller graph for this function:

◆ read()

ilECSRemoteUser::read ( )
protected

Read data set.

Returns
boolean

Definition at line 150 of file class.ilECSRemoteUser.php.

151 {
152 if (!$this->getId()) {
153 return false;
154 }
155
156 $query = 'SELECT * FROM ecs_remote_user ' .
157 'WHERE eru_id = ' . $GLOBALS['DIC']['ilDB']->quote($this->getId(), 'integer');
158 $res = $GLOBALS['DIC']['ilDB']->query($query);
159 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
160 $this->setServerId($row->sid);
161 $this->setMid($row->mid);
162 $this->setUserId($row->usr_id);
163 $this->setRemoteUserId($row->remote_usr_id);
164 }
165 }
setRemoteUserId($a_remote_id)

References $GLOBALS, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, getId(), setMid(), setRemoteUserId(), setServerId(), and setUserId().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMid()

ilECSRemoteUser::setMid (   $a_mid)

Definition at line 82 of file class.ilECSRemoteUser.php.

83 {
84 $this->mid = $a_mid;
85 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setRemoteUserId()

ilECSRemoteUser::setRemoteUserId (   $a_remote_id)

Definition at line 103 of file class.ilECSRemoteUser.php.

104 {
105 $this->remote_usr_id = $a_remote_id;
106 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setServerId()

ilECSRemoteUser::setServerId (   $a_sid)

Definition at line 72 of file class.ilECSRemoteUser.php.

73 {
74 $this->sid = $a_sid;
75 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setUserId()

ilECSRemoteUser::setUserId (   $a_usr_id)

Definition at line 93 of file class.ilECSRemoteUser.php.

94 {
95 $this->usr_id = $a_usr_id;
96 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilECSRemoteUser::update ( )

Update remote user entry.

Returns
boolean

Definition at line 117 of file class.ilECSRemoteUser.php.

118 {
119 $query = 'UPDATE ecs_remote_user SET ' .
120 'sid = ' . $GLOBALS['DIC']['ilDB']->quote($this->getServerId(), 'integer') . ', ' .
121 'mid = ' . $GLOBALS['DIC']['ilDB']->quote($this->getMid(), 'integer') . ', ' .
122 'usr_id = ' . $GLOBALS['DIC']['ilDB']->quote($this->getUserId(), 'text') . ', ' .
123 'remote_usr_id = ' . $GLOBALS['DIC']['ilDB']->quote($this->getRemoteUserId(), 'text') . ' ' .
124 'WHERE eru_id = ' . $GLOBALS['DIC']['ilDB']->quote($this->getId());
125 $GLOBALS['DIC']['ilDB']->manipulate($query);
126 return true;
127 }

References $GLOBALS, $query, getId(), getMid(), getRemoteUserId(), getServerId(), and getUserId().

+ Here is the call graph for this function:

Field Documentation

◆ $eru_id

ilECSRemoteUser::$eru_id = 0
private

Definition at line 10 of file class.ilECSRemoteUser.php.

Referenced by getId().

◆ $mid

ilECSRemoteUser::$mid = 0
private

Definition at line 12 of file class.ilECSRemoteUser.php.

Referenced by getMid().

◆ $remote_usr_id

ilECSRemoteUser::$remote_usr_id = ''
private

Definition at line 14 of file class.ilECSRemoteUser.php.

Referenced by getRemoteUserId().

◆ $sid

ilECSRemoteUser::$sid = 0
private

Definition at line 11 of file class.ilECSRemoteUser.php.

Referenced by getServerId().

◆ $usr_id

ilECSRemoteUser::$usr_id = 0
private

Definition at line 13 of file class.ilECSRemoteUser.php.

Referenced by getUserId().


The documentation for this class was generated from the following file: