ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 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.

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

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  }
global $DIC
Definition: shib_login.php:22
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 95 of file class.ilECSUser.php.

References $email.

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

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

◆ getExternalAccount()

ilECSUser::getExternalAccount ( )

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

References $external_account.

Referenced by toGET().

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

◆ getFirstname()

ilECSUser::getFirstname ( )

get firstname

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

References $firstname.

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

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

◆ getImportId()

ilECSUser::getImportId ( )

get Email

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

References $uid_hash.

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

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

◆ getInstitution()

ilECSUser::getInstitution ( )

get institution

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

References $institution.

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

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

◆ getLastname()

ilECSUser::getLastname ( )

getLastname

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

References $lastname.

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

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

◆ getLogin()

ilECSUser::getLogin ( )

get login

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

References $login.

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

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

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

Referenced by __construct().

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 ($this->source['ecs_uid_hash']) {
145  $this->uid_hash = ilUtil::stripSlashes(urldecode($this->source['ecs_uid_hash']));
146  } elseif ($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="")
login()
description: > Example for rendring a login glyph.
Definition: login.php:41
+ 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.

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

Referenced by __construct().

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  }
login()
description: > Example for rendring a login glyph.
Definition: login.php:41
+ 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.

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

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

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

198  : string
199  {
200  return
201  $this->login .
202  $this->firstname .
203  $this->lastname .
204  $this->email .
205  $this->institution .
207  }
string $uid_hash
login()
description: > Example for rendring a login glyph.
Definition: login.php:41
+ 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().

◆ $setting

ilSetting ilECSUser::$setting
private

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

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