ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
shibUser Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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 ()
 
 getPasswordEncodingType ()
 
 setPasswordEncodingType (?string $password_encryption_type)
 
 getPasswordSalt ()
 
 setPasswordSalt (?string $password_salt)
 
 assignData (array $a_data)
 loads a record 'user' from array More...
 
 saveAsNew ()
 
 update ()
 
 writeAccepted ()
 write accept date of user agreement More...
 
 refreshLogin ()
 updates the login data of a 'user' More...
 
 resetPassword (string $raw, string $raw_retype)
 Resets the user password. More...
 
 updateLogin (string $a_login)
 update login name More...
 
 writePref (string $a_keyword, string $a_value)
 
 deletePref (string $a_keyword)
 
 writePrefs ()
 
 getTimeZone ()
 
 getTimeFormat ()
 
 getDateFormat ()
 
 getDateTimeFormat ()
 
 setPref (string $a_keyword, ?string $a_value)
 
 getPref (string $a_keyword)
 
 existsPref (string $a_keyword)
 
 readPrefs ()
 
 delete ()
 
 setFullname ()
 builds a string with title + firstname + lastname method is used to build fullname in member variable $this->fullname. More...
 
 getFullname (int $a_max_strlen=0)
 
 setLogin (string $a_str)
 
 getLogin ()
 
 setPasswd (string $a_str, string $a_type=ilObjUser::PASSWD_PLAIN)
 
 getPasswd ()
 
 getPasswdType ()
 
 setGender (string $a_str)
 
 getGender ()
 
 setUTitle (string $a_str)
 set user title (note: don't mix up this method with setTitle() that is derived from ilObject and sets the user object's title) More...
 
 getUTitle ()
 
 setFirstname (string $a_str)
 
 getFirstname ()
 
 setLastname (string $a_str)
 
 getLastname ()
 
 setInstitution (string $a_str)
 
 getInstitution ()
 
 setDepartment (string $a_str)
 
 getDepartment ()
 
 setStreet (string $a_str)
 
 getStreet ()
 
 setCity (string $a_str)
 
 getCity ()
 
 setZipcode (string $a_str)
 
 getZipcode ()
 
 setCountry (string $a_str)
 
 getCountry ()
 
 setSelectedCountry (string $a_val)
 Set selected country (selection drop down) More...
 
 getSelectedCountry ()
 Get selected country (selection drop down) More...
 
 setPhoneOffice (string $a_str)
 
 getPhoneOffice ()
 
 setPhoneHome (string $a_str)
 
 getPhoneHome ()
 
 setPhoneMobile (string $a_str)
 
 getPhoneMobile ()
 
 setFax (string $a_str)
 
 getFax ()
 
 setClientIP (string $a_str)
 
 getClientIP ()
 
 setMatriculation (string $a_str)
 
 getMatriculation ()
 
 setEmail (string $a_str)
 
 getEmail ()
 
 getSecondEmail ()
 
 setSecondEmail (?string $second_email)
 
 setHobby (string $a_str)
 
 getHobby ()
 
 setLanguage (string $a_str)
 
 getLanguage ()
 
 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 $a_val)
 Set current language. More...
 
 setLastLogin (string $a_str)
 
 getLastLogin ()
 
 setFirstLogin (string $a_str)
 
 getFirstLogin ()
 
 setLastProfilePrompt (string $a_str)
 
 getLastProfilePrompt ()
 
 setLastUpdate (string $a_str)
 
 getLastUpdate ()
 
 setComment (string $a_str)
 
 getComment ()
 
 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 $a_str)
 
 setActive (bool $a_active, int $a_owner=0)
 set user active state and updates system fields appropriately More...
 
 getActive ()
 
 syncActive ()
 synchronizes current and stored user active values for the owner value to be set correctly, this function should only be called when an admin is approving a user account More...
 
 getStoredActive (int $a_id)
 get user active state More...
 
 setSkin (string $a_str)
 
 setTimeLimitOwner (int $a_owner)
 
 getTimeLimitOwner ()
 
 setTimeLimitFrom (?int $a_from)
 
 getTimeLimitFrom ()
 
 setTimeLimitUntil (?int $a_until)
 
 getTimeLimitUntil ()
 
 setTimeLimitUnlimited (bool $a_unlimited)
 
 getTimeLimitUnlimited ()
 
 setTimeLimitMessage (string $a_time_limit_message)
 
 getTimeLimitMessage ()
 
 setLoginAttempts (int $a_login_attempts)
 
 getLoginAttempts ()
 
 checkTimeLimit ()
 
 setProfileIncomplete (bool $a_prof_inc)
 
 getProfileIncomplete ()
 
 isPasswordChangeDemanded ()
 
 isPasswordExpired ()
 
 getPasswordAge ()
 
 setLastPasswordChangeToNow ()
 
 resetLastPasswordChange ()
 
 setLatitude (?string $a_latitude)
 
 getLatitude ()
 
 setLongitude (?string $a_longitude)
 
 getLongitude ()
 
 setLocationZoom (?int $a_locationzoom)
 
 getLocationZoom ()
 
 getAvatarRid ()
 
 setAvatarRid (?string $avatar_rid)
 
 checkUserId ()
 check user id with login name More...
 
 isCurrentUserActive ()
 
 getLoginByUserId (int $a_userid)
 
 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 ()
 
 setAuthMode (?string $a_str)
 
 getAuthMode (bool $a_auth_key=false)
 
 setExternalAccount (string $a_str)
 
 getExternalAccount ()
 
 getPersonalPicturePath (string $a_size='small', bool $a_force_pic=false)
 
 hasProfilePicture ()
 
 getAvatar ()
 
 removeUserPicture (bool $a_do_update=true)
 
 setUserDefinedData (array $a_data)
 
 getUserDefinedData ()
 
 updateUserDefinedFields ()
 
 readUserDefinedFields ()
 
 deleteUserDefinedFieldEntries ()
 
 hasPublicProfile ()
 returns true if public is profile, false otherwise More...
 
 getPublicName ()
 returns firstname lastname and login if profile is public, login otherwise More...
 
 setBirthday (?string $a_birthday)
 
 getBirthday ()
 
 resetOwner ()
 
 exportPersonalData ()
 
 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 ()
 Get help looking for as plain text. More...
 
 updateMultiTextFields (bool $a_create=false)
 
- 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)
 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 _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)
 lookup user name More...
 
static _lookupFields (int $a_user_id)
 lookup fields (deprecated; use more specific methods instead) More...
 
static _lookupLogin (int $a_user_id)
 
static _lookupExternalAccount (int $a_user_id)
 
static _lookupId ($a_user_str)
 
static _lookupLastLogin (int $a_user_id)
 
static _lookupFirstLogin (int $a_user_id)
 
static _doesLoginnameExistInHistory (string $a_login)
 Checks whether the passed loginname already exists in history. More...
 
static _getLastHistoryDataByUserId (int $a_usr_id)
 Returns the last used loginname and the changedate of the passed user_id. More...
 
static _deletePref (int $a_user_id, string $a_keyword)
 
static _deleteAllPref (int $a_user_id)
 Deletes a userpref value of the user from the database. More...
 
static _writePref (int $a_usr_id, string $a_keyword, string $a_value)
 
static _lookupPref (int $a_usr_id, string $a_keyword)
 
static lookupMatriculation (int $a_usr_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 _lookupActive (int $a_usr_id)
 
static hasActiveSession (int $a_user_id, string $a_session_id)
 
static toUsernameWithoutDomain (string $a_login)
 Static function removes Microsoft domain name from username webdav related. More...
 
static getUserIdByLogin (string $a_login)
 
static getUserIdsByEmail (string $a_email)
 
static getUserLoginsByEmail (string $a_email)
 
static _readUsersProfileData (array $a_user_ids)
 
static _getAllUserData (?array $a_fields=null, int $active=-1)
 
static _getNumberOfUsersForStyle (string $a_skin, string $a_style)
 
static _getAllUserAssignedStyles ()
 
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)
 get all users, that have a certain object within their clipboard More...
 
static _getImportedUserId (string $i2_id)
 
static lookupOrgUnitsRepresentation (int $a_usr_id)
 lookup org unit representation More...
 
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 _getNumberOfUsersPerAuthMode ()
 get number of users per auth mode More...
 
static _getLocalAccountsForEmail (string $a_email)
 
static _uploadPersonalPicture (string $tmp_file, int $obj_id)
 Create a personal picture image file from a temporary image file. More...
 
static _getAvatar (int $a_usr_id)
 
static _getPersonalPicturePath (int $a_usr_id, string $a_size='small', bool $a_force_pic=false, bool $a_prevent_no_photo_image=false, bool $html_export=false)
 
static copyProfilePicturesToDirectory (int $a_user_id, string $a_dir)
 
static _lookupFeedHash (int $a_user_id, bool $a_create=false)
 Lookup news feed hash for user. More...
 
static _getFeedPass (int $a_user_id)
 Lookup news feed password for user. More...
 
static _setFeedPass (int $a_user_id, string $a_password)
 Set news feed password for user. More...
 
static _loginExists (string $a_login, int $a_user_id=0)
 check if a login name already exists You may exclude a user from the check by giving his user id as 2nd paramter More...
 
static _externalAccountExists (string $a_external_account, string $a_auth_mode)
 Check if an external account name already exists. More...
 
static _getUsersForRole (int $role_id, int $active=-1)
 return array of complete users which belong to a specific role More...
 
static _getUsersForFolder (int $ref_id, int $active)
 get users for a category or from system folder More...
 
static _getUsersForGroup (array $a_mem_ids, int $active=-1)
 return user data for group members More...
 
static _getUsersForIds (array $a_mem_ids, int $active=-1, int $timelimitowner=-1)
 return user data for given user id More...
 
static _getUserData (array $a_internalids)
 return user data for given user ids More...
 
static _getPreferences (int $user_id)
 get preferences for user More...
 
static getUserSubsetByPreferenceValue (array $a_user_ids, string $a_keyword, string $a_val)
 For a given set of user IDs return a subset that has a given user preference set. More...
 
static _getLoginAttempts (int $a_usr_id)
 
static _incrementLoginAttempts (int $a_usr_id)
 
static _setUserInactive (int $a_usr_id)
 
static _writeHistory (int $a_usr_id, string $a_login)
 
static _getUsersOnline (int $a_user_id=0, bool $a_no_anonymous=false)
 reads all active sessions from db and returns users that are online OR returns only one active user if a user_id is given More...
 
static _generateRegistrationHash (int $a_usr_id)
 Generates a unique hashcode for activating a user profile after registration. More...
 
static _verifyRegistrationHash (string $a_hash)
 Verifies a registration hash. More...
 
static getUserIdsByInactivityPeriod (int $periodInDays)
 Get ids of all users that have been inactive for at least the given period. More...
 
static getUserIdsNeverLoggedIn (int $thresholdInDays)
 Get ids of all users that have never logged in. More...
 
static _getUserIdsByInactivationPeriod (int $period)
 get ids of all users that have been inactivated since at least the given period More...
 
static getFirstLettersOfLastnames (?array $user_ids=null)
 Get first letters of all lastnames. More...
 
static userExists (array $a_usr_ids=[])
 
static _isAnonymous (int $usr_id)
 
static findInterests (string $a_term, ?int $a_user_id=null, ?string $a_field_id=null)
 
static getProfileStatusOfUsers (array $a_user_ids)
 Get profile status. More...
 
- 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 ilObjUser
 buildTextFromArray (array $a_attr)
 Convert multi-text values to plain text. More...
 
 readMultiTextFields ()
 
 deleteMultiTextFields ()
 
- 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 ilObjUser
string $ext_account = ''
 
string $time_limit_message = ''
 
bool $time_limit_unlimited = false
 
int $time_limit_until = null
 
int $time_limit_from = null
 
int $time_limit_owner = null
 
string $last_login = ''
 
string $passwd = ''
 
string $passwd_type = ''
 
string $password_encoding_type = null
 
string $password_salt = null
 
string $birthday = null
 
string $second_email = null
 
bool $passwd_policy_reset = false
 
array $oldPrefs = []
 
string $inactivation_date = null
 
string $org_units = ''
 
array $interests_general = []
 
array $interests_help_offered = []
 
array $interests_help_looking = []
 
string $last_profile_prompt = ''
 
string $first_login = ''
 
bool $profile_incomplete = false
 
string $avatar_rid = null
 
DateFormatFactory $date_format_factory
 
- 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 NO_AVATAR_RID = '-'
 
const PASSWD_PLAIN = 'plain'
 
const PASSWD_CRYPTED = 'crypted'
 
string $login = ''
 
string $gender = ''
 
string $utitle = ''
 
string $firstname = ''
 
string $lastname = ''
 
string $fullname = ''
 
string $institution = ''
 
string $department = ''
 
string $street = ''
 
string $city = ''
 
string $zipcode = ''
 
string $country = ''
 
string $sel_country = ''
 
string $phone_office = ''
 
string $phone_home = ''
 
string $phone_mobile = ''
 
string $fax = ''
 
string $email = ''
 
string $hobby = ''
 
string $matriculation = ''
 
string $referral_comment = ''
 
string $approve_date = null
 
string $agree_date = null
 
int $active = 0
 
string $client_ip = ''
 
string $auth_mode = null
 
string $latitude = null
 
string $longitude = null
 
string $loc_zoom = null
 
int $last_password_change_ts = 0
 
int $login_attempts = 0
 
array $user_defined_data = []
 
array $prefs = []
 
string $skin = ''
 
- 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
 
- Static Protected Attributes inherited from ilObjUser
static array $personal_image_cache = []
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class shibUser

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

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

Member Function Documentation

◆ buildInstance()

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

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

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

Referenced by ilAuthProviderShibboleth\doAuthentication().

32  : shibUser
33  {
34  $shib_user = new self();
35  $shib_user->setLastPasswordChangeToNow();
36  $shib_user->shibServerData = $shibServerData;
37  $ext_id = $shib_user->shibServerData->getLogin();
38  $shib_user->setExternalAccount($ext_id);
39  $existing_usr_id = self::getUsrIdByExtId($ext_id);
40  if ($existing_usr_id !== null) {
41  $shib_user->setId($existing_usr_id);
42  $shib_user->read();
43  }
44  $shib_user->setAuthMode('shibboleth');
45 
46  return $shib_user;
47  }
shibServerData $shibServerData
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLastPasswordChangeToNow()
+ 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 183 of file class.shibUser.php.

Referenced by returnNewLoginName().

183  : string
184  {
185  return strtolower(
186  strtr(
187  $name,
188  'ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ',
189  'SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy'
190  )
191  );
192  }
+ Here is the caller graph for this function:

◆ create()

shibUser::create ( )
Exceptions
ilUserException

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

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

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

◆ createFields()

shibUser::createFields ( )

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

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\setTimeLimitOwner(), ilObjUser\setTimeLimitUnlimited(), ilObjUser\setTimeLimitUntil(), ilObject\setTitle(), ilObjUser\setUTitle(), and ilObjUser\setZipcode().

106  : void
107  {
108  $this->setFirstname($this->shibServerData->getFirstname());
109  $this->setLastname($this->shibServerData->getLastname());
110  $this->setLogin($this->returnNewLoginName());
112  $this->setPasswd(md5((string) end($array)), ilObjUser::PASSWD_CRYPTED);
113  $this->setGender($this->shibServerData->getGender());
114  $this->setExternalAccount($this->shibServerData->getLogin());
115  $this->setUTitle($this->shibServerData->getTitle());
116  $this->setInstitution($this->shibServerData->getInstitution());
117  $this->setDepartment($this->shibServerData->getDepartment());
118  $this->setStreet($this->shibServerData->getStreet());
119  $this->setZipcode($this->shibServerData->getZipcode());
120  $this->setCountry($this->shibServerData->getCountry());
121  $this->setPhoneOffice($this->shibServerData->getPhoneOffice());
122  $this->setPhoneHome($this->shibServerData->getPhoneHome());
123  $this->setPhoneMobile($this->shibServerData->getPhoneMobile());
124  $this->setFax($this->shibServerData->getFax());
126  $this->setEmail($this->shibServerData->getEmail());
127  $this->setHobby($this->shibServerData->getHobby());
128  $this->setTitle($this->getFullname());
129  $this->setDescription($this->getEmail());
130  $this->setLanguage($this->shibServerData->getLanguage());
131  $this->setTimeLimitOwner(7);
132  $this->setTimeLimitUnlimited(1);
133  $this->setTimeLimitFrom(time());
134  $this->setTimeLimitUntil(time());
135  $this->setActive(true);
136  }
setUTitle(string $a_str)
set user title (note: don't mix up this method with setTitle() that is derived from ilObject and sets...
setTimeLimitUnlimited(bool $a_unlimited)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setMatriculation(string $a_str)
setPhoneOffice(string $a_str)
getFullname(int $a_max_strlen=0)
setTitle(string $title)
setTimeLimitUntil(?int $a_until)
setInstitution(string $a_str)
setPasswd(string $a_str, string $a_type=ilObjUser::PASSWD_PLAIN)
setGender(string $a_str)
setExternalAccount(string $a_str)
setLogin(string $a_str)
setActive(bool $a_active, int $a_owner=0)
set user active state and updates system fields appropriately
setDepartment(string $a_str)
setPhoneHome(string $a_str)
setHobby(string $a_str)
setCountry(string $a_str)
setEmail(string $a_str)
setFax(string $a_str)
const PASSWD_CRYPTED
static generatePasswords(int $a_number)
Generate a number of passwords.
setPhoneMobile(string $a_str)
setLastname(string $a_str)
setStreet(string $a_str)
setLanguage(string $a_str)
setTimeLimitOwner(int $a_owner)
setZipcode(string $a_str)
setTimeLimitFrom(?int $a_from)
setFirstname(string $a_str)
setDescription(string $description)
+ Here is the call graph for this function:

◆ getUsrIdByExtId()

static shibUser::getUsrIdByExtId ( string  $ext_id)
staticprotected

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

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

206  : ?int
207  {
208  global $DIC;
209 
210  $db = $DIC->database();
211 
212  $query = 'SELECT usr_id FROM usr_data WHERE ext_account = ' . $db->quote($ext_id, 'text');
213  $a_set = $db->query($query);
214  if ($db->numRows($a_set) === 0) {
215  return null;
216  }
217 
218  $usr = $db->fetchObject($a_set);
219 
220  return ($usr !== null && isset($usr->usr_id)) ? (int) $usr->usr_id : null;
221  }
numRows(ilDBStatement $statement)
quote($value, string $type)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ilDBInterface $db
global $DIC
Definition: shib_login.php:22
fetchObject(ilDBStatement $query_result)
query(string $query)
Run a (read-only) Query on the database.
+ Here is the call graph for this function:

◆ isNew()

shibUser::isNew ( )

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

References ilObject\getId().

178  : bool
179  {
180  return $this->getId() === 0;
181  }
+ Here is the call graph for this function:

◆ loginExists()

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

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

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

Referenced by returnNewLoginName().

194  : bool
195  {
196  global $DIC;
197 
198  $db = $DIC->database();
199 
200  $query = 'SELECT usr_id FROM usr_data WHERE login = ' . $db->quote($login, 'text');
201  $query .= ' AND usr_id != ' . $db->quote($usr_id, 'integer');
202 
203  return $db->numRows($db->query($query)) > 0;
204  }
numRows(ilDBStatement $statement)
quote($value, string $type)
ilDBInterface $db
global $DIC
Definition: shib_login.php:22
query(string $query)
Run a (read-only) Query on the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ returnNewLoginName()

shibUser::returnNewLoginName ( )
protected

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

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

Referenced by createFields().

163  : ?string
164  {
165  $login = substr($this->cleanName($this->getFirstname()), 0, 1) . '.' . $this->cleanName($this->getLastname());
166  //remove whitespaces see mantis 0023123: https://www.ilias.de/mantis/view.php?id=23123
167  $login = preg_replace('/\s+/', '', $login);
168  $appendix = null;
169  $login_tmp = $login;
170  while ($this->loginExists($login, $this->getId())) {
171  $login = $login_tmp . $appendix;
172  $appendix++;
173  }
174 
175  return $login;
176  }
loginExists(string $login, int $usr_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
cleanName(string $name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateFields()

shibUser::updateFields ( )

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

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().

49  : void
50  {
51  $shibConfig = shibConfig::getInstance();
52  if ($shibConfig->getUpdateFirstname()) {
53  $this->setFirstname($this->shibServerData->getFirstname());
54  }
55  if ($shibConfig->getUpdateLastname()) {
56  $this->setLastname($this->shibServerData->getLastname());
57  }
58  if ($shibConfig->getUpdateGender()) {
59  $this->setGender($this->shibServerData->getGender());
60  }
61  if ($shibConfig->getUpdateTitle()) {
62  $this->setUTitle($this->shibServerData->getTitle());
63  }
64  if ($shibConfig->getUpdateInstitution()) {
66  }
67  if ($shibConfig->getUpdateDepartment()) {
68  $this->setDepartment($this->shibServerData->getDepartment());
69  }
70  if ($shibConfig->getUpdateStreet()) {
71  $this->setStreet($this->shibServerData->getStreet());
72  }
73  if ($shibConfig->getUpdateZipcode()) {
74  $this->setZipcode($this->shibServerData->getZipcode());
75  }
76  if ($shibConfig->getUpdateCountry()) {
77  $this->setCountry($this->shibServerData->getCountry());
78  }
79  if ($shibConfig->getUpdatePhoneOffice()) {
81  }
82  if ($shibConfig->getUpdatePhoneHome()) {
83  $this->setPhoneHome($this->shibServerData->getPhoneHome());
84  }
85  if ($shibConfig->getUpdatePhoneMobile()) {
87  }
88  if ($shibConfig->getUpdateFax()) {
89  $this->setFax($this->shibServerData->getFax());
90  }
91  if ($shibConfig->getUpdateMatriculation()) {
93  }
94  if ($shibConfig->getUpdateEmail()) {
95  $this->setEmail($this->shibServerData->getEmail());
96  }
97  if ($shibConfig->getUpdateHobby()) {
98  $this->setHobby($this->shibServerData->getHobby());
99  }
100  if ($shibConfig->getUpdateLanguage()) {
101  $this->setLanguage($this->shibServerData->getLanguage());
102  }
103  $this->setDescription($this->getEmail());
104  }
setUTitle(string $a_str)
set user title (note: don't mix up this method with setTitle() that is derived from ilObject and sets...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setMatriculation(string $a_str)
setPhoneOffice(string $a_str)
setInstitution(string $a_str)
static getInstance()
setGender(string $a_str)
setDepartment(string $a_str)
setPhoneHome(string $a_str)
setHobby(string $a_str)
setCountry(string $a_str)
setEmail(string $a_str)
setFax(string $a_str)
setPhoneMobile(string $a_str)
setLastname(string $a_str)
setStreet(string $a_str)
setLanguage(string $a_str)
setZipcode(string $a_str)
setFirstname(string $a_str)
setDescription(string $description)
+ Here is the call graph for this function:

Field Documentation

◆ $shibServerData

shibServerData shibUser::$shibServerData
protected

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

Referenced by buildInstance().


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