ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 26 of file class.ilECSUser.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

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

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getEmail()

ilECSUser::getEmail ( )

get email

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

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

References $email.

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

+ Here is the caller graph for this function:

◆ getExternalAccount()

ilECSUser::getExternalAccount ( )

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

69 : string
70 {
72 }
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 79 of file class.ilECSUser.php.

79 : string
80 {
81 return $this->firstname;
82 }
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 110 of file class.ilECSUser.php.

110 : string
111 {
112 return $this->uid_hash;
113 }
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 102 of file class.ilECSUser.php.

102 : string
103 {
104 return $this->institution;
105 }
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 87 of file class.ilECSUser.php.

87 : string
88 {
89 return $this->lastname;
90 }
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 64 of file class.ilECSUser.php.

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

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 135 of file class.ilECSUser.php.

135 : void
136 {
137 //TODO add proper testing for get parameters
138 $this->login = ilUtil::stripSlashes(urldecode($this->source['ecs_login']));
139 $this->firstname = ilUtil::stripSlashes(urldecode($this->source['ecs_firstname']));
140 $this->lastname = ilUtil::stripSlashes(urldecode($this->source['ecs_lastname']));
141 $this->email = ilUtil::stripSlashes(urldecode($this->source['ecs_email']));
142 $this->institution = ilUtil::stripSlashes(urldecode($this->source['ecs_institution']));
143
144 if (isset($this->source['ecs_uid_hash'])) {
145 $this->uid_hash = ilUtil::stripSlashes(urldecode($this->source['ecs_uid_hash']));
146 } elseif (isset($this->source['ecs_uid'])) {
147 $this->uid_hash = ilUtil::stripSlashes(urldecode($this->source['ecs_uid']));
148 }
149 }
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 118 of file class.ilECSUser.php.

118 : void
119 {
120 $this->login = $this->source->getLogin();
121 $this->firstname = $this->source->getFirstname();
122 $this->lastname = $this->source->getLastname();
123 $this->email = $this->source->getEmail();
124 $this->institution = $this->source->getInstitution();
125 if ($this->source instanceof ilObjUser) {
126 $this->external_account = $this->source->getExternalAccount();
127 $this->auth_mode = $this->source->getAuthMode();
128 }
129 $this->uid_hash = 'il_' . $this->setting->get('inst_id', "0") . '_usr_' . $this->source->getId();
130 }
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 159 of file class.ilECSUser.php.

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

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

◆ toREALM()

ilECSUser::toREALM ( )

Concatenate all attributes to one string.

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

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

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 41 of file class.ilECSUser.php.

◆ $email

string ilECSUser::$email

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

Referenced by getEmail().

◆ $external_account

string ilECSUser::$external_account = ''
protected

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

Referenced by getExternalAccount().

◆ $firstname

string ilECSUser::$firstname

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

Referenced by getFirstname().

◆ $institution

string ilECSUser::$institution

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

Referenced by getInstitution().

◆ $lastname

string ilECSUser::$lastname

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

Referenced by getLastname().

◆ $login

string ilECSUser::$login

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

Referenced by getLogin(), and toGET().

◆ $setting

ilSetting ilECSUser::$setting
private

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

Referenced by toGET().

◆ $source

ilECSUser::$source
private

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

◆ $uid_hash

string ilECSUser::$uid_hash

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

Referenced by getImportId(), and toREALM().


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