ILIAS  release_8 Revision v8.24
ilECSUser Class Reference

Stores relevant user data. More...

+ Collaboration diagram for ilECSUser:

Public Member Functions

 __construct ($a_data)
 
 getLogin ()
 get login More...
 
 getExternalAccount ()
 
 getFirstname ()
 get firstname More...
 
 getLastname ()
 getLastname More...
 
 getEmail ()
 get email More...
 
 getInstitution ()
 get institution More...
 
 getImportId ()
 get Email More...
 
 loadFromObject ()
 load from object More...
 
 loadFromGET ()
 load user data from GET parameters More...
 
 toJSON ()
 
 toGET (ilECSParticipantSetting $setting)
 get GET parameter string More...
 
 toREALM ()
 Concatenate all attributes to one string. More...
 

Data Fields

string $login
 
string $email
 
string $firstname
 
string $lastname
 
string $institution
 
string $uid_hash
 

Protected Attributes

string $external_account = ''
 
string $auth_mode = ''
 

Private Attributes

ilSetting $setting
 
 $source
 

Detailed Description

Stores relevant user data.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 25 of file class.ilECSUser.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSUser::__construct (   $a_data)
Parameters
ilObjUser|arrayilObjUser or array containing user info

Definition at line 46 of file class.ilECSUser.php.

47 {
48 global $DIC;
49
50 $this->setting = $DIC->settings();
51
52 $this->source = $a_data;
53 if (is_object($a_data)) {
54 $this->loadFromObject();
55 } elseif (is_array($a_data)) {
56 $this->loadFromGET();
57 }
58 }
loadFromObject()
load from object
loadFromGET()
load user data from GET parameters
global $DIC
Definition: feed.php:28

References $DIC, loadFromGET(), and loadFromObject().

+ Here is the call graph for this function:

Member Function Documentation

◆ getEmail()

ilECSUser::getEmail ( )

get email

Definition at line 94 of file class.ilECSUser.php.

94 : string
95 {
96 return $this->email;
97 }

References $email.

Referenced by ilAuthProviderECS\createUser(), and ilAuthProviderECS\updateUser().

+ Here is the caller graph for this function:

◆ getExternalAccount()

ilECSUser::getExternalAccount ( )

Definition at line 68 of file class.ilECSUser.php.

68 : string
69 {
71 }
string $external_account

References $external_account.

Referenced by toGET().

+ Here is the caller graph for this function:

◆ getFirstname()

ilECSUser::getFirstname ( )

get firstname

Definition at line 78 of file class.ilECSUser.php.

78 : string
79 {
80 return $this->firstname;
81 }
string $firstname

References $firstname.

Referenced by ilAuthProviderECS\createUser(), and ilAuthProviderECS\updateUser().

+ Here is the caller graph for this function:

◆ getImportId()

ilECSUser::getImportId ( )

get Email

Definition at line 109 of file class.ilECSUser.php.

109 : string
110 {
111 return $this->uid_hash;
112 }
string $uid_hash

References $uid_hash.

Referenced by ilAuthProviderECS\createUser(), and ilAuthProviderECS\updateUser().

+ Here is the caller graph for this function:

◆ getInstitution()

ilECSUser::getInstitution ( )

get institution

Definition at line 101 of file class.ilECSUser.php.

101 : string
102 {
103 return $this->institution;
104 }
string $institution

References $institution.

Referenced by ilAuthProviderECS\createUser(), and ilAuthProviderECS\updateUser().

+ Here is the caller graph for this function:

◆ getLastname()

ilECSUser::getLastname ( )

getLastname

Definition at line 86 of file class.ilECSUser.php.

86 : string
87 {
88 return $this->lastname;
89 }
string $lastname

References $lastname.

Referenced by ilAuthProviderECS\createUser(), and ilAuthProviderECS\updateUser().

+ Here is the caller graph for this function:

◆ getLogin()

ilECSUser::getLogin ( )

get login

Definition at line 63 of file class.ilECSUser.php.

63 : string
64 {
65 return $this->login;
66 }

References $login.

Referenced by ilAuthProviderECS\createUser(), and toGET().

+ Here is the caller graph for this function:

◆ loadFromGET()

ilECSUser::loadFromGET ( )

load user data from GET parameters

Definition at line 134 of file class.ilECSUser.php.

134 : void
135 {
136 //TODO add proper testing for get parameters
137 $this->login = ilUtil::stripSlashes(urldecode($this->source['ecs_login']));
138 $this->firstname = ilUtil::stripSlashes(urldecode($this->source['ecs_firstname']));
139 $this->lastname = ilUtil::stripSlashes(urldecode($this->source['ecs_lastname']));
140 $this->email = ilUtil::stripSlashes(urldecode($this->source['ecs_email']));
141 $this->institution = ilUtil::stripSlashes(urldecode($this->source['ecs_institution']));
142
143 if ($this->source['ecs_uid_hash']) {
144 $this->uid_hash = ilUtil::stripSlashes(urldecode($this->source['ecs_uid_hash']));
145 } elseif ($this->source['ecs_uid']) {
146 $this->uid_hash = ilUtil::stripSlashes(urldecode($this->source['ecs_uid']));
147 }
148 }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

References ILIAS\UI\examples\Symbol\Glyph\Login\login(), and ilUtil\stripSlashes().

Referenced by __construct().

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

◆ loadFromObject()

ilECSUser::loadFromObject ( )

load from object

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

117 : void
118 {
119 $this->login = $this->source->getLogin();
120 $this->firstname = $this->source->getFirstname();
121 $this->lastname = $this->source->getLastname();
122 $this->email = $this->source->getEmail();
123 $this->institution = $this->source->getInstitution();
124 if ($this->source instanceof ilObjUser) {
125 $this->external_account = $this->source->getExternalAccount();
126 $this->auth_mode = $this->source->getAuthMode();
127 }
128 $this->uid_hash = 'il_' . $this->setting->get('inst_id', "0") . '_usr_' . $this->source->getId();
129 }
User class.

References ILIAS\UI\examples\Symbol\Glyph\Login\login().

Referenced by __construct().

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

◆ toGET()

ilECSUser::toGET ( ilECSParticipantSetting  $setting)

get GET parameter string

Definition at line 158 of file class.ilECSUser.php.

158 : string
159 {
160 $login = '';
161 $external_account_info = '';
162
163 // check for external auth mode
164 $external_auth_modes = $setting->getOutgoingExternalAuthModes();
165 if (in_array($this->auth_mode, $external_auth_modes)) {
166 $placeholder = $setting->getOutgoingUsernamePlaceholderByAuthMode($this->auth_mode);
167 if (stripos($placeholder, ilECSParticipantSetting::LOGIN_PLACEHOLDER) !== false) {
168 $login = str_replace(
170 $this->getLogin(),
171 $placeholder
172 );
173 }
174 if (stripos($placeholder, ilECSParticipantSetting::EXTERNAL_ACCOUNT_PLACEHOLDER) !== false) {
175 $login = str_replace(
177 $this->getExternalAccount(),
178 $placeholder
179 );
180 }
181 $external_account_info = '&ecs_external_account=1';
182 } else {
183 $login = $this->getLogin();
184 }
185 return '&ecs_login=' . urlencode((string) $login) .
186 '&ecs_firstname=' . urlencode($this->firstname) .
187 '&ecs_lastname=' . urlencode($this->lastname) .
188 '&ecs_email=' . urlencode($this->email) .
189 '&ecs_institution=' . urlencode($this->institution) .
190 '&ecs_uid_hash=' . urlencode($this->uid_hash) .
191 $external_account_info;
192 }
getLogin()
get login
ilSetting $setting

References $login, $setting, ilECSParticipantSetting\EXTERNAL_ACCOUNT_PLACEHOLDER, getExternalAccount(), getLogin(), and ilECSParticipantSetting\LOGIN_PLACEHOLDER.

+ Here is the call graph for this function:

◆ toJSON()

ilECSUser::toJSON ( )

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

150 : string
151 {
152 return urlencode(json_encode($this, JSON_THROW_ON_ERROR));
153 }

◆ toREALM()

ilECSUser::toREALM ( )

Concatenate all attributes to one string.

Definition at line 197 of file class.ilECSUser.php.

197 : string
198 {
199 return
200 $this->login .
201 $this->firstname .
202 $this->lastname .
203 $this->email .
204 $this->institution .
206 }

References $uid_hash, and ILIAS\UI\examples\Symbol\Glyph\Login\login().

+ Here is the call graph for this function:

Field Documentation

◆ $auth_mode

string ilECSUser::$auth_mode = ''
protected

Definition at line 40 of file class.ilECSUser.php.

◆ $email

string ilECSUser::$email

Definition at line 33 of file class.ilECSUser.php.

Referenced by getEmail().

◆ $external_account

string ilECSUser::$external_account = ''
protected

Definition at line 39 of file class.ilECSUser.php.

Referenced by getExternalAccount().

◆ $firstname

string ilECSUser::$firstname

Definition at line 34 of file class.ilECSUser.php.

Referenced by getFirstname().

◆ $institution

string ilECSUser::$institution

Definition at line 36 of file class.ilECSUser.php.

Referenced by getInstitution().

◆ $lastname

string ilECSUser::$lastname

Definition at line 35 of file class.ilECSUser.php.

Referenced by getLastname().

◆ $login

string ilECSUser::$login

Definition at line 32 of file class.ilECSUser.php.

Referenced by getLogin(), and toGET().

◆ $setting

ilSetting ilECSUser::$setting
private

Definition at line 27 of file class.ilECSUser.php.

Referenced by toGET().

◆ $source

ilECSUser::$source
private

Definition at line 30 of file class.ilECSUser.php.

◆ $uid_hash

string ilECSUser::$uid_hash

Definition at line 37 of file class.ilECSUser.php.

Referenced by getImportId(), and toREALM().


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