ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjUser Class Reference
+ Inheritance diagram for ilObjUser:
+ Collaboration diagram for ilObjUser:

Public Member Functions

 __construct ($a_user_id=0, $a_call_by_reference=false)
 Constructor @access public. More...
 
 read ()
 loads a record "user" from database @access private More...
 
 getPasswordEncodingType ()
 
 setPasswordEncodingType ($password_encryption_type)
 
 getPasswordSalt ()
 
 setPasswordSalt ($password_salt)
 
 assignData ($a_data)
 loads a record "user" from array @access public More...
 
 writeAccepted ()
 write accept date of user agreement to db More...
 
 refreshLogin ()
 updates the login data of a "user" // TODO set date with now() should be enough @access public More...
 
 updateLogin ($a_login)
 update login name More...
 
 writePref ($a_keyword, $a_value)
 write userpref to user table @access private More...
 
 deletePref ($a_keyword)
 Deletes a userpref value of the user from the database @access public. More...
 
 writePrefs ()
 write all userprefs @access private More...
 
 getTimeZone ()
 get timezone of user More...
 
 getTimeFormat ()
 get time format More...
 
 getDateFormat ()
 get date format More...
 
 setPref ($a_keyword, $a_value)
 set a user preference More...
 
 getPref ($a_keyword)
 get a user preference More...
 
 readPrefs ()
 get all user preferences @access private More...
 
 delete ()
 deletes a user @access public More...
 
 setFullname ($a_title="", $a_firstname="", $a_lastname="")
 builds a string with title + firstname + lastname method is used to build fullname in member variable $this->fullname. More...
 
 getFullname ($a_max_strlen=0)
 get fullname @access public More...
 
 setLogin ($a_str)
 set login / username @access public More...
 
 getLogin ()
 get login / username @access public More...
 
 setPasswd ($a_str, $a_type=IL_PASSWD_PLAIN)
 set password @access public More...
 
 getPasswd ()
 get password More...
 
 getPasswdType ()
 get password type More...
 
 setGender ($a_str)
 set gender @access public More...
 
 getGender ()
 get gender @access public More...
 
 setUTitle ($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) @access public More...
 
 getUTitle ()
 get user title (note: don't mix up this method with getTitle() that is derived from ilObject and gets the user object's title) @access public More...
 
 setFirstname ($a_str)
 set firstname @access public More...
 
 getFirstname ()
 get firstname @access public More...
 
 setLastname ($a_str)
 set lastame @access public More...
 
 getLastname ()
 get lastname @access public More...
 
 setInstitution ($a_str)
 set institution @access public More...
 
 getInstitution ()
 get institution @access public More...
 
 setDepartment ($a_str)
 set department @access public More...
 
 getDepartment ()
 get department @access public More...
 
 setStreet ($a_str)
 set street @access public More...
 
 getStreet ()
 get street @access public More...
 
 setCity ($a_str)
 set city @access public More...
 
 getCity ()
 get city @access public More...
 
 setZipcode ($a_str)
 set zipcode @access public More...
 
 getZipcode ()
 get zipcode @access public More...
 
 setCountry ($a_str)
 Set country (free text) More...
 
 getCountry ()
 Get country (free text) More...
 
 setSelectedCountry ($a_val)
 Set selected country (selection drop down) More...
 
 getSelectedCountry ()
 Get selected country (selection drop down) More...
 
 setPhoneOffice ($a_str)
 set office phone @access public More...
 
 getPhoneOffice ()
 get office phone @access public More...
 
 setPhoneHome ($a_str)
 set home phone @access public More...
 
 getPhoneHome ()
 get home phone @access public More...
 
 setPhoneMobile ($a_str)
 set mobile phone @access public More...
 
 getPhoneMobile ()
 get mobile phone @access public More...
 
 setFax ($a_str)
 set fax @access public More...
 
 getFax ()
 get fax @access public More...
 
 setClientIP ($a_str)
 set client ip number @access public More...
 
 getClientIP ()
 get client ip number @access public More...
 
 setMatriculation ($a_str)
 set matriculation number @access public More...
 
 getMatriculation ()
 get matriculation number @access public More...
 
 setEmail ($a_str)
 set email @access public More...
 
 getEmail ()
 get email address @access public More...
 
 getSecondEmail ()
 
 setSecondEmail ($second_email)
 
 setHobby ($a_str)
 set hobby @access public More...
 
 getHobby ()
 get hobby @access public More...
 
 setLanguage ($a_str)
 set user language @access public More...
 
 getLanguage ()
 returns a 2char-language-string @access public More...
 
 setDiskQuota ($a_disk_quota)
 Sets the minimal disk quota imposed by this user account. More...
 
 getDiskQuota ()
 Returns the minimal disk quota imposed by this user account. More...
 
 getPersonalWorkspaceDiskQuota ()
 
 setLastPasswordChangeTS ($a_last_password_change_ts)
 
 getLastPasswordChangeTS ()
 
 getCurrentLanguage ()
 returns the current language (may differ from user's pref setting!) More...
 
 setCurrentLanguage ($a_val)
 Set current language. More...
 
 setLastLogin ($a_str)
 set user's last login @access public More...
 
 getLastLogin ()
 returns last login date @access public More...
 
 setFirstLogin ($a_str)
 set user's first login More...
 
 getFirstLogin ()
 returns first login date More...
 
 setLastProfilePrompt ($a_str)
 set user's last profile prompt More...
 
 getLastProfilePrompt ()
 returns user's last profile prompt More...
 
 setLastUpdate ($a_str)
 set last update of user data set @access public More...
 
 getLastUpdate ()
 
 setComment ($a_str)
 set referral comment @access public More...
 
 getComment ()
 get referral comment @access public More...
 
 setApproveDate ($a_str)
 set date the user account was activated null indicates that the user has not yet been activated @access public More...
 
 getApproveDate ()
 get the date when the user account was approved @access public More...
 
 getAgreeDate ()
 get the date when the user accepted the user agreement @access public More...
 
 setAgreeDate ($a_str)
 set date the user account was accepted by the user nullindicates that the user has not accepted his account @access public More...
 
 setActive ($a_active, $a_owner=0)
 set user active state and updates system fields appropriately @access public More...
 
 getActive ()
 get user active state @access public More...
 
 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 @access public More...
 
 getStoredActive ($a_id)
 get user active state More...
 
 setSkin ($a_str)
 set user skin (template set) @access public More...
 
 setTimeLimitOwner ($a_owner)
 
 getTimeLimitOwner ()
 
 setTimeLimitFrom ($a_from)
 
 getTimeLimitFrom ()
 
 setTimeLimitUntil ($a_until)
 
 getTimeLimitUntil ()
 
 setTimeLimitUnlimited ($a_unlimited)
 
 getTimeLimitUnlimited ()
 
 setTimeLimitMessage ($a_time_limit_message)
 
 getTimeLimitMessage ()
 
 setLoginAttempts ($a_login_attempts)
 
 getLoginAttempts ()
 
 checkTimeLimit ()
 
 setProfileIncomplete ($a_prof_inc)
 
 getProfileIncomplete ()
 
 isPasswordChangeDemanded ()
 
 isPasswordExpired ()
 
 getPasswordAge ()
 
 setLastPasswordChangeToNow ()
 
 resetLastPasswordChange ()
 
 setLatitude ($a_latitude)
 Set Latitude. More...
 
 getLatitude ()
 Get Latitude. More...
 
 setLongitude ($a_longitude)
 Set Longitude. More...
 
 getLongitude ()
 Get Longitude. More...
 
 setLocationZoom ($a_locationzoom)
 Set Location Zoom. More...
 
 getLocationZoom ()
 Get Location Zoom. More...
 
 checkUserId ()
 
 isCurrentUserActive ()
 
 getLoginByUserId ($a_userid)
 
 addDesktopItem ($a_item_id, $a_type, $a_par="")
 add an item to user's personal desktop More...
 
 setDesktopItemParameters ($a_item_id, $a_type, $a_par)
 set parameters of a desktop item entry More...
 
 dropDesktopItem ($a_item_id, $a_type)
 drop an item from user's personal desktop More...
 
 isDesktopItem ($a_item_id, $a_type)
 check wether an item is on the users desktop or not More...
 
 getDesktopItems ($a_types="")
 
 addObjectToClipboard ( $a_item_id, $a_type, $a_title, $a_parent=0, $a_time=0, $a_order_nr=0)
 add an item to user's personal clipboard More...
 
 addToPCClipboard ($a_content, $a_time, $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 ($a_type)
 Check whether clipboard has objects of a certain type. More...
 
 clipboardDeleteObjectsOfType ($a_type)
 Delete objects of type for user. More...
 
 clipboardDeleteAll ()
 Delete objects of type for user. More...
 
 getClipboardObjects ($a_type="", $a_top_nodes_only=false)
 get all clipboard objects of user and specified type More...
 
 getClipboardChilds ($a_parent, $a_insert_time)
 Get childs of an item. More...
 
 removeObjectFromClipboard ($a_item_id, $a_type)
 remove object from user's personal clipboard More...
 
 getOrgUnitsRepresentation ()
 
 setAuthMode ($a_str)
 set auth mode @access public More...
 
 getAuthMode ($a_auth_key=false)
 get auth mode @access public More...
 
 setExternalAccount ($a_str)
 set external account More...
 
 getExternalAccount ()
 get external account More...
 
 getPersonalPicturePath ($a_size="small", $a_force_pic=false)
 Get path to personal picture. More...
 
 removeUserPicture ($a_do_update=true)
 Remove user picture. More...
 
 setUserDefinedData ($a_data)
 
 getUserDefinedData ()
 
 updateUserDefinedFields ()
 
 readUserDefinedFields ()
 
 addUserDefinedFieldEntry ()
 
 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 ($a_birthday)
 
 getBirthday ()
 
 resetOwner ()
 
 isCaptchaVerified ()
 Is user captcha verified? More...
 
 setCaptchaVerified ($a_val)
 Set captcha verified. More...
 
 exportPersonalData ()
 Export personal data. More...
 
 getPersonalDataExportFile ()
 Get personal data export file. More...
 
 sendPersonalDataFile ()
 Send personal data file. More...
 
 importPersonalData ( $a_file, $a_profile_data, $a_settings, $a_bookmarks, $a_notes, $a_calendar)
 Import personal data. More...
 
 setInactivationDate ($inactivation_date)
 setter for inactivation date More...
 
 getInactivationDate ()
 getter for inactivation date More...
 
 hasToAcceptTermsOfService ()
 
 hasToAcceptTermsOfServiceInSession ($status=null)
 
 isAnonymous ()
 
 activateDeletionFlag ()
 
 removeDeletionFlag ()
 
 hasDeletionFlag ()
 
 setIsSelfRegistered ($status)
 
 isSelfRegistered ()
 
 setGeneralInterests (array $value=null)
 Set general interests. More...
 
 getGeneralInterests ()
 Get general interests. More...
 
 getGeneralInterestsAsText ()
 Get general interests as plain text. More...
 
 setOfferingHelp (array $value=null)
 Set help offering. More...
 
 getOfferingHelp ()
 Get help offering. More...
 
 getOfferingHelpAsText ()
 Get help offering as plain text. More...
 
 setLookingForHelp (array $value=null)
 Set help looking for. More...
 
 getLookingForHelp ()
 Get help looking for. More...
 
 getLookingForHelpAsText ()
 Get help looking for as plain text. More...
 
 updateMultiTextFields ($a_create=false)
 Write multi-text values to DB. More...
 
- Public Member Functions inherited from ilObject
 __construct ($a_id=0, $a_reference=true)
 Constructor @access public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ()
 read object data from db into object More...
 
 getId ()
 get object id @access public More...
 
 setId ($a_id)
 set object id @access public More...
 
 setRefId ($a_id)
 set reference id @access public More...
 
 getRefId ()
 get reference id @access public More...
 
 getType ()
 get object type @access public More...
 
 setType ($a_type)
 set object type @access public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title @access public More...
 
 getUntranslatedTitle ()
 get untranslated object title @access public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 setOfflineStatus ($a_status)
 Set offline status. More...
 
 getOfflineStatus ()
 Get offline status. More...
 
 supportsOfflineHandling ()
 Check whether object supports offline handling. More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date @access public More...
 
 getLastUpdateDate ()
 get last update date @access public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object 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 If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) @access public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static _lookupFullname ($a_user_id)
 Lookup Full Name. More...
 
static _lookupEmail ($a_user_id)
 Lookup email. More...
 
static _lookupSecondEmail ($a_user_id)
 Lookup second e-mail. More...
 
static _lookupGender ($a_user_id)
 Lookup gender. More...
 
static _lookupClientIP ($a_user_id)
 Lookup client ip. More...
 
static _lookupName ($a_user_id)
 lookup user name More...
 
static _lookupFields ($a_user_id)
 lookup fields (deprecated; use more specific methods instead) More...
 
static _lookupLogin ($a_user_id)
 lookup login More...
 
static _lookupExternalAccount ($a_user_id)
 lookup external account for login and authmethod More...
 
static _lookupId ($a_user_str)
 Lookup id by login. More...
 
static _lookupLastLogin ($a_user_id)
 lookup last login More...
 
static _lookupFirstLogin ($a_user_id)
 lookup first login More...
 
static _doesLoginnameExistInHistory ($a_login)
 Checks wether the passed loginname already exists in history. More...
 
static _getLastHistoryDataByUserId ($a_usr_id)
 Returns the last used loginname and the changedate of the passed user_id. More...
 
static _deleteAllPref ($a_user_id)
 Deletes a userpref value of the user from the database @access public. More...
 
static _writePref ($a_usr_id, $a_keyword, $a_value)
 
static _lookupPref ($a_usr_id, $a_keyword)
 
static lookupMatriculation ($a_usr_id)
 Lookup matriculation. More...
 
static _lookupLanguage ($a_usr_id)
 
static _writeExternalAccount ($a_usr_id, $a_ext_id)
 
static _writeAuthMode ($a_usr_id, $a_auth_mode)
 
static _lookupActive ($a_usr_id)
 Check user account active. More...
 
static hasActiveSession ($a_user_id, $a_session_id)
 Check for simultaneous login. More...
 
static toUsernameWithoutDomain ($a_login)
 Static function removes Microsoft domain name from username webdav related. More...
 
static getUserIdByLogin ($a_login)
 
static getUserIdsByEmail ($a_email)
 STATIC METHOD get all user_ids of an email address. More...
 
static getUserLoginsByEmail ($a_email)
 get all user login names of an email address More...
 
static searchUsers ($a_search_str, $active=1, $a_return_ids_only=false, $filter_settings=false)
 STATIC METHOD get the user_ids which correspond a search string. More...
 
static _readUsersProfileData ($a_user_ids)
 STATIC METHOD get user data of selected users. More...
 
static _getAllUserData ($a_fields=null, $active=-1)
 STATIC METHOD get all user data. More...
 
static _getNumberOfUsersForStyle ($a_skin, $a_style)
 skins and styles More...
 
static _getAllUserAssignedStyles ()
 skins and styles More...
 
static _moveUsersToStyle ($a_from_skin, $a_from_style, $a_to_skin, $a_to_style)
 skins and styles More...
 
static _addDesktopItem ($a_usr_id, $a_item_id, $a_type, $a_par="")
 add an item to user's personal desktop More...
 
static _dropDesktopItem ($a_usr_id, $a_item_id, $a_type)
 drop an item from user's personal desktop More...
 
static _removeItemFromDesktops ($a_id)
 removes object from all user's desktops @access public More...
 
static _isDesktopItem ($a_usr_id, $a_item_id, $a_type)
 check wether an item is on the users desktop or not More...
 
static preloadIsDesktopItem ($a_usr_id, $a_item_ids)
 Preload desktop item information. More...
 
static _lookupDesktopItems ($user_id, $a_types="")
 get all desktop items of user and specified type More...
 
static _getUsersForClipboadObject ($a_type, $a_id)
 get all users, that have a certain object within their clipboard More...
 
static _getImportedUserId ($i2_id)
 
static lookupOrgUnitsRepresentation ($a_usr_id)
 lokup org unit representation More...
 
static _getExternalAccountsByAuthMode ($a_auth_mode, $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 ($a_usr_ids, $a_status)
 Toggle active status of users. More...
 
static _lookupAuthMode ($a_usr_id)
 lookup auth mode More...
 
static _checkExternalAuthAccount ($a_auth, $a_account, $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 ($a_email)
 check whether external account and authentication method matches with a user More...
 
static _uploadPersonalPicture ($tmp_file, $obj_id)
 Create a personal picture image file from a temporary image file. More...
 
static copyProfilePicturesToDirectory ($a_user_id, $a_dir)
 Get profile picture direcotory. More...
 
static _lookupFeedHash ($a_user_id, $a_create=false)
 Lookup news feed hash for user. More...
 
static _getFeedPass ($a_user_id)
 Lookup news feed password for user. More...
 
static _setFeedPass ($a_user_id, $a_password)
 Set news feed password for user. More...
 
static _loginExists ($a_login, $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 @access public @access static More...
 
static _externalAccountExists ($a_external_account, $a_auth_mode)
 Check if an external account name already exists. More...
 
static _getUsersForRole ($role_id, $active=-1)
 return array of complete users which belong to a specific role More...
 
static _getUsersForFolder ($ref_id, $active)
 get users for a category or from system folder More...
 
static _getUsersForGroup ($a_mem_ids, $active=-1)
 return user data for group members More...
 
static _getUsersForIds ($a_mem_ids, $active=-1, $timelimitowner=-1)
 return user data for given user id More...
 
static _getUserData ($a_internalids)
 return user data for given user ids More...
 
static _getPreferences ($user_id)
 get preferences for user More...
 
static getUserSubsetByPreferenceValue ($a_user_ids, $a_keyword, $a_val)
 For a given set of user IDs return a subset that has a given user preference set. More...
 
static _resetLoginAttempts ($a_usr_id)
 
static _getLoginAttempts ($a_usr_id)
 
static _incrementLoginAttempts ($a_usr_id)
 
static _setUserInactive ($a_usr_id)
 
static _writeHistory ($a_usr_id, $a_login)
 
static _generateRegistrationHash ($a_usr_id)
 Generates a unique hashcode for activating a user profile after registration. More...
 
static _verifyRegistrationHash ($a_hash)
 Verifies a registration hash. More...
 
static _getUserIdsByInactivityPeriod ($period)
 get ids of all users that have been inactive for at least the given period More...
 
static _getUserIdsByInactivationPeriod ($period)
 get ids of all users that have been inactivated since at least the given period More...
 
static _updateLastLogin ($a_usr_id, $a_last_login=null)
 STATIC METHOD updates the last_login field of user with given id to given or current date. More...
 
static getFirstLettersOfLastnames ()
 Get first letters of all lastnames. More...
 
static userExists ($a_usr_ids=array())
 
static getUsersAgreed ($a_agreed=true, $a_users=null)
 Get users that have or have not agreed to the user agreement. More...
 
static _isAnonymous ($usr_id)
 
static findInterests ($a_term, $a_user_id=null, $a_field_id=null)
 
static getProfileStatusOfUsers ($a_user_ids)
 Get profile status. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
static _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static lookupOfflineStatus ($a_obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner ($a_id)
 lookup object owner More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
static _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
static _lookupObjId ($a_id)
 
static _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
static setDeletedDates ($a_ref_ids)
 Set deleted date. More...
 
static _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
static _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
static _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
static _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
static _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data@access public More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

 $login
 all user related data in single vars @access public More...
 
 $gender
 
 $utitle
 
 $firstname
 
 $lastname
 
 $fullname
 
 $institution
 
 $department
 
 $street
 
 $city
 
 $zipcode
 
 $country
 
 $sel_country
 
 $phone_office
 
 $phone_home
 
 $phone_mobile
 
 $fax
 
 $email
 
 $hobby
 
 $matriculation
 
 $referral_comment
 
 $approve_date = null
 
 $agree_date = null
 
 $active
 
 $client_ip
 
 $auth_mode
 
 $latitude
 
 $longitude
 
 $loc_zoom
 
 $last_password_change_ts
 
 $login_attempts
 
 $user_defined_data = array()
 
 $prefs
 
 $skin
 
 $default_role
 
 $ilias
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 

Static Public Attributes

static $is_desktop_item_loaded
 
static $is_desktop_item_cache
 

Protected Member Functions

 buildTextFromArray ($a_attr)
 Convert multi-text values to plain text. More...
 
 readMultiTextFields ()
 Fetch multi-text values from DB. More...
 
 deleteMultiTextFields ()
 Remove multi-text values from DB. More...
 

Protected Attributes

 $passwd
 
 $passwd_type
 
 $password_encoding_type
 
 $password_salt = null
 
 $birthday
 
 $second_email = null
 
 $inactivation_date = null
 
 $org_units
 
 $interests_general
 
 $interests_help_offered
 
 $interests_help_looking
 
 $last_profile_prompt
 
 $first_login
 
- Protected Attributes inherited from ilObject
 $objDefinition
 
 $db
 
 $log
 
 $error
 
 $tree
 
 $app_event_handler
 
 $rbacadmin
 
 $rbacreview
 

Static Protected Attributes

static $personal_image_cache = array()
 

Static Private Member Functions

static _lookup ($a_user_id, $a_field)
 Private function for lookup methods. More...
 
static getLoginFromAuth ()
 Gets the username from $ilAuth, and converts it into an ILIAS login name. More...
 
static initInactivationDate ($usrIds)
 @global type $ilDB More...
 
static resetInactivationDate ($usrIds)
 @global type $ilDB More...
 

Private Attributes

 $is_self_registered = false
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor @access public.

Parameters
integeruser_id

Reimplemented from ilObject.

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

186 {
187 global $DIC;
188
189 $ilias = $DIC['ilias'];
190 $ilDB = $DIC['ilDB'];
191
192 // init variables
193 $this->ilias = &$ilias;
194 $this->db = &$ilDB;
195
196 $this->type = "usr";
197 parent::__construct($a_user_id, $a_call_by_reference);
198 $this->auth_mode = "default";
199 $this->passwd_type = IL_PASSWD_PLAIN;
200
201 // for gender selection. don't change this
202 /*$this->gender = array(
203 'n' => "salutation_n",
204 'm' => "salutation_m",
205 'f' => "salutation_f"
206 );*/
207 if ($a_user_id > 0) {
208 $this->setId($a_user_id);
209 $this->read();
210 } else {
211 // TODO: all code in else-structure doesn't belongs in class user !!!
212 //load default data
213 $this->prefs = array();
214 //language
215 $this->prefs["language"] = $this->ilias->ini->readVariable("language", "default");
216
217 //skin and pda support
218 $this->skin = $this->ilias->ini->readVariable("layout", "skin");
219
220 $this->prefs["skin"] = $this->skin;
221 // $this->prefs["show_users_online"] = "y";
222
223 //style (css)
224 $this->prefs["style"] = $this->ilias->ini->readVariable("layout", "style");
225 }
226 }
const IL_PASSWD_PLAIN
read()
loads a record "user" from database @access private
setId($a_id)
set object id @access public
redirection script todo: (a better solution should control the processing via a xml file)
global $DIC
Definition: saml.php:7
global $ilDB

References $DIC, $ilDB, $ilias, $skin, IL_PASSWD_PLAIN, read(), and ilObject\setId().

+ Here is the call graph for this function:

Member Function Documentation

◆ _addDesktopItem()

static ilObjUser::_addDesktopItem (   $a_usr_id,
  $a_item_id,
  $a_type,
  $a_par = "" 
)
static

add an item to user's personal desktop

Parameters
int$a_usr_idid of user object
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 3139 of file class.ilObjUser.php.

3140 {
3141 global $DIC;
3142
3143 $ilDB = $DIC['ilDB'];
3144
3145 $item_set = $ilDB->queryF(
3146 "SELECT * FROM desktop_item WHERE " .
3147 "item_id = %s AND type = %s AND user_id = %s",
3148 array("integer", "text", "integer"),
3149 array($a_item_id, $a_type, $a_usr_id)
3150 );
3151
3152 // only insert if item is not already on desktop
3153 if (!$ilDB->fetchAssoc($item_set)) {
3154 $ilDB->manipulateF(
3155 "INSERT INTO desktop_item (item_id, type, user_id, parameters) VALUES " .
3156 " (%s,%s,%s,%s)",
3157 array("integer", "text", "integer", "text"),
3158 array($a_item_id,$a_type,$a_usr_id,$a_par)
3159 );
3160 }
3161
3162 include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
3164 }
static deletePDItemsCache($a_usr_id)
Delete cache (add remove desktop item)
$a_type
Definition: workflow.php:92

References $a_type, $DIC, $ilDB, and ilCalendarCategories\deletePDItemsCache().

Referenced by ilObjSurvey\addAppraisee(), addDesktopItem(), ilRbacAdmin\addDesktopItem(), ilParticipant\addDesktopItem(), ilParticipants\addDesktopItem(), ilSoapObjectAdministration\addDesktopItems(), ilObjSurvey\addRater(), ilDesktopItemGUI\addToDesktop(), ilAccountCode\applyRoleAssignments(), ilUserImportParser\assignToRole(), ilECSEnrolmentStatusCommandQueueHandler\doUpdate(), and ilObjSurvey\inviteUser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _checkExternalAuthAccount()

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

check whether external account and authentication method matches with a user

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

3910 {
3911 $db = $GLOBALS['DIC']->database();
3912 $settings = $GLOBALS['DIC']->settings();
3913
3914 // Check directly with auth_mode
3915 $r = $db->queryF(
3916 "SELECT * FROM usr_data WHERE " .
3917 " ext_account = %s AND auth_mode = %s",
3918 array("text", "text"),
3919 array($a_account, $a_auth)
3920 );
3921 if ($usr = $db->fetchAssoc($r)) {
3922 return $usr["login"];
3923 }
3924
3925 if (!$tryFallback) {
3926 return false;
3927 }
3928
3929 // For compatibility, check for login (no ext_account entry given)
3930 $res = $db->queryF(
3931 "SELECT login FROM usr_data " .
3932 "WHERE login = %s AND auth_mode = %s AND (ext_account IS NULL OR ext_account = '') ",
3933 array("text", "text"),
3934 array($a_account, $a_auth)
3935 );
3936 if ($usr = $db->fetchAssoc($res)) {
3937 return $usr['login'];
3938 }
3939
3940 // If auth_default == $a_auth => check for login
3941 if (ilAuthUtils::_getAuthModeName($settings->get('auth_mode')) == $a_auth) {
3942 $res = $db->queryF(
3943 "SELECT login FROM usr_data WHERE " .
3944 " ext_account = %s AND auth_mode = %s",
3945 array("text", "text"),
3946 array($a_account, "default")
3947 );
3948 if ($usr = $db->fetchAssoc($res)) {
3949 return $usr["login"];
3950 }
3951 // Search for login (no ext_account given)
3952 $res = $db->queryF(
3953 "SELECT login FROM usr_data " .
3954 "WHERE login = %s AND (ext_account IS NULL OR ext_account = '') AND auth_mode = %s",
3955 array("text", "text"),
3956 array($a_account, "default")
3957 );
3958 if ($usr = $db->fetchAssoc($res)) {
3959 return $usr["login"];
3960 }
3961 }
3962 return false;
3963 }
static _getAuthModeName($a_auth_key)
$r
Definition: example_031.php:79
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
foreach($_POST as $key=> $value) $res

References ilObject\$db, $GLOBALS, $r, $res, and ilAuthUtils\_getAuthModeName().

Referenced by ilSoapAuthentication\__checkAgreement(), ilSoapAuthenticationCAS\authenticate(), ilAuthProviderApache\doAuthentication(), ilAuthProviderCAS\doAuthentication(), ilAuthProviderRadius\doAuthentication(), ilLTIAppEventListener\doCronUpdate(), ilAuthContainerSOAP\fetchData(), ilAuthProviderLTI\findUserId(), ilAuthProviderSaml\handleSamlAuth(), ilAuthProviderSoap\handleSoapAuth(), ilAuthProviderOpenIdConnect\handleUpdate(), ilUserImportParser\importEndTag(), ilCASAuth\login(), ilAuthContainerCAS\loginObserver(), ilLDAPUserSynchronisation\readInternalAccount(), ilLDAPQuery\readUserData(), ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus(), ilObjUserTest\testAuthAndEmailMethods(), ilOpenIdConnectUserSync\updateUser(), and ilUserImportParser\verifyEndTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteAllPref()

static ilObjUser::_deleteAllPref (   $a_user_id)
static

Deletes a userpref value of the user from the database @access public.

Parameters
stringkeyword

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

1136 {
1137 global $DIC;
1138
1139 $ilDB = $DIC['ilDB'];
1140
1141 $ilDB->manipulateF(
1142 "DELETE FROM usr_pref WHERE usr_id = %s",
1143 array("integer"),
1144 array($a_user_id)
1145 );
1146 }

References $DIC, and $ilDB.

Referenced by delete(), and writePrefs().

+ Here is the caller graph for this function:

◆ _doesLoginnameExistInHistory()

static ilObjUser::_doesLoginnameExistInHistory (   $a_login)
static

Checks wether the passed loginname already exists in history.

@access public

Parameters
string$a_loginLoginname
Returns
boolean true or false

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

955 {
956 global $DIC;
957
958 $ilDB = $DIC['ilDB'];
959
960 $res = $ilDB->queryF(
961 '
962 SELECT * FROM loginname_history
963 WHERE login = %s',
964 array('text'),
965 array($a_login)
966 );
967
968 return $ilDB->fetchAssoc($res) ? true : false;
969 }

References $DIC, $ilDB, and $res.

Referenced by ilAccountRegistrationGUI\saveForm().

+ Here is the caller graph for this function:

◆ _dropDesktopItem()

static ilObjUser::_dropDesktopItem (   $a_usr_id,
  $a_item_id,
  $a_type 
)
static

drop an item from user's personal desktop

Parameters
int$a_usr_idid of user object
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 3210 of file class.ilObjUser.php.

3211 {
3212 global $DIC;
3213
3214 $ilDB = $DIC['ilDB'];
3215
3216 $ilDB->manipulateF(
3217 "DELETE FROM desktop_item WHERE " .
3218 " item_id = %s AND type = %s AND user_id = %s",
3219 array("integer", "text", "integer"),
3220 array($a_item_id, $a_type, $a_usr_id)
3221 );
3222
3223 include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
3225 }

References $a_type, $DIC, $ilDB, and ilCalendarCategories\deletePDItemsCache().

Referenced by ilPDSelectedItemsBlockGUI\confirmedRemove(), ilUserImportParser\detachFromRole(), ilObjSurvey\disinviteUser(), ilECSEnrolmentStatusCommandQueueHandler\doUpdate(), dropDesktopItem(), ilParticipant\dropDesktopItem(), ilParticipants\dropDesktopItem(), ilSoapObjectAdministration\removeDesktopItems(), and ilDesktopItemGUI\removeFromDesktop().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _externalAccountExists()

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

Check if an external account name already exists.

@access public

Parameters
stringexternal account
stringauth mode

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

4609 {
4610 global $DIC;
4611
4612 $ilDB = $DIC['ilDB'];
4613
4614 $res = $ilDB->queryF(
4615 "SELECT * FROM usr_data " .
4616 "WHERE ext_account = %s AND auth_mode = %s",
4617 array("text", "text"),
4618 array($a_external_account, $a_auth_mode)
4619 );
4620 return $ilDB->fetchAssoc($res) ? true :false;
4621 }

References $DIC, $ilDB, and $res.

Referenced by ilObjUserTest\testAuthAndEmailMethods().

+ Here is the caller graph for this function:

◆ _generateRegistrationHash()

static ilObjUser::_generateRegistrationHash (   $a_usr_id)
static

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

Parameters
integer$a_usr_iduser id of the current user
Returns
string generated hashcode

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

5084 {
5085 global $DIC;
5086
5087 $ilDB = $DIC['ilDB'];
5088
5089 do {
5090 $continue = false;
5091
5092 $random = new \ilRandom();
5093 $hashcode = substr(md5(uniqid($random->int(), true)), 0, 16);
5094
5095 $res = $ilDB->queryf(
5096 '
5097 SELECT COUNT(usr_id) cnt FROM usr_data
5098 WHERE reg_hash = %s',
5099 array('text'),
5100 array($hashcode)
5101 );
5102 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
5103 if ($row->cnt > 0) {
5104 $continue = true;
5105 }
5106 break;
5107 }
5108
5109 if ($continue) {
5110 continue;
5111 }
5112
5113 $ilDB->manipulateF(
5114 '
5115 UPDATE usr_data
5116 SET reg_hash = %s
5117 WHERE usr_id = %s',
5118 array('text', 'integer'),
5119 array($hashcode, (int) $a_usr_id)
5120 );
5121
5122 break;
5123 } while (true);
5124
5125 return $hashcode;
5126 }
$row

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

◆ _getAllUserAssignedStyles()

static ilObjUser::_getAllUserAssignedStyles ( )
static

skins and styles

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

3085 {
3086 global $DIC;
3087
3088 $ilDB = $DIC['ilDB'];
3089
3090 $q = "SELECT DISTINCT up1.value style, up2.value skin FROM usr_pref up1, usr_pref up2 " .
3091 " WHERE up1.keyword = " . $ilDB->quote("style", "text") .
3092 " AND up2.keyword = " . $ilDB->quote("skin", "text") .
3093 " AND up1.usr_id = up2.usr_id";
3094
3095 $sty_set = $ilDB->query($q);
3096
3097 $styles = array();
3098 while ($sty_rec = $ilDB->fetchAssoc($sty_set)) {
3099 $styles[] = $sty_rec["skin"] . ":" . $sty_rec["style"];
3100 }
3101
3102 return $styles;
3103 }

References $DIC, and $ilDB.

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

+ Here is the caller graph for this function:

◆ _getAllUserData()

static ilObjUser::_getAllUserData (   $a_fields = null,
  $active = -1 
)
static

STATIC METHOD get all user data.

Parameters
arraydesired columns
Returns
array of user data @access public

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

2961 {
2962 global $DIC;
2963
2964 $ilDB = $DIC['ilDB'];
2965
2966 $result_arr = array();
2967 $types = array();
2968 $values = array();
2969
2970 if ($a_fields !== null and is_array($a_fields)) {
2971 if (count($a_fields) == 0) {
2972 $select = "*";
2973 } else {
2974 if (($usr_id_field = array_search("usr_id", $a_fields)) !== false) {
2975 unset($a_fields[$usr_id_field]);
2976 }
2977
2978 $select = implode(",", $a_fields) . ",usr_data.usr_id";
2979 // online time
2980 if (in_array('online_time', $a_fields)) {
2981 $select .= ",ut_online.online_time ";
2982 }
2983 }
2984
2985 $q = "SELECT " . $select . " FROM usr_data ";
2986
2987 // Add online_time if desired
2988 // Need left join here to show users that never logged in
2989 if (in_array('online_time', $a_fields)) {
2990 $q .= "LEFT JOIN ut_online ON usr_data.usr_id = ut_online.usr_id ";
2991 }
2992
2993 switch ($active) {
2994 case 0:
2995 case 1:
2996 $q .= "WHERE active = " . $ilDB->quote($active, "integer");
2997 break;
2998 case 2:
2999 $q .= "WHERE time_limit_unlimited= " . $ilDB->quote(0, "integer");;
3000 break;
3001 case 3:
3002 $qtemp = $q . ", rbac_ua, object_data WHERE rbac_ua.rol_id = object_data.obj_id AND " .
3003 $ilDB->like("object_data.title", "text", "%crs%") . " AND usr_data.usr_id = rbac_ua.usr_id";
3004 $r = $ilDB->query($qtemp);
3005 $course_users = array();
3006 while ($row = $ilDB->fetchAssoc($r)) {
3007 array_push($course_users, $row["usr_id"]);
3008 }
3009 if (count($course_users)) {
3010 $q .= " WHERE " . $ilDB->in("usr_data.usr_id", $course_users, true, "integer") . " ";
3011 } else {
3012 return $result_arr;
3013 }
3014 break;
3015 case 4:
3016 $date = strftime("%Y-%m-%d %H:%I:%S", mktime(0, 0, 0, $_SESSION["user_filter_data"]["m"], $_SESSION["user_filter_data"]["d"], $_SESSION["user_filter_data"]["y"]));
3017 $q .= " AND last_login < " . $ilDB->quote($date, "timestamp");
3018 break;
3019 case 5:
3020 $ref_id = $_SESSION["user_filter_data"];
3021 if ($ref_id) {
3022 $q .= " LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id " .
3023 "WHERE obj_members.obj_id = (SELECT obj_id FROM object_reference " .
3024 "WHERE ref_id = " . $ilDB->quote($ref_id, "integer") . ") ";
3025 }
3026 break;
3027 case 6:
3028 global $DIC;
3029
3030 $rbacreview = $DIC['rbacreview'];
3031 $ref_id = $_SESSION["user_filter_data"];
3032 if ($ref_id) {
3033 $local_roles = $rbacreview->getRolesOfRoleFolder($ref_id, false);
3034 if (is_array($local_roles) && count($local_roles)) {
3035 $q .= " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE " .
3036 $ilDB->in("rbac_ua.rol_id", $local_roles, false, "integer") . " ";
3037 }
3038 }
3039 break;
3040 case 7:
3041 $rol_id = $_SESSION["user_filter_data"];
3042 if ($rol_id) {
3043 $q .= " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id = " .
3044 $ilDB->quote($rol_id, "integer");
3045 }
3046 break;
3047 }
3048 $r = $ilDB->query($q);
3049
3050 while ($row = $ilDB->fetchAssoc($r)) {
3051 $result_arr[] = $row;
3052 }
3053 }
3054
3055 return $result_arr;
3056 }
$_SESSION["AccountId"]
$values

References $_SESSION, $active, $DIC, $ilDB, $r, ilObject\$rbacreview, ilObject\$ref_id, $row, and $values.

Referenced by ilLocalUser\_getUserData(), and ilObjUserTest\testSearch().

+ Here is the caller graph for this function:

◆ _getExternalAccountsByAuthMode()

static ilObjUser::_getExternalAccountsByAuthMode (   $a_auth_mode,
  $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.

@access public

Parameters
stringauth_mode
boolalso get users with authentication method 'default'
Returns
array of external account names

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

3821 {
3822 global $DIC;
3823
3824 $ilDB = $DIC['ilDB'];
3825 $ilSetting = $DIC['ilSetting'];
3826
3827 include_once('./Services/Authentication/classes/class.ilAuthUtils.php');
3828 $q = "SELECT login,usr_id,ext_account,auth_mode FROM usr_data " .
3829 "WHERE auth_mode = %s";
3830 $types[] = "text";
3831 $values[] = $a_auth_mode;
3832 if ($a_read_auth_default and ilAuthUtils::_getAuthModeName($ilSetting->get('auth_mode', AUTH_LOCAL)) == $a_auth_mode) {
3833 $q .= " OR auth_mode = %s ";
3834 $types[] = "text";
3835 $values[] = 'default';
3836 }
3837
3838 $res = $ilDB->queryF($q, $types, $values);
3839 while ($row = $ilDB->fetchObject($res)) {
3840 if ($row->auth_mode == 'default') {
3841 $accounts[$row->usr_id] = $row->login;
3842 } else {
3843 $accounts[$row->usr_id] = $row->ext_account;
3844 }
3845 }
3846 return $accounts ? $accounts : array();
3847 }
const AUTH_LOCAL
global $ilSetting
Definition: privfeed.php:17

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getFeedPass()

static ilObjUser::_getFeedPass (   $a_user_id)
static

Lookup news feed password for user.

Parameters
integeruser_id
Returns
string feed_password md5-encoded, or false

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

4535 {
4536 global $DIC;
4537
4538 $ilDB = $DIC['ilDB'];
4539
4540 if ($a_user_id > 0) {
4541 return ilObjUser::_lookupPref($a_user_id, "priv_feed_pass");
4542 }
4543 return false;
4544 }
static _lookupPref($a_usr_id, $a_keyword)

References $DIC, $ilDB, and _lookupPref().

+ Here is the call graph for this function:

◆ _getImportedUserId()

static ilObjUser::_getImportedUserId (   $i2_id)
static

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

3726 {
3727 global $DIC;
3728
3729 $ilDB = $DIC['ilDB'];
3730
3731 $query = "SELECT obj_id FROM object_data WHERE import_id = " .
3732 $ilDB->quote($i2_id, "text");
3733
3734 $res = $ilDB->query($query);
3735 while ($row = $ilDB->fetchObject($res)) {
3736 $id = $row->obj_id;
3737 }
3738 return $id ? $id : 0;
3739 }
$query

References $DIC, ilObject\$id, $ilDB, $query, $res, and $row.

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

+ Here is the caller graph for this function:

◆ _getLastHistoryDataByUserId()

static ilObjUser::_getLastHistoryDataByUserId (   $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.

@access public

Parameters
string$a_usr_idA user id
Returns
array Associative array, first index is the loginname, second index a unix_timestamp
Exceptions
ilUserException

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

984 {
985 global $DIC;
986
987 $ilDB = $DIC['ilDB'];
988
989 $ilDB->setLimit(1, 0);
990 $res = $ilDB->queryF(
991 '
992 SELECT login, history_date FROM loginname_history
993 WHERE usr_id = %s ORDER BY history_date DESC',
994 array('integer'),
995 array($a_usr_id)
996 );
997 $row = $ilDB->fetchAssoc($res);
998 if (!is_array($row) || !count($row)) {
999 throw new ilUserException('');
1000 }
1001
1002 return array(
1003 $row['login'], $row['history_date']
1004 );
1005 }
Class for user related exception handling in ILIAS.

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

Referenced by updateLogin().

+ Here is the caller graph for this function:

◆ _getLocalAccountsForEmail()

static ilObjUser::_getLocalAccountsForEmail (   $a_email)
static

check whether external account and authentication method matches with a user

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

3990 {
3991 global $DIC;
3992
3993 $ilDB = $DIC['ilDB'];
3994 $ilSetting = $DIC['ilSetting'];
3995
3996 // default set to local (1)?
3997
3998 $q = "SELECT * FROM usr_data WHERE " .
3999 " email = %s AND (auth_mode = %s ";
4000 $types = array("text", "text");
4001 $values = array($a_email, "local");
4002
4003 if ($ilSetting->get("auth_mode") == 1) {
4004 $q .= " OR auth_mode = %s";
4005 $types[] = "text";
4006 $values[] = "default";
4007 }
4008
4009 $q .= ")";
4010
4011 $users = array();
4012 $usr_set = $ilDB->queryF($q, $types, $values);
4013 while ($usr_rec = $ilDB->fetchAssoc($usr_set)) {
4014 $users[$usr_rec["usr_id"]] = $usr_rec["login"];
4015 }
4016
4017 return $users;
4018 }
$users
Definition: authpage.php:44

References $DIC, $ilDB, $ilSetting, $users, and $values.

Referenced by ilObjUserTest\testAuthAndEmailMethods().

+ Here is the caller graph for this function:

◆ _getLoginAttempts()

static ilObjUser::_getLoginAttempts (   $a_usr_id)
static

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

4889 {
4890 global $DIC;
4891
4892 $ilDB = $DIC['ilDB'];
4893
4894 $query = "SELECT login_attempts FROM usr_data WHERE usr_id = %s";
4895 $result = $ilDB->queryF($query, array('integer'), array($a_usr_id));
4896 $record = $ilDB->fetchAssoc($result);
4897 $login_attempts = $record['login_attempts'];
4898
4899 return $login_attempts;
4900 }
$result

References $DIC, $ilDB, $login_attempts, $query, and $result.

Referenced by ilAuthFrontend\checkExceededLoginAttempts(), ilAuthBase\failedLoginObserver(), ilAuthFrontend\handleAuthenticationFail(), and ilObjUserTest\testAuthAndEmailMethods().

+ Here is the caller graph for this function:

◆ _getNumberOfUsersForStyle()

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

skins and styles

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

3062 {
3063 global $DIC;
3064
3065 $ilDB = $DIC['ilDB'];
3066
3067 $q = "SELECT count(*) as cnt FROM usr_pref up1, usr_pref up2 " .
3068 " WHERE up1.keyword= " . $ilDB->quote("style", "text") .
3069 " AND up1.value= " . $ilDB->quote($a_style, "text") .
3070 " AND up2.keyword= " . $ilDB->quote("skin", "text") .
3071 " AND up2.value= " . $ilDB->quote($a_skin, "text") .
3072 " AND up1.usr_id = up2.usr_id ";
3073
3074 $cnt_set = $ilDB->query($q);
3075
3076 $cnt_rec = $ilDB->fetchAssoc($cnt_set);
3077
3078 return $cnt_rec["cnt"];
3079 }

References $DIC, and $ilDB.

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

+ Here is the caller graph for this function:

◆ _getNumberOfUsersPerAuthMode()

static ilObjUser::_getNumberOfUsersPerAuthMode ( )
static

get number of users per auth mode

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

3969 {
3970 global $DIC;
3971
3972 $ilDB = $DIC['ilDB'];
3973
3974 $r = $ilDB->query("SELECT count(*) AS cnt, auth_mode FROM usr_data " .
3975 "GROUP BY auth_mode");
3976 $cnt_arr = array();
3977 while ($cnt = $ilDB->fetchAssoc($r)) {
3978 $cnt_arr[$cnt["auth_mode"]] = $cnt["cnt"];
3979 }
3980
3981 return $cnt_arr;
3982 }

References $DIC, $ilDB, and $r.

Referenced by ilObjAuthSettingsGUI\authSettingsObject(), and ilObjUserTest\testAuthAndEmailMethods().

+ Here is the caller graph for this function:

◆ _getPreferences()

static ilObjUser::_getPreferences (   $user_id)
static

get preferences for user

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

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

4823 {
4824 global $DIC;
4825
4826 $ilDB = $DIC['ilDB'];
4827
4828 $prefs = array();
4829
4830 $r = $ilDB->queryF(
4831 "SELECT * FROM usr_pref WHERE usr_id = %s",
4832 array("integer"),
4833 array($user_id)
4834 );
4835
4836 while ($row = $ilDB->fetchAssoc($r)) {
4837 $prefs[$row["keyword"]] = $row["value"];
4838 }
4839
4840 return $prefs;
4841 }

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

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

+ Here is the caller graph for this function:

◆ _getUserData()

static ilObjUser::_getUserData (   $a_internalids)
static

return user data for given user ids

Parameters
arrayof internal ids or numerics $a_internalids

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

4776 {
4777 global $DIC;
4778
4779 $ilDB = $DIC['ilDB'];
4780
4781 $ids = array();
4782 if (is_array($a_internalids)) {
4783 foreach ($a_internalids as $internalid) {
4784 if (is_numeric($internalid)) {
4785 $ids[] = $internalid;
4786 } else {
4787 $parsedid = ilUtil::__extractId($internalid, IL_INST_ID);
4788 if (is_numeric($parsedid) && $parsedid > 0) {
4789 $ids[] = $parsedid;
4790 }
4791 }
4792 }
4793 }
4794 if (count($ids) == 0) {
4795 $ids [] = -1;
4796 }
4797
4798 $query = "SELECT usr_data.*, usr_pref.value AS language
4799 FROM usr_data
4800 LEFT JOIN usr_pref
4801 ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
4802 WHERE " . $ilDB->in("usr_data.usr_id", $ids, false, "integer");
4803 $values[] = "language";
4804 $types[] = "text";
4805
4806 $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
4807
4808 $data = array();
4809 $result = $ilDB->queryF($query, $types, $values);
4810 while ($row = $ilDB->fetchAssoc($result)) {
4811 $data[] = $row;
4812 }
4813 return $data;
4814 }
static __extractId($ilias_id, $inst_id)
extract ref id from role title, e.g.
$data
Definition: bench.php:6

References $data, $DIC, $ilDB, $query, $result, $row, $values, and ilUtil\__extractId().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getUserIdsByInactivationPeriod()

static ilObjUser::_getUserIdsByInactivationPeriod (   $period)
static

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

Parameters
integer$period(in days)
Returns
array of user ids @access public

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

5231 {
5233 $field = 'inactivation_date';
5235
5236 if (!(int) $period) {
5237 throw new ilException('no valid period given');
5238 }
5239
5240 global $DIC;
5241
5242 $ilDB = $DIC['ilDB'];
5243
5244 $date = date('Y-m-d H:i:s', (time() - ((int) $period * 24 * 60 * 60)));
5245
5246 $query = "SELECT usr_id FROM usr_data WHERE $field < %s AND active = %s";
5247
5248 $res = $ilDB->queryF($query, array('timestamp', 'integer'), array($date, 0));
5249
5250 $ids = array();
5251 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
5252 $ids[] = $row->usr_id;
5253 }
5254
5255 return $ids;
5256 }
Base class for ILIAS Exception handling.

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

Referenced by ilCronDeleteInactivatedUserAccounts\run().

+ Here is the caller graph for this function:

◆ _getUserIdsByInactivityPeriod()

static ilObjUser::_getUserIdsByInactivityPeriod (   $period)
static

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

Parameters
integer$period(in days)
Returns
array of user ids @access public

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

5199 {
5200 if (!(int) $period) {
5201 throw new ilException('no valid period given');
5202 }
5203
5204 global $DIC;
5205
5206 $ilDB = $DIC['ilDB'];
5207
5208 $date = date('Y-m-d H:i:s', (time() - ((int) $period * 24 * 60 * 60)));
5209
5210 $query = "SELECT usr_id FROM usr_data WHERE last_login < %s OR (ISNULL(last_login) AND create_date < %s)";
5211
5212 $res = $ilDB->queryF($query, array('timestamp', 'timestamp'), array($date, $date));
5213
5214 $ids = array();
5215 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
5216 $ids[] = $row->usr_id;
5217 }
5218
5219 return $ids;
5220 }

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

◆ _getUsersForClipboadObject()

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

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

Parameters
string$a_typeobject type
string$a_typeobject type
Returns
array array of user IDs

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

3688 {
3689 global $DIC;
3690
3691 $ilDB = $DIC['ilDB'];
3692
3693 $q = "SELECT DISTINCT user_id FROM personal_clipboard WHERE " .
3694 "item_id = " . $ilDB->quote($a_id, "integer") . " AND " .
3695 "type = " . $ilDB->quote($a_type, "text");
3696 $user_set = $ilDB->query($q);
3697 $users = array();
3698 while ($user_rec = $ilDB->fetchAssoc($user_set)) {
3699 $users[] = $user_rec["user_id"];
3700 }
3701
3702 return $users;
3703 }

References $a_type, $DIC, $ilDB, and $users.

Referenced by ilObjMediaObject\lookupUsages(), and ilObjUserTest\testClipboard().

+ Here is the caller graph for this function:

◆ _getUsersForFolder()

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

get users for a category or from system folder

Parameters
$ref_idref id of object
$activecan be -1 (ignore), 1 = active, 0 = not active user

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

4675 {
4676 global $DIC;
4677
4678 $ilDB = $DIC['ilDB'];
4679 $data = array();
4680 $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 ";
4681 $types[] = "text";
4682 $values[] = "language";
4683
4684 if (is_numeric($active) && $active > -1) {
4685 $query .= " AND usr_data.active = %s";
4686 $values[] = $active;
4687 $types[] = "integer";
4688 }
4689
4690 if ($ref_id != USER_FOLDER_ID) {
4691 $query .= " AND usr_data.time_limit_owner = %s";
4692 $values[] = $ref_id;
4693 $types[] = "integer";
4694 }
4695
4696 $query .= " AND usr_data.usr_id != %s ";
4697 $values[] = ANONYMOUS_USER_ID;
4698 $types[] = "integer";
4699
4700 $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
4701
4702 $result = $ilDB->queryF($query, $types, $values);
4703 $data = array();
4704 while ($row = $ilDB->fetchAssoc($result)) {
4705 array_push($data, $row);
4706 }
4707
4708 return $data;
4709 }
const USER_FOLDER_ID
Class ilObjUserFolder.

References $active, $data, $DIC, $ilDB, $query, ilObject\$ref_id, $result, $row, $values, and USER_FOLDER_ID.

Referenced by ilSoapUserAdministration\getUsersForContainer().

+ Here is the caller graph for this function:

◆ _getUsersForGroup()

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

return user data for group members

Parameters
intarray of member ids
intactive can be -1 (ignore), 1 = active, 0 = not active user

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

4718 {
4719 return ilObjUser::_getUsersForIds($a_mem_ids, $active);
4720 }
static _getUsersForIds($a_mem_ids, $active=-1, $timelimitowner=-1)
return user data for given user id

References $active, and _getUsersForIds().

Referenced by ilSoapUserAdministration\getUsersForContainer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getUsersForIds()

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

return user data for given user id

Parameters
intarray of member ids
intactive can be -1 (ignore), 1 = active, 0 = not active user

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

4729 {
4730 global $DIC;
4731
4732 $rbacadmin = $DIC['rbacadmin'];
4733 $rbacreview = $DIC['rbacreview'];
4734 $ilDB = $DIC['ilDB'];
4735
4736 $query = "SELECT usr_data.*, usr_pref.value AS language
4737 FROM usr_data
4738 LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
4739 WHERE " . $ilDB->in("usr_data.usr_id", $a_mem_ids, false, "integer") . "
4740 AND usr_data.usr_id != %s";
4741 $values[] = "language";
4742 $types[] = "text";
4743 $values[] = ANONYMOUS_USER_ID;
4744 $types[] = "integer";
4745
4746 if (is_numeric($active) && $active > -1) {
4747 $query .= " AND active = %s";
4748 $values[] = $active;
4749 $types[] = "integer";
4750 }
4751
4752 if ($timelimitowner != USER_FOLDER_ID && $timelimitowner != -1) {
4753 $query .= " AND usr_data.time_limit_owner = %s";
4754 $values[] = $timelimitowner;
4755 $types[] = "integer";
4756 }
4757
4758 $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
4759
4760 $result = $ilDB->queryF($query, $types, $values);
4761 while ($row = $ilDB->fetchAssoc($result)) {
4762 $mem_arr[] = $row;
4763 }
4764
4765 return $mem_arr ? $mem_arr : array();
4766 }

References $active, $DIC, $ilDB, $query, ilObject\$rbacadmin, ilObject\$rbacreview, $result, $row, $values, and USER_FOLDER_ID.

Referenced by _getUsersForGroup(), and ilSoapUserAdministration\getUsersForContainer().

+ Here is the caller graph for this function:

◆ _getUsersForRole()

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

return array of complete users which belong to a specific role

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

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

4631 {
4632 global $DIC;
4633
4634 $ilDB = $DIC['ilDB'];
4635 $rbacreview = $DIC['rbacreview'];
4636 $data = array();
4637
4638 $ids = $rbacreview->assignedUsers($role_id);
4639
4640 if (count($ids) == 0) {
4641 $ids = array(-1);
4642 }
4643
4644 $query = "SELECT usr_data.*, usr_pref.value AS language
4645 FROM usr_data
4646 LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
4647 WHERE " . $ilDB->in("usr_data.usr_id", $ids, false, "integer");
4648 $values[] = "language";
4649 $types[] = "text";
4650
4651
4652 if (is_numeric($active) && $active > -1) {
4653 $query .= " AND usr_data.active = %s";
4654 $values[] = $active;
4655 $types[] = "integer";
4656 }
4657
4658 $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
4659
4660 $r = $ilDB->queryF($query, $types, $values);
4661 $data = array();
4662 while ($row = $ilDB->fetchAssoc($r)) {
4663 $data[] = $row;
4664 }
4665 return $data;
4666 }

References $active, $data, $DIC, $ilDB, $query, $r, ilObject\$rbacreview, $row, and $values.

Referenced by ilSoapUserAdministration\getUserForRole().

+ Here is the caller graph for this function:

◆ _incrementLoginAttempts()

static ilObjUser::_incrementLoginAttempts (   $a_usr_id)
static

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

4903 {
4904 global $DIC;
4905
4906 $ilDB = $DIC['ilDB'];
4907
4908 $query = "UPDATE usr_data SET login_attempts = (login_attempts + 1) WHERE usr_id = %s";
4909 $affected = $ilDB->manipulateF($query, array('integer'), array($a_usr_id));
4910
4911 if ($affected) {
4912 return true;
4913 } else {
4914 return false;
4915 }
4916 }

References $DIC, $ilDB, and $query.

Referenced by ilAuthBase\failedLoginObserver(), ilAuthFrontend\handleAuthenticationFail(), and ilObjUserTest\testAuthAndEmailMethods().

+ Here is the caller graph for this function:

◆ _isAnonymous()

static ilObjUser::_isAnonymous (   $usr_id)
static
Parameters
int$usr_id
Returns
bool

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

5641 {
5642 return $usr_id == ANONYMOUS_USER_ID;
5643 }

Referenced by ilContactUserActionProvider\collectActionsForTargetUser(), ilPublicUserProfileGUI\getEmbeddable(), ilBuddyList\getInstanceByUserId(), isAnonymous(), ilBuddyList\request(), and ilBuddySystemGUI\transitionAsyncCommand().

+ Here is the caller graph for this function:

◆ _isDesktopItem()

static ilObjUser::_isDesktopItem (   $a_usr_id,
  $a_item_id,
  $a_type 
)
static

check wether an item is on the users desktop or not

Parameters
int$a_usr_idid of user object
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 3283 of file class.ilObjUser.php.

3284 {
3285 global $DIC;
3286
3287 $ilDB = $DIC['ilDB'];
3288
3289 if (self::$is_desktop_item_loaded[$a_usr_id . ":" . $a_item_id]) {
3290 return self::$is_desktop_item_cache[$a_usr_id . ":" . $a_item_id . ":" . $a_type];
3291 }
3292 $item_set = $ilDB->queryF(
3293 "SELECT item_id FROM desktop_item WHERE " .
3294 "item_id = %s AND type = %s AND user_id = %s",
3295 array("integer", "text", "integer"),
3296 array($a_item_id, $a_type, $a_usr_id)
3297 );
3298
3299 if ($ilDB->fetchAssoc($item_set)) {
3300 return true;
3301 } else {
3302 return false;
3303 }
3304 }

References $a_type, $DIC, and $ilDB.

Referenced by ilParticipant\addDesktopItem(), ilParticipants\addDesktopItem(), ilParticipant\dropDesktopItem(), ilParticipants\dropDesktopItem(), and isDesktopItem().

+ Here is the caller graph for this function:

◆ _loginExists()

static ilObjUser::_loginExists (   $a_login,
  $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 @access public @access static

Parameters
stringlogin name
integeruser id of user to exclude (optional)
Returns
boolean

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

4574 {
4575 global $DIC;
4576
4577 $ilDB = $DIC['ilDB'];
4578
4579 $q = "SELECT DISTINCT login, usr_id FROM usr_data " .
4580 "WHERE login = %s";
4581 $types[] = "text";
4582 $values[] = $a_login;
4583
4584 if ($a_user_id != 0) {
4585 $q .= " AND usr_id != %s ";
4586 $types[] = "integer";
4587 $values[] = $a_user_id;
4588 }
4589
4590 $r = $ilDB->queryF($q, $types, $values);
4591
4592 if ($row = $ilDB->fetchAssoc($r)) {
4593 return $row['usr_id'];
4594 }
4595 return false;
4596 }

References $DIC, $ilDB, $r, $row, and $values.

Referenced by ilUserLoginInputGUI\checkInput(), ilServicesUserTasks\getValidLogin(), ilAuthProviderSaml\handleSamlAuth(), ilCalendarAppointmentGUI\loadNotificationRecipients(), ilAuthBase\loginObserver(), ilLuceneQueryParser\replaceOwnerCallback(), ilAccountRegistrationGUI\saveForm(), ilPersonalProfileGUI\savePersonalData(), ilConsultationHourAppointments\setManager(), and ilObjUserTest\testCreateSetLookupDelete().

+ Here is the caller graph for this function:

◆ _lookup()

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

Private function for lookup methods.

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

682 {
683 global $DIC;
684
685 $ilDB = $DIC['ilDB'];
686
687 $res = $ilDB->queryF(
688 "SELECT " . $a_field . " FROM usr_data WHERE usr_id = %s",
689 array("integer"),
690 array($a_user_id)
691 );
692
693 while ($set = $ilDB->fetchAssoc($res)) {
694 return $set[$a_field];
695 }
696 return false;
697 }

References $DIC, $ilDB, and $res.

Referenced by _lookupAuthMode(), _lookupClientIP(), _lookupEmail(), _lookupExternalAccount(), _lookupFirstLogin(), _lookupGender(), _lookupLastLogin(), _lookupLogin(), _lookupSecondEmail(), and getStoredActive().

+ Here is the caller graph for this function:

◆ _lookupActive()

static ilObjUser::_lookupActive (   $a_usr_id)
static

Check user account active.

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

2285 {
2286 global $DIC;
2287
2288 $ilDB = $DIC['ilDB'];
2289
2290 $query = 'SELECT usr_id FROM usr_data ' .
2291 'WHERE active = ' . $ilDB->quote(1, 'integer') . ' ' .
2292 'AND usr_id = ' . $ilDB->quote($a_usr_id, 'integer');
2293 $res = $ilDB->query($query);
2294 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
2295 return true;
2296 }
2297 return false;
2298 }

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

Referenced by ilCourseParticipantsTableGUI\fillRow(), ilGroupParticipantsTableGUI\fillRow(), ilLearningSequenceParticipantsTableGUI\fillRow(), and ilBuddySystemRelationsTableGUI\populate().

+ Here is the caller graph for this function:

◆ _lookupAuthMode()

static ilObjUser::_lookupAuthMode (   $a_usr_id)
static

lookup auth mode

@access public

Parameters
intusr_id

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

3899 {
3900 return (string) ilObjUser::_lookup($a_usr_id, "auth_mode");
3901 }
static _lookup($a_user_id, $a_field)
Private function for lookup methods.

References _lookup().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupClientIP()

static ilObjUser::_lookupClientIP (   $a_user_id)
static

Lookup client ip.

Parameters
intuser id
Returns
string client ip

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

761 {
762 return ilObjUser::_lookup($a_user_id, "client_ip");
763 }

References _lookup().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupDesktopItems()

static ilObjUser::_lookupDesktopItems (   $user_id,
  $a_types = "" 
)
static

get all desktop items of user and specified type

note: the implementation of this method is not good style (directly reading tables object_data and object_reference), must be revised someday...

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

3365 {
3366 global $DIC;
3367
3368 $ilUser = $DIC['ilUser'];
3369 $rbacsystem = $DIC['rbacsystem'];
3370 $tree = $DIC['tree'];
3371 $ilDB = $DIC['ilDB'];
3372
3373 if ($a_types == "") {
3374 $is_nested_set = ($tree->getTreeImplementation() instanceof ilNestedSetTree);
3375
3376 $item_set = $ilDB->queryF("SELECT obj.obj_id, obj.description, oref.ref_id, obj.title, obj.type " .
3377 " FROM desktop_item it, object_reference oref " .
3378 ", object_data obj" .
3379 " WHERE " .
3380 "it.item_id = oref.ref_id AND " .
3381 "oref.obj_id = obj.obj_id AND " .
3382 "it.user_id = %s", array("integer"), array($user_id));
3383 $items = $all_parent_path = array();
3384 while ($item_rec = $ilDB->fetchAssoc($item_set)) {
3385 if ($tree->isInTree($item_rec["ref_id"])
3386 && $item_rec["type"] != "rolf"
3387 && $item_rec["type"] != "itgr") { // due to bug 11508
3388 $parent_ref = $tree->getParentId($item_rec["ref_id"]);
3389
3390 if (!isset($all_parent_path[$parent_ref])) {
3391 // #15746
3392 //if($is_nested_set)
3393 //{
3394 // $par_left = $tree->getLeftValue($parent_ref);
3395 // $all_parent_path[$parent_ref] = sprintf("%010d", $par_left);
3396 //}
3397 //else
3398 //{
3399 if ($parent_ref > 0) { // workaround for #0023176
3400 $node = $tree->getNodeData($parent_ref);
3401 $all_parent_path[$parent_ref] = $node["title"];
3402 } else {
3403 $all_parent_path[$parent_ref] = "";
3404 }
3405 //}
3406 }
3407
3408 $parent_path = $all_parent_path[$parent_ref];
3409
3410 $title = ilObject::_lookupTitle($item_rec["obj_id"]);
3411 $desc = ilObject::_lookupDescription($item_rec["obj_id"]);
3412 $items[$parent_path . $title . $item_rec["ref_id"]] =
3413 array("ref_id" => $item_rec["ref_id"],
3414 "obj_id" => $item_rec["obj_id"],
3415 "type" => $item_rec["type"],
3416 "title" => $title,
3417 "description" => $desc,
3418 "parent_ref" => $parent_ref);
3419 }
3420 }
3421 ksort($items);
3422 } else {
3423 // due to bug 11508
3424 if (!is_array($a_types)) {
3425 $a_types = array($a_types);
3426 }
3427 $items = array();
3428 $foundsurveys = array();
3429 foreach ($a_types as $a_type) {
3430 if ($a_type == "itgr") {
3431 continue;
3432 }
3433 $item_set = $ilDB->queryF(
3434 "SELECT obj.obj_id, obj.description, oref.ref_id, obj.title FROM desktop_item it, object_reference oref " .
3435 ", object_data obj WHERE " .
3436 "it.item_id = oref.ref_id AND " .
3437 "oref.obj_id = obj.obj_id AND " .
3438 "it.type = %s AND " .
3439 "it.user_id = %s " .
3440 "ORDER BY title",
3441 array("text", "integer"),
3442 array($a_type, $user_id)
3443 );
3444
3445 while ($item_rec = $ilDB->fetchAssoc($item_set)) {
3446 $title = ilObject::_lookupTitle($item_rec["obj_id"]);
3447 $desc = ilObject::_lookupDescription($item_rec["obj_id"]);
3448 $items[$title . $a_type . $item_rec["ref_id"]] =
3449 array("ref_id" => $item_rec["ref_id"],
3450 "obj_id" => $item_rec["obj_id"], "type" => $a_type,
3451 "title" => $title, "description" => $desc);
3452 }
3453 }
3454 ksort($items);
3455 }
3456
3457 return $items;
3458 }
Base class for nested set path based trees.
static _lookupTitle($a_id)
lookup object title
static _lookupDescription($a_id)
lookup object description
$ilUser
Definition: imgupload.php:18

References $a_type, ilObject\$desc, $DIC, $ilDB, $ilUser, ilObject\$title, ilObject\$tree, ilObject\_lookupDescription(), and ilObject\_lookupTitle().

Referenced by ilNewsItem\_getNewsItemsOfUser(), ilNote\_getRelatedObjectsOfUser(), getDesktopItems(), and ilCalendarCategories\readSelectedItemCalendars().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupEmail()

static ilObjUser::_lookupEmail (   $a_user_id)
static

Lookup email.

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

732 {
733 return ilObjUser::_lookup($a_user_id, "email");
734 }

References _lookup().

Referenced by ilObjSurvey\getAppraiseesData(), ilSystemSupportContactsGUI\getFooterLink(), ilSystemSupportContacts\getMailToAddress(), ilObjSurvey\getRatersData(), ilBadgeHandler\sendNotification(), ilMailSearchGUI\showResults(), and ilObjUserTest\testCreateSetLookupDelete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupExternalAccount()

static ilObjUser::_lookupExternalAccount (   $a_user_id)
static

lookup external account for login and authmethod

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

820 {
821 return ilObjUser::_lookup($a_user_id, "ext_account");
822 }

References _lookup().

Referenced by ilLTIAppEventListener\handleOutcomeWithoutLP(), ilLTIAppEventListener\handleUpdateStatus(), ilUserImportParser\importEndTag(), ilObjUserTest\testCreateSetLookupDelete(), and ilUserImportParser\verifyEndTag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupFeedHash()

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

Lookup news feed hash for user.

If hash does not exist, create one.

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

4498 {
4499 global $DIC;
4500
4501 $ilDB = $DIC['ilDB'];
4502
4503 if ($a_user_id > 0) {
4504 $set = $ilDB->queryF(
4505 "SELECT feed_hash from usr_data WHERE usr_id = %s",
4506 array("integer"),
4507 array($a_user_id)
4508 );
4509 if ($rec = $ilDB->fetchAssoc($set)) {
4510 if (strlen($rec["feed_hash"]) == 32) {
4511 return $rec["feed_hash"];
4512 } elseif ($a_create) {
4513 $random = new \ilRandom();
4514 $hash = md5($random->int(1, 9999999) + str_replace(" ", "", (string) microtime()));
4515 $ilDB->manipulateF(
4516 "UPDATE usr_data SET feed_hash = %s" .
4517 " WHERE usr_id = %s",
4518 array("text", "integer"),
4519 array($hash, $a_user_id)
4520 );
4521 return $hash;
4522 }
4523 }
4524 }
4525
4526 return false;
4527 }

References $DIC, and $ilDB.

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

+ Here is the caller graph for this function:

◆ _lookupFields()

static ilObjUser::_lookupFields (   $a_user_id)
static

lookup fields (deprecated; use more specific methods instead)

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

794 {
795 global $DIC;
796
797 $ilDB = $DIC['ilDB'];
798
799 $res = $ilDB->queryF(
800 "SELECT * FROM usr_data WHERE usr_id = %s",
801 array("integer"),
802 array($a_user_id)
803 );
804 $user_rec = $ilDB->fetchAssoc($res);
805 return $user_rec;
806 }

References $DIC, $ilDB, and $res.

Referenced by ilTestExport\exportToCSV(), ilTestExport\exportToExcel(), ilSpecialUsersTableGUI\fillRow(), ilCourseCertificateAdapter\getCertificateVariablesForPresentation(), ilExerciseCertificateAdapter\getCertificateVariablesForPresentation(), ilTestCertificateAdapter\getCertificateVariablesForPresentation(), ilCertificateUserObjectHelper\lookupFields(), ilTestEvaluationGUI\outEvaluation(), and ilObjUserTest\testCreateSetLookupDelete().

+ Here is the caller graph for this function:

◆ _lookupFirstLogin()

static ilObjUser::_lookupFirstLogin (   $a_user_id)
static

lookup first login

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

866 {
867 return ilObjUser::_lookup($a_user_id, "first_login");
868 }

References _lookup().

Referenced by ilFirstLoginLearningHistoryProvider\getEntries().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupFullname()

static ilObjUser::_lookupFullname (   $a_user_id)
static

Lookup Full Name.

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

703 {
704 global $DIC;
705
706 $ilDB = $DIC['ilDB'];
707
708 $set = $ilDB->queryF(
709 "SELECT title, firstname, lastname FROM usr_data WHERE usr_id = %s",
710 array("integer"),
711 array($a_user_id)
712 );
713
714 if ($rec = $ilDB->fetchAssoc($set)) {
715 if ($rec["title"]) {
716 $fullname = $rec["title"] . " ";
717 }
718 if ($rec["firstname"]) {
719 $fullname .= $rec["firstname"] . " ";
720 }
721 if ($rec["lastname"]) {
722 $fullname .= $rec["lastname"];
723 }
724 }
725 return $fullname;
726 }

References $DIC, $fullname, and $ilDB.

Referenced by ilExAssignmentTeam\addTeamMember(), ilCalendarAppointmentGUI\book(), ilObjBookingPoolGUI\bookMultipleParticipantsObject(), ilObjStudyProgrammeIndividualPlanGUI\buildFrame(), ilCalendarAppointmentGUI\cancelBooking(), ilAppointmentPresentationConsultationHoursGUI\collectPropertiesAndActions(), ilExAssignmentTeam\createTeam(), ilRbacLogTableGUI\fillRow(), ilLPTableBaseGUI\getExportMeta(), ilCalendarAppointmentPanelGUI\getHTML(), ilCalendarBlockGUI\getHTML(), ilExAssignmentTeamLogTableGUI\getItems(), ilConsultationHourAppointments\getManager(), ilExAssignmentTeam\getTeamId(), ilSCORMTrackingItemPerUserTableGUI\initTable(), ilSCORMTrackingItemsPerUserTableGUI\initTable(), ilBookingEntry\lookupManagedBookingsForObject(), ilSCORMTrackingItemsScoTableGUI\parse(), ilConsultationHoursTableGUI\parse(), ilCalendarPresentationGUI\prepareOutput(), ilCalendarCategories\readConsultationHoursCalendar(), ilExAssignmentTeam\removeTeamMember(), ilIndividualAssessmentMembersGUI\removeUserConfirmation(), ilCalendarMailNotification\send(), ilConsultationHoursGUI\sendInfoAboutUnassignedUsers(), ilWikiUtil\sendNotification(), ilNote\sendNotifications(), and ilObjSurvey\sendTutorNotification().

+ Here is the caller graph for this function:

◆ _lookupGender()

static ilObjUser::_lookupGender (   $a_user_id)
static

Lookup gender.

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

750 {
751 return ilObjUser::_lookup($a_user_id, "gender");
752 }

References _lookup().

Referenced by ilMail\getSalutation(), and ilObjUserTest\testCreateSetLookupDelete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupId()

static ilObjUser::_lookupId (   $a_user_str)
static

Lookup id by login.

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

828 {
829 global $DIC;
830
831 $ilDB = $DIC['ilDB'];
832
833 if (!is_array($a_user_str)) {
834 $res = $ilDB->queryF(
835 "SELECT usr_id FROM usr_data WHERE login = %s",
836 array("text"),
837 array($a_user_str)
838 );
839 $user_rec = $ilDB->fetchAssoc($res);
840 return $user_rec["usr_id"];
841 } else {
842 $set = $ilDB->query(
843 "SELECT usr_id FROM usr_data " .
844 " WHERE " . $ilDB->in("login", $a_user_str, false, "text")
845 );
846 $ids = array();
847 while ($rec = $ilDB->fetchAssoc($set)) {
848 $ids[] = $rec["usr_id"];
849 }
850 return $ids;
851 }
852 }

References $DIC, $ilDB, and $res.

Referenced by ilDiskQuotaSummaryNotification\__construct(), ilObjUserGUI\_goto(), ilSurveyEvaluationGUI\addApprSelectionToToolbar(), ilOrgUnitStaffGUI\addOtherRoles(), ilOrgUnitUserAssignmentGUI\addStaff(), ilOrgUnitStaffGUI\addStaff(), ilObjBlogGUI\addUserFromAutoComplete(), ilRepositorySearchGUI\addUserFromAutoComplete(), ilBookingParticipantGUI\addUserFromAutoCompleteObject(), ilExerciseManagementGUI\addUserFromAutoCompleteObject(), ilExSubmissionTeamGUI\addUserFromAutoCompleteObject(), ilSkillProfileGUI\assignUser(), ilOrgUnitSimpleUserImport\buildUserId(), ilChatroomInviteUsersToPrivateRoomGUI\byLogin(), ilPermission2GUI\changeOwner(), checkUserId(), ilAuthProviderApache\doAuthentication(), ilAuthProviderShibboleth\doAuthentication(), ilAuthProviderCAS\doAuthentication(), ilAuthProviderRadius\doAuthentication(), ilLTIAppEventListener\doCronUpdate(), ilServicesAuthenticationExtractor\extractAfterLogin(), ilAuthBase\failedLoginObserver(), ilAuthProviderLTI\findUserId(), ilMail\formatNamesForOutput(), ilObjectPermissionStatusGUI\getUser(), getUserIdByLogin(), ilSystemSupportContacts\getValidSupportContactIds(), ilDclStandardField\getValueFromExcel(), ilAuthFrontend\handleAuthenticationFail(), ilAuthProviderCAS\handleLDAPDataSource(), ilAuthProviderApache\handleLDAPDataSource(), ilAuthProviderECS\handleLogin(), ilSessionControl\handleLoginEvent(), ilAuthProviderSaml\handleSamlAuth(), ilAuthProviderSoap\handleSoapAuth(), ilAuthProviderSaml\importUser(), ilPCParagraph\intLinks2xml(), ilChatroom\inviteUserToPrivateRoomByLogin(), ilAuthContainerECS\loginObserver(), ilSoapRBACAdministration\parseUserID(), ilStartUpGUI\processCode(), ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus(), ilDclRecordEditGUI\save(), ilObjSurveyGUI\savePropertiesObject(), ilSingleUserShareGUI\saveShare(), ilDiskQuotaSummaryNotification\send(), ilNote\sendNotifications(), ilRegistrationSettings\setApproveRecipientLogins(), ilOpenIdConnectUserSync\setInternalAccount(), ilSystemSupportContacts\setList(), ilObjDiskQuotaSettings\setSummaryRecipients(), ilObjUserTest\testCreateSetLookupDelete(), ilAuthProviderLDAP\updateAccount(), ilLDAPAttributeToUser\usersToXML(), ilRegistrationSettings\validate(), ilMailOnlyExternalAddressList\value(), and ilUserImportParser\verifyEndTag().

+ Here is the caller graph for this function:

◆ _lookupLanguage()

static ilObjUser::_lookupLanguage (   $a_usr_id)
static

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

2053 {
2054 global $DIC;
2055
2056 $ilDB = $DIC->database();
2057 $lng = $DIC->language();
2058
2059 $q = "SELECT value FROM usr_pref WHERE usr_id= " .
2060 $ilDB->quote($a_usr_id, "integer") . " AND keyword = " .
2061 $ilDB->quote('language', "text");
2062 $r = $ilDB->query($q);
2063
2064 while ($row = $ilDB->fetchAssoc($r)) {
2065 return $row['value'];
2066 }
2067 if (is_object($lng)) {
2068 return $lng->getDefaultLanguage();
2069 }
2070 return 'en';
2071 }

References $DIC, $ilDB, ilObject\$lng, $r, and $row.

Referenced by ilForum\_getLanguageInstanceByUsrId(), ilLanguageFactory\_getLanguageOfUser(), and ilObjUserTest\testCreateSetLookupDelete().

+ Here is the caller graph for this function:

◆ _lookupLastLogin()

static ilObjUser::_lookupLastLogin (   $a_user_id)
static

lookup last login

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

858 {
859 return ilObjUser::_lookup($a_user_id, "last_login");
860 }

References _lookup().

Referenced by ilCronDeleteInactiveUserReminderMail\removeEntriesFromTableIfLastLoginIsNewer(), and ilObjUserTest\testCreateSetLookupDelete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupLogin()

static ilObjUser::_lookupLogin (   $a_user_id)
static

lookup login

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

812 {
813 return ilObjUser::_lookup($a_user_id, "login");
814 }

References _lookup().

Referenced by ilCourseXMLParser\__parseId(), ilRegistrationSettings\__read(), ilChatUserActionProvider\collectActionsForTargetUser(), ilWorkspaceUserActionProvider\collectActionsForTargetUser(), ilObjRole\delete(), ilStartUpGUI\doStandardAuthentication(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilStudyProgrammeIndividualPlanTableGUI\fetchData(), ilDclBaseRecordModel\fillRecordFieldExcelExport(), ilMilestoneResponsiblesTableGUI\fillRow(), ilPageHistoryTableGUI\fillRow(), ilPDNewsTableGUI\fillRow(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), ilAttendanceList\getHTML(), ilWebDAVUtil\getLogin(), getLoginByUserId(), getLoginFromAuth(), ilConsultationHourAppointments\getManagedUsers(), ilConsultationHourAppointments\getManager(), ilNoteGUI\getNoteListHTML(), ilTestServiceGUI\getResultsHeadUserAndPass(), ilObjSurvey\getUserDataFromActiveId(), ilForumSettingsGUI\getUserNotificationTableData(), ilInternalLinkGUI\getUserSearchResult(), ilUserClipboard\getValidatedContent(), ilObjUserGUI\getValues(), ilAuthFrontend\handleAuthenticationSuccess(), ilCalendarAppointmentGUI\initForm(), ilMailSearchCoursesGUI\mailMembers(), ilMailSearchGroupsGUI\mailMembers(), ilContactGUI\mailToUsers(), ilPermission2GUI\owner(), ilCalendarSharedUserListTableGUI\parse(), ilUserClipboardTableGUI\parse(), ilObjCourseGUI\readMemberData(), ilObjGroupGUI\readMemberData(), ilLearningSequenceRoles\readMemberData(), ilCalendarEntry\readResponsibleUsers(), ilExerciseManagementGUI\redirectFeedbackMailObject(), ilBuddyList\request(), ilObjSurvey\send360ReminderToUser(), ilObjSurvey\sendAppraiseeCloseNotification(), ilObjSurvey\sendAppraiseeNotification(), ilTimingsCronReminder\sendExceededMail(), ilTimingsCronReminder\sendFreshlyStartedMail(), ilSkillNotifications\sendMail(), ilMembershipCronNotifications\sendMail(), ilMailNotification\sendMail(), ilLPTableBaseGUI\sendMail(), ilObjContentObjectGUI\sendMailToBlockedUsers(), ilMailMemberSearchGUI\sendMailToSelectedUsers(), ilMembershipGUI\sendMailToSelectedUsers(), ilMembershipMailGUI\sendMailToSelectedUsers(), ilMembershipCronMinMembers\sendMessage(), ilWikiUtil\sendNotification(), ilNote\sendNotifications(), ilObjSurvey\sendRaterNotification(), ilObjSurvey\sendTutorNotification(), ilMailSearchCoursesGUI\showMembers(), ilMailSearchGUI\showResults(), ilMailFolderGUI\showUser(), ilContactGUI\submitInvitation(), ilObjUserTest\testCreateSetLookupDelete(), ilBuddySystemGUI\transitionAsyncCommand(), ilBuddySystemGUI\transitionCommand(), updateLogin(), ilUserImportParser\verifyEndTag(), and ilPCParagraph\xml2output().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupName()

static ilObjUser::_lookupName (   $a_user_id)
static

lookup user name

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

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

772 {
773 global $DIC;
774
775 $ilDB = $DIC['ilDB'];
776
777 $res = $ilDB->queryF(
778 "SELECT firstname, lastname, title, login FROM usr_data WHERE usr_id = %s",
779 array("integer"),
780 array($a_user_id)
781 );
782 $user_rec = $ilDB->fetchAssoc($res);
783 return array("user_id" => $a_user_id,
784 "firstname" => $user_rec["firstname"],
785 "lastname" => $user_rec["lastname"],
786 "title" => $user_rec["title"],
787 "login" => $user_rec["login"]);
788 }

References $DIC, $ilDB, and $res.

Referenced by ilExGradesTableGUI\__construct(), ilBookingAssignObjectsTableGUI\__construct(), ilGroupXMLParser\__parseId(), ilObjTestAccess\_getParticipantData(), ilSoapLearningProgressAdministration\addUserProgress(), ilTimingsCronReminder\buildMailSalutation(), ilMailUserActionProvider\collectActionsForTargetUser(), ilExerciseManagementCollectFilesJob\collectAssignmentData(), ilMembershipGUI\confirmAssignFromWaitingList(), ilMembershipGUI\confirmAssignSubscribers(), ilSessionMembershipGUI\confirmDeleteParticipants(), ilMembershipGUI\confirmDeleteParticipants(), ilMembershipGUI\confirmRefuseFromList(), ilMembershipGUI\confirmRefuseSubscribers(), ilOrgUnitStaffGUI\confirmRemoveUser(), ilSkillProfileGUI\confirmUserRemoval(), ilLocalUserGUI\deleteUsers(), ilObjCategoryGUI\deleteUsersObject(), ilBlogExerciseGUI\downloadExcSubFile(), ilPortfolioExerciseGUI\downloadExcSubFile(), ilWikiPageGUI\downloadExcSubFile(), ilExSubmission\downloadFiles(), ilExSubmission\downloadMultipleFiles(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilObjExercise\exportGradesExcel(), ilObjAssessmentFolderGUI\exportLogObject(), ilDclBaseRecordModel\fillRecordFieldExcelExport(), ilFileVersionsTableGUI\fillRow(), ilRbacLogTableGUI\fillRow(), ilCalendarInboxSharedTableGUI\fillRow(), ilPageHistoryTableGUI\fillRow(), ilAssessmentFolderLogTableGUI\fillRow(), ilObjSurvey\getAppraiseesData(), ilBookingParticipant\getAssignableParticipants(), ilSkillProfile\getAssignedUsers(), ilLMTracker\getBlockedUsersInformation(), ilExSubmission\getDirectoryNameFromUserData(), ilIndividualAssessmentMembersTableGUI\getFullNameFor(), ilAttendanceList\getHTML(), ilCourseParticipantsGroupsTableGUI\getItems(), ilSessionOverviewTableGUI\getItems(), ilSurveyParticipantsTableGUI\getItems(), ilBookingParticipant\getList(), ilBookingReservation\getListByDate(), ilContSkillMemberTableGUI\getMembers(), ilExAssignment\getMultiFeedbackFiles(), ilPageObject\getPageContributors(), ilPageObject\getParentObjectContributors(), ilDownloadSubmissionsBackgroundTask\getParticipantBucketTitle(), ilMilestoneResponsiblesTableGUI\getParticipantsAndResponsibles(), ilObjWikiListGUI\getProperties(), ilObjSurvey\getRatersData(), ilMail\getSalutation(), ilDclBaseRecordModel\getStandardField(), ilForumSettingsGUI\getUserNotificationTableData(), ilExerciseXMLWriter\handleAssignmentMembers(), ilWorkspaceShareTableGUI\importData(), ilLOMemberTestResultTableGUI\init(), ilContSkillAdminGUI\initCompetenceAssignmentForm(), ilWorkspaceShareTableGUI\initFilter(), ilExerciseManagementGUI\initIndividualDeadlineForm(), ilObjectCustomUserFieldsGUI\initMemberForm(), ilExParticipantTableGUI\initMode(), ilObjSurveyGUI\initPropertiesForm(), ilTestEvaluationGUI\outParticipantsResultsOverview(), ilCourseParticipantsTableGUI\parse(), ilGroupParticipantsTableGUI\parse(), ilCalendarSharedListTableGUI\parse(), ilCalendarSharedUserListTableGUI\parse(), ilConsultationHoursTableGUI\parse(), ilUserClipboardTableGUI\parse(), ilObjPortfolioGUI\printView(), ilObjCourseGUI\readMemberData(), ilObjGroupGUI\readMemberData(), ilLearningSequenceRoles\readMemberData(), ilCalendarEntry\readResponsibleUsers(), ilSubscriberTableGUI\readSubscriberData(), ilWaitingListTableGUI\readUserData(), ilObjPortfolioBaseGUI\renderFullscreenHeader(), ilObjBlogGUI\renderFullscreenHeader(), ilTestScoringGUI\saveManScoringParticipantScreen(), ilExerciseManagementGUI\saveStatus(), ilExAssignment\sendMultiFeedbackStructureFile(), ilMailSearchCoursesGUI\showMembers(), ilExerciseManagementGUI\showParticipantObject(), ilMailSearchGUI\showResults(), ilCourseContentGUI\showUserTimings(), ilObjUserTest\testCreateSetLookupDelete(), ilObjTest\userLookupFullName(), ilMailNotification\userToString(), and ilObjStudyProgrammeMembersGUI\viewCompletedCourses().

+ Here is the caller graph for this function:

◆ _lookupPref()

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

◆ _lookupSecondEmail()

static ilObjUser::_lookupSecondEmail (   $a_user_id)
static

Lookup second e-mail.

Parameters
$a_user_id
Returns
null|string

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

742 {
743 return ilObjUser::_lookup($a_user_id, "second_email");
744 }

References _lookup().

+ Here is the call graph for this function:

◆ _moveUsersToStyle()

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

skins and styles

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

3109 {
3110 global $DIC;
3111
3112 $ilDB = $DIC['ilDB'];
3113
3114 $q = "SELECT up1.usr_id usr_id FROM usr_pref up1, usr_pref up2 " .
3115 " WHERE up1.keyword= " . $ilDB->quote("style", "text") .
3116 " AND up1.value= " . $ilDB->quote($a_from_style, "text") .
3117 " AND up2.keyword= " . $ilDB->quote("skin", "text") .
3118 " AND up2.value= " . $ilDB->quote($a_from_skin, "text") .
3119 " AND up1.usr_id = up2.usr_id ";
3120
3121 $usr_set = $ilDB->query($q);
3122
3123 while ($usr_rec = $ilDB->fetchAssoc($usr_set)) {
3124 self::_writePref($usr_rec["usr_id"], "skin", $a_to_skin);
3125 self::_writePref($usr_rec["usr_id"], "style", $a_to_style);
3126 }
3127 }
static _writePref($a_usr_id, $a_keyword, $a_value)

References $DIC, $ilDB, and _writePref().

Referenced by ilSystemStyleOverviewGUI\moveUserStyles(), and ilObjUserTest\testMiscellaneous().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _readUsersProfileData()

static ilObjUser::_readUsersProfileData (   $a_user_ids)
static

STATIC METHOD get user data of selected users.

Parameters
arraydesired user ids
Returns
array of user data

@access public

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

2940 {
2941 global $DIC;
2942
2943 $ilDB = $DIC['ilDB'];
2944 $res = $ilDB->query("SELECT * FROM usr_data WHERE " .
2945 $ilDB->in("usr_id", $a_user_ids, false, "integer"));
2946 while ($row = $ilDB->fetchAssoc($res)) {
2947 $user_data["$row[usr_id]"] = $row;
2948 }
2949 return $user_data ? $user_data : array();
2950 }

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

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

+ Here is the caller graph for this function:

◆ _removeItemFromDesktops()

static ilObjUser::_removeItemFromDesktops (   $a_id)
static

removes object from all user's desktops @access public

Parameters
integerref_id
Returns
array user_ids of all affected users

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

3246 {
3247 global $DIC;
3248
3249 $ilDB = $DIC['ilDB'];
3250
3251 $r = $ilDB->queryF(
3252 "SELECT user_id FROM desktop_item WHERE item_id = %s",
3253 array("integer"),
3254 array($a_id)
3255 );
3256
3257 $users = array();
3258
3259 while ($row = $ilDB->fetchObject($r)) {
3260 $users[] = $row->user_id;
3261 } // while
3262
3263 if (count($users) > 0) {
3264 $ilDB->manipulateF(
3265 "DELETE FROM desktop_item WHERE item_id = %s",
3266 array("integer"),
3267 array($a_id)
3268 );
3269 }
3270
3271 return $users;
3272 }

References $DIC, $ilDB, $r, $row, and $users.

Referenced by ilUtil\removeItemFromDesktops().

+ Here is the caller graph for this function:

◆ _resetLoginAttempts()

static ilObjUser::_resetLoginAttempts (   $a_usr_id)
static

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

4873 {
4874 global $DIC;
4875
4876 $ilDB = $DIC['ilDB'];
4877
4878 $query = "UPDATE usr_data SET login_attempts = 0 WHERE usr_id = %s";
4879 $affected = $ilDB->manipulateF($query, array('integer'), array($a_usr_id));
4880
4881 if ($affected) {
4882 return true;
4883 } else {
4884 return false;
4885 }
4886 }

References $DIC, $ilDB, and $query.

Referenced by ilAuthFrontend\handleAuthenticationSuccess(), ilAuthBase\loginObserver(), ilObjUserTest\testAuthAndEmailMethods(), and ilObjUserGUI\updateObject().

+ Here is the caller graph for this function:

◆ _setFeedPass()

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

Set news feed password for user.

Parameters
integeruser_id
stringnew password

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

4552 {
4553 global $DIC;
4554
4555 $ilDB = $DIC['ilDB'];
4556
4558 $a_user_id,
4559 "priv_feed_pass",
4560 ($a_password == "") ? "" : md5($a_password)
4561 );
4562 }

References $DIC, $ilDB, and _writePref().

+ Here is the call graph for this function:

◆ _setUserInactive()

static ilObjUser::_setUserInactive (   $a_usr_id)
static

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

4919 {
4920 global $DIC;
4921
4922 $ilDB = $DIC['ilDB'];
4923
4924 $query = "UPDATE usr_data SET active = 0, inactivation_date = %s WHERE usr_id = %s";
4925 $affected = $ilDB->manipulateF($query, array('timestamp', 'integer'), array(ilUtil::now(), $a_usr_id));
4926
4927 if ($affected) {
4928 return true;
4929 } else {
4930 return false;
4931 }
4932 }
static now()
Return current timestamp in Y-m-d H:i:s format.

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

Referenced by ilAuthBase\failedLoginObserver(), ilAuthFrontend\handleAuthenticationFail(), and ilObjUserTest\testAuthAndEmailMethods().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _toggleActiveStatusOfUsers()

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

Toggle active status of users.

@access public

Parameters

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

3857 {
3858 global $DIC;
3859
3860 $ilDB = $DIC['ilDB'];
3861
3862 if (!is_array($a_usr_ids)) {
3863 return false;
3864 }
3865
3866
3867 if ($a_status) {
3868 $q = "UPDATE usr_data SET active = 1, inactivation_date = NULL WHERE " .
3869 $ilDB->in("usr_id", $a_usr_ids, false, "integer");
3870 $ilDB->manipulate($q);
3871 } else {
3872 $usrId_IN_usrIds = $ilDB->in("usr_id", $a_usr_ids, false, "integer");
3873
3874 $q = "UPDATE usr_data SET active = 0 WHERE $usrId_IN_usrIds";
3875 $ilDB->manipulate($q);
3876
3877 $queryString = "
3878 UPDATE usr_data
3879 SET inactivation_date = %s
3880 WHERE inactivation_date IS NULL
3881 AND $usrId_IN_usrIds
3882 ";
3883 $ilDB->manipulateF($queryString, array('timestamp'), array(ilUtil::now()));
3884 }
3885
3886 return true;
3887 }

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

Referenced by ilLDAPCronSynchronization\deactivateUsers(), and ilObjUserTest\testCreateSetLookupDelete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _updateLastLogin()

static ilObjUser::_updateLastLogin (   $a_usr_id,
  $a_last_login = null 
)
static

STATIC METHOD updates the last_login field of user with given id to given or current date.

Parameters
integer$a_usr_id
string$last_login(optional)
Returns
$last_login or false @access public

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

5268 {
5269 if ($a_last_login !== null) {
5270 $last_login = $a_last_login;
5271 } else {
5272 $last_login = date('Y-m-d H:i:s');
5273 }
5274
5275 global $DIC;
5276
5277 $ilDB = $DIC['ilDB'];
5278
5279 $query = "UPDATE usr_data SET last_login = %s WHERE usr_id = %s";
5280 $affected = $ilDB->manipulateF($query, array('timestamp', 'integer'), array($last_login, $a_usr_id));
5281
5282 $query = "UPDATE usr_data SET first_login = %s WHERE usr_id = %s AND first_login IS NULL";
5283 $ilDB->manipulateF($query, array('timestamp', 'integer'), array($last_login, $a_usr_id));
5284
5285
5286 if ($affected) {
5287 return $last_login;
5288 } else {
5289 return false;
5290 }
5291 }

References $DIC, $ilDB, and $query.

◆ _uploadPersonalPicture()

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

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

Parameters
string$tmp_fileComplete path to the temporary image file
int$obj_idThe object id of the related user account
Returns
returns TRUE on success, otherwise FALSE

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

4029 {
4030 $webspace_dir = ilUtil::getWebspaceDir();
4031 $image_dir = $webspace_dir . "/usr_images";
4032 $store_file = "usr_" . $obj_id . "." . "jpg";
4033 $target_file = $image_dir . "/$store_file";
4034
4035 chmod($tmp_file, 0770);
4036
4037 // take quality 100 to avoid jpeg artefacts when uploading jpeg files
4038 // taking only frame [0] to avoid problems with animated gifs
4039 $show_file = "$image_dir/usr_" . $obj_id . ".jpg";
4040 $thumb_file = "$image_dir/usr_" . $obj_id . "_small.jpg";
4041 $xthumb_file = "$image_dir/usr_" . $obj_id . "_xsmall.jpg";
4042 $xxthumb_file = "$image_dir/usr_" . $obj_id . "_xxsmall.jpg";
4043
4044 ilUtil::execConvert($tmp_file . "[0] -geometry 200x200 -quality 100 JPEG:" . $show_file);
4045 ilUtil::execConvert($tmp_file . "[0] -geometry 100x100 -quality 100 JPEG:" . $thumb_file);
4046 ilUtil::execConvert($tmp_file . "[0] -geometry 75x75 -quality 100 JPEG:" . $xthumb_file);
4047 ilUtil::execConvert($tmp_file . "[0] -geometry 30x30 -quality 100 JPEG:" . $xxthumb_file);
4048
4049 // store filename
4050 self::_writePref($obj_id, "profile_image", $store_file);
4051
4052 return true;
4053 }
static getWebspaceDir($mode="filesystem")
get webspace directory
static execConvert($args)
execute convert command

References _writePref(), ilUtil\execConvert(), and ilUtil\getWebspaceDir().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _verifyRegistrationHash()

static ilObjUser::_verifyRegistrationHash (   $a_hash)
static

Verifies a registration hash.

Exceptions
ilRegistrationHashExpiredException
ilRegistrationHashNotFoundException
Parameters
string$a_hashhashcode
Returns
integer user id of the user

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

5137 {
5138 global $DIC;
5139
5140 $ilDB = $DIC['ilDB'];
5141
5142 $res = $ilDB->queryf(
5143 '
5144 SELECT usr_id, create_date FROM usr_data
5145 WHERE reg_hash = %s',
5146 array('text'),
5147 array($a_hash)
5148 );
5149 while ($row = $ilDB->fetchAssoc($res)) {
5150 require_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
5151 $oRegSettigs = new ilRegistrationSettings();
5152
5153 if ((int) $oRegSettigs->getRegistrationHashLifetime() != 0 &&
5154 time() - (int) $oRegSettigs->getRegistrationHashLifetime() > strtotime($row['create_date'])) {
5155 require_once 'Services/Registration/exceptions/class.ilRegConfirmationLinkExpiredException.php';
5156 throw new ilRegConfirmationLinkExpiredException('reg_confirmation_hash_life_time_expired', $row['usr_id']);
5157 }
5158
5159 $ilDB->manipulateF(
5160 '
5161 UPDATE usr_data
5162 SET reg_hash = %s
5163 WHERE usr_id = %s',
5164 array('text', 'integer'),
5165 array('', (int) $row['usr_id'])
5166 );
5167
5168 return (int) $row['usr_id'];
5169 }
5170
5171 require_once 'Services/Registration/exceptions/class.ilRegistrationHashNotFoundException.php';
5172 throw new ilRegistrationHashNotFoundException('reg_confirmation_hash_not_found');
5173 }
Class for user related exception handling in ILIAS.
Class for user related exception handling in ILIAS.
Class ilObjAuthSettingsGUI.

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

◆ _writeAuthMode()

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

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

2088 {
2089 global $DIC;
2090
2091 $ilDB = $DIC['ilDB'];
2092
2093 $ilDB->manipulateF(
2094 "UPDATE usr_data " .
2095 " SET auth_mode = %s WHERE usr_id = %s",
2096 array("text", "integer"),
2097 array($a_auth_mode, $a_usr_id)
2098 );
2099 }

References $DIC, and $ilDB.

Referenced by ilAuthProviderSaml\handleSamlAuth(), and ilObjUserTest\testAuthAndEmailMethods().

+ Here is the caller graph for this function:

◆ _writeExternalAccount()

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

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

2074 {
2075 global $DIC;
2076
2077 $ilDB = $DIC['ilDB'];
2078
2079 $ilDB->manipulateF(
2080 "UPDATE usr_data " .
2081 " SET ext_account = %s WHERE usr_id = %s",
2082 array("text", "integer"),
2083 array($a_ext_id, $a_usr_id)
2084 );
2085 }

References $DIC, and $ilDB.

Referenced by ilObjUserTest\testAuthAndEmailMethods().

+ Here is the caller graph for this function:

◆ _writeHistory()

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

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

4959 {
4960 global $DIC;
4961
4962 $ilDB = $DIC['ilDB'];
4963
4964 $timestamp = time();
4965
4966 $res = $ilDB->queryF(
4967 'SELECT * FROM loginname_history WHERE usr_id = %s AND login = %s AND history_date = %s',
4968 array('integer', 'text', 'integer'),
4969 array($a_usr_id, $a_login, $timestamp)
4970 );
4971
4972 if ($ilDB->numRows($res) == 0) {
4973 $ilDB->manipulateF(
4974 '
4975 INSERT INTO loginname_history
4976 (usr_id, login, history_date)
4977 VALUES (%s, %s, %s)',
4978 array('integer', 'text', 'integer'),
4979 array($a_usr_id, $a_login, $timestamp)
4980 );
4981 }
4982
4983 return true;
4984 }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81

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

Referenced by updateLogin().

+ Here is the caller graph for this function:

◆ _writePref()

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

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

1155 {
1156 global $DIC;
1157
1158 $ilDB = $DIC['ilDB'];
1159 $ilDB->replace(
1160 "usr_pref",
1161 array(
1162 "usr_id" => array("integer", $a_usr_id),
1163 "keyword" => array("text", $a_keyword),
1164 ),
1165 array(
1166 "value" => array("text",$a_value)
1167 )
1168 );
1169
1170 /*
1171 self::_deletePref($a_usr_id, $a_keyword);
1172 if(strlen($a_value))
1173 {
1174 $ilDB->manipulateF(
1175 'INSERT INTO usr_pref (usr_id, keyword, value) VALUES (%s, %s, %s)',
1176 array('integer', 'text', 'text'),
1177 array($a_usr_id, $a_keyword, $a_value)
1178 );
1179 }*/
1180 }

References $DIC, and $ilDB.

Referenced by _moveUsersToStyle(), _setFeedPass(), _uploadPersonalPicture(), ilBadgeProfileGUI\saveSettings(), writePref(), and writePrefs().

+ Here is the caller graph for this function:

◆ activateDeletionFlag()

ilObjUser::activateDeletionFlag ( )

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

5646 {
5647 $this->writePref("delete_flag", true);
5648 }
writePref($a_keyword, $a_value)
write userpref to user table @access private

References writePref().

+ Here is the call graph for this function:

◆ addDesktopItem()

ilObjUser::addDesktopItem (   $a_item_id,
  $a_type,
  $a_par = "" 
)

add an item to user's personal desktop

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

3174 {
3175 ilObjUser::_addDesktopItem($this->getId(), $a_item_id, $a_type, $a_par);
3176 }
static _addDesktopItem($a_usr_id, $a_item_id, $a_type, $a_par="")
add an item to user's personal desktop
getId()
get object id @access public

References $a_type, _addDesktopItem(), and ilObject\getId().

+ Here is the call graph for this function:

◆ addObjectToClipboard()

ilObjUser::addObjectToClipboard (   $a_item_id,
  $a_type,
  $a_title,
  $a_parent = 0,
  $a_time = 0,
  $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 3473 of file class.ilObjUser.php.

3480 {
3481 global $DIC;
3482
3483 $ilDB = $DIC['ilDB'];
3484
3485 if ($a_time == 0) {
3486 $a_time = date("Y-m-d H:i:s", time());
3487 }
3488
3489 $item_set = $ilDB->queryF(
3490 "SELECT * FROM personal_clipboard WHERE " .
3491 "parent = %s AND item_id = %s AND type = %s AND user_id = %s",
3492 array("integer", "integer", "text", "integer"),
3493 array(0, $a_item_id, $a_type, $this->getId())
3494 );
3495
3496 // only insert if item is not already in clipboard
3497 if (!$d = $item_set->fetchRow()) {
3498 $ilDB->manipulateF(
3499 "INSERT INTO personal_clipboard " .
3500 "(item_id, type, user_id, title, parent, insert_time, order_nr) VALUES " .
3501 " (%s,%s,%s,%s,%s,%s,%s)",
3502 array("integer", "text", "integer", "text", "integer", "timestamp", "integer"),
3503 array($a_item_id, $a_type, $this->getId(), $a_title, (int) $a_parent, $a_time, (int) $a_order_nr)
3504 );
3505 } else {
3506 $ilDB->manipulateF(
3507 "UPDATE personal_clipboard SET insert_time = %s " .
3508 "WHERE user_id = %s AND item_id = %s AND type = %s AND parent = 0",
3509 array("timestamp", "integer", "integer", "text"),
3510 array($a_time, $this->getId(), $a_item_id, $a_type)
3511 );
3512 }
3513 }
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296

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

+ Here is the call graph for this function:

◆ addToPCClipboard()

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

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

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

3519 {
3520 global $DIC;
3521
3522 $ilDB = $DIC['ilDB'];
3523 if ($a_time == 0) {
3524 $a_time = date("Y-m-d H:i:s", time());
3525 }
3526 $ilDB->insert("personal_pc_clipboard", array(
3527 "user_id" => array("integer", $this->getId()),
3528 "content" => array("clob", $a_content),
3529 "insert_time" => array("timestamp", $a_time),
3530 "order_nr" => array("integer", $a_nr)
3531 ));
3532 }
$a_content
Definition: workflow.php:93

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

+ Here is the call graph for this function:

◆ addUserDefinedFieldEntry()

ilObjUser::addUserDefinedFieldEntry ( )

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

4321 {
4322 global $DIC;
4323
4324 $ilDB = $DIC['ilDB'];
4325
4326 // not needed. no entry in udf_text/udf_clob means no value
4327
4328 /* $query = "INSERT INTO udf_data (usr_id ) ".
4329 "VALUES( ".
4330 $ilDB->quote($this->getId(),'integer').
4331 ")";
4332 $res = $ilDB->manipulate($query);
4333 */
4334 return true;
4335 }

References $DIC, and $ilDB.

◆ assignData()

ilObjUser::assignData (   $a_data)

loads a record "user" from array @access public

Parameters
arrayuserdata

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

339 {
340 global $DIC;
341
342 $ilErr = $DIC['ilErr'];
343 $ilDB = $DIC['ilDB'];
344 $lng = $DIC['lng'];
345
346 // basic personal data
347 $this->setLogin($a_data["login"]);
348 if (!$a_data["passwd_type"]) {
349 $ilErr->raiseError("<b>Error: passwd_type missing in function assignData(). " .
350 $this->id . "!</b><br />class: " . get_class($this) . "<br />Script: "
351 . __FILE__ . "<br />Line: " . __LINE__, $ilErr->FATAL);
352 }
353 if ($a_data["passwd"] != "********" and strlen($a_data['passwd'])) {
354 $this->setPasswd($a_data["passwd"], $a_data["passwd_type"]);
355 }
356
357 $this->setGender($a_data["gender"]);
358 $this->setUTitle($a_data["title"]);
359 $this->setFirstname($a_data["firstname"]);
360 $this->setLastname($a_data["lastname"]);
361 $this->setFullname();
362 if (!is_array($a_data['birthday'])) {
363 $this->setBirthday($a_data['birthday']);
364 } else {
365 $this->setBirthday(null);
366 }
367
368 // address data
369 $this->setInstitution($a_data["institution"]);
370 $this->setDepartment($a_data["department"]);
371 $this->setStreet($a_data["street"]);
372 $this->setCity($a_data["city"]);
373 $this->setZipcode($a_data["zipcode"]);
374 $this->setCountry($a_data["country"]);
375 $this->setSelectedCountry($a_data["sel_country"]);
376 $this->setPhoneOffice($a_data["phone_office"]);
377 $this->setPhoneHome($a_data["phone_home"]);
378 $this->setPhoneMobile($a_data["phone_mobile"]);
379 $this->setFax($a_data["fax"]);
380 $this->setMatriculation($a_data["matriculation"]);
381 $this->setEmail($a_data["email"]);
382 $this->setSecondEmail($a_data["second_email"]);
383 $this->setHobby($a_data["hobby"]);
384 $this->setClientIP($a_data["client_ip"]);
385 $this->setPasswordEncodingType($a_data['passwd_enc_type']);
386 $this->setPasswordSalt($a_data['passwd_salt']);
387
388 // other data
389 $this->setLatitude($a_data["latitude"]);
390 $this->setLongitude($a_data["longitude"]);
391 $this->setLocationZoom($a_data["loc_zoom"]);
392
393 // system data
394 $this->setLastLogin($a_data["last_login"]);
395 $this->setFirstLogin($a_data["first_login"]);
396 $this->setLastProfilePrompt($a_data["last_profile_prompt"]);
397 $this->setLastUpdate($a_data["last_update"]);
398 $this->create_date = $a_data["create_date"];
399 $this->setComment($a_data["referral_comment"]);
400 $this->approve_date = $a_data["approve_date"];
401 $this->active = $a_data["active"];
402 $this->agree_date = $a_data["agree_date"];
403
404 $this->setInactivationDate($a_data["inactivation_date"]);
405
406 // time limitation
407 $this->setTimeLimitOwner($a_data["time_limit_owner"]);
408 $this->setTimeLimitUnlimited($a_data["time_limit_unlimited"]);
409 $this->setTimeLimitFrom($a_data["time_limit_from"]);
410 $this->setTimeLimitUntil($a_data["time_limit_until"]);
411 $this->setTimeLimitMessage($a_data['time_limit_message']);
412
413 // user profile incomplete?
414 $this->setProfileIncomplete($a_data["profile_incomplete"]);
415
416 //authentication
417 $this->setAuthMode($a_data['auth_mode']);
418 $this->setExternalAccount($a_data['ext_account']);
419
420 $this->setIsSelfRegistered((bool) $a_data['is_self_registered']);
421 }
setCity($a_str)
set city @access public
setUTitle($a_str)
set user title (note: don't mix up this method with setTitle() that is derived from ilObject and sets...
setInactivationDate($inactivation_date)
setter for inactivation date
setSecondEmail($second_email)
setLocationZoom($a_locationzoom)
Set Location Zoom.
setClientIP($a_str)
set client ip number @access public
setLatitude($a_latitude)
Set Latitude.
setInstitution($a_str)
set institution @access public
setLastUpdate($a_str)
set last update of user data set @access public
setFirstname($a_str)
set firstname @access public
setDepartment($a_str)
set department @access public
setPasswordEncodingType($password_encryption_type)
setExternalAccount($a_str)
set external account
setLogin($a_str)
set login / username @access public
setTimeLimitFrom($a_from)
setSelectedCountry($a_val)
Set selected country (selection drop down)
setCountry($a_str)
Set country (free text)
setTimeLimitMessage($a_time_limit_message)
setPasswd($a_str, $a_type=IL_PASSWD_PLAIN)
set password @access public
setComment($a_str)
set referral comment @access public
setAuthMode($a_str)
set auth mode @access public
setPhoneHome($a_str)
set home phone @access public
setPasswordSalt($password_salt)
setFirstLogin($a_str)
set user's first login
setFax($a_str)
set fax @access public
setTimeLimitUntil($a_until)
setTimeLimitOwner($a_owner)
setZipcode($a_str)
set zipcode @access public
setLongitude($a_longitude)
Set Longitude.
setFullname($a_title="", $a_firstname="", $a_lastname="")
builds a string with title + firstname + lastname method is used to build fullname in member variable...
setLastname($a_str)
set lastame @access public
setBirthday($a_birthday)
setStreet($a_str)
set street @access public
setGender($a_str)
set gender @access public
setProfileIncomplete($a_prof_inc)
setTimeLimitUnlimited($a_unlimited)
setEmail($a_str)
set email @access public
setIsSelfRegistered($status)
setMatriculation($a_str)
set matriculation number @access public
setLastLogin($a_str)
set user's last login @access public
setLastProfilePrompt($a_str)
set user's last profile prompt
setHobby($a_str)
set hobby @access public
setPhoneOffice($a_str)
set office phone @access public
setPhoneMobile($a_str)
set mobile phone @access public
$ilErr
Definition: raiseError.php:18

References $DIC, $ilDB, $ilErr, ilObject\$lng, 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildTextFromArray()

ilObjUser::buildTextFromArray (   $a_attr)
protected

Convert multi-text values to plain text.

Parameters
string$a_attr
Returns
string

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

5775 {
5776 $current = $this->$a_attr;
5777 if (is_array($current) && sizeof($current)) {
5778 return implode(", ", $current);
5779 }
5780 }

References $current.

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

+ Here is the caller graph for this function:

◆ checkTimeLimit()

ilObjUser::checkTimeLimit ( )

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

2399 {
2400 if ($this->getTimeLimitUnlimited()) {
2401 return true;
2402 }
2403 if ($this->getTimeLimitFrom() < time() and $this->getTimeLimitUntil() > time()) {
2404 return true;
2405 }
2406 return false;
2407 }

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

+ Here is the call graph for this function:

◆ checkUserId()

ilObjUser::checkUserId ( )

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

2620 {
2621 global $DIC;
2622
2623 $ilSetting = $DIC['ilSetting'];
2624
2627 if ($id > 0) {
2628 return $id;
2629 }
2630 return false;
2631 }
$login
all user related data in single vars @access public
static getLoginFromAuth()
Gets the username from $ilAuth, and converts it into an ILIAS login name.
static _lookupId($a_user_str)
Lookup id by login.

References $DIC, ilObject\$id, $ilSetting, $login, _lookupId(), and getLoginFromAuth().

+ Here is the call graph for this function:

◆ clipboardDeleteAll()

ilObjUser::clipboardDeleteAll ( )

Delete objects of type for user.

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

3604 {
3605 global $DIC;
3606
3607 $ilDB = $DIC['ilDB'];
3608
3609 $ilDB->manipulateF("DELETE FROM personal_clipboard WHERE " .
3610 "user_id = %s", array("integer"), array($this->getId()));
3611 }

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

Referenced by delete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clipboardDeleteObjectsOfType()

ilObjUser::clipboardDeleteObjectsOfType (   $a_type)

Delete objects of type for user.

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

3587 {
3588 global $DIC;
3589
3590 $ilDB = $DIC['ilDB'];
3591
3592 $ilDB->manipulateF(
3593 "DELETE FROM personal_clipboard WHERE " .
3594 "type = %s AND user_id = %s",
3595 array("text", "integer"),
3596 array($a_type, $this->getId())
3597 );
3598 }

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

+ Here is the call graph for this function:

◆ clipboardHasObjectsOfType()

ilObjUser::clipboardHasObjectsOfType (   $a_type)

Check whether clipboard has objects of a certain type.

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

3565 {
3566 global $DIC;
3567
3568 $ilDB = $DIC['ilDB'];
3569
3570 $set = $ilDB->queryF(
3571 "SELECT * FROM personal_clipboard WHERE " .
3572 "parent = %s AND type = %s AND user_id = %s",
3573 array("integer", "text", "integer"),
3574 array(0, $a_type, $this->getId())
3575 );
3576 if ($rec = $ilDB->fetchAssoc($set)) {
3577 return true;
3578 }
3579
3580 return false;
3581 }

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

+ Here is the call graph for this function:

◆ copyProfilePicturesToDirectory()

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

Get profile picture direcotory.

Parameters

return

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

4173 {
4174 $a_dir = trim(str_replace("..", "", $a_dir));
4175 if ($a_dir == "" || !is_dir($a_dir)) {
4176 return;
4177 }
4178
4179 $webspace_dir = ilUtil::getWebspaceDir();
4180 $image_dir = $webspace_dir . "/usr_images";
4181 $images = array(
4182 "upload_" . $a_user_id . "pic",
4183 "usr_" . $a_user_id . "." . "jpg",
4184 "usr_" . $a_user_id . "_small.jpg",
4185 "usr_" . $a_user_id . "_xsmall.jpg",
4186 "usr_" . $a_user_id . "_xxsmall.jpg",
4187 "upload_" . $a_user_id);
4188 foreach ($images as $image) {
4189 if (is_file($image_dir . "/" . $image)) {
4190 copy($image_dir . "/" . $image, $a_dir . "/" . $image);
4191 }
4192 }
4193 }

References ilUtil\getWebspaceDir().

Referenced by ilUserDataSet\getXmlRecord().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilObjUser::delete ( )

deletes a user @access public

Parameters
integeruser_id

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

1315 {
1316 global $DIC;
1317
1318 $rbacadmin = $DIC->rbac()->admin();
1319 $ilDB = $DIC['ilDB'];
1320
1321 // deassign from ldap groups
1322 include_once('Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php');
1324 $mapping->deleteUser($this->getId());
1325
1326 // remove mailbox / update sent mails
1327 include_once("Services/Mail/classes/class.ilMailbox.php");
1328 $mailbox = new ilMailbox($this->getId());
1329 $mailbox->delete();
1330 $mailbox->updateMailsOfDeletedUser($this->getLogin());
1331
1332 // delete feed blocks on personal desktop
1333 include_once("./Services/Block/classes/class.ilCustomBlock.php");
1334 $costum_block = new ilCustomBlock();
1335 $costum_block->setContextObjId($this->getId());
1336 $costum_block->setContextObjType("user");
1337 $c_blocks = $costum_block->queryBlocksForContext();
1338 include_once("./Services/Feeds/classes/class.ilPDExternalFeedBlock.php");
1339 foreach ($c_blocks as $c_block) {
1340 if ($c_block["type"] == "pdfeed") {
1341 $fb = new ilPDExternalFeedBlock($c_block["id"]);
1342 $fb->delete();
1343 }
1344 }
1345
1346
1347 // delete block settings
1348 include_once("./Services/Block/classes/class.ilBlockSetting.php");
1350
1351 // delete user_account
1352 $ilDB->manipulateF(
1353 "DELETE FROM usr_data WHERE usr_id = %s",
1354 array("integer"),
1355 array($this->getId())
1356 );
1357
1358 $this->deleteMultiTextFields();
1359
1360 // delete user_prefs
1362
1363 $this->removeUserPicture(false); // #8597
1364
1365 // delete user_session
1366 include_once("./Services/Authentication/classes/class.ilSession.php");
1368
1369 // remove user from rbac
1370 $rbacadmin->removeUser($this->getId());
1371
1372 // remove bookmarks
1373 // TODO: move this to class.ilBookmarkFolder
1374 $q = "DELETE FROM bookmark_tree WHERE tree = " .
1375 $ilDB->quote($this->getId(), "integer");
1376 $ilDB->manipulate($q);
1377
1378 $q = "DELETE FROM bookmark_data WHERE user_id = " .
1379 $ilDB->quote($this->getId(), "integer");
1380 $ilDB->manipulate($q);
1381
1382 // DELETE FORUM ENTRIES (not complete in the moment)
1383 include_once './Modules/Forum/classes/class.ilObjForum.php';
1385
1386 // Delete link check notify entries
1387 include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
1389
1390 // Delete crs entries
1391 include_once './Modules/Course/classes/class.ilObjCourse.php';
1393
1394 // Delete user tracking
1395 include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
1397
1398 include_once 'Modules/Session/classes/class.ilEventParticipants.php';
1400
1401 // Delete Tracking data SCORM 2004 RTE
1402 include_once 'Modules/Scorm2004/classes/ilSCORM13Package.php';
1404
1405 // Delete Tracking data SCORM 1.2 RTE
1406 include_once 'Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
1408
1409 // remove all notifications
1410 include_once "./Services/Notification/classes/class.ilNotification.php";
1412
1413 // remove portfolios
1414 include_once "./Modules/Portfolio/classes/class.ilObjPortfolio.php";
1416
1417 // remove workspace
1418 include_once "./Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
1419 $tree = new ilWorkspaceTree($this->getId());
1420 $tree->cascadingDelete();
1421
1422 // remove disk quota entries
1423 include_once "./Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
1425
1426 // remove reminder entries
1427 require_once 'Services/User/classes/class.ilCronDeleteInactiveUserReminderMail.php';
1429
1430 // badges
1431 include_once "Services/Badge/classes/class.ilBadgeAssignment.php";
1433
1434 // remove org unit assignments
1435 $ilOrgUnitUserAssignmentQueries = ilOrgUnitUserAssignmentQueries::getInstance();
1436 $ilOrgUnitUserAssignmentQueries->deleteAllAssignmentsOfUser($this->getId());
1437
1438 // Delete user defined field entries
1440
1441 // Delete clipboard entries
1442 $this->clipboardDeleteAll();
1443
1444 // Reset owner
1445 $this->resetOwner();
1446
1447 // Trigger deleteUser Event
1448 global $DIC;
1449
1450 $ilAppEventHandler = $DIC['ilAppEventHandler'];
1451 $ilAppEventHandler->raise(
1452 'Services/User',
1453 'deleteUser',
1454 array('usr_id' => $this->getId())
1455 );
1456
1457 // delete object data
1458 parent::delete();
1459 return true;
1460 }
static deleteByUserId($a_user_id)
static _deleteSettingsOfUser($a_user)
Delete block settings of user.
This is the super class of all custom blocks.
static deleteByOwner($a_owner_id)
Delete all entries for owner.
static _getInstance()
Get singleton instance of this class.
static _deleteUser($a_usr_id)
Mail Box class Base class for creating and handling mail boxes.
static removeForUser($user_id)
Remove all notifications for given user.
static _deleteUser($a_usr_id)
static _deleteUser($a_usr_id)
static deleteUserPortfolios($a_user_id)
Delete all portfolio data for user.
static _deleteUser($a_usr_id)
deleteMultiTextFields()
Remove multi-text values from DB.
removeUserPicture($a_do_update=true)
Remove user picture.
clipboardDeleteAll()
Delete objects of type for user.
static _deleteAllPref($a_user_id)
Deletes a userpref value of the user from the database @access public.
getLogin()
get login / username @access public
deleteUserDefinedFieldEntries()
Custom block for external feeds on personal desktop.
static _removeTrackingDataForUser($user_id)
static _destroyByUserId($a_user_id)
Destroy session.
Tree handler for personal workspace.

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

+ Here is the call graph for this function:

◆ deleteMultiTextFields()

ilObjUser::deleteMultiTextFields ( )
protected

Remove multi-text values from DB.

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

5869 {
5870 global $DIC;
5871
5872 $ilDB = $DIC['ilDB'];
5873
5874 if (!$this->getId()) {
5875 return;
5876 }
5877
5878 $ilDB->manipulate("DELETE FROM usr_data_multi" .
5879 " WHERE usr_id = " . $ilDB->quote($this->getId(), "integer"));
5880 }

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

Referenced by delete(), and updateMultiTextFields().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deletePref()

ilObjUser::deletePref (   $a_keyword)

Deletes a userpref value of the user from the database @access public.

Parameters
stringkeyword

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

1105 {
1106 self::_deletePref($this->getId(), $a_keyword);
1107 }

References ilObject\getId().

+ Here is the call graph for this function:

◆ deleteUserDefinedFieldEntries()

ilObjUser::deleteUserDefinedFieldEntries ( )

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

4338 {
4339 global $DIC;
4340
4341 $ilDB = $DIC['ilDB'];
4342
4343 include_once("./Services/User/classes/class.ilUserDefinedData.php");
4345
4346 // wrong place...
4347 /* $query = "DELETE FROM udf_data ".
4348 "WHERE usr_id = ".$ilDB->quote($this->getId(),'integer');
4349 $res = $ilDB->manipulate($query);*/
4350
4351 return true;
4352 }
static deleteEntriesOfUser($a_user_id)
Delete data of user.

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

Referenced by delete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dropDesktopItem()

ilObjUser::dropDesktopItem (   $a_item_id,
  $a_type 
)

drop an item from user's personal desktop

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

3235 {
3236 ilObjUser::_dropDesktopItem($this->getId(), $a_item_id, $a_type);
3237 }
static _dropDesktopItem($a_usr_id, $a_item_id, $a_type)
drop an item from user's personal desktop

References $a_type, _dropDesktopItem(), and ilObject\getId().

+ Here is the call graph for this function:

◆ exportPersonalData()

ilObjUser::exportPersonalData ( )

Export personal data.

Parameters

return

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

5373 {
5374 include_once("./Services/Export/classes/class.ilExport.php");
5375 $exp = new ilExport();
5376 $dir = ilExport::_getExportDirectory($this->getId(), "xml", "usr", "personal_data");
5377 ilUtil::delDir($dir, true);
5378 $title = $this->getLastname() . ", " . $this->getLastname() . " [" . $this->getLogin() . "]";
5379 $exp->exportEntity(
5380 "personal_data",
5381 $this->getId(),
5382 "",
5383 "Services/User",
5384 $title,
5385 $dir
5386 );
5387 }
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
getLastname()
get lastname @access public
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively

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

+ Here is the call graph for this function:

◆ findInterests()

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

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

5883 {
5884 global $DIC;
5885
5886 $ilDB = $DIC['ilDB'];
5887
5888 $res = array();
5889
5890 $sql = "SELECT DISTINCT(value)" .
5891 " FROM usr_data_multi" .
5892 " WHERE " . $ilDB->like("value", "text", "%" . $a_term . "%");
5893 if ($a_field_id) {
5894 $sql .= " AND field_id = " . $ilDB->quote($a_field_id, "text");
5895 }
5896 if ($a_user_id) {
5897 $sql .= " AND usr_id <> " . $ilDB->quote($a_user_id, "integer");
5898 }
5899 $sql .= " ORDER BY value";
5900 $set = $ilDB->query($sql);
5901 while ($row = $ilDB->fetchAssoc($set)) {
5902 $res[] = $row["value"];
5903 }
5904
5905 return $res;
5906 }

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

Referenced by ilPublicUserProfileGUI\getAutocompleteResult().

+ Here is the caller graph for this function:

◆ getActive()

ilObjUser::getActive ( )

get user active state @access public

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

2277 {
2278 return $this->active;
2279 }

References $active.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getAgreeDate()

ilObjUser::getAgreeDate ( )

get the date when the user accepted the user agreement @access public

Returns
string date of last update

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

2237 {
2238 return $this->agree_date;
2239 }

References $agree_date.

◆ getApproveDate()

ilObjUser::getApproveDate ( )

get the date when the user account was approved @access public

Returns
string approve date

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

2226 {
2227 return $this->approve_date;
2228 }

References $approve_date.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getAuthMode()

ilObjUser::getAuthMode (   $a_auth_key = false)

get auth mode @access public

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

3776 {
3777 if (!$a_auth_key) {
3778 return $this->auth_mode;
3779 }
3780
3781 include_once('./Services/Authentication/classes/class.ilAuthUtils.php');
3782 return ilAuthUtils::_getAuthMode($this->auth_mode);
3783 }
static _getAuthMode($a_auth_mode, $a_db_handler='')

References $auth_mode, and ilAuthUtils\_getAuthMode().

Referenced by ilSoapUserAdministration\__readUserData(), isPasswordChangeDemanded(), and isPasswordExpired().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBirthday()

ilObjUser::getBirthday ( )

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

5186 {
5187 return $this->birthday;
5188 }

References $birthday.

◆ getCity()

ilObjUser::getCity ( )

get city @access public

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

1737 {
1738 return $this->city;
1739 }

References $city.

Referenced by ilSoapUserAdministration\__readUserData(), and ilPersonalProfileGUI\addLocationToForm().

+ Here is the caller graph for this function:

◆ getClientIP()

ilObjUser::getClientIP ( )

get client ip number @access public

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

1892 {
1893 return $this->client_ip;
1894 }

References $client_ip.

◆ getClipboardChilds()

ilObjUser::getClipboardChilds (   $a_parent,
  $a_insert_time 
)

Get childs of an item.

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

3655 {
3656 global $DIC;
3657
3658 $ilDB = $DIC['ilDB'];
3659 $ilUser = $DIC['ilUser'];
3660
3661 $objs = $ilDB->queryF(
3662 "SELECT * FROM personal_clipboard WHERE " .
3663 "user_id = %s AND parent = %s AND insert_time = %s " .
3664 " ORDER BY order_nr",
3665 array("integer", "integer", "timestamp"),
3666 array($ilUser->getId(), (int) $a_parent, $a_insert_time)
3667 );
3668 $objects = array();
3669 while ($obj = $ilDB->fetchAssoc($objs)) {
3670 if ($obj["type"] == "mob") {
3671 $obj["title"] = ilObject::_lookupTitle($obj["item_id"]);
3672 }
3673 $objects[] = array("id" => $obj["item_id"],
3674 "type" => $obj["type"], "title" => $obj["title"], "insert_time" => $obj["insert_time"]);
3675 }
3676 return $objects;
3677 }

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

+ Here is the call graph for this function:

◆ getClipboardObjects()

ilObjUser::getClipboardObjects (   $a_type = "",
  $a_top_nodes_only = false 
)

get all clipboard objects of user and specified type

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

3617 {
3618 global $DIC;
3619
3620 $ilDB = $DIC['ilDB'];
3621
3622 $par = "";
3623 if ($a_top_nodes_only) {
3624 $par = " AND parent = " . $ilDB->quote(0, "integer") . " ";
3625 }
3626
3627 $type_str = ($a_type != "")
3628 ? " AND type = " . $ilDB->quote($a_type, "text") . " "
3629 : "";
3630 $q = "SELECT * FROM personal_clipboard WHERE " .
3631 "user_id = " . $ilDB->quote($this->getId(), "integer") . " " .
3632 $type_str . $par .
3633 " ORDER BY order_nr";
3634 $objs = $ilDB->query($q);
3635 $objects = array();
3636 while ($obj = $ilDB->fetchAssoc($objs)) {
3637 if ($obj["type"] == "mob") {
3638 $obj["title"] = ilObject::_lookupTitle($obj["item_id"]);
3639 }
3640 if ($obj["type"] == "incl") {
3641 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
3642 $obj["title"] = ilMediaPoolPage::lookupTitle($obj["item_id"]);
3643 }
3644 $objects[] = array("id" => $obj["item_id"],
3645 "type" => $obj["type"], "title" => $obj["title"],
3646 "insert_time" => $obj["insert_time"]);
3647 }
3648 return $objects;
3649 }
static lookupTitle($a_page_id)
Lookup title.

References $a_type, $DIC, $ilDB, ilObject\_lookupTitle(), ilObject\getId(), and ilMediaPoolPage\lookupTitle().

+ Here is the call graph for this function:

◆ getComment()

ilObjUser::getComment ( )

get referral comment @access public

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

2205 {
2207 }

References $referral_comment.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getCountry()

ilObjUser::getCountry ( )

Get country (free text)

@access public

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

1777 {
1778 return $this->country;
1779 }

References $country.

Referenced by ilSoapUserAdministration\__readUserData(), and ilPersonalProfileGUI\addLocationToForm().

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

2106 {
2107 return $_SESSION['lang'];
2108 }

References $_SESSION.

◆ getDateFormat()

ilObjUser::getDateFormat ( )

get date format

@access public

Returns

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

1239 {
1240 if ($format = $this->getPref('date_format')) {
1241 return $format;
1242 } else {
1243 include_once('Services/Calendar/classes/class.ilCalendarSettings.php');
1245 return $settings->getDefaultDateFormat();
1246 }
1247 }
static _getInstance()
get singleton instance
getPref($a_keyword)
get a user preference
$format
Definition: metadata.php:141

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

+ Here is the call graph for this function:

◆ getDepartment()

ilObjUser::getDepartment ( )

get department @access public

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

1699 {
1700 return $this->department;
1701 }

References $department.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getDesktopItems()

ilObjUser::getDesktopItems (   $a_types = "")

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

3354 {
3355 return $this->_lookupDesktopItems($this->getId(), $a_types);
3356 }
static _lookupDesktopItems($user_id, $a_types="")
get all desktop items of user and specified type

References _lookupDesktopItems(), and ilObject\getId().

+ Here is the call graph for this function:

◆ getDiskQuota()

ilObjUser::getDiskQuota ( )

Returns the minimal disk quota imposed by this user account.

The minimal disk quota is specified in bytes. The default value is 0.

@access public

Returns
integer

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

2032 {
2033 return $this->prefs["disk_quota"] ? $this->prefs["disk_quota"] : 0;
2034 }

◆ getEmail()

ilObjUser::getEmail ( )

get email address @access public

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

1949 {
1950 return $this->email;
1951 }

References $email.

Referenced by ilSoapUserAdministration\__readUserData(), shibUser\createFields(), ilAccountRegistrationMail\sendLanguageVariableBasedAccountMail(), and shibUser\updateFields().

+ Here is the caller graph for this function:

◆ getExternalAccount()

ilObjUser::getExternalAccount ( )

get external account

note: 3.7.0 uses this field only for cas and soap authentication.

@access public

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

3805 {
3806 return $this->ext_account;
3807 }

◆ getFax()

ilObjUser::getFax ( )

get fax @access public

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

1873 {
1874 return $this->fax;
1875 }

References $fax.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getFirstLettersOfLastnames()

static ilObjUser::getFirstLettersOfLastnames ( )
static

Get first letters of all lastnames.

Parameters

return

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

5314 {
5315 global $DIC;
5316
5317 $ilDB = $DIC['ilDB'];
5318
5319 $q = "SELECT DISTINCT " . $ilDB->upper($ilDB->substr("lastname", 1, 1)) . " let" .
5320 " FROM usr_data" .
5321 " WHERE usr_id <> " . $ilDB->quote(ANONYMOUS_USER_ID, "integer") .
5322 " ORDER BY let";
5323 $let_set = $ilDB->query($q);
5324
5325 $lets = array();
5326 while ($let_rec = $ilDB->fetchAssoc($let_set)) {
5327 $let[$let_rec["let"]] = $let_rec["let"];
5328 }
5329 return $let;
5330 }

References $DIC, and $ilDB.

Referenced by ilObjUserFolderGUI\viewObject().

+ Here is the caller graph for this function:

◆ getFirstLogin()

ilObjUser::getFirstLogin ( )

returns first login date

Returns
string date

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

2154 {
2155 return $this->first_login;
2156 }

References $first_login.

Referenced by refreshLogin().

+ Here is the caller graph for this function:

◆ getFirstname()

ilObjUser::getFirstname ( )

get firstname @access public

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

1642 {
1643 return $this->firstname;
1644 }

References $firstname.

Referenced by ilSoapUserAdministration\__readUserData(), ilIndividualAssessmentMembers\buildNewRecordOfUser(), getPublicName(), and shibUser\returnNewLoginName().

+ Here is the caller graph for this function:

◆ getFullname()

ilObjUser::getFullname (   $a_max_strlen = 0)

get fullname @access public

Parameters
integermax. 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 1508 of file class.ilObjUser.php.

1509 {
1510 if (!$a_max_strlen) {
1511 return ilUtil::stripSlashes($this->fullname);
1512 }
1513
1514 if (strlen($this->fullname) <= $a_max_strlen) {
1515 return ilUtil::stripSlashes($this->fullname);
1516 }
1517
1518 if ((strlen($this->utitle) + strlen($this->lastname) + 4) <= $a_max_strlen) {
1519 return ilUtil::stripSlashes($this->utitle . " " . substr($this->firstname, 0, 1) . ". " . $this->lastname);
1520 }
1521
1522 if ((strlen($this->firstname) + strlen($this->lastname) + 1) <= $a_max_strlen) {
1523 return ilUtil::stripSlashes($this->firstname . " " . $this->lastname);
1524 }
1525
1526 if ((strlen($this->lastname) + 3) <= $a_max_strlen) {
1527 return ilUtil::stripSlashes(substr($this->firstname, 0, 1) . ". " . $this->lastname);
1528 }
1529
1530 return ilUtil::stripSlashes(substr($this->lastname, 0, $a_max_strlen));
1531 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References ilUtil\stripSlashes().

Referenced by shibUser\createFields().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGender()

ilObjUser::getGender ( )

get gender @access public

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

1600 {
1601 return $this->gender;
1602 }

References $gender.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getGeneralInterests()

ilObjUser::getGeneralInterests ( )

Get general interests.

Returns
array $value

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

5694 {
5696 }

References $interests_general.

Referenced by updateMultiTextFields().

+ Here is the caller graph for this function:

◆ getGeneralInterestsAsText()

ilObjUser::getGeneralInterestsAsText ( )

Get general interests as plain text.

Returns
string

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

5704 {
5705 return $this->buildTextFromArray("interests_general");
5706 }
buildTextFromArray($a_attr)
Convert multi-text values to plain text.

References buildTextFromArray().

+ Here is the call graph for this function:

◆ getHobby()

ilObjUser::getHobby ( )

get hobby @access public

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

1984 {
1985 return $this->hobby;
1986 }

References $hobby.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getInactivationDate()

ilObjUser::getInactivationDate ( )

getter for inactivation date

Returns
string $inactivation_date

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

5529 {
5531 }

References $inactivation_date.

◆ getInstitution()

ilObjUser::getInstitution ( )

get institution @access public

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

1680 {
1681 return $this->institution;
1682 }

References $institution.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getLanguage()

ilObjUser::getLanguage ( )

returns a 2char-language-string @access public

Returns
string language

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

2005 {
2006 return $this->prefs["language"];
2007 }

Referenced by ilSoapUserAdministration\__readUserData(), ilPortfolioDeclarationOfAuthorship\getForUser(), ilMailTemplateContext\initLanguage(), and ilAccountRegistrationMail\sendLanguageVariableBasedAccountMail().

+ Here is the caller graph for this function:

◆ getLastLogin()

ilObjUser::getLastLogin ( )

returns last login date @access public

Returns
string date

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

2136 {
2137 return $this->last_login;
2138 }

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getLastname()

ilObjUser::getLastname ( )

get lastname @access public

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

1661 {
1662 return $this->lastname;
1663 }

References $lastname.

Referenced by ilSoapUserAdministration\__readUserData(), ilIndividualAssessmentMembers\buildNewRecordOfUser(), exportPersonalData(), getPublicName(), and shibUser\returnNewLoginName().

+ Here is the caller graph for this function:

◆ getLastPasswordChangeTS()

ilObjUser::getLastPasswordChangeTS ( )

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

2047 {
2049 }

References $last_password_change_ts.

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

+ Here is the caller graph for this function:

◆ getLastProfilePrompt()

ilObjUser::getLastProfilePrompt ( )

returns user's last profile prompt

Returns
string ast profile prompt timestamp

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

2172 {
2174 }

References $last_profile_prompt.

◆ getLastUpdate()

ilObjUser::getLastUpdate ( )

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

2186 {
2187 return $this->last_update;
2188 }

References ilObject\$last_update.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getLatitude()

ilObjUser::getLatitude ( )

Get Latitude.

Returns
string Latitude

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

2548 {
2549 return $this->latitude;
2550 }

References $latitude.

Referenced by ilPersonalProfileGUI\addLocationToForm().

+ Here is the caller graph for this function:

◆ getLocationZoom()

ilObjUser::getLocationZoom ( )

Get Location Zoom.

Returns
int Location Zoom

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

2588 {
2589 return $this->loc_zoom;
2590 }

References $loc_zoom.

Referenced by ilPersonalProfileGUI\addLocationToForm().

+ Here is the caller graph for this function:

◆ getLogin()

ilObjUser::getLogin ( )

get login / username @access public

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

1548 {
1549 return $this->login;
1550 }

References $login.

Referenced by ilSoapUserAdministration\__readUserData(), ilIndividualAssessmentMembers\buildNewRecordOfUser(), shibUser\create(), delete(), exportPersonalData(), getPublicName(), ilPasswordAssistanceGUI\submitAssignPasswordForm(), and updateLogin().

+ Here is the caller graph for this function:

◆ getLoginAttempts()

ilObjUser::getLoginAttempts ( )

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

2393 {
2394 return $this->login_attempts;
2395 }

References $login_attempts.

◆ getLoginByUserId()

ilObjUser::getLoginByUserId (   $a_userid)

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

2775 {
2776 $login = ilObjUser::_lookupLogin($a_userid);
2777 return $login ? $login : false;
2778 }
static _lookupLogin($a_user_id)
lookup login

References $login, and _lookupLogin().

+ Here is the call graph for this function:

◆ getLoginFromAuth()

static ilObjUser::getLoginFromAuth ( )
staticprivate

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

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

2637 {
2638 $uid = $GLOBALS['DIC']['ilAuthSession']->getUserId();
2640
2641 // BEGIN WebDAV: Strip Microsoft Domain Names from logins
2642 require_once('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
2645 }
2646 return $login;
2647 }
static toUsernameWithoutDomain($a_login)
Static function removes Microsoft domain name from username webdav related.

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

Referenced by checkUserId(), isCurrentUserActive(), and syncActive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLongitude()

ilObjUser::getLongitude ( )

Get Longitude.

Returns
string Longitude

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

2568 {
2569 return $this->longitude;
2570 }

References $longitude.

Referenced by ilPersonalProfileGUI\addLocationToForm().

+ Here is the caller graph for this function:

◆ getLookingForHelp()

ilObjUser::getLookingForHelp ( )

Get help looking for.

Returns
array $value

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

5754 {
5756 }

References $interests_help_looking.

Referenced by updateMultiTextFields().

+ Here is the caller graph for this function:

◆ getLookingForHelpAsText()

ilObjUser::getLookingForHelpAsText ( )

Get help looking for as plain text.

Returns
string

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

5764 {
5765 return $this->buildTextFromArray("interests_help_looking");
5766 }

References buildTextFromArray().

+ Here is the call graph for this function:

◆ getMatriculation()

ilObjUser::getMatriculation ( )

get matriculation number @access public

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

1911 {
1912 return $this->matriculation;
1913 }

References $matriculation.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getOfferingHelp()

ilObjUser::getOfferingHelp ( )

Get help offering.

Returns
array $value

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

5724 {
5726 }

References $interests_help_offered.

Referenced by updateMultiTextFields().

+ Here is the caller graph for this function:

◆ getOfferingHelpAsText()

ilObjUser::getOfferingHelpAsText ( )

Get help offering as plain text.

Returns
string

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

5734 {
5735 return $this->buildTextFromArray("interests_help_offered");
5736 }

References buildTextFromArray().

+ Here is the call graph for this function:

◆ getOrgUnitsRepresentation()

ilObjUser::getOrgUnitsRepresentation ( )
Returns
String

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

3757 {
3759 }
static lookupOrgUnitsRepresentation($a_usr_id)
lokup org unit representation

References ilObject\getId(), and lookupOrgUnitsRepresentation().

+ Here is the call graph for this function:

◆ getPasswd()

ilObjUser::getPasswd ( )

get password

Returns
password. The password is encoded depending on the current password type. @access public
See also
getPasswdType

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

1571 {
1572 return $this->passwd;
1573 }

References $passwd.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getPasswdType()

ilObjUser::getPasswdType ( )

get password type

Returns
password type (IL_PASSWD_PLAIN, IL_PASSWD_CRYPTED). @access public
See also
getPasswd

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

1581 {
1582 return $this->passwd_type;
1583 }

References $passwd_type.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getPasswordAge()

ilObjUser::getPasswordAge ( )

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

2483 {
2484 $current_ts = time();
2485 $pass_change_ts = $this->getLastPasswordChangeTS();
2486 $password_age = (int) (($current_ts - $pass_change_ts) / 86400);
2487 return $password_age;
2488 }

References getLastPasswordChangeTS().

+ Here is the call graph for this function:

◆ getPasswordEncodingType()

ilObjUser::getPasswordEncodingType ( )
Returns
string

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

305 {
307 }

References $password_encoding_type.

Referenced by ilUserPasswordManager\verifyPassword().

+ Here is the caller graph for this function:

◆ getPasswordSalt()

ilObjUser::getPasswordSalt ( )
Returns
string|null

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

321 {
323 }

References $password_salt.

◆ getPCClipboardContent()

ilObjUser::getPCClipboardContent ( )

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

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

3538 {
3539 global $DIC;
3540
3541 $ilDB = $DIC['ilDB'];
3542
3543 $set = $ilDB->queryF("SELECT MAX(insert_time) mtime FROM personal_pc_clipboard " .
3544 " WHERE user_id = %s", array("integer"), array($this->getId()));
3545 $row = $ilDB->fetchAssoc($set);
3546
3547 $set = $ilDB->queryF(
3548 "SELECT * FROM personal_pc_clipboard " .
3549 " WHERE user_id = %s AND insert_time = %s ORDER BY order_nr ASC",
3550 array("integer", "timestamp"),
3551 array($this->getId(), $row["mtime"])
3552 );
3553 $content = array();
3554 while ($row = $ilDB->fetchAssoc($set)) {
3555 $content[] = $row["content"];
3556 }
3557
3558 return $content;
3559 }

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

+ Here is the call graph for this function:

◆ getPersonalDataExportFile()

ilObjUser::getPersonalDataExportFile ( )

Get personal data export file.

Parameters

return

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

5396 {
5397 include_once("./Services/Export/classes/class.ilExport.php");
5398 $dir = ilExport::_getExportDirectory($this->getId(), "xml", "usr", "personal_data");
5399 if (!is_dir($dir)) {
5400 return "";
5401 }
5402 foreach (ilUtil::getDir($dir) as $entry) {
5403 if (is_int(strpos($entry["entry"], ".zip"))) {
5404 return $entry["entry"];
5405 }
5406 }
5407
5408 return "";
5409 }
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory

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

Referenced by sendPersonalDataFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPersonalPicturePath()

ilObjUser::getPersonalPicturePath (   $a_size = "small",
  $a_force_pic = false 
)

Get path to personal picture.

The result will be cached. The result will be cached.

Parameters
string$a_size"small", "xsmall" or "xxsmall"
bool$a_force_pic
Returns
mixed

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

4065 {
4066 if (isset(self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic])) {
4067 return self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic];
4068 }
4069
4070 self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic] = ilObjUser::_getPersonalPicturePath($this->getId(), $a_size, $a_force_pic);
4071
4072 return self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic];
4073 }

References ilObject\getId().

+ Here is the call graph for this function:

◆ getPersonalWorkspaceDiskQuota()

ilObjUser::getPersonalWorkspaceDiskQuota ( )

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

2037 {
2038 return $this->prefs["wsp_disk_quota"] ? $this->prefs["wsp_disk_quota"] : 0;
2039 }

◆ getPhoneHome()

ilObjUser::getPhoneHome ( )

get home phone @access public

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

1835 {
1836 return $this->phone_home;
1837 }

References $phone_home.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getPhoneMobile()

ilObjUser::getPhoneMobile ( )

get mobile phone @access public

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

1854 {
1855 return $this->phone_mobile;
1856 }

References $phone_mobile.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getPhoneOffice()

ilObjUser::getPhoneOffice ( )

get office phone @access public

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

1816 {
1817 return $this->phone_office;
1818 }

References $phone_office.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getPref()

ilObjUser::getPref (   $a_keyword)

get a user preference

Parameters
stringname of parameter @access public

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

1268 {
1269 if (array_key_exists($a_keyword, $this->prefs)) {
1270 return $this->prefs[$a_keyword];
1271 } else {
1272 return false;
1273 }
1274 }

Referenced by ilSoapUserAdministration\__readUserData(), getDateFormat(), ilPublicUserProfileGUI\getPublicPref(), getTimeFormat(), getTimeZone(), hasDeletionFlag(), and hasPublicProfile().

+ Here is the caller graph for this function:

◆ getProfileIncomplete()

ilObjUser::getProfileIncomplete ( )

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

2413 {
2414 if ($this->id == ANONYMOUS_USER_ID) {
2415 return false;
2416 }
2417 return $this->profile_incomplete;
2418 }

◆ getProfileStatusOfUsers()

static ilObjUser::getProfileStatusOfUsers (   $a_user_ids)
static

Get profile status.

Parameters
array[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 5917 of file class.ilObjUser.php.

5918 {
5919 global $DIC;
5920
5921 $ilDB = $DIC->database();
5922
5923 $set = $ilDB->query(
5924 "SELECT * FROM usr_pref " .
5925 " WHERE keyword = " . $ilDB->quote("public_profile", "text") .
5926 " AND " . $ilDB->in("usr_id", $a_user_ids, false, "integer")
5927 );
5928 $r = array(
5929 "global" => array(),
5930 "local" => array(),
5931 "public" => array(),
5932 "not_public" => array()
5933 );
5934 while ($rec = $ilDB->fetchAssoc($set)) {
5935 if ($rec["value"] == "g") {
5936 $r["global"][] = $rec["usr_id"];
5937 $r["public"][] = $rec["usr_id"];
5938 }
5939 if ($rec["value"] == "y") {
5940 $r["local"][] = $rec["usr_id"];
5941 $r["public"][] = $rec["usr_id"];
5942 }
5943 }
5944 foreach ($a_user_ids as $id) {
5945 if (!in_array($id, $r["public"])) {
5946 $r["not_public"][] = $id;
5947 }
5948 }
5949
5950 return $r;
5951 }

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

Referenced by ilInternalLink\searchUsers().

+ Here is the caller graph for this function:

◆ getPublicName()

ilObjUser::getPublicName ( )

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

Returns
string

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

4950 {
4951 if ($this->hasPublicProfile()) {
4952 return $this->getFirstname() . " " . $this->getLastname() . " (" . $this->getLogin() . ")";
4953 } else {
4954 return $this->getLogin();
4955 }
4956 }
hasPublicProfile()
returns true if public is profile, false otherwise
getFirstname()
get firstname @access public

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

+ Here is the call graph for this function:

◆ getSecondEmail()

ilObjUser::getSecondEmail ( )
Returns
null|string

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

1957 {
1958 return $this->second_email;
1959 }

References $second_email.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getSelectedCountry()

ilObjUser::getSelectedCountry ( )

Get selected country (selection drop down)

Returns
string selected country

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

1797 {
1798 return $this->sel_country;
1799 }

References $sel_country.

◆ getStoredActive()

ilObjUser::getStoredActive (   $a_id)

get user active state

Parameters
integer$a_iduser id @access public
Returns
true if active, otherwise false

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

2330 {
2331 $active = ilObjUser::_lookup($a_id, "active");
2332 return $active ? true : false;
2333 }

References $active, and _lookup().

Referenced by syncActive(), and ilObjUserTest\testCreateSetLookupDelete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStreet()

ilObjUser::getStreet ( )

get street @access public

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

1718 {
1719 return $this->street;
1720 }

References $street.

Referenced by ilSoapUserAdministration\__readUserData(), and ilPersonalProfileGUI\addLocationToForm().

+ Here is the caller graph for this function:

◆ getTimeFormat()

ilObjUser::getTimeFormat ( )

get time format

@access public

Returns

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

1222 {
1223 if ($format = $this->getPref('time_format')) {
1224 return $format;
1225 } else {
1226 include_once('Services/Calendar/classes/class.ilCalendarSettings.php');
1228 return $settings->getDefaultTimeFormat();
1229 }
1230 }

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

+ Here is the call graph for this function:

◆ getTimeLimitFrom()

ilObjUser::getTimeLimitFrom ( )

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

2359 {
2360 return $this->time_limit_from;
2361 }

Referenced by ilSoapUserAdministration\__readUserData(), and checkTimeLimit().

+ Here is the caller graph for this function:

◆ getTimeLimitMessage()

ilObjUser::getTimeLimitMessage ( )

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

2383 {
2384 return $this->time_limit_message;
2385 }

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getTimeLimitOwner()

ilObjUser::getTimeLimitOwner ( )

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

2351 {
2352 return $this->time_limit_owner ? $this->time_limit_owner : 7;
2353 }

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getTimeLimitUnlimited()

ilObjUser::getTimeLimitUnlimited ( )

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

2375 {
2376 return $this->time_limit_unlimited;
2377 }

Referenced by ilSoapUserAdministration\__readUserData(), and checkTimeLimit().

+ Here is the caller graph for this function:

◆ getTimeLimitUntil()

ilObjUser::getTimeLimitUntil ( )

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

2367 {
2368 return $this->time_limit_until;
2369 }

Referenced by ilSoapUserAdministration\__readUserData(), and checkTimeLimit().

+ Here is the caller graph for this function:

◆ getTimeZone()

ilObjUser::getTimeZone ( )

get timezone of user

@access public

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

1205 {
1206 if ($tz = $this->getPref('user_tz')) {
1207 return $tz;
1208 } else {
1209 include_once('Services/Calendar/classes/class.ilCalendarSettings.php');
1211 return $settings->getDefaultTimeZone();
1212 }
1213 }

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

+ Here is the call graph for this function:

◆ getUserDefinedData()

ilObjUser::getUserDefinedData ( )

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

4249 {
4250 return $this->user_defined_data ? $this->user_defined_data : array();
4251 }

◆ getUserIdByLogin()

static ilObjUser::getUserIdByLogin (   $a_login)
static

◆ getUserIdsByEmail()

static ilObjUser::getUserIdsByEmail (   $a_email)
static

STATIC METHOD get all user_ids of an email address.

Parameters
stringemail of user
Returns
array of user ids

@access public

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

2718 : array
2719 {
2720 global $DIC;
2721
2722 $ilias = $DIC['ilias'];
2723 $ilDB = $DIC['ilDB'];
2724
2725 $res = $ilDB->queryF(
2726 "SELECT usr_id FROM usr_data " .
2727 "WHERE email = %s and active = 1",
2728 array("text"),
2729 array($a_email)
2730 );
2731 $ids = array();
2732 while ($row = $ilDB->fetchObject($res)) {
2733 $ids[] = $row->usr_id;
2734 }
2735
2736 return $ids;
2737 }

References $DIC, $ilDB, $ilias, $res, and $row.

Referenced by ilObjSurvey\sendNotificationMail().

+ Here is the caller graph for this function:

◆ getUserLoginsByEmail()

static ilObjUser::getUserLoginsByEmail (   $a_email)
static

get all user login names of an email address

Parameters
stringemail of user
Returns
array with all user login names @access public

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

2746 : array
2747 {
2748 global $DIC;
2749
2750 $ilDB = $DIC->database();
2751
2752 $res = $ilDB->queryF(
2753 "SELECT login FROM usr_data " .
2754 "WHERE email = %s and active = 1",
2755 array("text"),
2756 array($a_email)
2757 );
2758 $ids = array();
2759 while ($row = $ilDB->fetchObject($res)) {
2760 $ids[] = $row->login;
2761 }
2762
2763 return $ids;
2764 }

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

Referenced by ilPasswordAssistanceGUI\submitUsernameAssistanceForm(), and ilObjUserTest\testAuthAndEmailMethods().

+ Here is the caller graph for this function:

◆ getUsersAgreed()

static ilObjUser::getUsersAgreed (   $a_agreed = true,
  $a_users = null 
)
static

Get users that have or have not agreed to the user agreement.

Parameters
bool$a_agreedtrue, if users that have agreed should be returned $
array$a_usersarray of user ids (subset used as base) or null for all users
Returns
array array of user IDs

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

5588 {
5589 global $DIC;
5590
5591 $ilDB = $DIC['ilDB'];
5592
5593 $date_is = ($a_agreed)
5594 ? "IS NOT NULL"
5595 : "IS NULL";
5596
5597 $users = (is_array($a_users))
5598 ? " AND " . $ilDB->in("usr_id", $a_users, false, "integer")
5599 : "";
5600
5601 $set = $ilDB->query("SELECT usr_id FROM usr_data " .
5602 " WHERE agree_date " . $date_is .
5603 $users);
5604 $ret = array();
5605 while ($rec = $ilDB->fetchAssoc($set)) {
5606 $ret[] = $rec["usr_id"];
5607 }
5608 return $ret;
5609 }
$ret
Definition: parser.php:6

References $DIC, $ilDB, $ret, and $users.

Referenced by ilAwarenessUserCollector\collectUsers().

+ Here is the caller graph for this function:

◆ getUserSubsetByPreferenceValue()

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

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

Parameters
array$a_user_idsarray of user IDs
string$a_keywordpreference keyword
string$a_valvalue
Returns
array array of user IDs

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

4853 {
4854 global $DIC;
4855
4856 $ilDB = $DIC['ilDB'];
4857
4858 $users = array();
4859 $set = $ilDB->query(
4860 "SELECT usr_id FROM usr_pref " .
4861 " WHERE keyword = " . $ilDB->quote($a_keyword, "text") .
4862 " AND " . $ilDB->in("usr_id", $a_user_ids, false, "integer") .
4863 " AND value = " . $ilDB->quote($a_val, "text")
4864 );
4865 while ($rec = $ilDB->fetchAssoc($set)) {
4866 $users[] = $rec["usr_id"];
4867 }
4868 return $users;
4869 }

References $DIC, $ilDB, and $users.

Referenced by ilAwarenessUserCollector\collectUsers().

+ Here is the caller graph for this function:

◆ getUTitle()

ilObjUser::getUTitle ( )

get user title (note: don't mix up this method with getTitle() that is derived from ilObject and gets the user object's title) @access public

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

1623 {
1624 return $this->utitle;
1625 }

References $utitle.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ getZipcode()

ilObjUser::getZipcode ( )

get zipcode @access public

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

1756 {
1757 return $this->zipcode;
1758 }

References $zipcode.

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the caller graph for this function:

◆ hasActiveSession()

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

Check for simultaneous login.

Returns
bool

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

2599 {
2600 global $DIC;
2601
2602 $ilDB = $DIC['ilDB'];
2603
2604 $set = $ilDB->queryf(
2605 '
2606 SELECT COUNT(*) session_count
2607 FROM usr_session WHERE user_id = %s AND expires > %s AND session_id != %s ',
2608 array('integer', 'integer', 'text'),
2609 array($a_user_id, time(), $a_session_id)
2610 );
2611 $row = $ilDB->fetchAssoc($set);
2612 return (bool) $row['session_count'];
2613 }

References $DIC, $ilDB, and $row.

Referenced by ilAuthFrontend\checkSimultaneousLogins(), and ilAuthBase\loginObserver().

+ Here is the caller graph for this function:

◆ hasDeletionFlag()

ilObjUser::hasDeletionFlag ( )

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

5656 {
5657 return (bool) $this->getPref("delete_flag");
5658 }

References getPref().

+ Here is the call graph for this function:

◆ hasPublicProfile()

ilObjUser::hasPublicProfile ( )

returns true if public is profile, false otherwise

Returns
boolean

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

4940 {
4941 return in_array($this->getPref("public_profile"), array("y", "g"));
4942 }

References getPref().

Referenced by getPublicName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasToAcceptTermsOfService()

ilObjUser::hasToAcceptTermsOfService ( )
Returns
bool

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

5537 {
5538 require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
5539
5540 if (
5542 null == $this->agree_date &&
5543 'root' != $this->login &&
5544 !in_array($this->getId(), array(ANONYMOUS_USER_ID, SYSTEM_USER_ID))
5545 ) {
5546 return true;
5547 }
5548
5549 return false;
5550 }

References ilObject\getId(), and ilTermsOfServiceHelper\isEnabled().

Referenced by ilSoapUserAdministration\__readUserData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasToAcceptTermsOfServiceInSession()

ilObjUser::hasToAcceptTermsOfServiceInSession (   $status = null)
Parameters
bool | null$status
Returns
void|bool

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

5617 {
5618 if (null === $status) {
5619 return ilSession::get('has_to_accept_agr_in_session');
5620 }
5621
5622 require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
5624 ilSession::set('has_to_accept_agr_in_session', (int) $status);
5625 }
5626 }
static set($a_var, $a_val)
Set a value.
static get($a_var)
Get a value.

References ilSession\get(), ilTermsOfServiceHelper\isEnabled(), and ilSession\set().

+ Here is the call graph for this function:

◆ importPersonalData()

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

Import personal data.

Parameters

return

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

5440 {
5441 include_once("./Services/Export/classes/class.ilImport.php");
5442 $imp = new ilImport();
5443 if (!$a_profile_data) {
5444 $imp->addSkipEntity("Services/User", "usr_profile");
5445 }
5446 if (!$a_settings) {
5447 $imp->addSkipEntity("Services/User", "usr_setting");
5448 }
5449 if (!$a_bookmarks) {
5450 $imp->addSkipEntity("Services/Bookmarks", "bookmarks");
5451 }
5452 if (!$a_notes) {
5453 $imp->addSkipEntity("Services/Notes", "user_notes");
5454 }
5455 if (!$a_calendar) {
5456 $imp->addSkipEntity("Services/Calendar", "calendar");
5457 }
5458 $imp->importEntity(
5459 $a_file["tmp_name"],
5460 $a_file["name"],
5461 "personal_data",
5462 "Services/User"
5463 );
5464 }
Import class.

◆ initInactivationDate()

static ilObjUser::initInactivationDate (   $usrIds)
staticprivate

@global type $ilDB

Parameters
type$usrIds

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

5472 {
5473 global $DIC;
5474
5475 $ilDB = $DIC['ilDB'];
5476
5477 $NOW = $ilDB->now();
5478
5479 $usrId_IN_usrIds = $ilDB->in('usr_id', $usrIds, false, 'integer');
5480
5481 $queryString = "
5482 UPDATE usr_data
5483 SET inactivation_date = $NOW
5484 WHERE inactivation_date IS NULL
5485 AND $usrId_IN_usrIds
5486 ";
5487
5488 $ilDB->manipulate($queryString);
5489 }

References $DIC, and $ilDB.

◆ isAnonymous()

ilObjUser::isAnonymous ( )
Returns
bool

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

5632 {
5633 return self::_isAnonymous($this->getId());
5634 }
static _isAnonymous($usr_id)

References _isAnonymous(), and ilObject\getId().

+ Here is the call graph for this function:

◆ isCaptchaVerified()

ilObjUser::isCaptchaVerified ( )

Is user captcha verified?

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

5352 {
5353 return (boolean) $_SESSION["user_captcha_verified"];
5354 }

References $_SESSION.

◆ isCurrentUserActive()

ilObjUser::isCurrentUserActive ( )

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

2676 {
2677 global $DIC;
2678
2679 $ilDB = $DIC['ilDB'];
2680
2682 $set = $ilDB->queryF(
2683 "SELECT active FROM usr_data WHERE login= %s",
2684 array("text"),
2685 array($login)
2686 );
2687 //query has got a result
2688 if ($rec = $ilDB->fetchAssoc($set)) {
2689 if ($rec["active"]) {
2690 return true;
2691 }
2692 }
2693
2694 return false;
2695 }

References $DIC, $ilDB, $login, and getLoginFromAuth().

+ Here is the call graph for this function:

◆ isDesktopItem()

ilObjUser::isDesktopItem (   $a_item_id,
  $a_type 
)

check wether an item is on the users desktop or not

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

3349 {
3350 return ilObjUser::_isDesktopItem($this->getId(), $a_item_id, $a_type);
3351 }
static _isDesktopItem($a_usr_id, $a_item_id, $a_type)
check wether an item is on the users desktop or not

References $a_type, _isDesktopItem(), and ilObject\getId().

+ Here is the call graph for this function:

◆ isPasswordChangeDemanded()

ilObjUser::isPasswordChangeDemanded ( )
Returns
bool

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

2424 {
2425 if ($this->id == ANONYMOUS_USER_ID) {
2426 return false;
2427 }
2428
2429 if ($this->id == SYSTEM_USER_ID) {
2430 require_once './Services/User/classes/class.ilUserPasswordManager.php';
2431 if (
2432 \ilUserPasswordManager::getInstance()->verifyPassword($this, base64_decode('aG9tZXI=')) &&
2434 ) {
2435 return true;
2436 } else {
2437 return false;
2438 }
2439 }
2440
2441 require_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
2443
2444 if (
2446 $security->isPasswordChangeOnFirstLoginEnabled() &&
2447 $this->getLastPasswordChangeTS() == 0 &&
2448 $this->is_self_registered == false
2449 ) {
2450 return true;
2451 }
2452
2453 return false;
2454 }
static _needsExternalAccountByAuthMode($a_auth_mode)
Check if chosen auth mode needs an external account entry.
getAuthMode($a_auth_key=false)
get auth mode @access public
static _getInstance()
Get instance of ilSecuritySettings.
static getInstance()
Single method to reduce footprint (included files, created instances)

References ilSecuritySettings\_getInstance(), ilAuthUtils\_needsExternalAccountByAuthMode(), getAuthMode(), and ilUserPasswordManager\getInstance().

+ Here is the call graph for this function:

◆ isPasswordExpired()

ilObjUser::isPasswordExpired ( )

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

2457 {
2458 if ($this->id == ANONYMOUS_USER_ID) {
2459 return false;
2460 }
2461
2462 require_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
2464 if ($this->getLastPasswordChangeTS() > 0) {
2465 $max_pass_age = $security->getPasswordMaxAge();
2466 if ($max_pass_age > 0) {
2467 $max_pass_age_ts = ($max_pass_age * 86400);
2468 $pass_change_ts = $this->getLastPasswordChangeTS();
2469 $current_ts = time();
2470
2471 if (($current_ts - $pass_change_ts) > $max_pass_age_ts) {
2473 return true;
2474 }
2475 }
2476 }
2477 }
2478
2479 return false;
2480 }

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

+ Here is the call graph for this function:

◆ isSelfRegistered()

ilObjUser::isSelfRegistered ( )

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

5669 {
5670 return (bool) $this->is_self_registered;
5671 }

References $is_self_registered.

◆ lookupMatriculation()

static ilObjUser::lookupMatriculation (   $a_usr_id)
static

Lookup matriculation.

Returns
string matricualtion
Parameters
int$a_usr_id@access public

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

1922 {
1923 global $DIC;
1924
1925 $ilDB = $DIC['ilDB'];
1926
1927 $query = "SELECT matriculation FROM usr_data " .
1928 "WHERE usr_id = " . $ilDB->quote($a_usr_id);
1929 $res = $ilDB->query($query);
1931 return $row->matriculation ? $row->matriculation : '';
1932 }

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

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

+ Here is the caller graph for this function:

◆ lookupOrgUnitsRepresentation()

static ilObjUser::lookupOrgUnitsRepresentation (   $a_usr_id)
static

lokup org unit representation

Parameters
int$a_usr_id
Returns
string

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

3747 {
3748 require_once('./Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php');
3749 return ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_usr_id);
3750 }

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

+ Here is the caller graph for this function:

◆ preloadIsDesktopItem()

static ilObjUser::preloadIsDesktopItem (   $a_usr_id,
  $a_item_ids 
)
static

Preload desktop item information.

Parameters

return

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

3313 {
3314 global $DIC;
3315
3316 $ilDB = $DIC['ilDB'];
3317
3318 if (!is_array($a_item_ids)) {
3319 return;
3320 }
3321
3322 $item_ids = array();
3323 foreach ($a_item_ids as $id) {
3324 if (!self::$is_desktop_item_loaded[$a_usr_id . ":" . $id]) {
3325 $item_ids[] = $id;
3326 }
3327 self::$is_desktop_item_loaded[$a_usr_id . ":" . $id] = true;
3328 }
3329
3330 if (count($item_ids) > 0) {
3331 $item_set = $ilDB->query("SELECT item_id, type FROM desktop_item WHERE " .
3332 $ilDB->in("item_id", $item_ids, false, "integer") .
3333 " AND user_id = " . $ilDB->quote($a_usr_id, "integer"));
3334 while ($r = $ilDB->fetchAssoc($item_set)) {
3335 self::$is_desktop_item_cache[$a_usr_id . ":" . $r["item_id"] . ":" . $r["type"]]
3336 = true;
3337 }
3338 }
3339 }

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

Referenced by ilObjectListGUIPreloader\preload().

+ Here is the caller graph for this function:

◆ read()

ilObjUser::read ( )

loads a record "user" from database @access private

Reimplemented from ilObject.

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

233 {
234 global $DIC;
235
236 $ilErr = $DIC['ilErr'];
237 $ilDB = $DIC['ilDB'];
238
239 // Alex: I have removed the JOIN to rbac_ua, since there seems to be no
240 // use (3.11.0 alpha)
241 /*$q = "SELECT * FROM usr_data ".
242 "LEFT JOIN rbac_ua ON usr_data.usr_id=rbac_ua.usr_id ".
243 "WHERE usr_data.usr_id= ".$ilDB->quote($this->id); */
244 $r = $ilDB->queryF("SELECT * FROM usr_data " .
245 "WHERE usr_id= %s", array("integer"), array($this->id));
246
247 if ($data = $ilDB->fetchAssoc($r)) {
248 // convert password storage layout used by table usr_data into
249 // storage layout used by class ilObjUser
250 $data["passwd_type"] = IL_PASSWD_CRYPTED;
251
252 // this assign must not be set via $this->assignData($data)
253 // because this method will be called on profile updates and
254 // would set this values to 0, because they arent posted from form
255 $this->setLastPasswordChangeTS($data['last_password_change']);
256 $this->setLoginAttempts($data['login_attempts']);
257
258
259 // fill member vars in one shot
260 $this->assignData($data);
261
262 //get userpreferences from usr_pref table
263 $this->readPrefs();
264
265 //set language to default if not set
266 if ($this->prefs["language"] == "") {
267 $this->prefs["language"] = $this->oldPrefs["language"];
268 }
269
270 //check skin-setting
271 include_once("./Services/Style/System/classes/class.ilStyleDefinition.php");
272 if ($this->prefs["skin"] == "" ||
273 !ilStyleDefinition::skinExists($this->prefs["skin"])) {
274 $this->prefs["skin"] = $this->oldPrefs["skin"];
275 }
276
277 $this->skin = $this->prefs["skin"];
278
279 //check style-setting (skins could have more than one stylesheet
280 if ($this->prefs["style"] == "" ||
281 (!ilStyleDefinition::skinExists($this->skin) && ilStyleDefinition::styleExistsForSkinId($this->skin, $this->prefs["style"]))) {
282 //load default (css)
283 $this->prefs["style"] = $this->ilias->ini->readVariable("layout", "style");
284 }
285
286 if (empty($this->prefs["hits_per_page"])) {
287 $this->prefs["hits_per_page"] = 10;
288 }
289 } else {
290 $ilErr->raiseError("<b>Error: There is no dataset with id " .
291 $this->id . "!</b><br />class: " . get_class($this) . "<br />Script: " . __FILE__ .
292 "<br />Line: " . __LINE__, $ilErr->FATAL);
293 }
294
295 $this->readMultiTextFields();
296 $this->readUserDefinedFields();
297
298 parent::read();
299 }
const IL_PASSWD_CRYPTED
readMultiTextFields()
Fetch multi-text values from DB.
readPrefs()
get all user preferences @access private
setLastPasswordChangeTS($a_last_password_change_ts)
assignData($a_data)
loads a record "user" from array @access public
setLoginAttempts($a_login_attempts)
static skinExists($skin_id, ilSystemStyleConfig $system_style_config=null)
Check whether a skin exists.
static styleExistsForSkinId($skin_id, $style_id)

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

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readMultiTextFields()

ilObjUser::readMultiTextFields ( )
protected

Fetch multi-text values from DB.

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

5786 {
5787 global $DIC;
5788
5789 $ilDB = $DIC['ilDB'];
5790
5791 if (!$this->getId()) {
5792 return;
5793 }
5794
5795 $set = $ilDB->query("SELECT field_id,value" .
5796 " FROM usr_data_multi" .
5797 " WHERE usr_id = " . $ilDB->quote($this->getId(), "integer") .
5798 " ORDER BY value");
5799 while ($row = $ilDB->fetchAssoc($set)) {
5800 $values[$row["field_id"]][] = $row["value"];
5801 }
5802
5803 if (isset($values["interests_general"])) {
5804 $this->setGeneralInterests($values["interests_general"]);
5805 } else {
5806 $this->setGeneralInterests();
5807 }
5808 if (isset($values["interests_help_offered"])) {
5809 $this->setOfferingHelp($values["interests_help_offered"]);
5810 } else {
5811 $this->setOfferingHelp();
5812 }
5813 if (isset($values["interests_help_looking"])) {
5814 $this->setLookingForHelp($values["interests_help_looking"]);
5815 } else {
5816 $this->setLookingForHelp();
5817 }
5818 }
setLookingForHelp(array $value=null)
Set help looking for.
setGeneralInterests(array $value=null)
Set general interests.
setOfferingHelp(array $value=null)
Set help offering.

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

Referenced by read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readPrefs()

ilObjUser::readPrefs ( )

get all user preferences @access private

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

1297 {
1298 global $DIC;
1299
1300 $ilDB = $DIC['ilDB'];
1301
1302 if (is_array($this->prefs)) {
1303 $this->oldPrefs = $this->prefs;
1304 }
1305
1306 $this->prefs = ilObjUser::_getPreferences($this->id);
1307 }
static _getPreferences($user_id)
get preferences for user

References $DIC, $ilDB, $prefs, and _getPreferences().

Referenced by read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readUserDefinedFields()

ilObjUser::readUserDefinedFields ( )

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

4298 {
4299 global $DIC;
4300
4301 $ilDB = $DIC['ilDB'];
4302
4303 include_once("./Services/User/classes/class.ilUserDefinedData.php");
4304 $udata = new ilUserDefinedData($this->getId());
4305
4306 /* $query = "SELECT * FROM udf_data ".
4307 "WHERE usr_id = ".$ilDB->quote($this->getId(),'integer');
4308
4309 $res = $this->db->query($query);
4310 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC))
4311 {
4312 $this->user_defined_data = $row;
4313 }*/
4314
4315 $this->user_defined_data = $udata->getAll();
4316
4317 return true;
4318 }
Class ilUserDefinedData.

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

Referenced by read().

+ 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 @access public

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

877 {
878 global $DIC;
879
880 $ilDB = $DIC['ilDB'];
881
882 $ilDB->manipulateF(
883 "UPDATE usr_data SET " .
884 "last_login = " . $ilDB->now() .
885 " WHERE usr_id = %s",
886 array("integer"),
887 array($this->id)
888 );
889
890 if ($this->getFirstLogin() == "") {
891 $ilDB->manipulateF(
892 "UPDATE usr_data SET " .
893 "first_login = " . $ilDB->now() .
894 " WHERE usr_id = %s",
895 array("integer"),
896 array($this->id)
897 );
898 }
899 }
getFirstLogin()
returns first login date

References $DIC, $ilDB, and getFirstLogin().

+ Here is the call graph for this function:

◆ removeDeletionFlag()

ilObjUser::removeDeletionFlag ( )

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

5651 {
5652 $this->writePref("delete_flag", false);
5653 }

References writePref().

+ Here is the call graph for this function:

◆ removeObjectFromClipboard()

ilObjUser::removeObjectFromClipboard (   $a_item_id,
  $a_type 
)

remove object from 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 3712 of file class.ilObjUser.php.

3713 {
3714 global $DIC;
3715
3716 $ilDB = $DIC['ilDB'];
3717
3718 $q = "DELETE FROM personal_clipboard WHERE " .
3719 "item_id = " . $ilDB->quote($a_item_id, "integer") .
3720 " AND type = " . $ilDB->quote($a_type, "text") . " " .
3721 " AND user_id = " . $ilDB->quote($this->getId(), "integer");
3722 $ilDB->manipulate($q);
3723 }

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

+ Here is the call graph for this function:

◆ removeUserPicture()

ilObjUser::removeUserPicture (   $a_do_update = true)

Remove user picture.

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

4200 {
4201 $webspace_dir = ilUtil::getWebspaceDir();
4202 $image_dir = $webspace_dir . "/usr_images";
4203 $file = $image_dir . "/usr_" . $this->getID() . "." . "jpg";
4204 $thumb_file = $image_dir . "/usr_" . $this->getID() . "_small.jpg";
4205 $xthumb_file = $image_dir . "/usr_" . $this->getID() . "_xsmall.jpg";
4206 $xxthumb_file = $image_dir . "/usr_" . $this->getID() . "_xxsmall.jpg";
4207 $upload_file = $image_dir . "/upload_" . $this->getID();
4208
4209 if ($a_do_update) {
4210 // remove user pref file name
4211 $this->setPref("profile_image", "");
4212 $this->update();
4213 }
4214
4215 if (@is_file($file)) {
4216 unlink($file);
4217 }
4218 if (@is_file($thumb_file)) {
4219 unlink($thumb_file);
4220 }
4221 if (@is_file($xthumb_file)) {
4222 unlink($xthumb_file);
4223 }
4224 if (@is_file($xxthumb_file)) {
4225 unlink($xxthumb_file);
4226 }
4227 if (@is_file($upload_file)) {
4228 unlink($upload_file);
4229 }
4230 }
setPref($a_keyword, $a_value)
set a user preference
update()
update object in db

References ilUtil\getWebspaceDir(), setPref(), and ilObject\update().

Referenced by delete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetInactivationDate()

static ilObjUser::resetInactivationDate (   $usrIds)
staticprivate

@global type $ilDB

Parameters
type$usrIds

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

5497 {
5498 global $DIC;
5499
5500 $ilDB = $DIC['ilDB'];
5501
5502 $usrId_IN_usrIds = $ilDB->in('usr_id', $usrIds, false, 'integer');
5503
5504 $queryString = "
5505 UPDATE usr_data
5506 SET inactivation_date = NULL
5507 WHERE $usrId_IN_usrIds
5508 ";
5509
5510 $ilDB->manipulate($queryString);
5511 }

References $DIC, and $ilDB.

◆ resetLastPasswordChange()

ilObjUser::resetLastPasswordChange ( )

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

2513 {
2514 global $DIC;
2515
2516 $ilDB = $DIC['ilDB'];
2517
2518 $query = "UPDATE usr_data SET last_password_change = 0 " .
2519 "WHERE usr_id = %s";
2520 $affected = $ilDB->manipulateF(
2521 $query,
2522 array('integer'),
2523 array($this->getId())
2524 );
2525 if ($affected) {
2526 return true;
2527 } else {
2528 return false;
2529 }
2530 }

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

+ Here is the call graph for this function:

◆ resetOwner()

ilObjUser::resetOwner ( )

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

5294 {
5295 global $DIC;
5296
5297 $ilDB = $DIC['ilDB'];
5298
5299 $query = "UPDATE object_data SET owner = 0 " .
5300 "WHERE owner = " . $ilDB->quote($this->getId(), 'integer');
5301 $ilDB->query($query);
5302
5303 return true;
5304 }

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

Referenced by delete().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ searchUsers()

static ilObjUser::searchUsers (   $a_search_str,
  $active = 1,
  $a_return_ids_only = false,
  $filter_settings = false 
)
static

STATIC METHOD get the user_ids which correspond a search string.

Parameters
stringsearch string
boolean$activeSearch only for active users
boolean$a_return_ids_onlyReturn only an array of user id's instead of id, login, name, active status
mixed$filter_settingsFilter settings of the user administration view

@access public

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

2791 {
2792 global $DIC;
2793
2794 $ilias = $DIC['ilias'];
2795 $ilDB = $DIC['ilDB'];
2796 $ilLog = $DIC['ilLog'];
2797
2798
2799 $query = "SELECT usr_data.usr_id, usr_data.login, usr_data.firstname, usr_data.lastname, usr_data.email, usr_data.active FROM usr_data ";
2800
2801 $without_anonymous_users = true;
2802
2803 // determine join filter
2804 $join_filter = " WHERE ";
2805 if ($filter_settings !== false && strlen($filter_settings)) {
2806 switch ($filter_settings) {
2807 case 3:
2808 // show only users without courses
2809 $join_filter = " LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id WHERE obj_members.usr_id IS NULL AND ";
2810 break;
2811 case 5:
2812 // show only users with a certain course membership
2813 $ref_id = $_SESSION["user_filter_data"];
2814 if ($ref_id) {
2815 $join_filter = " LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id WHERE obj_members.obj_id = " .
2816 "(SELECT obj_id FROM object_reference WHERE ref_id = " . $ilDB->quote($ref_id, "integer") . ") AND ";
2817 }
2818 break;
2819 case 6:
2820 global $DIC;
2821
2822 $rbacreview = $DIC['rbacreview'];
2823 $ref_id = $_SESSION["user_filter_data"];
2824 if ($ref_id) {
2825 $local_roles = $rbacreview->getRolesOfRoleFolder($ref_id, false);
2826 if (is_array($local_roles) && count($local_roles)) {
2827 $join_filter = " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE " .
2828 $ilDB->in("rbac_ua.rol_id", $local_roles, false, $local_roles) . " AND ";
2829 }
2830 }
2831 break;
2832 case 7:
2833 global $DIC;
2834
2835 $rbacreview = $DIC['rbacreview'];
2836 $rol_id = $_SESSION["user_filter_data"];
2837 if ($rol_id) {
2838 $join_filter = " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id = " .
2839 $ilDB->quote($rol_id, "integer") . " AND ";
2840 $without_anonymous_users = false;
2841 }
2842 break;
2843 }
2844 }
2845 // This is a temporary hack to search users by their role
2846 // See Mantis #338. This is a hack due to Mantis #337.
2847 if (strtolower(substr($a_search_str, 0, 5)) == "role:") {
2848 $query = "SELECT DISTINCT usr_data.usr_id,usr_data.login,usr_data.firstname,usr_data.lastname,usr_data.email " .
2849 "FROM object_data,rbac_ua,usr_data " .
2850 "WHERE " . $ilDB->like("object_data.title", "text", "%" . substr($a_search_str, 5) . "%") .
2851 " AND object_data.type = 'role' " .
2852 "AND rbac_ua.rol_id = object_data.obj_id " .
2853 "AND usr_data.usr_id = rbac_ua.usr_id " .
2854 "AND rbac_ua.usr_id != " . $ilDB->quote(ANONYMOUS_USER_ID, "integer");
2855 } else {
2856 $query .= $join_filter .
2857 "(" . $ilDB->like("usr_data.login", "text", "%" . $a_search_str . "%") . " " .
2858 "OR " . $ilDB->like("usr_data.firstname", "text", "%" . $a_search_str . "%") . " " .
2859 "OR " . $ilDB->like("usr_data.lastname", "text", "%" . $a_search_str . "%") . " " .
2860 "OR " . $ilDB->like("usr_data.email", "text", "%" . $a_search_str . "%") . ") ";
2861
2862 if ($filter_settings !== false && strlen($filter_settings)) {
2863 switch ($filter_settings) {
2864 case 0:
2865 $query .= " AND usr_data.active = " . $ilDB->quote(0, "integer") . " ";
2866 break;
2867 case 1:
2868 $query .= " AND usr_data.active = " . $ilDB->quote(1, "integer") . " ";
2869 break;
2870 case 2:
2871 $query .= " AND usr_data.time_limit_unlimited = " . $ilDB->quote(0, "integer") . " ";
2872 break;
2873 case 4:
2874 $date = strftime("%Y-%m-%d %H:%I:%S", mktime(0, 0, 0, $_SESSION["user_filter_data"]["m"], $_SESSION["user_filter_data"]["d"], $_SESSION["user_filter_data"]["y"]));
2875 $query .= " AND last_login < " . $ilDB->quote($date, "timestamp") . " ";
2876 break;
2877 }
2878 }
2879
2880 if ($without_anonymous_users) {
2881 $query .= "AND usr_data.usr_id != " . $ilDB->quote(ANONYMOUS_USER_ID, "integer");
2882 }
2883
2884 if (is_numeric($active) && $active > -1 && $filter_settings === false) {
2885 $query .= " AND active = " . $ilDB->quote($active, "integer") . " ";
2886 }
2887 }
2888 $ilLog->write($query);
2889 $res = $ilDB->query($query);
2890 while ($row = $ilDB->fetchObject($res)) {
2891 $users[] = array(
2892 "usr_id" => $row->usr_id,
2893 "login" => $row->login,
2894 "firstname" => $row->firstname,
2895 "lastname" => $row->lastname,
2896 "email" => $row->email,
2897 "active" => $row->active);
2898 $ids[] = $row->usr_id;
2899 }
2900 if ($a_return_ids_only) {
2901 return $ids ? $ids : array();
2902 } else {
2903 return $users ? $users : array();
2904 }
2905 }

References $_SESSION, $active, $DIC, $ilDB, $ilias, $ilLog, $query, ilObject\$rbacreview, ilObject\$ref_id, $res, $row, and $users.

Referenced by ilObjUserTest\testSearch().

+ Here is the caller graph for this function:

◆ sendPersonalDataFile()

ilObjUser::sendPersonalDataFile ( )

Send personal data file.

Parameters

return

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

5418 {
5419 include_once("./Services/Export/classes/class.ilExport.php");
5420 $file = ilExport::_getExportDirectory($this->getId(), "xml", "usr", "personal_data") .
5421 "/" . $this->getPersonalDataExportFile();
5422 if (is_file($file)) {
5424 }
5425 }
getPersonalDataExportFile()
Get personal data export file.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.

References ilExport\_getExportDirectory(), ilUtil\deliverFile(), ilObject\getId(), and getPersonalDataExportFile().

+ Here is the call graph for this function:

◆ setActive()

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

set user active state and updates system fields appropriately @access public

Parameters
string$a_activethe active state of the user account
string$a_ownerthe id of the person who approved the account, defaults to 6 (root)

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

2259 {
2260 $this->setOwner($a_owner);
2261
2262 if ($a_active) {
2263 $this->active = 1;
2264 $this->setApproveDate(date('Y-m-d H:i:s'));
2265 $this->setOwner($a_owner);
2266 } else {
2267 $this->active = 0;
2268 $this->setApproveDate(null);
2269 }
2270 }
setApproveDate($a_str)
set date the user account was activated null indicates that the user has not yet been activated @acce...
setOwner($a_owner)
set object owner

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

Referenced by shibUser\create(), shibUser\createFields(), and syncActive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAgreeDate()

ilObjUser::setAgreeDate (   $a_str)

set date the user account was accepted by the user nullindicates that the user has not accepted his account @access public

Returns
void

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

2247 {
2248 $this->agree_date = $a_str;
2249 }

◆ setApproveDate()

ilObjUser::setApproveDate (   $a_str)

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

Returns
void

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

2216 {
2217 $this->approve_date = $a_str;
2218 }

Referenced by setActive().

+ Here is the caller graph for this function:

◆ setAuthMode()

ilObjUser::setAuthMode (   $a_str)

set auth mode @access public

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

3767 {
3768 $this->auth_mode = $a_str;
3769 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setBirthday()

ilObjUser::setBirthday (   $a_birthday)

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

5176 {
5177 if (strlen($a_birthday)) {
5178 $date = new ilDate($a_birthday, IL_CAL_DATE);
5179 $this->birthday = $date->get(IL_CAL_DATE);
5180 } else {
5181 $this->birthday = null;
5182 }
5183 }
const IL_CAL_DATE
Class for single dates.

References IL_CAL_DATE.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setCaptchaVerified()

ilObjUser::setCaptchaVerified (   $a_val)

Set captcha verified.

Parameters

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

5362 {
5363 $_SESSION["user_captcha_verified"] = $a_val;
5364 }

References $_SESSION.

◆ setCity()

ilObjUser::setCity (   $a_str)

set city @access public

Parameters
stringcity

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

1728 {
1729 $this->city = $a_str;
1730 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setClientIP()

ilObjUser::setClientIP (   $a_str)

set client ip number @access public

Parameters
stringclient ip

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

1883 {
1884 $this->client_ip = $a_str;
1885 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setComment()

ilObjUser::setComment (   $a_str)

set referral comment @access public

Parameters
stringhobby

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

2196 {
2197 $this->referral_comment = $a_str;
2198 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setCountry()

ilObjUser::setCountry (   $a_str)

Set country (free text)

@access public

Parameters
stringcountry

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

1767 {
1768 $this->country = $a_str;
1769 }

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

+ Here is the caller graph for this function:

◆ setCurrentLanguage()

ilObjUser::setCurrentLanguage (   $a_val)

Set current language.

Parameters
string$a_valcurrent language

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

2116 {
2117 $_SESSION['lang'] = $a_val;
2118 }

References $_SESSION.

◆ setDepartment()

ilObjUser::setDepartment (   $a_str)

set department @access public

Parameters
stringdepartment

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

1690 {
1691 $this->department = $a_str;
1692 }

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

+ Here is the caller graph for this function:

◆ setDesktopItemParameters()

ilObjUser::setDesktopItemParameters (   $a_item_id,
  $a_type,
  $a_par 
)

set parameters of a desktop item entry

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
string$a_parparameters

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

3187 {
3188 global $DIC;
3189
3190 $ilDB = $DIC['ilDB'];
3191
3192 $ilDB->manipulateF(
3193 "UPDATE desktop_item SET parameters = %s " .
3194 " WHERE item_id = %s AND type = %s AND user_id = %s",
3195 array("text", "integer", "text", "integer"),
3196 array($a_par, $a_item_id, $a_type, $this->getId())
3197 );
3198 }

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

+ Here is the call graph for this function:

◆ setDiskQuota()

ilObjUser::setDiskQuota (   $a_disk_quota)

Sets the minimal disk quota imposed by this user account.

The minimal disk quota is specified in bytes.

@access public

Parameters
integer

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

2018 {
2019 $this->setPref("disk_quota", $a_disk_quota);
2020 }

References setPref().

+ Here is the call graph for this function:

◆ setEmail()

ilObjUser::setEmail (   $a_str)

set email @access public

Parameters
stringemail address

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

1940 {
1941 $this->email = $a_str;
1942 }

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

+ Here is the caller graph for this function:

◆ setExternalAccount()

ilObjUser::setExternalAccount (   $a_str)

set external account

note: 3.7.0 uses this field only for cas and soap authentication.

@access public

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

3793 {
3794 $this->ext_account = $a_str;
3795 }

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

+ Here is the caller graph for this function:

◆ setFax()

ilObjUser::setFax (   $a_str)

set fax @access public

Parameters
stringfax

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

1864 {
1865 $this->fax = $a_str;
1866 }

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

+ Here is the caller graph for this function:

◆ setFirstLogin()

ilObjUser::setFirstLogin (   $a_str)

set user's first login

Parameters
stringlogin date

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

2145 {
2146 $this->first_login = $a_str;
2147 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setFirstname()

ilObjUser::setFirstname (   $a_str)

set firstname @access public

Parameters
stringfirstname

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

1633 {
1634 $this->firstname = $a_str;
1635 }

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

+ Here is the caller graph for this function:

◆ setFullname()

ilObjUser::setFullname (   $a_title = "",
  $a_firstname = "",
  $a_lastname = "" 
)

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. @access static

Parameters
stringtitle (opt.)
stringfirstname (opt.)
stringlastname (opt.)

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

1472 {
1473 $this->fullname = "";
1474
1475 if ($a_title) {
1476 $fullname = $a_title . " ";
1477 } elseif ($this->utitle) {
1478 $this->fullname = $this->utitle . " ";
1479 }
1480
1481 if ($a_firstname) {
1482 $fullname .= $a_firstname . " ";
1483 } elseif ($this->firstname) {
1484 $this->fullname .= $this->firstname . " ";
1485 }
1486
1487 if ($a_lastname) {
1488 return $fullname . $a_lastname;
1489 }
1490
1491 $this->fullname .= $this->lastname;
1492 }

References $fullname, and $lastname.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setGender()

ilObjUser::setGender (   $a_str)

set gender @access public

Parameters
stringgender

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

1591 {
1592 $this->gender = substr($a_str, -1);
1593 }

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

+ Here is the caller graph for this function:

◆ setGeneralInterests()

ilObjUser::setGeneralInterests ( array  $value = null)

Set general interests.

Parameters
array$value

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

5684 {
5685 $this->interests_general = $value;
5686 }

Referenced by readMultiTextFields().

+ Here is the caller graph for this function:

◆ setHobby()

ilObjUser::setHobby (   $a_str)

set hobby @access public

Parameters
stringhobby

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

1975 {
1976 $this->hobby = $a_str;
1977 }

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

+ Here is the caller graph for this function:

◆ setInactivationDate()

ilObjUser::setInactivationDate (   $inactivation_date)

setter for inactivation date

Parameters
string$inactivationDate

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

5519 {
5520 $this->inactivation_date = $inactivation_date;
5521 }

References $inactivation_date.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setInstitution()

ilObjUser::setInstitution (   $a_str)

set institution @access public

Parameters
stringinstitution

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

1671 {
1672 $this->institution = $a_str;
1673 }

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

+ Here is the caller graph for this function:

◆ setIsSelfRegistered()

ilObjUser::setIsSelfRegistered (   $status)
Parameters
bool$status

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

5664 {
5665 $this->is_self_registered = (bool) $status;
5666 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setLanguage()

ilObjUser::setLanguage (   $a_str)

set user language @access public

Parameters
stringlang_key (i.e. de,en,fr,...)

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

1994 {
1995 $this->setPref("language", $a_str);
1996 unset($_SESSION['lang']);
1997 }

References $_SESSION, and setPref().

Referenced by shibUser\createFields(), and shibUser\updateFields().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLastLogin()

ilObjUser::setLastLogin (   $a_str)

set user's last login @access public

Parameters
stringlogin date

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

2126 {
2127 $this->last_login = $a_str;
2128 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setLastname()

ilObjUser::setLastname (   $a_str)

set lastame @access public

Parameters
stringlastname

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

1652 {
1653 $this->lastname = $a_str;
1654 }

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

+ Here is the caller graph for this function:

◆ setLastPasswordChangeToNow()

ilObjUser::setLastPasswordChangeToNow ( )

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

2491 {
2492 global $DIC;
2493
2494 $ilDB = $DIC['ilDB'];
2495
2496 $this->setLastPasswordChangeTS(time());
2497
2498 $query = "UPDATE usr_data SET last_password_change = %s " .
2499 "WHERE usr_id = %s";
2500 $affected = $ilDB->manipulateF(
2501 $query,
2502 array('integer','integer'),
2503 array($this->getLastPasswordChangeTS(),$this->id)
2504 );
2505 if ($affected) {
2506 return true;
2507 } else {
2508 return false;
2509 }
2510 }

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

+ Here is the call graph for this function:

◆ setLastPasswordChangeTS()

ilObjUser::setLastPasswordChangeTS (   $a_last_password_change_ts)

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

2042 {
2043 $this->last_password_change_ts = $a_last_password_change_ts;
2044 }

Referenced by read(), and setLastPasswordChangeToNow().

+ Here is the caller graph for this function:

◆ setLastProfilePrompt()

ilObjUser::setLastProfilePrompt (   $a_str)

set user's last profile prompt

Parameters
stringlast profile prompt timestamp

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

2163 {
2164 $this->last_profile_prompt = $a_str;
2165 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setLastUpdate()

ilObjUser::setLastUpdate (   $a_str)

set last update of user data set @access public

Parameters
stringdate

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

2182 {
2183 $this->last_update = $a_str;
2184 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setLatitude()

ilObjUser::setLatitude (   $a_latitude)

Set Latitude.

Parameters
string$a_latitudeLatitude

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

2538 {
2539 $this->latitude = $a_latitude;
2540 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjUser::setLocationZoom (   $a_locationzoom)

Set Location Zoom.

Parameters
int$a_locationzoomLocation Zoom

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

2578 {
2579 $this->loc_zoom = $a_locationzoom;
2580 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setLogin()

ilObjUser::setLogin (   $a_str)

set login / username @access public

Parameters
stringusername

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

1539 {
1540 $this->login = $a_str;
1541 }

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

+ Here is the caller graph for this function:

◆ setLoginAttempts()

ilObjUser::setLoginAttempts (   $a_login_attempts)

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

2388 {
2389 $this->login_attempts = $a_login_attempts;
2390 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLongitude()

ilObjUser::setLongitude (   $a_longitude)

Set Longitude.

Parameters
string$a_longitudeLongitude

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

2558 {
2559 $this->longitude = $a_longitude;
2560 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setLookingForHelp()

ilObjUser::setLookingForHelp ( array  $value = null)

Set help looking for.

Parameters
array$value

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

5744 {
5745 $this->interests_help_looking = $value;
5746 }

Referenced by readMultiTextFields().

+ Here is the caller graph for this function:

◆ setMatriculation()

ilObjUser::setMatriculation (   $a_str)

set matriculation number @access public

Parameters
stringmatriculation number

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

1902 {
1903 $this->matriculation = $a_str;
1904 }

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

+ Here is the caller graph for this function:

◆ setOfferingHelp()

ilObjUser::setOfferingHelp ( array  $value = null)

Set help offering.

Parameters
array$value

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

5714 {
5715 $this->interests_help_offered = $value;
5716 }

Referenced by readMultiTextFields().

+ Here is the caller graph for this function:

◆ setPasswd()

ilObjUser::setPasswd (   $a_str,
  $a_type = IL_PASSWD_PLAIN 
)

set password @access public

Parameters
stringpasswd

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

1558 {
1559 $this->passwd = $a_str;
1560 $this->passwd_type = $a_type;
1561 }

References $a_type.

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

+ Here is the caller graph for this function:

◆ setPasswordEncodingType()

ilObjUser::setPasswordEncodingType (   $password_encryption_type)
Parameters
string$password_encryption_type

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

313 {
314 $this->password_encoding_type = $password_encryption_type;
315 }

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

+ Here is the caller graph for this function:

◆ setPasswordSalt()

ilObjUser::setPasswordSalt (   $password_salt)
Parameters
string | null$password_salt

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

329 {
330 $this->password_salt = $password_salt;
331 }

References $password_salt.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setPhoneHome()

ilObjUser::setPhoneHome (   $a_str)

set home phone @access public

Parameters
stringhome phone

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

1826 {
1827 $this->phone_home = $a_str;
1828 }

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

+ Here is the caller graph for this function:

◆ setPhoneMobile()

ilObjUser::setPhoneMobile (   $a_str)

set mobile phone @access public

Parameters
stringmobile phone

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

1845 {
1846 $this->phone_mobile = $a_str;
1847 }

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

+ Here is the caller graph for this function:

◆ setPhoneOffice()

ilObjUser::setPhoneOffice (   $a_str)

set office phone @access public

Parameters
stringoffice phone

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

1807 {
1808 $this->phone_office = $a_str;
1809 }

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

+ Here is the caller graph for this function:

◆ setPref()

ilObjUser::setPref (   $a_keyword,
  $a_value 
)

set a user preference

Parameters
stringname of parameter
stringvalue @access public

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

1256 {
1257 if ($a_keyword != "") {
1258 $this->prefs[$a_keyword] = $a_value;
1259 }
1260 }

Referenced by removeUserPicture(), setDiskQuota(), setLanguage(), and writePref().

+ Here is the caller graph for this function:

◆ setProfileIncomplete()

ilObjUser::setProfileIncomplete (   $a_prof_inc)

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

2409 {
2410 $this->profile_incomplete = (boolean) $a_prof_inc;
2411 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setSecondEmail()

ilObjUser::setSecondEmail (   $second_email)
Parameters
null | string$second_email

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

1965 {
1966 $this->second_email = $second_email;
1967 }

References $second_email.

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setSelectedCountry()

ilObjUser::setSelectedCountry (   $a_val)

Set selected country (selection drop down)

Parameters
stringselected country

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

1787 {
1788 $this->sel_country = $a_val;
1789 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setSkin()

ilObjUser::setSkin (   $a_str)

set user skin (template set) @access public

Parameters
stringdirectory name of template set

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

2341 {
2342 // TODO: exception handling (dir exists)
2343 $this->skin = $a_str;
2344 }

◆ setStreet()

ilObjUser::setStreet (   $a_str)

set street @access public

Parameters
stringstreet

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

1709 {
1710 $this->street = $a_str;
1711 }

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

+ Here is the caller graph for this function:

◆ setTimeLimitFrom()

ilObjUser::setTimeLimitFrom (   $a_from)

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

2355 {
2356 $this->time_limit_from = $a_from;
2357 }

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

+ Here is the caller graph for this function:

◆ setTimeLimitMessage()

ilObjUser::setTimeLimitMessage (   $a_time_limit_message)

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

2379 {
2380 return $this->time_limit_message = $a_time_limit_message;
2381 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setTimeLimitOwner()

ilObjUser::setTimeLimitOwner (   $a_owner)

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

2347 {
2348 $this->time_limit_owner = $a_owner;
2349 }

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

+ Here is the caller graph for this function:

◆ setTimeLimitUnlimited()

ilObjUser::setTimeLimitUnlimited (   $a_unlimited)

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

2371 {
2372 $this->time_limit_unlimited = $a_unlimited;
2373 }

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

+ Here is the caller graph for this function:

◆ setTimeLimitUntil()

ilObjUser::setTimeLimitUntil (   $a_until)

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

2363 {
2364 $this->time_limit_until = $a_until;
2365 }

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

+ Here is the caller graph for this function:

◆ setUserDefinedData()

ilObjUser::setUserDefinedData (   $a_data)

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

4234 {
4235 if (!is_array($a_data)) {
4236 return false;
4237 }
4238 foreach ($a_data as $field => $data) {
4239 #$new_data[$field] = ilUtil::stripSlashes($data);
4240 // Assign it directly to avoid update problems of unchangable fields
4241 $this->user_defined_data['f_' . $field] = $data;
4242 }
4243 #$this->user_defined_data = $new_data;
4244
4245 return true;
4246 }

References $data.

◆ setUTitle()

ilObjUser::setUTitle (   $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) @access public

Parameters
stringtitle

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

1612 {
1613 $this->utitle = $a_str;
1614 }

Referenced by assignData().

+ Here is the caller graph for this function:

◆ setZipcode()

ilObjUser::setZipcode (   $a_str)

set zipcode @access public

Parameters
stringzipcode

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

1747 {
1748 $this->zipcode = $a_str;
1749 }

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

+ 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 @access public

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

2306 {
2307 $storedActive = 0;
2308 if ($this->getStoredActive($this->id)) {
2309 $storedActive = 1;
2310 }
2311
2312 $currentActive = 0;
2313 if ($this->active) {
2314 $currentActive = 1;
2315 }
2316
2317 if ((!empty($storedActive) && empty($currentActive)) ||
2318 (empty($storedActive) && !empty($currentActive))) {
2319 $this->setActive($currentActive, self::getUserIdByLogin(ilObjUser::getLoginFromAuth()));
2320 }
2321 }
getStoredActive($a_id)
get user active state
setActive($a_active, $a_owner=0)
set user active state and updates system fields appropriately @access public

References getLoginFromAuth(), getStoredActive(), and setActive().

+ Here is the call graph for this function:

◆ toUsernameWithoutDomain()

static ilObjUser::toUsernameWithoutDomain (   $a_login)
static

Static function removes Microsoft domain name from username webdav related.

Parameters
string$a_login
Returns
string

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

2656 {
2657 // Remove all characters including the last slash or the last backslash
2658 // in the username
2659 $pos = strrpos($a_login, '/');
2660 $pos2 = strrpos($a_login, '\\');
2661 if ($pos === false || $pos < $pos2) {
2662 $pos = $pos2;
2663 }
2664 if ($pos !== false) {
2665 $a_login = substr($a_login, $pos + 1);
2666 }
2667 return $a_login;
2668 }

Referenced by getLoginFromAuth().

+ Here is the caller graph for this function:

◆ updateLogin()

ilObjUser::updateLogin (   $a_login)

update login name

Parameters
stringnew login
Returns
boolean true on success; otherwise false @access public
Exceptions
ilUserException

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

1015 {
1016 global $DIC;
1017
1018 $ilDB = $DIC['ilDB'];
1019 $ilSetting = $DIC['ilSetting'];
1020
1021 if (func_num_args() != 1) {
1022 return false;
1023 }
1024
1025 if (!isset($a_login)) {
1026 return false;
1027 }
1028
1029 $former_login = self::_lookupLogin($this->getId());
1030
1031 // Update not necessary
1032 if (0 == strcmp($a_login, $former_login)) {
1033 return false;
1034 }
1035
1036 try {
1037 $last_history_entry = ilObjUser::_getLastHistoryDataByUserId($this->getId());
1038 } catch (ilUserException $e) {
1039 $last_history_entry = null;
1040 }
1041
1042 // throw exception if the desired loginame is already in history and it is not allowed to reuse it
1043 if ((int) $ilSetting->get('allow_change_loginname') &&
1044 (int) $ilSetting->get('reuse_of_loginnames') == 0 &&
1045 self::_doesLoginnameExistInHistory($a_login)) {
1046 throw new ilUserException($this->lng->txt('loginname_already_exists'));
1047 } elseif ((int) $ilSetting->get('allow_change_loginname') &&
1048 (int) $ilSetting->get('loginname_change_blocking_time') &&
1049 is_array($last_history_entry) &&
1050 $last_history_entry[1] + (int) $ilSetting->get('loginname_change_blocking_time') > time()) {
1051 include_once 'Services/Calendar/classes/class.ilDate.php';
1052 throw new ilUserException(
1053 sprintf(
1054 $this->lng->txt('changing_loginname_not_possible_info'),
1056 new ilDateTime($last_history_entry[1], IL_CAL_UNIX)
1057 ),
1059 new ilDateTime(($last_history_entry[1] + (int) $ilSetting->get('loginname_change_blocking_time')), IL_CAL_UNIX)
1060 )
1061 )
1062 );
1063 } else {
1064 // log old loginname in history
1065 if ((int) $ilSetting->get('allow_change_loginname') &&
1066 (int) $ilSetting->get('create_history_loginname')) {
1067 ilObjUser::_writeHistory($this->getId(), $former_login);
1068 }
1069
1070 //update login
1071 $this->login = $a_login;
1072
1073 $ilDB->manipulateF(
1074 '
1075 UPDATE usr_data
1076 SET login = %s
1077 WHERE usr_id = %s',
1078 array('text', 'integer'),
1079 array($this->getLogin(), $this->getId())
1080 );
1081 }
1082
1083 return true;
1084 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static _getLastHistoryDataByUserId($a_usr_id)
Returns the last used loginname and the changedate of the passed user_id.
static _writeHistory($a_usr_id, $a_login)

References $DIC, $ilDB, $ilSetting, _getLastHistoryDataByUserId(), _lookupLogin(), _writeHistory(), ilDatePresentation\formatDate(), ilObject\getId(), getLogin(), and IL_CAL_UNIX.

+ Here is the call graph for this function:

◆ updateMultiTextFields()

ilObjUser::updateMultiTextFields (   $a_create = false)

Write multi-text values to DB.

Parameters
bool$a_create

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

5826 {
5827 global $DIC;
5828
5829 $ilDB = $DIC['ilDB'];
5830
5831 if (!$this->getId()) {
5832 return;
5833 }
5834
5835 if (!$a_create) {
5836 $this->deleteMultiTextFields();
5837 }
5838
5839 $map = array(
5840 "interests_general" => $this->getGeneralInterests(),
5841 "interests_help_offered" => $this->getOfferingHelp(),
5842 "interests_help_looking" => $this->getLookingForHelp()
5843 );
5844
5845 foreach ($map as $id => $values) {
5846 if (is_array($values) && sizeof($values)) {
5847 foreach ($values as $value) {
5848 $value = trim($value);
5849 if ($value) {
5850 $uniq_id = $ilDB->nextId('usr_data_multi');
5851
5852 $ilDB->manipulate("INSERT usr_data_multi" .
5853 " (id,usr_id,field_id,value) VALUES" .
5854 " (" . $ilDB->quote($uniq_id, "integer") .
5855 "," . $ilDB->quote($this->getId(), "integer") .
5856 "," . $ilDB->quote($id, "text") .
5857 "," . $ilDB->quote($value, "text") .
5858 ")");
5859 }
5860 }
5861 }
5862 }
5863 }
getGeneralInterests()
Get general interests.
getOfferingHelp()
Get help offering.
getLookingForHelp()
Get help looking for.

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

+ Here is the call graph for this function:

◆ updateUserDefinedFields()

ilObjUser::updateUserDefinedFields ( )

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

4254 {
4255 global $DIC;
4256
4257 $ilDB = $DIC['ilDB'];
4258
4259 $fields = '';
4260
4261 $field_def = array();
4262
4263 include_once("./Services/User/classes/class.ilUserDefinedData.php");
4264 $udata = new ilUserDefinedData($this->getId());
4265
4266 foreach ($this->user_defined_data as $field => $value) {
4267 if ($field != 'usr_id') {
4268 // $field_def[$field] = array('text',$value);
4269 $udata->set($field, $value);
4270 }
4271 }
4272 $udata->update();
4273
4274 /* if(!$field_def)
4275 {
4276 return true;
4277 }
4278
4279 $query = "SELECT usr_id FROM udf_data WHERE usr_id = ".$ilDB->quote($this->getId(),'integer');
4280 $res = $ilDB->query($query);
4281
4282
4283 if($res->numRows())
4284 {
4285 // Update
4286 $ilDB->update('udf_data',$field_def,array('usr_id' => array('integer',$this->getId())));
4287 }
4288 else
4289 {
4290 $field_def['usr_id'] = array('integer',$this->getId());
4291 $ilDB->insert('udf_data',$field_def);
4292 }
4293 */
4294 return true;
4295 }

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

+ Here is the call graph for this function:

◆ userExists()

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

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

5334 {
5335 global $DIC;
5336
5337 $ilDB = $DIC['ilDB'];
5338
5339 $query = 'SELECT count(*) num FROM object_data od ' .
5340 'JOIN usr_data ud ON obj_id = usr_id ' .
5341 'WHERE ' . $ilDB->in('obj_id', $a_usr_ids, false, 'integer') . ' ';
5342 $res = $ilDB->query($query);
5343 $num_rows = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)->num;
5344 return $num_rows == count((array) $a_usr_ids);
5345 }

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

Referenced by ilInfoScreenGUI\addObjectSections(), and ilObjForumAccess\getCachedUserInstance().

+ Here is the caller graph for this function:

◆ writeAccepted()

ilObjUser::writeAccepted ( )

write accept date of user agreement to db

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

669 {
670 global $DIC;
671
672 $ilDB = $DIC['ilDB'];
673
674 $ilDB->manipulateF("UPDATE usr_data SET agree_date = " . $ilDB->now() .
675 " WHERE usr_id = %s", array("integer"), array($this->getId()));
676 }

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

+ Here is the call graph for this function:

◆ writePref()

ilObjUser::writePref (   $a_keyword,
  $a_value 
)

write userpref to user table @access private

Parameters
stringkeyword
stringvalue

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

1093 {
1094 self::_writePref($this->id, $a_keyword, $a_value);
1095 $this->setPref($a_keyword, $a_value);
1096 }

References _writePref(), and setPref().

Referenced by activateDeletionFlag(), and removeDeletionFlag().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writePrefs()

ilObjUser::writePrefs ( )

write all userprefs @access private

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

1187 {
1188 global $DIC;
1189
1190 $ilDB = $DIC['ilDB'];
1191
1192 ilObjUser::_deleteAllPref($this->id);
1193 foreach ($this->prefs as $keyword => $value) {
1194 self::_writePref($this->id, $keyword, $value);
1195 }
1196 }

References $DIC, $ilDB, _deleteAllPref(), and _writePref().

+ Here is the call graph for this function:

Field Documentation

◆ $active

◆ $agree_date

ilObjUser::$agree_date = null

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

Referenced by getAgreeDate().

◆ $approve_date

ilObjUser::$approve_date = null

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

Referenced by getApproveDate().

◆ $auth_mode

ilObjUser::$auth_mode

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

Referenced by getAuthMode().

◆ $birthday

ilObjUser::$birthday
protected

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

Referenced by getBirthday().

◆ $city

ilObjUser::$city

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

Referenced by getCity().

◆ $client_ip

ilObjUser::$client_ip

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

Referenced by getClientIP().

◆ $country

ilObjUser::$country

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

Referenced by getCountry().

◆ $default_role

ilObjUser::$default_role

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

◆ $department

ilObjUser::$department

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

Referenced by getDepartment().

◆ $email

ilObjUser::$email

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

Referenced by getEmail().

◆ $fax

ilObjUser::$fax

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

Referenced by getFax().

◆ $first_login

ilObjUser::$first_login
protected

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

Referenced by getFirstLogin().

◆ $firstname

ilObjUser::$firstname

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

Referenced by getFirstname().

◆ $fullname

ilObjUser::$fullname

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

Referenced by _lookupFullname(), and setFullname().

◆ $gender

ilObjUser::$gender

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

Referenced by getGender().

◆ $hobby

ilObjUser::$hobby

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

Referenced by getHobby().

◆ $ilias

ilObjUser::$ilias

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

Referenced by __construct(), getUserIdsByEmail(), and searchUsers().

◆ $inactivation_date

ilObjUser::$inactivation_date = null
protected

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

Referenced by getInactivationDate(), and setInactivationDate().

◆ $institution

ilObjUser::$institution

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

Referenced by getInstitution().

◆ $interests_general

ilObjUser::$interests_general
protected

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

Referenced by getGeneralInterests().

◆ $interests_help_looking

ilObjUser::$interests_help_looking
protected

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

Referenced by getLookingForHelp().

◆ $interests_help_offered

ilObjUser::$interests_help_offered
protected

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

Referenced by getOfferingHelp().

◆ $is_desktop_item_cache

ilObjUser::$is_desktop_item_cache
static

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

◆ $is_desktop_item_loaded

ilObjUser::$is_desktop_item_loaded
static

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

◆ $is_self_registered

ilObjUser::$is_self_registered = false
private

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

Referenced by isSelfRegistered().

◆ $last_password_change_ts

ilObjUser::$last_password_change_ts

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

Referenced by getLastPasswordChangeTS().

◆ $last_profile_prompt

ilObjUser::$last_profile_prompt
protected

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

Referenced by getLastProfilePrompt().

◆ $lastname

ilObjUser::$lastname

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

Referenced by getLastname(), and setFullname().

◆ $latitude

ilObjUser::$latitude

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

Referenced by getLatitude().

◆ $loc_zoom

ilObjUser::$loc_zoom

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

Referenced by getLocationZoom().

◆ $login

ilObjUser::$login

all user related data in single vars @access public

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

Referenced by checkUserId(), getLogin(), getLoginByUserId(), getLoginFromAuth(), isCurrentUserActive(), and shibUser\returnNewLoginName().

◆ $login_attempts

ilObjUser::$login_attempts

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

Referenced by _getLoginAttempts(), and getLoginAttempts().

◆ $longitude

ilObjUser::$longitude

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

Referenced by getLongitude().

◆ $matriculation

ilObjUser::$matriculation

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

Referenced by getMatriculation().

◆ $org_units

ilObjUser::$org_units
protected

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

◆ $passwd

ilObjUser::$passwd
protected

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

Referenced by getPasswd().

◆ $passwd_type

ilObjUser::$passwd_type
protected

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

Referenced by getPasswdType().

◆ $password_encoding_type

ilObjUser::$password_encoding_type
protected

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

Referenced by getPasswordEncodingType().

◆ $password_salt

ilObjUser::$password_salt = null
protected

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

Referenced by getPasswordSalt(), and setPasswordSalt().

◆ $personal_image_cache

ilObjUser::$personal_image_cache = array()
staticprotected

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

◆ $phone_home

ilObjUser::$phone_home

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

Referenced by getPhoneHome().

◆ $phone_mobile

ilObjUser::$phone_mobile

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

Referenced by getPhoneMobile().

◆ $phone_office

ilObjUser::$phone_office

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

Referenced by getPhoneOffice().

◆ $prefs

ilObjUser::$prefs

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

Referenced by _getPreferences(), and readPrefs().

◆ $referral_comment

ilObjUser::$referral_comment

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

Referenced by getComment().

◆ $second_email

ilObjUser::$second_email = null
protected

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

Referenced by getSecondEmail(), and setSecondEmail().

◆ $sel_country

ilObjUser::$sel_country

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

Referenced by getSelectedCountry().

◆ $skin

ilObjUser::$skin

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

Referenced by __construct().

◆ $street

ilObjUser::$street

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

Referenced by getStreet().

◆ $user_defined_data

ilObjUser::$user_defined_data = array()

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

◆ $utitle

ilObjUser::$utitle

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

Referenced by getUTitle().

◆ $zipcode

ilObjUser::$zipcode

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

Referenced by getZipcode().


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