ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 
 exportPersonalData ()
 
 getPersonalDataExportFile ()
 
 sendPersonalDataFile ()
 
 importPersonalData (array $a_file, bool $a_profile_data, bool $a_settings, bool $a_notes, bool $a_calendar)
 
 setInactivationDate (?string $inactivation_date)
 
 getInactivationDate ()
 
 isAnonymous ()
 
 activateDeletionFlag ()
 
 removeDeletionFlag ()
 
 hasDeletionFlag ()
 
 setIsSelfRegistered (bool $status)
 
 isSelfRegistered ()
 
 setGeneralInterests (?array $value=null)
 
 getGeneralInterests ()
 
 getGeneralInterestsAsText ()
 Get general interests as plain text. More...
 
 setOfferingHelp (?array $value=null)
 
 getOfferingHelp ()
 
 getOfferingHelpAsText ()
 Get help offering as plain text. More...
 
 setLookingForHelp (?array $value=null)
 
 getLookingForHelp ()
 
 getLookingForHelpAsText ()
 Get help looking for as plain text. More...
 
 updateMultiTextFields (bool $a_create=false)
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static _lookupFullname (int $a_user_id)
 
static _lookupEmail (int $a_user_id)
 
static _lookupGender (int $a_user_id)
 
static _lookupClientIP (int $a_user_id)
 
static _lookupName (int $a_user_id)
 lookup user name More...
 
static _lookupFields (int $a_user_id)
 lookup fields (deprecated; use more specific methods instead) More...
 
static _lookupLogin (int $a_user_id)
 
static _lookupExternalAccount (int $a_user_id)
 
static _lookupId ($a_user_str)
 
static _lookupLastLogin (int $a_user_id)
 
static _lookupFirstLogin (int $a_user_id)
 
static _doesLoginnameExistInHistory (string $a_login)
 Checks whether the passed loginname already exists in history. More...
 
static _getLastHistoryDataByUserId (int $a_usr_id)
 Returns the last used loginname and the changedate of the passed user_id. More...
 
static _deletePref (int $a_user_id, string $a_keyword)
 
static _deleteAllPref (int $a_user_id)
 Deletes a userpref value of the user from the database. More...
 
static _writePref (int $a_usr_id, string $a_keyword, string $a_value)
 
static _lookupPref (int $a_usr_id, string $a_keyword)
 
static lookupMatriculation (int $a_usr_id)
 
static _lookupLanguage (int $a_usr_id)
 
static _writeExternalAccount (int $a_usr_id, string $a_ext_id)
 
static _writeAuthMode (int $a_usr_id, string $a_auth_mode)
 
static _lookupActive (int $a_usr_id)
 
static hasActiveSession (int $a_user_id, string $a_session_id)
 
static toUsernameWithoutDomain (string $a_login)
 Static function removes Microsoft domain name from username webdav related. More...
 
static getUserIdByLogin (string $a_login)
 
static getUserIdsByEmail (string $a_email)
 
static getUserLoginsByEmail (string $a_email)
 
static _readUsersProfileData (array $a_user_ids)
 
static _getAllUserData (?array $a_fields=null, int $active=-1)
 
static _getNumberOfUsersForStyle (string $a_skin, string $a_style)
 
static _getAllUserAssignedStyles ()
 
static _moveUsersToStyle (string $a_from_skin, string $a_from_style, string $a_to_skin, string $a_to_style)
 
static _getUsersForClipboadObject (string $a_type, int $a_id)
 get all users, that have a certain object within their clipboard More...
 
static _getImportedUserId (string $i2_id)
 
static lookupOrgUnitsRepresentation (int $a_usr_id)
 lookup org unit representation More...
 
static _getExternalAccountsByAuthMode (string $a_auth_mode, bool $a_read_auth_default=false)
 Get list of external account by authentication method Note: If login == ext_account for two user with auth_mode 'default' and auth_mode 'ldap' The ldap auth mode chosen. More...
 
static _toggleActiveStatusOfUsers (array $a_usr_ids, bool $a_status)
 
static _lookupAuthMode (int $a_usr_id)
 
static _checkExternalAuthAccount (string $a_auth, string $a_account, bool $tryFallback=true)
 check whether external account and authentication method matches with a user More...
 
static _getNumberOfUsersPerAuthMode ()
 get number of users per auth mode More...
 
static _getLocalAccountsForEmail (string $a_email)
 
static _uploadPersonalPicture (string $tmp_file, int $obj_id)
 Create a personal picture image file from a temporary image file. More...
 
static _getAvatar (int $a_usr_id)
 
static _getPersonalPicturePath (int $a_usr_id, string $a_size='small', bool $a_force_pic=false, bool $a_prevent_no_photo_image=false, bool $html_export=false)
 
static copyProfilePicturesToDirectory (int $a_user_id, string $a_dir)
 
static _lookupFeedHash (int $a_user_id, bool $a_create=false)
 Lookup news feed hash for user. More...
 
static _getFeedPass (int $a_user_id)
 Lookup news feed password for user. More...
 
static _setFeedPass (int $a_user_id, string $a_password)
 Set news feed password for user. More...
 
static _loginExists (string $a_login, int $a_user_id=0)
 check if a login name already exists You may exclude a user from the check by giving his user id as 2nd paramter More...
 
static _externalAccountExists (string $a_external_account, string $a_auth_mode)
 Check if an external account name already exists. More...
 
static _getUsersForRole (int $role_id, int $active=-1)
 return array of complete users which belong to a specific role More...
 
static _getUsersForFolder (int $ref_id, int $active)
 get users for a category or from system folder More...
 
static _getUsersForGroup (array $a_mem_ids, int $active=-1)
 return user data for group members More...
 
static _getUsersForIds (array $a_mem_ids, int $active=-1, int $timelimitowner=-1)
 return user data for given user id More...
 
static _getUserData (array $a_internalids)
 return user data for given user ids More...
 
static _getPreferences (int $user_id)
 get preferences for user More...
 
static getUserSubsetByPreferenceValue (array $a_user_ids, string $a_keyword, string $a_val)
 For a given set of user IDs return a subset that has a given user preference set. More...
 
static _getLoginAttempts (int $a_usr_id)
 
static _incrementLoginAttempts (int $a_usr_id)
 
static _setUserInactive (int $a_usr_id)
 
static _writeHistory (int $a_usr_id, string $a_login)
 
static _getUsersOnline (int $a_user_id=0, bool $a_no_anonymous=false)
 reads all active sessions from db and returns users that are online OR returns only one active user if a user_id is given More...
 
static _generateRegistrationHash (int $a_usr_id)
 Generates a unique hashcode for activating a user profile after registration. More...
 
static _verifyRegistrationHash (string $a_hash)
 Verifies a registration hash. More...
 
static getUserIdsByInactivityPeriod (int $periodInDays)
 Get ids of all users that have been inactive for at least the given period. More...
 
static getUserIdsNeverLoggedIn (int $thresholdInDays)
 Get ids of all users that have never logged in. More...
 
static _getUserIdsByInactivationPeriod (int $period)
 get ids of all users that have been inactivated since at least the given period More...
 
static getFirstLettersOfLastnames (?array $user_ids=null)
 Get first letters of all lastnames. More...
 
static userExists (array $a_usr_ids=[])
 
static _isAnonymous (int $usr_id)
 
static findInterests (string $a_term, ?int $a_user_id=null, ?string $a_field_id=null)
 
static getProfileStatusOfUsers (array $a_user_ids)
 Get profile status. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", ?int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static getIconForType (string $type)
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, ?\ilDBInterface $ilDB=null)
 

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
 
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 124 of file class.ilObjUser.php.

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

127  {
128  global $DIC;
129 
130  $this->type = 'usr';
131  parent::__construct($a_user_id, $a_call_by_reference);
132 
133  $this->cron_delete_user_reminder_mail = new ilCronDeleteInactiveUserReminderMail($this->db);
134  $this->irss = $DIC->resourceStorage();
135  $this->auth_mode = 'default';
136  $this->passwd_type = self::PASSWD_PLAIN;
137  if ($a_user_id > 0) {
138  $this->setId($a_user_id);
139  $this->read();
140  } else {
141  $this->prefs = [];
142  $this->prefs['language'] = $this->ilias->ini->readVariable('language', 'default');
143  $this->skin = $this->ilias->ini->readVariable('layout', 'skin');
144  $this->prefs['skin'] = $this->skin;
145  $this->prefs['style'] = $this->ilias->ini->readVariable('layout', 'style');
146  }
147 
148  $this->app_event_handler = $DIC['ilAppEventHandler'];
149  $this->date_format_factory = (new DataFactory())->dateFormat();
150  }
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:22
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 2746 of file class.ilObjUser.php.

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

Referenced by ilAuthProviderCAS\doAuthentication(), 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().

2750  : ?string {
2751  $db = $GLOBALS['DIC']->database();
2752  $settings = $GLOBALS['DIC']->settings();
2753 
2754  // Check directly with auth_mode
2755  $r = $db->queryF(
2756  'SELECT * FROM usr_data WHERE ' .
2757  ' ext_account = %s AND auth_mode = %s',
2758  ['text', 'text'],
2759  [$a_account, $a_auth]
2760  );
2761  if ($usr = $db->fetchAssoc($r)) {
2762  return $usr['login'];
2763  }
2764 
2765  if (!$tryFallback) {
2766  return null;
2767  }
2768 
2769  // For compatibility, check for login (no ext_account entry given)
2770  $res = $db->queryF(
2771  'SELECT login FROM usr_data ' .
2772  'WHERE login = %s AND auth_mode = %s AND (ext_account IS NULL OR ext_account = "") ',
2773  ['text', 'text'],
2774  [$a_account, $a_auth]
2775  );
2776  if ($usr = $db->fetchAssoc($res)) {
2777  return $usr['login'];
2778  }
2779 
2780  // If auth_default == $a_auth => check for login
2781  if (ilAuthUtils::_getAuthModeName($settings->get('auth_mode')) == $a_auth) {
2782  $res = $db->queryF(
2783  'SELECT login FROM usr_data WHERE ' .
2784  ' ext_account = %s AND auth_mode = %s',
2785  ['text', 'text'],
2786  [$a_account, 'default']
2787  );
2788  if ($usr = $db->fetchAssoc($res)) {
2789  return $usr['login'];
2790  }
2791  // Search for login (no ext_account given)
2792  $res = $db->queryF(
2793  'SELECT login FROM usr_data ' .
2794  'WHERE login = %s AND (ext_account IS NULL OR ext_account = "") AND auth_mode = %s',
2795  ['text', 'text'],
2796  [$a_account, 'default']
2797  );
2798  if ($usr = $db->fetchAssoc($res)) {
2799  return $usr['login'];
2800  }
2801  }
2802  return null;
2803  }
$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 967 of file class.ilObjUser.php.

References $DIC, and $ilDB.

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

◆ _deletePref()

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

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

References $DIC, and $ilDB.

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

◆ _doesLoginnameExistInHistory()

static ilObjUser::_doesLoginnameExistInHistory ( string  $a_login)
static

Checks whether the passed loginname already exists in history.

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

References $DIC, $ilDB, and $res.

Referenced by ilAccountRegistrationGUI\saveForm().

812  : bool
813  {
814  global $DIC;
815 
816  $ilDB = $DIC->database();
817 
818  $res = $ilDB->queryF(
819  '
820  SELECT * FROM loginname_history
821  WHERE login = %s',
822  ['text'],
823  [$a_login]
824  );
825 
826  return (bool) $ilDB->fetchAssoc($res);
827  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ 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 3270 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

3273  : bool {
3274  global $DIC;
3275 
3276  $ilDB = $DIC['ilDB'];
3277 
3278  $res = $ilDB->queryF(
3279  'SELECT * FROM usr_data ' .
3280  'WHERE ext_account = %s AND auth_mode = %s',
3281  ['text', 'text'],
3282  [$a_external_account, $a_auth_mode]
3283  );
3284  return (bool) $ilDB->fetchAssoc($res);
3285  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22

◆ _generateRegistrationHash()

static ilObjUser::_generateRegistrationHash ( int  $a_usr_id)
static

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

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

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

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

◆ _getAllUserAssignedStyles()

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

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

References $DIC, $ilDB, and $q.

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

2308  : array
2309  {
2310  global $DIC;
2311 
2312  $ilDB = $DIC['ilDB'];
2313 
2314  $q = 'SELECT DISTINCT up1.value style, up2.value skin FROM usr_pref up1, usr_pref up2 ' .
2315  ' WHERE up1.keyword = ' . $ilDB->quote('style', 'text') .
2316  ' AND up2.keyword = ' . $ilDB->quote('skin', 'text') .
2317  ' AND up1.usr_id = up2.usr_id';
2318 
2319  $sty_set = $ilDB->query($q);
2320 
2321  $styles = [];
2322  while ($sty_rec = $ilDB->fetchAssoc($sty_set)) {
2323  $styles[] = $sty_rec['skin'] . ':' . $sty_rec['style'];
2324  }
2325 
2326  return $styles;
2327  }
global $DIC
Definition: shib_login.php:22
$q
Definition: shib_logout.php:21
+ 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 2184 of file class.ilObjUser.php.

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

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

◆ _getAvatar()

static ilObjUser::_getAvatar ( int  $a_usr_id)
static

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

References ANONYMOUS_USER_ID.

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

2919  : Avatar
2920  {
2921  $define = new ilUserAvatarResolver($a_usr_id ?: ANONYMOUS_USER_ID);
2922  $define->setSize('xsmall');
2923  return $define->getAvatar();
2924  }
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 2678 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().

2681  : array {
2682  global $DIC;
2683 
2684  $ilDB = $DIC['ilDB'];
2685  $ilSetting = $DIC['ilSetting'];
2686 
2687  $q = 'SELECT login,usr_id,ext_account,auth_mode FROM usr_data ' .
2688  'WHERE auth_mode = %s';
2689  $types[] = 'text';
2690  $values[] = $a_auth_mode;
2691  if ($a_read_auth_default and ilAuthUtils::_getAuthModeName($ilSetting->get('auth_mode', ilAuthUtils::AUTH_LOCAL)) == $a_auth_mode) {
2692  $q .= ' OR auth_mode = %s ';
2693  $types[] = 'text';
2694  $values[] = 'default';
2695  }
2696 
2697  $res = $ilDB->queryF($q, $types, $values);
2698  $accounts = [];
2699  while ($row = $ilDB->fetchObject($res)) {
2700  if ($row->auth_mode == 'default') {
2701  $accounts[$row->usr_id] = $row->login;
2702  } else {
2703  $accounts[$row->usr_id] = $row->ext_account;
2704  }
2705  }
2706  return $accounts;
2707  }
$res
Definition: ltiservices.php:66
static _getAuthModeName($a_auth_key)
global $DIC
Definition: shib_login.php:22
global $ilSetting
Definition: privfeed.php:31
$q
Definition: shib_logout.php:21
+ 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 3212 of file class.ilObjUser.php.

References null.

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

3214  : ?string {
3215  if ($a_user_id > 0) {
3216  return self::_lookupPref($a_user_id, 'priv_feed_pass');
3217  }
3218  return null;
3219  }
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 2617 of file class.ilObjUser.php.

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

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

2619  : int {
2620  global $DIC;
2621 
2622  $ilDB = $DIC['ilDB'];
2623 
2624  $query = 'SELECT obj_id FROM object_data WHERE import_id = ' .
2625  $ilDB->quote($i2_id, 'text');
2626 
2627  $res = $ilDB->query($query);
2628  $id = 0;
2629  while ($row = $ilDB->fetchObject($res)) {
2630  $id = (int) $row->obj_id;
2631  }
2632  return $id;
2633  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
$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 835 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

Referenced by ilObjUserGUI\initForm().

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

◆ _getLocalAccountsForEmail()

static ilObjUser::_getLocalAccountsForEmail ( string  $a_email)
static

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

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

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

◆ _getLoginAttempts()

static ilObjUser::_getLoginAttempts ( int  $a_usr_id)
static

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

References $DIC, and $ilDB.

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

3535  : int {
3536  global $DIC;
3537 
3538  $ilDB = $DIC['ilDB'];
3539 
3540  $query = 'SELECT login_attempts FROM usr_data WHERE usr_id = %s';
3541  $result = $ilDB->queryF($query, ['integer'], [$a_usr_id]);
3542  $record = $ilDB->fetchAssoc($result);
3543  return (int) ($record['login_attempts'] ?? 0);
3544  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ _getNumberOfUsersForStyle()

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

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

References $DIC, $ilDB, and $q.

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

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

◆ _getNumberOfUsersPerAuthMode()

static ilObjUser::_getNumberOfUsersPerAuthMode ( )
static

get number of users per auth mode

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

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

Referenced by ilObjAuthSettingsGUI\authSettingsObject().

2808  : array // Missing array type.
2809  {
2810  global $DIC;
2811 
2812  $ilDB = $DIC['ilDB'];
2813 
2814  $r = $ilDB->query('SELECT count(*) AS cnt, auth_mode FROM usr_data ' .
2815  'GROUP BY auth_mode');
2816  $cnt_arr = [];
2817  while ($cnt = $ilDB->fetchAssoc($r)) {
2818  $cnt_arr[$cnt['auth_mode']] = (int) $cnt['cnt'];
2819  }
2820 
2821  return $cnt_arr;
2822  }
global $DIC
Definition: shib_login.php:22
$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 3486 of file class.ilObjUser.php.

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

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

3486  : array
3487  {
3488  global $DIC;
3489 
3490  $ilDB = $DIC['ilDB'];
3491 
3492  $prefs = [];
3493 
3494  $r = $ilDB->queryF(
3495  'SELECT * FROM usr_pref WHERE usr_id = %s',
3496  ['integer'],
3497  [$user_id]
3498  );
3499 
3500  while ($row = $ilDB->fetchAssoc($r)) {
3501  $prefs[$row['keyword']] = $row['value'];
3502  }
3503 
3504  return $prefs;
3505  }
global $DIC
Definition: shib_login.php:22
$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 3439 of file class.ilObjUser.php.

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

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

3439  : array
3440  {
3441  global $DIC;
3442 
3443  $ilDB = $DIC['ilDB'];
3444 
3445  $ids = [];
3446  if (is_array($a_internalids)) {
3447  foreach ($a_internalids as $internalid) {
3448  if (is_numeric($internalid)) {
3449  $ids[] = $internalid;
3450  } else {
3451  $parsedid = ilUtil::__extractId($internalid, IL_INST_ID);
3452  if (is_numeric($parsedid) && $parsedid > 0) {
3453  $ids[] = $parsedid;
3454  }
3455  }
3456  }
3457  }
3458  if (count($ids) == 0) {
3459  $ids [] = -1;
3460  }
3461 
3462  $query = 'SELECT usr_data.*, usr_pref.value AS language
3463  FROM usr_data
3464  LEFT JOIN usr_pref
3465  ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
3466  WHERE ' . $ilDB->in('usr_data.usr_id', $ids, false, 'integer');
3467  $values[] = 'language';
3468  $types[] = 'text';
3469 
3470  $query .= ' ORDER BY usr_data.lastname, usr_data.firstname ';
3471 
3472  $data = [];
3473  $result = $ilDB->queryF($query, $types, $values);
3474  while ($row = $ilDB->fetchAssoc($result)) {
3475  $data[] = $row;
3476  }
3477  return $data;
3478  }
const IL_INST_ID
Definition: constants.php:40
global $DIC
Definition: shib_login.php:22
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 3876 of file class.ilObjUser.php.

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

Referenced by ilCronDeleteInactivatedUserAccounts\run().

3878  : array {
3880  $field = 'inactivation_date';
3882 
3883  if (!$period) {
3884  throw new ilException('no valid period given');
3885  }
3886 
3887  global $DIC;
3888 
3889  $ilDB = $DIC['ilDB'];
3890 
3891  $date = date('Y-m-d H:i:s', (time() - ($period * 24 * 60 * 60)));
3892 
3893  $query = "SELECT usr_id FROM usr_data WHERE $field < %s AND active = %s";
3894 
3895  $res = $ilDB->queryF($query, ['timestamp', 'integer'], [$date, 0]);
3896 
3897  $ids = [];
3898  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
3899  $ids[] = (int) $row->usr_id;
3900  }
3901 
3902  return $ids;
3903  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ 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 2584 of file class.ilObjUser.php.

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

Referenced by ilObjMediaObject\lookupUsages().

2587  : array {
2588  global $DIC;
2589 
2590  $ilDB = $DIC['ilDB'];
2591 
2592  $q = 'SELECT DISTINCT user_id FROM personal_clipboard WHERE ' .
2593  'item_id = ' . $ilDB->quote($a_id, 'integer') . ' AND ' .
2594  'type = ' . $ilDB->quote($a_type, 'text');
2595  $user_set = $ilDB->query($q);
2596  $users = [];
2597  while ($user_rec = $ilDB->fetchAssoc($user_set)) {
2598  $users[] = (int) $user_rec['user_id'];
2599  }
2600 
2601  return $users;
2602  }
global $DIC
Definition: shib_login.php:22
$q
Definition: shib_logout.php:21
+ 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 3334 of file class.ilObjUser.php.

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

Referenced by ilSoapUserAdministration\getUsersForContainer().

3337  : array {
3338  global $DIC;
3339 
3340  $ilDB = $DIC['ilDB'];
3341  $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';
3342  $types[] = 'text';
3343  $values[] = 'language';
3344 
3345  if (is_numeric($active) && $active > -1) {
3346  $query .= ' AND usr_data.active = %s';
3347  $values[] = $active;
3348  $types[] = 'integer';
3349  }
3350 
3351  if ($ref_id != USER_FOLDER_ID) {
3352  $query .= ' AND usr_data.time_limit_owner = %s';
3353  $values[] = $ref_id;
3354  $types[] = 'integer';
3355  }
3356 
3357  $query .= ' AND usr_data.usr_id != %s ';
3358  $values[] = ANONYMOUS_USER_ID;
3359  $types[] = 'integer';
3360 
3361  $query .= ' ORDER BY usr_data.lastname, usr_data.firstname ';
3362 
3363  $result = $ilDB->queryF($query, $types, $values);
3364  $data = [];
3365  while ($row = $ilDB->fetchAssoc($result)) {
3366  $data[] = $row;
3367  }
3368 
3369  return $data;
3370  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
const USER_FOLDER_ID
Definition: constants.php:33
global $DIC
Definition: shib_login.php:22
+ 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 3378 of file class.ilObjUser.php.

Referenced by ilSoapUserAdministration\getUsersForContainer().

3381  : array {
3382  return self::_getUsersForIds($a_mem_ids, $active);
3383  }
+ 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 3391 of file class.ilObjUser.php.

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

Referenced by ilSoapUserAdministration\getUsersForContainer().

3395  : array {
3396  global $DIC;
3397 
3398  $ilDB = $DIC['ilDB'];
3399 
3400  $query = 'SELECT usr_data.*, usr_pref.value AS language
3401  FROM usr_data
3402  LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
3403  WHERE ' . $ilDB->in('usr_data.usr_id', $a_mem_ids, false, 'integer') . '
3404  AND usr_data.usr_id != %s';
3405  $values[] = 'language';
3406  $types[] = 'text';
3407  $values[] = ANONYMOUS_USER_ID;
3408  $types[] = 'integer';
3409 
3410  if (is_numeric($active) && $active > -1) {
3411  $query .= ' AND active = %s';
3412  $values[] = $active;
3413  $types[] = 'integer';
3414  }
3415 
3416  if ($timelimitowner != USER_FOLDER_ID && $timelimitowner != -1) {
3417  $query .= ' AND usr_data.time_limit_owner = %s';
3418  $values[] = $timelimitowner;
3419  $types[] = 'integer';
3420  }
3421 
3422  $query .= ' ORDER BY usr_data.lastname, usr_data.firstname ';
3423 
3424  $result = $ilDB->queryF($query, $types, $values);
3425  $mem_arr = [];
3426  while ($row = $ilDB->fetchAssoc($result)) {
3427  $mem_arr[] = $row;
3428  }
3429 
3430  return $mem_arr;
3431  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
const USER_FOLDER_ID
Definition: constants.php:33
global $DIC
Definition: shib_login.php:22
+ 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 3291 of file class.ilObjUser.php.

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

Referenced by ilSoapUserAdministration\getUserForRole().

3294  : array {
3295  global $DIC;
3296 
3297  $ilDB = $DIC['ilDB'];
3298  $rbacreview = $DIC['rbacreview'];
3299  $ids = $rbacreview->assignedUsers($role_id);
3300 
3301  if (count($ids) == 0) {
3302  $ids = [-1];
3303  }
3304 
3305  $query = 'SELECT usr_data.*, usr_pref.value AS language
3306  FROM usr_data
3307  LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
3308  WHERE ' . $ilDB->in('usr_data.usr_id', $ids, false, 'integer');
3309  $values[] = 'language';
3310  $types[] = 'text';
3311 
3312 
3313  if (is_numeric($active) && $active > -1) {
3314  $query .= ' AND usr_data.active = %s';
3315  $values[] = $active;
3316  $types[] = 'integer';
3317  }
3318 
3319  $query .= ' ORDER BY usr_data.lastname, usr_data.firstname ';
3320 
3321  $r = $ilDB->queryF($query, $types, $values);
3322  $data = [];
3323  while ($row = $ilDB->fetchAssoc($r)) {
3324  $data[] = $row;
3325  }
3326  return $data;
3327  }
global $DIC
Definition: shib_login.php:22
$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 3632 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().

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

References $DIC, and $ilDB.

Referenced by ilAuthFrontend\handleLoginAttempts().

3548  : bool {
3549  global $DIC;
3550 
3551  $ilDB = $DIC['ilDB'];
3552 
3553  $query = 'UPDATE usr_data SET login_attempts = (login_attempts + 1) WHERE usr_id = %s';
3554  $affected = $ilDB->manipulateF($query, ['integer'], [$a_usr_id]);
3555 
3556  if ($affected) {
3557  return true;
3558  } else {
3559  return false;
3560  }
3561  }
global $DIC
Definition: shib_login.php:22
+ 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 3240 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().

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

◆ _lookup()

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

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

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

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

◆ _lookupActive()

static ilObjUser::_lookupActive ( int  $a_usr_id)
static

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

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

Referenced by ilMailSearchObjectGUI\cancel(), ilLearningSequenceParticipantsTableGUI\fillRow(), ILIAS\Contact\Provider\ContactNotificationProvider\getNotifications(), and ilBuddySystemRelationsTableGUI\initFilter().

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

◆ _lookupAuthMode()

static ilObjUser::_lookupAuthMode ( int  $a_usr_id)
static

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

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

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

◆ _lookupClientIP()

static ilObjUser::_lookupClientIP ( int  $a_user_id)
static

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

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

◆ _lookupEmail()

static ilObjUser::_lookupEmail ( int  $a_user_id)
static

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

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

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

◆ _lookupExternalAccount()

static ilObjUser::_lookupExternalAccount ( int  $a_user_id)
static

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

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

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

◆ _lookupFeedHash()

static ilObjUser::_lookupFeedHash ( int  $a_user_id,
bool  $a_create = false 
)
static

Lookup news feed hash for user.

If hash does not exist, create one.

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

References $DIC, $ilDB, and null.

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

3178  : ?string {
3179  global $DIC;
3180 
3181  $ilDB = $DIC['ilDB'];
3182 
3183  if ($a_user_id > 0) {
3184  $set = $ilDB->queryF(
3185  'SELECT feed_hash from usr_data WHERE usr_id = %s',
3186  ['integer'],
3187  [$a_user_id]
3188  );
3189  if ($rec = $ilDB->fetchAssoc($set)) {
3190  if (strlen($rec['feed_hash']) == 32) {
3191  return $rec['feed_hash'];
3192  } elseif ($a_create) {
3193  $hash = md5(random_int(1, 9999999) + str_replace(' ', '', microtime()));
3194  $ilDB->manipulateF(
3195  'UPDATE usr_data SET feed_hash = %s' .
3196  ' WHERE usr_id = %s',
3197  ['text', 'integer'],
3198  [$hash, $a_user_id]
3199  );
3200  return $hash;
3201  }
3202  }
3203  }
3204  return null;
3205  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ 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 663 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

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

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

◆ _lookupFirstLogin()

static ilObjUser::_lookupFirstLogin ( int  $a_user_id)
static

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

Referenced by ilFirstLoginLearningHistoryProvider\getEntries().

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

◆ _lookupFullname()

static ilObjUser::_lookupFullname ( int  $a_user_id)
static

Definition at line 586 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(), ilObjDataCollection\doUpdate(), 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().

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

◆ _lookupGender()

static ilObjUser::_lookupGender ( int  $a_user_id)
static

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

Referenced by ilMail\getSalutation().

618  : string
619  {
620  return (string) self::_lookup($a_user_id, 'gender') ?? '';
621  }
+ 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 692 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(), ilAuthProviderCAS\doAuthentication(), 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(), ilAuthProviderCAS\handleLDAPDataSource(), 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().

693  {
694  global $DIC;
695 
696  $ilDB = $DIC['ilDB'];
697 
698  if (!is_array($a_user_str)) {
699  $res = $ilDB->queryF(
700  'SELECT usr_id FROM usr_data WHERE login = %s',
701  ['text'],
702  [$a_user_str]
703  );
704 
705  $user_rec = $ilDB->fetchAssoc($res);
706  if (is_array($user_rec)) {
707  return (int) $user_rec['usr_id'];
708  }
709 
710  return null;
711  }
712 
713  $set = $ilDB->query(
714  'SELECT usr_id FROM usr_data ' .
715  ' WHERE ' . $ilDB->in('login', $a_user_str, false, 'text')
716  );
717 
718  $ids = [];
719  while ($rec = $ilDB->fetchAssoc($set)) {
720  $ids[] = (int) $rec['usr_id'];
721  }
722 
723  return $ids;
724  }
$res
Definition: ltiservices.php:66
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ 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 1546 of file class.ilObjUser.php.

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

Referenced by ilLanguageFactory\_getLanguageOfUser().

1546  : string
1547  {
1548  global $DIC;
1549 
1550  $ilDB = $DIC->database();
1551  $lng = $DIC->language();
1552 
1553  $q = 'SELECT value FROM usr_pref WHERE usr_id= ' .
1554  $ilDB->quote($a_usr_id, 'integer') . ' AND keyword = ' .
1555  $ilDB->quote('language', 'text');
1556  $r = $ilDB->query($q);
1557 
1558  while ($row = $ilDB->fetchAssoc($r)) {
1559  return (string) $row['value'];
1560  }
1561  if (is_object($lng)) {
1562  return $lng->getDefaultLanguage();
1563  }
1564  return 'en';
1565  }
getDefaultLanguage()
Return default language.
ilLanguage $lng
global $DIC
Definition: shib_login.php:22
$q
Definition: shib_logout.php:21
$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 726 of file class.ilObjUser.php.

Referenced by ilCronDeleteInactiveUserReminderMail\removeEntriesFromTableIfLastLoginIsNewer().

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

◆ _lookupLogin()

static ilObjUser::_lookupLogin ( int  $a_user_id)
static

Definition at line 678 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(), ilObjSurvey\checkReminder(), ilWorkspaceUserActionProvider\collectActionsForTargetUser(), ilChatUserActionProvider\collectActionsForTargetUser(), ilOrgUnitUserAssignmentGUI\confirmRemove(), ilForumMailEventNotificationSender\createMailValueObjectsWithAttachments(), ilForumMailEventNotificationSender\createMailValueObjectWithoutAttachments(), ilObjRole\delete(), ilStartUpGUI\doStandardAuthentication(), ilObjDataCollection\doUpdate(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilStudyProgrammeIndividualPlanTableGUI\fetchData(), ilDclBaseRecordModel\fillRecordFieldExcelExport(), ilPDNewsTableGUI\fillRow(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), ilAccessibilitySupportContactsGUI\getContactLogins(), ilAttendanceList\getHTML(), ILIAS\Test\ExportImport\CertificateExport\getLoginsForIds(), ilConsultationHourAppointments\getManagedUsers(), ilConsultationHourAppointments\getManager(), ilStudyProgrammeMailMemberSearchGUI\getProcessData(), ilStudyProgrammeMailTemplateContext\getSpecificPlaceholders(), ilObjSurvey\getUserDataFromActiveId(), ilForumSettingsGUI\getUserNotificationTableData(), ilInternalLinkGUI\getUserSearchResult(), ilUserClipboard\getValidatedContent(), ilObjUserGUI\getValues(), ilAuthFrontend\handleAuthenticationSuccess(), ilCalendarAppointmentGUI\initForm(), 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(), ilContactGUI\showContacts(), ilMailSearchGUI\showResults(), ilMailFolderGUI\showUser(), ilContactGUI\submitInvitation(), ILIAS\LegalDocuments\Provide\ProvideHistory\table(), ilBuddySystemGUI\transitionAsyncCommand(), ilBuddySystemGUI\transitionCommand(), ilUserImportParser\verifyEndTag(), and ilPCParagraph\xml2output().

678  : string
679  {
680  return (string) self::_lookup($a_user_id, 'login') ?? '';
681  }
+ 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 632 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\Exercise\Submission\SubmissionManager\getDirectoryNameFromUserData(), ilExSubmission\getDirectoryNameFromUserData(), ILIAS\Exercise\TutorFeedbackFile\TutorFeedbackFileManager\getFeedbackTitle(), ILIAS\Exercise\TutorFeedbackFile\TutorFeedbackZipRepository\getFiles(), ilIndividualAssessmentMembersTableGUI\getFullNameFor(), ilAttendanceList\getHTML(), ilSurveyParticipantsTableGUI\getItems(), ilSessionOverviewTableGUI\getItems(), ilCourseParticipantsGroupsTableGUI\getItems(), ilExSubmission\getLastDownloadTime(), ILIAS\Test\Logging\TestLogViewer\getLegacyLogExportForObjId(), ilBookingParticipant\getList(), ILIAS\BookingManager\Reservations\ReservationDBRepository\getListByDate(), ilExAssignment\getMemberListData(), ilContSkillMemberTableGUI\getMembers(), 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(), ilForumSettingsGUI\getUserNotificationTableData(), ilObjStudyProgrammeAutoCategoriesGUI\getUserRepresentation(), ilObjStudyProgrammeAutoMembershipsGUI\getUserRepresentation(), ilExerciseXMLWriter\handleAssignmentMembers(), ilWorkspaceShareTableGUI\importData(), ilLOMemberTestResultTableGUI\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().

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

◆ _lookupPref()

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

Definition at line 1073 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(), ilBuddySystemRelationsTableGUI\fillRow(), ilMail\formatNamesForOutput(), ilSessionReminder\getEffectiveLeadTime(), ilBuddySystemLinkButton\getHtml(), ilUserUtil\getProfileLink(), ilTutorialSupportBlockGUI\hasContactEnabled(), ilBuddySystemGUI\requestCommand(), ilMailSearchGUI\showResults(), and ilBuddySystemGUI\transitionAsyncCommand().

1076  : ?string {
1077  global $DIC;
1078 
1079  $ilDB = $DIC['ilDB'];
1080 
1081  $query = 'SELECT * FROM usr_pref WHERE usr_id = ' . $ilDB->quote($a_usr_id, 'integer') . ' ' .
1082  'AND keyword = ' . $ilDB->quote($a_keyword, 'text');
1083  $res = $ilDB->query($query);
1084 
1085  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1086  return $row->value;
1087  }
1088  return null;
1089  }
$res
Definition: ltiservices.php:66
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ 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 2329 of file class.ilObjUser.php.

References $DIC, $ilDB, and $q.

Referenced by ilSystemStyleOverviewGUI\moveUserStyles().

2334  : void {
2335  global $DIC;
2336 
2337  $ilDB = $DIC['ilDB'];
2338 
2339  $q = 'SELECT up1.usr_id usr_id FROM usr_pref up1, usr_pref up2 ' .
2340  ' WHERE up1.keyword= ' . $ilDB->quote('style', 'text') .
2341  ' AND up1.value= ' . $ilDB->quote($a_from_style, 'text') .
2342  ' AND up2.keyword= ' . $ilDB->quote('skin', 'text') .
2343  ' AND up2.value= ' . $ilDB->quote($a_from_skin, 'text') .
2344  ' AND up1.usr_id = up2.usr_id ';
2345 
2346  $usr_set = $ilDB->query($q);
2347 
2348  while ($usr_rec = $ilDB->fetchAssoc($usr_set)) {
2349  self::_writePref($usr_rec['usr_id'], 'skin', $a_to_skin);
2350  self::_writePref($usr_rec['usr_id'], 'style', $a_to_style);
2351  }
2352  }
global $DIC
Definition: shib_login.php:22
$q
Definition: shib_logout.php:21
+ 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 2165 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

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

2165  : array
2166  {
2167  global $DIC;
2168 
2169  $ilDB = $DIC['ilDB'];
2170  $res = $ilDB->query('SELECT * FROM usr_data WHERE ' .
2171  $ilDB->in('usr_id', $a_user_ids, false, 'integer'));
2172  $user_data = [];
2173  while ($row = $ilDB->fetchAssoc($res)) {
2174  $user_data[$row['usr_id']] = $row;
2175  }
2176  return $user_data;
2177  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ 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 3225 of file class.ilObjUser.php.

Referenced by ilPDNewsBlockGUI\changeFeedSettings().

3228  : void {
3229  self::_writePref(
3230  $a_user_id,
3231  'priv_feed_pass',
3232  ($a_password == '') ? '' : md5($a_password)
3233  );
3234  }
+ Here is the caller graph for this function:

◆ _setUserInactive()

static ilObjUser::_setUserInactive ( int  $a_usr_id)
static

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

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

Referenced by ilAuthFrontend\handleLoginAttempts().

3565  : bool {
3566  global $DIC;
3567 
3568  $ilDB = $DIC['ilDB'];
3569 
3570  $query = 'UPDATE usr_data SET active = 0, inactivation_date = %s WHERE usr_id = %s';
3571  $affected = $ilDB->manipulateF($query, ['timestamp', 'integer'], [ilUtil::now(), $a_usr_id]);
3572 
3573  if ($affected) {
3574  return true;
3575  } else {
3576  return false;
3577  }
3578  }
static now()
Return current timestamp in Y-m-d H:i:s format.
global $DIC
Definition: shib_login.php:22
+ 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 2709 of file class.ilObjUser.php.

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

Referenced by ilLDAPCronSynchronization\deactivateUsers().

2712  : void {
2713  global $DIC;
2714 
2715  $ilDB = $DIC['ilDB'];
2716 
2717  if ($a_status) {
2718  $q = 'UPDATE usr_data SET active = 1, inactivation_date = NULL WHERE ' .
2719  $ilDB->in('usr_id', $a_usr_ids, false, 'integer');
2720  $ilDB->manipulate($q);
2721  } else {
2722  $usrId_IN_usrIds = $ilDB->in('usr_id', $a_usr_ids, false, 'integer');
2723 
2724  $q = 'UPDATE usr_data SET active = 0 WHERE $usrId_IN_usrIds';
2725  $ilDB->manipulate($q);
2726 
2727  $queryString = '
2728  UPDATE usr_data
2729  SET inactivation_date = %s
2730  WHERE inactivation_date IS NULL
2731  AND $usrId_IN_usrIds
2732  ';
2733  $ilDB->manipulateF($queryString, ['timestamp'], [ilUtil::now()]);
2734  }
2735  }
static now()
Return current timestamp in Y-m-d H:i:s format.
global $DIC
Definition: shib_login.php:22
$q
Definition: shib_logout.php:21
+ 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 2860 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().

2863  : bool {
2864  global $DIC;
2865  $user = new ilObjUser($obj_id);
2866  $stakeholder = new ilUserProfilePictureStakeholder();
2867  $stakeholder->setOwner($user->getId());
2868  $stream = Streams::ofResource(fopen($tmp_file, 'rb'));
2869 
2871  $rid = $DIC->resourceStorage()->manage()->find($user->getAvatarRid());
2872  // append profile picture
2873  $DIC->resourceStorage()->manage()->replaceWithStream(
2874  $rid,
2875  $stream,
2876  $stakeholder
2877  );
2878  } else {
2879  // new profile picture
2880  $rid = $DIC->resourceStorage()->manage()->stream(
2881  $stream,
2882  $stakeholder
2883  );
2884  }
2885 
2886  $user->setAvatarRid($rid->serialize());
2887  $user->update();
2888  return true;
2889  }
setAvatarRid(?string $avatar_rid)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const NO_AVATAR_RID
global $DIC
Definition: shib_login.php:22
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 3756 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

Referenced by ilStartUpGUI\processIndexPHP().

3758  : int {
3759  global $DIC;
3760 
3761  $ilDB = $DIC['ilDB'];
3762 
3763  $res = $ilDB->queryf(
3764  '
3765  SELECT usr_id, create_date FROM usr_data
3766  WHERE reg_hash = %s',
3767  ['text'],
3768  [$a_hash]
3769  );
3770  while ($row = $ilDB->fetchAssoc($res)) {
3771  $oRegSettigs = new ilRegistrationSettings();
3772 
3773  if ($oRegSettigs->getRegistrationHashLifetime() != 0 &&
3774  time() - $oRegSettigs->getRegistrationHashLifetime() > strtotime($row['create_date'])) {
3776  'reg_confirmation_hash_life_time_expired',
3777  (int) $row['usr_id']
3778  );
3779  }
3780 
3781  $ilDB->manipulateF(
3782  '
3783  UPDATE usr_data
3784  SET reg_hash = %s
3785  WHERE usr_id = %s',
3786  ['text', 'integer'],
3787  ['', (int) $row['usr_id']]
3788  );
3789 
3790  return (int) $row['usr_id'];
3791  }
3792 
3793  throw new ilRegistrationHashNotFoundException('reg_confirmation_hash_not_found');
3794  }
$res
Definition: ltiservices.php:66
Class for user related exception handling in ILIAS.
global $DIC
Definition: shib_login.php:22
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 1583 of file class.ilObjUser.php.

References $DIC, and $ilDB.

Referenced by ilAuthProviderSaml\handleSamlAuth().

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

◆ _writeExternalAccount()

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

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

References $DIC, and $ilDB.

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

◆ _writeHistory()

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

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

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

3603  : void {
3604  global $DIC;
3605 
3606  $ilDB = $DIC['ilDB'];
3607 
3608  $timestamp = time();
3609 
3610  $res = $ilDB->queryF(
3611  'SELECT * FROM loginname_history WHERE usr_id = %s AND login = %s AND history_date = %s',
3612  ['integer', 'text', 'integer'],
3613  [$a_usr_id, $a_login, $timestamp]
3614  );
3615 
3616  if ($ilDB->numRows($res) == 0) {
3617  $ilDB->manipulateF(
3618  '
3619  INSERT INTO loginname_history
3620  (usr_id, login, history_date)
3621  VALUES (%s, %s, %s)',
3622  ['integer', 'text', 'integer'],
3623  [$a_usr_id, $a_login, $timestamp]
3624  );
3625  }
3626  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
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 980 of file class.ilObjUser.php.

References $DIC, and $ilDB.

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

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

◆ activateDeletionFlag()

ilObjUser::activateDeletionFlag ( )

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

References writePref().

4044  : void
4045  {
4046  $this->writePref('delete_flag', true);
4047  }
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 2367 of file class.ilObjUser.php.

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

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

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

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

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

2417  : void {
2418  $ilDB = $this->db;
2419  if ($a_time == 0) {
2420  $a_time = date('Y-m-d H:i:s');
2421  }
2422  ilSession::set('user_pc_clip', true);
2423  $ilDB->insert('personal_pc_clipboard', [
2424  'user_id' => ['integer', $this->getId()],
2425  'content' => ['clob', $a_content],
2426  'insert_time' => ['timestamp', $a_time],
2427  'order_nr' => ['integer', $a_nr]
2428  ]);
2429  }
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 247 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().

247  : void
248  {
249  global $DIC;
250 
251  $ilErr = $DIC['ilErr'];
252 
253  // basic personal data
254  $this->setLogin($a_data['login'] ?? '');
255  if (!($a_data['passwd_type'] ?? false)) {
256  $ilErr->raiseError('<b>Error: passwd_type missing in function assignData(). ' .
257  $this->id . '!</b><br />class: ' . get_class($this) . '<br />Script: '
258  . __FILE__ . '<br />Line: ' . __LINE__, $ilErr->FATAL);
259  }
260  if (($a_data['passwd'] ?? '') != '********' && strlen($a_data['passwd'] ?? '')) {
261  $this->setPasswd($a_data['passwd'] ?? '', $a_data['passwd_type'] ?? '');
262  }
263 
264  $this->setGender((string) ($a_data['gender'] ?? ''));
265  $this->setUTitle((string) ($a_data['title'] ?? ''));
266  $this->setFirstname((string) ($a_data['firstname'] ?? ''));
267  $this->setLastname((string) ($a_data['lastname'] ?? ''));
268  $this->setFullname();
269  if (isset($a_data['birthday']) && is_string($a_data['birthday'])) {
270  $this->setBirthday($a_data['birthday']);
271  } else {
272  $this->setBirthday(null);
273  }
274 
275  // address data
276  $this->setInstitution((string) ($a_data['institution'] ?? ''));
277  $this->setDepartment((string) ($a_data['department'] ?? ''));
278  $this->setStreet((string) ($a_data['street'] ?? ''));
279  $this->setCity((string) ($a_data['city'] ?? ''));
280  $this->setZipcode((string) ($a_data['zipcode'] ?? ''));
281  $this->setCountry((string) ($a_data['country'] ?? ''));
282  $this->setSelectedCountry((string) ($a_data['sel_country'] ?? ''));
283  $this->setPhoneOffice((string) ($a_data['phone_office'] ?? ''));
284  $this->setPhoneHome((string) ($a_data['phone_home'] ?? ''));
285  $this->setPhoneMobile((string) ($a_data['phone_mobile'] ?? ''));
286  $this->setFax((string) ($a_data['fax'] ?? ''));
287  $this->setMatriculation((string) ($a_data['matriculation'] ?? ''));
288  $this->setEmail((string) ($a_data['email'] ?? ''));
289  $this->setSecondEmail((string) ($a_data['second_email'] ?? null));
290  $this->setHobby((string) ($a_data['hobby'] ?? ''));
291  $this->setClientIP((string) ($a_data['client_ip'] ?? ''));
292  $this->setPasswordEncodingType($a_data['passwd_enc_type'] ?? null);
293  $this->setPasswordSalt($a_data['passwd_salt'] ?? null);
294 
295  // other data
296  $this->setLatitude($a_data['latitude'] ?? null);
297  $this->setLongitude($a_data['longitude'] ?? null);
298  $this->setLocationZoom($a_data['loc_zoom'] ?? null);
299 
300  // system data
301  $this->setLastLogin((string) ($a_data['last_login'] ?? ''));
302  $this->setFirstLogin((string) ($a_data['first_login'] ?? ''));
303  $this->setLastProfilePrompt((string) ($a_data['last_profile_prompt'] ?? ''));
304  $this->setLastUpdate((string) ($a_data['last_update'] ?? ''));
305  $this->create_date = $a_data['create_date'] ?? '';
306  $this->setComment((string) ($a_data['referral_comment'] ?? ''));
307  $this->approve_date = ($a_data['approve_date'] ?? null);
308  $this->active = ($a_data['active'] ?? 0);
309  $this->agree_date = ($a_data['agree_date'] ?? null);
310 
311  $this->setInactivationDate((string) ($a_data['inactivation_date'] ?? null));
312 
313  // time limitation
314  $this->setTimeLimitOwner((int) ($a_data['time_limit_owner'] ?? 0));
315  $this->setTimeLimitUnlimited((bool) ($a_data['time_limit_unlimited'] ?? false));
316  $this->setTimeLimitFrom((int) ($a_data['time_limit_from'] ?? 0));
317  $this->setTimeLimitUntil((int) ($a_data['time_limit_until'] ?? 0));
318  $this->setTimeLimitMessage((string) ($a_data['time_limit_message'] ?? ''));
319 
320  // user profile incomplete?
321  $this->setProfileIncomplete((bool) ($a_data['profile_incomplete'] ?? false));
322 
323  //authentication
324  $this->setAuthMode((string) ($a_data['auth_mode'] ?? null));
325  $this->setExternalAccount((string) ($a_data['ext_account'] ?? ''));
326 
327  $this->setIsSelfRegistered((bool) ($a_data['is_self_registered'] ?? false));
328 
329  // Avatar
330  $this->avatar_rid = (string) ($a_data['rid'] ?? self::NO_AVATAR_RID);
331  }
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:22
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 4151 of file class.ilObjUser.php.

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

4151  : string
4152  {
4153  if (count($a_attr) > 0) {
4154  return implode(', ', $a_attr);
4155  }
4156  return '';
4157  }
+ Here is the caller graph for this function:

◆ checkTimeLimit()

ilObjUser::checkTimeLimit ( )

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

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

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

1823  : bool
1824  {
1825  if ($this->getTimeLimitUnlimited()) {
1826  return true;
1827  }
1828  if ($this->getTimeLimitFrom() < time() and $this->getTimeLimitUntil() > time()) {
1829  return true;
1830  }
1831  return false;
1832  }
+ 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 2012 of file class.ilObjUser.php.

References $id.

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

◆ clipboardDeleteAll()

ilObjUser::clipboardDeleteAll ( )

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

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

Referenced by delete().

2495  : void
2496  {
2497  global $DIC;
2498 
2499  $ilDB = $DIC['ilDB'];
2500 
2501  $ilDB->manipulateF('DELETE FROM personal_clipboard WHERE ' .
2502  'user_id = %s', ['integer'], [$this->getId()]);
2503  }
global $DIC
Definition: shib_login.php:22
+ 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 2483 of file class.ilObjUser.php.

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

2483  : void
2484  {
2485  $ilDB = $this->db;
2486 
2487  $ilDB->manipulateF(
2488  'DELETE FROM personal_clipboard WHERE ' .
2489  'type = %s AND user_id = %s',
2490  ['text', 'integer'],
2491  [$a_type, $this->getId()]
2492  );
2493  }
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 2464 of file class.ilObjUser.php.

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

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

◆ copyProfilePicturesToDirectory()

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

Definition at line 2943 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().

2946  : void {
2947  $a_dir = trim(str_replace('..', '', $a_dir));
2948  if ($a_dir == '' || !is_dir($a_dir)) {
2949  return;
2950  }
2951  // if profile picture is on IRSS
2952  global $DIC;
2953  $irss = $DIC->resourceStorage();
2954  $user = new ilObjUser($a_user_id);
2956  $rid = $irss->manage()->find($user->getAvatarRid());
2957  // Main Picture only is needed
2958  $stream = $irss->consume()->stream($rid)->getStream();
2959  $target = $a_dir . '/usr_' . $a_user_id . '.jpg';
2960  fwrite(fopen($target, 'wb'), (string) $stream);
2961 
2962  return;
2963  }
2964 
2965  // Legacy Picture Handling
2966  $webspace_dir = ilFileUtils::getWebspaceDir();
2967  $image_dir = $webspace_dir . '/usr_images';
2968  $images = [
2969  'upload_' . $a_user_id . 'pic',
2970  'usr_' . $a_user_id . '.' . 'jpg',
2971  'usr_' . $a_user_id . '_small.jpg',
2972  'usr_' . $a_user_id . '_xsmall.jpg',
2973  'usr_' . $a_user_id . '_xxsmall.jpg',
2974  'upload_' . $a_user_id];
2975  foreach ($images as $image) {
2976  if (is_file($image_dir . '/' . $image)) {
2977  copy($image_dir . '/' . $image, $a_dir . '/' . $image);
2978  }
2979  }
2980  }
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:22
ilObjUser $user
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilObjUser::delete ( )

Definition at line 1099 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().

1099  : bool
1100  {
1101  global $DIC;
1102 
1103  $rbacadmin = $DIC->rbac()->admin();
1104  $ilDB = $this->db;
1105 
1106  // deassign from ldap groups
1108  $mapping->deleteUser($this->getId());
1109 
1110  // remove mailbox / update sent mails
1111  $mailbox = new ilMailbox($this->getId());
1112  $mailbox->delete();
1113  $mailbox->updateMailsOfDeletedUser($this->getLogin());
1114 
1115  // delete block settings
1117 
1118  // delete user_account
1119  $ilDB->manipulateF(
1120  'DELETE FROM usr_data WHERE usr_id = %s',
1121  ['integer'],
1122  [$this->getId()]
1123  );
1124 
1125  $this->deleteMultiTextFields();
1126 
1127  // delete user_prefs
1128  self::_deleteAllPref($this->getId());
1129 
1130  $this->removeUserPicture(false); // #8597
1131 
1132  // delete user_session
1134 
1135  // remove user from rbac
1136  $rbacadmin->removeUser($this->getId());
1137 
1138  // remove bookmarks
1139  // TODO: move this to class.ilBookmarkFolder
1140  $q = 'DELETE FROM bookmark_tree WHERE tree = ' .
1141  $ilDB->quote($this->getId(), 'integer');
1142  $ilDB->manipulate($q);
1143 
1144  $q = 'DELETE FROM bookmark_data WHERE user_id = ' .
1145  $ilDB->quote($this->getId(), 'integer');
1146  $ilDB->manipulate($q);
1147 
1148  // Delete crs entries
1149  ilObjCourse::_deleteUser($this->getId());
1150 
1151  // Delete user tracking
1153 
1155 
1156  // Delete Tracking data SCORM 2004 RTE
1158 
1159  // Delete Tracking data SCORM 1.2 RTE
1161 
1162  // remove all notifications
1164 
1165  // remove portfolios
1167 
1168  // remove workspace
1169  $tree = new ilWorkspaceTree($this->getId());
1170  $tree->cascadingDelete();
1171 
1172  // remove reminder entries
1173  $this->cron_delete_user_reminder_mail->removeSingleUserFromTable($this->getId());
1174 
1175  // badges
1177 
1178  // remove org unit assignments
1179  $ilOrgUnitUserAssignmentQueries = ilOrgUnitUserAssignmentQueries::getInstance();
1180  $ilOrgUnitUserAssignmentQueries->deleteAllAssignmentsOfUser($this->getId());
1181 
1182  // Delete user defined field entries
1184 
1185  // Delete clipboard entries
1186  $this->clipboardDeleteAll();
1187 
1188  // Reset owner
1189  $this->resetOwner();
1190 
1191  // Trigger deleteUser Event
1192  global $DIC;
1193 
1194  $ilAppEventHandler = $DIC['ilAppEventHandler'];
1195  $ilAppEventHandler->raise(
1196  'components/ILIAS/User',
1197  'deleteUser',
1198  ['usr_id' => $this->getId()]
1199  );
1200 
1201  // delete object data
1202  parent::delete();
1203  return true;
1204  }
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.
Mail Box class Base class for creating and handling mail boxes.
static removeForUser(int $user_id)
Remove all notifications for given user.
ilDBInterface $db
global $DIC
Definition: shib_login.php:22
static deleteByUserId(int $a_user_id)
static deleteUserPortfolios(int $a_user_id)
Delete all portfolio data for user.
$q
Definition: shib_logout.php:21
static _removeTrackingDataForUser(int $user_id)
+ Here is the call graph for this function:

◆ deleteMultiTextFields()

ilObjUser::deleteMultiTextFields ( )
protected

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

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

Referenced by delete(), and updateMultiTextFields().

4234  : void
4235  {
4236  global $DIC;
4237 
4238  $ilDB = $DIC['ilDB'];
4239 
4240  if (!$this->getId()) {
4241  return;
4242  }
4243 
4244  $ilDB->manipulate('DELETE FROM usr_data_multi' .
4245  ' WHERE usr_id = ' . $ilDB->quote($this->getId(), 'integer'));
4246  }
global $DIC
Definition: shib_login.php:22
+ 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 946 of file class.ilObjUser.php.

References ilObject\getId().

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

◆ deleteUserDefinedFieldEntries()

◆ existsPref()

ilObjUser::existsPref ( string  $a_keyword)

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

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

◆ exportPersonalData()

ilObjUser::exportPersonalData ( )

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

References ilObject\$title, ilExport\_getExportDirectory(), ilFileUtils\delDir(), ilObject\getId(), getLastname(), and getLogin().

3954  : void
3955  {
3956  $exp = new ilExport();
3957  $dir = ilExport::_getExportDirectory($this->getId(), 'xml', 'usr', 'personal_data');
3958  ilFileUtils::delDir($dir, true);
3959  $title = $this->getLastname() . ', ' . $this->getLastname() . ' [' . $this->getLogin() . ']';
3960  $exp->exportEntity(
3961  'personal_data',
3962  $this->getId(),
3963  '',
3964  'components/ILIAS/User',
3965  $title,
3966  $dir
3967  );
3968  }
string $title
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 delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ findInterests()

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

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

References $DIC, $ilDB, and $res.

Referenced by ilPublicUserProfileGUI\getAutocompleteResult().

4252  : array {
4253  global $DIC;
4254 
4255  $ilDB = $DIC['ilDB'];
4256 
4257  $res = [];
4258 
4259  $sql = 'SELECT DISTINCT(value)' .
4260  ' FROM usr_data_multi' .
4261  ' WHERE ' . $ilDB->like('value', 'text', '%' . $a_term . '%');
4262  if ($a_field_id) {
4263  $sql .= ' AND field_id = ' . $ilDB->quote($a_field_id, 'text');
4264  }
4265  if ($a_user_id) {
4266  $sql .= ' AND usr_id <> ' . $ilDB->quote($a_user_id, 'integer');
4267  }
4268  $sql .= ' ORDER BY value';
4269  $set = $ilDB->query($sql);
4270  while ($row = $ilDB->fetchAssoc($set)) {
4271  $res[] = $row['value'];
4272  }
4273 
4274  return $res;
4275  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ getActive()

ilObjUser::getActive ( )

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

References $active.

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

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

◆ getAgreeDate()

ilObjUser::getAgreeDate ( )

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

References $agree_date.

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

◆ getApproveDate()

ilObjUser::getApproveDate ( )

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

References $approve_date.

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

◆ getAuthMode()

ilObjUser::getAuthMode ( bool  $a_auth_key = false)

Definition at line 2654 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().

2654  : ?string
2655  {
2656  if (!$a_auth_key) {
2657  return $this->auth_mode;
2658  }
2659  return ilAuthUtils::_getAuthMode($this->auth_mode);
2660  }
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 2914 of file class.ilObjUser.php.

References ilObject\getId().

Referenced by ilPDMailBlockGUI\getListItemForData().

2914  : Avatar
2915  {
2916  return self::_getAvatar($this->getId());
2917  }
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 1979 of file class.ilObjUser.php.

References $avatar_rid.

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

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

◆ getBirthday()

ilObjUser::getBirthday ( )

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

References $birthday.

Referenced by saveAsNew(), and update().

3806  : ?string
3807  {
3808  return $this->birthday;
3809  }
string $birthday
+ Here is the caller graph for this function:

◆ getCity()

ilObjUser::getCity ( )

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

References $city.

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

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

◆ getClientIP()

ilObjUser::getClientIP ( )

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

References $client_ip.

Referenced by ilAuthFrontend\checkIp().

1457  : string
1458  {
1459  return $this->client_ip;
1460  }
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 2553 of file class.ilObjUser.php.

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

2556  : array {
2557  global $DIC;
2558 
2559  $ilDB = $DIC['ilDB'];
2560  $ilUser = $DIC['ilUser'];
2561 
2562  $objs = $ilDB->queryF(
2563  'SELECT * FROM personal_clipboard WHERE ' .
2564  'user_id = %s AND parent = %s AND insert_time = %s ' .
2565  ' ORDER BY order_nr',
2566  ['integer', 'integer', 'timestamp'],
2567  [$ilUser->getId(), $a_parent, $a_insert_time]
2568  );
2569  $objects = [];
2570  while ($obj = $ilDB->fetchAssoc($objs)) {
2571  if ($obj['type'] == 'mob') {
2572  $obj['title'] = ilObject::_lookupTitle($obj['item_id']);
2573  }
2574  $objects[] = ['id' => $obj['item_id'],
2575  'type' => $obj['type'], 'title' => $obj['title'], 'insert_time' => $obj['insert_time']];
2576  }
2577  return $objects;
2578  }
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:22
+ 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 2508 of file class.ilObjUser.php.

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

Referenced by ilClipboardTableGUI\getItems().

2511  : array {
2512  global $DIC;
2513 
2514  $ilDB = $DIC['ilDB'];
2515 
2516  $par = '';
2517  if ($a_top_nodes_only) {
2518  $par = ' AND parent = ' . $ilDB->quote(0, 'integer') . ' ';
2519  }
2520 
2521  $type_str = ($a_type != '')
2522  ? ' AND type = ' . $ilDB->quote($a_type, 'text') . ' '
2523  : '';
2524  $q = 'SELECT * FROM personal_clipboard WHERE ' .
2525  'user_id = ' . $ilDB->quote($this->getId(), 'integer') . ' ' .
2526  $type_str . $par .
2527  ' ORDER BY order_nr';
2528  $objs = $ilDB->query($q);
2529  $objects = [];
2530  while ($obj = $ilDB->fetchAssoc($objs)) {
2531  if ($obj['type'] == 'mob') {
2532  $obj['title'] = ilObject::_lookupTitle($obj['item_id']);
2533  if (ilObject::_lookupType((int) $obj['item_id']) !== 'mob') {
2534  continue;
2535  }
2536  }
2537  if ($obj['type'] == 'incl') {
2538  $obj['title'] = ilMediaPoolPage::lookupTitle($obj['item_id']);
2539  if (!ilPageObject::_exists('mep', (int) $obj['item_id'], '-')) {
2540  continue;
2541  }
2542  }
2543  $objects[] = ['id' => $obj['item_id'],
2544  'type' => $obj['type'], 'title' => $obj['title'],
2545  'insert_time' => $obj['insert_time']];
2546  }
2547  return $objects;
2548  }
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:22
$q
Definition: shib_logout.php:21
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 1658 of file class.ilObjUser.php.

References $referral_comment.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getCountry()

ilObjUser::getCountry ( )

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

References $country.

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

1391  : string
1392  {
1393  return $this->country;
1394  }
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 1600 of file class.ilObjUser.php.

References ilSession\get().

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

◆ getDateFormat()

ilObjUser::getDateFormat ( )

Definition at line 1028 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(), and ilIndividualAssessmentDateFormatter\getUserDateFormat().

1028  : DateFormat
1029  {
1030  if (!($format = $this->getPref('date_format'))) {
1031  $settings = ilCalendarSettings::_getInstance();
1032  $format = $settings->getDefaultDateFormat();
1033  }
1034 
1035  switch ($format) {
1037  return $this->date_format_factory->germanShort();
1038 
1040  return $this->date_format_factory->americanShort();
1041 
1043  default:
1044  return $this->date_format_factory->standard();
1045  }
1046  }
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 1048 of file class.ilObjUser.php.

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

1048  : DateFormat
1049  {
1051  return $this->date_format_factory->withTime24($this->getDateFormat());
1052  }
1053  return $this->date_format_factory->withTime12($this->getDateFormat());
1054  }
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:

◆ getDepartment()

ilObjUser::getDepartment ( )

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

References $department.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getEmail()

◆ getExternalAccount()

ilObjUser::getExternalAccount ( )

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

References $ext_account.

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

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

◆ getFax()

ilObjUser::getFax ( )

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

References $fax.

Referenced by deleteUserDefinedFieldEntries().

1447  : string
1448  {
1449  return $this->fax;
1450  }
+ 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 3918 of file class.ilObjUser.php.

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

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

◆ getFirstLogin()

ilObjUser::getFirstLogin ( )

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

References $first_login.

Referenced by refreshLogin().

1628  : string
1629  {
1630  return $this->first_login;
1631  }
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 1232 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(), ilObjSurvey\saveAuthorToMetadata(), ilAccountMail\send(), ilAccountRegistrationMail\sendLanguageVariableBasedAccountMail(), and ilObjUserFolderGUI\showActionConfirmation().

1232  : string
1233  {
1234  if (!$a_max_strlen) {
1235  return ilUtil::stripSlashes($this->fullname);
1236  }
1237 
1238  if (strlen($this->fullname) <= $a_max_strlen) {
1239  return ilUtil::stripSlashes($this->fullname);
1240  }
1241 
1242  if ((strlen($this->utitle) + strlen($this->lastname) + 4) <= $a_max_strlen) {
1243  return ilUtil::stripSlashes($this->utitle . ' ' . substr($this->firstname, 0, 1) . '. ' . $this->lastname);
1244  }
1245 
1246  if ((strlen($this->firstname) + strlen($this->lastname) + 1) <= $a_max_strlen) {
1247  return ilUtil::stripSlashes($this->firstname . ' ' . $this->lastname);
1248  }
1249 
1250  if ((strlen($this->lastname) + 3) <= $a_max_strlen) {
1251  return ilUtil::stripSlashes(substr($this->firstname, 0, 1) . '. ' . $this->lastname);
1252  }
1253 
1254  return ilUtil::stripSlashes(substr($this->lastname, 0, $a_max_strlen));
1255  }
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 1296 of file class.ilObjUser.php.

References $gender.

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

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

◆ getGeneralInterests()

ilObjUser::getGeneralInterests ( )
Returns
string[]

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

References $interests_general.

Referenced by updateMultiTextFields().

4085  : array
4086  {
4087  return $this->interests_general;
4088  }
array $interests_general
+ Here is the caller graph for this function:

◆ getGeneralInterestsAsText()

ilObjUser::getGeneralInterestsAsText ( )

Get general interests as plain text.

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

References buildTextFromArray().

4093  : string
4094  {
4095  return $this->buildTextFromArray($this->interests_general);
4096  }
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 1510 of file class.ilObjUser.php.

References $hobby.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getInactivationDate()

ilObjUser::getInactivationDate ( )

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

References $inactivation_date.

4029  : ?string
4030  {
4031  return $this->inactivation_date;
4032  }
string $inactivation_date

◆ getInstitution()

ilObjUser::getInstitution ( )

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

References $institution.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getLanguage()

◆ getLastLogin()

ilObjUser::getLastLogin ( )

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

References $last_login.

Referenced by ilObjUserFolderGUI\showActionConfirmation().

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

◆ getLastname()

◆ getLastPasswordChangeTS()

ilObjUser::getLastPasswordChangeTS ( )

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

References $last_password_change_ts.

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

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

◆ getLastProfilePrompt()

ilObjUser::getLastProfilePrompt ( )

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

References $last_profile_prompt.

1638  : string
1639  {
1641  }
string $last_profile_prompt

◆ getLastUpdate()

ilObjUser::getLastUpdate ( )

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

References ilObject\$last_update.

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

◆ getLatitude()

ilObjUser::getLatitude ( )

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

References $latitude.

Referenced by ilPersonalProfileGUI\addLocationToForm().

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

◆ getLocationZoom()

ilObjUser::getLocationZoom ( )

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

References $loc_zoom.

Referenced by ilPersonalProfileGUI\addLocationToForm().

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

◆ getLogin()

◆ getLoginAttempts()

ilObjUser::getLoginAttempts ( )

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

References $login_attempts.

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

◆ getLoginByUserId()

ilObjUser::getLoginByUserId ( int  $a_userid)

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

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

2131  : ?string
2132  {
2133  $login = self::_lookupLogin($a_userid);
2134  return $login ?: null;
2135  }
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 2025 of file class.ilObjUser.php.

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

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

◆ getLongitude()

ilObjUser::getLongitude ( )

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

References $longitude.

Referenced by ilPersonalProfileGUI\addLocationToForm().

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

◆ getLookingForHelp()

ilObjUser::getLookingForHelp ( )
Returns
string[]

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

References $interests_help_looking.

Referenced by updateMultiTextFields().

4133  : array
4134  {
4136  }
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 4141 of file class.ilObjUser.php.

References buildTextFromArray().

4141  : string
4142  {
4143  return $this->buildTextFromArray($this->interests_help_looking);
4144  }
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 1467 of file class.ilObjUser.php.

References $matriculation.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getOfferingHelp()

ilObjUser::getOfferingHelp ( )
Returns
string[]

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

References $interests_help_offered.

Referenced by updateMultiTextFields().

4109  : array
4110  {
4112  }
array $interests_help_offered
+ Here is the caller graph for this function:

◆ getOfferingHelpAsText()

ilObjUser::getOfferingHelpAsText ( )

Get help offering as plain text.

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

References buildTextFromArray().

4117  : string
4118  {
4119  return $this->buildTextFromArray($this->interests_help_offered);
4120  }
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 2644 of file class.ilObjUser.php.

References ilObject\getId().

2644  : string
2645  {
2646  return self::lookupOrgUnitsRepresentation($this->getId());
2647  }
+ 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 1278 of file class.ilObjUser.php.

References $passwd.

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

1278  : string
1279  {
1280  return $this->passwd;
1281  }
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 1286 of file class.ilObjUser.php.

References $passwd_type.

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

◆ getPasswordAge()

ilObjUser::getPasswordAge ( )

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

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

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

◆ getPasswordEncodingType()

ilObjUser::getPasswordEncodingType ( )

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

References $password_encoding_type.

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

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

◆ getPasswordPolicyResetStatus()

ilObjUser::getPasswordPolicyResetStatus ( )

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

References $passwd_policy_reset.

Referenced by isPasswordChangeDemanded().

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

◆ getPasswordSalt()

ilObjUser::getPasswordSalt ( )

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

References $password_salt.

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

233  : ?string
234  {
235  return $this->password_salt;
236  }
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 2435 of file class.ilObjUser.php.

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

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

2435  : array // Missing array type.
2436  {
2437  $ilDB = $this->db;
2438 
2439  if (!ilSession::get('user_pc_clip')) {
2440  return [];
2441  }
2442 
2443  $set = $ilDB->queryF('SELECT MAX(insert_time) mtime FROM personal_pc_clipboard ' .
2444  ' WHERE user_id = %s', ['integer'], [$this->getId()]);
2445  $row = $ilDB->fetchAssoc($set);
2446 
2447  $set = $ilDB->queryF(
2448  'SELECT * FROM personal_pc_clipboard ' .
2449  ' WHERE user_id = %s AND insert_time = %s ORDER BY order_nr ASC',
2450  ['integer', 'timestamp'],
2451  [$this->getId(), $row['mtime']]
2452  );
2453  $content = [];
2454  while ($row = $ilDB->fetchAssoc($set)) {
2455  $content[] = $row['content'];
2456  }
2457 
2458  return $content;
2459  }
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 3970 of file class.ilObjUser.php.

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

Referenced by sendPersonalDataFile().

3970  : string
3971  {
3972  $dir = ilExport::_getExportDirectory($this->getId(), 'xml', 'usr', 'personal_data');
3973  if (!is_dir($dir)) {
3974  return '';
3975  }
3976  foreach (ilFileUtils::getDir($dir) as $entry) {
3977  if (is_int(strpos($entry['entry'], '.zip'))) {
3978  return $entry['entry'];
3979  }
3980  }
3981 
3982  return '';
3983  }
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 2896 of file class.ilObjUser.php.

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

Referenced by ilForumAuthorInformation\getUserImagePath().

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

◆ getPhoneHome()

ilObjUser::getPhoneHome ( )

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

References $phone_home.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getPhoneMobile()

ilObjUser::getPhoneMobile ( )

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

References $phone_mobile.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getPhoneOffice()

ilObjUser::getPhoneOffice ( )

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

References $phone_office.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getPref()

ilObjUser::getPref ( string  $a_keyword)

Definition at line 1063 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().

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

◆ getProfileIncomplete()

ilObjUser::getProfileIncomplete ( )

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

References $profile_incomplete, and ANONYMOUS_USER_ID.

Referenced by saveAsNew(), and update().

1839  : bool
1840  {
1841  if ($this->id == ANONYMOUS_USER_ID) {
1842  return false;
1843  }
1845  }
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 4285 of file class.ilObjUser.php.

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

Referenced by ilInternalLink\searchUsers().

4287  : array {
4288  global $DIC;
4289 
4290  $ilDB = $DIC->database();
4291 
4292  $set = $ilDB->query(
4293  'SELECT * FROM usr_pref ' .
4294  ' WHERE keyword = ' . $ilDB->quote('public_profile', 'text') .
4295  ' AND ' . $ilDB->in('usr_id', $a_user_ids, false, 'integer')
4296  );
4297  $r = [
4298  'global' => [],
4299  'local' => [],
4300  'public' => [],
4301  'not_public' => []
4302  ];
4303  while ($rec = $ilDB->fetchAssoc($set)) {
4304  if ($rec['value'] == 'g') {
4305  $r['global'][] = $rec['usr_id'];
4306  $r['public'][] = $rec['usr_id'];
4307  }
4308  if ($rec['value'] == 'y') {
4309  $r['local'][] = $rec['usr_id'];
4310  $r['public'][] = $rec['usr_id'];
4311  }
4312  }
4313  foreach ($a_user_ids as $id) {
4314  if (!in_array($id, $r['public'])) {
4315  $r['not_public'][] = $id;
4316  }
4317  }
4318 
4319  return $r;
4320  }
global $DIC
Definition: shib_login.php:22
$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 3591 of file class.ilObjUser.php.

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

Referenced by ilPDMailBlockGUI\getListItemForData().

3591  : string
3592  {
3593  if ($this->hasPublicProfile()) {
3594  return $this->getFirstname() . ' ' . $this->getLastname() . ' (' . $this->getLogin() . ')';
3595  } else {
3596  return $this->getLogin();
3597  }
3598  }
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 1495 of file class.ilObjUser.php.

References $second_email.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getSelectedCountry()

ilObjUser::getSelectedCountry ( )

Get selected country (selection drop down)

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

References $sel_country.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getStoredActive()

ilObjUser::getStoredActive ( int  $a_id)

get user active state

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

Referenced by syncActive(), and update().

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

◆ getStreet()

ilObjUser::getStreet ( )

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

References $street.

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

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

◆ getTimeFormat()

ilObjUser::getTimeFormat ( )

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

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

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

1018  : string
1019  {
1020  if ($format = $this->getPref('time_format')) {
1021  return $format;
1022  } else {
1023  $settings = ilCalendarSettings::_getInstance();
1024  return $settings->getDefaultTimeFormat();
1025  }
1026  }
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 1778 of file class.ilObjUser.php.

References $time_limit_from.

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

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

◆ getTimeLimitMessage()

ilObjUser::getTimeLimitMessage ( )

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

References $time_limit_message.

Referenced by update().

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

◆ getTimeLimitOwner()

ilObjUser::getTimeLimitOwner ( )

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

Referenced by saveAsNew(), and update().

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

◆ getTimeLimitUnlimited()

ilObjUser::getTimeLimitUnlimited ( )

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

References $time_limit_unlimited.

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

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

◆ getTimeLimitUntil()

ilObjUser::getTimeLimitUntil ( )

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

References $time_limit_until.

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

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

◆ getTimeZone()

ilObjUser::getTimeZone ( )

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

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

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

◆ getUserDefinedData()

ilObjUser::getUserDefinedData ( )

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

Referenced by deleteUserDefinedFieldEntries().

3007  : array // Missing array type.
3008  {
3009  return $this->user_defined_data ?: [];
3010  }
+ 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 2087 of file class.ilObjUser.php.

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

Referenced by ilObjSurvey\sendNotificationMail().

2087  : array
2088  {
2089  global $DIC;
2090 
2091  $ilDB = $DIC->database();
2092 
2093  $res = $ilDB->queryF(
2094  'SELECT usr_id FROM usr_data ' .
2095  'WHERE email = %s and active = 1',
2096  ['text'],
2097  [$a_email]
2098  );
2099  $ids = [];
2100  while ($row = $ilDB->fetchObject($res)) {
2101  $ids[] = (int) $row->usr_id;
2102  }
2103 
2104  return $ids;
2105  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ 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 3817 of file class.ilObjUser.php.

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

Referenced by ilCronDeleteInactiveUserAccounts\run().

3819  : array {
3820  global $DIC;
3821 
3822  if ($periodInDays < 1) {
3823  throw new ilException('Invalid period given');
3824  }
3825 
3826  $date = date('Y-m-d H:i:s', (time() - ($periodInDays * 24 * 60 * 60)));
3827 
3828  $query = 'SELECT usr_id FROM usr_data WHERE last_login IS NOT NULL AND last_login < %s';
3829 
3830  $ids = [];
3831 
3832  $types = ['timestamp'];
3833  $values = [$date];
3834 
3835  $res = $DIC->database()->queryF($query, $types, $values);
3836  while ($row = $DIC->database()->fetchAssoc($res)) {
3837  $ids[] = (int) $row['usr_id'];
3838  }
3839 
3840  return $ids;
3841  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ 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 3848 of file class.ilObjUser.php.

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

Referenced by ilCronDeleteNeverLoggedInUserAccounts\run().

3850  : array {
3851  global $DIC;
3852 
3853  $date = date('Y-m-d H:i:s', (time() - ($thresholdInDays * 24 * 60 * 60)));
3854 
3855  $query = 'SELECT usr_id FROM usr_data WHERE last_login IS NULL AND create_date < %s';
3856 
3857  $ids = [];
3858 
3859  $types = ['timestamp'];
3860  $values = [$date];
3861 
3862  $res = $DIC->database()->queryF($query, $types, $values);
3863  while ($row = $DIC->database()->fetchAssoc($res)) {
3864  $ids[] = (int) $row['usr_id'];
3865  }
3866 
3867  return $ids;
3868  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ 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 2111 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

Referenced by ilPasswordAssistanceGUI\submitUsernameAssistanceForm().

2111  : array
2112  {
2113  global $DIC;
2114 
2115  $ilDB = $DIC->database();
2116 
2117  $res = $ilDB->queryF(
2118  'SELECT login FROM usr_data ' .
2119  'WHERE email = %s and active = 1',
2120  ['text'],
2121  [$a_email]
2122  );
2123  $ids = [];
2124  while ($row = $ilDB->fetchObject($res)) {
2125  $ids[] = $row->login;
2126  }
2127 
2128  return $ids;
2129  }
$res
Definition: ltiservices.php:66
global $DIC
Definition: shib_login.php:22
+ 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 3511 of file class.ilObjUser.php.

References $DIC, and $ilDB.

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

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

◆ getUTitle()

ilObjUser::getUTitle ( )

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

References $utitle.

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

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

◆ getZipcode()

ilObjUser::getZipcode ( )

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

References $zipcode.

Referenced by deleteUserDefinedFieldEntries().

1381  : string
1382  {
1383  return $this->zipcode;
1384  }
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 1990 of file class.ilObjUser.php.

References $DIC, and $ilDB.

Referenced by ilAuthFrontend\checkSimultaneousLogins().

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

◆ hasDeletionFlag()

ilObjUser::hasDeletionFlag ( )

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

References getPref().

4054  : bool
4055  {
4056  return (bool) $this->getPref('delete_flag');
4057  }
getPref(string $a_keyword)
+ Here is the call graph for this function:

◆ hasProfilePicture()

ilObjUser::hasProfilePicture ( )

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

References ilObject\getId().

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

◆ hasPublicProfile()

ilObjUser::hasPublicProfile ( )

returns true if public is profile, false otherwise

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

References getPref().

Referenced by getPublicName().

3583  : bool
3584  {
3585  return in_array($this->getPref('public_profile'), ['y', 'g']);
3586  }
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 3994 of file class.ilObjUser.php.

4000  : void {
4001  $imp = new ilImport();
4002  // bookmarks need to be skipped, importer does not exist anymore
4003  $imp->addSkipImporter('components/ILIAS/Bookmarks');
4004  if (!$a_profile_data) {
4005  $imp->addSkipEntity('components/ILIAS/User', 'usr_profile');
4006  }
4007  if (!$a_settings) {
4008  $imp->addSkipEntity('components/ILIAS/User', 'usr_setting');
4009  }
4010  if (!$a_notes) {
4011  $imp->addSkipEntity('components/ILIAS/Notes', 'user_notes');
4012  }
4013  if (!$a_calendar) {
4014  $imp->addSkipEntity('components/ILIAS/Calendar', 'calendar');
4015  }
4016  $imp->importEntity(
4017  $a_file['tmp_name'],
4018  $a_file['name'],
4019  'personal_data',
4020  'components/ILIAS/User'
4021  );
4022  }
Import class.

◆ isAnonymous()

ilObjUser::isAnonymous ( )

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

References ilObject\getId().

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

4034  : bool
4035  {
4036  return self::_isAnonymous($this->getId());
4037  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCurrentUserActive()

ilObjUser::isCurrentUserActive ( )

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

References ilObject\$db, and $ilDB.

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

◆ isPasswordChangeDemanded()

ilObjUser::isPasswordChangeDemanded ( )

Definition at line 1847 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().

1847  : bool
1848  {
1849  if ($this->id == ANONYMOUS_USER_ID) {
1850  return false;
1851  }
1852 
1853  if ($this->id == SYSTEM_USER_ID) {
1854  if (
1855  LocalUserPasswordManager::getInstance()->verifyPassword($this, base64_decode('aG9tZXI=')) &&
1857  ) {
1858  return true;
1859  } else {
1860  return false;
1861  }
1862  }
1863 
1864  $security = ilSecuritySettings::_getInstance();
1865 
1866  $authModeAllowsPasswordChange = !ilAuthUtils::_needsExternalAccountByAuthMode($this->getAuthMode(true));
1867  $passwordResetOnFirstLogin = (
1868  $security->isPasswordChangeOnFirstLoginEnabled() &&
1869  $this->getLastPasswordChangeTS() == 0 && $this->is_self_registered == false
1870  );
1871  $passwordResetOnChangedPolicy = $this->getPasswordPolicyResetStatus();
1872 
1873  return ($authModeAllowsPasswordChange && ($passwordResetOnFirstLogin || $passwordResetOnChangedPolicy));
1874  }
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 1876 of file class.ilObjUser.php.

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

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

1876  : bool
1877  {
1878  if ($this->id == ANONYMOUS_USER_ID) {
1879  return false;
1880  }
1881 
1882  $security = ilSecuritySettings::_getInstance();
1883  if ($this->getLastPasswordChangeTS() > 0) {
1884  $max_pass_age = $security->getPasswordMaxAge();
1885  if ($max_pass_age > 0) {
1886  $max_pass_age_ts = ($max_pass_age * 86400);
1887  $pass_change_ts = $this->getLastPasswordChangeTS();
1888  $current_ts = time();
1889 
1890  if (($current_ts - $pass_change_ts) > $max_pass_age_ts) {
1892  return true;
1893  }
1894  }
1895  }
1896  }
1897 
1898  return false;
1899  }
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 4064 of file class.ilObjUser.php.

References $is_self_registered.

4064  : bool
4065  {
4067  }
bool $is_self_registered

◆ lookupMatriculation()

static ilObjUser::lookupMatriculation ( int  $a_usr_id)
static

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

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

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

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

◆ lookupOrgUnitsRepresentation()

static ilObjUser::lookupOrgUnitsRepresentation ( int  $a_usr_id)
static

lookup org unit representation

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

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

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

◆ read()

ilObjUser::read ( )
Exceptions
ilObjectNotFoundException
ilObjectTypeMismatchException
ilSystemStyleException

Definition at line 157 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().

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

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

Referenced by read().

4159  : void
4160  {
4161  global $DIC;
4162 
4163  $ilDB = $DIC['ilDB'];
4164 
4165  if (!$this->getId()) {
4166  return;
4167  }
4168 
4169  $set = $ilDB->query('SELECT field_id,value' .
4170  ' FROM usr_data_multi' .
4171  ' WHERE usr_id = ' . $ilDB->quote($this->getId(), 'integer') .
4172  ' ORDER BY value');
4173  while ($row = $ilDB->fetchAssoc($set)) {
4174  $values[$row['field_id']][] = $row['value'];
4175  }
4176 
4177  if (isset($values['interests_general'])) {
4178  $this->setGeneralInterests($values['interests_general']);
4179  } else {
4180  $this->setGeneralInterests();
4181  }
4182  if (isset($values['interests_help_offered'])) {
4183  $this->setOfferingHelp($values['interests_help_offered']);
4184  } else {
4185  $this->setOfferingHelp();
4186  }
4187  if (isset($values['interests_help_looking'])) {
4188  $this->setLookingForHelp($values['interests_help_looking']);
4189  } else {
4190  $this->setLookingForHelp();
4191  }
4192  }
setOfferingHelp(?array $value=null)
global $DIC
Definition: shib_login.php:22
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 1091 of file class.ilObjUser.php.

References $prefs.

Referenced by read().

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

◆ readUserDefinedFields()

ilObjUser::readUserDefinedFields ( )

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

References ilObject\getId().

Referenced by read().

3023  : void
3024  {
3025  $udata = new ilUserDefinedData($this->getId());
3026  $this->user_defined_data = $udata->getAll();
3027  }
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 741 of file class.ilObjUser.php.

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

741  : void
742  {
743  $ilDB = $this->db;
744 
745  $ilDB->manipulateF(
746  'UPDATE usr_data SET ' .
747  'last_login = ' . $ilDB->now() .
748  ' WHERE usr_id = %s',
749  ['integer'],
750  [$this->id]
751  );
752 
753  if ($this->getFirstLogin() == '') {
754  $ilDB->manipulateF(
755  'UPDATE usr_data SET ' .
756  'first_login = ' . $ilDB->now() .
757  ' WHERE usr_id = %s',
758  ['integer'],
759  [$this->id]
760  );
761  $this->app_event_handler->raise(
762  'components/ILIAS/User',
763  'firstLogin',
764  ['user_obj' => $this]
765  );
766  }
767  }
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 4049 of file class.ilObjUser.php.

References writePref().

4049  : void
4050  {
4051  $this->writePref('delete_flag', false);
4052  }
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 2604 of file class.ilObjUser.php.

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

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

◆ removeUserPicture()

ilObjUser::removeUserPicture ( bool  $a_do_update = true)

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

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

Referenced by delete().

2985  : void {
2986  if ($this->getAvatarRid() !== null && $this->getAvatarRid() !== self::NO_AVATAR_RID) {
2987  $rid = $this->irss->manage()->find($this->getAvatarRid());
2988  $this->irss->manage()->remove($rid, new ilUserProfilePictureStakeholder());
2989  }
2990 
2991  if ($a_do_update) {
2992  // remove user pref file name
2994  $this->setPref('profile_image', '');
2995  $this->update();
2996  }
2997  }
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 1931 of file class.ilObjUser.php.

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

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

◆ resetOwner()

ilObjUser::resetOwner ( )

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

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

Referenced by delete().

3905  : void
3906  {
3907  $ilDB = $this->db;
3908 
3909  $query = 'UPDATE object_data SET owner = 0 ' .
3910  'WHERE owner = ' . $ilDB->quote($this->getId(), 'integer');
3911  $ilDB->query($query);
3912  }
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 778 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().

781  : bool {
782  $ilDB = $this->db;
783 
784  if (func_num_args() != 2) {
785  return false;
786  }
787 
788  if (!isset($raw) || !isset($raw_retype)) {
789  return false;
790  }
791 
792  if ($raw != $raw_retype) {
793  return false;
794  }
795 
796  LocalUserPasswordManager::getInstance()->encodePassword($this, $raw);
797 
798  $ilDB->manipulateF(
799  'UPDATE usr_data
800  SET passwd = %s, passwd_enc_type = %s, passwd_salt = %s
801  WHERE usr_id = %s',
802  ['text', 'text', 'text', 'integer'],
803  [$this->getPasswd(), $this->getPasswordEncodingType(), $this->getPasswordSalt(), $this->getId()]
804  );
805 
806  return true;
807  }
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 338 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().

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

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

3985  : void
3986  {
3987  $file = ilExport::_getExportDirectory($this->getId(), 'xml', 'usr', 'personal_data') .
3988  '/' . $this->getPersonalDataExportFile();
3989  if (is_file($file)) {
3991  }
3992  }
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 1690 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().

1693  : void {
1694  $this->setOwner($a_owner);
1695 
1696  if ($a_active) {
1697  $this->active = 1;
1698  $this->setApproveDate(date('Y-m-d H:i:s'));
1699  $this->setOwner($a_owner);
1700  } else {
1701  $this->active = 0;
1702  $this->setApproveDate(null);
1703  }
1704  }
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 1681 of file class.ilObjUser.php.

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

◆ 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 1667 of file class.ilObjUser.php.

Referenced by setActive().

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

◆ setAuthMode()

ilObjUser::setAuthMode ( ?string  $a_str)

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

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

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

◆ setAvatarRid()

ilObjUser::setAvatarRid ( ?string  $avatar_rid)

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

References $avatar_rid.

Referenced by _uploadPersonalPicture(), and removeUserPicture().

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

◆ setBirthday()

ilObjUser::setBirthday ( ?string  $a_birthday)

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

References IL_CAL_DATE, and null.

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

3796  : void
3797  {
3798  if ($a_birthday && strlen($a_birthday)) {
3799  $date = new ilDate($a_birthday, IL_CAL_DATE);
3800  $this->birthday = $date->get(IL_CAL_DATE);
3801  } else {
3802  $this->birthday = null;
3803  }
3804  }
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 1366 of file class.ilObjUser.php.

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

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

◆ setClientIP()

ilObjUser::setClientIP ( string  $a_str)

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

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

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

◆ setComment()

ilObjUser::setComment ( string  $a_str)

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

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

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

◆ setCountry()

ilObjUser::setCountry ( string  $a_str)

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

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

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

◆ setCurrentLanguage()

ilObjUser::setCurrentLanguage ( string  $a_val)

Set current language.

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

References ilSession\set().

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

1608  : void
1609  {
1610  ilSession::set('lang', $a_val);
1611  }
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 1346 of file class.ilObjUser.php.

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

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

◆ setEmail()

ilObjUser::setEmail ( string  $a_str)

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

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

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

◆ setExternalAccount()

ilObjUser::setExternalAccount ( string  $a_str)

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

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

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

◆ setFax()

ilObjUser::setFax ( string  $a_str)

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

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

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

◆ setFirstLogin()

ilObjUser::setFirstLogin ( string  $a_str)

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

Referenced by assignData().

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

◆ setFirstname()

ilObjUser::setFirstname ( string  $a_str)

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

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

1316  : void
1317  {
1318  $this->firstname = $a_str;
1319  }
+ 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 1211 of file class.ilObjUser.php.

References $lastname.

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

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

◆ setGender()

ilObjUser::setGender ( string  $a_str)

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

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

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

◆ setGeneralInterests()

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

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

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

4077  : void
4078  {
4079  $this->interests_general = $value ?? [];
4080  }
+ Here is the caller graph for this function:

◆ setHobby()

ilObjUser::setHobby ( string  $a_str)

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

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

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

◆ setInactivationDate()

ilObjUser::setInactivationDate ( ?string  $inactivation_date)

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

References $inactivation_date.

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

4024  : void
4025  {
4026  $this->inactivation_date = $inactivation_date;
4027  }
string $inactivation_date
+ Here is the caller graph for this function:

◆ setInstitution()

ilObjUser::setInstitution ( string  $a_str)

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

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

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

◆ setIsSelfRegistered()

ilObjUser::setIsSelfRegistered ( bool  $status)

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

Referenced by assignData().

4059  : void
4060  {
4061  $this->is_self_registered = $status;
4062  }
+ Here is the caller graph for this function:

◆ setLanguage()

ilObjUser::setLanguage ( string  $a_str)

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

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

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

1515  : void
1516  {
1517  $this->setPref('language', $a_str);
1518  ilSession::clear('lang');
1519  }
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 1613 of file class.ilObjUser.php.

Referenced by assignData().

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

◆ setLastname()

ilObjUser::setLastname ( string  $a_str)

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

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

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

◆ setLastPasswordChangeToNow()

ilObjUser::setLastPasswordChangeToNow ( )

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

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

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

1909  : bool
1910  {
1911  global $DIC;
1912 
1913  $ilDB = $DIC['ilDB'];
1914 
1915  $this->setLastPasswordChangeTS(time());
1916 
1917  $query = 'UPDATE usr_data SET last_password_change = %s ' .
1918  'WHERE usr_id = %s';
1919  $affected = $ilDB->manipulateF(
1920  $query,
1921  ['integer','integer'],
1922  [$this->getLastPasswordChangeTS(),$this->id]
1923  );
1924  if ($affected) {
1925  return true;
1926  } else {
1927  return false;
1928  }
1929  }
global $DIC
Definition: shib_login.php:22
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 1526 of file class.ilObjUser.php.

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

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

◆ setLastProfilePrompt()

ilObjUser::setLastProfilePrompt ( string  $a_str)

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

Referenced by assignData().

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

◆ setLastUpdate()

ilObjUser::setLastUpdate ( string  $a_str)

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

Referenced by assignData().

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

◆ setLatitude()

ilObjUser::setLatitude ( ?string  $a_latitude)

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

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

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

◆ setLocationZoom()

ilObjUser::setLocationZoom ( ?int  $a_locationzoom)

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

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

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

◆ setLogin()

ilObjUser::setLogin ( string  $a_str)

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

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

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

1257  : void
1258  {
1259  $this->login = $a_str;
1260  }
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 1813 of file class.ilObjUser.php.

Referenced by read().

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

◆ setLongitude()

ilObjUser::setLongitude ( ?string  $a_longitude)

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

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

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

◆ setLookingForHelp()

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

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

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

4125  : void
4126  {
4127  $this->interests_help_looking = $value ?? [];
4128  }
+ Here is the caller graph for this function:

◆ setMatriculation()

ilObjUser::setMatriculation ( string  $a_str)

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

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

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

◆ setOfferingHelp()

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

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

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

4101  : void
4102  {
4103  $this->interests_help_offered = $value ?? [];
4104  }
+ Here is the caller graph for this function:

◆ setPasswd()

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

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

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

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

◆ setPasswordEncodingType()

ilObjUser::setPasswordEncodingType ( ?string  $password_encryption_type)

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

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

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

◆ setPasswordPolicyResetStatus()

ilObjUser::setPasswordPolicyResetStatus ( bool  $status)

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

Referenced by read().

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

◆ setPasswordSalt()

ilObjUser::setPasswordSalt ( ?string  $password_salt)

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

References $password_salt.

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

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

◆ setPhoneHome()

ilObjUser::setPhoneHome ( string  $a_str)

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

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

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

◆ setPhoneMobile()

ilObjUser::setPhoneMobile ( string  $a_str)

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

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

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

◆ setPhoneOffice()

ilObjUser::setPhoneOffice ( string  $a_str)

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

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

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

◆ setPref()

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

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

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

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

◆ setProfileIncomplete()

ilObjUser::setProfileIncomplete ( bool  $a_prof_inc)

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

Referenced by assignData().

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

◆ setSecondEmail()

ilObjUser::setSecondEmail ( ?string  $second_email)

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

References $second_email.

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

1500  : void
1501  {
1502  $this->second_email = $second_email;
1503  }
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 1399 of file class.ilObjUser.php.

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

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

◆ setSkin()

ilObjUser::setSkin ( string  $a_str)

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

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

◆ setStreet()

ilObjUser::setStreet ( string  $a_str)

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

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

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

◆ setTimeLimitFrom()

ilObjUser::setTimeLimitFrom ( ?int  $a_from)

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

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

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

◆ setTimeLimitMessage()

ilObjUser::setTimeLimitMessage ( string  $a_time_limit_message)

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

Referenced by assignData().

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

◆ setTimeLimitOwner()

ilObjUser::setTimeLimitOwner ( int  $a_owner)

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

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

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

◆ setTimeLimitUnlimited()

ilObjUser::setTimeLimitUnlimited ( bool  $a_unlimited)

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

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

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

◆ setTimeLimitUntil()

ilObjUser::setTimeLimitUntil ( ?int  $a_until)

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

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

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

◆ setUserDefinedData()

ilObjUser::setUserDefinedData ( array  $a_data)

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

References $data.

Referenced by ilObjUserGUI\loadUserDefinedDataFromForm().

3000  : void // Missing array type.
3001  {
3002  foreach ($a_data as $field => $data) {
3003  $this->user_defined_data['f_' . $field] = $data;
3004  }
3005  }
+ 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 1306 of file class.ilObjUser.php.

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

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

◆ setZipcode()

ilObjUser::setZipcode ( string  $a_str)

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

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

1376  : void
1377  {
1378  $this->zipcode = $a_str;
1379  }
+ 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 1732 of file class.ilObjUser.php.

References getStoredActive(), and setActive().

Referenced by update().

1732  : void
1733  {
1734  $storedActive = 0;
1735  if ($this->getStoredActive($this->id)) {
1736  $storedActive = 1;
1737  }
1738 
1739  $currentActive = 0;
1740  if ($this->active) {
1741  $currentActive = 1;
1742  }
1743 
1744  if ((!empty($storedActive) && empty($currentActive)) ||
1745  (empty($storedActive) && !empty($currentActive))) {
1746  $this->setActive($currentActive, self::getUserIdByLogin(self::getLoginFromAuth()));
1747  }
1748  }
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 2041 of file class.ilObjUser.php.

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

◆ update()

ilObjUser::update ( )

Definition at line 444 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().

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

866  : bool
867  {
868  global $DIC;
869 
870  $ilDB = $this->db;
871  $ilSetting = $DIC['ilSetting'];
872  $lng = $DIC->language();
873 
874  if (func_num_args() != 1) {
875  return false;
876  }
877 
878  if (!isset($a_login)) {
879  return false;
880  }
881 
882  $former_login = self::_lookupLogin($this->getId());
883 
884  // Update not necessary
885  if (0 == strcmp($a_login, $former_login)) {
886  return false;
887  }
888 
889  try {
890  $last_history_entry = self::_getLastHistoryDataByUserId($this->getId());
891  } catch (ilUserException $e) {
892  $last_history_entry = null;
893  }
894 
895  // throw exception if the desired loginame is already in history and it is not allowed to reuse it
896  if ((int) $ilSetting->get('allow_change_loginname') &&
897  (int) $ilSetting->get('reuse_of_loginnames') == 0 &&
898  self::_doesLoginnameExistInHistory($a_login)) {
899  throw new ilUserException($lng->txt('loginname_already_exists'));
900  } elseif ((int) $ilSetting->get('allow_change_loginname') &&
901  (int) $ilSetting->get('loginname_change_blocking_time') &&
902  is_array($last_history_entry) &&
903  $last_history_entry[1] + (int) $ilSetting->get('loginname_change_blocking_time') > time()) {
904  throw new ilUserException(
905  sprintf(
906  $lng->txt('changing_loginname_not_possible_info'),
908  new ilDateTime($last_history_entry[1], IL_CAL_UNIX)
909  ),
911  new ilDateTime(($last_history_entry[1] + (int) $ilSetting->get('loginname_change_blocking_time')), IL_CAL_UNIX)
912  )
913  )
914  );
915  } else {
916  // log old loginname in history
917  if ((int) $ilSetting->get('allow_change_loginname') &&
918  (int) $ilSetting->get('create_history_loginname')) {
919  self::_writeHistory($this->getId(), $former_login);
920  }
921 
922  //update login
923  $this->login = $a_login;
924 
925  $ilDB->manipulateF(
926  '
927  UPDATE usr_data
928  SET login = %s
929  WHERE usr_id = %s',
930  ['text', 'integer'],
931  [$this->getLogin(), $this->getId()]
932  );
933  }
934 
935  return true;
936  }
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:22
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 4194 of file class.ilObjUser.php.

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

Referenced by saveAsNew(), and update().

4194  : void
4195  {
4196  global $DIC;
4197 
4198  $ilDB = $DIC['ilDB'];
4199 
4200  if (!$this->getId()) {
4201  return;
4202  }
4203 
4204  if (!$a_create) {
4205  $this->deleteMultiTextFields();
4206  }
4207 
4208  $map = [
4209  'interests_general' => $this->getGeneralInterests(),
4210  'interests_help_offered' => $this->getOfferingHelp(),
4211  'interests_help_looking' => $this->getLookingForHelp()
4212  ];
4213 
4214  foreach ($map as $id => $values) {
4215  if (is_array($values) && count($values)) {
4216  foreach ($values as $value) {
4217  $value = trim($value);
4218  if ($value) {
4219  $uniq_id = $ilDB->nextId('usr_data_multi');
4220 
4221  $ilDB->manipulate('INSERT usr_data_multi' .
4222  ' (id,usr_id,field_id,value) VALUES' .
4223  ' (' . $ilDB->quote($uniq_id, 'integer') .
4224  ',' . $ilDB->quote($this->getId(), 'integer') .
4225  ',' . $ilDB->quote($id, 'text') .
4226  ',' . $ilDB->quote($value, 'text') .
4227  ')');
4228  }
4229  }
4230  }
4231  }
4232  }
global $DIC
Definition: shib_login.php:22
$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 3012 of file class.ilObjUser.php.

References ilObject\getId(), and null.

Referenced by saveAsNew(), and update().

3012  : void
3013  {
3014  $udata = new ilUserDefinedData($this->getId());
3015  foreach ($this->user_defined_data as $field => $value) {
3016  if ($field !== 'usr_id' && $value !== null) {
3017  $udata->set($field, $value);
3018  }
3019  }
3020  $udata->update();
3021  }
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 3939 of file class.ilObjUser.php.

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

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

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

◆ writeAccepted()

ilObjUser::writeAccepted ( )

write accept date of user agreement

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

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

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

◆ writePref()

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

Definition at line 938 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().

941  : void {
942  self::_writePref($this->id, $a_keyword, $a_value);
943  $this->setPref($a_keyword, $a_value);
944  }
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 1000 of file class.ilObjUser.php.

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

1000  : void
1001  {
1002  self::_deleteAllPref($this->id);
1003  foreach ($this->prefs as $keyword => $value) {
1004  self::_writePref($this->id, $keyword, (string) $value);
1005  }
1006  }
+ 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 89 of file class.ilObjUser.php.

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

◆ $approve_date

string ilObjUser::$approve_date = null

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

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

◆ $auth_mode

string ilObjUser::$auth_mode = null

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

Referenced by getAuthMode().

◆ $avatar_rid

string ilObjUser::$avatar_rid = null
protected

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

Referenced by getAvatarRid(), and setAvatarRid().

◆ $birthday

string ilObjUser::$birthday = null
protected

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

Referenced by getBirthday().

◆ $city

string ilObjUser::$city = ''

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

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

◆ $client_ip

string ilObjUser::$client_ip = ''

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

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

◆ $country

string ilObjUser::$country = ''

Definition at line 77 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 121 of file class.ilObjUser.php.

◆ $date_format_factory

DateFormatFactory ilObjUser::$date_format_factory
protected

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

◆ $department

string ilObjUser::$department = ''

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

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

◆ $email

string ilObjUser::$email = ''

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

Referenced by getEmail().

◆ $ext_account

string ilObjUser::$ext_account = ''
protected

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

Referenced by getExternalAccount().

◆ $fax

string ilObjUser::$fax = ''

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

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

◆ $first_login

string ilObjUser::$first_login = ''
protected

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

Referenced by getFirstLogin().

◆ $firstname

string ilObjUser::$firstname = ''

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

Referenced by getFirstname(), and saveAsNew().

◆ $fullname

string ilObjUser::$fullname = ''

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

Referenced by _lookupFullname().

◆ $gender

string ilObjUser::$gender = ''

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

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

◆ $hobby

string ilObjUser::$hobby = ''

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

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

◆ $inactivation_date

string ilObjUser::$inactivation_date = null
protected

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

Referenced by getInactivationDate(), saveAsNew(), setInactivationDate(), and update().

◆ $institution

string ilObjUser::$institution = ''

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

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

◆ $interests_general

array ilObjUser::$interests_general = []
protected

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

Referenced by getGeneralInterests().

◆ $interests_help_looking

array ilObjUser::$interests_help_looking = []
protected

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

Referenced by getLookingForHelp().

◆ $interests_help_offered

array ilObjUser::$interests_help_offered = []
protected

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

Referenced by getOfferingHelp().

◆ $irss

Services ilObjUser::$irss
private

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

◆ $is_self_registered

bool ilObjUser::$is_self_registered = false
private

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

Referenced by isSelfRegistered().

◆ $last_login

string ilObjUser::$last_login = ''
protected

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

Referenced by getLastLogin().

◆ $last_password_change_ts

int ilObjUser::$last_password_change_ts = 0

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

Referenced by getLastPasswordChangeTS().

◆ $last_profile_prompt

string ilObjUser::$last_profile_prompt = ''
protected

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

Referenced by getLastProfilePrompt().

◆ $lastname

string ilObjUser::$lastname = ''

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

Referenced by getLastname(), saveAsNew(), and setFullname().

◆ $latitude

string ilObjUser::$latitude = null

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

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

◆ $loc_zoom

string ilObjUser::$loc_zoom = null

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

Referenced by getLocationZoom().

◆ $login

string ilObjUser::$login = ''

◆ $login_attempts

int ilObjUser::$login_attempts = 0

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

Referenced by getLoginAttempts().

◆ $longitude

string ilObjUser::$longitude = null

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

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

◆ $matriculation

string ilObjUser::$matriculation = ''

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

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

◆ $oldPrefs

array ilObjUser::$oldPrefs = []
protected

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

◆ $org_units

string ilObjUser::$org_units = ''
protected

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

◆ $passwd

string ilObjUser::$passwd = ''
protected

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

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

◆ $passwd_policy_reset

bool ilObjUser::$passwd_policy_reset = false
protected

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

Referenced by getPasswordPolicyResetStatus(), and saveAsNew().

◆ $passwd_type

string ilObjUser::$passwd_type = ''
protected

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

Referenced by getPasswdType().

◆ $password_encoding_type

string ilObjUser::$password_encoding_type = null
protected

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

Referenced by getPasswordEncodingType().

◆ $password_salt

string ilObjUser::$password_salt = null
protected

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

Referenced by getPasswordSalt(), and setPasswordSalt().

◆ $personal_image_cache

array ilObjUser::$personal_image_cache = []
staticprotected

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

◆ $phone_home

string ilObjUser::$phone_home = ''

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

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

◆ $phone_mobile

string ilObjUser::$phone_mobile = ''

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

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

◆ $phone_office

string ilObjUser::$phone_office = ''

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

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

◆ $prefs

array ilObjUser::$prefs = []

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

Referenced by _getPreferences(), and readPrefs().

◆ $profile_incomplete

bool ilObjUser::$profile_incomplete = false
protected

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

Referenced by getProfileIncomplete().

◆ $referral_comment

string ilObjUser::$referral_comment = ''

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

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

◆ $second_email

string ilObjUser::$second_email = null
protected

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

Referenced by getSecondEmail(), and setSecondEmail().

◆ $sel_country

string ilObjUser::$sel_country = ''

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

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

◆ $skin

string ilObjUser::$skin = ''

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

Referenced by __construct().

◆ $street

string ilObjUser::$street = ''

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

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

◆ $time_limit_from

int ilObjUser::$time_limit_from = null
protected

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

Referenced by getTimeLimitFrom().

◆ $time_limit_message

string ilObjUser::$time_limit_message = ''
protected

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

Referenced by getTimeLimitMessage().

◆ $time_limit_owner

int ilObjUser::$time_limit_owner = null
protected

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

◆ $time_limit_unlimited

bool ilObjUser::$time_limit_unlimited = false
protected

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

Referenced by getTimeLimitUnlimited().

◆ $time_limit_until

int ilObjUser::$time_limit_until = null
protected

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

Referenced by getTimeLimitUntil().

◆ $user_defined_data

array ilObjUser::$user_defined_data = []

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

◆ $utitle

string ilObjUser::$utitle = ''

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

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

◆ $zipcode

string ilObjUser::$zipcode = ''

Definition at line 76 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: