ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ()
 
 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 _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
 
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 122 of file class.ilObjUser.php.

References $DIC, $skin, ILIAS\MetaData\Repository\Validation\Data\__construct(), read(), and ilObject\setId().

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

References ilObject\$db, $GLOBALS, $r, $res, ILIAS\LTI\ToolProvider\$settings, ilAuthUtils\_getAuthModeName(), ilDBInterface\fetchAssoc(), and ilDBInterface\queryF().

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

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

◆ _deleteAllPref()

static ilObjUser::_deleteAllPref ( int  $a_user_id)
static

Deletes a userpref value of the user from the database.

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

References $DIC, and $ilDB.

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

◆ _deletePref()

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

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

References $DIC, and $ilDB.

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

◆ _doesLoginnameExistInHistory()

static ilObjUser::_doesLoginnameExistInHistory ( string  $a_login)
static

Checks whether the passed loginname already exists in history.

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

References $DIC, $ilDB, and $res.

Referenced by ilAccountRegistrationGUI\saveForm().

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

References $DIC, $ilDB, and $res.

3264  : bool {
3265  global $DIC;
3266 
3267  $ilDB = $DIC['ilDB'];
3268 
3269  $res = $ilDB->queryF(
3270  "SELECT * FROM usr_data " .
3271  "WHERE ext_account = %s AND auth_mode = %s",
3272  ["text", "text"],
3273  [$a_external_account, $a_auth_mode]
3274  );
3275  return (bool) $ilDB->fetchAssoc($res);
3276  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28

◆ _generateRegistrationHash()

static ilObjUser::_generateRegistrationHash ( int  $a_usr_id)
static

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

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

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

3698  : string
3699  {
3700  global $DIC;
3701 
3702  $ilDB = $DIC['ilDB'];
3703 
3704  do {
3705  $continue = false;
3706 
3707  $hashcode = substr(md5(uniqid(mt_rand(), true)), 0, 16);
3708 
3709  $res = $ilDB->queryf(
3710  '
3711  SELECT COUNT(usr_id) cnt FROM usr_data
3712  WHERE reg_hash = %s',
3713  ['text'],
3714  [$hashcode]
3715  );
3716  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
3717  if ($row->cnt > 0) {
3718  $continue = true;
3719  }
3720  break;
3721  }
3722 
3723  if ($continue) {
3724  continue;
3725  }
3726 
3727  $ilDB->manipulateF(
3728  '
3729  UPDATE usr_data
3730  SET reg_hash = %s
3731  WHERE usr_id = %s',
3732  ['text', 'integer'],
3733  [$hashcode, $a_usr_id]
3734  );
3735 
3736  break;
3737  } while (true);
3738 
3739  return $hashcode;
3740  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28

◆ _getAllUserAssignedStyles()

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

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

References $DIC, $ilDB, and $q.

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

2299  : array
2300  {
2301  global $DIC;
2302 
2303  $ilDB = $DIC['ilDB'];
2304 
2305  $q = "SELECT DISTINCT up1.value style, up2.value skin FROM usr_pref up1, usr_pref up2 " .
2306  " WHERE up1.keyword = " . $ilDB->quote("style", "text") .
2307  " AND up2.keyword = " . $ilDB->quote("skin", "text") .
2308  " AND up1.usr_id = up2.usr_id";
2309 
2310  $sty_set = $ilDB->query($q);
2311 
2312  $styles = [];
2313  while ($sty_rec = $ilDB->fetchAssoc($sty_set)) {
2314  $styles[] = $sty_rec["skin"] . ":" . $sty_rec["style"];
2315  }
2316 
2317  return $styles;
2318  }
global $DIC
Definition: feed.php:28
$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 2175 of file class.ilObjUser.php.

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

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

References ANONYMOUS_USER_ID.

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

2910  : Avatar
2911  {
2912  $define = new ilUserAvatarResolver($a_usr_id ?: ANONYMOUS_USER_ID);
2913  $define->setSize('xsmall');
2914  return $define->getAvatar();
2915  }
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 2669 of file class.ilObjUser.php.

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

Referenced by ilLDAPCronSynchronization\deactivateUsers(), ilLDAPServerTableGUI\fillRow(), and ilLDAPRoleGroupMapping\initServers().

2672  : array {
2673  global $DIC;
2674 
2675  $ilDB = $DIC['ilDB'];
2676  $ilSetting = $DIC['ilSetting'];
2677 
2678  $q = "SELECT login,usr_id,ext_account,auth_mode FROM usr_data " .
2679  "WHERE auth_mode = %s";
2680  $types[] = "text";
2681  $values[] = $a_auth_mode;
2682  if ($a_read_auth_default and ilAuthUtils::_getAuthModeName($ilSetting->get('auth_mode', ilAuthUtils::AUTH_LOCAL)) == $a_auth_mode) {
2683  $q .= " OR auth_mode = %s ";
2684  $types[] = "text";
2685  $values[] = 'default';
2686  }
2687 
2688  $res = $ilDB->queryF($q, $types, $values);
2689  $accounts = [];
2690  while ($row = $ilDB->fetchObject($res)) {
2691  if ($row->auth_mode == 'default') {
2692  $accounts[$row->usr_id] = $row->login;
2693  } else {
2694  $accounts[$row->usr_id] = $row->ext_account;
2695  }
2696  }
2697  return $accounts;
2698  }
$res
Definition: ltiservices.php:69
static _getAuthModeName($a_auth_key)
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:18
$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 3203 of file class.ilObjUser.php.

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

3205  : ?string {
3206  if ($a_user_id > 0) {
3207  return self::_lookupPref($a_user_id, "priv_feed_pass");
3208  }
3209  return null;
3210  }
+ Here is the caller graph for this function:

◆ _getImportedUserId()

static ilObjUser::_getImportedUserId ( string  $i2_id)
static

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

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

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

2610  : int {
2611  global $DIC;
2612 
2613  $ilDB = $DIC['ilDB'];
2614 
2615  $query = "SELECT obj_id FROM object_data WHERE import_id = " .
2616  $ilDB->quote($i2_id, "text");
2617 
2618  $res = $ilDB->query($query);
2619  $id = 0;
2620  while ($row = $ilDB->fetchObject($res)) {
2621  $id = (int) $row->obj_id;
2622  }
2623  return $id;
2624  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getLastHistoryDataByUserId()

static ilObjUser::_getLastHistoryDataByUserId ( int  $a_usr_id)
static

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

Throws an ilUserException in case no entry could be found.

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

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

References $DIC, $ilDB, and $res.

Referenced by ilObjUserGUI\initForm().

837  : array
838  {
839  global $DIC;
840 
841  $ilDB = $DIC['ilDB'];
842 
843  $ilDB->setLimit(1, 0);
844  $res = $ilDB->queryF(
845  '
846  SELECT login, history_date FROM loginname_history
847  WHERE usr_id = %s ORDER BY history_date DESC',
848  ['integer'],
849  [$a_usr_id]
850  );
851  $row = $ilDB->fetchAssoc($res);
852  if (!is_array($row) || !count($row)) {
853  throw new ilUserException('');
854  }
855 
856  return [
857  $row['login'], $row['history_date']
858  ];
859  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _getLocalAccountsForEmail()

static ilObjUser::_getLocalAccountsForEmail ( string  $a_email)
static

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

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

2815  : array // Missing array type.
2816  {
2817  global $DIC;
2818 
2819  $ilDB = $DIC['ilDB'];
2820  $ilSetting = $DIC['ilSetting'];
2821 
2822  // default set to local (1)?
2823 
2824  $q = "SELECT * FROM usr_data WHERE " .
2825  " email = %s AND (auth_mode = %s ";
2826  $types = ["text", "text"];
2827  $values = [$a_email, "local"];
2828 
2829  if ($ilSetting->get("auth_mode") == 1) {
2830  $q .= " OR auth_mode = %s";
2831  $types[] = "text";
2832  $values[] = "default";
2833  }
2834 
2835  $q .= ")";
2836 
2837  $users = [];
2838  $usr_set = $ilDB->queryF($q, $types, $values);
2839  while ($usr_rec = $ilDB->fetchAssoc($usr_set)) {
2840  $users[$usr_rec["usr_id"]] = $usr_rec["login"];
2841  }
2842 
2843  return $users;
2844  }
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:18
$q
Definition: shib_logout.php:21

◆ _getLoginAttempts()

static ilObjUser::_getLoginAttempts ( int  $a_usr_id)
static

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

References $DIC, and $ilDB.

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

3526  : int {
3527  global $DIC;
3528 
3529  $ilDB = $DIC['ilDB'];
3530 
3531  $query = "SELECT login_attempts FROM usr_data WHERE usr_id = %s";
3532  $result = $ilDB->queryF($query, ['integer'], [$a_usr_id]);
3533  $record = $ilDB->fetchAssoc($result);
3534  return (int) ($record['login_attempts'] ?? 0);
3535  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _getNumberOfUsersForStyle()

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

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

References $DIC, $ilDB, and $q.

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

2277  : int {
2278  global $DIC;
2279 
2280  $ilDB = $DIC['ilDB'];
2281 
2282  $q = "SELECT count(*) as cnt FROM usr_pref up1, usr_pref up2 " .
2283  " WHERE up1.keyword= " . $ilDB->quote("style", "text") .
2284  " AND up1.value= " . $ilDB->quote($a_style, "text") .
2285  " AND up2.keyword= " . $ilDB->quote("skin", "text") .
2286  " AND up2.value= " . $ilDB->quote($a_skin, "text") .
2287  " AND up1.usr_id = up2.usr_id ";
2288 
2289  $cnt_set = $ilDB->query($q);
2290 
2291  $cnt_rec = $ilDB->fetchAssoc($cnt_set);
2292 
2293  return (int) $cnt_rec["cnt"];
2294  }
global $DIC
Definition: feed.php:28
$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 2799 of file class.ilObjUser.php.

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

Referenced by ilObjAuthSettingsGUI\authSettingsObject().

2799  : array // Missing array type.
2800  {
2801  global $DIC;
2802 
2803  $ilDB = $DIC['ilDB'];
2804 
2805  $r = $ilDB->query("SELECT count(*) AS cnt, auth_mode FROM usr_data " .
2806  "GROUP BY auth_mode");
2807  $cnt_arr = [];
2808  while ($cnt = $ilDB->fetchAssoc($r)) {
2809  $cnt_arr[$cnt["auth_mode"]] = (int) $cnt["cnt"];
2810  }
2811 
2812  return $cnt_arr;
2813  }
global $DIC
Definition: feed.php:28
$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
Parameters
string$a_size"small", "xsmall" or "xxsmall"
Exceptions
ilWACException

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

Referenced by ilRepositoryUserResultTableGUI\fillRow(), ilPublicUserProfileGUI\getEmbeddable(), ilUserProfile\getImageInput(), ILIAS\Awareness\WidgetManager\getListData(), ilUserUtil\getNamePresentation(), ilInternalLinkGUI\getUserSearchResult(), ilUserDataSet\getXmlRecord(), ilObjUserGUI\initForm(), ilObjPortfolioBaseGUI\renderFullscreenHeader(), ilObjBlogGUI\renderFullscreenHeader(), ilLikeGUI\renderModal(), ilPublicUserProfileGUI\renderTitle(), ilMStShowUserGUI\setTitleAndIcon(), and ilPersonalProfileGUI\showPublicProfileFields().

2927  : string {
2928  $define = new ilUserAvatarResolver($a_usr_id);
2929  $define->setForcePicture($a_force_pic);
2930  $define->setSize($a_size);
2931  return $define->getLegacyPictureURL();
2932  }
Class ilUserAvatarResolver.
+ Here is the caller graph for this function:

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

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

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

3477  : array
3478  {
3479  global $DIC;
3480 
3481  $ilDB = $DIC['ilDB'];
3482 
3483  $prefs = [];
3484 
3485  $r = $ilDB->queryF(
3486  "SELECT * FROM usr_pref WHERE usr_id = %s",
3487  ["integer"],
3488  [$user_id]
3489  );
3490 
3491  while ($row = $ilDB->fetchAssoc($r)) {
3492  $prefs[$row["keyword"]] = $row["value"];
3493  }
3494 
3495  return $prefs;
3496  }
global $DIC
Definition: feed.php:28
$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 3430 of file class.ilObjUser.php.

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

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

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

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

Referenced by ilCronDeleteInactivatedUserAccounts\run().

3869  : array {
3871  $field = 'inactivation_date';
3873 
3874  if (!$period) {
3875  throw new ilException('no valid period given');
3876  }
3877 
3878  global $DIC;
3879 
3880  $ilDB = $DIC['ilDB'];
3881 
3882  $date = date('Y-m-d H:i:s', (time() - ($period * 24 * 60 * 60)));
3883 
3884  $query = "SELECT usr_id FROM usr_data WHERE $field < %s AND active = %s";
3885 
3886  $res = $ilDB->queryF($query, ['timestamp', 'integer'], [$date, 0]);
3887 
3888  $ids = [];
3889  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
3890  $ids[] = (int) $row->usr_id;
3891  }
3892 
3893  return $ids;
3894  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ 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 2575 of file class.ilObjUser.php.

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

Referenced by ilObjMediaObject\lookupUsages().

2578  : array {
2579  global $DIC;
2580 
2581  $ilDB = $DIC['ilDB'];
2582 
2583  $q = "SELECT DISTINCT user_id FROM personal_clipboard WHERE " .
2584  "item_id = " . $ilDB->quote($a_id, "integer") . " AND " .
2585  "type = " . $ilDB->quote($a_type, "text");
2586  $user_set = $ilDB->query($q);
2587  $users = [];
2588  while ($user_rec = $ilDB->fetchAssoc($user_set)) {
2589  $users[] = (int) $user_rec["user_id"];
2590  }
2591 
2592  return $users;
2593  }
global $DIC
Definition: feed.php:28
$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 3325 of file class.ilObjUser.php.

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

Referenced by ilSoapUserAdministration\getUsersForContainer().

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

Referenced by ilSoapUserAdministration\getUsersForContainer().

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

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

Referenced by ilSoapUserAdministration\getUsersForContainer().

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

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

Referenced by ilSoapUserAdministration\getUserForRole().

3285  : array {
3286  global $DIC;
3287 
3288  $ilDB = $DIC['ilDB'];
3289  $rbacreview = $DIC['rbacreview'];
3290  $ids = $rbacreview->assignedUsers($role_id);
3291 
3292  if (count($ids) == 0) {
3293  $ids = [-1];
3294  }
3295 
3296  $query = "SELECT usr_data.*, usr_pref.value AS language
3297  FROM usr_data
3298  LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
3299  WHERE " . $ilDB->in("usr_data.usr_id", $ids, false, "integer");
3300  $values[] = "language";
3301  $types[] = "text";
3302 
3303 
3304  if (is_numeric($active) && $active > -1) {
3305  $query .= " AND usr_data.active = %s";
3306  $values[] = $active;
3307  $types[] = "integer";
3308  }
3309 
3310  $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
3311 
3312  $r = $ilDB->queryF($query, $types, $values);
3313  $data = [];
3314  while ($row = $ilDB->fetchAssoc($r)) {
3315  $data[] = $row;
3316  }
3317  return $data;
3318  }
global $DIC
Definition: feed.php:28
$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 3623 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 ILIAS\Awareness\User\Collector\getOnlineUsers().

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

References $DIC, and $ilDB.

Referenced by ilAuthFrontend\handleLoginAttempts().

3539  : bool {
3540  global $DIC;
3541 
3542  $ilDB = $DIC['ilDB'];
3543 
3544  $query = "UPDATE usr_data SET login_attempts = (login_attempts + 1) WHERE usr_id = %s";
3545  $affected = $ilDB->manipulateF($query, ['integer'], [$a_usr_id]);
3546 
3547  if ($affected) {
3548  return true;
3549  } else {
3550  return false;
3551  }
3552  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _isAnonymous()

static ilObjUser::_isAnonymous ( int  $usr_id)
static

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

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

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

3234  : ?int {
3235  global $DIC;
3236 
3237  $ilDB = $DIC['ilDB'];
3238 
3239  $q = "SELECT DISTINCT login, usr_id FROM usr_data " .
3240  "WHERE login = %s";
3241  $types[] = "text";
3242  $values[] = $a_login;
3243 
3244  if ($a_user_id != 0) {
3245  $q .= " AND usr_id != %s ";
3246  $types[] = "integer";
3247  $values[] = $a_user_id;
3248  }
3249 
3250  $r = $ilDB->queryF($q, $types, $values);
3251 
3252  if ($row = $ilDB->fetchAssoc($r)) {
3253  return (int) $row['usr_id'];
3254  }
3255  return null;
3256  }
global $DIC
Definition: feed.php:28
$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 568 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

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

◆ _lookupActive()

static ilObjUser::_lookupActive ( int  $a_usr_id)
static

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

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

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

1702  : bool
1703  {
1704  global $DIC;
1705 
1706  $ilDB = $DIC['ilDB'];
1707 
1708  $query = 'SELECT usr_id FROM usr_data ' .
1709  'WHERE active = ' . $ilDB->quote(1, 'integer') . ' ' .
1710  'AND usr_id = ' . $ilDB->quote($a_usr_id, 'integer');
1711  $res = $ilDB->query($query);
1712  while ($res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1713  return true;
1714  }
1715  return false;
1716  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _lookupAuthMode()

static ilObjUser::_lookupAuthMode ( int  $a_usr_id)
static

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

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

2728  : string
2729  {
2730  return (string) self::_lookup($a_usr_id, "auth_mode");
2731  }
+ Here is the caller graph for this function:

◆ _lookupClientIP()

static ilObjUser::_lookupClientIP ( int  $a_user_id)
static

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

Referenced by ilObjTest\inviteGroup(), and ilObjTest\inviteRole().

625  : string
626  {
627  return self::_lookup($a_user_id, "client_ip") ?? '';
628  }
+ Here is the caller graph for this function:

◆ _lookupEmail()

static ilObjUser::_lookupEmail ( int  $a_user_id)
static

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

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

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

◆ _lookupExternalAccount()

static ilObjUser::_lookupExternalAccount ( int  $a_user_id)
static

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

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

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

◆ _lookupFeedHash()

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

Lookup news feed hash for user.

If hash does not exist, create one.

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

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

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

3166  : ?string
3167  {
3168  global $DIC;
3169  $ilDB = $DIC['ilDB'];
3170 
3171  if ($a_user_id > 0) {
3172  $set = $ilDB->queryF(
3173  'SELECT feed_hash from usr_data WHERE usr_id = %s',
3175  [$a_user_id]
3176  );
3177  if ($rec = $ilDB->fetchAssoc($set)) {
3178  $feed_hash = $rec['feed_hash'];
3179  if (is_string($feed_hash) && strlen($feed_hash) === 32) {
3180  return $feed_hash;
3181  }
3182 
3183  if ($a_create) {
3184  $hash = md5(random_int(1, 9999999) + str_replace(' ', '', microtime()));
3185  $ilDB->manipulateF(
3186  'UPDATE usr_data SET feed_hash = %s' .
3187  ' WHERE usr_id = %s',
3189  [$hash, $a_user_id]
3190  );
3191  return $hash;
3192  }
3193  }
3194  }
3195  return null;
3196  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _lookupFields()

static ilObjUser::_lookupFields ( int  $a_user_id)
static

lookup fields (deprecated; use more specific methods instead)

Deprecated:

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

References $DIC, $ilDB, and $res.

Referenced by ilTestExportAbstract\getDatarows(), ilCertificateUserObjectHelper\lookupFields(), and ilTestEvaluationGUI\resetfilterEvaluation().

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

◆ _lookupFirstLogin()

static ilObjUser::_lookupFirstLogin ( int  $a_user_id)
static

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

Referenced by ilFirstLoginLearningHistoryProvider\getEntries().

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

◆ _lookupFullname()

static ilObjUser::_lookupFullname ( int  $a_user_id)
static

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

References $DIC, $fullname, and $ilDB.

Referenced by ilExAssignmentTeam\addTeamMember(), ilCalendarAppointmentGUI\book(), ilBookingProcessWithoutScheduleGUI\bookMultipleParticipants(), ilObjStudyProgrammeIndividualPlanGUI\buildFrame(), ilTestEvaluationGUI\buildResultsTitle(), ilCalendarAppointmentGUI\cancelBooking(), ilObjSurvey\checkReminder(), ilAppointmentPresentationConsultationHoursGUI\collectPropertiesAndActions(), ilObjStudyProgrammeMembersGUI\confirmRemoveUsers(), ilExAssignmentTeam\createTeam(), ilRbacLogTableGUI\fillRow(), ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI\fillRow(), ilConsultationHourUtils\getConsultationHourLinksForRepositoryObject(), ilLPTableBaseGUI\getExportMeta(), ilCalendarAppointmentPanelGUI\getHTML(), ilCalendarBlockGUI\getHTML(), ilExAssignmentTeamLogTableGUI\getItems(), ilLearningModuleNotification\getMailBody(), ilConsultationHourAppointments\getManager(), ilObjSurvey\getSurveyParticipants(), ilExAssignmentTeam\getTeamId(), ilSCORMTrackingItemsPerUserTableGUI\initTable(), ilSCORMTrackingItemPerUserTableGUI\initTable(), ilBookingEntry\lookupManagedBookingsForObject(), ilTestEvaluationGUI\multiParticipantsPassDetails(), ilSCORMTrackingItemsScoTableGUI\parse(), ilConsultationHoursTableGUI\parse(), ilAssignmentsPerParticipantTableGUI\parseData(), ilCalendarPresentationGUI\prepareOutput(), ilCalendarCategories\readConsultationHoursCalendar(), ilObjStudyProgrammeMembersGUI\removeCertificate(), ilObjStudyProgrammeMembersGUI\removeCertificateMulti(), ilExAssignmentTeam\removeTeamMember(), ilTestScoringByQuestionsGUI\saveManScoringByQuestion(), ILIAS\Wiki\Notification\NotificationGUI\send(), ilCalendarMailNotification\send(), ilConsultationHoursGUI\sendInfoAboutUnassignedUsers(), ilWikiUtil\sendNotification(), ILIAS\Notes\NotificationsManager\sendNotifications(), ilExAssignmentReminder\sendReminders(), ilObjSurvey\sendTutorNotification(), ilObjStudyProgrammeMembersGUI\updateCertificate(), ilObjStudyProgrammeMembersGUI\updateCertificateMulti(), ilObjStudyProgrammeMembersGUI\updateFromCurrentPlan(), and ilObjStudyProgrammeMembersGUI\updateFromCurrentPlanMulti().

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

◆ _lookupGender()

static ilObjUser::_lookupGender ( int  $a_user_id)
static

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

Referenced by ilMail\getSalutation().

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

◆ _lookupId()

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

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

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

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(), ilPermission2GUI\changeOwner(), ilAuthProviderShibboleth\doAuthentication(), ilAuthProviderCAS\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().

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

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

Referenced by ilLanguageFactory\_getLanguageOfUser(), and ilCoursePlaceholderValues\getPlaceholderValues().

1537  : string
1538  {
1539  global $DIC;
1540 
1541  $ilDB = $DIC->database();
1542  $lng = $DIC->language();
1543 
1544  $q = "SELECT value FROM usr_pref WHERE usr_id= " .
1545  $ilDB->quote($a_usr_id, "integer") . " AND keyword = " .
1546  $ilDB->quote('language', "text");
1547  $r = $ilDB->query($q);
1548 
1549  while ($row = $ilDB->fetchAssoc($r)) {
1550  return (string) $row['value'];
1551  }
1552  if (is_object($lng)) {
1553  return $lng->getDefaultLanguage();
1554  }
1555  return 'en';
1556  }
getDefaultLanguage()
Return default language.
global $DIC
Definition: feed.php:28
ilLanguage $lng
$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 728 of file class.ilObjUser.php.

Referenced by ilCronDeleteInactiveUserReminderMail\removeEntriesFromTableIfLastLoginIsNewer().

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

◆ _lookupLogin()

static ilObjUser::_lookupLogin ( int  $a_user_id)
static

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

Referenced by ilCourseXMLParser\__parseId(), ilObjEmployeeTalkGUI\addChangeDateButtonsToToolbar(), ilObjSystemFolderGUI\benchmarkObject(), ilObjSurvey\checkReminder(), ilWorkspaceUserActionProvider\collectActionsForTargetUser(), ilChatUserActionProvider\collectActionsForTargetUser(), ilForumMailEventNotificationSender\createMailValueObjectsWithAttachments(), ilForumMailEventNotificationSender\createMailValueObjectWithoutAttachments(), ilObjRole\delete(), ilStartUpGUI\doStandardAuthentication(), ilObjSessionGUI\eventsListObject(), ilTestEvaluationGUI\exportCertificateArchive(), ilSessionOverviewGUI\exportCSV(), ilStudyProgrammeIndividualPlanTableGUI\fetchData(), ilDclBaseRecordModel\fillRecordFieldExcelExport(), ilPDNewsTableGUI\fillRow(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), ilOrgUnitUserAssignmentGUI\getConfirmationGUI(), ilAccessibilitySupportContactsGUI\getContactLogins(), ilAttendanceList\getHTML(), ilConsultationHourAppointments\getManagedUsers(), ilConsultationHourAppointments\getManager(), ilStudyProgrammeMailMemberSearchGUI\getProcessData(), ilTestServiceGUI\getResultsHeadUserAndPass(), ilStudyProgrammeMailTemplateContext\getSpecificPlaceholders(), ilObjSurvey\getUserDataFromActiveId(), ilForumSettingsGUI\getUserNotificationTableData(), ilInternalLinkGUI\getUserSearchResult(), ilUserClipboard\getValidatedContent(), ilObjUserGUI\getValues(), ilAuthFrontend\handleAuthenticationSuccess(), ilCalendarAppointmentGUI\initForm(), ilMailSearchObjectGUI\mailMembers(), ilContactGUI\mailToUsers(), ilPermission2GUI\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(), 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().

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

◆ _lookupName()

static ilObjUser::_lookupName ( int  $a_user_id)
static

lookup user name

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

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

References $DIC, $ilDB, and $res.

Referenced by ILIAS\Services\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(), ilLocalUserGUI\deleteUsers(), ilObjCategoryGUI\deleteUsersObject(), ilBlogExerciseGUI\downloadExcSubFile(), ilPortfolioExerciseGUI\downloadExcSubFile(), ilWikiPageGUI\downloadExcSubFile(), ilExSubmission\downloadFiles(), ilExSubmission\downloadMultipleFiles(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilObjExercise\exportGradesExcel(), ilObjAssessmentFolderGUI\exportLogObject(), ilDclBaseRecordModel\fillRecordFieldExcelExport(), ilAssessmentFolderLogTableGUI\fillRow(), ilCalendarInboxSharedTableGUI\fillRow(), ilRbacLogTableGUI\fillRow(), ilFileVersionsTableGUI\fillRow(), ilObjSurvey\getAppraiseesData(), ilBookingParticipant\getAssignableParticipants(), ilLMTracker\getBlockedUsersInformation(), ilExSubmission\getDirectoryNameFromUserData(), ILIAS\Exercise\TutorFeedbackFile\TutorFeedbackFileManager\getFeedbackTitle(), ILIAS\Exercise\TutorFeedbackFile\TutorFeedbackZipRepository\getFiles(), ilIndividualAssessmentMembersTableGUI\getFullNameFor(), ilAttendanceList\getHTML(), ilSurveyParticipantsTableGUI\getItems(), ilSessionOverviewTableGUI\getItems(), ilCourseParticipantsGroupsTableGUI\getItems(), 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(), 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(), ilTestScoringGUI\saveManScoringParticipantScreen(), ilExerciseManagementGUI\saveStatus(), ilExerciseManagementGUI\showParticipantObject(), ilMailSearchGUI\showResults(), ilCourseContentGUI\showUserTimings(), ilObjTest\userLookupFullName(), ilMailNotification\userToString(), and ILIAS\Survey\Settings\SettingsFormGUI\withAfterEnd().

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

◆ _lookupPref()

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

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

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

Referenced by ilNewsItem\_getNewsItemsOfUser(), ilChatUserActionProvider\acceptsMessages(), ilObjUserAccess\canBeDelivered(), ilMailSearchObjectGUI\cancel(), ilUserUserActionProvider\collectActionsForTargetUser(), ilMailFolderGUI\confirmDeleteMails(), ilMailSearchObjectMembershipsTableGUI\fillRow(), ilBuddySystemRelationsTableGUI\fillRow(), ilMail\formatNamesForOutput(), ilBuddySystemLinkButton\getHtml(), ilUserUtil\getProfileLink(), ilBuddySystemGUI\requestCommand(), ilMailSearchGUI\showResults(), and ilBuddySystemGUI\transitionAsyncCommand().

1070  : ?string {
1071  global $DIC;
1072 
1073  $ilDB = $DIC['ilDB'];
1074 
1075  $query = "SELECT * FROM usr_pref WHERE usr_id = " . $ilDB->quote($a_usr_id, "integer") . " " .
1076  "AND keyword = " . $ilDB->quote($a_keyword, "text");
1077  $res = $ilDB->query($query);
1078 
1079  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1080  return $row->value;
1081  }
1082  return null;
1083  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ 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 2320 of file class.ilObjUser.php.

References $DIC, $ilDB, and $q.

Referenced by ilSystemStyleOverviewGUI\moveUserStyles().

2325  : void {
2326  global $DIC;
2327 
2328  $ilDB = $DIC['ilDB'];
2329 
2330  $q = "SELECT up1.usr_id usr_id FROM usr_pref up1, usr_pref up2 " .
2331  " WHERE up1.keyword= " . $ilDB->quote("style", "text") .
2332  " AND up1.value= " . $ilDB->quote($a_from_style, "text") .
2333  " AND up2.keyword= " . $ilDB->quote("skin", "text") .
2334  " AND up2.value= " . $ilDB->quote($a_from_skin, "text") .
2335  " AND up1.usr_id = up2.usr_id ";
2336 
2337  $usr_set = $ilDB->query($q);
2338 
2339  while ($usr_rec = $ilDB->fetchAssoc($usr_set)) {
2340  self::_writePref($usr_rec["usr_id"], "skin", $a_to_skin);
2341  self::_writePref($usr_rec["usr_id"], "style", $a_to_style);
2342  }
2343  }
global $DIC
Definition: feed.php:28
$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 2156 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

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

2156  : array
2157  {
2158  global $DIC;
2159 
2160  $ilDB = $DIC['ilDB'];
2161  $res = $ilDB->query("SELECT * FROM usr_data WHERE " .
2162  $ilDB->in("usr_id", $a_user_ids, false, "integer"));
2163  $user_data = [];
2164  while ($row = $ilDB->fetchAssoc($res)) {
2165  $user_data[$row['usr_id']] = $row;
2166  }
2167  return $user_data;
2168  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ 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 3216 of file class.ilObjUser.php.

Referenced by ilPDNewsBlockGUI\changeFeedSettings().

3219  : void {
3220  self::_writePref(
3221  $a_user_id,
3222  "priv_feed_pass",
3223  ($a_password == "") ? "" : md5($a_password)
3224  );
3225  }
+ Here is the caller graph for this function:

◆ _setUserInactive()

static ilObjUser::_setUserInactive ( int  $a_usr_id)
static

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

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

Referenced by ilAuthFrontend\handleLoginAttempts().

3556  : bool {
3557  global $DIC;
3558 
3559  $ilDB = $DIC['ilDB'];
3560 
3561  $query = "UPDATE usr_data SET active = 0, inactivation_date = %s WHERE usr_id = %s";
3562  $affected = $ilDB->manipulateF($query, ['timestamp', 'integer'], [ilUtil::now(), $a_usr_id]);
3563 
3564  if ($affected) {
3565  return true;
3566  } else {
3567  return false;
3568  }
3569  }
static now()
Return current timestamp in Y-m-d H:i:s format.
global $DIC
Definition: feed.php:28
+ 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 2700 of file class.ilObjUser.php.

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

Referenced by ilLDAPCronSynchronization\deactivateUsers().

2703  : void {
2704  global $DIC;
2705 
2706  $ilDB = $DIC['ilDB'];
2707 
2708  if ($a_status) {
2709  $q = "UPDATE usr_data SET active = 1, inactivation_date = NULL WHERE " .
2710  $ilDB->in("usr_id", $a_usr_ids, false, "integer");
2711  $ilDB->manipulate($q);
2712  } else {
2713  $usrId_IN_usrIds = $ilDB->in("usr_id", $a_usr_ids, false, "integer");
2714 
2715  $q = "UPDATE usr_data SET active = 0 WHERE $usrId_IN_usrIds";
2716  $ilDB->manipulate($q);
2717 
2718  $queryString = "
2719  UPDATE usr_data
2720  SET inactivation_date = %s
2721  WHERE inactivation_date IS NULL
2722  AND $usrId_IN_usrIds
2723  ";
2724  $ilDB->manipulateF($queryString, ['timestamp'], [ilUtil::now()]);
2725  }
2726  }
static now()
Return current timestamp in Y-m-d H:i:s format.
global $DIC
Definition: feed.php:28
$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 2851 of file class.ilObjUser.php.

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

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

2854  : bool {
2855  global $DIC;
2856  $user = new ilObjUser($obj_id);
2857  $stakeholder = new ilUserProfilePictureStakeholder();
2858  $stakeholder->setOwner($user->getId());
2859  $stream = Streams::ofResource(fopen($tmp_file, 'rb'));
2860 
2861  if ($user->getAvatarRid() !== null && $user->getAvatarRid() !== ilObjUser::NO_AVATAR_RID) {
2862  $rid = $DIC->resourceStorage()->manage()->find($user->getAvatarRid());
2863  // append profile picture
2864  $DIC->resourceStorage()->manage()->replaceWithStream(
2865  $rid,
2866  $stream,
2867  $stakeholder
2868  );
2869  } else {
2870  // new profile picture
2871  $rid = $DIC->resourceStorage()->manage()->stream(
2872  $stream,
2873  $stakeholder
2874  );
2875  }
2876 
2877  $user->setAvatarRid($rid->serialize());
2878  $user->update();
2879  return true;
2880  }
setAvatarRid(?string $avatar_rid)
global $DIC
Definition: feed.php:28
const NO_AVATAR_RID
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 3747 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

Referenced by ilStartUpGUI\processIndexPHP().

3749  : int {
3750  global $DIC;
3751 
3752  $ilDB = $DIC['ilDB'];
3753 
3754  $res = $ilDB->queryf(
3755  '
3756  SELECT usr_id, create_date FROM usr_data
3757  WHERE reg_hash = %s',
3758  ['text'],
3759  [$a_hash]
3760  );
3761  while ($row = $ilDB->fetchAssoc($res)) {
3762  $oRegSettigs = new ilRegistrationSettings();
3763 
3764  if ($oRegSettigs->getRegistrationHashLifetime() != 0 &&
3765  time() - $oRegSettigs->getRegistrationHashLifetime() > strtotime($row['create_date'])) {
3767  'reg_confirmation_hash_life_time_expired',
3768  (int) $row['usr_id']
3769  );
3770  }
3771 
3772  $ilDB->manipulateF(
3773  '
3774  UPDATE usr_data
3775  SET reg_hash = %s
3776  WHERE usr_id = %s',
3777  ['text', 'integer'],
3778  ['', (int) $row['usr_id']]
3779  );
3780 
3781  return (int) $row['usr_id'];
3782  }
3783 
3784  throw new ilRegistrationHashNotFoundException('reg_confirmation_hash_not_found');
3785  }
$res
Definition: ltiservices.php:69
Class for user related exception handling in ILIAS.
global $DIC
Definition: feed.php:28
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 1574 of file class.ilObjUser.php.

References $DIC, and $ilDB.

Referenced by ilAuthProviderSaml\handleSamlAuth().

1574  : void
1575  {
1576  global $DIC;
1577 
1578  $ilDB = $DIC['ilDB'];
1579 
1580  $ilDB->manipulateF(
1581  "UPDATE usr_data " .
1582  " SET auth_mode = %s WHERE usr_id = %s",
1583  ["text", "integer"],
1584  [$a_auth_mode, $a_usr_id]
1585  );
1586  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _writeExternalAccount()

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

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

References $DIC, and $ilDB.

1561  : void {
1562  global $DIC;
1563 
1564  $ilDB = $DIC['ilDB'];
1565 
1566  $ilDB->manipulateF(
1567  "UPDATE usr_data " .
1568  " SET ext_account = %s WHERE usr_id = %s",
1569  ["text", "integer"],
1570  [$a_ext_id, $a_usr_id]
1571  );
1572  }
global $DIC
Definition: feed.php:28

◆ _writeHistory()

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

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

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

3594  : void {
3595  global $DIC;
3596 
3597  $ilDB = $DIC['ilDB'];
3598 
3599  $timestamp = time();
3600 
3601  $res = $ilDB->queryF(
3602  'SELECT * FROM loginname_history WHERE usr_id = %s AND login = %s AND history_date = %s',
3603  ['integer', 'text', 'integer'],
3604  [$a_usr_id, $a_login, $timestamp]
3605  );
3606 
3607  if ($ilDB->numRows($res) == 0) {
3608  $ilDB->manipulateF(
3609  '
3610  INSERT INTO loginname_history
3611  (usr_id, login, history_date)
3612  VALUES (%s, %s, %s)',
3613  ['integer', 'text', 'integer'],
3614  [$a_usr_id, $a_login, $timestamp]
3615  );
3616  }
3617  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70

◆ _writePref()

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

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

References $DIC, and $ilDB.

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

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

◆ activateDeletionFlag()

ilObjUser::activateDeletionFlag ( )

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

References writePref().

4035  : void
4036  {
4037  $this->writePref("delete_flag", true);
4038  }
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 2358 of file class.ilObjUser.php.

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

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

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

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

Referenced by ILIAS\COPage\Page\PageContentManager\copyContents().

2408  : void {
2409  $ilDB = $this->db;
2410  if ($a_time == 0) {
2411  $a_time = date("Y-m-d H:i:s");
2412  }
2413  ilSession::set("user_pc_clip", true);
2414  $ilDB->insert("personal_pc_clipboard", [
2415  "user_id" => ["integer", $this->getId()],
2416  "content" => ["clob", $a_content],
2417  "insert_time" => ["timestamp", $a_time],
2418  "order_nr" => ["integer", $a_nr]
2419  ]);
2420  }
ilDBInterface $db
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assignData()

ilObjUser::assignData ( array  $a_data)

loads a record "user" from array

Parameters
array$a_data,<string,mixed>

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

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

Referenced by read().

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

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

4142  : string
4143  {
4144  if (count($a_attr) > 0) {
4145  return implode(", ", $a_attr);
4146  }
4147  return "";
4148  }
+ Here is the caller graph for this function:

◆ checkTimeLimit()

ilObjUser::checkTimeLimit ( )

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

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

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

1814  : bool
1815  {
1816  if ($this->getTimeLimitUnlimited()) {
1817  return true;
1818  }
1819  if ($this->getTimeLimitFrom() < time() and $this->getTimeLimitUntil() > time()) {
1820  return true;
1821  }
1822  return false;
1823  }
+ 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 2003 of file class.ilObjUser.php.

References $id.

2003  : bool
2004  {
2005  $login = self::getLoginFromAuth();
2006  $id = self::_lookupId($login);
2007  if ($id > 0) {
2008  return $id;
2009  }
2010  return false;
2011  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ clipboardDeleteAll()

ilObjUser::clipboardDeleteAll ( )

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

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

Referenced by delete().

2486  : void
2487  {
2488  global $DIC;
2489 
2490  $ilDB = $DIC['ilDB'];
2491 
2492  $ilDB->manipulateF("DELETE FROM personal_clipboard WHERE " .
2493  "user_id = %s", ["integer"], [$this->getId()]);
2494  }
global $DIC
Definition: feed.php:28
+ 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 2474 of file class.ilObjUser.php.

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

2474  : void
2475  {
2476  $ilDB = $this->db;
2477 
2478  $ilDB->manipulateF(
2479  "DELETE FROM personal_clipboard WHERE " .
2480  "type = %s AND user_id = %s",
2481  ["text", "integer"],
2482  [$a_type, $this->getId()]
2483  );
2484  }
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 2455 of file class.ilObjUser.php.

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

2455  : bool
2456  {
2457  global $DIC;
2458 
2459  $ilDB = $DIC['ilDB'];
2460 
2461  $set = $ilDB->queryF(
2462  "SELECT * FROM personal_clipboard WHERE " .
2463  "parent = %s AND type = %s AND user_id = %s",
2464  ["integer", "text", "integer"],
2465  [0, $a_type, $this->getId()]
2466  );
2467  if ($ilDB->fetchAssoc($set)) {
2468  return true;
2469  }
2470 
2471  return false;
2472  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ copyProfilePicturesToDirectory()

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

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

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

Referenced by ILIAS\Portfolio\Export\PortfolioHtmlExport\exportBanner(), ILIAS\Blog\Export\BlogHtmlExport\exportBanner(), and ilUserDataSet\getXmlRecord().

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

◆ delete()

ilObjUser::delete ( )

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

1093  : bool
1094  {
1095  global $DIC;
1096 
1097  $rbacadmin = $DIC->rbac()->admin();
1098  $ilDB = $this->db;
1099 
1100  $ilAppEventHandler = $DIC['ilAppEventHandler'];
1101  $ilAppEventHandler->raise(
1102  'Services/User',
1103  'deleteUser',
1104  ['usr_id' => $this->getId()]
1105  );
1106 
1107  // deassign from ldap groups
1109  $mapping->deleteUser($this->getId());
1110 
1111  // remove mailbox / update sent mails
1112  $mailbox = new ilMailbox($this->getId());
1113  $mailbox->delete();
1114  $mailbox->updateMailsOfDeletedUser($this->getLogin());
1115 
1116  // delete block settings
1118 
1119  // delete user_account
1120  $ilDB->manipulateF(
1121  "DELETE FROM usr_data WHERE usr_id = %s",
1122  ["integer"],
1123  [$this->getId()]
1124  );
1125 
1126  $this->deleteMultiTextFields();
1127 
1128  // delete user_prefs
1129  self::_deleteAllPref($this->getId());
1130 
1131  $this->removeUserPicture(false); // #8597
1132 
1133  // delete user_session
1135 
1136  // remove user from rbac
1137  $rbacadmin->removeUser($this->getId());
1138 
1139  // remove bookmarks
1140  // TODO: move this to class.ilBookmarkFolder
1141  $q = "DELETE FROM bookmark_tree WHERE tree = " .
1142  $ilDB->quote($this->getId(), "integer");
1143  $ilDB->manipulate($q);
1144 
1145  $q = "DELETE FROM bookmark_data WHERE user_id = " .
1146  $ilDB->quote($this->getId(), "integer");
1147  $ilDB->manipulate($q);
1148 
1149  // Delete crs entries
1150  ilObjCourse::_deleteUser($this->getId());
1151 
1152  // Delete user tracking
1154 
1156 
1157  // Delete Tracking data SCORM 2004 RTE
1159 
1160  // Delete Tracking data SCORM 1.2 RTE
1162 
1163  // remove all notifications
1165 
1166  // remove portfolios
1168 
1169  // remove workspace
1170  $tree = new ilWorkspaceTree($this->getId());
1171  $tree->cascadingDelete();
1172 
1173  // remove reminder entries
1174  $this->cron_delete_user_reminder_mail->removeSingleUserFromTable($this->getId());
1175 
1176  // badges
1178 
1179  // remove org unit assignments
1180  $ilOrgUnitUserAssignmentQueries = ilOrgUnitUserAssignmentQueries::getInstance();
1181  $ilOrgUnitUserAssignmentQueries->deleteAllAssignmentsOfUser($this->getId());
1182 
1183  // Delete user defined field entries
1185 
1186  // Delete clipboard entries
1187  $this->clipboardDeleteAll();
1188 
1189  // Reset owner
1190  $this->resetOwner();
1191 
1192  // delete object data
1193  parent::delete();
1194  return true;
1195  }
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...
global $DIC
Definition: feed.php:28
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
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 4225 of file class.ilObjUser.php.

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

Referenced by delete(), and updateMultiTextFields().

4225  : void
4226  {
4227  global $DIC;
4228 
4229  $ilDB = $DIC['ilDB'];
4230 
4231  if (!$this->getId()) {
4232  return;
4233  }
4234 
4235  $ilDB->manipulate("DELETE FROM usr_data_multi" .
4236  " WHERE usr_id = " . $ilDB->quote($this->getId(), "integer"));
4237  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deletePref()

ilObjUser::deletePref ( string  $a_keyword)

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

References ilObject\getId().

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

◆ deleteUserDefinedFieldEntries()

◆ existsPref()

ilObjUser::existsPref ( string  $a_keyword)

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

1062  : bool
1063  {
1064  return (array_key_exists($a_keyword, $this->prefs));
1065  }

◆ exportPersonalData()

ilObjUser::exportPersonalData ( )

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

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

3945  : void
3946  {
3947  $exp = new ilExport();
3948  $dir = ilExport::_getExportDirectory($this->getId(), "xml", "usr", "personal_data");
3949  ilFileUtils::delDir($dir, true);
3950  $title = $this->getLastname() . ", " . $this->getLastname() . " [" . $this->getLogin() . "]";
3951  $exp->exportEntity(
3952  "personal_data",
3953  $this->getId(),
3954  "",
3955  "Services/User",
3956  $title,
3957  $dir
3958  );
3959  }
string $title
Export.
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 4239 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

Referenced by ilPublicUserProfileGUI\getAutocompleteResult().

4243  : array {
4244  global $DIC;
4245 
4246  $ilDB = $DIC['ilDB'];
4247 
4248  $res = [];
4249 
4250  $sql = "SELECT DISTINCT(value)" .
4251  " FROM usr_data_multi" .
4252  " WHERE " . $ilDB->like("value", "text", "%" . $a_term . "%");
4253  if ($a_field_id) {
4254  $sql .= " AND field_id = " . $ilDB->quote($a_field_id, "text");
4255  }
4256  if ($a_user_id) {
4257  $sql .= " AND usr_id <> " . $ilDB->quote($a_user_id, "integer");
4258  }
4259  $sql .= " ORDER BY value";
4260  $set = $ilDB->query($sql);
4261  while ($row = $ilDB->fetchAssoc($set)) {
4262  $res[] = $row["value"];
4263  }
4264 
4265  return $res;
4266  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getActive()

ilObjUser::getActive ( )

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

References $active.

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

1697  : bool
1698  {
1699  return (bool) $this->active;
1700  }
+ Here is the caller graph for this function:

◆ getAgreeDate()

ilObjUser::getAgreeDate ( )

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

References $agree_date.

1668  : ?string
1669  {
1670  return $this->agree_date;
1671  }
string $agree_date

◆ getApproveDate()

ilObjUser::getApproveDate ( )

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

References $approve_date.

1663  : ?string
1664  {
1665  return $this->approve_date;
1666  }
string $approve_date

◆ getAuthMode()

ilObjUser::getAuthMode ( bool  $a_auth_key = false)

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

References $auth_mode, and ilAuthUtils\_getAuthMode().

Referenced by ilECSAppEventListener\handleMembership(), isPasswordChangeDemanded(), isPasswordExpired(), saveAsNew(), and update().

2645  : ?string
2646  {
2647  if (!$a_auth_key) {
2648  return $this->auth_mode;
2649  }
2650  return ilAuthUtils::_getAuthMode($this->auth_mode);
2651  }
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 2905 of file class.ilObjUser.php.

References ilObject\getId().

2905  : Avatar
2906  {
2907  return self::_getAvatar($this->getId());
2908  }
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:

◆ getAvatarRid()

ilObjUser::getAvatarRid ( )

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

References $avatar_rid.

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

1970  : ?string
1971  {
1972  return $this->avatar_rid;
1973  }
string $avatar_rid
+ Here is the caller graph for this function:

◆ getBirthday()

ilObjUser::getBirthday ( )

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

References $birthday.

Referenced by saveAsNew(), and update().

3797  : ?string
3798  {
3799  return $this->birthday;
3800  }
string $birthday
+ Here is the caller graph for this function:

◆ getCity()

ilObjUser::getCity ( )

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

References $city.

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

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

◆ getClientIP()

ilObjUser::getClientIP ( )

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

References $client_ip.

Referenced by ilAuthFrontend\checkIp().

1448  : string
1449  {
1450  return $this->client_ip;
1451  }
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 2544 of file class.ilObjUser.php.

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

2547  : array {
2548  global $DIC;
2549 
2550  $ilDB = $DIC['ilDB'];
2551  $ilUser = $DIC['ilUser'];
2552 
2553  $objs = $ilDB->queryF(
2554  "SELECT * FROM personal_clipboard WHERE " .
2555  "user_id = %s AND parent = %s AND insert_time = %s " .
2556  " ORDER BY order_nr",
2557  ["integer", "integer", "timestamp"],
2558  [$ilUser->getId(), $a_parent, $a_insert_time]
2559  );
2560  $objects = [];
2561  while ($obj = $ilDB->fetchAssoc($objs)) {
2562  if ($obj["type"] == "mob") {
2563  $obj["title"] = ilObject::_lookupTitle($obj["item_id"]);
2564  }
2565  $objects[] = ["id" => $obj["item_id"],
2566  "type" => $obj["type"], "title" => $obj["title"], "insert_time" => $obj["insert_time"]];
2567  }
2568  return $objects;
2569  }
global $DIC
Definition: feed.php:28
static _lookupTitle(int $obj_id)
+ 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 2499 of file class.ilObjUser.php.

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

Referenced by ilClipboardTableGUI\getItems().

2502  : array {
2503  global $DIC;
2504 
2505  $ilDB = $DIC['ilDB'];
2506 
2507  $par = "";
2508  if ($a_top_nodes_only) {
2509  $par = " AND parent = " . $ilDB->quote(0, "integer") . " ";
2510  }
2511 
2512  $type_str = ($a_type != "")
2513  ? " AND type = " . $ilDB->quote($a_type, "text") . " "
2514  : "";
2515  $q = "SELECT * FROM personal_clipboard WHERE " .
2516  "user_id = " . $ilDB->quote($this->getId(), "integer") . " " .
2517  $type_str . $par .
2518  " ORDER BY order_nr";
2519  $objs = $ilDB->query($q);
2520  $objects = [];
2521  while ($obj = $ilDB->fetchAssoc($objs)) {
2522  if ($obj["type"] == "mob") {
2523  $obj["title"] = ilObject::_lookupTitle($obj["item_id"]);
2524  if (ilObject::_lookupType((int) $obj["item_id"]) !== "mob") {
2525  continue;
2526  }
2527  }
2528  if ($obj["type"] == "incl") {
2529  $obj["title"] = ilMediaPoolPage::lookupTitle($obj["item_id"]);
2530  if (!ilPageObject::_exists("mep", (int) $obj["item_id"], "-")) {
2531  continue;
2532  }
2533  }
2534  $objects[] = ["id" => $obj["item_id"],
2535  "type" => $obj["type"], "title" => $obj["title"],
2536  "insert_time" => $obj["insert_time"]];
2537  }
2538  return $objects;
2539  }
static lookupTitle(int $a_page_id)
global $DIC
Definition: feed.php:28
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.
$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 1649 of file class.ilObjUser.php.

References $referral_comment.

Referenced by deleteUserDefinedFieldEntries().

1649  : string
1650  {
1651  return $this->referral_comment;
1652  }
string $referral_comment
+ Here is the caller graph for this function:

◆ getCountry()

ilObjUser::getCountry ( )

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

References $country.

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

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

References ilSession\get().

1591  : string
1592  {
1593  return (string) ilSession::get('lang');
1594  }
static get(string $a_var)
+ Here is the call graph for this function:

◆ getDateFormat()

ilObjUser::getDateFormat ( )

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

References ILIAS\LTI\ToolProvider\$settings, ilCalendarSettings\_getInstance(), ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, ilCalendarSettings\DATE_FORMAT_YMD, and getPref().

Referenced by ilIndividualAssessmentDateFormatter\getUserDateFormat().

1030  : DateFormat
1031  {
1032  if (!($format = $this->getPref('date_format'))) {
1034  $format = $settings->getDefaultDateFormat();
1035  }
1036 
1037  switch ($format) {
1039  return $this->date_format_factory->germanShort();
1040 
1042  return $this->date_format_factory->americanShort();
1043 
1045  default:
1046  return $this->date_format_factory->standard();
1047  }
1048  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
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:

◆ getDepartment()

ilObjUser::getDepartment ( )

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

References $department.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getEmail()

◆ getExternalAccount()

ilObjUser::getExternalAccount ( )

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

References $ext_account.

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

2658  : string
2659  {
2660  return $this->ext_account;
2661  }
string $ext_account
+ Here is the caller graph for this function:

◆ getFax()

ilObjUser::getFax ( )

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

References $fax.

Referenced by deleteUserDefinedFieldEntries().

1438  : string
1439  {
1440  return $this->fax;
1441  }
+ 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 3909 of file class.ilObjUser.php.

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

3911  : array {
3912  global $DIC;
3913 
3914  $ilDB = $DIC->database();
3915 
3916  $q = "SELECT DISTINCT " . $ilDB->upper($ilDB->substr("lastname", 1, 1)) . " let" .
3917  " FROM usr_data" .
3918  " WHERE usr_id <> " . $ilDB->quote(ANONYMOUS_USER_ID, "integer") .
3919  ($user_ids !== null ? " AND " . $ilDB->in('usr_id', $user_ids, false, "integer") : "") .
3920  " ORDER BY let";
3921  $let_set = $ilDB->query($q);
3922 
3923  $let = [];
3924  while ($let_rec = $ilDB->fetchAssoc($let_set)) {
3925  $let[$let_rec["let"]] = $let_rec["let"];
3926  }
3927  return $let;
3928  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
global $DIC
Definition: feed.php:28
$q
Definition: shib_logout.php:21

◆ getFirstLogin()

ilObjUser::getFirstLogin ( )

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

References $first_login.

Referenced by refreshLogin().

1619  : string
1620  {
1621  return $this->first_login;
1622  }
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 1223 of file class.ilObjUser.php.

References ilUtil\stripSlashes().

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

1223  : string
1224  {
1225  if (!$a_max_strlen) {
1226  return ilUtil::stripSlashes($this->fullname);
1227  }
1228 
1229  if (strlen($this->fullname) <= $a_max_strlen) {
1230  return ilUtil::stripSlashes($this->fullname);
1231  }
1232 
1233  if ((strlen($this->utitle) + strlen($this->lastname) + 4) <= $a_max_strlen) {
1234  return ilUtil::stripSlashes($this->utitle . " " . substr($this->firstname, 0, 1) . ". " . $this->lastname);
1235  }
1236 
1237  if ((strlen($this->firstname) + strlen($this->lastname) + 1) <= $a_max_strlen) {
1238  return ilUtil::stripSlashes($this->firstname . " " . $this->lastname);
1239  }
1240 
1241  if ((strlen($this->lastname) + 3) <= $a_max_strlen) {
1242  return ilUtil::stripSlashes(substr($this->firstname, 0, 1) . ". " . $this->lastname);
1243  }
1244 
1245  return ilUtil::stripSlashes(substr($this->lastname, 0, $a_max_strlen));
1246  }
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 1287 of file class.ilObjUser.php.

References $gender.

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

1287  : string
1288  {
1289  return $this->gender;
1290  }
string $gender
+ Here is the caller graph for this function:

◆ getGeneralInterests()

ilObjUser::getGeneralInterests ( )
Returns
string[]

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

References $interests_general.

Referenced by updateMultiTextFields().

4076  : array
4077  {
4078  return $this->interests_general;
4079  }
array $interests_general
+ Here is the caller graph for this function:

◆ getGeneralInterestsAsText()

ilObjUser::getGeneralInterestsAsText ( )

Get general interests as plain text.

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

References buildTextFromArray().

4084  : string
4085  {
4086  return $this->buildTextFromArray($this->interests_general);
4087  }
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 1501 of file class.ilObjUser.php.

References $hobby.

Referenced by deleteUserDefinedFieldEntries().

1501  : string
1502  {
1503  return $this->hobby;
1504  }
+ Here is the caller graph for this function:

◆ getInactivationDate()

ilObjUser::getInactivationDate ( )

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

References $inactivation_date.

4020  : ?string
4021  {
4022  return $this->inactivation_date;
4023  }
string $inactivation_date

◆ getInstitution()

ilObjUser::getInstitution ( )

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

References $institution.

Referenced by deleteUserDefinedFieldEntries().

1332  : string
1333  {
1334  return $this->institution;
1335  }
string $institution
+ Here is the caller graph for this function:

◆ getLanguage()

◆ getLastLogin()

ilObjUser::getLastLogin ( )

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

References $last_login.

Referenced by ilObjUserFolderGUI\showActionConfirmation().

1609  : string
1610  {
1611  return $this->last_login;
1612  }
string $last_login
+ Here is the caller graph for this function:

◆ getLastname()

◆ getLastPasswordChangeTS()

ilObjUser::getLastPasswordChangeTS ( )

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

References $last_password_change_ts.

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

1522  : int
1523  {
1525  }
int $last_password_change_ts
+ Here is the caller graph for this function:

◆ getLastProfilePrompt()

ilObjUser::getLastProfilePrompt ( )

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

References $last_profile_prompt.

1629  : string
1630  {
1632  }
string $last_profile_prompt

◆ getLastUpdate()

ilObjUser::getLastUpdate ( )

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

References ilObject\$last_update.

1639  : string
1640  {
1641  return $this->last_update;
1642  }
string $last_update

◆ getLatitude()

ilObjUser::getLatitude ( )

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

References $latitude.

Referenced by ilPersonalProfileGUI\addLocationToForm().

1945  : ?string
1946  {
1947  return $this->latitude;
1948  }
string $latitude
+ Here is the caller graph for this function:

◆ getLocationZoom()

ilObjUser::getLocationZoom ( )

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

References $loc_zoom.

Referenced by ilPersonalProfileGUI\addLocationToForm().

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

◆ getLogin()

◆ getLoginAttempts()

ilObjUser::getLoginAttempts ( )

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

References $login_attempts.

1809  : int
1810  {
1811  return $this->login_attempts;
1812  }

◆ getLoginByUserId()

ilObjUser::getLoginByUserId ( int  $a_userid)

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

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

2122  : ?string
2123  {
2124  $login = self::_lookupLogin($a_userid);
2125  return $login ?: null;
2126  }

◆ getLoginFromAuth()

static ilObjUser::getLoginFromAuth ( )
staticprivate

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

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

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

2016  : string
2017  {
2018  $uid = $GLOBALS['DIC']['ilAuthSession']->getUserId();
2019  $login = self::_lookupLogin($uid);
2020 
2021  // BEGIN WebDAV: Strip Microsoft Domain Names from logins
2023  $login = self::toUsernameWithoutDomain($login);
2024  }
2025  return $login;
2026  }
$GLOBALS["DIC"]
Definition: wac.php:31
+ Here is the call graph for this function:

◆ getLongitude()

ilObjUser::getLongitude ( )

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

References $longitude.

Referenced by ilPersonalProfileGUI\addLocationToForm().

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

◆ getLookingForHelp()

ilObjUser::getLookingForHelp ( )
Returns
string[]

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

References $interests_help_looking.

Referenced by updateMultiTextFields().

4124  : array
4125  {
4127  }
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 4132 of file class.ilObjUser.php.

References buildTextFromArray().

4132  : string
4133  {
4134  return $this->buildTextFromArray($this->interests_help_looking);
4135  }
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 1458 of file class.ilObjUser.php.

References $matriculation.

Referenced by ilTestArchiver\createPassMaterialsDirectory(), deleteUserDefinedFieldEntries(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), and ilTestServiceGUI\getResultsHeadUserAndPass().

1458  : string
1459  {
1460  return $this->matriculation;
1461  }
string $matriculation
+ Here is the caller graph for this function:

◆ getOfferingHelp()

ilObjUser::getOfferingHelp ( )
Returns
string[]

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

References $interests_help_offered.

Referenced by updateMultiTextFields().

4100  : array
4101  {
4103  }
array $interests_help_offered
+ Here is the caller graph for this function:

◆ getOfferingHelpAsText()

ilObjUser::getOfferingHelpAsText ( )

Get help offering as plain text.

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

References buildTextFromArray().

4108  : string
4109  {
4110  return $this->buildTextFromArray($this->interests_help_offered);
4111  }
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 2635 of file class.ilObjUser.php.

References ilObject\getId().

2635  : string
2636  {
2637  return self::lookupOrgUnitsRepresentation($this->getId());
2638  }
+ 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 1269 of file class.ilObjUser.php.

References $passwd.

Referenced by resetPassword(), saveAsNew(), update(), and ilUserPasswordManager\verifyPassword().

1269  : string
1270  {
1271  return $this->passwd;
1272  }
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 1277 of file class.ilObjUser.php.

References $passwd_type.

1277  : string
1278  {
1279  return $this->passwd_type;
1280  }
string $passwd_type

◆ getPasswordAge()

ilObjUser::getPasswordAge ( )

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

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

1892  : int
1893  {
1894  $current_ts = time();
1895  $pass_change_ts = $this->getLastPasswordChangeTS();
1896  $password_age = (int) (($current_ts - $pass_change_ts) / 86400);
1897  return $password_age;
1898  }
+ Here is the call graph for this function:

◆ getPasswordEncodingType()

ilObjUser::getPasswordEncodingType ( )

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

References $password_encoding_type.

Referenced by resetPassword(), saveAsNew(), update(), and ilUserPasswordManager\verifyPassword().

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

◆ getPasswordPolicyResetStatus()

ilObjUser::getPasswordPolicyResetStatus ( )

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

References $passwd_policy_reset.

Referenced by isPasswordChangeDemanded().

1527  : bool
1528  {
1530  }
bool $passwd_policy_reset
+ Here is the caller graph for this function:

◆ getPasswordSalt()

ilObjUser::getPasswordSalt ( )

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

References $password_salt.

Referenced by ilUserPasswordManager\encodePassword(), resetPassword(), saveAsNew(), update(), and ilUserPasswordManager\verifyPassword().

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

◆ getPCClipboardContent()

ilObjUser::getPCClipboardContent ( )

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

Todo:
move to COPage service

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

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

Referenced by ILIAS\COPage\Page\PageContentManager\pasteContents().

2426  : array // Missing array type.
2427  {
2428  $ilDB = $this->db;
2429 
2430  if (!ilSession::get("user_pc_clip")) {
2431  return [];
2432  }
2433 
2434  $set = $ilDB->queryF("SELECT MAX(insert_time) mtime FROM personal_pc_clipboard " .
2435  " WHERE user_id = %s", ["integer"], [$this->getId()]);
2436  $row = $ilDB->fetchAssoc($set);
2437 
2438  $set = $ilDB->queryF(
2439  "SELECT * FROM personal_pc_clipboard " .
2440  " WHERE user_id = %s AND insert_time = %s ORDER BY order_nr ASC",
2441  ["integer", "timestamp"],
2442  [$this->getId(), $row["mtime"]]
2443  );
2444  $content = [];
2445  while ($row = $ilDB->fetchAssoc($set)) {
2446  $content[] = $row["content"];
2447  }
2448 
2449  return $content;
2450  }
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 3961 of file class.ilObjUser.php.

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

Referenced by sendPersonalDataFile().

3961  : string
3962  {
3963  $dir = ilExport::_getExportDirectory($this->getId(), "xml", "usr", "personal_data");
3964  if (!is_dir($dir)) {
3965  return "";
3966  }
3967  foreach (ilFileUtils::getDir($dir) as $entry) {
3968  if (is_int(strpos($entry["entry"], ".zip"))) {
3969  return $entry["entry"];
3970  }
3971  }
3972 
3973  return "";
3974  }
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 2887 of file class.ilObjUser.php.

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

Referenced by ilMailFolderTableGUI\fetchTableData(), ilPDMailBlockGUI\getListItemForData(), and ilForumAuthorInformation\getUserImagePath().

2890  : string {
2891  if (isset(self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic])) {
2892  return self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic];
2893  }
2894 
2895  self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic] = self::_getPersonalPicturePath($this->getId(), $a_size, $a_force_pic);
2896 
2897  return self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic];
2898  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPhoneHome()

ilObjUser::getPhoneHome ( )

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

References $phone_home.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getPhoneMobile()

ilObjUser::getPhoneMobile ( )

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

References $phone_mobile.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getPhoneOffice()

ilObjUser::getPhoneOffice ( )

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

References $phone_office.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getPref()

◆ getProfileIncomplete()

ilObjUser::getProfileIncomplete ( )

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

References $profile_incomplete, and ANONYMOUS_USER_ID.

Referenced by ilProfileChecklistStatus\getStatus(), saveAsNew(), and update().

1830  : bool
1831  {
1832  if ($this->id == ANONYMOUS_USER_ID) {
1833  return false;
1834  }
1836  }
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 4276 of file class.ilObjUser.php.

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

Referenced by ilInternalLink\searchUsers().

4278  : array {
4279  global $DIC;
4280 
4281  $ilDB = $DIC->database();
4282 
4283  $set = $ilDB->query(
4284  "SELECT * FROM usr_pref " .
4285  " WHERE keyword = " . $ilDB->quote("public_profile", "text") .
4286  " AND " . $ilDB->in("usr_id", $a_user_ids, false, "integer")
4287  );
4288  $r = [
4289  "global" => [],
4290  "local" => [],
4291  "public" => [],
4292  "not_public" => []
4293  ];
4294  while ($rec = $ilDB->fetchAssoc($set)) {
4295  if ($rec["value"] == "g") {
4296  $r["global"][] = $rec["usr_id"];
4297  $r["public"][] = $rec["usr_id"];
4298  }
4299  if ($rec["value"] == "y") {
4300  $r["local"][] = $rec["usr_id"];
4301  $r["public"][] = $rec["usr_id"];
4302  }
4303  }
4304  foreach ($a_user_ids as $id) {
4305  if (!in_array($id, $r["public"])) {
4306  $r["not_public"][] = $id;
4307  }
4308  }
4309 
4310  return $r;
4311  }
global $DIC
Definition: feed.php:28
$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 3582 of file class.ilObjUser.php.

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

Referenced by ilMailFolderTableGUI\fetchTableData(), and ilPDMailBlockGUI\getListItemForData().

3582  : string
3583  {
3584  if ($this->hasPublicProfile()) {
3585  return $this->getFirstname() . " " . $this->getLastname() . " (" . $this->getLogin() . ")";
3586  } else {
3587  return $this->getLogin();
3588  }
3589  }
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 1486 of file class.ilObjUser.php.

References $second_email.

Referenced by deleteUserDefinedFieldEntries().

1486  : ?string
1487  {
1488  return $this->second_email;
1489  }
string $second_email
+ Here is the caller graph for this function:

◆ getSelectedCountry()

ilObjUser::getSelectedCountry ( )

Get selected country (selection drop down)

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

References $sel_country.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getStoredActive()

ilObjUser::getStoredActive ( int  $a_id)

get user active state

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

Referenced by syncActive(), and update().

1744  : bool
1745  {
1746  return (bool) self::_lookup($a_id, "active");
1747  }
+ Here is the caller graph for this function:

◆ getStreet()

ilObjUser::getStreet ( )

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

References $street.

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

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

◆ getTimeFormat()

ilObjUser::getTimeFormat ( )

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

References ILIAS\LTI\ToolProvider\$settings, ilCalendarSettings\_getInstance(), and getPref().

Referenced by ilIndividualAssessmentDateFormatter\getUserDateFormat().

1020  : string
1021  {
1022  if ($format = $this->getPref('time_format')) {
1023  return $format;
1024  } else {
1026  return $settings->getDefaultTimeFormat();
1027  }
1028  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
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 1769 of file class.ilObjUser.php.

References $time_limit_from.

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

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

◆ getTimeLimitMessage()

ilObjUser::getTimeLimitMessage ( )

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

References $time_limit_message.

Referenced by update().

1799  : string
1800  {
1802  }
string $time_limit_message
+ Here is the caller graph for this function:

◆ getTimeLimitOwner()

ilObjUser::getTimeLimitOwner ( )

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

Referenced by saveAsNew(), and update().

1759  : int
1760  {
1761  return $this->time_limit_owner ?: 7;
1762  }
+ Here is the caller graph for this function:

◆ getTimeLimitUnlimited()

ilObjUser::getTimeLimitUnlimited ( )

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

References $time_limit_unlimited.

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

1789  : bool
1790  {
1792  }
bool $time_limit_unlimited
+ Here is the caller graph for this function:

◆ getTimeLimitUntil()

ilObjUser::getTimeLimitUntil ( )

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

References $time_limit_until.

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

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

◆ getTimeZone()

ilObjUser::getTimeZone ( )

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

References ILIAS\LTI\ToolProvider\$settings, ilCalendarSettings\_getInstance(), and getPref().

1010  : string
1011  {
1012  if ($tz = $this->getPref('user_tz')) {
1013  return $tz;
1014  } else {
1016  return $settings->getDefaultTimeZone();
1017  }
1018  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
getPref(string $a_keyword)
+ Here is the call graph for this function:

◆ getUserDefinedData()

ilObjUser::getUserDefinedData ( )

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

Referenced by deleteUserDefinedFieldEntries().

2998  : array // Missing array type.
2999  {
3000  return $this->user_defined_data ?: [];
3001  }
+ 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 2078 of file class.ilObjUser.php.

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

Referenced by ilObjSurvey\sendNotificationMail().

2078  : array
2079  {
2080  global $DIC;
2081 
2082  $ilDB = $DIC->database();
2083 
2084  $res = $ilDB->queryF(
2085  "SELECT usr_id FROM usr_data " .
2086  "WHERE email = %s and active = 1",
2087  ["text"],
2088  [$a_email]
2089  );
2090  $ids = [];
2091  while ($row = $ilDB->fetchObject($res)) {
2092  $ids[] = (int) $row->usr_id;
2093  }
2094 
2095  return $ids;
2096  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ 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 3808 of file class.ilObjUser.php.

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

Referenced by ilCronDeleteInactiveUserAccounts\run().

3810  : array {
3811  global $DIC;
3812 
3813  if ($periodInDays < 1) {
3814  throw new ilException('Invalid period given');
3815  }
3816 
3817  $date = date('Y-m-d H:i:s', (time() - ($periodInDays * 24 * 60 * 60)));
3818 
3819  $query = "SELECT usr_id FROM usr_data WHERE last_login IS NOT NULL AND last_login < %s";
3820 
3821  $ids = [];
3822 
3823  $types = ['timestamp'];
3824  $values = [$date];
3825 
3826  $res = $DIC->database()->queryF($query, $types, $values);
3827  while ($row = $DIC->database()->fetchAssoc($res)) {
3828  $ids[] = (int) $row['usr_id'];
3829  }
3830 
3831  return $ids;
3832  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ 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 3839 of file class.ilObjUser.php.

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

Referenced by ilCronDeleteNeverLoggedInUserAccounts\run().

3841  : array {
3842  global $DIC;
3843 
3844  $date = date('Y-m-d H:i:s', (time() - ($thresholdInDays * 24 * 60 * 60)));
3845 
3846  $query = "SELECT usr_id FROM usr_data WHERE last_login IS NULL AND create_date < %s";
3847 
3848  $ids = [];
3849 
3850  $types = ['timestamp'];
3851  $values = [$date];
3852 
3853  $res = $DIC->database()->queryF($query, $types, $values);
3854  while ($row = $DIC->database()->fetchAssoc($res)) {
3855  $ids[] = (int) $row['usr_id'];
3856  }
3857 
3858  return $ids;
3859  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ 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 2102 of file class.ilObjUser.php.

References $DIC, $ilDB, and $res.

Referenced by ilPasswordAssistanceGUI\submitUsernameAssistanceForm().

2102  : array
2103  {
2104  global $DIC;
2105 
2106  $ilDB = $DIC->database();
2107 
2108  $res = $ilDB->queryF(
2109  "SELECT login FROM usr_data " .
2110  "WHERE email = %s and active = 1",
2111  ["text"],
2112  [$a_email]
2113  );
2114  $ids = [];
2115  while ($row = $ilDB->fetchObject($res)) {
2116  $ids[] = $row->login;
2117  }
2118 
2119  return $ids;
2120  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ 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 3502 of file class.ilObjUser.php.

References $DIC, and $ilDB.

Referenced by ILIAS\Awareness\User\Collector\collectUsers().

3506  : array {
3507  global $DIC;
3508 
3509  $ilDB = $DIC['ilDB'];
3510 
3511  $users = [];
3512  $set = $ilDB->query(
3513  "SELECT usr_id FROM usr_pref " .
3514  " WHERE keyword = " . $ilDB->quote($a_keyword, "text") .
3515  " AND " . $ilDB->in("usr_id", $a_user_ids, false, "integer") .
3516  " AND value = " . $ilDB->quote($a_val, "text")
3517  );
3518  while ($rec = $ilDB->fetchAssoc($set)) {
3519  $users[] = $rec["usr_id"];
3520  }
3521  return $users;
3522  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getUTitle()

ilObjUser::getUTitle ( )

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

References $utitle.

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

1302  : string
1303  {
1304  return $this->utitle;
1305  }
string $utitle
+ Here is the caller graph for this function:

◆ getZipcode()

ilObjUser::getZipcode ( )

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

References $zipcode.

Referenced by deleteUserDefinedFieldEntries().

1372  : string
1373  {
1374  return $this->zipcode;
1375  }
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 1981 of file class.ilObjUser.php.

References $DIC, and $ilDB.

Referenced by ilAuthFrontend\checkSimultaneousLogins().

1984  : bool {
1985  global $DIC;
1986 
1987  $ilDB = $DIC['ilDB'];
1988 
1989  $set = $ilDB->queryf(
1990  '
1991  SELECT COUNT(*) session_count
1992  FROM usr_session WHERE user_id = %s AND expires > %s AND session_id != %s ',
1993  ['integer', 'integer', 'text'],
1994  [$a_user_id, time(), $a_session_id]
1995  );
1996  $row = $ilDB->fetchAssoc($set);
1997  return (bool) $row['session_count'];
1998  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ hasDeletionFlag()

ilObjUser::hasDeletionFlag ( )

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

References getPref().

4045  : bool
4046  {
4047  return (bool) $this->getPref("delete_flag");
4048  }
getPref(string $a_keyword)
+ Here is the call graph for this function:

◆ hasProfilePicture()

ilObjUser::hasProfilePicture ( )

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

References ilObject\getId().

2900  : bool
2901  {
2902  return (new ilUserAvatarResolver($this->getId()))->hasProfilePicture();
2903  }
Class ilUserAvatarResolver.
+ Here is the call graph for this function:

◆ hasPublicProfile()

ilObjUser::hasPublicProfile ( )

returns true if public is profile, false otherwise

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

References getPref().

Referenced by getPublicName().

3574  : bool
3575  {
3576  return in_array($this->getPref("public_profile"), ["y", "g"]);
3577  }
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 3985 of file class.ilObjUser.php.

3991  : void {
3992  $imp = new ilImport();
3993  // bookmarks need to be skipped, importer does not exist anymore
3994  $imp->addSkipImporter("Services/Bookmarks");
3995  if (!$a_profile_data) {
3996  $imp->addSkipEntity("Services/User", "usr_profile");
3997  }
3998  if (!$a_settings) {
3999  $imp->addSkipEntity("Services/User", "usr_setting");
4000  }
4001  if (!$a_notes) {
4002  $imp->addSkipEntity("Services/Notes", "user_notes");
4003  }
4004  if (!$a_calendar) {
4005  $imp->addSkipEntity("Services/Calendar", "calendar");
4006  }
4007  $imp->importEntity(
4008  $a_file["tmp_name"],
4009  $a_file["name"],
4010  "personal_data",
4011  "Services/User"
4012  );
4013  }
Import class.

◆ isAnonymous()

ilObjUser::isAnonymous ( )

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

References ilObject\getId().

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

4025  : bool
4026  {
4027  return self::_isAnonymous($this->getId());
4028  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCurrentUserActive()

ilObjUser::isCurrentUserActive ( )

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

References ilObject\$db, and $ilDB.

2050  : bool
2051  {
2052  $ilDB = $this->db;
2053 
2054  $login = self::getLoginFromAuth();
2055  $set = $ilDB->queryF(
2056  "SELECT active FROM usr_data WHERE login= %s",
2057  ["text"],
2058  [$login]
2059  );
2060  //query has got a result
2061  if ($rec = $ilDB->fetchAssoc($set)) {
2062  if ($rec["active"]) {
2063  return true;
2064  }
2065  }
2066 
2067  return false;
2068  }
ilDBInterface $db

◆ isPasswordChangeDemanded()

ilObjUser::isPasswordChangeDemanded ( )

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

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

1838  : bool
1839  {
1840  if ($this->id == ANONYMOUS_USER_ID) {
1841  return false;
1842  }
1843 
1844  if ($this->id == SYSTEM_USER_ID) {
1845  if (
1846  \ilUserPasswordManager::getInstance()->verifyPassword($this, base64_decode('aG9tZXI=')) &&
1848  ) {
1849  return true;
1850  } else {
1851  return false;
1852  }
1853  }
1854 
1855  $security = ilSecuritySettings::_getInstance();
1856 
1857  $authModeAllowsPasswordChange = !ilAuthUtils::_needsExternalAccountByAuthMode($this->getAuthMode(true));
1858  $passwordResetOnFirstLogin = (
1859  $security->isPasswordChangeOnFirstLoginEnabled() &&
1860  $this->getLastPasswordChangeTS() == 0 && $this->is_self_registered == false
1861  );
1862  $passwordResetOnChangedPolicy = $this->getPasswordPolicyResetStatus();
1863 
1864  return ($authModeAllowsPasswordChange && ($passwordResetOnFirstLogin || $passwordResetOnChangedPolicy));
1865  }
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.
static getInstance()
Singleton method to reduce footprint (included files, created instances)
+ Here is the call graph for this function:

◆ isPasswordExpired()

ilObjUser::isPasswordExpired ( )

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

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

1867  : bool
1868  {
1869  if ($this->id == ANONYMOUS_USER_ID) {
1870  return false;
1871  }
1872 
1873  $security = ilSecuritySettings::_getInstance();
1874  if ($this->getLastPasswordChangeTS() > 0) {
1875  $max_pass_age = $security->getPasswordMaxAge();
1876  if ($max_pass_age > 0) {
1877  $max_pass_age_ts = ($max_pass_age * 86400);
1878  $pass_change_ts = $this->getLastPasswordChangeTS();
1879  $current_ts = time();
1880 
1881  if (($current_ts - $pass_change_ts) > $max_pass_age_ts) {
1883  return true;
1884  }
1885  }
1886  }
1887  }
1888 
1889  return false;
1890  }
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:

◆ isSelfRegistered()

ilObjUser::isSelfRegistered ( )

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

References $is_self_registered.

4055  : bool
4056  {
4058  }
bool $is_self_registered

◆ lookupMatriculation()

static ilObjUser::lookupMatriculation ( int  $a_usr_id)
static

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

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

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

1463  : string
1464  {
1465  global $DIC;
1466 
1467  $ilDB = $DIC['ilDB'];
1468 
1469  $query = "SELECT matriculation FROM usr_data " .
1470  "WHERE usr_id = " . $ilDB->quote($a_usr_id);
1471  $res = $ilDB->query($query);
1472  $row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT);
1473  return $row->matriculation ?: '';
1474  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ lookupOrgUnitsRepresentation()

static ilObjUser::lookupOrgUnitsRepresentation ( int  $a_usr_id)
static

lookup org unit representation

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

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

2631  : string {
2632  return ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_usr_id);
2633  }
+ Here is the caller graph for this function:

◆ read()

ilObjUser::read ( )
Exceptions
ilObjectNotFoundException
ilObjectTypeMismatchException
ilSystemStyleException

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

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

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

Referenced by read().

4150  : void
4151  {
4152  global $DIC;
4153 
4154  $ilDB = $DIC['ilDB'];
4155 
4156  if (!$this->getId()) {
4157  return;
4158  }
4159 
4160  $set = $ilDB->query("SELECT field_id,value" .
4161  " FROM usr_data_multi" .
4162  " WHERE usr_id = " . $ilDB->quote($this->getId(), "integer") .
4163  " ORDER BY value");
4164  while ($row = $ilDB->fetchAssoc($set)) {
4165  $values[$row["field_id"]][] = $row["value"];
4166  }
4167 
4168  if (isset($values["interests_general"])) {
4169  $this->setGeneralInterests($values["interests_general"]);
4170  } else {
4171  $this->setGeneralInterests();
4172  }
4173  if (isset($values["interests_help_offered"])) {
4174  $this->setOfferingHelp($values["interests_help_offered"]);
4175  } else {
4176  $this->setOfferingHelp();
4177  }
4178  if (isset($values["interests_help_looking"])) {
4179  $this->setLookingForHelp($values["interests_help_looking"]);
4180  } else {
4181  $this->setLookingForHelp();
4182  }
4183  }
global $DIC
Definition: feed.php:28
setOfferingHelp(?array $value=null)
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 1085 of file class.ilObjUser.php.

References $prefs.

Referenced by read().

1085  : void
1086  {
1087  if (is_array($this->prefs)) {
1088  $this->oldPrefs = $this->prefs;
1089  }
1090  $this->prefs = self::_getPreferences($this->id);
1091  }
+ Here is the caller graph for this function:

◆ readUserDefinedFields()

ilObjUser::readUserDefinedFields ( )

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

References ilObject\getId().

Referenced by read().

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

◆ refreshLogin()

ilObjUser::refreshLogin ( )

updates the login data of a "user"

Todo:
set date with now() should be enough

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

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

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

◆ removeDeletionFlag()

ilObjUser::removeDeletionFlag ( )

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

References writePref().

4040  : void
4041  {
4042  $this->writePref("delete_flag", false);
4043  }
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 2595 of file class.ilObjUser.php.

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

2598  : void {
2599  $ilDB = $this->db;
2600 
2601  $q = "DELETE FROM personal_clipboard WHERE " .
2602  "item_id = " . $ilDB->quote($a_item_id, "integer") .
2603  " AND type = " . $ilDB->quote($a_type, "text") . " " .
2604  " AND user_id = " . $ilDB->quote($this->getId(), "integer");
2605  $ilDB->manipulate($q);
2606  }
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 2974 of file class.ilObjUser.php.

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

Referenced by delete().

2976  : void {
2977  if ($this->getAvatarRid() !== null && $this->getAvatarRid() !== self::NO_AVATAR_RID) {
2978  $rid = $this->irss->manage()->find($this->getAvatarRid());
2979  $this->irss->manage()->remove($rid, new ilUserProfilePictureStakeholder());
2980  }
2981 
2982  if ($a_do_update) {
2983  // remove user pref file name
2985  $this->setPref("profile_image", "");
2986  $this->update();
2987  }
2988  }
setAvatarRid(?string $avatar_rid)
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 1922 of file class.ilObjUser.php.

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

1922  : bool
1923  {
1924  $ilDB = $this->db;
1925 
1926  $query = "UPDATE usr_data SET last_password_change = 0 " .
1927  "WHERE usr_id = %s";
1928  $affected = $ilDB->manipulateF(
1929  $query,
1930  ['integer'],
1931  [$this->getId()]
1932  );
1933  if ($affected) {
1934  return true;
1935  } else {
1936  return false;
1937  }
1938  }
ilDBInterface $db
+ Here is the call graph for this function:

◆ resetOwner()

ilObjUser::resetOwner ( )

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

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

Referenced by delete().

3896  : void
3897  {
3898  $ilDB = $this->db;
3899 
3900  $query = "UPDATE object_data SET owner = 0 " .
3901  "WHERE owner = " . $ilDB->quote($this->getId(), 'integer');
3902  $ilDB->query($query);
3903  }
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetPassword()

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

Resets the user password.

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

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

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

Referenced by ilPasswordAssistanceGUI\submitAssignPasswordForm(), and ilUserPasswordManager\verifyPassword().

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

◆ saveAsNew()

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

redundant data in object_data!

Exceptions
ilPasswordException
ilUserException

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

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

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

◆ sendPersonalDataFile()

ilObjUser::sendPersonalDataFile ( )

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

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

3976  : void
3977  {
3978  $file = ilExport::_getExportDirectory($this->getId(), "xml", "usr", "personal_data") .
3979  "/" . $this->getPersonalDataExportFile();
3980  if (is_file($file)) {
3982  }
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 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 1681 of file class.ilObjUser.php.

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

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

1684  : void {
1685  $this->setOwner($a_owner);
1686 
1687  if ($a_active) {
1688  $this->active = 1;
1689  $this->setApproveDate(date('Y-m-d H:i:s'));
1690  $this->setOwner($a_owner);
1691  } else {
1692  $this->active = 0;
1693  $this->setApproveDate(null);
1694  }
1695  }
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 1672 of file class.ilObjUser.php.

1672  : void
1673  {
1674  $this->agree_date = $a_str;
1675  }

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

Referenced by setActive().

1658  : void
1659  {
1660  $this->approve_date = $a_str;
1661  }
+ Here is the caller graph for this function:

◆ setAuthMode()

ilObjUser::setAuthMode ( ?string  $a_str)

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

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

2640  : void
2641  {
2642  $this->auth_mode = $a_str;
2643  }
+ Here is the caller graph for this function:

◆ setAvatarRid()

ilObjUser::setAvatarRid ( ?string  $avatar_rid)

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

References $avatar_rid.

Referenced by _uploadPersonalPicture(), and removeUserPicture().

1975  : void
1976  {
1977  $this->avatar_rid = $avatar_rid;
1978  }
string $avatar_rid
+ Here is the caller graph for this function:

◆ setBirthday()

ilObjUser::setBirthday ( ?string  $a_birthday)

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

References IL_CAL_DATE.

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

3787  : void
3788  {
3789  if ($a_birthday && strlen($a_birthday)) {
3790  $date = new ilDate($a_birthday, IL_CAL_DATE);
3791  $this->birthday = $date->get(IL_CAL_DATE);
3792  } else {
3793  $this->birthday = null;
3794  }
3795  }
const IL_CAL_DATE
+ Here is the caller graph for this function:

◆ setCity()

ilObjUser::setCity ( string  $a_str)

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

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

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

◆ setClientIP()

ilObjUser::setClientIP ( string  $a_str)

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

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

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

◆ setComment()

ilObjUser::setComment ( string  $a_str)

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

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

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

◆ setCountry()

ilObjUser::setCountry ( string  $a_str)

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

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

1377  : void
1378  {
1379  $this->country = $a_str;
1380  }
+ Here is the caller graph for this function:

◆ setCurrentLanguage()

ilObjUser::setCurrentLanguage ( string  $a_val)

Set current language.

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

References ilSession\set().

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

1599  : void
1600  {
1601  ilSession::set('lang', $a_val);
1602  }
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 1337 of file class.ilObjUser.php.

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

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

◆ setEmail()

ilObjUser::setEmail ( string  $a_str)

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

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

1476  : void
1477  {
1478  $this->email = $a_str;
1479  }
+ Here is the caller graph for this function:

◆ setExternalAccount()

ilObjUser::setExternalAccount ( string  $a_str)

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

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

2653  : void
2654  {
2655  $this->ext_account = $a_str;
2656  }
+ Here is the caller graph for this function:

◆ setFax()

ilObjUser::setFax ( string  $a_str)

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

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

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

◆ setFirstLogin()

ilObjUser::setFirstLogin ( string  $a_str)

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

Referenced by assignData().

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

◆ setFirstname()

ilObjUser::setFirstname ( string  $a_str)

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

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

1307  : void
1308  {
1309  $this->firstname = $a_str;
1310  }
+ 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 1202 of file class.ilObjUser.php.

References $lastname.

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

1202  : void
1203  {
1204  $this->fullname = ($this->utitle != "")
1205  ? $this->utitle . " "
1206  : "";
1207  $this->fullname .= $this->firstname . " ";
1208  $this->fullname .= $this->lastname;
1209  }
string $lastname
+ Here is the caller graph for this function:

◆ setGender()

ilObjUser::setGender ( string  $a_str)

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

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

1282  : void
1283  {
1284  $this->gender = substr($a_str, -1);
1285  }
+ Here is the caller graph for this function:

◆ setGeneralInterests()

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

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

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

4068  : void
4069  {
4070  $this->interests_general = $value ?? [];
4071  }
+ Here is the caller graph for this function:

◆ setHobby()

ilObjUser::setHobby ( string  $a_str)

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

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

1496  : void
1497  {
1498  $this->hobby = $a_str;
1499  }
+ Here is the caller graph for this function:

◆ setInactivationDate()

ilObjUser::setInactivationDate ( ?string  $inactivation_date)

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

References $inactivation_date.

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

4015  : void
4016  {
4017  $this->inactivation_date = $inactivation_date;
4018  }
string $inactivation_date
+ Here is the caller graph for this function:

◆ setInstitution()

ilObjUser::setInstitution ( string  $a_str)

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

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

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

◆ setIsSelfRegistered()

ilObjUser::setIsSelfRegistered ( bool  $status)

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

Referenced by assignData().

4050  : void
4051  {
4052  $this->is_self_registered = $status;
4053  }
+ Here is the caller graph for this function:

◆ setLanguage()

ilObjUser::setLanguage ( string  $a_str)

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

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

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

1506  : void
1507  {
1508  $this->setPref("language", $a_str);
1509  ilSession::clear('lang');
1510  }
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 1604 of file class.ilObjUser.php.

Referenced by assignData().

1604  : void
1605  {
1606  $this->last_login = $a_str;
1607  }
+ Here is the caller graph for this function:

◆ setLastname()

ilObjUser::setLastname ( string  $a_str)

◆ setLastPasswordChangeToNow()

ilObjUser::setLastPasswordChangeToNow ( )

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

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

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

1900  : bool
1901  {
1902  global $DIC;
1903 
1904  $ilDB = $DIC['ilDB'];
1905 
1906  $this->setLastPasswordChangeTS(time());
1907 
1908  $query = "UPDATE usr_data SET last_password_change = %s " .
1909  "WHERE usr_id = %s";
1910  $affected = $ilDB->manipulateF(
1911  $query,
1912  ['integer','integer'],
1913  [$this->getLastPasswordChangeTS(),$this->id]
1914  );
1915  if ($affected) {
1916  return true;
1917  } else {
1918  return false;
1919  }
1920  }
global $DIC
Definition: feed.php:28
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 1517 of file class.ilObjUser.php.

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

1517  : void
1518  {
1519  $this->last_password_change_ts = $a_last_password_change_ts;
1520  }
+ Here is the caller graph for this function:

◆ setLastProfilePrompt()

ilObjUser::setLastProfilePrompt ( string  $a_str)

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

Referenced by assignData().

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

◆ setLastUpdate()

ilObjUser::setLastUpdate ( string  $a_str)

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

Referenced by assignData().

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

◆ setLatitude()

ilObjUser::setLatitude ( ?string  $a_latitude)

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

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

1940  : void
1941  {
1942  $this->latitude = $a_latitude;
1943  }
+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjUser::setLocationZoom ( ?int  $a_locationzoom)

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

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

1960  : void
1961  {
1962  $this->loc_zoom = $a_locationzoom;
1963  }
+ Here is the caller graph for this function:

◆ setLogin()

ilObjUser::setLogin ( string  $a_str)

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

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

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

1248  : void
1249  {
1250  $this->login = $a_str;
1251  }
+ 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 1804 of file class.ilObjUser.php.

Referenced by read().

1804  : void
1805  {
1806  $this->login_attempts = $a_login_attempts;
1807  }
+ Here is the caller graph for this function:

◆ setLongitude()

ilObjUser::setLongitude ( ?string  $a_longitude)

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

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

1950  : void
1951  {
1952  $this->longitude = $a_longitude;
1953  }
+ Here is the caller graph for this function:

◆ setLookingForHelp()

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

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

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

4116  : void
4117  {
4118  $this->interests_help_looking = $value ?? [];
4119  }
+ Here is the caller graph for this function:

◆ setMatriculation()

ilObjUser::setMatriculation ( string  $a_str)

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

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

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

◆ setOfferingHelp()

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

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

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

4092  : void
4093  {
4094  $this->interests_help_offered = $value ?? [];
4095  }
+ Here is the caller graph for this function:

◆ setPasswd()

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

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

Referenced by assignData(), shibUser\createFields(), ilUserPasswordManager\encodePassword(), and ilStartUpGUI\processIndexPHP().

1261  : void {
1262  $this->passwd = $a_str;
1263  $this->passwd_type = $a_type;
1264  }
+ Here is the caller graph for this function:

◆ setPasswordEncodingType()

ilObjUser::setPasswordEncodingType ( ?string  $password_encryption_type)

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

Referenced by assignData(), and ilUserPasswordManager\encodePassword().

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

◆ setPasswordPolicyResetStatus()

ilObjUser::setPasswordPolicyResetStatus ( bool  $status)

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

Referenced by read().

1532  : void
1533  {
1534  $this->passwd_policy_reset = $status;
1535  }
+ Here is the caller graph for this function:

◆ setPasswordSalt()

ilObjUser::setPasswordSalt ( ?string  $password_salt)

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

References $password_salt.

Referenced by assignData(), and ilUserPasswordManager\encodePassword().

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

◆ setPhoneHome()

ilObjUser::setPhoneHome ( string  $a_str)

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

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

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

◆ setPhoneMobile()

ilObjUser::setPhoneMobile ( string  $a_str)

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

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

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

◆ setPhoneOffice()

ilObjUser::setPhoneOffice ( string  $a_str)

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

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

1403  : void
1404  {
1405  $this->phone_office = $a_str;
1406  }
+ Here is the caller graph for this function:

◆ setPref()

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

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

Referenced by removeUserPicture(), assQuestionGUI\saveEdit(), ilUserPrivacySettingsGUI\savePrivacySettings(), ilProfileChecklistStatus\saveStepSucess(), ilPortfolioRepositoryGUI\setDefault(), setLanguage(), ilMembershipNotifications\toggleUser(), ilPortfolioRepositoryGUI\unsetDefault(), and writePref().

1050  : void
1051  {
1052  if ($a_keyword != "") {
1053  $this->prefs[$a_keyword] = $a_value;
1054  }
1055  }
+ Here is the caller graph for this function:

◆ setProfileIncomplete()

ilObjUser::setProfileIncomplete ( bool  $a_prof_inc)

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

Referenced by assignData().

1825  : void
1826  {
1827  $this->profile_incomplete = $a_prof_inc;
1828  }
+ Here is the caller graph for this function:

◆ setSecondEmail()

ilObjUser::setSecondEmail ( ?string  $second_email)

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

References $second_email.

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

1491  : void
1492  {
1493  $this->second_email = $second_email;
1494  }
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 1390 of file class.ilObjUser.php.

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

1390  : void
1391  {
1392  $this->sel_country = $a_val;
1393  }
+ Here is the caller graph for this function:

◆ setSkin()

ilObjUser::setSkin ( string  $a_str)

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

1749  : void
1750  {
1751  $this->skin = $a_str;
1752  }

◆ setStreet()

ilObjUser::setStreet ( string  $a_str)

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

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

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

◆ setTimeLimitFrom()

ilObjUser::setTimeLimitFrom ( ?int  $a_from)

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

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

1764  : void
1765  {
1766  $this->time_limit_from = $a_from;
1767  }
+ Here is the caller graph for this function:

◆ setTimeLimitMessage()

ilObjUser::setTimeLimitMessage ( string  $a_time_limit_message)

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

Referenced by assignData().

1794  : void
1795  {
1796  $this->time_limit_message = $a_time_limit_message;
1797  }
+ Here is the caller graph for this function:

◆ setTimeLimitOwner()

ilObjUser::setTimeLimitOwner ( int  $a_owner)

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

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

1754  : void
1755  {
1756  $this->time_limit_owner = $a_owner;
1757  }
+ Here is the caller graph for this function:

◆ setTimeLimitUnlimited()

ilObjUser::setTimeLimitUnlimited ( bool  $a_unlimited)

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

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

1784  : void
1785  {
1786  $this->time_limit_unlimited = $a_unlimited;
1787  }
+ Here is the caller graph for this function:

◆ setTimeLimitUntil()

ilObjUser::setTimeLimitUntil ( ?int  $a_until)

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

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

1774  : void
1775  {
1776  $this->time_limit_until = $a_until;
1777  }
+ Here is the caller graph for this function:

◆ setUserDefinedData()

ilObjUser::setUserDefinedData ( array  $a_data)

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

References $data.

Referenced by ilObjUserGUI\loadUserDefinedDataFromForm().

2991  : void // Missing array type.
2992  {
2993  foreach ($a_data as $field => $data) {
2994  $this->user_defined_data['f_' . $field] = $data;
2995  }
2996  }
+ 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 1297 of file class.ilObjUser.php.

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

1297  : void
1298  {
1299  $this->utitle = $a_str;
1300  }
+ Here is the caller graph for this function:

◆ setZipcode()

ilObjUser::setZipcode ( string  $a_str)

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

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

1367  : void
1368  {
1369  $this->zipcode = $a_str;
1370  }
+ 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 1723 of file class.ilObjUser.php.

References getStoredActive(), and setActive().

Referenced by update().

1723  : void
1724  {
1725  $storedActive = 0;
1726  if ($this->getStoredActive($this->id)) {
1727  $storedActive = 1;
1728  }
1729 
1730  $currentActive = 0;
1731  if ($this->active) {
1732  $currentActive = 1;
1733  }
1734 
1735  if ((!empty($storedActive) && empty($currentActive)) ||
1736  (empty($storedActive) && !empty($currentActive))) {
1737  $this->setActive($currentActive, self::getUserIdByLogin(self::getLoginFromAuth()));
1738  }
1739  }
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 2032 of file class.ilObjUser.php.

2032  : string
2033  {
2034  // Remove all characters including the last slash or the last backslash
2035  // in the username
2036  $pos = strrpos($a_login, '/');
2037  $pos2 = strrpos($a_login, '\\');
2038  if ($pos === false || $pos < $pos2) {
2039  $pos = $pos2;
2040  }
2041  if (is_int($pos)) {
2042  $a_login = substr($a_login, $pos + 1);
2043  }
2044  return $a_login;
2045  }

◆ update()

ilObjUser::update ( )

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

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

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

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

◆ updateLogin()

ilObjUser::updateLogin ( string  $a_login)

update login name

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

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

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

868  : bool
869  {
870  global $DIC;
871 
872  $ilDB = $this->db;
873  $ilSetting = $DIC['ilSetting'];
874  $lng = $DIC->language();
875 
876  if (func_num_args() != 1) {
877  return false;
878  }
879 
880  if (!isset($a_login)) {
881  return false;
882  }
883 
884  $former_login = self::_lookupLogin($this->getId());
885 
886  // Update not necessary
887  if (0 == strcmp($a_login, $former_login)) {
888  return false;
889  }
890 
891  try {
892  $last_history_entry = self::_getLastHistoryDataByUserId($this->getId());
893  } catch (ilUserException $e) {
894  $last_history_entry = null;
895  }
896 
897  // throw exception if the desired loginame is already in history and it is not allowed to reuse it
898  if ((int) $ilSetting->get('allow_change_loginname') &&
899  (int) $ilSetting->get('reuse_of_loginnames') == 0 &&
900  self::_doesLoginnameExistInHistory($a_login)) {
901  throw new ilUserException($lng->txt('loginname_already_exists'));
902  } elseif ((int) $ilSetting->get('allow_change_loginname') &&
903  (int) $ilSetting->get('loginname_change_blocking_time') &&
904  is_array($last_history_entry) &&
905  $last_history_entry[1] + (int) $ilSetting->get('loginname_change_blocking_time') > time()) {
906  throw new ilUserException(
907  sprintf(
908  $lng->txt('changing_loginname_not_possible_info'),
910  new ilDateTime($last_history_entry[1], IL_CAL_UNIX)
911  ),
913  new ilDateTime(($last_history_entry[1] + (int) $ilSetting->get('loginname_change_blocking_time')), IL_CAL_UNIX)
914  )
915  )
916  );
917  } else {
918  // log old loginname in history
919  if ((int) $ilSetting->get('allow_change_loginname') &&
920  (int) $ilSetting->get('create_history_loginname')) {
921  self::_writeHistory($this->getId(), $former_login);
922  }
923 
924  //update login
925  $this->login = $a_login;
926 
927  $ilDB->manipulateF(
928  '
929  UPDATE usr_data
930  SET login = %s
931  WHERE usr_id = %s',
932  ['text', 'integer'],
933  [$this->getLogin(), $this->getId()]
934  );
935  }
936 
937  return true;
938  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
const IL_CAL_UNIX
global $DIC
Definition: feed.php:28
ilLanguage $lng
ilDBInterface $db
global $ilSetting
Definition: privfeed.php:18
+ Here is the call graph for this function:

◆ updateMultiTextFields()

ilObjUser::updateMultiTextFields ( bool  $a_create = false)

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

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

Referenced by saveAsNew(), and update().

4185  : void
4186  {
4187  global $DIC;
4188 
4189  $ilDB = $DIC['ilDB'];
4190 
4191  if (!$this->getId()) {
4192  return;
4193  }
4194 
4195  if (!$a_create) {
4196  $this->deleteMultiTextFields();
4197  }
4198 
4199  $map = [
4200  "interests_general" => $this->getGeneralInterests(),
4201  "interests_help_offered" => $this->getOfferingHelp(),
4202  "interests_help_looking" => $this->getLookingForHelp()
4203  ];
4204 
4205  foreach ($map as $id => $values) {
4206  if (is_array($values) && count($values)) {
4207  foreach ($values as $value) {
4208  $value = trim($value);
4209  if ($value) {
4210  $uniq_id = $ilDB->nextId('usr_data_multi');
4211 
4212  $ilDB->manipulate("INSERT usr_data_multi" .
4213  " (id,usr_id,field_id,value) VALUES" .
4214  " (" . $ilDB->quote($uniq_id, "integer") .
4215  "," . $ilDB->quote($this->getId(), "integer") .
4216  "," . $ilDB->quote($id, "text") .
4217  "," . $ilDB->quote($value, "text") .
4218  ")");
4219  }
4220  }
4221  }
4222  }
4223  }
global $DIC
Definition: feed.php:28
$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 3003 of file class.ilObjUser.php.

References ilObject\getId().

Referenced by saveAsNew(), and update().

3003  : void
3004  {
3005  $udata = new ilUserDefinedData($this->getId());
3006  foreach ($this->user_defined_data as $field => $value) {
3007  if ($field !== 'usr_id' && $value !== null) {
3008  $udata->set($field, $value);
3009  }
3010  }
3011  $udata->update();
3012  }
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:

◆ userExists()

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

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

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

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

3932  : bool {
3933  global $DIC;
3934 
3935  $ilDB = $DIC['ilDB'];
3936 
3937  $query = 'SELECT count(*) num FROM object_data od ' .
3938  'JOIN usr_data ud ON obj_id = usr_id ' .
3939  'WHERE ' . $ilDB->in('obj_id', $a_usr_ids, false, 'integer') . ' ';
3940  $res = $ilDB->query($query);
3941  $num_rows = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)->num;
3942  return $num_rows == count($a_usr_ids);
3943  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ writeAccepted()

ilObjUser::writeAccepted ( )

write accept date of user agreement

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

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

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

◆ writePref()

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

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

References setPref().

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

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

◆ writePrefs()

ilObjUser::writePrefs ( )

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

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

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

Field Documentation

◆ $active

int ilObjUser::$active = 0

◆ $agree_date

string ilObjUser::$agree_date = null

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

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

◆ $approve_date

string ilObjUser::$approve_date = null

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

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

◆ $auth_mode

string ilObjUser::$auth_mode = null

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

Referenced by getAuthMode().

◆ $avatar_rid

string ilObjUser::$avatar_rid = null
protected

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

Referenced by getAvatarRid(), and setAvatarRid().

◆ $birthday

string ilObjUser::$birthday = null
protected

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

Referenced by getBirthday().

◆ $city

string ilObjUser::$city = ""

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

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

◆ $client_ip

string ilObjUser::$client_ip = ""

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

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

◆ $country

string ilObjUser::$country = ""

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

◆ $date_format_factory

DateFormatFactory ilObjUser::$date_format_factory
protected

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

◆ $department

string ilObjUser::$department = ""

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

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

◆ $email

string ilObjUser::$email = ""

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

Referenced by getEmail().

◆ $ext_account

string ilObjUser::$ext_account = ""
protected

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

Referenced by getExternalAccount().

◆ $fax

string ilObjUser::$fax = ""

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

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

◆ $first_login

string ilObjUser::$first_login = ""
protected

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

Referenced by getFirstLogin().

◆ $firstname

string ilObjUser::$firstname = ""

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

Referenced by getFirstname(), and saveAsNew().

◆ $fullname

string ilObjUser::$fullname = ""

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

Referenced by _lookupFullname().

◆ $gender

string ilObjUser::$gender = ""

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

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

◆ $hobby

string ilObjUser::$hobby = ""

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

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

◆ $inactivation_date

string ilObjUser::$inactivation_date = null
protected

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

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

◆ $institution

string ilObjUser::$institution = ""

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

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

◆ $interests_general

array ilObjUser::$interests_general = []
protected

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

Referenced by getGeneralInterests().

◆ $interests_help_looking

array ilObjUser::$interests_help_looking = []
protected

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

Referenced by getLookingForHelp().

◆ $interests_help_offered

array ilObjUser::$interests_help_offered = []
protected

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

Referenced by getOfferingHelp().

◆ $irss

Services ilObjUser::$irss
private

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

◆ $is_self_registered

bool ilObjUser::$is_self_registered = false
private

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

Referenced by isSelfRegistered().

◆ $last_login

string ilObjUser::$last_login = ""
protected

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

Referenced by getLastLogin().

◆ $last_password_change_ts

int ilObjUser::$last_password_change_ts = 0

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

Referenced by getLastPasswordChangeTS().

◆ $last_profile_prompt

string ilObjUser::$last_profile_prompt = ""
protected

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

Referenced by getLastProfilePrompt().

◆ $lastname

string ilObjUser::$lastname = ""

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

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

◆ $latitude

string ilObjUser::$latitude = null

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

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

◆ $loc_zoom

string ilObjUser::$loc_zoom = null

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

Referenced by getLocationZoom().

◆ $login

string ilObjUser::$login = ''

◆ $login_attempts

int ilObjUser::$login_attempts = 0

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

Referenced by getLoginAttempts().

◆ $longitude

string ilObjUser::$longitude = null

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

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

◆ $matriculation

string ilObjUser::$matriculation = ""

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

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

◆ $oldPrefs

array ilObjUser::$oldPrefs = []
protected

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

◆ $org_units

string ilObjUser::$org_units = ""
protected

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

◆ $passwd

string ilObjUser::$passwd = ""
protected

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

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

◆ $passwd_policy_reset

bool ilObjUser::$passwd_policy_reset = false
protected

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

Referenced by getPasswordPolicyResetStatus(), and saveAsNew().

◆ $passwd_type

string ilObjUser::$passwd_type = ""
protected

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

Referenced by getPasswdType().

◆ $password_encoding_type

string ilObjUser::$password_encoding_type = null
protected

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

Referenced by getPasswordEncodingType().

◆ $password_salt

string ilObjUser::$password_salt = null
protected

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

Referenced by getPasswordSalt(), and setPasswordSalt().

◆ $personal_image_cache

array ilObjUser::$personal_image_cache = []
staticprotected

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

◆ $phone_home

string ilObjUser::$phone_home = ""

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

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

◆ $phone_mobile

string ilObjUser::$phone_mobile = ""

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

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

◆ $phone_office

string ilObjUser::$phone_office = ""

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

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

◆ $prefs

array ilObjUser::$prefs = []

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

Referenced by _getPreferences(), and readPrefs().

◆ $profile_incomplete

bool ilObjUser::$profile_incomplete = false
protected

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

Referenced by getProfileIncomplete().

◆ $referral_comment

string ilObjUser::$referral_comment = ""

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

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

◆ $second_email

string ilObjUser::$second_email = null
protected

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

Referenced by getSecondEmail(), and setSecondEmail().

◆ $sel_country

string ilObjUser::$sel_country = ""

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

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

◆ $skin

string ilObjUser::$skin = ""

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

Referenced by __construct().

◆ $street

string ilObjUser::$street = ""

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

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

◆ $time_limit_from

int ilObjUser::$time_limit_from = null
protected

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

Referenced by getTimeLimitFrom().

◆ $time_limit_message

string ilObjUser::$time_limit_message = ""
protected

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

Referenced by getTimeLimitMessage().

◆ $time_limit_owner

int ilObjUser::$time_limit_owner = null
protected

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

◆ $time_limit_unlimited

bool ilObjUser::$time_limit_unlimited = false
protected

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

Referenced by getTimeLimitUnlimited().

◆ $time_limit_until

int ilObjUser::$time_limit_until = null
protected

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

Referenced by getTimeLimitUntil().

◆ $user_defined_data

array ilObjUser::$user_defined_data = []

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

◆ $utitle

string ilObjUser::$utitle = ""

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

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

◆ $zipcode

string ilObjUser::$zipcode = ""

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