ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilObjUser Class Reference

User class. More...

+ Inheritance diagram for ilObjUser:
+ Collaboration diagram for ilObjUser:

Public Member Functions

 __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 ()
 
 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, 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 _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 $user_id, bool $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)
 

Data Fields

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
 

Protected Member Functions

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

Protected Attributes

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
 
ILIAS FileDelivery Delivery StreamDelivery $delivery
 
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
 

Static Protected Attributes

static array $personal_image_cache = []
 

Static Private Member Functions

static _lookup (int $a_user_id, string $a_field)
 
static getLoginFromAuth ()
 Gets the username from $ilAuth, and converts it into an ILIAS login name. More...
 

Private Attributes

bool $is_self_registered = false
 
ilCronDeleteInactiveUserReminderMail $cron_delete_user_reminder_mail
 
Services $irss
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjUser::__construct ( int  $a_user_id = 0,
bool  $a_call_by_reference = false 
)

Definition at line 125 of file class.ilObjUser.php.

References $DIC, $skin, ILIAS\GlobalScreen\Provider\__construct(), read(), and ilObject\setId().

128  {
129  global $DIC;
130 
131  $this->type = 'usr';
132  parent::__construct($a_user_id, $a_call_by_reference);
133 
134  $this->cron_delete_user_reminder_mail = new ilCronDeleteInactiveUserReminderMail($this->db);
135  $this->irss = $DIC->resourceStorage();
136  $this->auth_mode = 'default';
137  $this->passwd_type = self::PASSWD_PLAIN;
138  if ($a_user_id > 0) {
139  $this->setId($a_user_id);
140  $this->read();
141  } else {
142  $this->prefs = [];
143  $this->prefs['language'] = $this->ilias->ini->readVariable('language', 'default');
144  $this->skin = $this->ilias->ini->readVariable('layout', 'skin');
145  $this->prefs['skin'] = $this->skin;
146  $this->prefs['style'] = $this->ilias->ini->readVariable('layout', 'style');
147  }
148 
149  $this->app_event_handler = $DIC['ilAppEventHandler'];
150  $this->date_format_factory = (new DataFactory())->dateFormat();
151  $this->delivery = $DIC->fileDelivery()->delivery();
152  }
setId(int $id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26
Class ilObjForumAdministration.
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

Member Function Documentation

◆ _checkExternalAuthAccount()

static ilObjUser::_checkExternalAuthAccount ( string  $a_auth,
string  $a_account,
bool  $tryFallback = true 
)
static

check whether external account and authentication method matches with a user

Definition at line 2745 of file class.ilObjUser.php.

References ilObject\$db, $GLOBALS, $r, $res, ilAuthUtils\_getAuthModeName(), ilDBInterface\fetchAssoc(), null, and ilDBInterface\queryF().

Referenced by ilAuthProviderApache\doAuthentication(), ilLTIAppEventListener\doCronUpdate(), ilAuthProviderLTI\findUserId(), ilAuthFrontend\handleLoginAttempts(), ilAuthProviderSaml\handleSamlAuth(), ilAuthProviderSoap\handleSoapAuth(), ilAuthProviderOpenIdConnect\handleUpdate(), ilUserImportParser\importEndTag(), ilLDAPUserSynchronisation\readInternalAccount(), ilLDAPQuery\readUserData(), ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus(), ilOpenIdConnectUserSync\updateUser(), and ilUserImportParser\verifyEndTag().

2749  : ?string {
2750  $db = $GLOBALS['DIC']->database();
2751  $settings = $GLOBALS['DIC']->settings();
2752 
2753  // Check directly with auth_mode
2754  $r = $db->queryF(
2755  'SELECT * FROM usr_data WHERE ' .
2756  ' ext_account = %s AND auth_mode = %s',
2757  ['text', 'text'],
2758  [$a_account, $a_auth]
2759  );
2760  if ($usr = $db->fetchAssoc($r)) {
2761  return $usr['login'];
2762  }
2763 
2764  if (!$tryFallback) {
2765  return null;
2766  }
2767 
2768  // For compatibility, check for login (no ext_account entry given)
2769  $res = $db->queryF(
2770  'SELECT login FROM usr_data ' .
2771  'WHERE login = %s AND auth_mode = %s AND (ext_account IS NULL OR ext_account = "") ',
2772  ['text', 'text'],
2773  [$a_account, $a_auth]
2774  );
2775  if ($usr = $db->fetchAssoc($res)) {
2776  return $usr['login'];
2777  }
2778 
2779  // If auth_default == $a_auth => check for login
2780  if (ilAuthUtils::_getAuthModeName($settings->get('auth_mode')) == $a_auth) {
2781  $res = $db->queryF(
2782  'SELECT login FROM usr_data WHERE ' .
2783  ' ext_account = %s AND auth_mode = %s',
2784  ['text', 'text'],
2785  [$a_account, 'default']
2786  );
2787  if ($usr = $db->fetchAssoc($res)) {
2788  return $usr['login'];
2789  }
2790  // Search for login (no ext_account given)
2791  $res = $db->queryF(
2792  'SELECT login FROM usr_data ' .
2793  'WHERE login = %s AND (ext_account IS NULL OR ext_account = "") AND auth_mode = %s',
2794  ['text', 'text'],
2795  [$a_account, 'default']
2796  );
2797  if ($usr = $db->fetchAssoc($res)) {
2798  return $usr['login'];
2799  }
2800  }
2801  return null;
2802  }
$res
Definition: ltiservices.php:66
fetchAssoc(ilDBStatement $statement)
static _getAuthModeName($a_auth_key)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$GLOBALS["DIC"]
Definition: wac.php:53
ilDBInterface $db
queryF(string $query, array $types, array $values)
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteAllPref()

static ilObjUser::_deleteAllPref ( int  $a_user_id)
static

Deletes a userpref value of the user from the database.

Definition at line 969 of file class.ilObjUser.php.

References $DIC, and $ilDB.

969  : void
970  {
971  global $DIC;
972 
973  $ilDB = $DIC->database();
974 
975  $ilDB->manipulateF(
976  'DELETE FROM usr_pref WHERE usr_id = %s',
977  ['integer'],
978  [$a_user_id]
979  );
980  }
global $DIC
Definition: shib_login.php:26

◆ _deletePref()

static ilObjUser::_deletePref ( int  $a_user_id,
string  $a_keyword 
)
static

Definition at line 953 of file class.ilObjUser.php.

References $DIC, and $ilDB.

953  : void
954  {
955  global $DIC;
956 
957  $ilDB = $DIC->database();
958 
959  $ilDB->manipulateF(
960  'DELETE FROM usr_pref WHERE usr_id = %s AND keyword = %s',
961  ['integer', 'text'],
962  [$a_user_id, $a_keyword]
963  );
964  }
global $DIC
Definition: shib_login.php:26

◆ _doesLoginnameExistInHistory()

static ilObjUser::_doesLoginnameExistInHistory ( string  $a_login)
static

Checks whether the passed loginname already exists in history.

Definition at line 814 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

Referenced by ilAccountRegistrationGUI\saveForm().

814  : bool
815  {
816  global $DIC;
817 
818  $ilDB = $DIC->database();
819 
820  $res = $ilDB->queryF(
821  '
822  SELECT * FROM loginname_history
823  WHERE login = %s',
824  ['text'],
825  [$a_login]
826  );
827 
828  return (bool) $ilDB->fetchAssoc($res);
829  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ _externalAccountExists()

static ilObjUser::_externalAccountExists ( string  $a_external_account,
string  $a_auth_mode 
)
static

Check if an external account name already exists.

Definition at line 3276 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

3279  : bool {
3280  global $DIC;
3281 
3282  $ilDB = $DIC['ilDB'];
3283 
3284  $res = $ilDB->queryF(
3285  'SELECT * FROM usr_data ' .
3286  'WHERE ext_account = %s AND auth_mode = %s',
3287  ['text', 'text'],
3288  [$a_external_account, $a_auth_mode]
3289  );
3290  return (bool) $ilDB->fetchAssoc($res);
3291  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26

◆ _generateRegistrationHash()

static ilObjUser::_generateRegistrationHash ( int  $a_usr_id)
static

Generates a unique hashcode for activating a user profile after registration.

Definition at line 3713 of file class.ilObjUser.php.

References $DIC, $ilDB, $res, and ilDBConstants\FETCHMODE_OBJECT.

3713  : string
3714  {
3715  global $DIC;
3716 
3717  $ilDB = $DIC['ilDB'];
3718 
3719  do {
3720  $continue = false;
3721 
3722  $hashcode = substr(md5(uniqid(mt_rand(), true)), 0, 16);
3723 
3724  $res = $ilDB->queryf(
3725  '
3726  SELECT COUNT(usr_id) cnt FROM usr_data
3727  WHERE reg_hash = %s',
3728  ['text'],
3729  [$hashcode]
3730  );
3731  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
3732  if ($row->cnt > 0) {
3733  $continue = true;
3734  }
3735  break;
3736  }
3737 
3738  if ($continue) {
3739  continue;
3740  }
3741 
3742  $ilDB->manipulateF(
3743  '
3744  UPDATE usr_data
3745  SET reg_hash = %s
3746  WHERE usr_id = %s',
3747  ['text', 'integer'],
3748  [$hashcode, $a_usr_id]
3749  );
3750 
3751  break;
3752  } while (true);
3753 
3754  return $hashcode;
3755  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26

◆ _getAllUserAssignedStyles()

static ilObjUser::_getAllUserAssignedStyles ( )
static
Returns
string[]

Definition at line 2307 of file class.ilObjUser.php.

References $DIC, $ilDB, and $q.

Referenced by ilSystemStylesTableGUI\getStyles(), and ilSystemStyleOverviewGUI\moveUserStyles().

2307  : array
2308  {
2309  global $DIC;
2310 
2311  $ilDB = $DIC['ilDB'];
2312 
2313  $q = 'SELECT DISTINCT up1.value style, up2.value skin FROM usr_pref up1, usr_pref up2 ' .
2314  ' WHERE up1.keyword = ' . $ilDB->quote('style', 'text') .
2315  ' AND up2.keyword = ' . $ilDB->quote('skin', 'text') .
2316  ' AND up1.usr_id = up2.usr_id';
2317 
2318  $sty_set = $ilDB->query($q);
2319 
2320  $styles = [];
2321  while ($sty_rec = $ilDB->fetchAssoc($sty_set)) {
2322  $styles[] = $sty_rec['skin'] . ':' . $sty_rec['style'];
2323  }
2324 
2325  return $styles;
2326  }
global $DIC
Definition: shib_login.php:26
$q
Definition: shib_logout.php:23
+ Here is the caller graph for this function:

◆ _getAllUserData()

static ilObjUser::_getAllUserData ( ?array  $a_fields = null,
int  $active = -1 
)
static
Parameters
?array$a_fields
int$activeall kind of undocumented options, see code, needs refactoring
Returns
array

Definition at line 2183 of file class.ilObjUser.php.

References $DIC, $ilDB, $q, $r, ilObject\$ref_id, ilSession\get(), and null.

2186  : array {
2187  global $DIC;
2188 
2189  $ilDB = $DIC['ilDB'];
2190 
2191  $result_arr = [];
2192 
2193  if ($a_fields !== null and is_array($a_fields)) {
2194  if (count($a_fields) == 0) {
2195  $select = '*';
2196  } else {
2197  if (($usr_id_field = array_search('usr_id', $a_fields)) !== false) {
2198  unset($a_fields[$usr_id_field]);
2199  }
2200 
2201  $select = implode(',', $a_fields) . ',usr_data.usr_id';
2202  // online time
2203  if (in_array('online_time', $a_fields)) {
2204  $select .= ',ut_online.online_time ';
2205  }
2206  }
2207 
2208  $q = 'SELECT ' . $select . ' FROM usr_data ';
2209 
2210  // Add online_time if desired
2211  // Need left join here to show users that never logged in
2212  if (in_array('online_time', $a_fields)) {
2213  $q .= 'LEFT JOIN ut_online ON usr_data.usr_id = ut_online.usr_id ';
2214  }
2215 
2216  switch ($active) {
2217  case 0:
2218  case 1:
2219  $q .= 'WHERE active = ' . $ilDB->quote($active, 'integer');
2220  break;
2221  case 2:
2222  $q .= 'WHERE time_limit_unlimited= ' . $ilDB->quote(0, 'integer');
2223  break;
2224  case 3:
2225  $qtemp = $q . ', rbac_ua, object_data WHERE rbac_ua.rol_id = object_data.obj_id AND ' .
2226  $ilDB->like('object_data.title', 'text', '%crs%') . ' AND usr_data.usr_id = rbac_ua.usr_id';
2227  $r = $ilDB->query($qtemp);
2228  $course_users = [];
2229  while ($row = $ilDB->fetchAssoc($r)) {
2230  $course_users[] = $row['usr_id'];
2231  }
2232  if (count($course_users)) {
2233  $q .= ' WHERE ' . $ilDB->in('usr_data.usr_id', $course_users, true, 'integer') . ' ';
2234  } else {
2235  return $result_arr;
2236  }
2237  break;
2238  case 4:
2239  $session_data = ilSession::get('user_filter_data');
2240  $date = date('Y-m-d H:i:s', mktime(0, 0, 0, $session_data['m'], $session_data['d'], $session_data['y']));
2241  $q .= ' AND last_login < ' . $ilDB->quote($date, 'timestamp');
2242  break;
2243  case 5:
2244  $ref_id = ilSession::get('user_filter_data');
2245  if ($ref_id) {
2246  $q .= ' LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id ' .
2247  'WHERE obj_members.obj_id = (SELECT obj_id FROM object_reference ' .
2248  'WHERE ref_id = ' . $ilDB->quote($ref_id, 'integer') . ') ';
2249  }
2250  break;
2251  case 6:
2252  global $DIC;
2253 
2254  $rbacreview = $DIC['rbacreview'];
2255  $ref_id = ilSession::get('user_filter_data');
2256  if ($ref_id) {
2257  $local_roles = $rbacreview->getRolesOfRoleFolder($ref_id, false);
2258  if (is_array($local_roles) && count($local_roles)) {
2259  $q .= ' LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE ' .
2260  $ilDB->in('rbac_ua.rol_id', $local_roles, false, 'integer') . ' ';
2261  }
2262  }
2263  break;
2264  case 7:
2265  $rol_id = ilSession::get('user_filter_data');
2266  if ($rol_id) {
2267  $q .= ' LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id = ' .
2268  $ilDB->quote($rol_id, 'integer');
2269  }
2270  break;
2271  }
2272  $r = $ilDB->query($q);
2273 
2274  while ($row = $ilDB->fetchAssoc($r)) {
2275  $result_arr[] = $row;
2276  }
2277  }
2278 
2279  return $result_arr;
2280  }
static get(string $a_var)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:26
$q
Definition: shib_logout.php:23
$r
+ Here is the call graph for this function:

◆ _getAvatar()

static ilObjUser::_getAvatar ( int  $a_usr_id)
static

Definition at line 2918 of file class.ilObjUser.php.

References ANONYMOUS_USER_ID.

Referenced by ilWikiContributorsTableGUI\fillRow(), ILIAS\Repository\Profile\ProfileGUI\getAvatar(), and ilMessageGUI\getItemTitle().

2918  : Avatar
2919  {
2920  $define = new ilUserAvatarResolver($a_usr_id ?: ANONYMOUS_USER_ID);
2921  $define->setSize('xsmall');
2922  return $define->getAvatar();
2923  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
This describes how a letter or a picture avatar could be modified during construction of UI...
Definition: Avatar.php:28
Class ilUserAvatarResolver.
+ Here is the caller graph for this function:

◆ _getExternalAccountsByAuthMode()

static ilObjUser::_getExternalAccountsByAuthMode ( string  $a_auth_mode,
bool  $a_read_auth_default = false 
)
static

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.

Parameters
bool$a_read_auth_defaultalso get users with authentication method 'default'

Definition at line 2677 of file class.ilObjUser.php.

References $DIC, $ilDB, $ilSetting, $q, $res, ilAuthUtils\_getAuthModeName(), and ilAuthUtils\AUTH_LOCAL.

Referenced by ilLDAPCronSynchronization\deactivateUsers(), ILIAS\COPage\Editor\Server\UI\ServerTable\getRecords(), and ilLDAPRoleGroupMapping\initServers().

2680  : array {
2681  global $DIC;
2682 
2683  $ilDB = $DIC['ilDB'];
2684  $ilSetting = $DIC['ilSetting'];
2685 
2686  $q = 'SELECT login,usr_id,ext_account,auth_mode FROM usr_data ' .
2687  'WHERE auth_mode = %s';
2688  $types[] = 'text';
2689  $values[] = $a_auth_mode;
2690  if ($a_read_auth_default and ilAuthUtils::_getAuthModeName($ilSetting->get('auth_mode', ilAuthUtils::AUTH_LOCAL)) == $a_auth_mode) {
2691  $q .= ' OR auth_mode = %s ';
2692  $types[] = 'text';
2693  $values[] = 'default';
2694  }
2695 
2696  $res = $ilDB->queryF($q, $types, $values);
2697  $accounts = [];
2698  while ($row = $ilDB->fetchObject($res)) {
2699  if ($row->auth_mode == 'default') {
2700  $accounts[$row->usr_id] = $row->login;
2701  } else {
2702  $accounts[$row->usr_id] = $row->ext_account;
2703  }
2704  }
2705  return $accounts;
2706  }
$res
Definition: ltiservices.php:66
static _getAuthModeName($a_auth_key)
const int AUTH_LOCAL
global $DIC
Definition: shib_login.php:26
global $ilSetting
Definition: privfeed.php:31
$q
Definition: shib_logout.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getFeedPass()

static ilObjUser::_getFeedPass ( int  $a_user_id)
static

Lookup news feed password for user.

Returns
?string feed_password md5-encoded, or false
Todo:
move to news service

Definition at line 3218 of file class.ilObjUser.php.

References null.

Referenced by ilPDNewsBlockGUI\initPrivateSettingsForm(), and ilPDNewsBlockGUI\showFeedUrl().

3220  : ?string {
3221  if ($a_user_id > 0) {
3222  return self::_lookupPref($a_user_id, 'priv_feed_pass');
3223  }
3224  return null;
3225  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ _getImportedUserId()

static ilObjUser::_getImportedUserId ( string  $i2_id)
static

Definition at line 2616 of file class.ilObjUser.php.

References $DIC, $id, $ilDB, $res, and ILIAS\Repository\int().

Referenced by ilCourseXMLParser\__parseId(), and ilGroupXMLParser\parseId().

2618  : int {
2619  global $DIC;
2620 
2621  $ilDB = $DIC['ilDB'];
2622 
2623  $query = 'SELECT obj_id FROM object_data WHERE import_id = ' .
2624  $ilDB->quote($i2_id, 'text');
2625 
2626  $res = $ilDB->query($query);
2627  $id = 0;
2628  while ($row = $ilDB->fetchObject($res)) {
2629  $id = (int) $row->obj_id;
2630  }
2631  return $id;
2632  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getLastHistoryDataByUserId()

static ilObjUser::_getLastHistoryDataByUserId ( int  $a_usr_id)
static

Returns the last used loginname and the changedate of the passed user_id.

Throws an ilUserException in case no entry could be found.

Returns
array Associative array, first index is the loginname, second index a unix_timestamp
Exceptions
ilUserException

Definition at line 837 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

Referenced by ilObjUserGUI\initForm().

837  : array
838  {
839  global $DIC;
840 
841  $ilDB = $DIC['ilDB'];
842 
843  $ilDB->setLimit(1, 0);
844  $res = $ilDB->queryF(
845  '
846  SELECT login, history_date FROM loginname_history
847  WHERE usr_id = %s ORDER BY history_date DESC',
848  ['integer'],
849  [$a_usr_id]
850  );
851  $row = $ilDB->fetchAssoc($res);
852  if (!is_array($row) || !count($row)) {
853  throw new ilUserException('');
854  }
855 
856  return [
857  $row['login'], $row['history_date']
858  ];
859  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ _getLocalAccountsForEmail()

static ilObjUser::_getLocalAccountsForEmail ( string  $a_email)
static

Definition at line 2823 of file class.ilObjUser.php.

References $DIC, $ilDB, $ilSetting, and $q.

2823  : array // Missing array type.
2824  {
2825  global $DIC;
2826 
2827  $ilDB = $DIC['ilDB'];
2828  $ilSetting = $DIC['ilSetting'];
2829 
2830  // default set to local (1)?
2831 
2832  $q = 'SELECT * FROM usr_data WHERE ' .
2833  ' email = %s AND (auth_mode = %s ';
2834  $types = ['text', 'text'];
2835  $values = [$a_email, 'local'];
2836 
2837  if ($ilSetting->get('auth_mode') == 1) {
2838  $q .= ' OR auth_mode = %s';
2839  $types[] = 'text';
2840  $values[] = 'default';
2841  }
2842 
2843  $q .= ')';
2844 
2845  $users = [];
2846  $usr_set = $ilDB->queryF($q, $types, $values);
2847  while ($usr_rec = $ilDB->fetchAssoc($usr_set)) {
2848  $users[$usr_rec['usr_id']] = $usr_rec['login'];
2849  }
2850 
2851  return $users;
2852  }
global $DIC
Definition: shib_login.php:26
global $ilSetting
Definition: privfeed.php:31
$q
Definition: shib_logout.php:23

◆ _getLoginAttempts()

static ilObjUser::_getLoginAttempts ( int  $a_usr_id)
static

Definition at line 3539 of file class.ilObjUser.php.

References $DIC, and $ilDB.

Referenced by ilAuthFrontend\checkExceededLoginAttempts(), and ilAuthFrontend\handleLoginAttempts().

3541  : int {
3542  global $DIC;
3543 
3544  $ilDB = $DIC['ilDB'];
3545 
3546  $query = 'SELECT login_attempts FROM usr_data WHERE usr_id = %s';
3547  $result = $ilDB->queryF($query, ['integer'], [$a_usr_id]);
3548  $record = $ilDB->fetchAssoc($result);
3549  return (int) ($record['login_attempts'] ?? 0);
3550  }
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ _getNumberOfUsersForStyle()

static ilObjUser::_getNumberOfUsersForStyle ( string  $a_skin,
string  $a_style 
)
static

Definition at line 2282 of file class.ilObjUser.php.

References $DIC, $ilDB, and $q.

Referenced by ilSystemStyleOverviewGUI\checkStyleSettings(), ilStyleDefinition\getAllSkinStyles(), and ilSystemStylesTableGUI\getStyles().

2285  : int {
2286  global $DIC;
2287 
2288  $ilDB = $DIC['ilDB'];
2289 
2290  $q = 'SELECT count(*) as cnt FROM usr_pref up1, usr_pref up2 ' .
2291  ' WHERE up1.keyword= ' . $ilDB->quote('style', 'text') .
2292  ' AND up1.value= ' . $ilDB->quote($a_style, 'text') .
2293  ' AND up2.keyword= ' . $ilDB->quote('skin', 'text') .
2294  ' AND up2.value= ' . $ilDB->quote($a_skin, 'text') .
2295  ' AND up1.usr_id = up2.usr_id ';
2296 
2297  $cnt_set = $ilDB->query($q);
2298 
2299  $cnt_rec = $ilDB->fetchAssoc($cnt_set);
2300 
2301  return (int) $cnt_rec['cnt'];
2302  }
global $DIC
Definition: shib_login.php:26
$q
Definition: shib_logout.php:23
+ Here is the caller graph for this function:

◆ _getNumberOfUsersPerAuthMode()

static ilObjUser::_getNumberOfUsersPerAuthMode ( )
static

get number of users per auth mode

Definition at line 2807 of file class.ilObjUser.php.

References $DIC, $ilDB, $r, and ILIAS\Repository\int().

Referenced by ilObjAuthSettingsGUI\authSettingsObject().

2807  : array // Missing array type.
2808  {
2809  global $DIC;
2810 
2811  $ilDB = $DIC['ilDB'];
2812 
2813  $r = $ilDB->query('SELECT count(*) AS cnt, auth_mode FROM usr_data ' .
2814  'GROUP BY auth_mode');
2815  $cnt_arr = [];
2816  while ($cnt = $ilDB->fetchAssoc($r)) {
2817  $cnt_arr[$cnt['auth_mode']] = (int) $cnt['cnt'];
2818  }
2819 
2820  return $cnt_arr;
2821  }
global $DIC
Definition: shib_login.php:26
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getPersonalPicturePath()

static ilObjUser::_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

◆ _getPreferences()

static ilObjUser::_getPreferences ( int  $user_id)
static

get preferences for user

Parameters
int$user_id
Returns
array of keys (pref_keys) and values

Definition at line 3492 of file class.ilObjUser.php.

References $DIC, $ilDB, $prefs, and $r.

Referenced by ilUserXMLWriter\__handleUser(), and ilConsultationHoursTableGUI\fillRow().

3492  : array
3493  {
3494  global $DIC;
3495 
3496  $ilDB = $DIC['ilDB'];
3497 
3498  $prefs = [];
3499 
3500  $r = $ilDB->queryF(
3501  'SELECT * FROM usr_pref WHERE usr_id = %s',
3502  ['integer'],
3503  [$user_id]
3504  );
3505 
3506  while ($row = $ilDB->fetchAssoc($r)) {
3507  $prefs[$row['keyword']] = $row['value'];
3508  }
3509 
3510  return $prefs;
3511  }
global $DIC
Definition: shib_login.php:26
$r
+ Here is the caller graph for this function:

◆ _getUserData()

static ilObjUser::_getUserData ( array  $a_internalids)
static

return user data for given user ids

Parameters
array$a_internalidsof internal ids or numerics

Definition at line 3445 of file class.ilObjUser.php.

References $data, $DIC, $ilDB, ilUtil\__extractId(), and IL_INST_ID.

Referenced by ilSoapUserAdministration\getUserXML(), and ilObjSurvey\sendNotificationMail().

3445  : array
3446  {
3447  global $DIC;
3448 
3449  $ilDB = $DIC['ilDB'];
3450 
3451  $ids = [];
3452  if (is_array($a_internalids)) {
3453  foreach ($a_internalids as $internalid) {
3454  if (is_numeric($internalid)) {
3455  $ids[] = $internalid;
3456  } else {
3457  $parsedid = ilUtil::__extractId($internalid, IL_INST_ID);
3458  if (is_numeric($parsedid) && $parsedid > 0) {
3459  $ids[] = $parsedid;
3460  }
3461  }
3462  }
3463  }
3464  if (count($ids) == 0) {
3465  $ids [] = -1;
3466  }
3467 
3468  $query = 'SELECT usr_data.*, usr_pref.value AS language
3469  FROM usr_data
3470  LEFT JOIN usr_pref
3471  ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
3472  WHERE ' . $ilDB->in('usr_data.usr_id', $ids, false, 'integer');
3473  $values[] = 'language';
3474  $types[] = 'text';
3475 
3476  $query .= ' ORDER BY usr_data.lastname, usr_data.firstname ';
3477 
3478  $data = [];
3479  $result = $ilDB->queryF($query, $types, $values);
3480  while ($row = $ilDB->fetchAssoc($result)) {
3481  $data[] = $row;
3482  }
3483  return $data;
3484  }
const IL_INST_ID
Definition: constants.php:40
global $DIC
Definition: shib_login.php:26
static __extractId(string $ilias_id, int $inst_id)
extract ref id from role title, e.g.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getUserIdsByInactivationPeriod()

static ilObjUser::_getUserIdsByInactivationPeriod ( int  $period)
static

get ids of all users that have been inactivated since at least the given period

Parameters
int$period(in days)
Returns
list<int> A list of user ids
Exceptions
ilException

Definition at line 3882 of file class.ilObjUser.php.

References $DIC, $ilDB, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

Referenced by ilCronDeleteInactivatedUserAccounts\run().

3884  : array {
3886  $field = 'inactivation_date';
3888 
3889  if (!$period) {
3890  throw new ilException('no valid period given');
3891  }
3892 
3893  global $DIC;
3894 
3895  $ilDB = $DIC['ilDB'];
3896 
3897  $date = date('Y-m-d H:i:s', (time() - ($period * 24 * 60 * 60)));
3898 
3899  $query = "SELECT usr_id FROM usr_data WHERE $field < %s AND active = %s";
3900 
3901  $res = $ilDB->queryF($query, ['timestamp', 'integer'], [$date, 0]);
3902 
3903  $ids = [];
3904  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
3905  $ids[] = (int) $row->usr_id;
3906  }
3907 
3908  return $ids;
3909  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getUsersForClipboadObject()

static ilObjUser::_getUsersForClipboadObject ( string  $a_type,
int  $a_id 
)
static

get all users, that have a certain object within their clipboard

Returns
int[] array of user IDs

Definition at line 2583 of file class.ilObjUser.php.

References $DIC, $ilDB, $q, and ILIAS\Repository\int().

Referenced by ilObjMediaObject\lookupUsages().

2586  : array {
2587  global $DIC;
2588 
2589  $ilDB = $DIC['ilDB'];
2590 
2591  $q = 'SELECT DISTINCT user_id FROM personal_clipboard WHERE ' .
2592  'item_id = ' . $ilDB->quote($a_id, 'integer') . ' AND ' .
2593  'type = ' . $ilDB->quote($a_type, 'text');
2594  $user_set = $ilDB->query($q);
2595  $users = [];
2596  while ($user_rec = $ilDB->fetchAssoc($user_set)) {
2597  $users[] = (int) $user_rec['user_id'];
2598  }
2599 
2600  return $users;
2601  }
global $DIC
Definition: shib_login.php:26
$q
Definition: shib_logout.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getUsersForFolder()

static ilObjUser::_getUsersForFolder ( int  $ref_id,
int  $active 
)
static

get users for a category or from system folder

Parameters
$active-1 (ignore), 1 = active, 0 = not active user

Definition at line 3340 of file class.ilObjUser.php.

References $active, $data, $DIC, $ilDB, ilObject\$ref_id, ANONYMOUS_USER_ID, and USER_FOLDER_ID.

Referenced by ilSoapUserAdministration\getUsersForContainer().

3343  : array {
3344  global $DIC;
3345 
3346  $ilDB = $DIC['ilDB'];
3347  $query = 'SELECT usr_data.*, usr_pref.value AS language FROM usr_data LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id and usr_pref.keyword = %s WHERE 1=1';
3348  $types[] = 'text';
3349  $values[] = 'language';
3350 
3351  if (is_numeric($active) && $active > -1) {
3352  $query .= ' AND usr_data.active = %s';
3353  $values[] = $active;
3354  $types[] = 'integer';
3355  }
3356 
3357  if ($ref_id != USER_FOLDER_ID) {
3358  $query .= ' AND usr_data.time_limit_owner = %s';
3359  $values[] = $ref_id;
3360  $types[] = 'integer';
3361  }
3362 
3363  $query .= ' AND usr_data.usr_id != %s ';
3364  $values[] = ANONYMOUS_USER_ID;
3365  $types[] = 'integer';
3366 
3367  $query .= ' ORDER BY usr_data.lastname, usr_data.firstname ';
3368 
3369  $result = $ilDB->queryF($query, $types, $values);
3370  $data = [];
3371  while ($row = $ilDB->fetchAssoc($result)) {
3372  $data[] = $row;
3373  }
3374 
3375  return $data;
3376  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
const USER_FOLDER_ID
Definition: constants.php:33
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ _getUsersForGroup()

static ilObjUser::_getUsersForGroup ( array  $a_mem_ids,
int  $active = -1 
)
static

return user data for group members

Parameters
int[]$a_mem_ids array of member ids
int$activeactive can be -1 (ignore), 1 = active, 0 = not active user

Definition at line 3384 of file class.ilObjUser.php.

Referenced by ilSoapUserAdministration\getUsersForContainer().

3387  : array {
3388  return self::_getUsersForIds($a_mem_ids, $active);
3389  }
+ Here is the caller graph for this function:

◆ _getUsersForIds()

static ilObjUser::_getUsersForIds ( array  $a_mem_ids,
int  $active = -1,
int  $timelimitowner = -1 
)
static

return user data for given user id

Parameters
int[]array of member ids
intactive can be -1 (ignore), 1 = active, 0 = not active user

Definition at line 3397 of file class.ilObjUser.php.

References $active, $DIC, $ilDB, ANONYMOUS_USER_ID, and USER_FOLDER_ID.

Referenced by ilSoapUserAdministration\getUsersForContainer().

3401  : array {
3402  global $DIC;
3403 
3404  $ilDB = $DIC['ilDB'];
3405 
3406  $query = 'SELECT usr_data.*, usr_pref.value AS language
3407  FROM usr_data
3408  LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
3409  WHERE ' . $ilDB->in('usr_data.usr_id', $a_mem_ids, false, 'integer') . '
3410  AND usr_data.usr_id != %s';
3411  $values[] = 'language';
3412  $types[] = 'text';
3413  $values[] = ANONYMOUS_USER_ID;
3414  $types[] = 'integer';
3415 
3416  if (is_numeric($active) && $active > -1) {
3417  $query .= ' AND active = %s';
3418  $values[] = $active;
3419  $types[] = 'integer';
3420  }
3421 
3422  if ($timelimitowner != USER_FOLDER_ID && $timelimitowner != -1) {
3423  $query .= ' AND usr_data.time_limit_owner = %s';
3424  $values[] = $timelimitowner;
3425  $types[] = 'integer';
3426  }
3427 
3428  $query .= ' ORDER BY usr_data.lastname, usr_data.firstname ';
3429 
3430  $result = $ilDB->queryF($query, $types, $values);
3431  $mem_arr = [];
3432  while ($row = $ilDB->fetchAssoc($result)) {
3433  $mem_arr[] = $row;
3434  }
3435 
3436  return $mem_arr;
3437  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
const USER_FOLDER_ID
Definition: constants.php:33
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ _getUsersForRole()

static ilObjUser::_getUsersForRole ( int  $role_id,
int  $active = -1 
)
static

return array of complete users which belong to a specific role

Parameters
int$activeif -1, all users will be delivered, 0 only non active, 1 only active users

Definition at line 3297 of file class.ilObjUser.php.

References $active, $data, $DIC, $ilDB, and $r.

Referenced by ilSoapUserAdministration\getUserForRole().

3300  : array {
3301  global $DIC;
3302 
3303  $ilDB = $DIC['ilDB'];
3304  $rbacreview = $DIC['rbacreview'];
3305  $ids = $rbacreview->assignedUsers($role_id);
3306 
3307  if (count($ids) == 0) {
3308  $ids = [-1];
3309  }
3310 
3311  $query = 'SELECT usr_data.*, usr_pref.value AS language
3312  FROM usr_data
3313  LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
3314  WHERE ' . $ilDB->in('usr_data.usr_id', $ids, false, 'integer');
3315  $values[] = 'language';
3316  $types[] = 'text';
3317 
3318 
3319  if (is_numeric($active) && $active > -1) {
3320  $query .= ' AND usr_data.active = %s';
3321  $values[] = $active;
3322  $types[] = 'integer';
3323  }
3324 
3325  $query .= ' ORDER BY usr_data.lastname, usr_data.firstname ';
3326 
3327  $r = $ilDB->queryF($query, $types, $values);
3328  $data = [];
3329  while ($row = $ilDB->fetchAssoc($r)) {
3330  $data[] = $row;
3331  }
3332  return $data;
3333  }
global $DIC
Definition: shib_login.php:26
$r
+ Here is the caller graph for this function:

◆ _getUsersOnline()

static ilObjUser::_getUsersOnline ( int  $a_user_id = 0,
bool  $a_no_anonymous = false 
)
static

reads all active sessions from db and returns users that are online OR returns only one active user if a user_id is given

Definition at line 3638 of file class.ilObjUser.php.

References $DIC, $ilDB, ilObject\$log, $q, $r, ilObject\$user, ANONYMOUS_USER_ID, ilLogger\debug(), ilUserFilter\getInstance(), ilUserAccountSettings\getInstance(), and ilLoggerFactory\getLogger().

Referenced by ceLTIc\LTI\User\Collector\getOnlineUsers().

3641  : array {
3642  global $DIC;
3643 
3644  $ilDB = $DIC->database();
3645 
3646  $log = ilLoggerFactory::getLogger('user');
3647 
3648  $pd_set = new ilSetting('pd');
3649  $atime = $pd_set->get('user_activity_time') * 60;
3650  $ctime = time();
3651 
3652  $where = [];
3653 
3654  if ($a_user_id === 0) {
3655  $where[] = 'user_id > 0';
3656  } else {
3657  $where[] = 'user_id = ' . $ilDB->quote($a_user_id, 'integer');
3658  }
3659 
3660  if ($a_no_anonymous) {
3661  $where[] = 'user_id != ' . $ilDB->quote(ANONYMOUS_USER_ID, 'integer');
3662  }
3663 
3664  if (ilUserAccountSettings::getInstance()->isUserAccessRestricted()) {
3665  $where[] = $ilDB->in('time_limit_owner', ilUserFilter::getInstance()->getFolderIds(), false, 'integer');
3666  }
3667 
3668  $where[] = 'expires > ' . $ilDB->quote($ctime, 'integer');
3669  $where[] = '(p.value IS NULL OR NOT p.value = ' . $ilDB->quote('y', 'text') . ')';
3670 
3671  $where = 'WHERE ' . implode(' AND ', $where);
3672 
3673  $r = $ilDB->queryF(
3674  $q = "
3675  SELECT COUNT(user_id) num, user_id, firstname, lastname, title, login, last_login, MAX(ctime) ctime, context, agree_date
3676  FROM usr_session
3677  LEFT JOIN usr_data u
3678  ON user_id = u.usr_id
3679  LEFT JOIN usr_pref p
3680  ON (p.usr_id = u.usr_id AND p.keyword = %s)
3681  {$where}
3682  GROUP BY user_id, firstname, lastname, title, login, last_login, context, agree_date
3683  ORDER BY lastname, firstname
3684  ",
3685  ['text'],
3686  ['hide_own_online_status']
3687  );
3688 
3689  $log->debug('Query: ' . $q);
3690 
3691  $users = [];
3692  while ($user = $ilDB->fetchAssoc($r)) {
3693  if ($atime <= 0 || $user['ctime'] + $atime > $ctime) {
3694  $users[$user['user_id']] = $user;
3695  }
3696  }
3697 
3698  $log->debug('Found users: ' . count($users));
3699 
3700  $hide_users = $DIC['legalDocuments']->usersWithHiddenOnlineStatus(array_map(intval(...), array_column($users, 'user_id')));
3701  $users = array_filter(
3702  $users,
3703  fn($user) => !in_array((int) $user['user_id'], $hide_users, true)
3704  );
3705 
3706  return $users;
3707  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
static getLogger(string $a_component_id)
Get component logger.
global $DIC
Definition: shib_login.php:26
$q
Definition: shib_logout.php:23
ilLogger $log
debug(string $message, array $context=[])
ilObjUser $user
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _incrementLoginAttempts()

static ilObjUser::_incrementLoginAttempts ( int  $a_usr_id)
static

Definition at line 3552 of file class.ilObjUser.php.

References $DIC, and $ilDB.

Referenced by ilAuthFrontend\handleLoginAttempts().

3554  : bool {
3555  global $DIC;
3556 
3557  $ilDB = $DIC['ilDB'];
3558 
3559  $query = 'UPDATE usr_data SET login_attempts = (login_attempts + 1) WHERE usr_id = %s';
3560  $affected = $ilDB->manipulateF($query, ['integer'], [$a_usr_id]);
3561 
3562  if ($affected) {
3563  return true;
3564  } else {
3565  return false;
3566  }
3567  }
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ _isAnonymous()

◆ _loginExists()

static ilObjUser::_loginExists ( string  $a_login,
int  $a_user_id = 0 
)
static

check if a login name already exists You may exclude a user from the check by giving his user id as 2nd paramter

Definition at line 3246 of file class.ilObjUser.php.

References $DIC, $ilDB, $q, $r, and null.

Referenced by ilUserLoginInputGUI\checkInput(), ilECSAppEventListener\handleNewAccountCreation(), ilAuthProviderSaml\handleSamlAuth(), ilCalendarAppointmentGUI\loadNotificationRecipients(), ilLuceneQueryParser\replaceOwnerCallback(), ilAccountRegistrationGUI\saveForm(), ilObjEmployeeTalkSeriesGUI\saveObject(), ilConsultationHourAppointments\setManager(), ilPersonalProfileGUI\updateLoginOrSetErrorMessages(), and ilAuthProviderDatabase\withoutPasswordVerification().

3249  : ?int {
3250  global $DIC;
3251 
3252  $ilDB = $DIC['ilDB'];
3253 
3254  $q = 'SELECT DISTINCT login, usr_id FROM usr_data ' .
3255  'WHERE login = %s';
3256  $types[] = 'text';
3257  $values[] = $a_login;
3258 
3259  if ($a_user_id != 0) {
3260  $q .= ' AND usr_id != %s ';
3261  $types[] = 'integer';
3262  $values[] = $a_user_id;
3263  }
3264 
3265  $r = $ilDB->queryF($q, $types, $values);
3266 
3267  if ($row = $ilDB->fetchAssoc($r)) {
3268  return (int) $row['usr_id'];
3269  }
3270  return null;
3271  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:26
$q
Definition: shib_logout.php:23
$r
+ Here is the caller graph for this function:

◆ _lookup()

static ilObjUser::_lookup ( int  $a_user_id,
string  $a_field 
)
staticprivate

Definition at line 568 of file class.ilObjUser.php.

References $DIC, $ilDB, $res, and null.

571  : ?string {
572  global $DIC;
573 
574  $ilDB = $DIC->database();
575 
576  $res = $ilDB->queryF(
577  'SELECT ' . $a_field . ' FROM usr_data WHERE usr_id = %s',
578  ['integer'],
579  [$a_user_id]
580  );
581 
582  while ($set = $ilDB->fetchAssoc($res)) {
583  return $set[$a_field];
584  }
585  return null;
586  }
$res
Definition: ltiservices.php:66
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:26

◆ _lookupActive()

static ilObjUser::_lookupActive ( int  $a_usr_id)
static

Definition at line 1710 of file class.ilObjUser.php.

References $DIC, $ilDB, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilMailSearchObjectGUI\cancel(), ilLearningSequenceParticipantsTableGUI\fillRow(), ILIAS\Contact\BuddySystem\Tables\RelationsTable\filter(), and ILIAS\Contact\Provider\ContactNotificationProvider\getNotifications().

1710  : bool
1711  {
1712  global $DIC;
1713 
1714  $ilDB = $DIC['ilDB'];
1715 
1716  $query = 'SELECT usr_id FROM usr_data ' .
1717  'WHERE active = ' . $ilDB->quote(1, 'integer') . ' ' .
1718  'AND usr_id = ' . $ilDB->quote($a_usr_id, 'integer');
1719  $res = $ilDB->query($query);
1720  while ($res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1721  return true;
1722  }
1723  return false;
1724  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ _lookupAuthMode()

static ilObjUser::_lookupAuthMode ( int  $a_usr_id)
static

Definition at line 2736 of file class.ilObjUser.php.

Referenced by ilECSAppEventListener\handleEvent(), ilLTIAppEventListener\handleOutcomeWithoutLP(), and ilLTIAppEventListener\handleUpdateStatus().

2736  : string
2737  {
2738  return (string) self::_lookup($a_usr_id, 'auth_mode');
2739  }
+ Here is the caller graph for this function:

◆ _lookupClientIP()

static ilObjUser::_lookupClientIP ( int  $a_user_id)
static

Definition at line 625 of file class.ilObjUser.php.

625  : string
626  {
627  return self::_lookup($a_user_id, 'client_ip') ?? '';
628  }

◆ _lookupEmail()

static ilObjUser::_lookupEmail ( int  $a_user_id)
static

Definition at line 615 of file class.ilObjUser.php.

Referenced by ilObjSurvey\getAppraiseesData(), ilAccessibilitySupportContacts\getMailsToAddress(), ilSystemSupportContacts\getMailsToAddress(), ilObjSurvey\getRatersData(), ilUserCronCheckAccounts\run(), ilBadgeHandler\sendNotification(), and ilMailSearchGUI\showResults().

615  : string
616  {
617  return self::_lookup($a_user_id, 'email') ?? '';
618  }
+ Here is the caller graph for this function:

◆ _lookupExternalAccount()

static ilObjUser::_lookupExternalAccount ( int  $a_user_id)
static

Definition at line 685 of file class.ilObjUser.php.

Referenced by ilECSAppEventListener\handleNewAccountCreation(), ilLTIAppEventListener\handleOutcomeWithoutLP(), ilLTIAppEventListener\handleUpdateStatus(), ilUserImportParser\importEndTag(), ilAuthProviderECS\resumeCurrentSession(), and ilUserImportParser\verifyEndTag().

685  : string
686  {
687  return (string) self::_lookup($a_user_id, 'ext_account') ?? '';
688  }
+ Here is the caller graph for this function:

◆ _lookupFeedHash()

static ilObjUser::_lookupFeedHash ( int  $user_id,
bool  $create = false 
)
static

Lookup news feed hash for user.

If hash does not exist, create one.

Definition at line 3174 of file class.ilObjUser.php.

References $DIC, $ilDB, null, ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

Referenced by ilUserFeedWriter\__construct(), ilPDNewsBlockGUI\showFeedUrl(), and ilNewsForContextBlockGUI\showFeedUrl().

3177  : ?string {
3178  global $DIC;
3179  $ilDB = $DIC['ilDB'];
3180 
3181  if ($user_id === 0) {
3182  return null;
3183  }
3184 
3185  $set = $ilDB->queryF(
3186  'SELECT feed_hash from usr_data WHERE usr_id = %s',
3188  [$user_id]
3189  );
3190  if (($rec = $ilDB->fetchAssoc($set)) === null) {
3191  return null;
3192  }
3193 
3194  $feed_hash = $rec['feed_hash'];
3195  if (is_string($feed_hash) && strlen($feed_hash) === 32) {
3196  return $feed_hash;
3197  }
3198 
3199  if (!$create) {
3200  return null;
3201  }
3202 
3203  $hash = md5(random_int(1, 9999999) + str_replace(' ', '', microtime()));
3204  $ilDB->manipulateF(
3205  'UPDATE usr_data SET feed_hash = %s' .
3206  ' WHERE usr_id = %s',
3208  [$hash, $user_id]
3209  );
3210  return $hash;
3211  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ _lookupFields()

static ilObjUser::_lookupFields ( int  $a_user_id)
static

lookup fields (deprecated; use more specific methods instead)

Deprecated:

Definition at line 665 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

Referenced by ILIAS\Test\ExportImport\ResultsExportExcel\getUserFieldsForUserID(), and ilCertificateUserObjectHelper\lookupFields().

665  : array // Missing array type.
666  {
667  global $DIC;
668 
669  $ilDB = $DIC['ilDB'];
670 
671  $res = $ilDB->queryF(
672  'SELECT * FROM usr_data WHERE usr_id = %s',
673  ['integer'],
674  [$a_user_id]
675  );
676  $user_rec = $ilDB->fetchAssoc($res);
677  return $user_rec;
678  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ _lookupFirstLogin()

static ilObjUser::_lookupFirstLogin ( int  $a_user_id)
static

Definition at line 733 of file class.ilObjUser.php.

Referenced by ilFirstLoginLearningHistoryProvider\getEntries().

733  : string
734  {
735  return self::_lookup($a_user_id, 'first_login') ?? '';
736  }
+ Here is the caller graph for this function:

◆ _lookupFullname()

static ilObjUser::_lookupFullname ( int  $a_user_id)
static

Definition at line 588 of file class.ilObjUser.php.

References $DIC, $fullname, and $ilDB.

Referenced by ilExAssignmentTeam\addTeamMember(), ilCalendarAppointmentGUI\book(), ilBookingProcessWithoutScheduleGUI\bookMultipleParticipants(), ILIAS\AccessControl\Log\Table\buildChangeColumn(), ilObjStudyProgrammeIndividualPlanGUI\buildFrame(), ilTestEvaluationGUI\buildParticipantSelectorArray(), ilCalendarAppointmentGUI\cancelBooking(), ilObjSurvey\checkReminder(), ilAppointmentPresentationConsultationHoursGUI\collectPropertiesAndActions(), ilObjStudyProgrammeMembersGUI\confirmRemoveUsers(), ilExAssignmentTeam\createTeam(), ILIAS\Calendar\ConsultationHours\BookingCancellationGUI\getBookingInfo(), ilConsultationHourUtils\getConsultationHourLinksForRepositoryObject(), ilLPTableBaseGUI\getExportMeta(), ilCalendarAppointmentPanelGUI\getHTML(), ilCalendarBlockGUI\getHTML(), ILIAS\Calendar\ConsultationHours\BookingCancellationGUI\getInputs(), ilExAssignmentTeamLogTableGUI\getItems(), ilLearningModuleNotification\getMailBody(), ilConsultationHourAppointments\getManager(), ILIAS\Test\Participants\ParticipantTableDeleteParticipantAction\getModal(), ILIAS\Test\Participants\ParticipantTableDeleteResultsAction\getModal(), ilObjSurvey\getSurveyParticipants(), ilExAssignmentTeam\getTeamId(), ilSCORMTrackingItemsPerUserTableGUI\initTable(), ilSCORMTrackingItemPerUserTableGUI\initTable(), ilBookingEntry\lookupManagedBookingsForObject(), ilSCORMTrackingItemsScoTableGUI\parse(), ilConsultationHoursTableGUI\parse(), ilAssignmentsPerParticipantTableGUI\parseData(), ilCalendarPresentationGUI\prepareOutput(), ilTestEvaluationGUI\printResults(), ILIAS\Calendar\ConsultationHours\BookingDataProvider\read(), ilCalendarCategories\readConsultationHoursCalendar(), ilObjStudyProgrammeMembersGUI\removeCertificate(), ilObjStudyProgrammeMembersGUI\removeCertificateMulti(), ilExAssignmentTeam\removeTeamMember(), ILIAS\Wiki\Notification\NotificationGUI\send(), ilCalendarMailNotification\send(), ilConsultationHoursGUI\sendInfoAboutUnassignedUsers(), ilWikiUtil\sendNotification(), ILIAS\Notes\NotificationsManager\sendNotifications(), ilExAssignmentReminder\sendReminders(), ilObjSurvey\sendTutorNotification(), ilTestEvaluationGUI\showResults(), ilObjStudyProgrammeMembersGUI\updateCertificate(), ilObjStudyProgrammeMembersGUI\updateCertificateMulti(), ilObjStudyProgrammeMembersGUI\updateFromCurrentPlan(), and ilObjStudyProgrammeMembersGUI\updateFromCurrentPlanMulti().

588  : string
589  {
590  global $DIC;
591 
592  $fullname = '';
593  $ilDB = $DIC['ilDB'];
594 
595  $set = $ilDB->queryF(
596  'SELECT title, firstname, lastname FROM usr_data WHERE usr_id = %s',
597  ['integer'],
598  [$a_user_id]
599  );
600 
601  if ($rec = $ilDB->fetchAssoc($set)) {
602  if ($rec['title']) {
603  $fullname = $rec['title'] . ' ';
604  }
605  if ($rec['firstname']) {
606  $fullname .= $rec['firstname'] . ' ';
607  }
608  if ($rec['lastname']) {
609  $fullname .= $rec['lastname'];
610  }
611  }
612  return $fullname;
613  }
string $fullname
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ _lookupGender()

static ilObjUser::_lookupGender ( int  $a_user_id)
static

Definition at line 620 of file class.ilObjUser.php.

Referenced by ilMail\getSalutation().

620  : string
621  {
622  return (string) self::_lookup($a_user_id, 'gender') ?? '';
623  }
+ Here is the caller graph for this function:

◆ _lookupId()

static ilObjUser::_lookupId (   $a_user_str)
static
Parameters
string|string[]$a_user_str
Returns
int|null|int[]

Definition at line 694 of file class.ilObjUser.php.

References $DIC, $ilDB, $res, ILIAS\Repository\int(), and null.

Referenced by ilMail\__construct(), ilObjUserGUI\__sendProfileMail(), ilSurveyRaterGUI\addRater(), ilOrgUnitUserAssignmentGUI\addStaff(), ilRepositorySearchGUI\addUserFromAutoComplete(), ilObjBlogGUI\addUserFromAutoComplete(), ilBookingParticipantGUI\addUserFromAutoCompleteObject(), ilExSubmissionTeamGUI\addUserFromAutoCompleteObject(), ilExerciseManagementGUI\addUserFromAutoCompleteObject(), ilTreeTrashQueries\appendTrashNodeForContainerQueryFilter(), ilSkillProfileGUI\assignUser(), ilOrgUnitSimpleUserImport\buildUserId(), ilChatroomInviteUsersToPrivateRoomGUI\byLogin(), ilPermissionGUI\changeOwner(), ilAuthProviderShibboleth\doAuthentication(), ilAuthProviderApache\doAuthentication(), ilLTIAppEventListener\doCronUpdate(), ilBenchmark\enableDbBenchmarkForUserName(), ilAuthProviderLTI\findUserId(), ilMail\formatNamesForOutput(), ILIAS\Survey\Evaluation\EvaluationManager\getSelectableAppraisees(), ILIAS\Survey\Settings\SettingsFormGUI\getTutorIdsFromForm(), ILIAS\Survey\Settings\SettingsFormGUI\getTutorResIdsFromForm(), ilObjectPermissionStatusGUI\getUser(), ilAccessibilitySupportContacts\getValidSupportContactIds(), ilSystemSupportContacts\getValidSupportContactIds(), ilDclStandardField\getValueFromExcel(), ilSoapObjectAdministration\getXMLTree(), ilAuthProviderApache\handleLDAPDataSource(), ilAuthProviderECS\handleLogin(), ilAuthFrontend\handleLoginAttempts(), ilSessionControl\handleLoginEvent(), ilAuthProviderSaml\handleSamlAuth(), ilAuthProviderSoap\handleSoapAuth(), ilAuthProviderSaml\importUser(), ilPCParagraph\intLinks2xml(), ilSoapRBACAdministration\parseUserID(), ilStartUpGUI\processCode(), ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus(), ilDclRecordEditGUI\save(), ilObjEmployeeTalkSeriesGUI\saveObject(), ilSingleUserShareGUI\saveShare(), ilObjSurvey\sendNotificationMail(), ILIAS\Notes\NotificationsManager\sendNotifications(), ilObjSurvey\sent360Reminders(), ilRegistrationSettings\setApproveRecipientLogins(), ilOpenIdConnectUserSync\setInternalAccount(), ilAccessibilitySupportContacts\setList(), ilSystemSupportContacts\setList(), ilAuthProviderLDAP\updateAccount(), ilLDAPAttributeToUser\usersToXML(), ilRegistrationSettings\validate(), and ilUserImportParser\verifyEndTag().

695  {
696  global $DIC;
697 
698  $ilDB = $DIC['ilDB'];
699 
700  if (!is_array($a_user_str)) {
701  $res = $ilDB->queryF(
702  'SELECT usr_id FROM usr_data WHERE login = %s',
703  ['text'],
704  [$a_user_str]
705  );
706 
707  $user_rec = $ilDB->fetchAssoc($res);
708  if (is_array($user_rec)) {
709  return (int) $user_rec['usr_id'];
710  }
711 
712  return null;
713  }
714 
715  $set = $ilDB->query(
716  'SELECT usr_id FROM usr_data ' .
717  ' WHERE ' . $ilDB->in('login', $a_user_str, false, 'text')
718  );
719 
720  $ids = [];
721  while ($rec = $ilDB->fetchAssoc($set)) {
722  $ids[] = (int) $rec['usr_id'];
723  }
724 
725  return $ids;
726  }
$res
Definition: ltiservices.php:66
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupLanguage()

static ilObjUser::_lookupLanguage ( int  $a_usr_id)
static

Definition at line 1545 of file class.ilObjUser.php.

References $DIC, $ilDB, ilObject\$lng, $q, $r, and ilLanguage\getDefaultLanguage().

Referenced by ilLanguageFactory\_getLanguageOfUser().

1545  : string
1546  {
1547  global $DIC;
1548 
1549  $ilDB = $DIC->database();
1550  $lng = $DIC->language();
1551 
1552  $q = 'SELECT value FROM usr_pref WHERE usr_id= ' .
1553  $ilDB->quote($a_usr_id, 'integer') . ' AND keyword = ' .
1554  $ilDB->quote('language', 'text');
1555  $r = $ilDB->query($q);
1556 
1557  while ($row = $ilDB->fetchAssoc($r)) {
1558  return (string) $row['value'];
1559  }
1560  if (is_object($lng)) {
1561  return $lng->getDefaultLanguage();
1562  }
1563  return 'en';
1564  }
getDefaultLanguage()
Return default language.
ilLanguage $lng
global $DIC
Definition: shib_login.php:26
$q
Definition: shib_logout.php:23
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupLastLogin()

static ilObjUser::_lookupLastLogin ( int  $a_user_id)
static

Definition at line 728 of file class.ilObjUser.php.

Referenced by ilCronDeleteInactiveUserReminderMail\removeEntriesFromTableIfLastLoginIsNewer().

728  : string
729  {
730  return self::_lookup($a_user_id, 'last_login') ?? '';
731  }
+ Here is the caller graph for this function:

◆ _lookupLogin()

static ilObjUser::_lookupLogin ( int  $a_user_id)
static

Definition at line 680 of file class.ilObjUser.php.

Referenced by ilCourseXMLParser\__parseId(), ilObjEmployeeTalkGUI\addChangeDateButtonsToToolbar(), ILIAS\Mail\Placeholder\MailSignatureUserLoginPlaceholder\addPlaceholder(), ILIAS\Test\Questions\Presentation\Printer\addResultUserInfoToTemplate(), ilObjSystemFolderGUI\benchmarkObject(), ILIAS\Certificate\Overview\CertificateOverviewTable\buildTableRows(), ilCalendarAppointmentGUI\cancel(), ilContactGUI\chatroomInvitationMessage(), ilObjSurvey\checkReminder(), ilWorkspaceUserActionProvider\collectActionsForTargetUser(), ilChatUserActionProvider\collectActionsForTargetUser(), ilOrgUnitUserAssignmentGUI\confirmRemove(), ilForumMailEventNotificationSender\createMailValueObjectsWithAttachments(), ilForumMailEventNotificationSender\createMailValueObjectWithoutAttachments(), ilObjRole\delete(), ilStartUpGUI\doStandardAuthentication(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilStudyProgrammeIndividualPlanTableGUI\fetchData(), ilDclBaseRecordModel\fillRecordFieldExcelExport(), ilPDNewsTableGUI\fillRow(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), ilAccessibilitySupportContactsGUI\getContactLogins(), ILIAS\Container\Skills\ContSkillMemberRetrieval\getData(), ilAttendanceList\getHTML(), ILIAS\Test\ExportImport\CertificateExport\getLoginsForIds(), ilConsultationHourAppointments\getManagedUsers(), ilConsultationHourAppointments\getManager(), ilStudyProgrammeMailMemberSearchGUI\getProcessData(), ilStudyProgrammeMailTemplateContext\getSpecificPlaceholders(), ilObjSurvey\getUserDataFromActiveId(), ILIAS\Forum\Notification\ForumNotificationTable\getUserNotificationTableData(), ilInternalLinkGUI\getUserSearchResult(), ilUserClipboard\getValidatedContent(), ilObjUserGUI\getValues(), ilAuthFrontend\handleAuthenticationSuccess(), ilMailSearchObjectGUI\mailMembers(), ilContactGUI\mailToUsers(), ilPermissionGUI\owner(), ilCalendarSharedUserListTableGUI\parse(), ilUserClipboardTableGUI\parse(), ilTrashTableGUI\parse(), ilRegistrationSettings\read(), ilLearningSequenceRoles\readMemberData(), ilExerciseManagementGUI\redirectFeedbackMailObject(), ilBookingReservationsGUI\redirectMailToBooker(), ilPortfolioRepositoryGUI\redirectSendMailToSharer(), ilBuddyList\request(), ilMailSummaryNotification\send(), ILIAS\Wiki\Notification\NotificationGUI\send(), ilLearningModuleNotification\send(), ilObjSurvey\send360ReminderToUser(), ilObjSurvey\sendAppraiseeCloseNotification(), ilObjSurvey\sendAppraiseeNotification(), ilTimingsCronReminder\sendExceededMail(), ilTimingsCronReminder\sendFreshlyStartedMail(), ilSkillNotifications\sendMail(), ilLPTableBaseGUI\sendMail(), ilMailNotification\sendMail(), ilMembershipCronNotifications\sendMail(), ilObjContentObjectGUI\sendMailToBlockedUsers(), ilMembershipMailGUI\sendMailToSelectedUsers(), ilStudyProgrammeMailMemberSearchGUI\sendMailToSelectedUsers(), ilMailMemberSearchGUI\sendMailToSelectedUsers(), ilMembershipGUI\sendMailToSelectedUsers(), ilConsultationHoursGUI\sendMailToSelectedUsers(), ilMembershipCronMinMembers\sendMessage(), ilWikiUtil\sendNotification(), ILIAS\Notes\NotificationsManager\sendNotifications(), ilObjSurvey\sendRaterNotification(), ilExAssignmentReminder\sendReminders(), ilObjSurvey\sendTutorNotification(), ilEmployeeTalkTableGUI\setTalkData(), ilMailSearchGUI\showResults(), ilMailFolderGUI\showUser(), ilContactGUI\submitInvitation(), ILIAS\LegalDocuments\Provide\ProvideHistory\table(), ilBuddySystemGUI\transitionAsyncCommand(), ilBuddySystemGUI\transitionCommand(), ilContactGUI\updateRelationState(), ilUserImportParser\verifyEndTag(), and ilPCParagraph\xml2output().

680  : string
681  {
682  return (string) self::_lookup($a_user_id, 'login') ?? '';
683  }
+ Here is the caller graph for this function:

◆ _lookupName()

static ilObjUser::_lookupName ( int  $a_user_id)
static

lookup user name

Returns
array array('user_id' => ...,'firstname' => ...,'lastname' => ...,'login' => ...,'title' => ...)

Definition at line 634 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

Referenced by ilStudyProgrammeAutoMembershipsTableGUI\__construct(), ILIAS\components\WOPI\Handler\GetFileInfoResponse\__construct(), ilBookingAssignObjectsTableGUI\__construct(), ilExGradesTableGUI\__construct(), ilObjTestAccess\_getParticipantData(), ilSoapLearningProgressAdministration\addUserProgress(), ilTimingsCronReminder\buildMailSalutation(), ilMailUserActionProvider\collectActionsForTargetUser(), ilExerciseManagementCollectFilesJob\collectAssignmentData(), ilMembershipGUI\confirmAssignFromWaitingList(), ilMembershipGUI\confirmAssignSubscribers(), ilSessionMembershipGUI\confirmDeleteParticipants(), ilMembershipGUI\confirmDeleteParticipants(), ilMembershipGUI\confirmRefuseFromList(), ilMembershipGUI\confirmRefuseSubscribers(), ILIAS\Exercise\Submission\SubmissionManager\copySubmissionsToDir(), ilLocalUserGUI\deleteUsers(), ilObjCategoryGUI\deleteUsersObject(), ilBlogExerciseGUI\downloadExcAssFile(), ilPortfolioExerciseGUI\downloadExcSubFile(), ilWikiPageGUI\downloadExcSubFile(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilObjExercise\exportGradesExcel(), ilDclBaseRecordModel\fillRecordFieldExcelExport(), ilCalendarInboxSharedTableGUI\fillRow(), ilFileVersionsTableGUI\fillRow(), ilObjSurvey\getAppraiseesData(), ilBookingParticipant\getAssignableParticipants(), ilLMTracker\getBlockedUsersInformation(), ILIAS\Container\Skills\ContSkillMemberRetrieval\getData(), ILIAS\Exercise\Submission\SubmissionManager\getDirectoryNameFromUserData(), ilExSubmission\getDirectoryNameFromUserData(), ILIAS\Exercise\TutorFeedbackFile\TutorFeedbackFileManager\getFeedbackTitle(), ILIAS\Exercise\TutorFeedbackFile\TutorFeedbackZipRepository\getFiles(), ilIndividualAssessmentMembersTableGUI\getFullNameFor(), ilAttendanceList\getHTML(), ilSurveyParticipantsTableGUI\getItems(), ilSessionOverviewTableGUI\getItems(), ilExSubmission\getLastDownloadTime(), ILIAS\Test\Logging\TestLogViewer\getLegacyLogExportForObjId(), ilBookingParticipant\getList(), ILIAS\BookingManager\Reservations\ReservationDBRepository\getListByDate(), ilExAssignment\getMemberListData(), ILIAS\Exercise\TutorFeedbackFile\TutorFeedbackZipManager\getMultiFeedbackStructureFile(), ilPageObject\getPageContributors(), ILIAS\Portfolio\PortfolioPrintViewProviderGUI\getPages(), ilPageObject\getParentObjectContributors(), ilDownloadSubmissionsBackgroundTask\getParticipantBucketTitle(), ilStudyProgrammeMailMemberSearchGUI\getProcessData(), ilObjWikiListGUI\getProperties(), ilObjSurvey\getRatersData(), ILIAS\AccessControl\Log\Table\getRows(), ilMail\getSalutation(), ilDclBaseRecordModel\getStandardField(), ilObjSurvey\getSurveyParticipants(), ILIAS\Forum\Notification\ForumNotificationTable\getUserNotificationTableData(), ilObjStudyProgrammeAutoCategoriesGUI\getUserRepresentation(), ilObjStudyProgrammeAutoMembershipsGUI\getUserRepresentation(), ilExerciseXMLWriter\handleAssignmentMembers(), ilWorkspaceShareTableGUI\importData(), ilLOMemberTestResultTableGUI\init(), ilCourseParticipantsGroupsTableDataRetrieval\init(), ilContSkillAdminGUI\initCompetenceAssignmentForm(), ilWorkspaceShareTableGUI\initFilter(), ilExerciseManagementGUI\initIndividualDeadlineForm(), ilObjectCustomUserFieldsGUI\initMemberForm(), ilAssignmentsPerParticipantTableGUI\initMode(), ilGroupParticipantsTableGUI\lookupUserName(), ilCourseParticipantsTableGUI\lookupUserName(), ilCalendarSharedUserListTableGUI\parse(), ilCalendarSharedListTableGUI\parse(), ilUserClipboardTableGUI\parse(), ilCourseReferenceDeleteConfirmationTableGUI\parse(), ilConsultationHoursTableGUI\parse(), ilGroupXMLParser\parseId(), ilLearningSequenceRoles\readMemberData(), ilObjCourseGUI\readMemberData(), ilSubscriberTableGUI\readSubscriberData(), ilWaitingListTableGUI\readUserData(), ilObjPortfolioBaseGUI\renderFullscreenHeader(), ilObjBlogGUI\renderFullscreenHeader(), ilObjBlogGUI\renderNavigationByAuthors(), ILIAS\Test\Scoring\Manual\TestScoringByParticipantGUI\saveManScoringParticipantScreen(), ilExerciseManagementGUI\saveStatus(), ilExerciseManagementGUI\showParticipantObject(), ilMailSearchGUI\showResults(), ilCourseContentGUI\showUserTimings(), ilObjTest\userLookupFullName(), ilMailNotification\userToString(), and ILIAS\Survey\Settings\SettingsFormGUI\withAfterEnd().

634  : array
635  {
636  global $DIC;
637 
638  $ilDB = $DIC['ilDB'];
639 
640  $res = $ilDB->queryF(
641  'SELECT firstname, lastname, title, login FROM usr_data WHERE usr_id = %s',
642  ['integer'],
643  [$a_user_id]
644  );
645  if ($user_rec = $ilDB->fetchAssoc($res)) {
646  return ['user_id' => $a_user_id,
647  'firstname' => $user_rec['firstname'],
648  'lastname' => $user_rec['lastname'],
649  'title' => $user_rec['title'],
650  'login' => $user_rec['login']
651  ];
652  }
653  return ['user_id' => 0,
654  'firstname' => '',
655  'lastname' => '',
656  'title' => '',
657  'login' => ''
658  ];
659  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ _lookupPref()

static ilObjUser::_lookupPref ( int  $a_usr_id,
string  $a_keyword 
)
static

Definition at line 1075 of file class.ilObjUser.php.

References $DIC, $ilDB, $res, ilDBConstants\FETCHMODE_OBJECT, and null.

Referenced by ilNewsItem\_getNewsItemsOfUser(), ilChatUserActionProvider\acceptsMessages(), ilChatroomViewGUI\buildUserActions(), ilObjUserAccess\canBeDelivered(), ilMailSearchObjectGUI\cancel(), ilUserUserActionProvider\collectActionsForTargetUser(), ilMailFolderGUI\confirmDeleteMails(), ilMailSearchObjectMembershipsTableGUI\fillRow(), ilMail\formatNamesForOutput(), ilSessionReminder\getEffectiveLeadTime(), ilBuddySystemLinkButton\getHtml(), ilUserUtil\getProfileLink(), ilTutorialSupportBlockGUI\hasContactEnabled(), ilBuddySystemGUI\requestCommand(), ilMailSearchGUI\showResults(), ilBuddySystemGUI\transitionAsyncCommand(), and ilContactGUI\updateRelationState().

1078  : ?string {
1079  global $DIC;
1080 
1081  $ilDB = $DIC['ilDB'];
1082 
1083  $query = 'SELECT * FROM usr_pref WHERE usr_id = ' . $ilDB->quote($a_usr_id, 'integer') . ' ' .
1084  'AND keyword = ' . $ilDB->quote($a_keyword, 'text');
1085  $res = $ilDB->query($query);
1086 
1087  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1088  return $row->value;
1089  }
1090  return null;
1091  }
$res
Definition: ltiservices.php:66
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ _moveUsersToStyle()

static ilObjUser::_moveUsersToStyle ( string  $a_from_skin,
string  $a_from_style,
string  $a_to_skin,
string  $a_to_style 
)
static

Definition at line 2328 of file class.ilObjUser.php.

References $DIC, $ilDB, and $q.

Referenced by ilSystemStyleOverviewGUI\moveUserStyles().

2333  : void {
2334  global $DIC;
2335 
2336  $ilDB = $DIC['ilDB'];
2337 
2338  $q = 'SELECT up1.usr_id usr_id FROM usr_pref up1, usr_pref up2 ' .
2339  ' WHERE up1.keyword= ' . $ilDB->quote('style', 'text') .
2340  ' AND up1.value= ' . $ilDB->quote($a_from_style, 'text') .
2341  ' AND up2.keyword= ' . $ilDB->quote('skin', 'text') .
2342  ' AND up2.value= ' . $ilDB->quote($a_from_skin, 'text') .
2343  ' AND up1.usr_id = up2.usr_id ';
2344 
2345  $usr_set = $ilDB->query($q);
2346 
2347  while ($usr_rec = $ilDB->fetchAssoc($usr_set)) {
2348  self::_writePref($usr_rec['usr_id'], 'skin', $a_to_skin);
2349  self::_writePref($usr_rec['usr_id'], 'style', $a_to_style);
2350  }
2351  }
global $DIC
Definition: shib_login.php:26
$q
Definition: shib_logout.php:23
+ Here is the caller graph for this function:

◆ _readUsersProfileData()

static ilObjUser::_readUsersProfileData ( array  $a_user_ids)
static
Parameters
int[]$a_user_ids
Returns
array

Definition at line 2164 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

Referenced by ilMemberExport\fetchUsers(), ilAttendanceList\getNonMemberUserData(), ilCourseMembershipGUI\getPrintMemberData(), ilLearningSequenceRoles\readMemberData(), and ilObjGroupGUI\readMemberData().

2164  : array
2165  {
2166  global $DIC;
2167 
2168  $ilDB = $DIC['ilDB'];
2169  $res = $ilDB->query('SELECT * FROM usr_data WHERE ' .
2170  $ilDB->in('usr_id', $a_user_ids, false, 'integer'));
2171  $user_data = [];
2172  while ($row = $ilDB->fetchAssoc($res)) {
2173  $user_data[$row['usr_id']] = $row;
2174  }
2175  return $user_data;
2176  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ _setFeedPass()

static ilObjUser::_setFeedPass ( int  $a_user_id,
string  $a_password 
)
static

Set news feed password for user.

Todo:
move to news service

Definition at line 3231 of file class.ilObjUser.php.

Referenced by ilPDNewsBlockGUI\changeFeedSettings().

3234  : void {
3235  self::_writePref(
3236  $a_user_id,
3237  'priv_feed_pass',
3238  ($a_password == '') ? '' : md5($a_password)
3239  );
3240  }
+ Here is the caller graph for this function:

◆ _setUserInactive()

static ilObjUser::_setUserInactive ( int  $a_usr_id)
static

Definition at line 3569 of file class.ilObjUser.php.

References $DIC, $ilDB, and ilUtil\now().

Referenced by ilAuthFrontend\handleLoginAttempts().

3571  : bool {
3572  global $DIC;
3573 
3574  $ilDB = $DIC['ilDB'];
3575 
3576  $query = 'UPDATE usr_data SET active = 0, inactivation_date = %s WHERE usr_id = %s';
3577  $affected = $ilDB->manipulateF($query, ['timestamp', 'integer'], [ilUtil::now(), $a_usr_id]);
3578 
3579  if ($affected) {
3580  return true;
3581  } else {
3582  return false;
3583  }
3584  }
static now()
Return current timestamp in Y-m-d H:i:s format.
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _toggleActiveStatusOfUsers()

static ilObjUser::_toggleActiveStatusOfUsers ( array  $a_usr_ids,
bool  $a_status 
)
static

Definition at line 2708 of file class.ilObjUser.php.

References $DIC, $ilDB, $q, and ilUtil\now().

Referenced by ilLDAPCronSynchronization\deactivateUsers().

2711  : void {
2712  global $DIC;
2713 
2714  $ilDB = $DIC['ilDB'];
2715 
2716  if ($a_status) {
2717  $q = 'UPDATE usr_data SET active = 1, inactivation_date = NULL WHERE ' .
2718  $ilDB->in('usr_id', $a_usr_ids, false, 'integer');
2719  $ilDB->manipulate($q);
2720  } else {
2721  $usrId_IN_usrIds = $ilDB->in('usr_id', $a_usr_ids, false, 'integer');
2722 
2723  $q = 'UPDATE usr_data SET active = 0 WHERE $usrId_IN_usrIds';
2724  $ilDB->manipulate($q);
2725 
2726  $queryString = '
2727  UPDATE usr_data
2728  SET inactivation_date = %s
2729  WHERE inactivation_date IS NULL
2730  AND $usrId_IN_usrIds
2731  ';
2732  $ilDB->manipulateF($queryString, ['timestamp'], [ilUtil::now()]);
2733  }
2734  }
static now()
Return current timestamp in Y-m-d H:i:s format.
global $DIC
Definition: shib_login.php:26
$q
Definition: shib_logout.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _uploadPersonalPicture()

static ilObjUser::_uploadPersonalPicture ( string  $tmp_file,
int  $obj_id 
)
static

Create a personal picture image file from a temporary image file.

Parameters
int$obj_idThe object id of the related user account

Definition at line 2859 of file class.ilObjUser.php.

References $DIC, ilObject\$user, getAvatarRid(), ilObject\getId(), NO_AVATAR_RID, null, setAvatarRid(), and update().

Referenced by ilUserImportParser\importEndTag(), and ilUserDataSet\importRecord().

2862  : bool {
2863  global $DIC;
2864  $user = new ilObjUser($obj_id);
2865  $stakeholder = new ilUserProfilePictureStakeholder();
2866  $stakeholder->setOwner($user->getId());
2867  $stream = Streams::ofResource(fopen($tmp_file, 'rb'));
2868 
2870  $rid = $DIC->resourceStorage()->manage()->find($user->getAvatarRid());
2871  // append profile picture
2872  $DIC->resourceStorage()->manage()->replaceWithStream(
2873  $rid,
2874  $stream,
2875  $stakeholder
2876  );
2877  } else {
2878  // new profile picture
2879  $rid = $DIC->resourceStorage()->manage()->stream(
2880  $stream,
2881  $stakeholder
2882  );
2883  }
2884 
2885  $user->setAvatarRid($rid->serialize());
2886  $user->update();
2887  return true;
2888  }
setAvatarRid(?string $avatar_rid)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const NO_AVATAR_RID
global $DIC
Definition: shib_login.php:26
ilObjUser $user
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _verifyRegistrationHash()

static ilObjUser::_verifyRegistrationHash ( string  $a_hash)
static

Verifies a registration hash.

Exceptions
ilRegConfirmationLinkExpiredException
ilRegistrationHashNotFoundException

Definition at line 3762 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

Referenced by ilStartUpGUI\processIndexPHP().

3764  : int {
3765  global $DIC;
3766 
3767  $ilDB = $DIC['ilDB'];
3768 
3769  $res = $ilDB->queryf(
3770  '
3771  SELECT usr_id, create_date FROM usr_data
3772  WHERE reg_hash = %s',
3773  ['text'],
3774  [$a_hash]
3775  );
3776  while ($row = $ilDB->fetchAssoc($res)) {
3777  $oRegSettigs = new ilRegistrationSettings();
3778 
3779  if ($oRegSettigs->getRegistrationHashLifetime() != 0 &&
3780  time() - $oRegSettigs->getRegistrationHashLifetime() > strtotime($row['create_date'])) {
3782  'reg_confirmation_hash_life_time_expired',
3783  (int) $row['usr_id']
3784  );
3785  }
3786 
3787  $ilDB->manipulateF(
3788  '
3789  UPDATE usr_data
3790  SET reg_hash = %s
3791  WHERE usr_id = %s',
3792  ['text', 'integer'],
3793  ['', (int) $row['usr_id']]
3794  );
3795 
3796  return (int) $row['usr_id'];
3797  }
3798 
3799  throw new ilRegistrationHashNotFoundException('reg_confirmation_hash_not_found');
3800  }
$res
Definition: ltiservices.php:66
Class for user related exception handling in ILIAS.
global $DIC
Definition: shib_login.php:26
Class ilObjAuthSettingsGUI.
Class for user related exception handling in ILIAS.
+ Here is the caller graph for this function:

◆ _writeAuthMode()

static ilObjUser::_writeAuthMode ( int  $a_usr_id,
string  $a_auth_mode 
)
static

Definition at line 1582 of file class.ilObjUser.php.

References $DIC, and $ilDB.

Referenced by ilAuthProviderSaml\handleSamlAuth().

1582  : void
1583  {
1584  global $DIC;
1585 
1586  $ilDB = $DIC['ilDB'];
1587 
1588  $ilDB->manipulateF(
1589  'UPDATE usr_data ' .
1590  ' SET auth_mode = %s WHERE usr_id = %s',
1591  ['text', 'integer'],
1592  [$a_auth_mode, $a_usr_id]
1593  );
1594  }
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ _writeExternalAccount()

static ilObjUser::_writeExternalAccount ( int  $a_usr_id,
string  $a_ext_id 
)
static

Definition at line 1566 of file class.ilObjUser.php.

References $DIC, and $ilDB.

1569  : void {
1570  global $DIC;
1571 
1572  $ilDB = $DIC['ilDB'];
1573 
1574  $ilDB->manipulateF(
1575  'UPDATE usr_data ' .
1576  ' SET ext_account = %s WHERE usr_id = %s',
1577  ['text', 'integer'],
1578  [$a_ext_id, $a_usr_id]
1579  );
1580  }
global $DIC
Definition: shib_login.php:26

◆ _writeHistory()

static ilObjUser::_writeHistory ( int  $a_usr_id,
string  $a_login 
)
static

Definition at line 3606 of file class.ilObjUser.php.

References $DIC, $ilDB, $res, and $timestamp.

3609  : void {
3610  global $DIC;
3611 
3612  $ilDB = $DIC['ilDB'];
3613 
3614  $timestamp = time();
3615 
3616  $res = $ilDB->queryF(
3617  'SELECT * FROM loginname_history WHERE usr_id = %s AND login = %s AND history_date = %s',
3618  ['integer', 'text', 'integer'],
3619  [$a_usr_id, $a_login, $timestamp]
3620  );
3621 
3622  if ($ilDB->numRows($res) == 0) {
3623  $ilDB->manipulateF(
3624  '
3625  INSERT INTO loginname_history
3626  (usr_id, login, history_date)
3627  VALUES (%s, %s, %s)',
3628  ['integer', 'text', 'integer'],
3629  [$a_usr_id, $a_login, $timestamp]
3630  );
3631  }
3632  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70

◆ _writePref()

static ilObjUser::_writePref ( int  $a_usr_id,
string  $a_keyword,
string  $a_value 
)
static

Definition at line 982 of file class.ilObjUser.php.

References $DIC, and $ilDB.

Referenced by ilBadgeProfileGUI\saveSettings(), and ilChatroomViewGUI\toggleAutoMessageDisplayState().

986  : void {
987  global $DIC;
988 
989  $ilDB = $DIC->database();
990  $ilDB->replace(
991  'usr_pref',
992  [
993  'usr_id' => ['integer', $a_usr_id],
994  'keyword' => ['text', $a_keyword],
995  ],
996  [
997  'value' => ['text',$a_value]
998  ]
999  );
1000  }
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ activateDeletionFlag()

ilObjUser::activateDeletionFlag ( )

Definition at line 4056 of file class.ilObjUser.php.

References writePref().

4056  : void
4057  {
4058  $this->writePref('delete_flag', true);
4059  }
writePref(string $a_keyword, string $a_value)
+ Here is the call graph for this function:

◆ addObjectToClipboard()

ilObjUser::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

Parameters
int$a_item_idref_id for objects, that are in the main tree (learning modules, forums) obj_id for others
string$a_typeobject type

Definition at line 2366 of file class.ilObjUser.php.

References $DIC, $ilDB, and ilObject\getId().

Referenced by ilPageEditorGUI\copyLinkedMediaToClipboard(), and ilPCMediaObjectGUI\copyToClipboard().

2373  : void {
2374  global $DIC;
2375 
2376  $ilDB = $DIC['ilDB'];
2377 
2378  if ($a_time === '') {
2379  $a_time = date('Y-m-d H:i:s');
2380  }
2381 
2382  $item_set = $ilDB->queryF(
2383  'SELECT * FROM personal_clipboard WHERE ' .
2384  'parent = %s AND item_id = %s AND type = %s AND user_id = %s',
2385  ['integer', 'integer', 'text', 'integer'],
2386  [0, $a_item_id, $a_type, $this->getId()]
2387  );
2388 
2389  // only insert if item is not already in clipboard
2390  if (!$item_set->fetchRow()) {
2391  $ilDB->manipulateF(
2392  'INSERT INTO personal_clipboard ' .
2393  '(item_id, type, user_id, title, parent, insert_time, order_nr) VALUES ' .
2394  ' (%s,%s,%s,%s,%s,%s,%s)',
2395  ['integer', 'text', 'integer', 'text', 'integer', 'timestamp', 'integer'],
2396  [$a_item_id, $a_type, $this->getId(), $a_title, $a_parent, $a_time, $a_order_nr]
2397  );
2398  } else {
2399  $ilDB->manipulateF(
2400  'UPDATE personal_clipboard SET insert_time = %s ' .
2401  'WHERE user_id = %s AND item_id = %s AND type = %s AND parent = 0',
2402  ['timestamp', 'integer', 'integer', 'text'],
2403  [$a_time, $this->getId(), $a_item_id, $a_type]
2404  );
2405  }
2406  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addToPCClipboard()

ilObjUser::addToPCClipboard ( string  $a_content,
string  $a_time,
int  $a_nr 
)

Add a page content item to PC clipboard (should go to another class)

Todo:
move to COPage service

Definition at line 2412 of file class.ilObjUser.php.

References ilObject\$db, $ilDB, ilObject\getId(), and ilSession\set().

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageContentManager\copyContents().

2416  : void {
2417  $ilDB = $this->db;
2418  if ($a_time == 0) {
2419  $a_time = date('Y-m-d H:i:s');
2420  }
2421  ilSession::set('user_pc_clip', true);
2422  $ilDB->insert('personal_pc_clipboard', [
2423  'user_id' => ['integer', $this->getId()],
2424  'content' => ['clob', $a_content],
2425  'insert_time' => ['timestamp', $a_time],
2426  'order_nr' => ['integer', $a_nr]
2427  ]);
2428  }
ilDBInterface $db
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assignData()

ilObjUser::assignData ( array  $a_data)

loads a record 'user' from array

Parameters
array$a_data,<string,mixed>

Definition at line 249 of file class.ilObjUser.php.

References $DIC, $ilErr, null, setAuthMode(), setBirthday(), setCity(), setClientIP(), setComment(), setCountry(), setDepartment(), setEmail(), setExternalAccount(), setFax(), setFirstLogin(), setFirstname(), setFullname(), setGender(), setHobby(), setInactivationDate(), setInstitution(), setIsSelfRegistered(), setLastLogin(), setLastname(), setLastProfilePrompt(), setLastUpdate(), setLatitude(), setLocationZoom(), setLogin(), setLongitude(), setMatriculation(), setPasswd(), setPasswordEncodingType(), setPasswordSalt(), setPhoneHome(), setPhoneMobile(), setPhoneOffice(), setProfileIncomplete(), setSecondEmail(), setSelectedCountry(), setStreet(), setTimeLimitFrom(), setTimeLimitMessage(), setTimeLimitOwner(), setTimeLimitUnlimited(), setTimeLimitUntil(), setUTitle(), and setZipcode().

Referenced by read().

249  : void
250  {
251  global $DIC;
252 
253  $ilErr = $DIC['ilErr'];
254 
255  // basic personal data
256  $this->setLogin($a_data['login'] ?? '');
257  if (!($a_data['passwd_type'] ?? false)) {
258  $ilErr->raiseError('<b>Error: passwd_type missing in function assignData(). ' .
259  $this->id . '!</b><br />class: ' . get_class($this) . '<br />Script: '
260  . __FILE__ . '<br />Line: ' . __LINE__, $ilErr->FATAL);
261  }
262  if (($a_data['passwd'] ?? '') != '********' && strlen($a_data['passwd'] ?? '')) {
263  $this->setPasswd($a_data['passwd'] ?? '', $a_data['passwd_type'] ?? '');
264  }
265 
266  $this->setGender((string) ($a_data['gender'] ?? ''));
267  $this->setUTitle((string) ($a_data['title'] ?? ''));
268  $this->setFirstname((string) ($a_data['firstname'] ?? ''));
269  $this->setLastname((string) ($a_data['lastname'] ?? ''));
270  $this->setFullname();
271  if (isset($a_data['birthday']) && is_string($a_data['birthday'])) {
272  $this->setBirthday($a_data['birthday']);
273  } else {
274  $this->setBirthday(null);
275  }
276 
277  // address data
278  $this->setInstitution((string) ($a_data['institution'] ?? ''));
279  $this->setDepartment((string) ($a_data['department'] ?? ''));
280  $this->setStreet((string) ($a_data['street'] ?? ''));
281  $this->setCity((string) ($a_data['city'] ?? ''));
282  $this->setZipcode((string) ($a_data['zipcode'] ?? ''));
283  $this->setCountry((string) ($a_data['country'] ?? ''));
284  $this->setSelectedCountry((string) ($a_data['sel_country'] ?? ''));
285  $this->setPhoneOffice((string) ($a_data['phone_office'] ?? ''));
286  $this->setPhoneHome((string) ($a_data['phone_home'] ?? ''));
287  $this->setPhoneMobile((string) ($a_data['phone_mobile'] ?? ''));
288  $this->setFax((string) ($a_data['fax'] ?? ''));
289  $this->setMatriculation((string) ($a_data['matriculation'] ?? ''));
290  $this->setEmail((string) ($a_data['email'] ?? ''));
291  $this->setSecondEmail((string) ($a_data['second_email'] ?? null));
292  $this->setHobby((string) ($a_data['hobby'] ?? ''));
293  $this->setClientIP((string) ($a_data['client_ip'] ?? ''));
294  $this->setPasswordEncodingType($a_data['passwd_enc_type'] ?? null);
295  $this->setPasswordSalt($a_data['passwd_salt'] ?? null);
296 
297  // other data
298  $this->setLatitude($a_data['latitude'] ?? null);
299  $this->setLongitude($a_data['longitude'] ?? null);
300  $this->setLocationZoom($a_data['loc_zoom'] ?? null);
301 
302  // system data
303  $this->setLastLogin((string) ($a_data['last_login'] ?? ''));
304  $this->setFirstLogin((string) ($a_data['first_login'] ?? ''));
305  $this->setLastProfilePrompt((string) ($a_data['last_profile_prompt'] ?? ''));
306  $this->setLastUpdate((string) ($a_data['last_update'] ?? ''));
307  $this->create_date = $a_data['create_date'] ?? '';
308  $this->setComment((string) ($a_data['referral_comment'] ?? ''));
309  $this->approve_date = ($a_data['approve_date'] ?? null);
310  $this->active = ($a_data['active'] ?? 0);
311  $this->agree_date = ($a_data['agree_date'] ?? null);
312 
313  $this->setInactivationDate((string) ($a_data['inactivation_date'] ?? null));
314 
315  // time limitation
316  $this->setTimeLimitOwner((int) ($a_data['time_limit_owner'] ?? 0));
317  $this->setTimeLimitUnlimited((bool) ($a_data['time_limit_unlimited'] ?? false));
318  $this->setTimeLimitFrom((int) ($a_data['time_limit_from'] ?? 0));
319  $this->setTimeLimitUntil((int) ($a_data['time_limit_until'] ?? 0));
320  $this->setTimeLimitMessage((string) ($a_data['time_limit_message'] ?? ''));
321 
322  // user profile incomplete?
323  $this->setProfileIncomplete((bool) ($a_data['profile_incomplete'] ?? false));
324 
325  //authentication
326  $this->setAuthMode((string) ($a_data['auth_mode'] ?? null));
327  $this->setExternalAccount((string) ($a_data['ext_account'] ?? ''));
328 
329  $this->setIsSelfRegistered((bool) ($a_data['is_self_registered'] ?? false));
330 
331  // Avatar
332  $this->avatar_rid = (string) ($a_data['rid'] ?? self::NO_AVATAR_RID);
333  }
setUTitle(string $a_str)
set user title (note: don&#39;t mix up this method with setTitle() that is derived from ilObject and sets...
setProfileIncomplete(bool $a_prof_inc)
setTimeLimitUnlimited(bool $a_unlimited)
setClientIP(string $a_str)
setLastLogin(string $a_str)
setMatriculation(string $a_str)
setPhoneOffice(string $a_str)
setSelectedCountry(string $a_val)
Set selected country (selection drop down)
setFullname()
builds a string with title + firstname + lastname method is used to build fullname in member variable...
setPasswordSalt(?string $password_salt)
setTimeLimitUntil(?int $a_until)
setInstitution(string $a_str)
setCity(string $a_str)
$ilErr
Definition: raiseError.php:33
setLatitude(?string $a_latitude)
setComment(string $a_str)
setPasswd(string $a_str, string $a_type=ilObjUser::PASSWD_PLAIN)
setGender(string $a_str)
setExternalAccount(string $a_str)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setBirthday(?string $a_birthday)
setLogin(string $a_str)
setDepartment(string $a_str)
setPhoneHome(string $a_str)
setInactivationDate(?string $inactivation_date)
global $DIC
Definition: shib_login.php:26
setHobby(string $a_str)
setIsSelfRegistered(bool $status)
setFirstLogin(string $a_str)
setCountry(string $a_str)
setEmail(string $a_str)
setFax(string $a_str)
setPhoneMobile(string $a_str)
setLastname(string $a_str)
setPasswordEncodingType(?string $password_encryption_type)
setStreet(string $a_str)
setLastProfilePrompt(string $a_str)
setTimeLimitOwner(int $a_owner)
setSecondEmail(?string $second_email)
setLongitude(?string $a_longitude)
setLocationZoom(?int $a_locationzoom)
setZipcode(string $a_str)
setTimeLimitMessage(string $a_time_limit_message)
setTimeLimitFrom(?int $a_from)
setFirstname(string $a_str)
setAuthMode(?string $a_str)
setLastUpdate(string $a_str)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildTextFromArray()

ilObjUser::buildTextFromArray ( array  $a_attr)
protected

Convert multi-text values to plain text.

Parameters
string[]
Returns
string

Definition at line 4163 of file class.ilObjUser.php.

Referenced by getGeneralInterestsAsText(), getLookingForHelpAsText(), and getOfferingHelpAsText().

4163  : string
4164  {
4165  if (count($a_attr) > 0) {
4166  return implode(', ', $a_attr);
4167  }
4168  return '';
4169  }
+ Here is the caller graph for this function:

◆ checkTimeLimit()

ilObjUser::checkTimeLimit ( )

Definition at line 1822 of file class.ilObjUser.php.

References getTimeLimitFrom(), getTimeLimitUnlimited(), and getTimeLimitUntil().

Referenced by ilAuthFrontend\checkTimeLimit(), and ilAccountMail\send().

1822  : bool
1823  {
1824  if ($this->getTimeLimitUnlimited()) {
1825  return true;
1826  }
1827  if ($this->getTimeLimitFrom() < time() and $this->getTimeLimitUntil() > time()) {
1828  return true;
1829  }
1830  return false;
1831  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkUserId()

ilObjUser::checkUserId ( )

check user id with login name

Definition at line 2011 of file class.ilObjUser.php.

References $id.

2011  : bool
2012  {
2013  $login = self::getLoginFromAuth();
2014  $id = self::_lookupId($login);
2015  if ($id > 0) {
2016  return $id;
2017  }
2018  return false;
2019  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ clipboardDeleteAll()

ilObjUser::clipboardDeleteAll ( )

Definition at line 2494 of file class.ilObjUser.php.

References $DIC, $ilDB, and ilObject\getId().

Referenced by delete().

2494  : void
2495  {
2496  global $DIC;
2497 
2498  $ilDB = $DIC['ilDB'];
2499 
2500  $ilDB->manipulateF('DELETE FROM personal_clipboard WHERE ' .
2501  'user_id = %s', ['integer'], [$this->getId()]);
2502  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clipboardDeleteObjectsOfType()

ilObjUser::clipboardDeleteObjectsOfType ( string  $a_type)

Definition at line 2482 of file class.ilObjUser.php.

References ilObject\$db, $ilDB, and ilObject\getId().

2482  : void
2483  {
2484  $ilDB = $this->db;
2485 
2486  $ilDB->manipulateF(
2487  'DELETE FROM personal_clipboard WHERE ' .
2488  'type = %s AND user_id = %s',
2489  ['text', 'integer'],
2490  [$a_type, $this->getId()]
2491  );
2492  }
ilDBInterface $db
+ Here is the call graph for this function:

◆ clipboardHasObjectsOfType()

ilObjUser::clipboardHasObjectsOfType ( string  $a_type)

Check whether clipboard has objects of a certain type.

Definition at line 2463 of file class.ilObjUser.php.

References $DIC, $ilDB, and ilObject\getId().

2463  : bool
2464  {
2465  global $DIC;
2466 
2467  $ilDB = $DIC['ilDB'];
2468 
2469  $set = $ilDB->queryF(
2470  'SELECT * FROM personal_clipboard WHERE ' .
2471  'parent = %s AND type = %s AND user_id = %s',
2472  ['integer', 'text', 'integer'],
2473  [0, $a_type, $this->getId()]
2474  );
2475  if ($ilDB->fetchAssoc($set)) {
2476  return true;
2477  }
2478 
2479  return false;
2480  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

◆ copyProfilePicturesToDirectory()

static ilObjUser::copyProfilePicturesToDirectory ( int  $a_user_id,
string  $a_dir 
)
static

Definition at line 2942 of file class.ilObjUser.php.

References $DIC, ilObject\$user, ILIAS\ResourceStorage\Services\consume(), getAvatarRid(), ilFileUtils\getWebspaceDir(), ILIAS\ResourceStorage\Services\manage(), NO_AVATAR_RID, and null.

Referenced by ilUserDataSet\getXmlRecord().

2945  : void {
2946  $a_dir = trim(str_replace('..', '', $a_dir));
2947  if ($a_dir == '' || !is_dir($a_dir)) {
2948  return;
2949  }
2950  // if profile picture is on IRSS
2951  global $DIC;
2952  $irss = $DIC->resourceStorage();
2953  $user = new ilObjUser($a_user_id);
2955  $rid = $irss->manage()->find($user->getAvatarRid());
2956  // Main Picture only is needed
2957  $stream = $irss->consume()->stream($rid)->getStream();
2958  $target = $a_dir . '/usr_' . $a_user_id . '.jpg';
2959  fwrite(fopen($target, 'wb'), (string) $stream);
2960 
2961  return;
2962  }
2963 
2964  // Legacy Picture Handling
2965  $webspace_dir = ilFileUtils::getWebspaceDir();
2966  $image_dir = $webspace_dir . '/usr_images';
2967  $images = [
2968  'upload_' . $a_user_id . 'pic',
2969  'usr_' . $a_user_id . '.' . 'jpg',
2970  'usr_' . $a_user_id . '_small.jpg',
2971  'usr_' . $a_user_id . '_xsmall.jpg',
2972  'usr_' . $a_user_id . '_xxsmall.jpg',
2973  'upload_' . $a_user_id];
2974  foreach ($images as $image) {
2975  if (is_file($image_dir . '/' . $image)) {
2976  copy($image_dir . '/' . $image, $a_dir . '/' . $image);
2977  }
2978  }
2979  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
Services $irss
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const NO_AVATAR_RID
global $DIC
Definition: shib_login.php:26
ilObjUser $user
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilObjUser::delete ( )

Definition at line 1101 of file class.ilObjUser.php.

References ilObject\$db, $DIC, $ilDB, $q, ilObject\$tree, ilEventParticipants\_deleteByUser(), ilBlockSetting\_deleteSettingsOfUser(), ilObjUserTracking\_deleteUser(), ilObjCourse\_deleteUser(), ilSession\_destroyByUserId(), ilLDAPRoleGroupMapping\_getInstance(), ilSCORM13Package\_removeTrackingDataForUser(), ilObjSCORMLearningModule\_removeTrackingDataForUser(), clipboardDeleteAll(), ilBadgeAssignment\deleteByUserId(), deleteMultiTextFields(), deleteUserDefinedFieldEntries(), ilObjPortfolio\deleteUserPortfolios(), ilObject\getId(), ilOrgUnitUserAssignmentQueries\getInstance(), getLogin(), ilNotification\removeForUser(), removeUserPicture(), and resetOwner().

1101  : bool
1102  {
1103  global $DIC;
1104 
1105  $rbacadmin = $DIC->rbac()->admin();
1106  $ilDB = $this->db;
1107 
1108  $ilAppEventHandler = $DIC['ilAppEventHandler'];
1109  $ilAppEventHandler->raise(
1110  'Services/User',
1111  'deleteUser',
1112  ['usr_id' => $this->getId()]
1113  );
1114 
1115  // deassign from ldap groups
1117  $mapping->deleteUser($this->getId());
1118 
1119  // remove mailbox / update sent mails
1120  $mailbox = new ilMailbox($this->getId());
1121  $mailbox->delete();
1122  $mailbox->updateMailsOfDeletedUser($this->getLogin());
1123 
1124  // delete block settings
1126 
1127  // delete user_account
1128  $ilDB->manipulateF(
1129  'DELETE FROM usr_data WHERE usr_id = %s',
1130  ['integer'],
1131  [$this->getId()]
1132  );
1133 
1134  $this->deleteMultiTextFields();
1135 
1136  // delete user_prefs
1137  self::_deleteAllPref($this->getId());
1138 
1139  $this->removeUserPicture(false); // #8597
1140 
1141  // delete user_session
1143 
1144  // remove user from rbac
1145  $rbacadmin->removeUser($this->getId());
1146 
1147  // remove bookmarks
1148  // TODO: move this to class.ilBookmarkFolder
1149  $q = 'DELETE FROM bookmark_tree WHERE tree = ' .
1150  $ilDB->quote($this->getId(), 'integer');
1151  $ilDB->manipulate($q);
1152 
1153  $q = 'DELETE FROM bookmark_data WHERE user_id = ' .
1154  $ilDB->quote($this->getId(), 'integer');
1155  $ilDB->manipulate($q);
1156 
1157  // Delete crs entries
1158  ilObjCourse::_deleteUser($this->getId());
1159 
1160  // Delete user tracking
1162 
1164 
1165  // Delete Tracking data SCORM 2004 RTE
1167 
1168  // Delete Tracking data SCORM 1.2 RTE
1170 
1171  // remove all notifications
1173 
1174  // remove portfolios
1176 
1177  // remove workspace
1178  $tree = new ilWorkspaceTree($this->getId());
1179  $tree->cascadingDelete();
1180 
1181  // remove reminder entries
1182  $this->cron_delete_user_reminder_mail->removeSingleUserFromTable($this->getId());
1183 
1184  // badges
1186 
1187  // remove org unit assignments
1188  $ilOrgUnitUserAssignmentQueries = ilOrgUnitUserAssignmentQueries::getInstance();
1189  $ilOrgUnitUserAssignmentQueries->deleteAllAssignmentsOfUser($this->getId());
1190 
1191  // Delete user defined field entries
1193 
1194  // Delete clipboard entries
1195  $this->clipboardDeleteAll();
1196 
1197  // Reset owner
1198  $this->resetOwner();
1199 
1200  // delete object data
1201  parent::delete();
1202  return true;
1203  }
static _destroyByUserId(int $a_user_id)
Destroy session.
static _deleteUser(int $a_usr_id)
static _removeTrackingDataForUser(int $user_id)
to be called from IlObjUser
ilTree $tree
static _deleteSettingsOfUser(int $a_user)
removeUserPicture(bool $a_do_update=true)
static _deleteByUser(int $a_usr_id)
deleteUserDefinedFieldEntries()
static _deleteUser(int $a_usr_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getInstance()
Get singleton instance of this class.
static removeForUser(int $user_id)
Remove all notifications for given user.
ilDBInterface $db
global $DIC
Definition: shib_login.php:26
static deleteByUserId(int $a_user_id)
static deleteUserPortfolios(int $a_user_id)
Delete all portfolio data for user.
$q
Definition: shib_logout.php:23
static _removeTrackingDataForUser(int $user_id)
+ Here is the call graph for this function:

◆ deleteMultiTextFields()

ilObjUser::deleteMultiTextFields ( )
protected

Definition at line 4246 of file class.ilObjUser.php.

References $DIC, $ilDB, and ilObject\getId().

Referenced by delete(), and updateMultiTextFields().

4246  : void
4247  {
4248  global $DIC;
4249 
4250  $ilDB = $DIC['ilDB'];
4251 
4252  if (!$this->getId()) {
4253  return;
4254  }
4255 
4256  $ilDB->manipulate('DELETE FROM usr_data_multi' .
4257  ' WHERE usr_id = ' . $ilDB->quote($this->getId(), 'integer'));
4258  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deletePref()

ilObjUser::deletePref ( string  $a_keyword)

Definition at line 948 of file class.ilObjUser.php.

References ilObject\getId().

948  : void
949  {
950  self::_deletePref($this->getId(), $a_keyword);
951  }
+ Here is the call graph for this function:

◆ deleteUserDefinedFieldEntries()

◆ existsPref()

ilObjUser::existsPref ( string  $a_keyword)

Definition at line 1070 of file class.ilObjUser.php.

1070  : bool
1071  {
1072  return (array_key_exists($a_keyword, $this->prefs));
1073  }

◆ findInterests()

static ilObjUser::findInterests ( string  $a_term,
?int  $a_user_id = null,
?string  $a_field_id = null 
)
static

Definition at line 4260 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

Referenced by ilPublicUserProfileGUI\getAutocompleteResult().

4264  : array {
4265  global $DIC;
4266 
4267  $ilDB = $DIC['ilDB'];
4268 
4269  $res = [];
4270 
4271  $sql = 'SELECT DISTINCT(value)' .
4272  ' FROM usr_data_multi' .
4273  ' WHERE ' . $ilDB->like('value', 'text', '%' . $a_term . '%');
4274  if ($a_field_id) {
4275  $sql .= ' AND field_id = ' . $ilDB->quote($a_field_id, 'text');
4276  }
4277  if ($a_user_id) {
4278  $sql .= ' AND usr_id <> ' . $ilDB->quote($a_user_id, 'integer');
4279  }
4280  $sql .= ' ORDER BY value';
4281  $set = $ilDB->query($sql);
4282  while ($row = $ilDB->fetchAssoc($set)) {
4283  $res[] = $row['value'];
4284  }
4285 
4286  return $res;
4287  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ getActive()

ilObjUser::getActive ( )

Definition at line 1705 of file class.ilObjUser.php.

References $active.

Referenced by ilMailSearchObjectGUI\cancel(), ilAuthFrontend\checkActivation(), ilAuthFrontend\checkExceededLoginAttempts(), and ilObjUserGUI\loadValuesFromForm().

1705  : bool
1706  {
1707  return (bool) $this->active;
1708  }
+ Here is the caller graph for this function:

◆ getAgreeDate()

ilObjUser::getAgreeDate ( )

Definition at line 1676 of file class.ilObjUser.php.

References $agree_date.

1676  : ?string
1677  {
1678  return $this->agree_date;
1679  }
string $agree_date

◆ getApproveDate()

ilObjUser::getApproveDate ( )

Definition at line 1671 of file class.ilObjUser.php.

References $approve_date.

1671  : ?string
1672  {
1673  return $this->approve_date;
1674  }
string $approve_date

◆ getAuthMode()

ilObjUser::getAuthMode ( bool  $a_auth_key = false)

Definition at line 2653 of file class.ilObjUser.php.

References $auth_mode, and ilAuthUtils\_getAuthMode().

Referenced by ILIAS\Data\Password\LocalUserPasswordManager\allowPasswordChange(), ilECSAppEventListener\handleMembership(), isPasswordChangeDemanded(), isPasswordExpired(), saveAsNew(), and update().

2653  : ?string
2654  {
2655  if (!$a_auth_key) {
2656  return $this->auth_mode;
2657  }
2658  return ilAuthUtils::_getAuthMode($this->auth_mode);
2659  }
static _getAuthMode(?string $a_auth_mode)
string $auth_mode
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAvatar()

ilObjUser::getAvatar ( )

Definition at line 2913 of file class.ilObjUser.php.

References ilObject\getId().

Referenced by ilPDMailBlockGUI\getListItemForData().

2913  : Avatar
2914  {
2915  return self::_getAvatar($this->getId());
2916  }
This describes how a letter or a picture avatar could be modified during construction of UI...
Definition: Avatar.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAvatarRid()

ilObjUser::getAvatarRid ( )

Definition at line 1978 of file class.ilObjUser.php.

References $avatar_rid.

Referenced by _uploadPersonalPicture(), copyProfilePicturesToDirectory(), and removeUserPicture().

1978  : ?string
1979  {
1980  return $this->avatar_rid;
1981  }
string $avatar_rid
+ Here is the caller graph for this function:

◆ getBirthday()

ilObjUser::getBirthday ( )

Definition at line 3812 of file class.ilObjUser.php.

References $birthday.

Referenced by saveAsNew(), and update().

3812  : ?string
3813  {
3814  return $this->birthday;
3815  }
string $birthday
+ Here is the caller graph for this function:

◆ getCity()

ilObjUser::getCity ( )

Definition at line 1370 of file class.ilObjUser.php.

References $city.

Referenced by ilPersonalProfileGUI\addLocationToForm(), and deleteUserDefinedFieldEntries().

1370  : string
1371  {
1372  return $this->city;
1373  }
+ Here is the caller graph for this function:

◆ getClientIP()

ilObjUser::getClientIP ( )

Definition at line 1456 of file class.ilObjUser.php.

References $client_ip.

Referenced by ilAuthFrontend\checkIp().

1456  : string
1457  {
1458  return $this->client_ip;
1459  }
string $client_ip
+ Here is the caller graph for this function:

◆ getClipboardChilds()

ilObjUser::getClipboardChilds ( int  $a_parent,
string  $a_insert_time 
)

Get children of an item.

Definition at line 2552 of file class.ilObjUser.php.

References $DIC, $ilDB, and ilObject\_lookupTitle().

2555  : array {
2556  global $DIC;
2557 
2558  $ilDB = $DIC['ilDB'];
2559  $ilUser = $DIC['ilUser'];
2560 
2561  $objs = $ilDB->queryF(
2562  'SELECT * FROM personal_clipboard WHERE ' .
2563  'user_id = %s AND parent = %s AND insert_time = %s ' .
2564  ' ORDER BY order_nr',
2565  ['integer', 'integer', 'timestamp'],
2566  [$ilUser->getId(), $a_parent, $a_insert_time]
2567  );
2568  $objects = [];
2569  while ($obj = $ilDB->fetchAssoc($objs)) {
2570  if ($obj['type'] == 'mob') {
2571  $obj['title'] = ilObject::_lookupTitle($obj['item_id']);
2572  }
2573  $objects[] = ['id' => $obj['item_id'],
2574  'type' => $obj['type'], 'title' => $obj['title'], 'insert_time' => $obj['insert_time']];
2575  }
2576  return $objects;
2577  }
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

◆ getClipboardObjects()

ilObjUser::getClipboardObjects ( string  $a_type = '',
bool  $a_top_nodes_only = false 
)

get all clipboard objects of user and specified type

Definition at line 2507 of file class.ilObjUser.php.

References $DIC, $ilDB, $q, ilPageObject\_exists(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilObject\getId(), and ilMediaPoolPage\lookupTitle().

Referenced by ilClipboardTableGUI\getItems().

2510  : array {
2511  global $DIC;
2512 
2513  $ilDB = $DIC['ilDB'];
2514 
2515  $par = '';
2516  if ($a_top_nodes_only) {
2517  $par = ' AND parent = ' . $ilDB->quote(0, 'integer') . ' ';
2518  }
2519 
2520  $type_str = ($a_type != '')
2521  ? ' AND type = ' . $ilDB->quote($a_type, 'text') . ' '
2522  : '';
2523  $q = 'SELECT * FROM personal_clipboard WHERE ' .
2524  'user_id = ' . $ilDB->quote($this->getId(), 'integer') . ' ' .
2525  $type_str . $par .
2526  ' ORDER BY order_nr';
2527  $objs = $ilDB->query($q);
2528  $objects = [];
2529  while ($obj = $ilDB->fetchAssoc($objs)) {
2530  if ($obj['type'] == 'mob') {
2531  $obj['title'] = ilObject::_lookupTitle($obj['item_id']);
2532  if (ilObject::_lookupType((int) $obj['item_id']) !== 'mob') {
2533  continue;
2534  }
2535  }
2536  if ($obj['type'] == 'incl') {
2537  $obj['title'] = ilMediaPoolPage::lookupTitle($obj['item_id']);
2538  if (!ilPageObject::_exists('mep', (int) $obj['item_id'], '-')) {
2539  continue;
2540  }
2541  }
2542  $objects[] = ['id' => $obj['item_id'],
2543  'type' => $obj['type'], 'title' => $obj['title'],
2544  'insert_time' => $obj['insert_time']];
2545  }
2546  return $objects;
2547  }
static lookupTitle(int $a_page_id)
static _lookupTitle(int $obj_id)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
global $DIC
Definition: shib_login.php:26
$q
Definition: shib_logout.php:23
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getComment()

ilObjUser::getComment ( )

Definition at line 1657 of file class.ilObjUser.php.

References $referral_comment.

Referenced by deleteUserDefinedFieldEntries().

1657  : string
1658  {
1659  return $this->referral_comment;
1660  }
string $referral_comment
+ Here is the caller graph for this function:

◆ getCountry()

ilObjUser::getCountry ( )

Definition at line 1390 of file class.ilObjUser.php.

References $country.

Referenced by ilPersonalProfileGUI\addLocationToForm(), deleteUserDefinedFieldEntries(), and ILIAS\LegalDocuments\Condition\UserCountry\eval().

1390  : string
1391  {
1392  return $this->country;
1393  }
string $country
+ Here is the caller graph for this function:

◆ getCurrentLanguage()

ilObjUser::getCurrentLanguage ( )

returns the current language (may differ from user's pref setting!)

Definition at line 1599 of file class.ilObjUser.php.

References ilSession\get().

1599  : string
1600  {
1601  return (string) ilSession::get('lang');
1602  }
static get(string $a_var)
+ Here is the call graph for this function:

◆ getDateFormat()

ilObjUser::getDateFormat ( )

Definition at line 1030 of file class.ilObjUser.php.

References ilCalendarSettings\_getInstance(), ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, ilCalendarSettings\DATE_FORMAT_YMD, and getPref().

Referenced by getDateTimeFormat(), ilIndividualAssessmentDateFormatter\getUserDateFormat(), and ilDclDateSelectionFieldModel\personalizeOptionValue().

1030  : DateFormat
1031  {
1032  if (!($format = $this->getPref('date_format'))) {
1033  $settings = ilCalendarSettings::_getInstance();
1034  $format = $settings->getDefaultDateFormat();
1035  }
1036 
1037  switch ($format) {
1039  return $this->date_format_factory->germanShort();
1040 
1042  return $this->date_format_factory->americanShort();
1043 
1045  default:
1046  return $this->date_format_factory->standard();
1047  }
1048  }
A Date Format provides a format definition akin to PHP&#39;s date formatting options, but stores the sing...
Definition: DateFormat.php:26
getPref(string $a_keyword)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDateTimeFormat()

ilObjUser::getDateTimeFormat ( )

Definition at line 1050 of file class.ilObjUser.php.

References getDateFormat(), getTimeFormat(), and ilCalendarSettings\TIME_FORMAT_24.

Referenced by ilDclDatetimeSelectionFieldModel\personalizeOptionValue().

1050  : DateFormat
1051  {
1053  return $this->date_format_factory->withTime24($this->getDateFormat());
1054  }
1055  return $this->date_format_factory->withTime12($this->getDateFormat());
1056  }
A Date Format provides a format definition akin to PHP&#39;s date formatting options, but stores the sing...
Definition: DateFormat.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDepartment()

ilObjUser::getDepartment ( )

Definition at line 1350 of file class.ilObjUser.php.

References $department.

Referenced by deleteUserDefinedFieldEntries().

1350  : string
1351  {
1352  return $this->department;
1353  }
string $department
+ Here is the caller graph for this function:

◆ getEmail()

◆ getExternalAccount()

ilObjUser::getExternalAccount ( )

Definition at line 2666 of file class.ilObjUser.php.

References $ext_account.

Referenced by ilCmiXapiUser\getIdent(), ilCmiXapiUser\getIdentAsId(), ilECSAppEventListener\handleMembership(), saveAsNew(), and update().

2666  : string
2667  {
2668  return $this->ext_account;
2669  }
string $ext_account
+ Here is the caller graph for this function:

◆ getFax()

ilObjUser::getFax ( )

Definition at line 1446 of file class.ilObjUser.php.

References $fax.

Referenced by deleteUserDefinedFieldEntries().

1446  : string
1447  {
1448  return $this->fax;
1449  }
+ Here is the caller graph for this function:

◆ getFirstLettersOfLastnames()

static ilObjUser::getFirstLettersOfLastnames ( ?array  $user_ids = null)
static

Get first letters of all lastnames.

Parameters
int[]$user_ids

Definition at line 3924 of file class.ilObjUser.php.

References $DIC, $ilDB, $q, ANONYMOUS_USER_ID, and null.

3926  : array {
3927  global $DIC;
3928 
3929  $ilDB = $DIC->database();
3930 
3931  $q = 'SELECT DISTINCT ' . $ilDB->upper($ilDB->substr('lastname', 1, 1)) . ' let' .
3932  ' FROM usr_data' .
3933  ' WHERE usr_id <> ' . $ilDB->quote(ANONYMOUS_USER_ID, 'integer') .
3934  ($user_ids !== null ? ' AND ' . $ilDB->in('usr_id', $user_ids, false, 'integer') : '') .
3935  ' ORDER BY let';
3936  $let_set = $ilDB->query($q);
3937 
3938  $let = [];
3939  while ($let_rec = $ilDB->fetchAssoc($let_set)) {
3940  $let[$let_rec['let']] = $let_rec['let'];
3941  }
3942  return $let;
3943  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:26
$q
Definition: shib_logout.php:23

◆ getFirstLogin()

ilObjUser::getFirstLogin ( )

Definition at line 1627 of file class.ilObjUser.php.

References $first_login.

Referenced by refreshLogin().

1627  : string
1628  {
1629  return $this->first_login;
1630  }
string $first_login
+ Here is the caller graph for this function:

◆ getFirstname()

◆ getFullname()

ilObjUser::getFullname ( int  $a_max_strlen = 0)
Parameters
int$a_max_strlenmax. string length to return (optional) if string length of fullname is greater than given a_max_strlen the name is shortened in the following way:
  1. abreviate firstname (-> Dr. J. Smith) if fullname is still too long
  2. drop title (-> John Smith) if fullname is still too long
  3. drop title and abreviate first name (J. Smith) if fullname is still too long
  4. drop title and firstname and shorten lastname to max length (–> Smith)

Definition at line 1231 of file class.ilObjUser.php.

References ilUtil\stripSlashes().

Referenced by ilIndividualAssessmentMembersStorageDB\createAssessmentMember(), shibUser\createFields(), ILIAS\EmployeeTalk\Notification\Calendar\VCalendarGenerator\getEventfromTalk(), ilCmiXapiUser\getName(), ilTutorialSupportBlockGUI\getTutorData(), ilObjSurvey\getUserDataFromActiveId(), ilDclBaseFieldRepresentation\passThroughFilter(), ilObjSurvey\saveAuthorToMetadata(), ilAccountMail\send(), ilAccountRegistrationMail\sendLanguageVariableBasedAccountMail(), and ilObjUserFolderGUI\showActionConfirmation().

1231  : string
1232  {
1233  if (!$a_max_strlen) {
1234  return ilUtil::stripSlashes($this->fullname);
1235  }
1236 
1237  if (strlen($this->fullname) <= $a_max_strlen) {
1238  return ilUtil::stripSlashes($this->fullname);
1239  }
1240 
1241  if ((strlen($this->utitle) + strlen($this->lastname) + 4) <= $a_max_strlen) {
1242  return ilUtil::stripSlashes($this->utitle . ' ' . substr($this->firstname, 0, 1) . '. ' . $this->lastname);
1243  }
1244 
1245  if ((strlen($this->firstname) + strlen($this->lastname) + 1) <= $a_max_strlen) {
1246  return ilUtil::stripSlashes($this->firstname . ' ' . $this->lastname);
1247  }
1248 
1249  if ((strlen($this->lastname) + 3) <= $a_max_strlen) {
1250  return ilUtil::stripSlashes(substr($this->firstname, 0, 1) . '. ' . $this->lastname);
1251  }
1252 
1253  return ilUtil::stripSlashes(substr($this->lastname, 0, $a_max_strlen));
1254  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGender()

ilObjUser::getGender ( )

Definition at line 1295 of file class.ilObjUser.php.

References $gender.

Referenced by deleteUserDefinedFieldEntries(), ilObjSurvey\getUserDataFromActiveId(), and ilAccountMail\replacePlaceholders().

1295  : string
1296  {
1297  return $this->gender;
1298  }
string $gender
+ Here is the caller graph for this function:

◆ getGeneralInterests()

ilObjUser::getGeneralInterests ( )
Returns
string[]

Definition at line 4097 of file class.ilObjUser.php.

References $interests_general.

Referenced by updateMultiTextFields().

4097  : array
4098  {
4099  return $this->interests_general;
4100  }
array $interests_general
+ Here is the caller graph for this function:

◆ getGeneralInterestsAsText()

ilObjUser::getGeneralInterestsAsText ( )

Get general interests as plain text.

Definition at line 4105 of file class.ilObjUser.php.

References buildTextFromArray().

4105  : string
4106  {
4107  return $this->buildTextFromArray($this->interests_general);
4108  }
buildTextFromArray(array $a_attr)
Convert multi-text values to plain text.
+ Here is the call graph for this function:

◆ getHobby()

ilObjUser::getHobby ( )

Definition at line 1509 of file class.ilObjUser.php.

References $hobby.

Referenced by deleteUserDefinedFieldEntries().

1509  : string
1510  {
1511  return $this->hobby;
1512  }
+ Here is the caller graph for this function:

◆ getInactivationDate()

ilObjUser::getInactivationDate ( )

Definition at line 4041 of file class.ilObjUser.php.

References $inactivation_date.

4041  : ?string
4042  {
4043  return $this->inactivation_date;
4044  }
string $inactivation_date

◆ getInstitution()

ilObjUser::getInstitution ( )

Definition at line 1340 of file class.ilObjUser.php.

References $institution.

Referenced by deleteUserDefinedFieldEntries().

1340  : string
1341  {
1342  return $this->institution;
1343  }
string $institution
+ Here is the caller graph for this function:

◆ getLanguage()

◆ getLastLogin()

ilObjUser::getLastLogin ( )

Definition at line 1617 of file class.ilObjUser.php.

References $last_login.

Referenced by ilObjUserFolderGUI\showActionConfirmation().

1617  : string
1618  {
1619  return $this->last_login;
1620  }
string $last_login
+ Here is the caller graph for this function:

◆ getLastname()

◆ getLastPasswordChangeTS()

ilObjUser::getLastPasswordChangeTS ( )

Definition at line 1530 of file class.ilObjUser.php.

References $last_password_change_ts.

Referenced by getPasswordAge(), isPasswordChangeDemanded(), isPasswordExpired(), and setLastPasswordChangeToNow().

1530  : int
1531  {
1533  }
int $last_password_change_ts
+ Here is the caller graph for this function:

◆ getLastProfilePrompt()

ilObjUser::getLastProfilePrompt ( )

Definition at line 1637 of file class.ilObjUser.php.

References $last_profile_prompt.

1637  : string
1638  {
1640  }
string $last_profile_prompt

◆ getLastUpdate()

ilObjUser::getLastUpdate ( )

Definition at line 1647 of file class.ilObjUser.php.

References ilObject\$last_update.

1647  : string
1648  {
1649  return $this->last_update;
1650  }
string $last_update

◆ getLatitude()

ilObjUser::getLatitude ( )

Definition at line 1953 of file class.ilObjUser.php.

References $latitude.

Referenced by ilPersonalProfileGUI\addLocationToForm().

1953  : ?string
1954  {
1955  return $this->latitude;
1956  }
string $latitude
+ Here is the caller graph for this function:

◆ getLocationZoom()

ilObjUser::getLocationZoom ( )

Definition at line 1973 of file class.ilObjUser.php.

References $loc_zoom.

Referenced by ilPersonalProfileGUI\addLocationToForm().

1973  : ?int
1974  {
1975  return $this->loc_zoom;
1976  }
string $loc_zoom
+ Here is the caller graph for this function:

◆ getLogin()

◆ getLoginAttempts()

ilObjUser::getLoginAttempts ( )

Definition at line 1817 of file class.ilObjUser.php.

References $login_attempts.

1817  : int
1818  {
1819  return $this->login_attempts;
1820  }

◆ getLoginByUserId()

ilObjUser::getLoginByUserId ( int  $a_userid)

Definition at line 2130 of file class.ilObjUser.php.

References $DIC, $ilDB, $res, ANONYMOUS_USER_ID, and null.

2130  : ?string
2131  {
2132  $login = self::_lookupLogin($a_userid);
2133  return $login ?: null;
2134  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ getLoginFromAuth()

static ilObjUser::getLoginFromAuth ( )
staticprivate

Gets the username from $ilAuth, and converts it into an ILIAS login name.

Definition at line 2024 of file class.ilObjUser.php.

References $GLOBALS, $login, and ilDAVActivationChecker\_isActive().

2024  : string
2025  {
2026  $uid = $GLOBALS['DIC']['ilAuthSession']->getUserId();
2027  $login = self::_lookupLogin($uid);
2028 
2029  // BEGIN WebDAV: Strip Microsoft Domain Names from logins
2031  $login = self::toUsernameWithoutDomain($login);
2032  }
2033  return $login;
2034  }
$GLOBALS["DIC"]
Definition: wac.php:53
+ Here is the call graph for this function:

◆ getLongitude()

ilObjUser::getLongitude ( )

Definition at line 1963 of file class.ilObjUser.php.

References $longitude.

Referenced by ilPersonalProfileGUI\addLocationToForm().

1963  : ?string
1964  {
1965  return $this->longitude;
1966  }
string $longitude
+ Here is the caller graph for this function:

◆ getLookingForHelp()

ilObjUser::getLookingForHelp ( )
Returns
string[]

Definition at line 4145 of file class.ilObjUser.php.

References $interests_help_looking.

Referenced by updateMultiTextFields().

4145  : array
4146  {
4148  }
array $interests_help_looking
+ Here is the caller graph for this function:

◆ getLookingForHelpAsText()

ilObjUser::getLookingForHelpAsText ( )

Get help looking for as plain text.

Definition at line 4153 of file class.ilObjUser.php.

References buildTextFromArray().

4153  : string
4154  {
4155  return $this->buildTextFromArray($this->interests_help_looking);
4156  }
buildTextFromArray(array $a_attr)
Convert multi-text values to plain text.
+ Here is the call graph for this function:

◆ getMatriculation()

ilObjUser::getMatriculation ( )

Definition at line 1466 of file class.ilObjUser.php.

References $matriculation.

Referenced by deleteUserDefinedFieldEntries().

1466  : string
1467  {
1468  return $this->matriculation;
1469  }
string $matriculation
+ Here is the caller graph for this function:

◆ getOfferingHelp()

ilObjUser::getOfferingHelp ( )
Returns
string[]

Definition at line 4121 of file class.ilObjUser.php.

References $interests_help_offered.

Referenced by updateMultiTextFields().

4121  : array
4122  {
4124  }
array $interests_help_offered
+ Here is the caller graph for this function:

◆ getOfferingHelpAsText()

ilObjUser::getOfferingHelpAsText ( )

Get help offering as plain text.

Definition at line 4129 of file class.ilObjUser.php.

References buildTextFromArray().

4129  : string
4130  {
4131  return $this->buildTextFromArray($this->interests_help_offered);
4132  }
buildTextFromArray(array $a_attr)
Convert multi-text values to plain text.
+ Here is the call graph for this function:

◆ getOrgUnitsRepresentation()

ilObjUser::getOrgUnitsRepresentation ( )

Definition at line 2643 of file class.ilObjUser.php.

References ilObject\getId().

2643  : string
2644  {
2645  return self::lookupOrgUnitsRepresentation($this->getId());
2646  }
+ Here is the call graph for this function:

◆ getPasswd()

ilObjUser::getPasswd ( )
Returns
string The password is encoded depending on the current password type.

Definition at line 1277 of file class.ilObjUser.php.

References $passwd.

Referenced by resetPassword(), saveAsNew(), update(), and ILIAS\Data\Password\LocalUserPasswordManager\verifyPassword().

1277  : string
1278  {
1279  return $this->passwd;
1280  }
string $passwd
+ Here is the caller graph for this function:

◆ getPasswdType()

ilObjUser::getPasswdType ( )
Returns
string password type (ilObjUser::PASSWD_PLAIN, ilObjUser::PASSWD_CRYPTED).

Definition at line 1285 of file class.ilObjUser.php.

References $passwd_type.

1285  : string
1286  {
1287  return $this->passwd_type;
1288  }
string $passwd_type

◆ getPasswordAge()

ilObjUser::getPasswordAge ( )

Definition at line 1900 of file class.ilObjUser.php.

References getLastPasswordChangeTS(), and ILIAS\Repository\int().

1900  : int
1901  {
1902  $current_ts = time();
1903  $pass_change_ts = $this->getLastPasswordChangeTS();
1904  $password_age = (int) (($current_ts - $pass_change_ts) / 86400);
1905  return $password_age;
1906  }
+ Here is the call graph for this function:

◆ getPasswordEncodingType()

ilObjUser::getPasswordEncodingType ( )

Definition at line 225 of file class.ilObjUser.php.

References $password_encoding_type.

Referenced by resetPassword(), saveAsNew(), update(), and ILIAS\Data\Password\LocalUserPasswordManager\verifyPassword().

225  : ?string
226  {
228  }
string $password_encoding_type
+ Here is the caller graph for this function:

◆ getPasswordPolicyResetStatus()

ilObjUser::getPasswordPolicyResetStatus ( )

Definition at line 1535 of file class.ilObjUser.php.

References $passwd_policy_reset.

Referenced by isPasswordChangeDemanded().

1535  : bool
1536  {
1538  }
bool $passwd_policy_reset
+ Here is the caller graph for this function:

◆ getPasswordSalt()

ilObjUser::getPasswordSalt ( )

Definition at line 235 of file class.ilObjUser.php.

References $password_salt.

Referenced by ILIAS\Data\Password\LocalUserPasswordManager\encodePassword(), resetPassword(), saveAsNew(), update(), and ILIAS\Data\Password\LocalUserPasswordManager\verifyPassword().

235  : ?string
236  {
237  return $this->password_salt;
238  }
string $password_salt
+ Here is the caller graph for this function:

◆ getPCClipboardContent()

ilObjUser::getPCClipboardContent ( )

Add a page content item to PC clipboard (should go to another class)

Todo:
move to COPage service

Definition at line 2434 of file class.ilObjUser.php.

References ilObject\$db, $ilDB, ilSession\get(), and ilObject\getId().

Referenced by ILIAS\UI\Implementation\Component\Layout\Page\PageContentManager\pasteContents().

2434  : array // Missing array type.
2435  {
2436  $ilDB = $this->db;
2437 
2438  if (!ilSession::get('user_pc_clip')) {
2439  return [];
2440  }
2441 
2442  $set = $ilDB->queryF('SELECT MAX(insert_time) mtime FROM personal_pc_clipboard ' .
2443  ' WHERE user_id = %s', ['integer'], [$this->getId()]);
2444  $row = $ilDB->fetchAssoc($set);
2445 
2446  $set = $ilDB->queryF(
2447  'SELECT * FROM personal_pc_clipboard ' .
2448  ' WHERE user_id = %s AND insert_time = %s ORDER BY order_nr ASC',
2449  ['integer', 'timestamp'],
2450  [$this->getId(), $row['mtime']]
2451  );
2452  $content = [];
2453  while ($row = $ilDB->fetchAssoc($set)) {
2454  $content[] = $row['content'];
2455  }
2456 
2457  return $content;
2458  }
static get(string $a_var)
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPersonalDataExportFile()

ilObjUser::getPersonalDataExportFile ( )

Definition at line 3982 of file class.ilObjUser.php.

References ilExport\_getExportDirectory(), ilFileUtils\getDir(), and ilObject\getId().

Referenced by sendPersonalDataFile().

3982  : string
3983  {
3984  $dir = ilExport::_getExportDirectory($this->getId(), 'xml', 'usr', 'personal_data');
3985  if (!is_dir($dir)) {
3986  return '';
3987  }
3988  foreach (ilFileUtils::getDir($dir) as $entry) {
3989  if (is_int(strpos($entry['entry'], '.zip'))) {
3990  return $entry['entry'];
3991  }
3992  }
3993 
3994  return '';
3995  }
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPersonalPicturePath()

ilObjUser::getPersonalPicturePath ( string  $a_size = 'small',
bool  $a_force_pic = false 
)
Parameters
string$a_size'small', 'xsmall' or 'xxsmall'
Exceptions
ilWACException

Definition at line 2895 of file class.ilObjUser.php.

References ilObject\getId(), and ILIAS\Repository\int().

Referenced by ilForumAuthorInformation\getUserImagePath().

2898  : string {
2899  if (isset(self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic])) {
2900  return self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic];
2901  }
2902 
2903  self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic] = self::_getPersonalPicturePath($this->getId(), $a_size, $a_force_pic);
2904 
2905  return self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic];
2906  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPhoneHome()

ilObjUser::getPhoneHome ( )

Definition at line 1426 of file class.ilObjUser.php.

References $phone_home.

Referenced by deleteUserDefinedFieldEntries().

1426  : string
1427  {
1428  return $this->phone_home;
1429  }
string $phone_home
+ Here is the caller graph for this function:

◆ getPhoneMobile()

ilObjUser::getPhoneMobile ( )

Definition at line 1436 of file class.ilObjUser.php.

References $phone_mobile.

Referenced by deleteUserDefinedFieldEntries().

1436  : string
1437  {
1438  return $this->phone_mobile;
1439  }
string $phone_mobile
+ Here is the caller graph for this function:

◆ getPhoneOffice()

ilObjUser::getPhoneOffice ( )

Definition at line 1416 of file class.ilObjUser.php.

References $phone_office.

Referenced by deleteUserDefinedFieldEntries().

1416  : string
1417  {
1418  return $this->phone_office;
1419  }
string $phone_office
+ Here is the caller graph for this function:

◆ getPref()

ilObjUser::getPref ( string  $a_keyword)

Definition at line 1065 of file class.ilObjUser.php.

References null.

Referenced by ilBadgeProfileGUI\getBackpackMail(), getDateFormat(), ilCalendarAgendaListGUI\getPeriod(), ilPublicUserProfileGUI\getPublicPref(), getTimeFormat(), getTimeZone(), hasDeletionFlag(), ilTutorialSupportBlockGUI\hasPublicProfile(), hasPublicProfile(), ilContainerSessionsContentGUI\initSessionPresentationLimitation(), ilStartUpGUI\processIndexPHP(), and ilValidator\purgeObjects().

1065  : ?string
1066  {
1067  return $this->prefs[$a_keyword] ?? null;
1068  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ getProfileIncomplete()

ilObjUser::getProfileIncomplete ( )

Definition at line 1838 of file class.ilObjUser.php.

References $profile_incomplete, and ANONYMOUS_USER_ID.

Referenced by saveAsNew(), and update().

1838  : bool
1839  {
1840  if ($this->id == ANONYMOUS_USER_ID) {
1841  return false;
1842  }
1844  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
bool $profile_incomplete
+ Here is the caller graph for this function:

◆ getProfileStatusOfUsers()

static ilObjUser::getProfileStatusOfUsers ( array  $a_user_ids)
static

Get profile status.

Parameters
int[]$a_user_ids user ids
Returns
array[] array['global'] => all user ids having their profile global (www) activated, array['local'] => all user ids having their profile only locally (logged in users) activated, array['public'] => all user ids having their profile either locally or globally activated, array['not_public'] => all user ids having their profile deactivated

Definition at line 4297 of file class.ilObjUser.php.

References $DIC, $id, $ilDB, and $r.

Referenced by ilInternalLink\searchUsers().

4299  : array {
4300  global $DIC;
4301 
4302  $ilDB = $DIC->database();
4303 
4304  $set = $ilDB->query(
4305  'SELECT * FROM usr_pref ' .
4306  ' WHERE keyword = ' . $ilDB->quote('public_profile', 'text') .
4307  ' AND ' . $ilDB->in('usr_id', $a_user_ids, false, 'integer')
4308  );
4309  $r = [
4310  'global' => [],
4311  'local' => [],
4312  'public' => [],
4313  'not_public' => []
4314  ];
4315  while ($rec = $ilDB->fetchAssoc($set)) {
4316  if ($rec['value'] == 'g') {
4317  $r['global'][] = $rec['usr_id'];
4318  $r['public'][] = $rec['usr_id'];
4319  }
4320  if ($rec['value'] == 'y') {
4321  $r['local'][] = $rec['usr_id'];
4322  $r['public'][] = $rec['usr_id'];
4323  }
4324  }
4325  foreach ($a_user_ids as $id) {
4326  if (!in_array($id, $r['public'])) {
4327  $r['not_public'][] = $id;
4328  }
4329  }
4330 
4331  return $r;
4332  }
global $DIC
Definition: shib_login.php:26
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$r
+ Here is the caller graph for this function:

◆ getPublicName()

ilObjUser::getPublicName ( )

returns firstname lastname and login if profile is public, login otherwise

Definition at line 3597 of file class.ilObjUser.php.

References getFirstname(), getLastname(), getLogin(), and hasPublicProfile().

Referenced by ilPDMailBlockGUI\getListItemForData().

3597  : string
3598  {
3599  if ($this->hasPublicProfile()) {
3600  return $this->getFirstname() . ' ' . $this->getLastname() . ' (' . $this->getLogin() . ')';
3601  } else {
3602  return $this->getLogin();
3603  }
3604  }
hasPublicProfile()
returns true if public is profile, false otherwise
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSecondEmail()

ilObjUser::getSecondEmail ( )

Definition at line 1494 of file class.ilObjUser.php.

References $second_email.

Referenced by deleteUserDefinedFieldEntries().

1494  : ?string
1495  {
1496  return $this->second_email;
1497  }
string $second_email
+ Here is the caller graph for this function:

◆ getSelectedCountry()

ilObjUser::getSelectedCountry ( )

Get selected country (selection drop down)

Definition at line 1406 of file class.ilObjUser.php.

References $sel_country.

Referenced by deleteUserDefinedFieldEntries().

1406  : string
1407  {
1408  return $this->sel_country;
1409  }
string $sel_country
+ Here is the caller graph for this function:

◆ getStoredActive()

ilObjUser::getStoredActive ( int  $a_id)

get user active state

Definition at line 1752 of file class.ilObjUser.php.

Referenced by syncActive(), and update().

1752  : bool
1753  {
1754  return (bool) self::_lookup($a_id, 'active');
1755  }
+ Here is the caller graph for this function:

◆ getStreet()

ilObjUser::getStreet ( )

Definition at line 1360 of file class.ilObjUser.php.

References $street.

Referenced by ilPersonalProfileGUI\addLocationToForm(), and deleteUserDefinedFieldEntries().

1360  : string
1361  {
1362  return $this->street;
1363  }
string $street
+ Here is the caller graph for this function:

◆ getTimeFormat()

ilObjUser::getTimeFormat ( )

Definition at line 1020 of file class.ilObjUser.php.

References ilCalendarSettings\_getInstance(), and getPref().

Referenced by getDateTimeFormat(), and ilIndividualAssessmentDateFormatter\getUserDateFormat().

1020  : string
1021  {
1022  if ($format = $this->getPref('time_format')) {
1023  return $format;
1024  } else {
1025  $settings = ilCalendarSettings::_getInstance();
1026  return $settings->getDefaultTimeFormat();
1027  }
1028  }
getPref(string $a_keyword)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTimeLimitFrom()

ilObjUser::getTimeLimitFrom ( )

Definition at line 1777 of file class.ilObjUser.php.

References $time_limit_from.

Referenced by checkTimeLimit(), deleteUserDefinedFieldEntries(), ilAccountMail\replacePlaceholders(), saveAsNew(), ilAccountMail\send(), and update().

1777  : ?int
1778  {
1779  return $this->time_limit_from;
1780  }
int $time_limit_from
+ Here is the caller graph for this function:

◆ getTimeLimitMessage()

ilObjUser::getTimeLimitMessage ( )

Definition at line 1807 of file class.ilObjUser.php.

References $time_limit_message.

Referenced by update().

1807  : string
1808  {
1810  }
string $time_limit_message
+ Here is the caller graph for this function:

◆ getTimeLimitOwner()

ilObjUser::getTimeLimitOwner ( )

Definition at line 1767 of file class.ilObjUser.php.

Referenced by saveAsNew(), and update().

1767  : int
1768  {
1769  return $this->time_limit_owner ?: 7;
1770  }
+ Here is the caller graph for this function:

◆ getTimeLimitUnlimited()

ilObjUser::getTimeLimitUnlimited ( )

Definition at line 1797 of file class.ilObjUser.php.

References $time_limit_unlimited.

Referenced by checkTimeLimit(), deleteUserDefinedFieldEntries(), ilAccountMail\replacePlaceholders(), saveAsNew(), and update().

1797  : bool
1798  {
1800  }
bool $time_limit_unlimited
+ Here is the caller graph for this function:

◆ getTimeLimitUntil()

ilObjUser::getTimeLimitUntil ( )

Definition at line 1787 of file class.ilObjUser.php.

References $time_limit_until.

Referenced by checkTimeLimit(), deleteUserDefinedFieldEntries(), ilECSAppEventListener\extendAccount(), ilAccountMail\replacePlaceholders(), saveAsNew(), ilAccountMail\send(), and update().

1787  : ?int
1788  {
1789  return $this->time_limit_until;
1790  }
int $time_limit_until
+ Here is the caller graph for this function:

◆ getTimeZone()

ilObjUser::getTimeZone ( )

Definition at line 1010 of file class.ilObjUser.php.

References ilCalendarSettings\_getInstance(), and getPref().

1010  : string
1011  {
1012  if ($tz = $this->getPref('user_tz')) {
1013  return $tz;
1014  } else {
1015  $settings = ilCalendarSettings::_getInstance();
1016  return $settings->getDefaultTimeZone();
1017  }
1018  }
getPref(string $a_keyword)
+ Here is the call graph for this function:

◆ getUserDefinedData()

ilObjUser::getUserDefinedData ( )

Definition at line 3006 of file class.ilObjUser.php.

Referenced by deleteUserDefinedFieldEntries().

3006  : array // Missing array type.
3007  {
3008  return $this->user_defined_data ?: [];
3009  }
+ Here is the caller graph for this function:

◆ getUserIdByLogin()

◆ getUserIdsByEmail()

static ilObjUser::getUserIdsByEmail ( string  $a_email)
static
Returns
int[] of user ids

Definition at line 2086 of file class.ilObjUser.php.

References $DIC, $ilDB, $res, and ILIAS\Repository\int().

Referenced by ilObjSurvey\sendNotificationMail().

2086  : array
2087  {
2088  global $DIC;
2089 
2090  $ilDB = $DIC->database();
2091 
2092  $res = $ilDB->queryF(
2093  'SELECT usr_id FROM usr_data ' .
2094  'WHERE email = %s and active = 1',
2095  ['text'],
2096  [$a_email]
2097  );
2098  $ids = [];
2099  while ($row = $ilDB->fetchObject($res)) {
2100  $ids[] = (int) $row->usr_id;
2101  }
2102 
2103  return $ids;
2104  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUserIdsByInactivityPeriod()

static ilObjUser::getUserIdsByInactivityPeriod ( int  $periodInDays)
static

Get ids of all users that have been inactive for at least the given period.

Parameters
int$periodInDays
Returns
int[]
Exceptions
ilException

Definition at line 3823 of file class.ilObjUser.php.

References $DIC, $res, and ILIAS\Repository\int().

Referenced by ilCronDeleteInactiveUserAccounts\run().

3825  : array {
3826  global $DIC;
3827 
3828  if ($periodInDays < 1) {
3829  throw new ilException('Invalid period given');
3830  }
3831 
3832  $date = date('Y-m-d H:i:s', (time() - ($periodInDays * 24 * 60 * 60)));
3833 
3834  $query = 'SELECT usr_id FROM usr_data WHERE last_login IS NOT NULL AND last_login < %s';
3835 
3836  $ids = [];
3837 
3838  $types = ['timestamp'];
3839  $values = [$date];
3840 
3841  $res = $DIC->database()->queryF($query, $types, $values);
3842  while ($row = $DIC->database()->fetchAssoc($res)) {
3843  $ids[] = (int) $row['usr_id'];
3844  }
3845 
3846  return $ids;
3847  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUserIdsNeverLoggedIn()

static ilObjUser::getUserIdsNeverLoggedIn ( int  $thresholdInDays)
static

Get ids of all users that have never logged in.

Parameters
int$thresholdInDays
Returns
int[]

Definition at line 3854 of file class.ilObjUser.php.

References $DIC, $res, and ILIAS\Repository\int().

Referenced by ilCronDeleteNeverLoggedInUserAccounts\run().

3856  : array {
3857  global $DIC;
3858 
3859  $date = date('Y-m-d H:i:s', (time() - ($thresholdInDays * 24 * 60 * 60)));
3860 
3861  $query = 'SELECT usr_id FROM usr_data WHERE last_login IS NULL AND create_date < %s';
3862 
3863  $ids = [];
3864 
3865  $types = ['timestamp'];
3866  $values = [$date];
3867 
3868  $res = $DIC->database()->queryF($query, $types, $values);
3869  while ($row = $DIC->database()->fetchAssoc($res)) {
3870  $ids[] = (int) $row['usr_id'];
3871  }
3872 
3873  return $ids;
3874  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUserLoginsByEmail()

static ilObjUser::getUserLoginsByEmail ( string  $a_email)
static
Returns
string[] with all user login names

Definition at line 2110 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

Referenced by ilPasswordAssistanceGUI\submitUsernameAssistanceForm().

2110  : array
2111  {
2112  global $DIC;
2113 
2114  $ilDB = $DIC->database();
2115 
2116  $res = $ilDB->queryF(
2117  'SELECT login FROM usr_data ' .
2118  'WHERE email = %s and active = 1',
2119  ['text'],
2120  [$a_email]
2121  );
2122  $ids = [];
2123  while ($row = $ilDB->fetchObject($res)) {
2124  $ids[] = $row->login;
2125  }
2126 
2127  return $ids;
2128  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ getUserSubsetByPreferenceValue()

static ilObjUser::getUserSubsetByPreferenceValue ( array  $a_user_ids,
string  $a_keyword,
string  $a_val 
)
static

For a given set of user IDs return a subset that has a given user preference set.

Definition at line 3517 of file class.ilObjUser.php.

References $DIC, and $ilDB.

Referenced by ceLTIc\LTI\User\Collector\collectUsers().

3521  : array {
3522  global $DIC;
3523 
3524  $ilDB = $DIC['ilDB'];
3525 
3526  $users = [];
3527  $set = $ilDB->query(
3528  'SELECT usr_id FROM usr_pref ' .
3529  ' WHERE keyword = ' . $ilDB->quote($a_keyword, 'text') .
3530  ' AND ' . $ilDB->in('usr_id', $a_user_ids, false, 'integer') .
3531  ' AND value = ' . $ilDB->quote($a_val, 'text')
3532  );
3533  while ($rec = $ilDB->fetchAssoc($set)) {
3534  $users[] = $rec['usr_id'];
3535  }
3536  return $users;
3537  }
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ getUTitle()

ilObjUser::getUTitle ( )

Definition at line 1310 of file class.ilObjUser.php.

References $utitle.

Referenced by deleteUserDefinedFieldEntries(), and ilCmiXapiUser\getName().

1310  : string
1311  {
1312  return $this->utitle;
1313  }
string $utitle
+ Here is the caller graph for this function:

◆ getZipcode()

ilObjUser::getZipcode ( )

Definition at line 1380 of file class.ilObjUser.php.

References $zipcode.

Referenced by deleteUserDefinedFieldEntries().

1380  : string
1381  {
1382  return $this->zipcode;
1383  }
string $zipcode
+ Here is the caller graph for this function:

◆ hasActiveSession()

static ilObjUser::hasActiveSession ( int  $a_user_id,
string  $a_session_id 
)
static

Definition at line 1989 of file class.ilObjUser.php.

References $DIC, and $ilDB.

Referenced by ilAuthFrontend\checkSimultaneousLogins().

1992  : bool {
1993  global $DIC;
1994 
1995  $ilDB = $DIC['ilDB'];
1996 
1997  $set = $ilDB->queryf(
1998  '
1999  SELECT COUNT(*) session_count
2000  FROM usr_session WHERE user_id = %s AND expires > %s AND session_id != %s ',
2001  ['integer', 'integer', 'text'],
2002  [$a_user_id, time(), $a_session_id]
2003  );
2004  $row = $ilDB->fetchAssoc($set);
2005  return (bool) $row['session_count'];
2006  }
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ hasDeletionFlag()

ilObjUser::hasDeletionFlag ( )

Definition at line 4066 of file class.ilObjUser.php.

References getPref().

4066  : bool
4067  {
4068  return (bool) $this->getPref('delete_flag');
4069  }
getPref(string $a_keyword)
+ Here is the call graph for this function:

◆ hasProfilePicture()

ilObjUser::hasProfilePicture ( )

Definition at line 2908 of file class.ilObjUser.php.

References ilObject\getId().

2908  : bool
2909  {
2910  return (new ilUserAvatarResolver($this->getId()))->hasProfilePicture();
2911  }
Class ilUserAvatarResolver.
+ Here is the call graph for this function:

◆ hasPublicProfile()

ilObjUser::hasPublicProfile ( )

returns true if public is profile, false otherwise

Definition at line 3589 of file class.ilObjUser.php.

References getPref().

Referenced by getPublicName().

3589  : bool
3590  {
3591  return in_array($this->getPref('public_profile'), ['y', 'g']);
3592  }
getPref(string $a_keyword)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importPersonalData()

ilObjUser::importPersonalData ( array  $a_file,
bool  $a_profile_data,
bool  $a_settings,
bool  $a_notes,
bool  $a_calendar 
)

Definition at line 4006 of file class.ilObjUser.php.

4012  : void {
4013  $imp = new ilImport();
4014  // bookmarks need to be skipped, importer does not exist anymore
4015  $imp->addSkipImporter('components/ILIAS/Bookmarks');
4016  if (!$a_profile_data) {
4017  $imp->addSkipEntity('components/ILIAS/User', 'usr_profile');
4018  }
4019  if (!$a_settings) {
4020  $imp->addSkipEntity('components/ILIAS/User', 'usr_setting');
4021  }
4022  if (!$a_notes) {
4023  $imp->addSkipEntity('components/ILIAS/Notes', 'user_notes');
4024  }
4025  if (!$a_calendar) {
4026  $imp->addSkipEntity('components/ILIAS/Calendar', 'calendar');
4027  }
4028  $imp->importEntity(
4029  $a_file['tmp_name'],
4030  $a_file['name'],
4031  'usr',
4032  'components/ILIAS/User'
4033  );
4034  }
Import class.

◆ isAnonymous()

ilObjUser::isAnonymous ( )

Definition at line 4046 of file class.ilObjUser.php.

References ilObject\getId().

Referenced by ilUsersGalleryGUI\getActionsSection(), ilMailGlobalServices\getNewMailsData(), and ilTutorialSupportBlockGUI\isUserValid().

4046  : bool
4047  {
4048  return self::_isAnonymous($this->getId());
4049  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCurrentUserActive()

ilObjUser::isCurrentUserActive ( )

Definition at line 2058 of file class.ilObjUser.php.

References ilObject\$db, and $ilDB.

2058  : bool
2059  {
2060  $ilDB = $this->db;
2061 
2062  $login = self::getLoginFromAuth();
2063  $set = $ilDB->queryF(
2064  'SELECT active FROM usr_data WHERE login= %s',
2065  ['text'],
2066  [$login]
2067  );
2068  //query has got a result
2069  if ($rec = $ilDB->fetchAssoc($set)) {
2070  if ($rec['active']) {
2071  return true;
2072  }
2073  }
2074 
2075  return false;
2076  }
ilDBInterface $db

◆ isPasswordChangeDemanded()

ilObjUser::isPasswordChangeDemanded ( )

Definition at line 1846 of file class.ilObjUser.php.

References ilSecuritySettings\_getInstance(), ilAuthUtils\_needsExternalAccountByAuthMode(), ANONYMOUS_USER_ID, getAuthMode(), getLastPasswordChangeTS(), getPasswordPolicyResetStatus(), and SYSTEM_USER_ID.

Referenced by ILIAS\Data\Password\LocalUserPasswordManager\allowPasswordChange().

1846  : bool
1847  {
1848  if ($this->id == ANONYMOUS_USER_ID) {
1849  return false;
1850  }
1851 
1852  if ($this->id == SYSTEM_USER_ID) {
1853  if (
1854  LocalUserPasswordManager::getInstance()->verifyPassword($this, base64_decode('aG9tZXI=')) &&
1856  ) {
1857  return true;
1858  } else {
1859  return false;
1860  }
1861  }
1862 
1863  $security = ilSecuritySettings::_getInstance();
1864 
1865  $authModeAllowsPasswordChange = !ilAuthUtils::_needsExternalAccountByAuthMode($this->getAuthMode(true));
1866  $passwordResetOnFirstLogin = (
1867  $security->isPasswordChangeOnFirstLoginEnabled() &&
1868  $this->getLastPasswordChangeTS() == 0 && $this->is_self_registered == false
1869  );
1870  $passwordResetOnChangedPolicy = $this->getPasswordPolicyResetStatus();
1871 
1872  return ($authModeAllowsPasswordChange && ($passwordResetOnFirstLogin || $passwordResetOnChangedPolicy));
1873  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
getPasswordPolicyResetStatus()
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26
static _needsExternalAccountByAuthMode($a_auth_mode)
Check if chosen auth mode needs an external account entry.
getAuthMode(bool $a_auth_key=false)
static _getInstance()
Get instance of ilSecuritySettings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isPasswordExpired()

ilObjUser::isPasswordExpired ( )

Definition at line 1875 of file class.ilObjUser.php.

References ilSecuritySettings\_getInstance(), ilAuthUtils\_needsExternalAccountByAuthMode(), ANONYMOUS_USER_ID, getAuthMode(), and getLastPasswordChangeTS().

Referenced by ILIAS\Data\Password\LocalUserPasswordManager\allowPasswordChange().

1875  : bool
1876  {
1877  if ($this->id == ANONYMOUS_USER_ID) {
1878  return false;
1879  }
1880 
1881  $security = ilSecuritySettings::_getInstance();
1882  if ($this->getLastPasswordChangeTS() > 0) {
1883  $max_pass_age = $security->getPasswordMaxAge();
1884  if ($max_pass_age > 0) {
1885  $max_pass_age_ts = ($max_pass_age * 86400);
1886  $pass_change_ts = $this->getLastPasswordChangeTS();
1887  $current_ts = time();
1888 
1889  if (($current_ts - $pass_change_ts) > $max_pass_age_ts) {
1891  return true;
1892  }
1893  }
1894  }
1895  }
1896 
1897  return false;
1898  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
static _needsExternalAccountByAuthMode($a_auth_mode)
Check if chosen auth mode needs an external account entry.
getAuthMode(bool $a_auth_key=false)
static _getInstance()
Get instance of ilSecuritySettings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSelfRegistered()

ilObjUser::isSelfRegistered ( )

Definition at line 4076 of file class.ilObjUser.php.

References $is_self_registered.

4076  : bool
4077  {
4079  }
bool $is_self_registered

◆ lookupMatriculation()

static ilObjUser::lookupMatriculation ( int  $a_usr_id)
static

Definition at line 1471 of file class.ilObjUser.php.

References $DIC, $ilDB, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

1471  : string
1472  {
1473  global $DIC;
1474 
1475  $ilDB = $DIC['ilDB'];
1476 
1477  $query = 'SELECT matriculation FROM usr_data ' .
1478  'WHERE usr_id = ' . $ilDB->quote($a_usr_id);
1479  $res = $ilDB->query($query);
1480  $row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT);
1481  return $row->matriculation ?: '';
1482  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the caller graph for this function:

◆ lookupOrgUnitsRepresentation()

static ilObjUser::lookupOrgUnitsRepresentation ( int  $a_usr_id)
static

lookup org unit representation

Definition at line 2637 of file class.ilObjUser.php.

Referenced by ilUserTableGUI\getItems(), ilStudyProgrammeMailTemplateContext\getSpecificPlaceholders(), and ilMemberExport\write().

2639  : string {
2640  return ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_usr_id);
2641  }
+ Here is the caller graph for this function:

◆ read()

ilObjUser::read ( )
Exceptions
ilObjectNotFoundException
ilObjectTypeMismatchException
ilSystemStyleException

Definition at line 159 of file class.ilObjUser.php.

References $data, ilObject\$db, $DIC, $ilDB, $ilErr, $r, assignData(), readMultiTextFields(), readPrefs(), readUserDefinedFields(), setLastPasswordChangeTS(), setLoginAttempts(), setPasswordPolicyResetStatus(), ilStyleDefinition\skinExists(), ilStyleDefinition\styleExists(), and ilStyleDefinition\styleExistsForSkinId().

Referenced by __construct(), and update().

159  : void
160  {
161  global $DIC;
162 
163  $ilErr = $DIC['ilErr'];
164  $ilDB = $this->db;
165 
166  $r = $ilDB->queryF('SELECT * FROM usr_data ' .
167  'WHERE usr_id= %s', ['integer'], [$this->id]);
168 
169  if ($data = $ilDB->fetchAssoc($r)) {
170  // convert password storage layout used by table usr_data into
171  // storage layout used by class ilObjUser
172  $data['passwd_type'] = self::PASSWD_CRYPTED;
173 
174  // this assign must not be set via $this->assignData($data)
175  // because this method will be called on profile updates and
176  // would set this values to 0, because they arent posted from form
177  $this->setLastPasswordChangeTS($data['last_password_change']);
178  $this->setLoginAttempts($data['login_attempts']);
179  $this->setPasswordPolicyResetStatus((bool) $data['passwd_policy_reset']);
180 
181  // fill member vars in one shot
182  $this->assignData($data);
183 
184  //get userpreferences from usr_pref table
185  $this->readPrefs();
186 
187  if (!isset($this->prefs['language']) || $this->prefs['language'] === '') {
188  $this->prefs['language'] = $this->oldPrefs['language'] ?? '';
189  }
190 
191  if (
192  !isset($this->prefs['skin']) || $this->prefs['skin'] === '' ||
193  !ilStyleDefinition::skinExists($this->prefs['skin'])
194  ) {
195  $this->prefs['skin'] = $this->oldPrefs['skin'] ?? '';
196  }
197 
198  $this->skin = $this->prefs['skin'];
199 
200  if (
201  !isset($this->prefs['style']) ||
202  $this->prefs['style'] === '' ||
203  !ilStyleDefinition::styleExists($this->prefs['style']) ||
204  (
205  !ilStyleDefinition::skinExists($this->skin) &&
206  ilStyleDefinition::styleExistsForSkinId($this->skin, $this->prefs['style'])
207  )
208  ) {
209  //load default (css)
210  $this->prefs['skin'] = $this->ilias->ini->readVariable('layout', 'skin');
211  $this->prefs['style'] = $this->ilias->ini->readVariable('layout', 'style');
212  }
213  } else {
214  $ilErr->raiseError('<b>Error: There is no dataset with id ' .
215  $this->id . '!</b><br />class: ' . get_class($this) . '<br />Script: ' . __FILE__ .
216  '<br />Line: ' . __LINE__, $ilErr->FATAL);
217  }
218 
219  $this->readMultiTextFields();
220  $this->readUserDefinedFields();
221 
222  parent::read();
223  }
static styleExists(string $style_id)
assignData(array $a_data)
loads a record &#39;user&#39; from array
setLoginAttempts(int $a_login_attempts)
$ilErr
Definition: raiseError.php:33
setPasswordPolicyResetStatus(bool $status)
static styleExistsForSkinId(string $skin_id, string $style_id)
ilDBInterface $db
global $DIC
Definition: shib_login.php:26
Class ilObjForumAdministration.
setLastPasswordChangeTS(int $a_last_password_change_ts)
static skinExists(string $skin_id, ?ilSystemStyleConfig $system_style_config=null)
Check whether a skin exists.
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readMultiTextFields()

ilObjUser::readMultiTextFields ( )
protected

Definition at line 4171 of file class.ilObjUser.php.

References $DIC, $ilDB, ilObject\getId(), setGeneralInterests(), setLookingForHelp(), and setOfferingHelp().

Referenced by read().

4171  : void
4172  {
4173  global $DIC;
4174 
4175  $ilDB = $DIC['ilDB'];
4176 
4177  if (!$this->getId()) {
4178  return;
4179  }
4180 
4181  $set = $ilDB->query('SELECT field_id,value' .
4182  ' FROM usr_data_multi' .
4183  ' WHERE usr_id = ' . $ilDB->quote($this->getId(), 'integer') .
4184  ' ORDER BY value');
4185  while ($row = $ilDB->fetchAssoc($set)) {
4186  $values[$row['field_id']][] = $row['value'];
4187  }
4188 
4189  if (isset($values['interests_general'])) {
4190  $this->setGeneralInterests($values['interests_general']);
4191  } else {
4192  $this->setGeneralInterests();
4193  }
4194  if (isset($values['interests_help_offered'])) {
4195  $this->setOfferingHelp($values['interests_help_offered']);
4196  } else {
4197  $this->setOfferingHelp();
4198  }
4199  if (isset($values['interests_help_looking'])) {
4200  $this->setLookingForHelp($values['interests_help_looking']);
4201  } else {
4202  $this->setLookingForHelp();
4203  }
4204  }
setOfferingHelp(?array $value=null)
global $DIC
Definition: shib_login.php:26
setGeneralInterests(?array $value=null)
setLookingForHelp(?array $value=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readPrefs()

ilObjUser::readPrefs ( )

Definition at line 1093 of file class.ilObjUser.php.

References $prefs.

Referenced by read().

1093  : void
1094  {
1095  if (is_array($this->prefs)) {
1096  $this->oldPrefs = $this->prefs;
1097  }
1098  $this->prefs = self::_getPreferences($this->id);
1099  }
+ Here is the caller graph for this function:

◆ readUserDefinedFields()

ilObjUser::readUserDefinedFields ( )

Definition at line 3022 of file class.ilObjUser.php.

References ilObject\getId().

Referenced by read().

3022  : void
3023  {
3024  $udata = new ilUserDefinedData($this->getId());
3025  $this->user_defined_data = $udata->getAll();
3026  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refreshLogin()

ilObjUser::refreshLogin ( )

updates the login data of a 'user'

Todo:
set date with now() should be enough

Definition at line 743 of file class.ilObjUser.php.

References ilObject\$db, $id, $ilDB, and getFirstLogin().

743  : void
744  {
745  $ilDB = $this->db;
746 
747  $ilDB->manipulateF(
748  'UPDATE usr_data SET ' .
749  'last_login = ' . $ilDB->now() .
750  ' WHERE usr_id = %s',
751  ['integer'],
752  [$this->id]
753  );
754 
755  if ($this->getFirstLogin() == '') {
756  $ilDB->manipulateF(
757  'UPDATE usr_data SET ' .
758  'first_login = ' . $ilDB->now() .
759  ' WHERE usr_id = %s',
760  ['integer'],
761  [$this->id]
762  );
763  $this->app_event_handler->raise(
764  'components/ILIAS/User',
765  'firstLogin',
766  ['user_obj' => $this]
767  );
768  }
769  }
ilDBInterface $db
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ removeDeletionFlag()

ilObjUser::removeDeletionFlag ( )

Definition at line 4061 of file class.ilObjUser.php.

References writePref().

4061  : void
4062  {
4063  $this->writePref('delete_flag', false);
4064  }
writePref(string $a_keyword, string $a_value)
+ Here is the call graph for this function:

◆ removeObjectFromClipboard()

ilObjUser::removeObjectFromClipboard ( int  $a_item_id,
string  $a_type 
)

Definition at line 2603 of file class.ilObjUser.php.

References ilObject\$db, $ilDB, $q, and ilObject\getId().

2606  : void {
2607  $ilDB = $this->db;
2608 
2609  $q = 'DELETE FROM personal_clipboard WHERE ' .
2610  'item_id = ' . $ilDB->quote($a_item_id, 'integer') .
2611  ' AND type = ' . $ilDB->quote($a_type, 'text') . ' ' .
2612  ' AND user_id = ' . $ilDB->quote($this->getId(), 'integer');
2613  $ilDB->manipulate($q);
2614  }
ilDBInterface $db
$q
Definition: shib_logout.php:23
+ Here is the call graph for this function:

◆ removeUserPicture()

ilObjUser::removeUserPicture ( bool  $a_do_update = true)

Definition at line 2982 of file class.ilObjUser.php.

References getAvatarRid(), NO_AVATAR_RID, null, setAvatarRid(), setPref(), and update().

Referenced by delete().

2984  : void {
2985  if ($this->getAvatarRid() !== null && $this->getAvatarRid() !== self::NO_AVATAR_RID) {
2986  $rid = $this->irss->manage()->find($this->getAvatarRid());
2987  $this->irss->manage()->remove($rid, new ilUserProfilePictureStakeholder());
2988  }
2989 
2990  if ($a_do_update) {
2991  // remove user pref file name
2993  $this->setPref('profile_image', '');
2994  $this->update();
2995  }
2996  }
setAvatarRid(?string $avatar_rid)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const NO_AVATAR_RID
setPref(string $a_keyword, ?string $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetLastPasswordChange()

ilObjUser::resetLastPasswordChange ( )

Definition at line 1930 of file class.ilObjUser.php.

References ilObject\$db, $ilDB, and ilObject\getId().

1930  : bool
1931  {
1932  $ilDB = $this->db;
1933 
1934  $query = 'UPDATE usr_data SET last_password_change = 0 ' .
1935  'WHERE usr_id = %s';
1936  $affected = $ilDB->manipulateF(
1937  $query,
1938  ['integer'],
1939  [$this->getId()]
1940  );
1941  if ($affected) {
1942  return true;
1943  } else {
1944  return false;
1945  }
1946  }
ilDBInterface $db
+ Here is the call graph for this function:

◆ resetOwner()

ilObjUser::resetOwner ( )

Definition at line 3911 of file class.ilObjUser.php.

References ilObject\$db, $ilDB, and ilObject\getId().

Referenced by delete().

3911  : void
3912  {
3913  $ilDB = $this->db;
3914 
3915  $query = 'UPDATE object_data SET owner = 0 ' .
3916  'WHERE owner = ' . $ilDB->quote($this->getId(), 'integer');
3917  $ilDB->query($query);
3918  }
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetPassword()

ilObjUser::resetPassword ( string  $raw,
string  $raw_retype 
)

Resets the user password.

Parameters
string$rawPassword as plaintext
string$raw_retypeRetyped password as plaintext
Returns
bool true on success otherwise false
Exceptions
ilPasswordException
ilUserException

Definition at line 780 of file class.ilObjUser.php.

References ilObject\$db, $ilDB, ilObject\getId(), getPasswd(), getPasswordEncodingType(), and getPasswordSalt().

Referenced by ilPasswordAssistanceGUI\getAssignPasswordForm(), and ILIAS\Data\Password\LocalUserPasswordManager\verifyPassword().

783  : bool {
784  $ilDB = $this->db;
785 
786  if (func_num_args() != 2) {
787  return false;
788  }
789 
790  if (!isset($raw) || !isset($raw_retype)) {
791  return false;
792  }
793 
794  if ($raw != $raw_retype) {
795  return false;
796  }
797 
798  LocalUserPasswordManager::getInstance()->encodePassword($this, $raw);
799 
800  $ilDB->manipulateF(
801  'UPDATE usr_data
802  SET passwd = %s, passwd_enc_type = %s, passwd_salt = %s
803  WHERE usr_id = %s',
804  ['text', 'text', 'text', 'integer'],
805  [$this->getPasswd(), $this->getPasswordEncodingType(), $this->getPasswordSalt(), $this->getId()]
806  );
807 
808  return true;
809  }
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAsNew()

ilObjUser::saveAsNew ( )
Todo:
drop fields last_update & create_date.

redundant data in object_data!

Exceptions
ilPasswordException
ilUserException

Definition at line 340 of file class.ilObjUser.php.

References $active, $agree_date, $approve_date, $city, $client_ip, $country, ilObject\$db, $department, $DIC, $fax, $firstname, $gender, $hobby, $id, $ilDB, $ilErr, $inactivation_date, $institution, $lastname, $latitude, $login, $longitude, $matriculation, $passwd, $passwd_policy_reset, $phone_home, $phone_mobile, $phone_office, $referral_comment, $sel_country, $street, $utitle, $zipcode, getAuthMode(), getBirthday(), getExternalAccount(), getPasswd(), getPasswordEncodingType(), getPasswordSalt(), getProfileIncomplete(), getTimeLimitFrom(), getTimeLimitOwner(), getTimeLimitUnlimited(), getTimeLimitUntil(), ILIAS\Repository\int(), ilUtil\now(), null, setInactivationDate(), updateMultiTextFields(), and updateUserDefinedFields().

340  : void
341  {
342  global $DIC;
343 
344  $ilAppEventHandler = $DIC['ilAppEventHandler'];
345 
346  $ilErr = $DIC['ilErr'];
347  $ilDB = $this->db;
348  $pw_value = '';
349 
350  switch ($this->passwd_type) {
351  case self::PASSWD_PLAIN:
352  if (strlen($this->passwd)) {
353  LocalUserPasswordManager::getInstance()->encodePassword($this, $this->passwd);
354  $pw_value = $this->getPasswd();
355  } else {
356  $pw_value = $this->passwd;
357  }
358  break;
359 
360  case self::PASSWD_CRYPTED:
361  $pw_value = $this->passwd;
362  break;
363 
364  default:
365  $ilErr->raiseError('<b>Error: passwd_type missing in function saveAsNew. ' .
366  $this->id . '!</b><br />class: ' . get_class($this) . '<br />Script: ' . __FILE__ .
367  '<br />Line: ' . __LINE__, $ilErr->FATAL);
368  }
369 
370  if (!$this->active) {
372  } else {
373  $this->setInactivationDate(null);
374  }
375 
376  $insert_array = [
377  'usr_id' => ['integer', $this->id],
378  'login' => ['text', $this->login],
379  'passwd' => ['text', $pw_value],
380  'passwd_enc_type' => ['text', $this->getPasswordEncodingType()],
381  'passwd_salt' => ['text', $this->getPasswordSalt()],
382  'firstname' => ['text', $this->firstname],
383  'lastname' => ['text', $this->lastname],
384  'title' => ['text', $this->utitle],
385  'gender' => ['text', $this->gender],
386  'email' => ['text', trim($this->email ?? '')],
387  'second_email' => ['text', trim($this->second_email ?? '')],
388  'hobby' => ['text', $this->hobby],
389  'institution' => ['text', $this->institution],
390  'department' => ['text', $this->department],
391  'street' => ['text', $this->street],
392  'city' => ['text', $this->city],
393  'zipcode' => ['text', $this->zipcode],
394  'country' => ['text', $this->country],
395  'sel_country' => ['text', $this->sel_country],
396  'phone_office' => ['text', $this->phone_office],
397  'phone_home' => ['text', $this->phone_home],
398  'phone_mobile' => ['text', $this->phone_mobile],
399  'fax' => ['text', $this->fax],
400  'birthday' => ['date', $this->getBirthday()],
401  'last_login' => ['timestamp', null],
402  'first_login' => ['timestamp', null],
403  'last_profile_prompt' => ['timestamp', null],
404  'last_update' => ['timestamp', ilUtil::now()],
405  'create_date' => ['timestamp', ilUtil::now()],
406  'referral_comment' => ['text', $this->referral_comment],
407  'matriculation' => ['text', $this->matriculation],
408  'client_ip' => ['text', $this->client_ip],
409  'approve_date' => ['timestamp', $this->approve_date],
410  'agree_date' => ['timestamp', $this->agree_date],
411  'active' => ['integer', $this->active],
412  'time_limit_unlimited' => ['integer', $this->getTimeLimitUnlimited()],
413  'time_limit_until' => ['integer', $this->getTimeLimitUntil()],
414  'time_limit_from' => ['integer', $this->getTimeLimitFrom()],
415  'time_limit_owner' => ['integer', $this->getTimeLimitOwner()],
416  'auth_mode' => ['text', $this->getAuthMode()],
417  'ext_account' => ['text', $this->getExternalAccount()],
418  'profile_incomplete' => ['integer', $this->getProfileIncomplete()],
419  'latitude' => ['text', $this->latitude],
420  'longitude' => ['text', $this->longitude],
421  'loc_zoom' => ['integer', (int) $this->loc_zoom],
422  'last_password_change' => ['integer', $this->last_password_change_ts],
423  'passwd_policy_reset' => ['integer', (int) $this->passwd_policy_reset],
424  'inactivation_date' => ['timestamp', $this->inactivation_date],
425  'is_self_registered' => ['integer', (int) $this->is_self_registered],
426  ];
427  $ilDB->insert('usr_data', $insert_array);
428 
429  $this->updateMultiTextFields(true);
430  $this->updateUserDefinedFields();
431 
432  // CREATE ENTRIES FOR MAIL BOX
433  $mbox = new ilMailbox($this->id);
434  $mbox->createDefaultFolder();
435 
436  $mail_options = new ilMailOptions($this->id);
437  $mail_options->createMailOptionsEntry();
438 
439  $ilAppEventHandler->raise(
440  'components/ILIAS/User',
441  'afterCreate',
442  ['user_obj' => $this]
443  );
444  }
string $passwd
string $utitle
string $street
string $phone_mobile
string $matriculation
string $longitude
string $institution
static now()
Return current timestamp in Y-m-d H:i:s format.
string $latitude
getAuthMode(bool $a_auth_key=false)
$ilErr
Definition: raiseError.php:33
string $agree_date
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
string $department
string $phone_home
ilDBInterface $db
setInactivationDate(?string $inactivation_date)
global $DIC
Definition: shib_login.php:26
string $country
string $phone_office
bool $passwd_policy_reset
string $gender
string $lastname
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
updateMultiTextFields(bool $a_create=false)
string $approve_date
string $client_ip
string $zipcode
string $referral_comment
string $inactivation_date
string $sel_country
string $firstname
+ Here is the call graph for this function:

◆ sendPersonalDataFile()

ilObjUser::sendPersonalDataFile ( )

Definition at line 3997 of file class.ilObjUser.php.

References ilExport\_getExportDirectory(), ilFileDelivery\deliverFileLegacy(), ilObject\getId(), and getPersonalDataExportFile().

3997  : void
3998  {
3999  $file = ilExport::_getExportDirectory($this->getId(), 'xml', 'usr', 'personal_data') .
4000  '/' . $this->getPersonalDataExportFile();
4001  if (is_file($file)) {
4003  }
4004  }
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
+ Here is the call graph for this function:

◆ setActive()

ilObjUser::setActive ( bool  $a_active,
int  $a_owner = 0 
)

set user active state and updates system fields appropriately

Parameters
int$a_ownerthe id of the person who approved the account, defaults to 6 (root)

Definition at line 1689 of file class.ilObjUser.php.

References null, setApproveDate(), and ilObject\setOwner().

Referenced by shibUser\create(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), ilStartUpGUI\processCode(), ilStartUpGUI\processIndexPHP(), and syncActive().

1692  : void {
1693  $this->setOwner($a_owner);
1694 
1695  if ($a_active) {
1696  $this->active = 1;
1697  $this->setApproveDate(date('Y-m-d H:i:s'));
1698  $this->setOwner($a_owner);
1699  } else {
1700  $this->active = 0;
1701  $this->setApproveDate(null);
1702  }
1703  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setApproveDate(?string $a_str)
set date the user account was activated null indicates that the user has not yet been activated ...
setOwner(int $usr_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAgreeDate()

ilObjUser::setAgreeDate ( ?string  $a_str)

Definition at line 1680 of file class.ilObjUser.php.

1680  : void
1681  {
1682  $this->agree_date = $a_str;
1683  }

◆ setApproveDate()

ilObjUser::setApproveDate ( ?string  $a_str)

set date the user account was activated null indicates that the user has not yet been activated

Definition at line 1666 of file class.ilObjUser.php.

Referenced by setActive().

1666  : void
1667  {
1668  $this->approve_date = $a_str;
1669  }
+ Here is the caller graph for this function:

◆ setAuthMode()

ilObjUser::setAuthMode ( ?string  $a_str)

Definition at line 2648 of file class.ilObjUser.php.

Referenced by assignData(), and ilObjUserGUI\loadValuesFromForm().

2648  : void
2649  {
2650  $this->auth_mode = $a_str;
2651  }
+ Here is the caller graph for this function:

◆ setAvatarRid()

ilObjUser::setAvatarRid ( ?string  $avatar_rid)

Definition at line 1983 of file class.ilObjUser.php.

References $avatar_rid.

Referenced by _uploadPersonalPicture(), and removeUserPicture().

1983  : void
1984  {
1985  $this->avatar_rid = $avatar_rid;
1986  }
string $avatar_rid
+ Here is the caller graph for this function:

◆ setBirthday()

ilObjUser::setBirthday ( ?string  $a_birthday)

Definition at line 3802 of file class.ilObjUser.php.

References IL_CAL_DATE, and null.

Referenced by assignData(), and ilObjUserGUI\loadValuesFromForm().

3802  : void
3803  {
3804  if ($a_birthday && strlen($a_birthday)) {
3805  $date = new ilDate($a_birthday, IL_CAL_DATE);
3806  $this->birthday = $date->get(IL_CAL_DATE);
3807  } else {
3808  $this->birthday = null;
3809  }
3810  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const IL_CAL_DATE
+ Here is the caller graph for this function:

◆ setCity()

ilObjUser::setCity ( string  $a_str)

Definition at line 1365 of file class.ilObjUser.php.

Referenced by assignData(), and ilObjUserGUI\loadValuesFromForm().

1365  : void
1366  {
1367  $this->city = $a_str;
1368  }
+ Here is the caller graph for this function:

◆ setClientIP()

ilObjUser::setClientIP ( string  $a_str)

Definition at line 1451 of file class.ilObjUser.php.

Referenced by assignData(), and ilObjUserGUI\loadValuesFromForm().

1451  : void
1452  {
1453  $this->client_ip = $a_str;
1454  }
+ Here is the caller graph for this function:

◆ setComment()

ilObjUser::setComment ( string  $a_str)

Definition at line 1652 of file class.ilObjUser.php.

Referenced by assignData(), and ilObjUserGUI\loadValuesFromForm().

1652  : void
1653  {
1654  $this->referral_comment = $a_str;
1655  }
+ Here is the caller graph for this function:

◆ setCountry()

ilObjUser::setCountry ( string  $a_str)

Definition at line 1385 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1385  : void
1386  {
1387  $this->country = $a_str;
1388  }
+ Here is the caller graph for this function:

◆ setCurrentLanguage()

ilObjUser::setCurrentLanguage ( string  $a_val)

Set current language.

Definition at line 1607 of file class.ilObjUser.php.

References ilSession\set().

Referenced by ILIAS\LearningModule\Export\LMHtmlExport\initLanguage().

1607  : void
1608  {
1609  ilSession::set('lang', $a_val);
1610  }
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDepartment()

ilObjUser::setDepartment ( string  $a_str)

Definition at line 1345 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1345  : void
1346  {
1347  $this->department = $a_str;
1348  }
+ Here is the caller graph for this function:

◆ setEmail()

ilObjUser::setEmail ( string  $a_str)

Definition at line 1484 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1484  : void
1485  {
1486  $this->email = $a_str;
1487  }
+ Here is the caller graph for this function:

◆ setExternalAccount()

ilObjUser::setExternalAccount ( string  $a_str)

Definition at line 2661 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), and ilObjUserGUI\loadValuesFromForm().

2661  : void
2662  {
2663  $this->ext_account = $a_str;
2664  }
+ Here is the caller graph for this function:

◆ setFax()

ilObjUser::setFax ( string  $a_str)

Definition at line 1441 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1441  : void
1442  {
1443  $this->fax = $a_str;
1444  }
+ Here is the caller graph for this function:

◆ setFirstLogin()

ilObjUser::setFirstLogin ( string  $a_str)

Definition at line 1622 of file class.ilObjUser.php.

Referenced by assignData().

1622  : void
1623  {
1624  $this->first_login = $a_str;
1625  }
+ Here is the caller graph for this function:

◆ setFirstname()

ilObjUser::setFirstname ( string  $a_str)

Definition at line 1315 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1315  : void
1316  {
1317  $this->firstname = $a_str;
1318  }
+ Here is the caller graph for this function:

◆ setFullname()

ilObjUser::setFullname ( )

builds a string with title + firstname + lastname method is used to build fullname in member variable $this->fullname.

But you may use the function in static manner.

Definition at line 1210 of file class.ilObjUser.php.

References $lastname.

Referenced by assignData(), and ilObjUserGUI\loadValuesFromForm().

1210  : void
1211  {
1212  $this->fullname = ($this->utitle != '')
1213  ? $this->utitle . ' '
1214  : '';
1215  $this->fullname .= $this->firstname . ' ';
1216  $this->fullname .= $this->lastname;
1217  }
string $lastname
+ Here is the caller graph for this function:

◆ setGender()

ilObjUser::setGender ( string  $a_str)

Definition at line 1290 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1290  : void
1291  {
1292  $this->gender = substr($a_str, -1);
1293  }
+ Here is the caller graph for this function:

◆ setGeneralInterests()

ilObjUser::setGeneralInterests ( ?array  $value = null)
Parameters
string[]|null$value

Definition at line 4089 of file class.ilObjUser.php.

Referenced by ilObjUserGUI\loadValuesFromForm(), and readMultiTextFields().

4089  : void
4090  {
4091  $this->interests_general = $value ?? [];
4092  }
+ Here is the caller graph for this function:

◆ setHobby()

ilObjUser::setHobby ( string  $a_str)

Definition at line 1504 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1504  : void
1505  {
1506  $this->hobby = $a_str;
1507  }
+ Here is the caller graph for this function:

◆ setInactivationDate()

ilObjUser::setInactivationDate ( ?string  $inactivation_date)

Definition at line 4036 of file class.ilObjUser.php.

References $inactivation_date.

Referenced by assignData(), saveAsNew(), and update().

4036  : void
4037  {
4038  $this->inactivation_date = $inactivation_date;
4039  }
string $inactivation_date
+ Here is the caller graph for this function:

◆ setInstitution()

ilObjUser::setInstitution ( string  $a_str)

Definition at line 1335 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1335  : void
1336  {
1337  $this->institution = $a_str;
1338  }
+ Here is the caller graph for this function:

◆ setIsSelfRegistered()

ilObjUser::setIsSelfRegistered ( bool  $status)

Definition at line 4071 of file class.ilObjUser.php.

Referenced by assignData().

4071  : void
4072  {
4073  $this->is_self_registered = $status;
4074  }
+ Here is the caller graph for this function:

◆ setLanguage()

ilObjUser::setLanguage ( string  $a_str)

Definition at line 1514 of file class.ilObjUser.php.

References ilSession\clear(), and setPref().

Referenced by shibUser\createFields(), ILIAS\LearningModule\Export\LMHtmlExport\initLanguage(), and shibUser\updateFields().

1514  : void
1515  {
1516  $this->setPref('language', $a_str);
1517  ilSession::clear('lang');
1518  }
setPref(string $a_keyword, ?string $a_value)
static clear(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLastLogin()

ilObjUser::setLastLogin ( string  $a_str)

Definition at line 1612 of file class.ilObjUser.php.

Referenced by assignData().

1612  : void
1613  {
1614  $this->last_login = $a_str;
1615  }
+ Here is the caller graph for this function:

◆ setLastname()

ilObjUser::setLastname ( string  $a_str)

Definition at line 1325 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1325  : void
1326  {
1327  $this->lastname = $a_str;
1328  }
+ Here is the caller graph for this function:

◆ setLastPasswordChangeToNow()

ilObjUser::setLastPasswordChangeToNow ( )

Definition at line 1908 of file class.ilObjUser.php.

References $DIC, $ilDB, getLastPasswordChangeTS(), and setLastPasswordChangeTS().

Referenced by shibUser\buildInstance(), and ilPasswordAssistanceGUI\getAssignPasswordForm().

1908  : bool
1909  {
1910  global $DIC;
1911 
1912  $ilDB = $DIC['ilDB'];
1913 
1914  $this->setLastPasswordChangeTS(time());
1915 
1916  $query = 'UPDATE usr_data SET last_password_change = %s ' .
1917  'WHERE usr_id = %s';
1918  $affected = $ilDB->manipulateF(
1919  $query,
1920  ['integer','integer'],
1921  [$this->getLastPasswordChangeTS(),$this->id]
1922  );
1923  if ($affected) {
1924  return true;
1925  } else {
1926  return false;
1927  }
1928  }
global $DIC
Definition: shib_login.php:26
setLastPasswordChangeTS(int $a_last_password_change_ts)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLastPasswordChangeTS()

ilObjUser::setLastPasswordChangeTS ( int  $a_last_password_change_ts)

Definition at line 1525 of file class.ilObjUser.php.

Referenced by ilStartUpGUI\processIndexPHP(), read(), and setLastPasswordChangeToNow().

1525  : void
1526  {
1527  $this->last_password_change_ts = $a_last_password_change_ts;
1528  }
+ Here is the caller graph for this function:

◆ setLastProfilePrompt()

ilObjUser::setLastProfilePrompt ( string  $a_str)

Definition at line 1632 of file class.ilObjUser.php.

Referenced by assignData().

1632  : void
1633  {
1634  $this->last_profile_prompt = $a_str;
1635  }
+ Here is the caller graph for this function:

◆ setLastUpdate()

ilObjUser::setLastUpdate ( string  $a_str)

Definition at line 1642 of file class.ilObjUser.php.

Referenced by assignData().

1642  : void
1643  {
1644  $this->last_update = $a_str;
1645  }
+ Here is the caller graph for this function:

◆ setLatitude()

ilObjUser::setLatitude ( ?string  $a_latitude)

Definition at line 1948 of file class.ilObjUser.php.

Referenced by assignData(), and ilObjUserGUI\loadValuesFromForm().

1948  : void
1949  {
1950  $this->latitude = $a_latitude;
1951  }
+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjUser::setLocationZoom ( ?int  $a_locationzoom)

Definition at line 1968 of file class.ilObjUser.php.

Referenced by assignData(), and ilObjUserGUI\loadValuesFromForm().

1968  : void
1969  {
1970  $this->loc_zoom = $a_locationzoom;
1971  }
+ Here is the caller graph for this function:

◆ setLogin()

ilObjUser::setLogin ( string  $a_str)

Definition at line 1256 of file class.ilObjUser.php.

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

Referenced by assignData(), shibUser\createFields(), and ilObjUserGUI\loadValuesFromForm().

1256  : void
1257  {
1258  $this->login = $a_str;
1259  }
login()
description: > Example for rendring a login glyph.
Definition: login.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLoginAttempts()

ilObjUser::setLoginAttempts ( int  $a_login_attempts)

Definition at line 1812 of file class.ilObjUser.php.

Referenced by read().

1812  : void
1813  {
1814  $this->login_attempts = $a_login_attempts;
1815  }
+ Here is the caller graph for this function:

◆ setLongitude()

ilObjUser::setLongitude ( ?string  $a_longitude)

Definition at line 1958 of file class.ilObjUser.php.

Referenced by assignData(), and ilObjUserGUI\loadValuesFromForm().

1958  : void
1959  {
1960  $this->longitude = $a_longitude;
1961  }
+ Here is the caller graph for this function:

◆ setLookingForHelp()

ilObjUser::setLookingForHelp ( ?array  $value = null)
Parameters
string[]|null$value

Definition at line 4137 of file class.ilObjUser.php.

Referenced by ilObjUserGUI\loadValuesFromForm(), and readMultiTextFields().

4137  : void
4138  {
4139  $this->interests_help_looking = $value ?? [];
4140  }
+ Here is the caller graph for this function:

◆ setMatriculation()

ilObjUser::setMatriculation ( string  $a_str)

Definition at line 1461 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1461  : void
1462  {
1463  $this->matriculation = $a_str;
1464  }
+ Here is the caller graph for this function:

◆ setOfferingHelp()

ilObjUser::setOfferingHelp ( ?array  $value = null)
Parameters
string[]|null$value

Definition at line 4113 of file class.ilObjUser.php.

Referenced by ilObjUserGUI\loadValuesFromForm(), and readMultiTextFields().

4113  : void
4114  {
4115  $this->interests_help_offered = $value ?? [];
4116  }
+ Here is the caller graph for this function:

◆ setPasswd()

ilObjUser::setPasswd ( string  $a_str,
string  $a_type = ilObjUser::PASSWD_PLAIN 
)

Definition at line 1266 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ILIAS\Data\Password\LocalUserPasswordManager\encodePassword(), and ilStartUpGUI\processIndexPHP().

1269  : void {
1270  $this->passwd = $a_str;
1271  $this->passwd_type = $a_type;
1272  }
+ Here is the caller graph for this function:

◆ setPasswordEncodingType()

ilObjUser::setPasswordEncodingType ( ?string  $password_encryption_type)

Definition at line 230 of file class.ilObjUser.php.

Referenced by assignData(), and ILIAS\Data\Password\LocalUserPasswordManager\encodePassword().

230  : void
231  {
232  $this->password_encoding_type = $password_encryption_type;
233  }
+ Here is the caller graph for this function:

◆ setPasswordPolicyResetStatus()

ilObjUser::setPasswordPolicyResetStatus ( bool  $status)

Definition at line 1540 of file class.ilObjUser.php.

Referenced by read().

1540  : void
1541  {
1542  $this->passwd_policy_reset = $status;
1543  }
+ Here is the caller graph for this function:

◆ setPasswordSalt()

ilObjUser::setPasswordSalt ( ?string  $password_salt)

Definition at line 240 of file class.ilObjUser.php.

References $password_salt.

Referenced by assignData(), and ILIAS\Data\Password\LocalUserPasswordManager\encodePassword().

240  : void
241  {
242  $this->password_salt = $password_salt;
243  }
string $password_salt
+ Here is the caller graph for this function:

◆ setPhoneHome()

ilObjUser::setPhoneHome ( string  $a_str)

Definition at line 1421 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1421  : void
1422  {
1423  $this->phone_home = $a_str;
1424  }
+ Here is the caller graph for this function:

◆ setPhoneMobile()

ilObjUser::setPhoneMobile ( string  $a_str)

Definition at line 1431 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1431  : void
1432  {
1433  $this->phone_mobile = $a_str;
1434  }
+ Here is the caller graph for this function:

◆ setPhoneOffice()

ilObjUser::setPhoneOffice ( string  $a_str)

Definition at line 1411 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1411  : void
1412  {
1413  $this->phone_office = $a_str;
1414  }
+ Here is the caller graph for this function:

◆ setPref()

ilObjUser::setPref ( string  $a_keyword,
?string  $a_value 
)

Definition at line 1058 of file class.ilObjUser.php.

Referenced by removeUserPicture(), ilUserPrivacySettingsGUI\savePrivacySettings(), setLanguage(), ilMembershipNotifications\toggleUser(), and writePref().

1058  : void
1059  {
1060  if ($a_keyword != '') {
1061  $this->prefs[$a_keyword] = $a_value;
1062  }
1063  }
+ Here is the caller graph for this function:

◆ setProfileIncomplete()

ilObjUser::setProfileIncomplete ( bool  $a_prof_inc)

Definition at line 1833 of file class.ilObjUser.php.

Referenced by assignData().

1833  : void
1834  {
1835  $this->profile_incomplete = $a_prof_inc;
1836  }
+ Here is the caller graph for this function:

◆ setSecondEmail()

ilObjUser::setSecondEmail ( ?string  $second_email)

Definition at line 1499 of file class.ilObjUser.php.

References $second_email.

Referenced by assignData(), and ilObjUserGUI\loadValuesFromForm().

1499  : void
1500  {
1501  $this->second_email = $second_email;
1502  }
string $second_email
+ Here is the caller graph for this function:

◆ setSelectedCountry()

ilObjUser::setSelectedCountry ( string  $a_val)

Set selected country (selection drop down)

Definition at line 1398 of file class.ilObjUser.php.

Referenced by assignData(), and ilObjUserGUI\loadValuesFromForm().

1398  : void
1399  {
1400  $this->sel_country = $a_val;
1401  }
+ Here is the caller graph for this function:

◆ setSkin()

ilObjUser::setSkin ( string  $a_str)

Definition at line 1757 of file class.ilObjUser.php.

1757  : void
1758  {
1759  $this->skin = $a_str;
1760  }

◆ setStreet()

ilObjUser::setStreet ( string  $a_str)

Definition at line 1355 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1355  : void
1356  {
1357  $this->street = $a_str;
1358  }
+ Here is the caller graph for this function:

◆ setTimeLimitFrom()

ilObjUser::setTimeLimitFrom ( ?int  $a_from)

Definition at line 1772 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), and ilObjUserGUI\loadValuesFromForm().

1772  : void
1773  {
1774  $this->time_limit_from = $a_from;
1775  }
+ Here is the caller graph for this function:

◆ setTimeLimitMessage()

ilObjUser::setTimeLimitMessage ( string  $a_time_limit_message)

Definition at line 1802 of file class.ilObjUser.php.

Referenced by assignData().

1802  : void
1803  {
1804  $this->time_limit_message = $a_time_limit_message;
1805  }
+ Here is the caller graph for this function:

◆ setTimeLimitOwner()

ilObjUser::setTimeLimitOwner ( int  $a_owner)

Definition at line 1762 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), and ilObjUserGUI\loadValuesFromForm().

1762  : void
1763  {
1764  $this->time_limit_owner = $a_owner;
1765  }
+ Here is the caller graph for this function:

◆ setTimeLimitUnlimited()

ilObjUser::setTimeLimitUnlimited ( bool  $a_unlimited)

Definition at line 1792 of file class.ilObjUser.php.

Referenced by ilRegistrationCode\applyAccessLimits(), assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and ilStartUpGUI\processCode().

1792  : void
1793  {
1794  $this->time_limit_unlimited = $a_unlimited;
1795  }
+ Here is the caller graph for this function:

◆ setTimeLimitUntil()

ilObjUser::setTimeLimitUntil ( ?int  $a_until)

Definition at line 1782 of file class.ilObjUser.php.

Referenced by ilRegistrationCode\applyAccessLimits(), assignData(), shibUser\createFields(), ilECSAppEventListener\extendAccount(), ilObjUserGUI\loadValuesFromForm(), and ilStartUpGUI\processCode().

1782  : void
1783  {
1784  $this->time_limit_until = $a_until;
1785  }
+ Here is the caller graph for this function:

◆ setUserDefinedData()

ilObjUser::setUserDefinedData ( array  $a_data)

Definition at line 2999 of file class.ilObjUser.php.

References $data.

Referenced by ilObjUserGUI\loadUserDefinedDataFromForm().

2999  : void // Missing array type.
3000  {
3001  foreach ($a_data as $field => $data) {
3002  $this->user_defined_data['f_' . $field] = $data;
3003  }
3004  }
+ Here is the caller graph for this function:

◆ setUTitle()

ilObjUser::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)

Definition at line 1305 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1305  : void
1306  {
1307  $this->utitle = $a_str;
1308  }
+ Here is the caller graph for this function:

◆ setZipcode()

ilObjUser::setZipcode ( string  $a_str)

Definition at line 1375 of file class.ilObjUser.php.

Referenced by assignData(), shibUser\createFields(), ilObjUserGUI\loadValuesFromForm(), and shibUser\updateFields().

1375  : void
1376  {
1377  $this->zipcode = $a_str;
1378  }
+ Here is the caller graph for this function:

◆ syncActive()

ilObjUser::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

Definition at line 1731 of file class.ilObjUser.php.

References getStoredActive(), and setActive().

Referenced by update().

1731  : void
1732  {
1733  $storedActive = 0;
1734  if ($this->getStoredActive($this->id)) {
1735  $storedActive = 1;
1736  }
1737 
1738  $currentActive = 0;
1739  if ($this->active) {
1740  $currentActive = 1;
1741  }
1742 
1743  if ((!empty($storedActive) && empty($currentActive)) ||
1744  (empty($storedActive) && !empty($currentActive))) {
1745  $this->setActive($currentActive, self::getUserIdByLogin(self::getLoginFromAuth()));
1746  }
1747  }
getStoredActive(int $a_id)
get user active state
setActive(bool $a_active, int $a_owner=0)
set user active state and updates system fields appropriately
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toUsernameWithoutDomain()

static ilObjUser::toUsernameWithoutDomain ( string  $a_login)
static

Static function removes Microsoft domain name from username webdav related.

Definition at line 2040 of file class.ilObjUser.php.

2040  : string
2041  {
2042  // Remove all characters including the last slash or the last backslash
2043  // in the username
2044  $pos = strrpos($a_login, '/');
2045  $pos2 = strrpos($a_login, '\\');
2046  if ($pos === false || $pos < $pos2) {
2047  $pos = $pos2;
2048  }
2049  if (is_int($pos)) {
2050  $a_login = substr($a_login, $pos + 1);
2051  }
2052  return $a_login;
2053  }

◆ update()

ilObjUser::update ( )

Definition at line 446 of file class.ilObjUser.php.

References $active, $agree_date, ilObject\$app_event_handler, $approve_date, $city, $client_ip, $country, ilObject\$db, $department, $DIC, $fax, $gender, $hobby, $ilDB, $ilErr, $inactivation_date, $institution, $latitude, $longitude, $matriculation, $passwd, $phone_home, $phone_mobile, $phone_office, $referral_comment, $sel_country, $street, $utitle, $zipcode, getAuthMode(), getBirthday(), getExternalAccount(), getPasswd(), getPasswordEncodingType(), getPasswordSalt(), getProfileIncomplete(), getStoredActive(), getTimeLimitFrom(), getTimeLimitMessage(), getTimeLimitOwner(), getTimeLimitUnlimited(), getTimeLimitUntil(), ILIAS\Repository\int(), ilUtil\now(), null, read(), setInactivationDate(), syncActive(), updateMultiTextFields(), ilObject\updateOwner(), updateUserDefinedFields(), and writePrefs().

Referenced by _uploadPersonalPicture(), ilECSAppEventListener\extendAccount(), ilPasswordAssistanceGUI\getAssignPasswordForm(), ilStartUpGUI\processCode(), ilStartUpGUI\processIndexPHP(), removeUserPicture(), and ilUserPrivacySettingsGUI\savePrivacySettings().

446  : bool
447  {
448  global $DIC;
449 
450  $ilErr = $DIC['ilErr'];
451  $ilDB = $this->db;
452  $ilAppEventHandler = $this->app_event_handler;
453 
454  $this->syncActive();
455 
456  if ($this->getStoredActive($this->id) && !$this->active) {
458  } elseif ($this->active) {
459  $this->setInactivationDate(null);
460  }
461 
462  $update_array = [
463  'gender' => ['text', $this->gender],
464  'title' => ['text', $this->utitle],
465  'firstname' => ['text', substr($this->firstname, 0, 128)],
466  'lastname' => ['text', substr($this->lastname, 0, 128)],
467  'email' => ['text', substr(trim($this->email), 0, 128)],
468  'second_email' => ['text', trim($this->second_email ?? '')],
469  'birthday' => ['date', $this->getBirthday()],
470  'hobby' => ['text', $this->hobby],
471  'institution' => ['text', $this->institution],
472  'department' => ['text', $this->department],
473  'street' => ['text', $this->street],
474  'city' => ['text', $this->city],
475  'zipcode' => ['text', $this->zipcode],
476  'country' => ['text', $this->country],
477  'sel_country' => ['text', $this->sel_country],
478  'phone_office' => ['text', $this->phone_office],
479  'phone_home' => ['text', $this->phone_home],
480  'phone_mobile' => ['text', $this->phone_mobile],
481  'fax' => ['text', $this->fax],
482  'referral_comment' => ['text', $this->referral_comment],
483  'matriculation' => ['text', $this->matriculation],
484  'client_ip' => ['text', $this->client_ip],
485  'approve_date' => ['timestamp', $this->approve_date],
486  'active' => ['integer', $this->active],
487  'time_limit_unlimited' => ['integer', $this->getTimeLimitUnlimited()],
488  'time_limit_until' => ['integer', $this->getTimeLimitUntil()],
489  'time_limit_from' => ['integer', $this->getTimeLimitFrom()],
490  'time_limit_owner' => ['integer', $this->getTimeLimitOwner()],
491  'time_limit_message' => ['integer', $this->getTimeLimitMessage()],
492  'profile_incomplete' => ['integer', $this->getProfileIncomplete()],
493  'auth_mode' => ['text', $this->getAuthMode()],
494  'ext_account' => ['text', $this->getExternalAccount()],
495  'latitude' => ['text', $this->latitude],
496  'longitude' => ['text', $this->longitude],
497  'loc_zoom' => ['integer', (int) $this->loc_zoom],
498  'login_attempts' => ['integer', $this->login_attempts],
499  'last_password_change' => ['integer', $this->last_password_change_ts],
500  'passwd_policy_reset' => ['integer', $this->passwd_policy_reset],
501  'last_update' => ['timestamp', ilUtil::now()],
502  'inactivation_date' => ['timestamp', $this->inactivation_date],
503  'reg_hash' => ['text', null],
504  'rid' => [
505  'text',
506  ($this->avatar_rid ?? self::NO_AVATAR_RID)
507  ],
508  ];
509 
510  if ($this->agree_date === null || (is_string($this->agree_date) && strtotime($this->agree_date) !== false)) {
511  $update_array['agree_date'] = ['timestamp', $this->agree_date];
512  }
513  switch ($this->passwd_type) {
514  case self::PASSWD_PLAIN:
515  if (strlen($this->passwd)) {
516  LocalUserPasswordManager::getInstance()->encodePassword($this, $this->passwd);
517  $update_array['passwd'] = ['text', $this->getPasswd()];
518  } else {
519  $update_array['passwd'] = ['text', $this->passwd];
520  }
521  break;
522 
523  case self::PASSWD_CRYPTED:
524  $update_array['passwd'] = ['text', $this->passwd];
525  break;
526 
527  default:
528  $ilErr->raiseError('<b>Error: passwd_type missing in function update()' . $this->id . '!</b><br />class: ' .
529  get_class($this) . '<br />Script: ' . __FILE__ . '<br />Line: ' . __LINE__, $ilErr->FATAL);
530  }
531 
532  $update_array['passwd_enc_type'] = ['text', $this->getPasswordEncodingType()];
533  $update_array['passwd_salt'] = ['text', $this->getPasswordSalt()];
534 
535  $ilDB->update('usr_data', $update_array, ['usr_id' => ['integer', $this->id]]);
536 
537  $this->updateMultiTextFields();
538 
539  $this->writePrefs();
540 
541  // update user defined fields
542  $this->updateUserDefinedFields();
543 
544  parent::update();
545  $this->updateOwner();
546 
547  $this->read();
548 
549  $ilAppEventHandler->raise(
550  'components/ILIAS/User',
551  'afterUpdate',
552  ['user_obj' => $this]
553  );
554 
555  return true;
556  }
string $passwd
getStoredActive(int $a_id)
get user active state
string $utitle
string $street
string $phone_mobile
string $matriculation
string $longitude
string $institution
static now()
Return current timestamp in Y-m-d H:i:s format.
string $latitude
getAuthMode(bool $a_auth_key=false)
$ilErr
Definition: raiseError.php:33
string $agree_date
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
string $department
ilAppEventHandler $app_event_handler
string $phone_home
ilDBInterface $db
setInactivationDate(?string $inactivation_date)
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
global $DIC
Definition: shib_login.php:26
updateOwner()
update owner of object in db
string $country
string $phone_office
string $gender
updateMultiTextFields(bool $a_create=false)
string $approve_date
string $client_ip
string $zipcode
string $referral_comment
string $inactivation_date
string $sel_country
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateLogin()

ilObjUser::updateLogin ( string  $a_login)

update login name

Parameters
stringnew login
Returns
bool true on success; otherwise false
Exceptions
ilDateTimeException
ilUserException

Definition at line 868 of file class.ilObjUser.php.

References ilObject\$db, $DIC, Vendor\Package\$e, $ilDB, $ilSetting, ilObject\$lng, ilDatePresentation\formatDate(), ilObject\getId(), getLogin(), IL_CAL_UNIX, ILIAS\Repository\int(), ILIAS\UI\examples\Symbol\Glyph\Login\login(), null, and ilLanguage\txt().

868  : bool
869  {
870  global $DIC;
871 
872  $ilDB = $this->db;
873  $ilSetting = $DIC['ilSetting'];
874  $lng = $DIC->language();
875 
876  if (func_num_args() != 1) {
877  return false;
878  }
879 
880  if (!isset($a_login)) {
881  return false;
882  }
883 
884  $former_login = self::_lookupLogin($this->getId());
885 
886  // Update not necessary
887  if (0 == strcmp($a_login, $former_login)) {
888  return false;
889  }
890 
891  try {
892  $last_history_entry = self::_getLastHistoryDataByUserId($this->getId());
893  } catch (ilUserException $e) {
894  $last_history_entry = null;
895  }
896 
897  // throw exception if the desired loginame is already in history and it is not allowed to reuse it
898  if ((int) $ilSetting->get('allow_change_loginname') &&
899  (int) $ilSetting->get('reuse_of_loginnames') == 0 &&
900  self::_doesLoginnameExistInHistory($a_login)) {
901  throw new ilUserException($lng->txt('loginname_already_exists'));
902  } elseif ((int) $ilSetting->get('allow_change_loginname') &&
903  (int) $ilSetting->get('loginname_change_blocking_time') &&
904  is_array($last_history_entry) &&
905  $last_history_entry[1] + (int) $ilSetting->get('loginname_change_blocking_time') > time()) {
906  throw new ilUserException(
907  sprintf(
908  $lng->txt('changing_loginname_not_possible_info'),
910  new ilDateTime($last_history_entry[1], IL_CAL_UNIX)
911  ),
913  new ilDateTime(($last_history_entry[1] + (int) $ilSetting->get('loginname_change_blocking_time')), IL_CAL_UNIX)
914  )
915  )
916  );
917  } else {
918  // log old loginname in history
919  if ((int) $ilSetting->get('allow_change_loginname') &&
920  (int) $ilSetting->get('create_history_loginname')) {
921  self::_writeHistory($this->getId(), $former_login);
922  }
923 
924  //update login
925  $this->login = $a_login;
926 
927  $ilDB->manipulateF(
928  '
929  UPDATE usr_data
930  SET login = %s
931  WHERE usr_id = %s',
932  ['text', 'integer'],
933  [$this->getLogin(), $this->getId()]
934  );
935  }
936 
937  return true;
938  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
const IL_CAL_UNIX
login()
description: > Example for rendring a login glyph.
Definition: login.php:41
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ilLanguage $lng
ilDBInterface $db
global $DIC
Definition: shib_login.php:26
global $ilSetting
Definition: privfeed.php:31
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
+ Here is the call graph for this function:

◆ updateMultiTextFields()

ilObjUser::updateMultiTextFields ( bool  $a_create = false)

Definition at line 4206 of file class.ilObjUser.php.

References $DIC, $id, $ilDB, deleteMultiTextFields(), getGeneralInterests(), ilObject\getId(), getLookingForHelp(), and getOfferingHelp().

Referenced by saveAsNew(), and update().

4206  : void
4207  {
4208  global $DIC;
4209 
4210  $ilDB = $DIC['ilDB'];
4211 
4212  if (!$this->getId()) {
4213  return;
4214  }
4215 
4216  if (!$a_create) {
4217  $this->deleteMultiTextFields();
4218  }
4219 
4220  $map = [
4221  'interests_general' => $this->getGeneralInterests(),
4222  'interests_help_offered' => $this->getOfferingHelp(),
4223  'interests_help_looking' => $this->getLookingForHelp()
4224  ];
4225 
4226  foreach ($map as $id => $values) {
4227  if (is_array($values) && count($values)) {
4228  foreach ($values as $value) {
4229  $value = trim($value);
4230  if ($value) {
4231  $uniq_id = $ilDB->nextId('usr_data_multi');
4232 
4233  $ilDB->manipulate('INSERT usr_data_multi' .
4234  ' (id,usr_id,field_id,value) VALUES' .
4235  ' (' . $ilDB->quote($uniq_id, 'integer') .
4236  ',' . $ilDB->quote($this->getId(), 'integer') .
4237  ',' . $ilDB->quote($id, 'text') .
4238  ',' . $ilDB->quote($value, 'text') .
4239  ')');
4240  }
4241  }
4242  }
4243  }
4244  }
global $DIC
Definition: shib_login.php:26
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateUserDefinedFields()

ilObjUser::updateUserDefinedFields ( )

Definition at line 3011 of file class.ilObjUser.php.

References ilObject\getId(), and null.

Referenced by saveAsNew(), and update().

3011  : void
3012  {
3013  $udata = new ilUserDefinedData($this->getId());
3014  foreach ($this->user_defined_data as $field => $value) {
3015  if ($field !== 'usr_id' && $value !== null) {
3016  $udata->set($field, $value);
3017  }
3018  }
3019  $udata->update();
3020  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userExists()

static ilObjUser::userExists ( array  $a_usr_ids = [])
static

Definition at line 3945 of file class.ilObjUser.php.

References $DIC, $ilDB, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\user().

Referenced by ilInfoScreenGUI\buildPublicAccessExportButton(), ilTrQuery\filterOutUsersWithoutData(), ilExerciseManagementCollectFilesJob\getAssignmentMembersIds(), ilObjForumAccess\getCachedUserInstance(), ilIndividualAssessmentMembersTableGUI\getGradedByInformation(), and ilNewsForContextBlockGUI\showNews().

3947  : bool {
3948  global $DIC;
3949 
3950  $ilDB = $DIC['ilDB'];
3951 
3952  $query = 'SELECT count(*) num FROM object_data od ' .
3953  'JOIN usr_data ud ON obj_id = usr_id ' .
3954  'WHERE ' . $ilDB->in('obj_id', $a_usr_ids, false, 'integer') . ' ';
3955  $res = $ilDB->query($query);
3956  $num_rows = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)->num;
3957  return $num_rows == count($a_usr_ids);
3958  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeAccepted()

ilObjUser::writeAccepted ( )

write accept date of user agreement

Definition at line 561 of file class.ilObjUser.php.

References ilObject\$db, $ilDB, and ilObject\getId().

561  : void
562  {
563  $ilDB = $this->db;
564  $ilDB->manipulateF('UPDATE usr_data SET agree_date = ' . $ilDB->now() .
565  ' WHERE usr_id = %s', ['integer'], [$this->getId()]);
566  }
ilDBInterface $db
+ Here is the call graph for this function:

◆ writePref()

ilObjUser::writePref ( string  $a_keyword,
string  $a_value 
)

Definition at line 940 of file class.ilObjUser.php.

References setPref().

Referenced by activateDeletionFlag(), ilHelpGUI\activateTooltips(), ilSurveyEditorGUI\changeDatatypeObject(), ilPDNotesGUI\changeRelatedObject(), ilObjSurveyQuestionPoolGUI\createQuestionObject(), ilHelpGUI\deactivateTooltips(), ilContainerSessionsContentGUI\initSessionPresentationLimitation(), removeDeletionFlag(), ilSurveyParticipantsGUI\setCodeLanguageObject(), and ilPageEditorGUI\setMediaMode().

943  : void {
944  self::_writePref($this->id, $a_keyword, $a_value);
945  $this->setPref($a_keyword, $a_value);
946  }
setPref(string $a_keyword, ?string $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writePrefs()

ilObjUser::writePrefs ( )

Definition at line 1002 of file class.ilObjUser.php.

Referenced by ilMembershipNotifications\toggleUser(), and update().

1002  : void
1003  {
1004  self::_deleteAllPref($this->id);
1005  foreach ($this->prefs as $keyword => $value) {
1006  self::_writePref($this->id, $keyword, (string) $value);
1007  }
1008  }
+ Here is the caller graph for this function:

Field Documentation

◆ $active

int ilObjUser::$active = 0

◆ $agree_date

string ilObjUser::$agree_date = null

Definition at line 90 of file class.ilObjUser.php.

Referenced by getAgreeDate(), saveAsNew(), and update().

◆ $approve_date

string ilObjUser::$approve_date = null

Definition at line 89 of file class.ilObjUser.php.

Referenced by getApproveDate(), saveAsNew(), and update().

◆ $auth_mode

string ilObjUser::$auth_mode = null

Definition at line 93 of file class.ilObjUser.php.

Referenced by getAuthMode().

◆ $avatar_rid

string ilObjUser::$avatar_rid = null
protected

Definition at line 119 of file class.ilObjUser.php.

Referenced by getAvatarRid(), and setAvatarRid().

◆ $birthday

string ilObjUser::$birthday = null
protected

Definition at line 71 of file class.ilObjUser.php.

Referenced by getBirthday().

◆ $city

string ilObjUser::$city = ''

Definition at line 76 of file class.ilObjUser.php.

Referenced by getCity(), saveAsNew(), and update().

◆ $client_ip

string ilObjUser::$client_ip = ''

Definition at line 92 of file class.ilObjUser.php.

Referenced by getClientIP(), saveAsNew(), and update().

◆ $country

string ilObjUser::$country = ''

Definition at line 78 of file class.ilObjUser.php.

Referenced by getCountry(), saveAsNew(), and update().

◆ $cron_delete_user_reminder_mail

ilCronDeleteInactiveUserReminderMail ilObjUser::$cron_delete_user_reminder_mail
private

Definition at line 122 of file class.ilObjUser.php.

◆ $date_format_factory

DateFormatFactory ilObjUser::$date_format_factory
protected

Definition at line 121 of file class.ilObjUser.php.

◆ $delivery

ILIAS FileDelivery Delivery StreamDelivery ilObjUser::$delivery
protected

Definition at line 120 of file class.ilObjUser.php.

◆ $department

string ilObjUser::$department = ''

Definition at line 74 of file class.ilObjUser.php.

Referenced by getDepartment(), saveAsNew(), and update().

◆ $email

string ilObjUser::$email = ''

Definition at line 84 of file class.ilObjUser.php.

Referenced by getEmail().

◆ $ext_account

string ilObjUser::$ext_account = ''
protected

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

Referenced by getExternalAccount().

◆ $fax

string ilObjUser::$fax = ''

Definition at line 83 of file class.ilObjUser.php.

Referenced by getFax(), saveAsNew(), and update().

◆ $first_login

string ilObjUser::$first_login = ''
protected

Definition at line 117 of file class.ilObjUser.php.

Referenced by getFirstLogin().

◆ $firstname

string ilObjUser::$firstname = ''

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

Referenced by getFirstname(), and saveAsNew().

◆ $fullname

string ilObjUser::$fullname = ''

Definition at line 72 of file class.ilObjUser.php.

Referenced by _lookupFullname().

◆ $gender

string ilObjUser::$gender = ''

Definition at line 67 of file class.ilObjUser.php.

Referenced by getGender(), saveAsNew(), and update().

◆ $hobby

string ilObjUser::$hobby = ''

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

Referenced by getHobby(), saveAsNew(), and update().

◆ $inactivation_date

string ilObjUser::$inactivation_date = null
protected

Definition at line 107 of file class.ilObjUser.php.

Referenced by getInactivationDate(), saveAsNew(), setInactivationDate(), and update().

◆ $institution

string ilObjUser::$institution = ''

Definition at line 73 of file class.ilObjUser.php.

Referenced by getInstitution(), saveAsNew(), and update().

◆ $interests_general

array ilObjUser::$interests_general = []
protected

Definition at line 111 of file class.ilObjUser.php.

Referenced by getGeneralInterests().

◆ $interests_help_looking

array ilObjUser::$interests_help_looking = []
protected

Definition at line 115 of file class.ilObjUser.php.

Referenced by getLookingForHelp().

◆ $interests_help_offered

array ilObjUser::$interests_help_offered = []
protected

Definition at line 113 of file class.ilObjUser.php.

Referenced by getOfferingHelp().

◆ $irss

Services ilObjUser::$irss
private

Definition at line 123 of file class.ilObjUser.php.

◆ $is_self_registered

bool ilObjUser::$is_self_registered = false
private

Definition at line 108 of file class.ilObjUser.php.

Referenced by isSelfRegistered().

◆ $last_login

string ilObjUser::$last_login = ''
protected

Definition at line 46 of file class.ilObjUser.php.

Referenced by getLastLogin().

◆ $last_password_change_ts

int ilObjUser::$last_password_change_ts = 0

Definition at line 97 of file class.ilObjUser.php.

Referenced by getLastPasswordChangeTS().

◆ $last_profile_prompt

string ilObjUser::$last_profile_prompt = ''
protected

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

Referenced by getLastProfilePrompt().

◆ $lastname

string ilObjUser::$lastname = ''

Definition at line 70 of file class.ilObjUser.php.

Referenced by getLastname(), saveAsNew(), and setFullname().

◆ $latitude

string ilObjUser::$latitude = null

Definition at line 94 of file class.ilObjUser.php.

Referenced by getLatitude(), saveAsNew(), and update().

◆ $loc_zoom

string ilObjUser::$loc_zoom = null

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

Referenced by getLocationZoom().

◆ $login

string ilObjUser::$login = ''

◆ $login_attempts

int ilObjUser::$login_attempts = 0

Definition at line 99 of file class.ilObjUser.php.

Referenced by getLoginAttempts().

◆ $longitude

string ilObjUser::$longitude = null

Definition at line 95 of file class.ilObjUser.php.

Referenced by getLongitude(), saveAsNew(), and update().

◆ $matriculation

string ilObjUser::$matriculation = ''

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

Referenced by getMatriculation(), saveAsNew(), and update().

◆ $oldPrefs

array ilObjUser::$oldPrefs = []
protected

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

◆ $org_units

string ilObjUser::$org_units = ''
protected

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

◆ $passwd

string ilObjUser::$passwd = ''
protected

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

Referenced by getPasswd(), saveAsNew(), and update().

◆ $passwd_policy_reset

bool ilObjUser::$passwd_policy_reset = false
protected

Definition at line 98 of file class.ilObjUser.php.

Referenced by getPasswordPolicyResetStatus(), and saveAsNew().

◆ $passwd_type

string ilObjUser::$passwd_type = ''
protected

Definition at line 50 of file class.ilObjUser.php.

Referenced by getPasswdType().

◆ $password_encoding_type

string ilObjUser::$password_encoding_type = null
protected

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

Referenced by getPasswordEncodingType().

◆ $password_salt

string ilObjUser::$password_salt = null
protected

Definition at line 66 of file class.ilObjUser.php.

Referenced by getPasswordSalt(), and setPasswordSalt().

◆ $personal_image_cache

array ilObjUser::$personal_image_cache = []
staticprotected

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

◆ $phone_home

string ilObjUser::$phone_home = ''

Definition at line 81 of file class.ilObjUser.php.

Referenced by getPhoneHome(), saveAsNew(), and update().

◆ $phone_mobile

string ilObjUser::$phone_mobile = ''

Definition at line 82 of file class.ilObjUser.php.

Referenced by getPhoneMobile(), saveAsNew(), and update().

◆ $phone_office

string ilObjUser::$phone_office = ''

Definition at line 80 of file class.ilObjUser.php.

Referenced by getPhoneOffice(), saveAsNew(), and update().

◆ $prefs

array ilObjUser::$prefs = []

Definition at line 104 of file class.ilObjUser.php.

Referenced by _getPreferences(), and readPrefs().

◆ $profile_incomplete

bool ilObjUser::$profile_incomplete = false
protected

Definition at line 118 of file class.ilObjUser.php.

Referenced by getProfileIncomplete().

◆ $referral_comment

string ilObjUser::$referral_comment = ''

Definition at line 88 of file class.ilObjUser.php.

Referenced by getComment(), saveAsNew(), and update().

◆ $second_email

string ilObjUser::$second_email = null
protected

Definition at line 85 of file class.ilObjUser.php.

Referenced by getSecondEmail(), and setSecondEmail().

◆ $sel_country

string ilObjUser::$sel_country = ''

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

Referenced by getSelectedCountry(), saveAsNew(), and update().

◆ $skin

string ilObjUser::$skin = ''

Definition at line 105 of file class.ilObjUser.php.

Referenced by __construct().

◆ $street

string ilObjUser::$street = ''

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

Referenced by getStreet(), saveAsNew(), and update().

◆ $time_limit_from

int ilObjUser::$time_limit_from = null
protected

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

Referenced by getTimeLimitFrom().

◆ $time_limit_message

string ilObjUser::$time_limit_message = ''
protected

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

Referenced by getTimeLimitMessage().

◆ $time_limit_owner

int ilObjUser::$time_limit_owner = null
protected

Definition at line 45 of file class.ilObjUser.php.

◆ $time_limit_unlimited

bool ilObjUser::$time_limit_unlimited = false
protected

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

Referenced by getTimeLimitUnlimited().

◆ $time_limit_until

int ilObjUser::$time_limit_until = null
protected

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

Referenced by getTimeLimitUntil().

◆ $user_defined_data

array ilObjUser::$user_defined_data = []

Definition at line 100 of file class.ilObjUser.php.

◆ $utitle

string ilObjUser::$utitle = ''

Definition at line 68 of file class.ilObjUser.php.

Referenced by getUTitle(), saveAsNew(), and update().

◆ $zipcode

string ilObjUser::$zipcode = ''

Definition at line 77 of file class.ilObjUser.php.

Referenced by getZipcode(), saveAsNew(), and update().

◆ NO_AVATAR_RID

const ilObjUser::NO_AVATAR_RID = '-'

◆ PASSWD_CRYPTED

◆ PASSWD_PLAIN


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