ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
shibUser Class Reference

Class shibUser. More...

+ Inheritance diagram for shibUser:
+ Collaboration diagram for shibUser:

Public Member Functions

 updateFields ()
 
 createFields ()
 
 create ()
 
 isNew ()
 
- Public Member Functions inherited from ilObjUser
 __construct (int $a_user_id=0, bool $a_call_by_reference=false)
 
 read ()
 
 saveAsNew ()
 
 update ()
 
 resetPassword (string $new_raw_password)
 
 getLastHistoryData ()
 
 updateLogin (string $login)
 
 writePref (string $keyword, string $value)
 
 deletePref (string $keyword)
 
 writePrefs ()
 
 getTimeZone ()
 
 getTimeFormat ()
 
 getDateFormat ()
 
 getDateTimeFormat ()
 
 setPref (string $a_keyword, ?string $a_value)
 
 getPref (string $a_keyword)
 
 getPrefs ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 withProfileData (Data $profile_data)
 
 getProfileData ()
 
 setLogin (string $login)
 
 getLogin ()
 
 setGender (string $gender_string)
 
 getGender ()
 
 setUTitle (string $user_title)
 This sets the USER's title NOT the OBJECT's title! More...
 
 getUTitle ()
 
 setFirstname (string $firstname)
 
 getFirstname ()
 
 setLastname (string $lastname)
 
 getLastname ()
 
 setBirthday (?string $birthday)
 
 getBirthday ()
 
 setInstitution (string $instituion)
 
 getInstitution ()
 
 setDepartment (string $department)
 
 getDepartment ()
 
 setStreet (string $street)
 
 getStreet ()
 
 setCity (string $city)
 
 getCity ()
 
 setZipcode (string $zipcode)
 
 getZipcode ()
 
 setCountry (string $country)
 
 getCountry ()
 
 setPhoneOffice (string $phone)
 
 getPhoneOffice ()
 
 setPhoneHome (string $phone)
 
 getPhoneHome ()
 
 setPhoneMobile (string $phone)
 
 getPhoneMobile ()
 
 setFax (string $fax)
 
 getFax ()
 
 setMatriculation (string $matriculation)
 
 getMatriculation ()
 
 setEmail (string $email)
 
 getEmail ()
 
 setSecondEmail (?string $email)
 
 getSecondEmail ()
 
 setHobby (string $hobby)
 
 getHobby ()
 
 setComment (string $referral_comment)
 
 getComment ()
 
 setLatitude (?string $latitude)
 
 getLatitude ()
 
 setLongitude (?string $longitude)
 
 getLongitude ()
 
 setLocationZoom (?int $zoom)
 
 getLocationZoom ()
 
 getAvatarRid ()
 
 setAvatarRid (?ResourceIdentification $avatar_rid)
 
 setClientIP (string $a_str)
 
 getClientIP ()
 
 setLanguage (string $language)
 
 getLanguage ()
 
 getPasswordEncodingType ()
 
 setPasswordEncodingType (?string $password_encryption_type)
 
 getPasswordSalt ()
 
 setPasswordSalt (?string $password_salt)
 
 setFullname ()
 
 getFullname (int $max_strlen=0)
 
 setPasswd (string $a_str, string $a_type=ilObjUser::PASSWD_PLAIN)
 
 getPasswd ()
 
 getPasswdType ()
 
 setLastPasswordChangeTS (int $a_last_password_change_ts)
 
 getLastPasswordChangeTS ()
 
 getPasswordPolicyResetStatus ()
 
 setPasswordPolicyResetStatus (bool $status)
 
 getCurrentLanguage ()
 returns the current language (may differ from user's pref setting!) More...
 
 setCurrentLanguage (string $language)
 Set current language. More...
 
 setLastLogin (string $a_str)
 
 getLastLogin ()
 
 refreshLogin ()
 
 setFirstLogin (string $date)
 
 getFirstLogin ()
 
 setLastProfilePrompt (string $date)
 
 getLastProfilePrompt ()
 
 setLastUpdate (string $date)
 
 getLastUpdate ()
 
 setApproveDate (?string $a_str)
 set date the user account was activated null indicates that the user has not yet been activated More...
 
 getApproveDate ()
 
 getAgreeDate ()
 
 setAgreeDate (?string $date)
 
 setActive (bool $active, int $owner=0)
 set user active state and updates system fields appropriately More...
 
 getActive ()
 
 getSkin ()
 
 setTimeLimitOwner (int $a_owner)
 
 getTimeLimitOwner ()
 
 setTimeLimitFrom (?int $a_from)
 
 getTimeLimitFrom ()
 
 setTimeLimitUntil (?int $a_until)
 
 getTimeLimitUntil ()
 
 setTimeLimitUnlimited (bool $unlimited)
 
 getTimeLimitUnlimited ()
 
 setLoginAttempts (int $a_login_attempts)
 
 getLoginAttempts ()
 
 checkTimeLimit ()
 
 setProfileIncomplete (bool $a_prof_inc)
 
 getProfileIncomplete ()
 
 isPasswordChangeDemanded ()
 
 isPasswordExpired ()
 
 getPasswordAge ()
 
 setLastPasswordChangeToNow ()
 
 resetLastPasswordChange ()
 
 setAuthMode (?string $a_str)
 
 getAuthMode (bool $a_auth_key=false)
 
 setExternalAccount (string $a_str)
 
 getExternalAccount ()
 
 addObjectToClipboard (int $a_item_id, string $a_type, string $a_title, int $a_parent=0, string $a_time='', int $a_order_nr=0)
 add an item to user's personal clipboard More...
 
 addToPCClipboard (string $a_content, string $a_time, int $a_nr)
 Add a page content item to PC clipboard (should go to another class) More...
 
 getPCClipboardContent ()
 Add a page content item to PC clipboard (should go to another class) More...
 
 clipboardHasObjectsOfType (string $a_type)
 Check whether clipboard has objects of a certain type. More...
 
 clipboardDeleteObjectsOfType (string $a_type)
 
 clipboardDeleteAll ()
 
 getClipboardObjects (string $a_type='', bool $a_top_nodes_only=false)
 get all clipboard objects of user and specified type More...
 
 getClipboardChilds (int $a_parent, string $a_insert_time)
 Get children of an item. More...
 
 removeObjectFromClipboard (int $a_item_id, string $a_type)
 
 getOrgUnitsRepresentation ()
 
 getPersonalPicturePath (string $a_size='small', bool $a_force_pic=false)
 
 hasProfilePicture ()
 
 getAvatar ()
 
 removeUserPicture ()
 
 getProfileAsString (Language $language)
 Get formatted mail body text of user profile data. More...
 
 setFeedPass (string $a_password)
 
 hasPublicProfile ()
 
 getPublicName ()
 
 resetOwner ()
 
 getPersonalDataExportFile ()
 
 sendPersonalDataFile ()
 
 importPersonalData (array $a_file, bool $a_profile_data, bool $a_settings, bool $a_notes, bool $a_calendar)
 
 setInactivationDate (?string $inactivation_date)
 
 getInactivationDate ()
 
 isAnonymous ()
 
 activateDeletionFlag ()
 
 removeDeletionFlag ()
 
 hasDeletionFlag ()
 
 setIsSelfRegistered (bool $status)
 
 isSelfRegistered ()
 
 setGeneralInterests (?array $value=null)
 
 getGeneralInterests ()
 
 getGeneralInterestsAsText ()
 Get general interests as plain text. More...
 
 setOfferingHelp (?array $value=null)
 
 getOfferingHelp ()
 
 getOfferingHelpAsText ()
 Get help offering as plain text. More...
 
 setLookingForHelp (?array $value=null)
 
 getLookingForHelp ()
 
 getLookingForHelpAsText ()
 
 uploadPersonalPicture (string $tmp_file)
 
 generateRegistrationHash ()
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id, int $new_obj_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static buildInstance (shibServerData $shibServerData)
 
- Static Public Member Functions inherited from ilObjUser
static _isAnonymous (int $usr_id)
 
static _loginExists (string $a_login, int $a_user_id=0)
 
static _externalAccountExists (string $a_external_account, string $a_auth_mode)
 
static _getUsersForRole (int $role_id, int $active=-1)
 
static _getUsersForFolder (int $ref_id, int $active)
 
static _getUsersForGroup (array $a_mem_ids, int $active=-1)
 
static _getUsersForIds (array $a_mem_ids, int $active=-1, int $timelimitowner=-1)
 
static _getUserData (array $a_internalids)
 
static _getPreferences (int $user_id)
 
static getUserSubsetByPreferenceValue (array $a_user_ids, string $a_keyword, string $a_val)
 
static _getLoginAttempts (int $a_usr_id)
 
static _incrementLoginAttempts (int $a_usr_id)
 
static _setUserInactive (int $a_usr_id)
 
static _getUsersOnline (int $a_user_id=0, bool $a_no_anonymous=false)
 
static _verifyRegistrationHash (string $a_hash)
 
static getUserIdsByInactivityPeriod (int $periodInDays)
 
static getUserIdsNeverLoggedIn (int $thresholdInDays)
 
static _getUserIdsByInactivationPeriod (int $period)
 
static getFirstLettersOfLastnames (?array $user_ids=null)
 
static userExists (array $a_usr_ids=[])
 
static _doesLoginnameExistInHistory (string $a_login)
 
static _lookupPref (int $a_usr_id, string $a_keyword)
 
static lookupMatriculation (int $a_usr_id)
 
static findInterests (string $a_term, ?int $a_user_id=null, ?string $a_field_id=null)
 
static getProfileStatusOfUsers (array $a_user_ids)
 
static _lookupFullname (int $a_user_id)
 
static _lookupEmail (int $a_user_id)
 
static _lookupGender (int $a_user_id)
 
static _lookupClientIP (int $a_user_id)
 
static _lookupName (int $a_user_id)
 
static _lookupLanguage (int $a_usr_id)
 
static _writeExternalAccount (int $a_usr_id, string $a_ext_id)
 
static _writeAuthMode (int $a_usr_id, string $a_auth_mode)
 
static _lookupFields (int $a_user_id)
 
static _lookupActive (int $a_usr_id)
 
static _lookupLogin (int $a_user_id)
 
static _lookupExternalAccount (int $a_user_id)
 
static _getExternalAccountsByAuthMode (string $a_auth_mode, bool $a_read_auth_default=false)
 Get list of external account by authentication method Note: If login == ext_account for two user with auth_mode 'default' and auth_mode 'ldap' The ldap auth mode chosen. More...
 
static _toggleActiveStatusOfUsers (array $a_usr_ids, bool $a_status)
 
static _lookupAuthMode (int $a_usr_id)
 
static _checkExternalAuthAccount (string $a_auth, string $a_account, bool $tryFallback=true)
 check whether external account and authentication method matches with a user More...
 
static getUserIdByLogin (string $a_login)
 
static getUserIdsByEmail (string $a_email)
 
static getUserLoginsByEmail (string $a_email)
 
static _lookupId (string|array $a_user_str)
 
static _lookupLastLogin (int $a_user_id)
 
static _lookupFirstLogin (int $a_user_id)
 
static hasActiveSession (int $a_user_id, string $a_session_id)
 
static _readUsersProfileData (array $a_user_ids)
 
static _getNumberOfUsersForStyle (string $a_skin, string $a_style)
 
static _getAllUserAssignedStyles ()
 
static _getNumberOfUsersPerAuthMode ()
 get number of users per auth mode More...
 
static _getLocalAccountsForEmail (string $a_email)
 
static _moveUsersToStyle (string $a_from_skin, string $a_from_style, string $a_to_skin, string $a_to_style)
 
static _getUsersForClipboadObject (string $a_type, int $a_id)
 
static _getImportedUserId (string $i2_id)
 
static lookupOrgUnitsRepresentation (int $a_usr_id)
 
static _getAvatar (int $a_usr_id)
 
static _getPersonalPicturePath (int $a_usr_id, string $a_size='small', bool $a_force_pic=false)
 
static copyProfilePicturesToDirectory (int $a_user_id, string $a_dir)
 
static _lookupFeedHash (int $a_user_id, bool $a_create=false)
 
static _getFeedPass (int $a_user_id)
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", ?int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static getIconForType (string $type)
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, ?\ilDBInterface $ilDB=null)
 

Protected Member Functions

 returnNewLoginName ()
 
 cleanName (string $name)
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Static Protected Member Functions

static getUsrIdByExtId (string $ext_id)
 

Protected Attributes

shibServerData $shibServerData
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
LOMServices $lom_services
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Private Member Functions

 loginExists (string $login, int $usr_id)
 

Additional Inherited Members

- Data Fields inherited from ilObjUser
const PASSWD_PLAIN = 'plain'
 
const PASSWD_CRYPTED = 'crypted'
 
const DATABASE_DATE_FORMAT = 'Y-m-d H:i:s'
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 

Detailed Description

Class shibUser.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 26 of file class.shibUser.php.

Member Function Documentation

◆ buildInstance()

static shibUser::buildInstance ( shibServerData  $shibServerData)
static
Exceptions
ilObjectNotFoundException
ilObjectTypeMismatchException
ilSystemStyleException

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

35 : shibUser
36 {
37 $shib_user = new self();
38 $shib_user->setLastPasswordChangeToNow();
39 $shib_user->shibServerData = $shibServerData;
40 $ext_id = $shib_user->shibServerData->getLogin();
41 $shib_user->setExternalAccount($ext_id);
42 $existing_usr_id = self::getUsrIdByExtId($ext_id);
43 if ($existing_usr_id !== null) {
44 $shib_user->setId($existing_usr_id);
45 $shib_user->read();
46 }
47 $shib_user->setAuthMode('shibboleth');
48
49 return $shib_user;
50 }
setLastPasswordChangeToNow()
Class shibUser.
static getUsrIdByExtId(string $ext_id)
shibServerData $shibServerData

References $shibServerData, shibConfig\getLogin(), getUsrIdByExtId(), and ilObjUser\setLastPasswordChangeToNow().

Referenced by ilAuthProviderShibboleth\doAuthentication().

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

◆ cleanName()

shibUser::cleanName ( string  $name)
protected

Definition at line 185 of file class.shibUser.php.

185 : string
186 {
187 $umlaut_map = [
188 'ä' => 'ae', 'ö' => 'oe', 'ü' => 'ue',
189 'Ä' => 'Ae', 'Ö' => 'Oe', 'Ü' => 'Ue',
190 'ß' => 'ss'
191 ];
192 $name = strtr($name, $umlaut_map);
193
194 $form_d = new UTFNormal();
195 $name = $form_d->formD()->transform($name);
196 $name = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', (string) $name);
197
198 return strtolower((string) preg_replace('/[^a-zA-Z0-9\s]/', '', $name));
199 }

Referenced by returnNewLoginName().

+ Here is the caller graph for this function:

◆ create()

shibUser::create ( )
Exceptions
ilUserException

Reimplemented from ilObject.

Definition at line 144 of file class.shibUser.php.

144 : int
145 {
147 $registration_settings = new ilRegistrationSettings();
148 $recipients = array_filter($registration_settings->getApproveRecipients(), static fn($v): bool => is_int($v));
149 if ($recipients !== [] && $c->isActivateNew()) {
150 $this->setActive(false);
151 $mail = new ilRegistrationMailNotification();
153 $mail->setRecipients($registration_settings->getApproveRecipients());
154 $mail->setAdditionalInformation(['usr' => $this]);
155 $mail->send();
156 }
157
158 if ($this->getLogin() !== '' && $this->getLogin() !== '.') {
159 return parent::create();
160 }
161
162 throw new ilUserException('No Login-name created');
163 }
setActive(bool $active, int $owner=0)
set user active state and updates system fields appropriately
Class ilObjAuthSettingsGUI.
static getInstance()
$c
Definition: deliver.php:25

References $c, shibConfig\getInstance(), ilObjUser\getLogin(), ilObjUser\setActive(), and ilRegistrationMailNotification\TYPE_NOTIFICATION_CONFIRMATION.

+ Here is the call graph for this function:

◆ createFields()

shibUser::createFields ( )

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

109 : void
110 {
111 $this->setFirstname($this->shibServerData->getFirstname());
112 $this->setLastname($this->shibServerData->getLastname());
113 $this->setLogin($this->returnNewLoginName());
115 $this->setPasswd(md5((string) end($array)), ilObjUser::PASSWD_CRYPTED);
116 $this->setGender($this->shibServerData->getGender());
118 $this->setUTitle($this->shibServerData->getTitle());
121 $this->setStreet($this->shibServerData->getStreet());
122 $this->setZipcode($this->shibServerData->getZipcode());
123 $this->setCountry($this->shibServerData->getCountry());
125 $this->setPhoneHome($this->shibServerData->getPhoneHome());
127 $this->setFax($this->shibServerData->getFax());
129 $this->setEmail($this->shibServerData->getEmail());
130 $this->setHobby($this->shibServerData->getHobby());
131 $this->setTitle($this->getFullname());
132 $this->setDescription($this->getEmail());
133 $this->setLanguage($this->shibServerData->getLanguage());
134 $this->setTimeLimitUnlimited(true);
135 $this->setTimeLimitFrom(time());
136 $this->setTimeLimitUntil(time());
137 $this->setActive(true);
138 }
setGender(string $gender_string)
setPhoneMobile(string $phone)
setLanguage(string $language)
setLogin(string $login)
setStreet(string $street)
setEmail(string $email)
setTimeLimitUntil(?int $a_until)
setTimeLimitFrom(?int $a_from)
setPhoneHome(string $phone)
const PASSWD_CRYPTED
getFullname(int $max_strlen=0)
setHobby(string $hobby)
setFax(string $fax)
setMatriculation(string $matriculation)
setPasswd(string $a_str, string $a_type=ilObjUser::PASSWD_PLAIN)
setZipcode(string $zipcode)
setLastname(string $lastname)
setCountry(string $country)
setDepartment(string $department)
setPhoneOffice(string $phone)
setExternalAccount(string $a_str)
setTimeLimitUnlimited(bool $unlimited)
setInstitution(string $instituion)
setFirstname(string $firstname)
setUTitle(string $user_title)
This sets the USER's title NOT the OBJECT's title!
setTitle(string $title)
setDescription(string $description)
static generatePasswords(int $a_number)
Generate a number of passwords.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilSecuritySettingsChecker\generatePasswords(), shibConfig\getCountry(), shibConfig\getDepartment(), shibConfig\getEmail(), ilObjUser\getEmail(), shibConfig\getFax(), shibConfig\getFirstname(), ilObjUser\getFullname(), shibConfig\getGender(), shibConfig\getHobby(), shibConfig\getInstitution(), shibConfig\getLanguage(), shibConfig\getLastname(), shibConfig\getLogin(), shibConfig\getMatriculation(), shibConfig\getPhoneHome(), shibConfig\getPhoneMobile(), shibConfig\getPhoneOffice(), shibConfig\getStreet(), shibConfig\getTitle(), shibConfig\getZipcode(), ilObjUser\PASSWD_CRYPTED, returnNewLoginName(), ilObjUser\setActive(), ilObjUser\setCountry(), ilObjUser\setDepartment(), ilObject\setDescription(), ilObjUser\setEmail(), ilObjUser\setExternalAccount(), ilObjUser\setFax(), ilObjUser\setFirstname(), ilObjUser\setGender(), ilObjUser\setHobby(), ilObjUser\setInstitution(), ilObjUser\setLanguage(), ilObjUser\setLastname(), ilObjUser\setLogin(), ilObjUser\setMatriculation(), ilObjUser\setPasswd(), ilObjUser\setPhoneHome(), ilObjUser\setPhoneMobile(), ilObjUser\setPhoneOffice(), ilObjUser\setStreet(), ilObjUser\setTimeLimitFrom(), ilObjUser\setTimeLimitUnlimited(), ilObjUser\setTimeLimitUntil(), ilObject\setTitle(), ilObjUser\setUTitle(), and ilObjUser\setZipcode().

+ Here is the call graph for this function:

◆ getUsrIdByExtId()

static shibUser::getUsrIdByExtId ( string  $ext_id)
staticprotected

Definition at line 213 of file class.shibUser.php.

213 : ?int
214 {
215 global $DIC;
216
217 $db = $DIC->database();
218
219 $query = 'SELECT usr_id FROM usr_data WHERE ext_account = ' . $db->quote($ext_id, 'text');
220 $a_set = $db->query($query);
221 if ($db->numRows($a_set) === 0) {
222 return null;
223 }
224
225 $usr = $db->fetchObject($a_set);
226
227 return ($usr !== null && isset($usr->usr_id)) ? (int) $usr->usr_id : null;
228 }
ilDBInterface $db
fetchObject(ilDBStatement $query_result)
numRows(ilDBStatement $statement)
quote($value, string $type)
query(string $query)
Run a (read-only) Query on the database.
global $DIC
Definition: shib_login.php:26

References ilObject\$db, $DIC, ilDBInterface\fetchObject(), ILIAS\Repository\int(), ilDBInterface\numRows(), ilDBInterface\query(), and ilDBInterface\quote().

Referenced by buildInstance().

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

◆ isNew()

shibUser::isNew ( )

Definition at line 180 of file class.shibUser.php.

180 : bool
181 {
182 return $this->getId() === 0;
183 }

References ilObject\getId().

+ Here is the call graph for this function:

◆ loginExists()

shibUser::loginExists ( string  $login,
int  $usr_id 
)
private

Definition at line 201 of file class.shibUser.php.

201 : bool
202 {
203 global $DIC;
204
205 $db = $DIC->database();
206
207 $query = 'SELECT usr_id FROM usr_data WHERE login = ' . $db->quote($login, 'text');
208 $query .= ' AND usr_id != ' . $db->quote($usr_id, 'integer');
209
210 return $db->numRows($db->query($query)) > 0;
211 }

References ilObject\$db, $DIC, ilDBInterface\numRows(), ilDBInterface\query(), and ilDBInterface\quote().

Referenced by returnNewLoginName().

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

◆ returnNewLoginName()

shibUser::returnNewLoginName ( )
protected

Definition at line 165 of file class.shibUser.php.

165 : ?string
166 {
167 $login = substr($this->cleanName($this->getFirstname()), 0, 1) . '.' . $this->cleanName($this->getLastname());
168 //remove whitespaces see mantis 0023123: https://www.ilias.de/mantis/view.php?id=23123
169 $login = preg_replace('/\s+/', '', $login);
170 $appendix = null;
171 $login_tmp = $login;
172 while ($this->loginExists($login, $this->getId())) {
173 $login = $login_tmp . $appendix;
174 $appendix++;
175 }
176
177 return $login;
178 }
loginExists(string $login, int $usr_id)
cleanName(string $name)

References cleanName(), ilObjUser\getFirstname(), ilObject\getId(), ilObjUser\getLastname(), and loginExists().

Referenced by createFields().

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

◆ updateFields()

shibUser::updateFields ( )

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

52 : void
53 {
54 $shibConfig = shibConfig::getInstance();
55 if ($shibConfig->getUpdateFirstname()) {
57 }
58 if ($shibConfig->getUpdateLastname()) {
59 $this->setLastname($this->shibServerData->getLastname());
60 }
61 if ($shibConfig->getUpdateGender()) {
62 $this->setGender($this->shibServerData->getGender());
63 }
64 if ($shibConfig->getUpdateTitle()) {
65 $this->setUTitle($this->shibServerData->getTitle());
66 }
67 if ($shibConfig->getUpdateInstitution()) {
69 }
70 if ($shibConfig->getUpdateDepartment()) {
72 }
73 if ($shibConfig->getUpdateStreet()) {
74 $this->setStreet($this->shibServerData->getStreet());
75 }
76 if ($shibConfig->getUpdateZipcode()) {
77 $this->setZipcode($this->shibServerData->getZipcode());
78 }
79 if ($shibConfig->getUpdateCountry()) {
80 $this->setCountry($this->shibServerData->getCountry());
81 }
82 if ($shibConfig->getUpdatePhoneOffice()) {
84 }
85 if ($shibConfig->getUpdatePhoneHome()) {
87 }
88 if ($shibConfig->getUpdatePhoneMobile()) {
90 }
91 if ($shibConfig->getUpdateFax()) {
92 $this->setFax($this->shibServerData->getFax());
93 }
94 if ($shibConfig->getUpdateMatriculation()) {
96 }
97 if ($shibConfig->getUpdateEmail()) {
98 $this->setEmail($this->shibServerData->getEmail());
99 }
100 if ($shibConfig->getUpdateHobby()) {
101 $this->setHobby($this->shibServerData->getHobby());
102 }
103 if ($shibConfig->getUpdateLanguage()) {
104 $this->setLanguage($this->shibServerData->getLanguage());
105 }
106 $this->setDescription($this->getEmail());
107 }

References shibConfig\getCountry(), shibConfig\getDepartment(), shibConfig\getEmail(), ilObjUser\getEmail(), shibConfig\getFax(), shibConfig\getFirstname(), shibConfig\getGender(), shibConfig\getHobby(), shibConfig\getInstance(), shibConfig\getInstitution(), shibConfig\getLanguage(), shibConfig\getLastname(), shibConfig\getMatriculation(), shibConfig\getPhoneHome(), shibConfig\getPhoneMobile(), shibConfig\getPhoneOffice(), shibConfig\getStreet(), shibConfig\getTitle(), shibConfig\getZipcode(), ilObjUser\setCountry(), ilObjUser\setDepartment(), ilObject\setDescription(), ilObjUser\setEmail(), ilObjUser\setFax(), ilObjUser\setFirstname(), ilObjUser\setGender(), ilObjUser\setHobby(), ilObjUser\setInstitution(), ilObjUser\setLanguage(), ilObjUser\setLastname(), ilObjUser\setMatriculation(), ilObjUser\setPhoneHome(), ilObjUser\setPhoneMobile(), ilObjUser\setPhoneOffice(), ilObjUser\setStreet(), ilObjUser\setUTitle(), and ilObjUser\setZipcode().

+ Here is the call graph for this function:

Field Documentation

◆ $shibServerData

shibServerData shibUser::$shibServerData
protected

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

Referenced by buildInstance().


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