ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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 ()
 
 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 ()
 
 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)
 
 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 ()
 
 hasToAcceptTermsOfService ()
 
 hasToAcceptTermsOfServiceInSession (?bool $status=null)
 
 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
 __construct (int $id=0, bool $reference=true)
 
 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 $desc)
 
 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=array())
 
static getUsersAgreed (bool $a_agreed=true, ?array $a_users=null)
 Get users that have or have not agreed to the user agreement. More...
 
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 _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 ()
 
- 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 cleanName (string $name)
 
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
 
- 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
 
int $id
 
bool $referenced
 
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 = ""
 
bool $offline = false
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Static Private Member Functions

static loginExists (string $login, int $usr_id)
 

Additional Inherited Members

- Data Fields inherited from ilObjUser
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()
 
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 = array()
 

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

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

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

Referenced by ilAuthProviderShibboleth\doAuthentication().

28  : shibUser
29  {
30  $shibUser = new self();
31  $shibUser->setLastPasswordChangeToNow();
32  $shibUser->shibServerData = $shibServerData;
33  $ext_id = $shibUser->shibServerData->getLogin();
34  $shibUser->setExternalAccount($ext_id);
35  $existing_usr_id = self::getUsrIdByExtId($ext_id);
36  if ($existing_usr_id) {
37  $shibUser->setId($existing_usr_id);
38  $shibUser->read();
39  }
40  $shibUser->setAuthMode('shibboleth');
41 
42  return $shibUser;
43  }
shibServerData $shibServerData
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()

static shibUser::cleanName ( string  $name)
staticprotected

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

177  : string
178  {
179  return strtolower(strtr(
180  utf8_decode($name),
181  utf8_decode('ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ'),
182  'SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy'
183  ));
184  }
if($format !==null) $name
Definition: metadata.php:247

◆ create()

shibUser::create ( )

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

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

134  : int
135  {
137  $registration_settings = new ilRegistrationSettings();
138  $recipients = array_filter($registration_settings->getApproveRecipients(), function ($v) {
139  return is_int($v);
140  });
141  if ($c->isActivateNew() && $recipients !== []) {
142  $this->setActive(false);
143  $mail = new ilRegistrationMailNotification();
145  $mail->setRecipients($registration_settings->getApproveRecipients());
146  $mail->setAdditionalInformation(array('usr' => $this));
147  $mail->send();
148  }
149 
150  if ($this->getLogin() !== '' && $this->getLogin() !== '.') {
151  return parent::create();
152  }
153 
154  throw new ilUserException('No Login-name created');
155  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$c
Definition: cli.php:38
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 102 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(), and ilObjUser\setZipcode().

102  : void
103  {
104  $this->setFirstname($this->shibServerData->getFirstname());
105  $this->setLastname($this->shibServerData->getLastname());
106  $this->setLogin($this->returnNewLoginName());
108  $this->setPasswd(md5(end($array)), ilObjUser::PASSWD_CRYPTED);
109  $this->setGender($this->shibServerData->getGender());
110  $this->setExternalAccount($this->shibServerData->getLogin());
111  $this->setTitle($this->shibServerData->getTitle());
112  $this->setInstitution($this->shibServerData->getInstitution());
113  $this->setDepartment($this->shibServerData->getDepartment());
114  $this->setStreet($this->shibServerData->getStreet());
115  $this->setZipcode($this->shibServerData->getZipcode());
116  $this->setCountry($this->shibServerData->getCountry());
117  $this->setPhoneOffice($this->shibServerData->getPhoneOffice());
118  $this->setPhoneHome($this->shibServerData->getPhoneHome());
119  $this->setPhoneMobile($this->shibServerData->getPhoneMobile());
120  $this->setFax($this->shibServerData->getFax());
122  $this->setEmail($this->shibServerData->getEmail());
123  $this->setHobby($this->shibServerData->getHobby());
124  $this->setTitle($this->getFullname());
125  $this->setDescription($this->getEmail());
126  $this->setLanguage($this->shibServerData->getLanguage());
127  $this->setTimeLimitOwner(7);
128  $this->setTimeLimitUnlimited(1);
129  $this->setTimeLimitFrom(time());
130  $this->setTimeLimitUntil(time());
131  $this->setActive(true);
132  }
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)
setDescription(string $desc)
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)
+ Here is the call graph for this function:

◆ getUsrIdByExtId()

static shibUser::getUsrIdByExtId ( string  $ext_id)
staticprotected
Parameters
$ext_id
Returns
false|int

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

References $DIC, $ilDB, and $query.

203  {
204  global $DIC;
205 
206  $ilDB = $DIC->database();
207 
208  $query = 'SELECT usr_id FROM usr_data WHERE ext_account = ' . $ilDB->quote($ext_id, 'text');
209  $a_set = $ilDB->query($query);
210  if ($ilDB->numRows($a_set) === 0) {
211  return false;
212  }
213 
214  $usr = $ilDB->fetchObject($a_set);
215 
216  return (int) $usr->usr_id;
217  }
global $DIC
Definition: feed.php:28
$query

◆ isNew()

shibUser::isNew ( )

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

References ilObject\getId().

172  : bool
173  {
174  return $this->getId() === 0;
175  }
+ Here is the call graph for this function:

◆ loginExists()

static shibUser::loginExists ( string  $login,
int  $usr_id 
)
staticprivate

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

References $DIC, $ilDB, and $query.

186  : bool
187  {
188  global $DIC;
189 
190  $ilDB = $DIC->database();
191 
192  $query = 'SELECT usr_id FROM usr_data WHERE login = ' . $ilDB->quote($login, 'text');
193  $query .= ' AND usr_id != ' . $ilDB->quote($usr_id, 'integer');
194 
195  return $ilDB->numRows($ilDB->query($query)) > 0;
196  }
global $DIC
Definition: feed.php:28
$query

◆ returnNewLoginName()

shibUser::returnNewLoginName ( )
protected

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

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

Referenced by createFields().

157  : ?string
158  {
159  $login = substr(self::cleanName($this->getFirstname()), 0, 1) . '.' . self::cleanName($this->getLastname());
160  //remove whitespaces see mantis 0023123: https://www.ilias.de/mantis/view.php?id=23123
161  $login = preg_replace('/\s+/', '', $login);
162  $appendix = null;
163  $login_tmp = $login;
164  while (self::loginExists($login, $this->getId())) {
165  $login = $login_tmp . $appendix;
166  $appendix++;
167  }
168 
169  return $login;
170  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateFields()

shibUser::updateFields ( )

Definition at line 45 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(), ilObject\setTitle(), and ilObjUser\setZipcode().

45  : void
46  {
47  $shibConfig = shibConfig::getInstance();
48  if ($shibConfig->getUpdateFirstname()) {
49  $this->setFirstname($this->shibServerData->getFirstname());
50  }
51  if ($shibConfig->getUpdateLastname()) {
52  $this->setLastname($this->shibServerData->getLastname());
53  }
54  if ($shibConfig->getUpdateGender()) {
55  $this->setGender($this->shibServerData->getGender());
56  }
57  if ($shibConfig->getUpdateTitle()) {
58  $this->setTitle($this->shibServerData->getTitle());
59  }
60  if ($shibConfig->getUpdateInstitution()) {
62  }
63  if ($shibConfig->getUpdateDepartment()) {
64  $this->setDepartment($this->shibServerData->getDepartment());
65  }
66  if ($shibConfig->getUpdateStreet()) {
67  $this->setStreet($this->shibServerData->getStreet());
68  }
69  if ($shibConfig->getUpdateZipcode()) {
70  $this->setZipcode($this->shibServerData->getZipcode());
71  }
72  if ($shibConfig->getUpdateCountry()) {
73  $this->setCountry($this->shibServerData->getCountry());
74  }
75  if ($shibConfig->getUpdatePhoneOffice()) {
77  }
78  if ($shibConfig->getUpdatePhoneHome()) {
79  $this->setPhoneHome($this->shibServerData->getPhoneHome());
80  }
81  if ($shibConfig->getUpdatePhoneMobile()) {
83  }
84  if ($shibConfig->getUpdateFax()) {
85  $this->setFax($this->shibServerData->getFax());
86  }
87  if ($shibConfig->getUpdateMatriculation()) {
89  }
90  if ($shibConfig->getUpdateEmail()) {
91  $this->setEmail($this->shibServerData->getEmail());
92  }
93  if ($shibConfig->getUpdateHobby()) {
94  $this->setHobby($this->shibServerData->getHobby());
95  }
96  if ($shibConfig->getUpdateLanguage()) {
97  $this->setLanguage($this->shibServerData->getLanguage());
98  }
99  $this->setDescription($this->getEmail());
100  }
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)
setTitle(string $title)
setInstitution(string $a_str)
static getInstance()
setGender(string $a_str)
setDescription(string $desc)
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)
+ 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: