ILIAS  release_4-4 Revision
ilECSUser Class Reference

Stores relevant user data. More...

+ Collaboration diagram for ilECSUser:

Public Member Functions

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

Data Fields

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

Protected Attributes

 $source
 

Detailed Description

Stores relevant user data.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilECSUser::__construct (   $a_data)

Constructor.

Parameters
mixedilObjUser or encoded json string public

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

References loadFromGET(), loadFromJSON(), and loadFromObject().

53  {
54  $this->source = $a_data;
55  if(is_object($a_data))
56  {
57  $this->loadFromObject();
58  }
59  elseif(is_array($a_data))
60  {
61  $this->loadFromGET();
62  }
63  else
64  {
65  $this->loadFromJSON();
66  }
67  }
loadFromJSON()
load from json
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

public

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

References $email.

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

107  {
108  return $this->email;
109  }
+ Here is the caller graph for this function:

◆ getFirstname()

ilECSUser::getFirstname ( )

get firstname

public

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

References $firstname.

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

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

◆ getImportId()

ilECSUser::getImportId ( )

get Email

public

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

References $uid_hash.

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

128  {
129  return $this->uid_hash;
130  }
+ Here is the caller graph for this function:

◆ getInstitution()

ilECSUser::getInstitution ( )

get institution

public

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

References $institution.

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

117  {
118  return $this->institution;
119  }
+ Here is the caller graph for this function:

◆ getLastname()

ilECSUser::getLastname ( )

getLastname

public

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

References $lastname.

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

97  {
98  return $this->lastname;
99  }
+ Here is the caller graph for this function:

◆ getLogin()

ilECSUser::getLogin ( )

get login

public

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

References $login.

Referenced by ilAuthContainerECS\createUser().

76  {
77  return $this->login;
78  }
+ Here is the caller graph for this function:

◆ loadFromGET()

ilECSUser::loadFromGET ( )

load user data from GET parameters

public

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

References $_GET, and ilUtil\stripSlashes().

Referenced by __construct().

178  {
179  $this->login = ilUtil::stripSlashes(urldecode($_GET['ecs_login']));
180  $this->firstname = ilUtil::stripSlashes(urldecode($_GET['ecs_firstname']));
181  $this->lastname = ilUtil::stripSlashes(urldecode($_GET['ecs_lastname']));
182  $this->email = ilUtil::stripSlashes(urldecode($_GET['ecs_email']));
183  $this->institution = ilUtil::stripSlashes(urldecode($_GET['ecs_institution']));
184  $this->uid_hash = ilUtil::stripSlashes(urldecode($_GET['ecs_uid_hash']));
185  }
$_GET["client_id"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadFromJSON()

ilECSUser::loadFromJSON ( )

load from json

public

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

Referenced by __construct().

158  {
159  $this->source = json_decode(urldecode($this->source));
160 
161  $this->login = $this->source->login();
162  $this->firstname = $this->source->firstname();
163  $this->lastname = $this->source->lastname();
164  $this->email = $this->source->email();
165  $this->institution = $this->source->institution();
166 
167  $this->uid_hash = $this->source->uid_hash;
168 
169  }
+ Here is the caller graph for this function:

◆ loadFromObject()

ilECSUser::loadFromObject ( )

load from object

public

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

References $ilSetting.

Referenced by __construct().

139  {
140  global $ilSetting;
141 
142  $this->login = $this->source->getLogin();
143  $this->firstname = $this->source->getFirstname();
144  $this->lastname = $this->source->getLastname();
145  $this->email = $this->source->getEmail();
146  $this->institution = $this->source->getInstitution();
147 
148  $this->uid_hash = 'il_'.$ilSetting->get('inst_id',0).'_usr_'.$this->source->getId();
149  }
global $ilSetting
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ toGET()

ilECSUser::toGET ( )

get GET parameter string

public

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

206  {
207  return '&ecs_login='.urlencode((string) $this->login).
208  '&ecs_firstname='.urlencode((string) $this->firstname).
209  '&ecs_lastname='.urlencode((string) $this->lastname).
210  '&ecs_email='.urlencode((string) $this->email).
211  '&ecs_institution='.urlencode((string) $this->institution).
212  '&ecs_uid_hash='.urlencode((string) $this->uid_hash);
213  }

◆ toJSON()

ilECSUser::toJSON ( )

public

Parameters

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

195  {
196  return urlencode(json_encode($this));
197  }

◆ toREALM()

ilECSUser::toREALM ( )

Concatenate all attributes to one string.

Returns
string

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

220  {
221  return
222  (string) $this->login.''.
223  (string) $this->firstname.''.
224  (string) $this->lastname.''.
225  (string) $this->email.''.
226  (string) $this->institution.''.
227  (string) $this->uid_hash;
228  }

Field Documentation

◆ $email

ilECSUser::$email

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

Referenced by getEmail().

◆ $firstname

ilECSUser::$firstname

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

Referenced by getFirstname().

◆ $institution

ilECSUser::$institution

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

Referenced by getInstitution().

◆ $lastname

ilECSUser::$lastname

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

Referenced by getLastname().

◆ $login

ilECSUser::$login

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

Referenced by getLogin().

◆ $source

ilECSUser::$source
protected

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

◆ $uid_hash

ilECSUser::$uid_hash

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

Referenced by getImportId().


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