ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

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

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  }
global $DIC
Definition: feed.php:28
loadFromObject()
load from object
loadFromGET()
load user data from GET parameters
+ 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.

References $email.

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

94  : string
95  {
96  return $this->email;
97  }
+ Here is the caller graph for this function:

◆ getExternalAccount()

ilECSUser::getExternalAccount ( )

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

References $external_account.

Referenced by toGET().

68  : string
69  {
71  }
string $external_account
+ Here is the caller graph for this function:

◆ getFirstname()

ilECSUser::getFirstname ( )

get firstname

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

References $firstname.

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

78  : string
79  {
80  return $this->firstname;
81  }
string $firstname
+ Here is the caller graph for this function:

◆ getImportId()

ilECSUser::getImportId ( )

get Email

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

References $uid_hash.

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

109  : string
110  {
111  return $this->uid_hash;
112  }
string $uid_hash
+ Here is the caller graph for this function:

◆ getInstitution()

ilECSUser::getInstitution ( )

get institution

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

References $institution.

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

101  : string
102  {
103  return $this->institution;
104  }
string $institution
+ Here is the caller graph for this function:

◆ getLastname()

ilECSUser::getLastname ( )

getLastname

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

References $lastname.

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

86  : string
87  {
88  return $this->lastname;
89  }
string $lastname
+ Here is the caller graph for this function:

◆ getLogin()

ilECSUser::getLogin ( )

get login

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

References $login.

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

63  : string
64  {
65  return $this->login;
66  }
+ 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.

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

Referenced by __construct().

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="")
+ 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.

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

Referenced by __construct().

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  }
+ 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.

References ilECSParticipantSetting\EXTERNAL_ACCOUNT_PLACEHOLDER, getExternalAccount(), getLogin(), ilECSParticipantSetting\getOutgoingExternalAuthModes(), ilECSParticipantSetting\getOutgoingUsernamePlaceholderByAuthMode(), and ilECSParticipantSetting\LOGIN_PLACEHOLDER.

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  }
getOutgoingUsernamePlaceholderByAuthMode(string $auth_mode)
getLogin()
get login
+ 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.

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

197  : string
198  {
199  return
200  $this->login .
201  $this->firstname .
202  $this->lastname .
203  $this->email .
204  $this->institution .
206  }
string $uid_hash
+ 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().

◆ $setting

ilSetting ilECSUser::$setting
private

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

◆ $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: