ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 public. More...
 
 read ()
 loads a record "user" from database private More...
 
 getPasswordEncodingType ()
 
 setPasswordEncodingType ($password_encryption_type)
 
 getPasswordSalt ()
 
 setPasswordSalt ($password_salt)
 
 assignData ($a_data)
 loads a record "user" from array public More...
 
 writeAccepted ()
 write accept date of user agreement to db More...
 
 _lookupFullname ($a_user_id)
 Lookup Full Name. More...
 
 _lookupIm ($a_user_id, $a_type)
 Lookup IM. More...
 
 _lookupEmail ($a_user_id)
 Lookup email. More...
 
 _lookupClientIP ($a_user_id)
 Lookup client ip. More...
 
 _lookupFields ($a_user_id)
 lookup fields (deprecated; use more specific methods instead) More...
 
 _lookupExternalAccount ($a_user_id)
 lookup external account for login and authmethod More...
 
 _lookupLastLogin ($a_user_id)
 lookup last login More...
 
 refreshLogin ()
 updates the login data of a "user" // TODO set date with now() should be enough public More...
 
 updateLogin ($a_login)
 update login name More...
 
 writePref ($a_keyword, $a_value)
 write userpref to user table private More...
 
 deletePref ($a_keyword)
 Deletes a userpref value of the user from the database public. More...
 
 _deleteAllPref ($a_user_id)
 Deletes a userpref value of the user from the database public. More...
 
 writePrefs ()
 write all userprefs 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...
 
 _lookupPref ($a_usr_id, $a_keyword)
 
 readPrefs ()
 get all user preferences private More...
 
 delete ()
 deletes a user 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 public More...
 
 setLogin ($a_str)
 set login / username public More...
 
 getLogin ()
 get login / username public More...
 
 setPasswd ($a_str, $a_type=IL_PASSWD_PLAIN)
 set password public More...
 
 getPasswd ()
 get password More...
 
 getPasswdType ()
 get password type More...
 
 setGender ($a_str)
 set gender public More...
 
 getGender ()
 get gender 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) 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) public More...
 
 setFirstname ($a_str)
 set firstname public More...
 
 getFirstname ()
 get firstname public More...
 
 setLastname ($a_str)
 set lastame public More...
 
 getLastname ()
 get lastname public More...
 
 setInstitution ($a_str)
 set institution public More...
 
 getInstitution ()
 get institution public More...
 
 setDepartment ($a_str)
 set department public More...
 
 getDepartment ()
 get department public More...
 
 setStreet ($a_str)
 set street public More...
 
 getStreet ()
 get street public More...
 
 setCity ($a_str)
 set city public More...
 
 getCity ()
 get city public More...
 
 setZipcode ($a_str)
 set zipcode public More...
 
 getZipcode ()
 get zipcode 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 public More...
 
 getPhoneOffice ()
 get office phone public More...
 
 setPhoneHome ($a_str)
 set home phone public More...
 
 getPhoneHome ()
 get home phone public More...
 
 setPhoneMobile ($a_str)
 set mobile phone public More...
 
 getPhoneMobile ()
 get mobile phone public More...
 
 setFax ($a_str)
 set fax public More...
 
 getFax ()
 get fax public More...
 
 setClientIP ($a_str)
 set client ip number public More...
 
 getClientIP ()
 get client ip number public More...
 
 setMatriculation ($a_str)
 set matriculation number public More...
 
 getMatriculation ()
 get matriculation number public More...
 
 setEmail ($a_str)
 set email public More...
 
 getEmail ()
 get email address public More...
 
 setHobby ($a_str)
 set hobby public More...
 
 getHobby ()
 get hobby public More...
 
 setLanguage ($a_str)
 set user language public More...
 
 getLanguage ()
 returns a 2char-language-string 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 ()
 
 _writeExternalAccount ($a_usr_id, $a_ext_id)
 
 _writeAuthMode ($a_usr_id, $a_auth_mode)
 
 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 public More...
 
 getLastLogin ()
 returns last login date public More...
 
 setLastUpdate ($a_str)
 set last update of user data set public More...
 
 getLastUpdate ()
 
 setComment ($a_str)
 set referral comment public More...
 
 getComment ()
 get referral comment public More...
 
 setApproveDate ($a_str)
 set date the user account was activated null indicates that the user has not yet been activated public More...
 
 getApproveDate ()
 get the date when the user account was approved public More...
 
 getAgreeDate ()
 get the date when the user accepted the user agreement public More...
 
 setAgreeDate ($a_str)
 set date the user account was accepted by the user nullindicates that the user has not accepted his account public More...
 
 setActive ($a_active, $a_owner=0)
 set user active state and updates system fields appropriately public More...
 
 getActive ()
 get user active state public More...
 
 _lookupActive ($a_usr_id)
 Check user account active. 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 public More...
 
 getStoredActive ($a_id)
 get user active state More...
 
 setSkin ($a_str)
 set user skin (template set) 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...
 
getAppliedUsers ()
 
 isChild ($a_usr_id)
 
 __readAppliedUsers ($a_parent_id)
 
 checkUserId ()
 
 isCurrentUserActive ()
 
 getUserIdByLogin ($a_login)
 
 getLoginByUserId ($a_userid)
 
 _getNumberOfUsersForStyle ($a_skin, $a_style)
 skins and styles More...
 
 _getAllUserAssignedStyles ()
 skins and styles More...
 
 _moveUsersToStyle ($a_from_skin, $a_from_style, $a_to_skin, $a_to_style)
 skins and styles More...
 
 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...
 
 _getUsersForClipboadObject ($a_type, $a_id)
 get all users, that have a certain object within their clipboard More...
 
 removeObjectFromClipboard ($a_item_id, $a_type)
 remove object from user's personal clipboard More...
 
 _getImportedUserId ($i2_id)
 
 setAuthMode ($a_str)
 set auth mode public More...
 
 getAuthMode ($a_auth_key=false)
 get auth mode public More...
 
 setExternalAccount ($a_str)
 set external account More...
 
 getExternalAccount ()
 get external account More...
 
 _getNumberOfUsersPerAuthMode ()
 get number of users per auth mode More...
 
 _getLocalAccountsForEmail ($a_email)
 check whether external account and authentication method matches with a user More...
 
 _uploadPersonalPicture ($tmp_file, $obj_id)
 Create a personal picture image file from a temporary image file. 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 ()
 
 setInstantMessengerId ($a_im_type, $a_im_id)
 
 getInstantMessengerId ($a_im_type)
 
 setDelicious ($a_delicious)
 
 getDelicious ()
 
 _lookupFeedHash ($a_user_id, $a_create=false)
 Lookup news feed hash for user. More...
 
 _getFeedPass ($a_user_id)
 Lookup news feed password for user. More...
 
 _setFeedPass ($a_user_id, $a_password)
 Set news feed password for user. More...
 
 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
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title 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...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) 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...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type 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...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 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...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. 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 _lookupGender ($a_user_id)
 Lookup gender. More...
 
static _lookupName ($a_user_id)
 lookup user name More...
 
static _lookupLogin ($a_user_id)
 lookup login More...
 
static _lookupId ($a_user_str)
 Lookup id by 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 _writePref ($a_usr_id, $a_keyword, $a_value)
 
static lookupMatriculation ($a_usr_id)
 Lookup matriculation. More...
 
static _lookupLanguage ($a_usr_id)
 
static hasActiveSession ($a_user_id)
 Check for simultaneous login. More...
 
 _getUserIdsByEmail ($a_email)
 STATIC METHOD get all user_ids of an email address. More...
 
 getUserIdByEmail ($a_email)
 STATIC METHOD get the user_id 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...
 
 _getAllUserLogins (&$ilias)
 STATIC METHOD get all user logins. More...
 
static _readUsersProfileData ($a_user_ids)
 STATIC METHOD get user data of selected users. More...
 
 _getAllUserData ($a_fields=NULL, $active=-1)
 STATIC METHOD get all user data. 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 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 _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)
 check whether external account and authentication method matches with a user More...
 
static _getPersonalPicturePath ($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
 Get path to personal picture. More...
 
static copyProfilePicturesToDirectory ($a_user_id, $a_dir)
 Get profile picture direcotory. 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 public 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 _getAssociatedUsersOnline ($a_user_id, $a_no_anonymous=false)
 
reads all active sessions from db and returns users that are online
and who have a local role in a group or a course for which the

the current user has also a local role. More...

 
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 Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _lookupImportId ($a_obj_id)
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data 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 _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. 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 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 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
 
 $im_icq
 
 $im_yahoo
 
 $im_msn
 
 $im_aim
 
 $im_skype
 
 $im_jabber
 
 $im_voip
 
 $delicious
 
 $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
 
 $ilias
 
 $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
 
 $obj_data_record
 object_data record More...
 

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
 
 $inactivation_date = null
 
 $interests_general
 
 $interests_help_offered
 
 $interests_help_looking
 

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)
 type $ilDB More...
 
static resetInactivationDate ($usrIds)
 type $ilDB More...
 

Private Attributes

 $is_self_registered = false
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor public.

Parameters
integeruser_id

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

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

176  {
177  global $ilias,$ilDB;
178 
179  // init variables
180  $this->ilias =& $ilias;
181  $this->db =& $ilDB;
182 
183  $this->type = "usr";
184  parent::__construct($a_user_id, $a_call_by_reference);
185  $this->auth_mode = "default";
186  $this->passwd_type = IL_PASSWD_PLAIN;
187 
188  // for gender selection. don't change this
189  /*$this->gender = array(
190  'm' => "salutation_m",
191  'f' => "salutation_f"
192  );*/
193  if ($a_user_id > 0)
194  {
195  $this->setId($a_user_id);
196  $this->read();
197  }
198  else
199  {
200  // TODO: all code in else-structure doesn't belongs in class user !!!
201  //load default data
202  $this->prefs = array();
203  //language
204  $this->prefs["language"] = $this->ilias->ini->readVariable("language","default");
205 
206  //skin and pda support
207  $this->skin = $this->ilias->ini->readVariable("layout","skin");
208 
209  $this->prefs["skin"] = $this->skin;
210 // $this->prefs["show_users_online"] = "y";
211 
212  //style (css)
213  $this->prefs["style"] = $this->ilias->ini->readVariable("layout","style");
214  }
215  }
const IL_PASSWD_PLAIN
setId($a_id)
set object id public
read()
loads a record "user" from database private
redirection script todo: (a better solution should control the processing via a xml file) ...
global $ilDB
+ Here is the call graph for this function:

Member Function Documentation

◆ __readAppliedUsers()

ilObjUser::__readAppliedUsers (   $a_parent_id)

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

References $ilDB, $res, and $row.

Referenced by getAppliedUsers(), and isChild().

2517  {
2518  global $ilDB;
2519 
2520  $res = $ilDB->queryF("SELECT usr_id FROM usr_data ".
2521  "WHERE time_limit_owner = %s",
2522  array("integer"),
2523  array($a_parent_id));
2524  while ($row = $ilDB->fetchObject($res))
2525  {
2526  $this->applied_users[] = $row->usr_id;
2527 
2528  // recursion
2529  $this->__readAppliedUsers($row->usr_id);
2530  }
2531  return true;
2532  }
global $ilDB
__readAppliedUsers($a_parent_id)
+ Here is the caller graph for this function:

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

References $ilDB, and ilCalendarCategories\deletePDItemsCache().

Referenced by ilRbacAdmin\addDesktopItem(), ilParticipant\addDesktopItem(), ilParticipants\addDesktopItem(), addDesktopItem(), ilDesktopItemGUI\addToDesktop(), ilAccountCode\applyRoleAssignments(), ilUserImportParser\assignToRole(), ilECSEnrolmentStatusCommandQueueHandler\doUpdate(), ilObjSurvey\inviteGroup(), ilObjSurvey\inviteRole(), ilObjSurvey\inviteUser(), and ilAccountRegistrationGUI\saveForm().

3057  {
3058  global $ilDB;
3059 
3060  $item_set = $ilDB->queryF("SELECT * FROM desktop_item WHERE ".
3061  "item_id = %s AND type = %s AND user_id = %s",
3062  array("integer", "text", "integer"),
3063  array($a_item_id, $a_type, $a_usr_id));
3064 
3065  // only insert if item is not already on desktop
3066  if (!$ilDB->fetchAssoc($item_set))
3067  {
3068  $ilDB->manipulateF("INSERT INTO desktop_item (item_id, type, user_id, parameters) VALUES ".
3069  " (%s,%s,%s,%s)", array("integer", "text", "integer", "text"),
3070  array($a_item_id,$a_type,$a_usr_id,$a_par));
3071  }
3072 
3073  include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
3075  }
static deletePDItemsCache($a_usr_id)
Delete cache (add remove desktop item)
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _checkExternalAuthAccount()

static ilObjUser::_checkExternalAuthAccount (   $a_auth,
  $a_account 
)
static

check whether external account and authentication method matches with a user

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

References $ilDB, $ilSetting, $r, $res, and ilAuthUtils\_getAuthModeName().

Referenced by ilSoapAuthentication\__checkAgreement(), ilSoapAuthenticationCAS\authenticate(), ilAuthContainerLDAP\extractUserName(), ilAuthContainerSOAP\fetchData(), ilAuthContainerApache\forceCreation(), ilUserImportParser\importEndTag(), ilCASAuth\login(), ilAuthContainerCAS\loginObserver(), ilAuthContainerRadius\loginObserver(), ilAuthContainerOpenId\loginObserver(), ilLDAPUserSynchronisation\readInternalAccount(), ilLDAPQuery\readUserData(), ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus(), ilObjUserTest\testAuthAndEmailMethods(), ilObjUserGUI\updateObjectOld(), ilAuthContainerApache\updateRequired(), ilAuthContainerLDAP\updateRequired(), and ilUserImportParser\verifyEndTag().

3767  {
3768  global $ilDB,$ilSetting;
3769 
3770  // Check directly with auth_mode
3771  $r = $ilDB->queryF("SELECT * FROM usr_data WHERE ".
3772  " ext_account = %s AND auth_mode = %s",
3773  array("text", "text"),
3774  array($a_account, $a_auth));
3775  if ($usr = $ilDB->fetchAssoc($r))
3776  {
3777  return $usr["login"];
3778  }
3779 
3780  // For compatibility, check for login (no ext_account entry given)
3781  $res = $ilDB->queryF("SELECT login FROM usr_data ".
3782  "WHERE login = %s AND auth_mode = %s AND ext_account IS NULL ",
3783  array("text", "text"),
3784  array($a_account, $a_auth));
3785  if($usr = $ilDB->fetchAssoc($res))
3786  {
3787  return $usr['login'];
3788  }
3789 
3790  // If auth_default == $a_auth => check for login
3791  if(ilAuthUtils::_getAuthModeName($ilSetting->get('auth_mode')) == $a_auth)
3792  {
3793  $res = $ilDB->queryF("SELECT login FROM usr_data WHERE ".
3794  " ext_account = %s AND auth_mode = %s",
3795  array("text", "text"),
3796  array($a_account, "default"));
3797  if ($usr = $ilDB->fetchAssoc($res))
3798  {
3799  return $usr["login"];
3800  }
3801  // Search for login (no ext_account given)
3802  $res = $ilDB->queryF("SELECT login FROM usr_data ".
3803  "WHERE login = %s AND (ext_account IS NULL OR ext_account = '') AND auth_mode = %s",
3804  array("text", "text"),
3805  array($a_account, "default"));
3806  if($usr = $ilDB->fetchAssoc($res))
3807  {
3808  return $usr["login"];
3809  }
3810  }
3811  return false;
3812  }
static _getAuthModeName($a_auth_key)
$r
Definition: example_031.php:79
global $ilSetting
Definition: privfeed.php:40
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteAllPref()

ilObjUser::_deleteAllPref (   $a_user_id)

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

Parameters
stringkeyword

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

References $ilDB.

Referenced by delete(), and writePrefs().

1121  {
1122  global $ilDB;
1123 
1124  $ilDB->manipulateF("DELETE FROM usr_pref WHERE usr_id = %s",
1125  array("integer"), array($a_user_id));
1126  }
global $ilDB
+ Here is the caller graph for this function:

◆ _doesLoginnameExistInHistory()

static ilObjUser::_doesLoginnameExistInHistory (   $a_login)
static

Checks wether the passed loginname already exists in history.

public

Parameters
string$a_loginLoginname
Returns
boolean true or false

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

References $ilDB, and $res.

Referenced by ilAccountRegistrationGUI\saveForm().

953  {
954  global $ilDB;
955 
956  $res = $ilDB->queryF('
957  SELECT * FROM loginname_history
958  WHERE login = %s',
959  array('text'), array($a_login));
960 
961  return $ilDB->fetchAssoc($res) ? true : false;
962  }
global $ilDB
+ 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 3117 of file class.ilObjUser.php.

References $ilDB, and ilCalendarCategories\deletePDItemsCache().

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

3118  {
3119  global $ilDB;
3120 
3121  $ilDB->manipulateF("DELETE FROM desktop_item WHERE ".
3122  " item_id = %s AND type = %s AND user_id = %s",
3123  array("integer", "text", "integer"),
3124  array($a_item_id, $a_type, $a_usr_id));
3125 
3126  include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
3128  }
static deletePDItemsCache($a_usr_id)
Delete cache (add remove desktop item)
global $ilDB
+ 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.

public

Parameters
stringexternal account
stringauth mode

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

References $ilDB, and $res.

Referenced by ilObjUserTest\testAuthAndEmailMethods().

4494  {
4495  global $ilDB;
4496 
4497  $res = $ilDB->queryF("SELECT * FROM usr_data ".
4498  "WHERE ext_account = %s AND auth_mode = %s",
4499  array("text", "text"),
4500  array($a_external_account, $a_auth_mode));
4501  return $ilDB->fetchAssoc($res) ? true :false;
4502  }
global $ilDB
+ 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 5036 of file class.ilObjUser.php.

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

Referenced by ilRegistrationMimeMailNotification\__construct().

5037  {
5038  global $ilDB;
5039 
5040  do
5041  {
5042  $continue = false;
5043 
5044  $hashcode = substr(md5(uniqid(rand(), true)), 0, 16);
5045 
5046  $res = $ilDB->queryf('
5047  SELECT COUNT(usr_id) cnt FROM usr_data
5048  WHERE reg_hash = %s',
5049  array('text'),
5050  array($hashcode));
5051  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
5052  {
5053  if($row->cnt > 0) $continue = true;
5054  break;
5055  }
5056 
5057  if($continue) continue;
5058 
5059  $ilDB->manipulateF('
5060  UPDATE usr_data
5061  SET reg_hash = %s
5062  WHERE usr_id = %s',
5063  array('text', 'integer'),
5064  array($hashcode, (int)$a_usr_id)
5065  );
5066 
5067  break;
5068 
5069  } while(true);
5070 
5071  return $hashcode;
5072  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the caller graph for this function:

◆ _getAllUserAssignedStyles()

ilObjUser::_getAllUserAssignedStyles ( )

skins and styles

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

References $ilDB.

Referenced by ilSystemStylesTableGUI\getStyles(), ilObjStyleSettingsGUI\moveUserStylesObject(), and ilObjUserTest\testMiscellaneous().

3004  {
3005  global $ilDB;
3006 
3007  $q = "SELECT DISTINCT up1.value style, up2.value skin FROM usr_pref up1, usr_pref up2 ".
3008  " WHERE up1.keyword = ".$ilDB->quote("style", "text").
3009  " AND up2.keyword = ".$ilDB->quote("skin", "text").
3010  " AND up1.usr_id = up2.usr_id";
3011 
3012  $sty_set = $ilDB->query($q);
3013 
3014  $styles = array();
3015  while($sty_rec = $ilDB->fetchAssoc($sty_set))
3016  {
3017  $styles[] = $sty_rec["skin"].":".$sty_rec["style"];
3018  }
3019 
3020  return $styles;
3021  }
global $ilDB
+ Here is the caller graph for this function:

◆ _getAllUserData()

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

STATIC METHOD get all user data.

Parameters
arraydesired columns
Returns
array of user data public

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

References $_SESSION, $ilDB, $r, ilObject\$ref_id, and $row.

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

2871  {
2872  global $ilDB;
2873 
2874  $result_arr = array();
2875  $types = array();
2876  $values = array();
2877 
2878  if ($a_fields !== NULL and is_array($a_fields))
2879  {
2880  if (count($a_fields) == 0)
2881  {
2882  $select = "*";
2883  }
2884  else
2885  {
2886  if (($usr_id_field = array_search("usr_id",$a_fields)) !== false)
2887  unset($a_fields[$usr_id_field]);
2888 
2889  $select = implode(",",$a_fields).",usr_data.usr_id";
2890  // online time
2891  if(in_array('online_time',$a_fields))
2892  {
2893  $select .= ",ut_online.online_time ";
2894  }
2895  }
2896 
2897  $q = "SELECT ".$select." FROM usr_data ";
2898 
2899  // Add online_time if desired
2900  // Need left join here to show users that never logged in
2901  if(in_array('online_time',$a_fields))
2902  {
2903  $q .= "LEFT JOIN ut_online ON usr_data.usr_id = ut_online.usr_id ";
2904  }
2905 
2906  switch ($active)
2907  {
2908  case 0:
2909  case 1:
2910  $q .= "WHERE active = ".$ilDB->quote($active, "integer");
2911  break;
2912  case 2:
2913  $q .= "WHERE time_limit_unlimited= ".$ilDB->quote(0, "integer");;
2914  break;
2915  case 3:
2916  $qtemp = $q . ", rbac_ua, object_data WHERE rbac_ua.rol_id = object_data.obj_id AND ".
2917  $ilDB->like("object_data.title", "text", "%crs%")." AND usr_data.usr_id = rbac_ua.usr_id";
2918  $r = $ilDB->query($qtemp);
2919  $course_users = array();
2920  while ($row = $ilDB->fetchAssoc($r))
2921  {
2922  array_push($course_users, $row["usr_id"]);
2923  }
2924  if (count($course_users))
2925  {
2926  $q .= " WHERE ".$ilDB->in("usr_data.usr_id", $course_users, true, "integer")." ";
2927  }
2928  else
2929  {
2930  return $result_arr;
2931  }
2932  break;
2933  case 4:
2934  $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"]));
2935  $q.= " AND last_login < ".$ilDB->quote($date, "timestamp");
2936  break;
2937  case 5:
2938  $ref_id = $_SESSION["user_filter_data"];
2939  if ($ref_id)
2940  {
2941  $q .= " LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id ".
2942  "WHERE obj_members.obj_id = (SELECT obj_id FROM object_reference ".
2943  "WHERE ref_id = ".$ilDB->quote($ref_id, "integer").") ";
2944  }
2945  break;
2946  case 6:
2947  global $rbacreview;
2948  $ref_id = $_SESSION["user_filter_data"];
2949  if ($ref_id)
2950  {
2951  $local_roles = $rbacreview->getRolesOfRoleFolder($ref_id,false);
2952  if (is_array($local_roles) && count($local_roles))
2953  {
2954  $q.= " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE ".
2955  $ilDB->in("rbac_ua.rol_id", $local_roles, false, "integer")." ";
2956  }
2957  }
2958  break;
2959  case 7:
2960  $rol_id = $_SESSION["user_filter_data"];
2961  if ($rol_id)
2962  {
2963  $q .= " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id = ".
2964  $ilDB->quote($rol_id, "integer");
2965  }
2966  break;
2967  }
2968  $r = $ilDB->query($q);
2969 
2970  while ($row = $ilDB->fetchAssoc($r))
2971  {
2972  $result_arr[] = $row;
2973  }
2974  }
2975 
2976  return $result_arr;
2977  }
$_SESSION["AccountId"]
$r
Definition: example_031.php:79
global $ilDB
+ Here is the caller graph for this function:

◆ _getAllUserLogins()

ilObjUser::_getAllUserLogins ( $ilias)
static

STATIC METHOD get all user logins.

Parameters
iliasobject
Returns
array of logins public

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

References $ilDB, $res, and $row.

2831  {
2832  global $ilDB;
2833 
2834  $res = $ilDB->query("SELECT login FROM usr_data");
2835  while($row = $ilDB->fetchObject($res))
2836  {
2837  $logins[] = $row->login;
2838  }
2839  return $logins ? $logins : array();
2840  }
global $ilDB

◆ _getAssociatedUsersOnline()

static ilObjUser::_getAssociatedUsersOnline (   $a_user_id,
  $a_no_anonymous = false 
)
static

reads all active sessions from db and returns users that are online
and who have a local role in a group or a course for which the

the current user has also a local role.

Parameters
integeruser_id User ID of the current user.
Returns
array
Deprecated:
This is dead code since ILIAS 5.3.x (ilUsersOnlineBlock ...) and could be removed in future releases.

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

References $ilDB, $ilias, $r, and $row.

Referenced by ilUtil\getAssociatedUsersOnline().

4942  {
4943  global $ilias, $ilDB;
4944 
4945  $pd_set = new ilSetting("pd");
4946  $atime = $pd_set->get("user_activity_time") * 60;
4947  $ctime = time();
4948  $no_anonym = ($a_no_anonymous)
4949  ? "AND user_id <> ".$ilDB->quote(ANONYMOUS_USER_ID, "integer")." "
4950  : "";
4951 
4952  // Get a list of object id's of all courses and groups for which
4953  // the current user has local roles.
4954  // Note: we have to use DISTINCT here, because a user may assume
4955  // multiple roles in a group or a course.
4956  $q = "SELECT DISTINCT dat.obj_id as obj_id ".
4957  "FROM rbac_ua ua ".
4958  "JOIN rbac_fa fa ON fa.rol_id = ua.rol_id ".
4959  "JOIN object_reference r1 ON r1.ref_id = fa.parent ".
4960  "JOIN tree ON tree.child = r1.ref_id ".
4961  "JOIN object_reference r2 ON r2.ref_id = tree.child ". // #17674 - rolf is gone
4962  "JOIN object_data dat ON dat.obj_id = r2.obj_id ".
4963  "WHERE ua.usr_id = ".$ilDB->quote($a_user_id, "integer")." ".
4964  "AND fa.assign = ".$ilDB->quote("y", "text")." ".
4965  "AND dat.type IN (".$ilDB->quote("crs", "text").",".
4966  $ilDB->quote("grp", "text").")";
4967  $r = $ilDB->query($q);
4968 
4969  while ($row = $ilDB->fetchAssoc($r))
4970  {
4971  $groups_and_courses_of_user[] = $row["obj_id"];
4972  }
4973 
4974  require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
4975  $tos_condition = '';
4976  if(ilTermsOfServiceHelper::isEnabled())
4977  {
4978  $tos_condition = " AND (agree_date IS NOT NULL OR ud.usr_id = " . $ilDB->quote(SYSTEM_USER_ID, 'integer') . ") ";
4979  }
4980 
4981  // If the user is not in a course or a group, he has no associated users.
4982  if (count($groups_and_courses_of_user) == 0)
4983  {
4984  $q = "SELECT count(user_id) as num,ctime,user_id,firstname,lastname,title,login,last_login ".
4985  "FROM usr_session ".
4986  "JOIN usr_data ud ON user_id = ud.usr_id ".
4987  "WHERE user_id = ".$ilDB->quote($a_user_id, "integer")." ".
4988  $no_anonym.
4989  $tos_condition.
4990  "AND expires > ".$ilDB->quote(time(), "integer")." ".
4991  "GROUP BY user_id,ctime,firstname,lastname,title,login,last_login";
4992  $r = $ilDB->query($q);
4993  }
4994  else
4995  {
4996  $q = "SELECT count(user_id) as num,s.ctime,s.user_id,ud.firstname,ud.lastname,ud.title,ud.login,ud.last_login ".
4997  "FROM usr_session s ".
4998  "JOIN usr_data ud ON ud.usr_id = s.user_id ".
4999  "JOIN rbac_ua ua ON ua.usr_id = s.user_id ".
5000  "JOIN rbac_fa fa ON fa.rol_id = ua.rol_id ".
5001  "JOIN tree ON tree.child = fa.parent ".
5002  "JOIN object_reference or1 ON or1.ref_id = tree.child ". // #17674 - rolf is gone
5003  "JOIN object_data od ON od.obj_id = or1.obj_id ".
5004  "LEFT JOIN usr_pref p ON (p.usr_id = ud.usr_id AND p.keyword = ".
5005  $ilDB->quote("hide_own_online_status", "text").") ".
5006  "WHERE s.user_id != 0 ".
5007  $no_anonym.
5008  "AND (p.value IS NULL OR NOT p.value = ".$ilDB->quote("y", "text").") ".
5009  "AND s.expires > ".$ilDB->quote(time(),"integer")." ".
5010  "AND fa.assign = ".$ilDB->quote("y", "text")." ".
5011  $tos_condition.
5012  "AND ".$ilDB->in("od.obj_id", $groups_and_courses_of_user, false, "integer")." ".
5013  "GROUP BY s.user_id,s.ctime,ud.firstname,ud.lastname,ud.title,ud.login,ud.last_login ".
5014  "ORDER BY ud.lastname, ud.firstname";
5015  $r = $ilDB->query($q);
5016  }
5017 
5018  while ($user = $ilDB->fetchAssoc($r))
5019  {
5020  if ($atime <= 0
5021  || $user["ctime"] + $atime > $ctime)
5022  {
5023  $users[$user["user_id"]] = $user;
5024  }
5025  }
5026 
5027  return $users ? $users : array();
5028  }
ILIAS Setting Class.
$r
Definition: example_031.php:79
global $ilDB
+ 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.

public

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

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

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

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

3674  {
3675  global $ilDB,$ilSetting;
3676 
3677  include_once('./Services/Authentication/classes/class.ilAuthUtils.php');
3678  $q = "SELECT login,usr_id,ext_account,auth_mode FROM usr_data ".
3679  "WHERE auth_mode = %s";
3680  $types[] = "text";
3681  $values[] = $a_auth_mode;
3682  if($a_read_auth_default and ilAuthUtils::_getAuthModeName($ilSetting->get('auth_mode',AUTH_LOCAL)) == $a_auth_mode)
3683  {
3684  $q.= " OR auth_mode = %s ";
3685  $types[] = "text";
3686  $values[] = 'default';
3687  }
3688 
3689  $res = $ilDB->queryF($q, $types, $values);
3690  while ($row = $ilDB->fetchObject($res))
3691  {
3692  if($row->auth_mode == 'default')
3693  {
3694  $accounts[$row->usr_id] = $row->login;
3695  }
3696  else
3697  {
3698  $accounts[$row->usr_id] = $row->ext_account;
3699  }
3700  }
3701  return $accounts ? $accounts : array();
3702  }
static _getAuthModeName($a_auth_key)
const AUTH_LOCAL
global $ilSetting
Definition: privfeed.php:40
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getFeedPass()

ilObjUser::_getFeedPass (   $a_user_id)

Lookup news feed password for user.

Parameters
integeruser_id
Returns
string feed_password md5-encoded, or false

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

References $ilDB, and _lookupPref().

4426  {
4427  global $ilDB;
4428 
4429  if ($a_user_id > 0)
4430  {
4431  return ilObjUser::_lookupPref($a_user_id, "priv_feed_pass");
4432  }
4433  return false;
4434  }
_lookupPref($a_usr_id, $a_keyword)
global $ilDB
+ Here is the call graph for this function:

◆ _getImportedUserId()

ilObjUser::_getImportedUserId (   $i2_id)

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

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

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

3600  {
3601  global $ilDB;
3602 
3603  $query = "SELECT obj_id FROM object_data WHERE import_id = ".
3604  $ilDB->quote($i2_id, "text");
3605 
3606  $res = $ilDB->query($query);
3607  while($row = $ilDB->fetchObject($res))
3608  {
3609  $id = $row->obj_id;
3610  }
3611  return $id ? $id : 0;
3612  }
global $ilDB
+ 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.

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

References $ilDB, $res, and $row.

Referenced by ilObjUserGUI\initForm(), and updateLogin().

977  {
978  global $ilDB;
979 
980  $ilDB->setLimit(1, 0);
981  $res = $ilDB->queryF('
982  SELECT login, history_date FROM loginname_history
983  WHERE usr_id = %s ORDER BY history_date DESC',
984  array('integer'), array($a_usr_id));
985  $row = $ilDB->fetchAssoc($res);
986  if(!is_array($row) || !count($row)) throw new ilUserException('');
987 
988  return array(
989  $row['login'], $row['history_date']
990  );
991  }
Class for user related exception handling in ILIAS.
global $ilDB
+ Here is the caller graph for this function:

◆ _getLocalAccountsForEmail()

ilObjUser::_getLocalAccountsForEmail (   $a_email)

check whether external account and authentication method matches with a user

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

References $ilDB, and $ilSetting.

Referenced by ilStartUpGUI\showUserMappingSelection(), and ilObjUserTest\testAuthAndEmailMethods().

3838  {
3839  global $ilDB, $ilSetting;
3840 
3841  // default set to local (1)?
3842 
3843  $q = "SELECT * FROM usr_data WHERE ".
3844  " email = %s AND (auth_mode = %s ";
3845  $types = array("text", "text");
3846  $values = array($a_email, "local");
3847 
3848  if ($ilSetting->get("auth_mode") == 1)
3849  {
3850  $q.=" OR auth_mode = %s";
3851  $types[] = "text";
3852  $values[] = "default";
3853  }
3854 
3855  $q.= ")";
3856 
3857  $users = array();
3858  $usr_set = $ilDB->queryF($q, $types, $values);
3859  while ($usr_rec = $ilDB->fetchAssoc($usr_set))
3860  {
3861  $users[$usr_rec["usr_id"]] = $usr_rec["login"];
3862  }
3863 
3864  return $users;
3865  }
global $ilSetting
Definition: privfeed.php:40
global $ilDB
+ Here is the caller graph for this function:

◆ _getLoginAttempts()

static ilObjUser::_getLoginAttempts (   $a_usr_id)
static

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

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

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

4765  {
4766  global $ilDB;
4767 
4768  $query = "SELECT login_attempts FROM usr_data WHERE usr_id = %s";
4769  $result = $ilDB->queryF( $query, array('integer'), array($a_usr_id) );
4770  $record = $ilDB->fetchAssoc( $result );
4771  $login_attempts = $record['login_attempts'];
4772 
4773  return $login_attempts;
4774  }
$result
global $ilDB
+ Here is the caller graph for this function:

◆ _getNumberOfUsersForStyle()

ilObjUser::_getNumberOfUsersForStyle (   $a_skin,
  $a_style 
)

skins and styles

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

References $ilDB.

Referenced by ilStyleDefinition\getAllSkinStyles(), ilSystemStylesTableGUI\getStyles(), ilObjStyleSettingsGUI\saveStyleSettingsObject(), and ilObjUserTest\testMiscellaneous().

2983  {
2984  global $ilDB;
2985 
2986  $q = "SELECT count(*) as cnt FROM usr_pref up1, usr_pref up2 ".
2987  " WHERE up1.keyword= ".$ilDB->quote("style", "text").
2988  " AND up1.value= ".$ilDB->quote($a_style, "text").
2989  " AND up2.keyword= ".$ilDB->quote("skin", "text").
2990  " AND up2.value= ".$ilDB->quote($a_skin, "text").
2991  " AND up1.usr_id = up2.usr_id ";
2992 
2993  $cnt_set = $ilDB->query($q);
2994 
2995  $cnt_rec = $ilDB->fetchAssoc($cnt_set);
2996 
2997  return $cnt_rec["cnt"];
2998  }
global $ilDB
+ Here is the caller graph for this function:

◆ _getNumberOfUsersPerAuthMode()

ilObjUser::_getNumberOfUsersPerAuthMode ( )

get number of users per auth mode

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

References $ilDB, and $r.

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

3818  {
3819  global $ilDB;
3820 
3821  $r = $ilDB->query("SELECT count(*) AS cnt, auth_mode FROM usr_data ".
3822  "GROUP BY auth_mode");
3823  $cnt_arr = array();
3824  while($cnt = $ilDB->fetchAssoc($r))
3825  {
3826  $cnt_arr[$cnt["auth_mode"]] = $cnt["cnt"];
3827  }
3828 
3829  return $cnt_arr;
3830  }
$r
Definition: example_031.php:79
global $ilDB
+ Here is the caller graph for this function:

◆ _getPersonalPicturePath()

static ilObjUser::_getPersonalPicturePath (   $a_usr_id,
  $a_size = "small",
  $a_force_pic = false,
  $a_prevent_no_photo_image = false 
)
static

Get path to personal picture.

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

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

References $file, $ilDB, $res, $row, ilUtil\getImagePath(), and ilWACSignedPath\signFile().

Referenced by ilUserProfile\addStandardFieldsToForm(), ilPortfolioHTMLExport\buildExportFile(), ilObjBlogGUI\buildExportFile(), ilWikiContributorsTableGUI\fillRow(), ilUsersOnlineBlockGUI\fillRow(), ilAwarenessData\getData(), ilPublicUserProfileGUI\getEmbeddable(), ilUserUtil\getNamePresentation(), ilNoteGUI\getNoteListHTML(), getPersonalPicturePath(), ilObjUserGUI\initForm(), ilRepositoryUserResultTableGUI\initMultiCommands(), ilObjPortfolioBaseGUI\renderFullscreenHeader(), ilObjBlogGUI\renderFullscreenHeader(), ilPublicUserProfileGUI\renderTitle(), and ilPersonalProfileGUI\showPublicProfileFields().

3934  {
3935  global $ilDB;
3936 
3937  // BEGIN DiskQuota: Fetch all user preferences in a single query
3938  $res = $ilDB->queryF("SELECT * FROM usr_pref WHERE ".
3939  "keyword IN (%s,%s) ".
3940  "AND usr_id = %s",
3941  array("text", "text", "integer"),
3942  array('public_upload', 'public_profile', $a_usr_id));
3943  while ($row = $ilDB->fetchAssoc($res))
3944  {
3945  switch ($row['keyword'])
3946  {
3947  case 'public_upload' :
3948  $upload = $row['value'] == 'y';
3949  break;
3950  case 'public_profile' :
3951  $profile = ($row['value'] == 'y' ||
3952  $row['value'] == 'g');
3953  break;
3954  }
3955  }
3956 
3957  // END DiskQuota: Fetch all user preferences in a single query
3958  $webspace_dir = "";
3959  if(defined('ILIAS_MODULE'))
3960  {
3961  $webspace_dir = ('.'.$webspace_dir);
3962  }
3963  $webspace_dir .= ('./'.ilUtil::getWebspaceDir());
3964 
3965  $image_dir = $webspace_dir."/usr_images";
3966  // BEGIN DiskQuota: Support 'big' user images
3967  if ($a_size == 'big')
3968  {
3969  $thumb_file = $image_dir."/usr_".$a_usr_id.".jpg";
3970  }
3971  else
3972  {
3973  $thumb_file = $image_dir."/usr_".$a_usr_id."_".$a_size.".jpg";
3974  }
3975  // END DiskQuota: Support 'big' user images
3976 
3977  if((($upload && $profile) || $a_force_pic)
3978  && @is_file($thumb_file))
3979  {
3980  $file = $thumb_file."?t=".rand(1, 99999);
3981  }
3982  else
3983  {
3984  if (!$a_prevent_no_photo_image)
3985  {
3986  // we only have xsmall and xxsmall for this
3987  if($a_size == "small" || $a_size == "big")
3988  {
3989  $a_size = "xsmall";
3990  }
3991  $file = ilUtil::getImagePath("no_photo_".$a_size.".jpg");
3992  }
3993  }
3994 
3995  require_once('./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
3997  }
print $file
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static signFile($path_to_file)
global $ilDB
+ Here is the call graph for this function:
+ 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 4709 of file class.ilObjUser.php.

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

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

4710  {
4711  global $ilDB;
4712 
4713  $prefs = array();
4714 
4715  $r = $ilDB->queryF("SELECT * FROM usr_pref WHERE usr_id = %s",
4716  array("integer"), array($user_id));
4717 
4718  while($row = $ilDB->fetchAssoc($r))
4719  {
4720  $prefs[$row["keyword"]] = $row["value"];
4721  }
4722 
4723  return $prefs;
4724  }
$r
Definition: example_031.php:79
global $ilDB
+ 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 4661 of file class.ilObjUser.php.

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

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

4661  {
4662  global $ilDB;
4663 
4664  $ids = array();
4665  if (is_array($a_internalids)) {
4666  foreach ($a_internalids as $internalid) {
4667  if (is_numeric ($internalid))
4668  {
4669  $ids[] = $internalid;
4670  }
4671  else
4672  {
4673  $parsedid = ilUtil::__extractId($internalid, IL_INST_ID);
4674  if (is_numeric($parsedid) && $parsedid > 0)
4675  {
4676  $ids[] = $parsedid;
4677  }
4678  }
4679  }
4680  }
4681  if (count($ids) == 0)
4682  $ids [] = -1;
4683 
4684  $query = "SELECT usr_data.*, usr_pref.value AS language
4685  FROM usr_data
4686  LEFT JOIN usr_pref
4687  ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
4688  WHERE ".$ilDB->in("usr_data.usr_id", $ids, false, "integer");
4689  $values[] = "language";
4690  $types[] = "text";
4691 
4692  $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
4693 
4694  $data = array();
4695  $result = $ilDB->queryF($query, $types, $values);
4696  while ($row = $ilDB->fetchAssoc($result))
4697  {
4698  $data[] = $row;
4699  }
4700  return $data;
4701  }
$result
$data
global $ilDB
static __extractId($ilias_id, $inst_id)
extract ref id from role title, e.g.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getUserIdsByEmail()

ilObjUser::_getUserIdsByEmail (   $a_email)
static

STATIC METHOD get all user_ids of an email address.

Parameters
stringemail of user
Returns
integer id of user public

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

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

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

2638  {
2639  global $ilias, $ilDB;
2640 
2641  $res = $ilDB->queryF("SELECT login FROM usr_data ".
2642  "WHERE email = %s and active = 1",
2643  array("text"),
2644  array($a_email));
2645  $ids = array ();
2646  while($row = $ilDB->fetchObject($res))
2647  {
2648  $ids[] = $row->login;
2649  }
2650 
2651  return $ids;
2652  }
global $ilDB
+ 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 public

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilCronDeleteInactivatedUserAccounts\run().

5174  {
5176  $field = 'inactivation_date';
5178 
5179  if( !(int)$period ) throw new ilException('no valid period given');
5180 
5181  global $ilDB;
5182 
5183  $date = date( 'Y-m-d H:i:s', (time() - ((int)$period * 24 * 60 * 60)) );
5184 
5185  $query = "SELECT usr_id FROM usr_data WHERE $field < %s AND active = %s";
5186 
5187  $res = $ilDB->queryF($query, array('timestamp', 'integer'), array($date, 0));
5188 
5189  $ids = array();
5190  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
5191  {
5192  $ids[] = $row->usr_id;
5193  }
5194 
5195  return $ids;
5196  }
Base class for ILIAS Exception handling.
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ 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 public

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilCronDeleteInactiveUserAccounts\hasCustomSettings().

5145  {
5146  if( !(int)$period ) throw new ilException('no valid period given');
5147 
5148  global $ilDB;
5149 
5150  $date = date( 'Y-m-d H:i:s', (time() - ((int)$period * 24 * 60 * 60)) );
5151 
5152  $query = "SELECT usr_id FROM usr_data WHERE last_login < %s OR (ISNULL(last_login) AND create_date < %s)";
5153 
5154  $res = $ilDB->queryF($query, array('timestamp', 'timestamp'), array($date, $date));
5155 
5156  $ids = array();
5157  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
5158  {
5159  $ids[] = $row->usr_id;
5160  }
5161 
5162  return $ids;
5163  }
Base class for ILIAS Exception handling.
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the caller graph for this function:

◆ _getUsersForClipboadObject()

ilObjUser::_getUsersForClipboadObject (   $a_type,
  $a_id 
)

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

References $ilDB.

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

3565  {
3566  global $ilDB;
3567 
3568  $q = "SELECT DISTINCT user_id FROM personal_clipboard WHERE ".
3569  "item_id = ".$ilDB->quote($a_id, "integer")." AND ".
3570  "type = ".$ilDB->quote($a_type, "text");
3571  $user_set = $ilDB->query($q);
3572  $users = array();
3573  while ($user_rec = $ilDB->fetchAssoc($user_set))
3574  {
3575  $users[] = $user_rec["user_id"];
3576  }
3577 
3578  return $users;
3579  }
global $ilDB
+ 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 4554 of file class.ilObjUser.php.

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

Referenced by ilSoapUserAdministration\getUsersForContainer().

4554  {
4555  global $ilDB;
4556  $data = array();
4557  $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 ";
4558  $types[] = "text";
4559  $values[] = "language";
4560 
4561  if (is_numeric($active) && $active > -1)
4562  {
4563  $query .= " AND usr_data.active = %s";
4564  $values[] = $active;
4565  $types[] = "integer";
4566  }
4567 
4568  if ($ref_id != USER_FOLDER_ID)
4569  {
4570  $query.= " AND usr_data.time_limit_owner = %s";
4571  $values[] = $ref_id;
4572  $types[] = "integer";
4573  }
4574 
4575  $query .= " AND usr_data.usr_id != %s ";
4576  $values[] = ANONYMOUS_USER_ID;
4577  $types[] = "integer";
4578 
4579  $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
4580 
4581  $result = $ilDB->queryF($query, $types, $values);
4582  $data = array();
4583  while ($row = $ilDB->fetchAssoc($result))
4584  {
4585  array_push($data, $row);
4586  }
4587 
4588  return $data;
4589  }
$result
$data
global $ilDB
const USER_FOLDER_ID
Class ilObjUserFolder.
+ 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 4597 of file class.ilObjUser.php.

References _getUsersForIds().

Referenced by ilSoapUserAdministration\getUsersForContainer().

4598  {
4599  return ilObjUser::_getUsersForIds($a_mem_ids, $active);
4600  }
static _getUsersForIds($a_mem_ids, $active=-1, $timelimitowner=-1)
return user data for given user id
+ 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 4608 of file class.ilObjUser.php.

References $active, $ilDB, $query, $result, $row, and USER_FOLDER_ID.

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

4609  {
4610  global $rbacadmin, $rbacreview, $ilDB;
4611 
4612  // quote all ids
4613  $ids = array();
4614  foreach ($a_mem_ids as $mem_id) {
4615  $ids [] = $ilDB->quote($mem_id);
4616  }
4617 
4618  $query = "SELECT usr_data.*, usr_pref.value AS language
4619  FROM usr_data
4620  LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
4621  WHERE ".$ilDB->in("usr_data.usr_id", $ids, false, "integer")."
4622  AND usr_data.usr_id != %s";
4623  $values[] = "language";
4624  $types[] = "text";
4625  $values[] = ANONYMOUS_USER_ID;
4626  $types[] = "integer";
4627 
4628  if (is_numeric($active) && $active > -1)
4629  {
4630  $query .= " AND active = %s";
4631  $values[] = $active;
4632  $types[] = "integer";
4633  }
4634 
4635  if ($timelimitowner != USER_FOLDER_ID && $timelimitowner != -1)
4636  {
4637  $query.= " AND usr_data.time_limit_owner = %s";
4638  $values[] = $timelimitowner;
4639  $types[] = "integer";
4640 
4641  }
4642 
4643  $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
4644 
4645  $result = $ilDB->queryF($query, $types, $values);
4646  while ($row = $ilDB->fetchAssoc($result))
4647  {
4648  $mem_arr[] = $row;
4649  }
4650 
4651  return $mem_arr ? $mem_arr : array();
4652  }
$result
global $ilDB
const USER_FOLDER_ID
Class ilObjUserFolder.
+ 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 4511 of file class.ilObjUser.php.

References $active, $data, $ilDB, $query, $r, and $row.

Referenced by ilSoapUserAdministration\getUserForRole().

4511  {
4512  global $ilDB, $rbacreview;
4513  $data = array();
4514 
4515  $ids = $rbacreview->assignedUsers($role_id);
4516 
4517  if (count ($ids) == 0)
4518  {
4519  $ids = array (-1);
4520  }
4521 
4522  $query = "SELECT usr_data.*, usr_pref.value AS language
4523  FROM usr_data
4524  LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
4525  WHERE ".$ilDB->in("usr_data.usr_id", $ids, false, "integer");
4526  $values[] = "language";
4527  $types[] = "text";
4528 
4529 
4530  if (is_numeric($active) && $active > -1)
4531  {
4532  $query .= " AND usr_data.active = %s";
4533  $values[] = $active;
4534  $types[] = "integer";
4535  }
4536 
4537  $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
4538 
4539  $r = $ilDB->queryF($query, $types, $values);
4540  $data = array();
4541  while ($row = $ilDB->fetchAssoc($r))
4542  {
4543  $data[] = $row;
4544  }
4545  return $data;
4546  }
$r
Definition: example_031.php:79
$data
global $ilDB
+ Here is the caller graph for this function:

◆ _incrementLoginAttempts()

static ilObjUser::_incrementLoginAttempts (   $a_usr_id)
static

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

References $ilDB, and $query.

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

4777  {
4778  global $ilDB;
4779 
4780  $query = "UPDATE usr_data SET login_attempts = (login_attempts + 1) WHERE usr_id = %s";
4781  $affected = $ilDB->manipulateF( $query, array('integer'), array($a_usr_id) );
4782 
4783  if($affected) return true;
4784  else return false;
4785  }
global $ilDB
+ Here is the caller graph for this function:

◆ _isAnonymous()

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

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

Referenced by ilPublicUserProfileGUI\getEmbeddable(), ilBuddyList\getInstanceByUserId(), ilBuddyList\request(), and ilBuddySystemGUI\transitionCommand().

5555  {
5556  return $usr_id == ANONYMOUS_USER_ID;
5557  }
+ 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 3180 of file class.ilObjUser.php.

References $ilDB.

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

3181  {
3182  global $ilDB;
3183 
3184  if (self::$is_desktop_item_loaded[$a_usr_id.":".$a_item_id])
3185  {
3186  return self::$is_desktop_item_cache[$a_usr_id.":".$a_item_id.":".$a_type];
3187  }
3188  $item_set = $ilDB->queryF("SELECT item_id FROM desktop_item WHERE ".
3189  "item_id = %s AND type = %s AND user_id = %s",
3190  array("integer", "text", "integer"),
3191  array($a_item_id, $a_type, $a_usr_id));
3192 
3193  if ($ilDB->fetchAssoc($item_set))
3194  {
3195  return true;
3196  }
3197  else
3198  {
3199  return false;
3200  }
3201  }
global $ilDB
+ 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 public static

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

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

References $ilDB, $r, and $row.

Referenced by ilMail\__substituteRecipients(), ilSoapUserAdministration\__validateUserData(), ilUserLoginInputGUI\checkInput(), ilCalendarAppointmentGUI\loadNotificationRecipients(), ilAuthBase\loginObserver(), ilLuceneQueryParser\replaceOwnerCallback(), ilAccountRegistrationGUI\saveForm(), ilPersonalProfileGUI\savePersonalData(), ilConsultationHourAppointments\setManager(), ilAuthContainerMDB2\supportsCaptchaVerification(), ilObjUserTest\testCreateSetLookupDelete(), and ilObjUserGUI\updateObjectOld().

4459  {
4460  global $ilDB;
4461 
4462  $q = "SELECT DISTINCT login, usr_id FROM usr_data ".
4463  "WHERE login = %s";
4464  $types[] = "text";
4465  $values[] = $a_login;
4466 
4467  if ($a_user_id != 0)
4468  {
4469  $q.= " AND usr_id != %s ";
4470  $types[] = "integer";
4471  $values[] = $a_user_id;
4472  }
4473 
4474  $r = $ilDB->queryF($q, $types, $values);
4475 
4476  if ($row = $ilDB->fetchAssoc($r))
4477  {
4478  return $row['usr_id'];
4479  }
4480  return false;
4481  }
$r
Definition: example_031.php:79
global $ilDB
+ 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 694 of file class.ilObjUser.php.

References $ilDB, and $res.

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

695  {
696  global $ilDB;
697 
698  $res = $ilDB->queryF("SELECT ".$a_field." FROM usr_data WHERE usr_id = %s",
699  array("integer"), array($a_user_id));
700 
701  while($set = $ilDB->fetchAssoc($res))
702  {
703  return $set[$a_field];
704  }
705  return false;
706  }
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupActive()

ilObjUser::_lookupActive (   $a_usr_id)

Check user account active.

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilGroupParticipantsTableGUI\fillRow(), and ilCourseParticipantsTableGUI\fillRow().

2204  {
2205  global $ilDB;
2206 
2207  $query = 'SELECT usr_id FROM usr_data '.
2208  'WHERE active = '.$ilDB->quote(1,'integer').' '.
2209  'AND usr_id = '.$ilDB->quote($a_usr_id,'integer');
2210  $res = $ilDB->query($query);
2211  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
2212  {
2213  return true;
2214  }
2215  return false;
2216  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupAuthMode()

static ilObjUser::_lookupAuthMode (   $a_usr_id)
static

lookup auth mode

public

Parameters
intusr_id

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

References _lookup().

Referenced by ilAuthContainerMDB2\fetchData(), ilECSAppEventListener\handleEvent(), and ilObjUserTest\testAuthAndEmailMethods().

3756  {
3757  return (string) ilObjUser::_lookup($a_usr_id, "auth_mode");
3758  }
static _lookup($a_user_id, $a_field)
Private function for lookup methods.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupClientIP()

ilObjUser::_lookupClientIP (   $a_user_id)

Lookup client ip.

Parameters
intuser id
Returns
string client ip

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

References _lookup().

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

768  {
769  return ilObjUser::_lookup($a_user_id, "client_ip");
770  }
static _lookup($a_user_id, $a_field)
Private function for lookup methods.
+ 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 3264 of file class.ilObjUser.php.

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

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

3265  {
3266  global $ilUser, $rbacsystem, $tree, $ilDB;
3267 
3268  if ($a_types == "")
3269  {
3270  $is_nested_set = ($tree->getTreeImplementation() instanceof ilNestedSetTree);
3271 
3272  $item_set = $ilDB->queryF("SELECT obj.obj_id, obj.description, oref.ref_id, obj.title, obj.type ".
3273  " FROM desktop_item it, object_reference oref ".
3274  ", object_data obj".
3275  " WHERE ".
3276  "it.item_id = oref.ref_id AND ".
3277  "oref.obj_id = obj.obj_id AND ".
3278  "it.user_id = %s", array("integer"), array($user_id));
3279  $items = $all_parent_path = array();
3280  while ($item_rec = $ilDB->fetchAssoc($item_set))
3281  {
3282  if ($tree->isInTree($item_rec["ref_id"])
3283  && $item_rec["type"] != "rolf"
3284  && $item_rec["type"] != "itgr") // due to bug 11508
3285  {
3286  $parent_ref = $tree->getParentId($item_rec["ref_id"]);
3287 
3288  if(!isset($all_parent_path[$parent_ref]))
3289  {
3290  // #15746
3291  //if($is_nested_set)
3292  //{
3293  // $par_left = $tree->getLeftValue($parent_ref);
3294  // $all_parent_path[$parent_ref] = sprintf("%010d", $par_left);
3295  //}
3296  //else
3297  //{
3298  $node = $tree->getNodeData($parent_ref);
3299  $all_parent_path[$parent_ref] = $node["title"];
3300  //}
3301  }
3302 
3303  $parent_path = $all_parent_path[$parent_ref];
3304 
3305  $title = ilObject::_lookupTitle($item_rec["obj_id"]);
3306  $desc = ilObject::_lookupDescription($item_rec["obj_id"]);
3307  $items[$parent_path.$title.$item_rec["ref_id"]] =
3308  array("ref_id" => $item_rec["ref_id"],
3309  "obj_id" => $item_rec["obj_id"],
3310  "type" => $item_rec["type"],
3311  "title" => $title,
3312  "description" => $desc,
3313  "parent_ref" => $parent_ref);
3314  }
3315  }
3316  ksort($items);
3317  }
3318  else
3319  {
3320  // due to bug 11508
3321  if (!is_array($a_types))
3322  {
3323  $a_types = array($a_types);
3324  }
3325  $items = array();
3326  $foundsurveys = array();
3327  foreach($a_types as $a_type)
3328  {
3329  if ($a_type == "itgr")
3330  {
3331  continue;
3332  }
3333  $item_set = $ilDB->queryF("SELECT obj.obj_id, obj.description, oref.ref_id, obj.title FROM desktop_item it, object_reference oref ".
3334  ", object_data obj WHERE ".
3335  "it.item_id = oref.ref_id AND ".
3336  "oref.obj_id = obj.obj_id AND ".
3337  "it.type = %s AND ".
3338  "it.user_id = %s ".
3339  "ORDER BY title",
3340  array("text", "integer"),
3341  array($a_type, $user_id));
3342 
3343  while ($item_rec = $ilDB->fetchAssoc($item_set))
3344  {
3345  $title = ilObject::_lookupTitle($item_rec["obj_id"]);
3346  $desc = ilObject::_lookupDescription($item_rec["obj_id"]);
3347  $items[$title.$a_type.$item_rec["ref_id"]] =
3348  array("ref_id" => $item_rec["ref_id"],
3349  "obj_id" => $item_rec["obj_id"], "type" => $a_type,
3350  "title" => $title, "description" => $desc);
3351  }
3352 
3353  }
3354  ksort($items);
3355  }
3356 
3357  return $items;
3358  }
static _lookupTitle($a_id)
lookup object title
Base class for nested set path based trees.
static _lookupDescription($a_id)
lookup object description
global $ilUser
Definition: imgupload.php:15
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupEmail()

◆ _lookupExternalAccount()

ilObjUser::_lookupExternalAccount (   $a_user_id)

lookup external account for login and authmethod

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

References _lookup().

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

817  {
818  return ilObjUser::_lookup($a_user_id, "ext_account");
819  }
static _lookup($a_user_id, $a_field)
Private function for lookup methods.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupFeedHash()

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

Lookup news feed hash for user.

If hash does not exist, create one.

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

References $ilDB.

Referenced by ilUserFeedWriter\ilUserFeedWriter().

4392  {
4393  global $ilDB;
4394 
4395  if ($a_user_id > 0)
4396  {
4397  $set = $ilDB->queryF("SELECT feed_hash from usr_data WHERE usr_id = %s",
4398  array("integer"), array($a_user_id));
4399  if ($rec = $ilDB->fetchAssoc($set))
4400  {
4401  if (strlen($rec["feed_hash"]) == 32)
4402  {
4403  return $rec["feed_hash"];
4404  }
4405  else if($a_create)
4406  {
4407  $hash = md5(rand(1,9999999) + str_replace(" ", "", (string) microtime()));
4408  $ilDB->manipulateF("UPDATE usr_data SET feed_hash = %s".
4409  " WHERE usr_id = %s",
4410  array("text", "integer"),
4411  array($hash, $a_user_id));
4412  return $hash;
4413  }
4414  }
4415  }
4416 
4417  return false;
4418  }
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupFields()

ilObjUser::_lookupFields (   $a_user_id)

lookup fields (deprecated; use more specific methods instead)

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

References $ilDB, and $res.

Referenced by ilObjSCORMVerification\createFromSCORMLM(), ilSCORMPresentationGUI\downloadCertificate(), ilTestExport\exportToCSV(), ilTestExport\exportToExcel(), ilSpecialUsersTableGUI\fillRow(), ilTestCertificateAdapter\getCertificateVariablesForPresentation(), ilCourseCertificateAdapter\getCertificateVariablesForPresentation(), ilExerciseCertificateAdapter\getCertificateVariablesForPresentation(), ilTestEvaluationGUI\resetfilterEvaluation(), and ilObjUserTest\testCreateSetLookupDelete().

796  {
797  global $ilDB;
798 
799  $res = $ilDB->queryF("SELECT * FROM usr_data WHERE usr_id = %s",
800  array("integer"), array($a_user_id));
801  $user_rec = $ilDB->fetchAssoc($res);
802  return $user_rec;
803  }
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupFullname()

ilObjUser::_lookupFullname (   $a_user_id)

Lookup Full Name.

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

References $fullname, and $ilDB.

Referenced by ilExAssignmentTeam\addTeamMember(), ilCalendarAppointmentGUI\book(), ilObjStudyProgrammeIndividualPlanGUI\buildFrame(), ilCalendarAppointmentGUI\cancelBooking(), ilRbacLogTableGUI\fillRow(), ilExParticipantTableGUI\fillRow(), ilLPTableBaseGUI\getExportMeta(), ilCalendarAppointmentPanelGUI\getHTML(), ilCalendarBlockGUI\getHTML(), ilExAssignmentTeamLogTableGUI\getItems(), ilExSubmissionTeamGUI\getOverviewContent(), ilExAssignmentTeam\getTeamId(), ilCalendarBlockGUI\ilCalendarBlockGUI(), ilSCORMTrackingItemsPerUserTableGUI\initTable(), ilSCORMTrackingItemPerUserTableGUI\initTable(), ilBookingEntry\lookupManagedBookingsForObject(), ilSCORMTrackingItemsScoTableGUI\parse(), ilConsultationHoursTableGUI\parse(), ilExAssignmentTeam\removeTeamMember(), ilCalendarMailNotification\send(), ilConsultationHoursGUI\sendInfoAboutUnassignedUsers(), ilObjDataCollection\sendNotification(), ilWikiUtil\sendNotification(), ilNote\sendNotifications(), ilObjSurvey\sendTutorNotification(), and ilObjSurvey\sentReminder().

712  {
713  global $ilDB;
714 
715  $set = $ilDB->queryF("SELECT title, firstname, lastname FROM usr_data WHERE usr_id = %s",
716  array("integer"), array($a_user_id));
717 
718  if ($rec = $ilDB->fetchAssoc($set))
719  {
720  if ($rec["title"])
721  {
722  $fullname = $rec["title"]." ";
723  }
724  if ($rec["firstname"])
725  {
726  $fullname .= $rec["firstname"]." ";
727  }
728  if ($rec["lastname"])
729  {
730  $fullname .= $rec["lastname"];
731  }
732  }
733  return $fullname;
734  }
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupGender()

static ilObjUser::_lookupGender (   $a_user_id)
static

Lookup gender.

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

References _lookup().

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

757  {
758  return ilObjUser::_lookup($a_user_id, "gender");
759  }
static _lookup($a_user_id, $a_field)
Private function for lookup methods.
+ 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 824 of file class.ilObjUser.php.

References $ilDB, and $res.

Referenced by ilDiskQuotaSummaryNotification\__construct(), ilMail\__getCountRecipient(), ilMail\__getEmailRecipients(), ilObjUserGUI\_goto(), ilShopUtils\_sendNotificationToVATAdministration(), ilSoapObjectAdministration\addObject(), ilOrgUnitStaffGUI\addOtherRoles(), ilOrgUnitStaffGUI\addStaff(), ilRepositorySearchGUI\addUserFromAutoComplete(), ilObjBlogGUI\addUserFromAutoComplete(), ilExerciseManagementGUI\addUserFromAutoCompleteObject(), ilExSubmissionTeamGUI\addUserFromAutoCompleteObject(), ilSkillProfileGUI\assignUser(), ilOrgUnitSimpleUserImport\buildUserId(), ilChatroomInviteUsersToPrivateRoomTask\byLogin(), ilPermission2GUI\changeOwner(), checkUserId(), ilOpenIdAttributeToUser\create(), ilAuthBase\failedLoginObserver(), ilAuthContainerMDB2\fetchData(), ilMail\formatNamesForOutput(), ilObjectPermissionStatusGUI\getUser(), getUserIdByLogin(), ilMail\getUserIds(), ilSystemSupportContacts\getValidSupportContactIds(), ilSessionControl\handleLoginEvent(), ilPCParagraph\intLinks2xml(), ilChatroom\inviteUserToPrivateRoomByLogin(), ilAuthContainerECS\loginObserver(), ilStartUpGUI\migrateAccount(), ilSoapRBACAdministration\parseUserID(), ilStartUpGUI\processCode(), ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus(), ilDataCollectionRecordEditGUI\save(), ilObjSurveyGUI\savePropertiesObject(), ilSingleUserShareGUI\saveShare(), ilDiskQuotaSummaryNotification\send(), ilNote\sendNotifications(), ilRegistrationSettings\setApproveRecipientLogins(), ilSystemSupportContacts\setList(), ilObjDiskQuotaSettings\setSummaryRecipients(), ilObjUserTest\testCreateSetLookupDelete(), ilLDAPAttributeToUser\usersToXML(), ilRegistrationSettings\validate(), and ilUserImportParser\verifyEndTag().

825  {
826  global $ilDB;
827 
828  if (!is_array($a_user_str))
829  {
830  $res = $ilDB->queryF("SELECT usr_id FROM usr_data WHERE login = %s",
831  array("text"), array($a_user_str));
832  $user_rec = $ilDB->fetchAssoc($res);
833  return $user_rec["usr_id"];
834  }
835  else
836  {
837  $set = $ilDB->query("SELECT usr_id FROM usr_data ".
838  " WHERE ".$ilDB->in("login", $a_user_str, false, "text")
839  );
840  $ids = array();
841  while ($rec = $ilDB->fetchAssoc($set))
842  {
843  $ids[] = $rec["usr_id"];
844  }
845  return $ids;
846  }
847  }
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupIm()

ilObjUser::_lookupIm (   $a_user_id,
  $a_type 
)

Lookup IM.

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

References _lookup().

Referenced by ilUsersOnlineBlockGUI\fillRow().

740  {
741  return ilObjUser::_lookup($a_user_id, "im_".$a_type);
742  }
static _lookup($a_user_id, $a_field)
Private function for lookup methods.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupLanguage()

static ilObjUser::_lookupLanguage (   $a_usr_id)
static

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

References $ilDB, $r, and $row.

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

2018  {
2019  global $ilDB;
2020 
2021  $q = "SELECT value FROM usr_pref WHERE usr_id= ".
2022  $ilDB->quote($a_usr_id, "integer")." AND keyword = ".
2023  $ilDB->quote('language', "text");
2024  $r = $ilDB->query($q);
2025 
2026  while($row = $ilDB->fetchAssoc($r))
2027  {
2028  return $row['value'];
2029  }
2030  return 'en';
2031  }
$r
Definition: example_031.php:79
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupLastLogin()

ilObjUser::_lookupLastLogin (   $a_user_id)

lookup last login

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

References _lookup().

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

853  {
854  return ilObjUser::_lookup($a_user_id, "last_login");
855  }
static _lookup($a_user_id, $a_field)
Private function for lookup methods.
+ 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 808 of file class.ilObjUser.php.

References _lookup().

Referenced by ilCourseXMLParser\__parseId(), ilRegistrationSettings\__read(), ilContactGUI\activateTab(), ilPaymentStatisticGUI\addStatisticWorksheet(), ilObjPaymentSettingsGUI\addStatisticWorksheet(), ilMailSearchGroupsGUI\adoptMembers(), ilAwarenessWorkspaceFeatureProvider\collectFeaturesForTargetUser(), ilMailMemberSearchDataProvider\collectTableData(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilStudyProgrammeIndividualPlanTableGUI\fetchData(), ilPageHistoryTableGUI\fillRow(), ilMilestoneResponsiblesTableGUI\fillRow(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), ilAttendanceList\getHTML(), ilDAVServer\getLogin(), getLoginByUserId(), ilConsultationHourAppointments\getManagedUsers(), ilConsultationHourAppointments\getManager(), ilNoteGUI\getNoteListHTML(), ilObjForumNotificationDataProvider\getPostUpdateUserName(), ilForumCronNotificationDataProvider\getPostUpdateUserName(), ilObjForumNotificationDataProvider\getPostUserName(), ilForumCronNotificationDataProvider\getPostUserName(), ilTestServiceGUI\getResultsHeadUserAndPass(), ilObjSurvey\getUserDataFromActiveId(), ilObjForumGUI\getUserNotificationTableData(), ilObjUserGUI\getValues(), ilCalendarAppointmentGUI\initForm(), ilMailSearchGroupsGUI\mailMembers(), ilMailSearchCoursesGUI\mailMembers(), ilPermission2GUI\owner(), ilCalendarSharedUserListTableGUI\parse(), ilSessionParticipantsTableGUI\parse(), ilMail\parseRcptOfMailingLists(), ilObjGroupGUI\readMemberData(), ilObjCourseGUI\readMemberData(), ilCalendarEntry\readResponsibleUsers(), ilExerciseManagementGUI\redirectFeedbackMailObject(), ilBuddyList\request(), ilMailSummaryNotification\send(), ilLPTableBaseGUI\sendMail(), ilMembershipCronNotifications\sendMail(), ilMailNotification\sendMail(), ilObjContentObjectGUI\sendMailToBlockedUsers(), ilMembershipGUI\sendMailToSelectedUsers(), ilMailMemberSearchGUI\sendMailToSelectedUsers(), ilObjCourseGUI\sendMailToSelectedUsersObject(), ilObjGroupGUI\sendMailToSelectedUsersObject(), ilMembershipCronMinMembers\sendMessage(), ilObjDataCollection\sendNotification(), ilWikiUtil\sendNotification(), ilNote\sendNotifications(), ilObjSurvey\sendTutorNotification(), ilObjSurvey\sentReminder(), ilPaymentCouponGUI\showCoupons(), ilMailSearchCoursesGUI\showMembers(), ilMailSearchGUI\showResults(), ilPaymentStatisticGUI\showStatistics(), ilMailFolderGUI\showUser(), ilObjPaymentSettingsGUI\statisticObject(), ilObjUserTest\testCreateSetLookupDelete(), ilBuddySystemGUI\transitionCommand(), ilUserImportParser\verifyEndTag(), and ilPCParagraph\xml2output().

809  {
810  return ilObjUser::_lookup($a_user_id, "login");
811  }
static _lookup($a_user_id, $a_field)
Private function for lookup methods.
+ 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 778 of file class.ilObjUser.php.

References $ilDB, and $res.

Referenced by ilExGradesTableGUI\__construct(), ilExParticipantTableGUI\__construct(), ilGroupXMLParser\__parseId(), ilObjTestAccess\_getParticipantData(), ilObjPaymentSettingsGUI\addStatisticWorksheet(), ilSoapLearningProgressAdministration\addUserProgress(), ilMailSearchGroupsGUI\adoptMembers(), ilAwarenessMailFeatureProvider\collectFeaturesForTargetUser(), ilMailMemberSearchDataProvider\collectTableData(), ilObjSessionGUI\confirmAssignFromWaitingListObject(), ilObjGroupGUI\confirmAssignFromWaitingListObject(), ilObjCourseGUI\confirmAssignFromWaitingListObject(), ilObjSessionGUI\confirmAssignSubscribersObject(), ilObjGroupGUI\confirmAssignSubscribersObject(), ilObjCourseGUI\confirmAssignSubscribersObject(), ilObjSessionGUI\confirmRefuseFromListObject(), ilObjGroupGUI\confirmRefuseFromListObject(), ilObjCourseGUI\confirmRefuseFromListObject(), ilObjSessionGUI\confirmRefuseSubscribersObject(), ilObjGroupGUI\confirmRefuseSubscribersObject(), ilObjCourseGUI\confirmRefuseSubscribersObject(), ilOrgUnitStaffGUI\confirmRemoveUser(), ilSkillProfileGUI\confirmUserRemoval(), ilObjCourseGUI\deleteMembersObject(), ilObjTestGUI\deleteSingleUserResultsObject(), ilLocalUserGUI\deleteUsers(), ilObjCategoryGUI\deleteUsersObject(), ilExSubmission\downloadAllAssignmentFiles(), ilBlogExerciseGUI\downloadExcSubFile(), ilPortfolioExerciseGUI\downloadExcSubFile(), ilExSubmission\downloadFiles(), ilExSubmission\downloadMultipleFiles(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilObjExercise\exportGradesExcel(), ilObjAssessmentFolderGUI\exportLogObject(), ilPageHistoryTableGUI\fillRow(), ilAssessmentFolderLogTableGUI\fillRow(), ilCalendarInboxSharedTableGUI\fillRow(), ilFileVersionTableGUI\fillRow(), ilRbacLogTableGUI\fillRow(), ilObjSurvey\getAppraiseesData(), ilSkillProfile\getAssignedUsers(), ilLMTracker\getBlockedUsersInformation(), ilAttendanceList\getHTML(), ilSessionOverviewTableGUI\getItems(), ilCourseParticipantsGroupsTableGUI\getItems(), ilBookingReservation\getListByDate(), ilExAssignment\getMultiFeedbackFiles(), ilPageObject\getPageContributors(), ilPageObject\getParentObjectContributors(), ilMilestoneResponsiblesTableGUI\getParticipantsAndResponsibles(), ilObjSurvey\getRatersData(), ilMail\getSalutation(), ilDataCollectionRecord\getStandardField(), ilObjForumGUI\getUserNotificationTableData(), ilWorkspaceShareTableGUI\importData(), ilLOMemberTestResultTableGUI\init(), ilWorkspaceShareTableGUI\initFilter(), ilObjectCustomUserFieldsGUI\initMemberForm(), ilObjSurveyGUI\initPropertiesForm(), ilAuthContainerCalendarToken\loginObserver(), ilTestEvaluationGUI\outParticipantsResultsOverview(), ilCalendarSharedUserListTableGUI\parse(), ilCalendarSharedListTableGUI\parse(), ilConsultationHoursTableGUI\parse(), ilSessionParticipantsTableGUI\parse(), ilGroupParticipantsTableGUI\parse(), ilCourseParticipantsTableGUI\parse(), ilObjGroupGUI\readMemberData(), ilObjCourseGUI\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(), ilObjPaymentSettingsGUI\statisticObject(), ilObjUserTest\testCreateSetLookupDelete(), ilObjTest\userLookupFullName(), ilMailNotification\userToString(), and ilObjStudyProgrammeMembersGUI\viewCompletedCourses().

779  {
780  global $ilDB;
781 
782  $res = $ilDB->queryF("SELECT firstname, lastname, title, login FROM usr_data WHERE usr_id = %s",
783  array("integer"), array($a_user_id));
784  $user_rec = $ilDB->fetchAssoc($res);
785  return array("user_id" => $a_user_id,
786  "firstname" => $user_rec["firstname"],
787  "lastname" => $user_rec["lastname"],
788  "title" => $user_rec["title"],
789  "login" => $user_rec["login"]);
790  }
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupPref()

ilObjUser::_lookupPref (   $a_usr_id,
  $a_keyword 
)

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilMailSearchCoursesMembersTableGUI\__construct(), _getFeedPass(), ilNewsItem\_getNewsItemsOfUser(), ilMailSearchGroupsGUI\adoptMembers(), ilObjUserAccess\canBeDelivered(), ilMailFolderGUI\cancelDeleteMails(), ilAwarenessUserFeatureProvider\collectFeaturesForTargetUser(), ilUsersOnlineBlockGUI\fillRow(), ilMail\formatNamesForOutput(), ilBuddySystemLinkButton\getBuddyList(), ilUserUtil\getProfileLink(), ilUsersOnlineBlockGUI\getUsers(), ilBuddySystemRelationsTableGUI\populate(), ilBuddySystemGUI\requestCommand(), ilMailSearchCoursesGUI\showMembers(), ilMailSearchGroupsGUI\showMyGroups(), ilMailSearchGUI\showResults(), ilObjUserTest\testCreateSetLookupDelete(), and ilBuddySystemGUI\transitionCommand().

1266  {
1267  global $ilDB;
1268 
1269  $query = "SELECT * FROM usr_pref WHERE usr_id = ".$ilDB->quote($a_usr_id, "integer")." ".
1270  "AND keyword = ".$ilDB->quote($a_keyword, "text");
1271  $res = $ilDB->query($query);
1272 
1273  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
1274  {
1275  return $row->value;
1276  }
1277  return false;
1278  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the caller graph for this function:

◆ _moveUsersToStyle()

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

skins and styles

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

References $ilDB.

Referenced by ilObjStyleSettingsGUI\moveUserStylesObject(), and ilObjUserTest\testMiscellaneous().

3027  {
3028  global $ilDB;
3029 
3030  $q = "SELECT up1.usr_id usr_id FROM usr_pref up1, usr_pref up2 ".
3031  " WHERE up1.keyword= ".$ilDB->quote("style", "text").
3032  " AND up1.value= ".$ilDB->quote($a_from_style, "text").
3033  " AND up2.keyword= ".$ilDB->quote("skin", "text").
3034  " AND up2.value= ".$ilDB->quote($a_from_skin, "text").
3035  " AND up1.usr_id = up2.usr_id ";
3036 
3037  $usr_set = $ilDB->query($q);
3038 
3039  while ($usr_rec = $ilDB->fetchAssoc($usr_set))
3040  {
3041  self::_writePref($usr_rec["usr_id"], "skin", $a_to_skin);
3042  self::_writePref($usr_rec["usr_id"], "style", $a_to_style);
3043  }
3044  }
global $ilDB
+ 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 public

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

References $ilDB, $res, and $row.

Referenced by ilMemberExport\fetchUsers(), ilObjPaymentSettingsGUI\saveCustomerObject(), and ilObjUserTest\testCreateSetLookupDelete().

2851  {
2852  global $ilDB;
2853  $res = $ilDB->query("SELECT * FROM usr_data WHERE ".
2854  $ilDB->in("usr_id", $a_user_ids, false, "integer"));
2855  while ($row = $ilDB->fetchAssoc($res))
2856  {
2857  $user_data["$row[usr_id]"] = $row;
2858  }
2859  return $user_data ? $user_data : array();
2860  }
global $ilDB
+ Here is the caller graph for this function:

◆ _removeItemFromDesktops()

static ilObjUser::_removeItemFromDesktops (   $a_id)
static

removes object from all user's desktops public

Parameters
integerref_id
Returns
array user_ids of all affected users

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

References $ilDB, $r, and $row.

Referenced by ilUtil\removeItemFromDesktops().

3149  {
3150  global $ilDB;
3151 
3152  $r = $ilDB->queryF("SELECT user_id FROM desktop_item WHERE item_id = %s",
3153  array("integer"), array($a_id));
3154 
3155  $users = array();
3156 
3157  while ($row = $ilDB->fetchObject($r))
3158  {
3159  $users[] = $row->user_id;
3160  } // while
3161 
3162  if (count($users) > 0)
3163  {
3164  $ilDB->manipulateF("DELETE FROM desktop_item WHERE item_id = %s",
3165  array("integer"), array($a_id));
3166  }
3167 
3168  return $users;
3169  }
$r
Definition: example_031.php:79
global $ilDB
+ Here is the caller graph for this function:

◆ _resetLoginAttempts()

static ilObjUser::_resetLoginAttempts (   $a_usr_id)
static

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

References $ilDB, and $query.

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

4754  {
4755  global $ilDB;
4756 
4757  $query = "UPDATE usr_data SET login_attempts = 0 WHERE usr_id = %s";
4758  $affected = $ilDB->manipulateF( $query, array('integer'), array($a_usr_id) );
4759 
4760  if($affected) return true;
4761  else return false;
4762  }
global $ilDB
+ Here is the caller graph for this function:

◆ _setFeedPass()

ilObjUser::_setFeedPass (   $a_user_id,
  $a_password 
)

Set news feed password for user.

Parameters
integeruser_id
stringnew password

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

References $ilDB.

4442  {
4443  global $ilDB;
4444 
4445  self::_writePref($a_user_id, "priv_feed_pass",
4446  ($a_password=="") ? "" : md5($a_password));
4447  }
global $ilDB

◆ _setUserInactive()

static ilObjUser::_setUserInactive (   $a_usr_id)
static

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

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

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

4788  {
4789  global $ilDB;
4790 
4791  $query = "UPDATE usr_data SET active = 0, inactivation_date = %s WHERE usr_id = %s";
4792  $affected = $ilDB->manipulateF( $query, array('timestamp', 'integer'), array(ilUtil::now(), $a_usr_id) );
4793 
4794  if($affected) return true;
4795  else return false;
4796  }
static now()
Return current timestamp in Y-m-d H:i:s format.
global $ilDB
+ 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.

public

Parameters

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

References $ilDB, and ilUtil\now().

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

3712  {
3713  global $ilDB;
3714 
3715  if(!is_array($a_usr_ids))
3716  {
3717  return false;
3718  }
3719 
3720 
3721  if( $a_status )
3722  {
3723  $q = "UPDATE usr_data SET active = 1, inactivation_date = NULL WHERE ".
3724  $ilDB->in("usr_id", $a_usr_ids, false, "integer");
3725  $ilDB->manipulate($q);
3726  }
3727  else
3728  {
3729  $usrId_IN_usrIds = $ilDB->in("usr_id", $a_usr_ids, false, "integer");
3730 
3731  $q = "UPDATE usr_data SET active = 0 WHERE $usrId_IN_usrIds";
3732  $ilDB->manipulate($q);
3733 
3734  $queryString = "
3735  UPDATE usr_data
3736  SET inactivation_date = %s
3737  WHERE inactivation_date IS NULL
3738  AND $usrId_IN_usrIds
3739  ";
3740  $ilDB->manipulateF($queryString, array('timestamp'), array(ilUtil::now()));
3741  }
3742 
3743  return true;
3744  }
static now()
Return current timestamp in Y-m-d H:i:s format.
global $ilDB
+ 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 public

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

References $ilDB, and $query.

Referenced by ShibAuth\login().

5208  {
5209  if($a_last_login !== null) $last_login = $a_last_login;
5210  else $last_login = date('Y-m-d H:i:s');
5211 
5212  global $ilDB;
5213 
5214  $query = "UPDATE usr_data SET last_login = %s WHERE usr_id = %s";
5215  $affected = $ilDB->manipulateF( $query, array('timestamp', 'integer'), array($last_login, $a_usr_id) );
5216 
5217  if($affected) return $last_login;
5218  else return false;
5219  }
global $ilDB
+ Here is the caller graph for this function:

◆ _uploadPersonalPicture()

ilObjUser::_uploadPersonalPicture (   $tmp_file,
  $obj_id 
)

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

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

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

3876  {
3877  $webspace_dir = ilUtil::getWebspaceDir();
3878  $image_dir = $webspace_dir."/usr_images";
3879  $store_file = "usr_".$obj_id."."."jpg";
3880  $target_file = $image_dir."/$store_file";
3881 
3882  chmod($tmp_file, 0770);
3883 
3884  // take quality 100 to avoid jpeg artefacts when uploading jpeg files
3885  // taking only frame [0] to avoid problems with animated gifs
3886  $show_file = "$image_dir/usr_".$obj_id.".jpg";
3887  $thumb_file = "$image_dir/usr_".$obj_id."_small.jpg";
3888  $xthumb_file = "$image_dir/usr_".$obj_id."_xsmall.jpg";
3889  $xxthumb_file = "$image_dir/usr_".$obj_id."_xxsmall.jpg";
3890 
3891  ilUtil::execConvert($tmp_file . "[0] -geometry 200x200 -quality 100 JPEG:".$show_file);
3892  ilUtil::execConvert($tmp_file . "[0] -geometry 100x100 -quality 100 JPEG:".$thumb_file);
3893  ilUtil::execConvert($tmp_file . "[0] -geometry 75x75 -quality 100 JPEG:".$xthumb_file);
3894  ilUtil::execConvert($tmp_file . "[0] -geometry 30x30 -quality 100 JPEG:".$xxthumb_file);
3895 
3896  // store filename
3897  self::_writePref($obj_id, "profile_image", $store_file);
3898 
3899  return TRUE;
3900  }
static execConvert($args)
execute convert command
static getWebspaceDir($mode="filesystem")
get webspace directory
+ 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 5082 of file class.ilObjUser.php.

References $ilDB, $res, and $row.

Referenced by ilStartUpGUI\confirmRegistration().

5083  {
5084  global $ilDB;
5085 
5086  $res = $ilDB->queryf('
5087  SELECT usr_id, create_date FROM usr_data
5088  WHERE reg_hash = %s',
5089  array('text'),
5090  array($a_hash));
5091  while($row = $ilDB->fetchAssoc($res))
5092  {
5093  require_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
5094  $oRegSettigs = new ilRegistrationSettings();
5095 
5096  if((int)$oRegSettigs->getRegistrationHashLifetime() != 0 &&
5097  time() - (int)$oRegSettigs->getRegistrationHashLifetime() > strtotime($row['create_date']))
5098  {
5099  require_once 'Services/Registration/exceptions/class.ilRegConfirmationLinkExpiredException.php';
5100  throw new ilRegConfirmationLinkExpiredException('reg_confirmation_hash_life_time_expired', $row['usr_id']);
5101  }
5102 
5103  $ilDB->manipulateF('
5104  UPDATE usr_data
5105  SET reg_hash = %s
5106  WHERE usr_id = %s',
5107  array('text', 'integer'),
5108  array('', (int)$row['usr_id'])
5109  );
5110 
5111  return (int)$row['usr_id'];
5112  }
5113 
5114  require_once 'Services/Registration/exceptions/class.ilRegistrationHashNotFoundException.php';
5115  throw new ilRegistrationHashNotFoundException('reg_confirmation_hash_not_found');
5116  }
Class for user related exception handling in ILIAS.
Class ilObjAuthSettingsGUI.
global $ilDB
Class for user related exception handling in ILIAS.
+ Here is the caller graph for this function:

◆ _writeAuthMode()

ilObjUser::_writeAuthMode (   $a_usr_id,
  $a_auth_mode 
)

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

References $ilDB.

Referenced by ilObjUserTest\testAuthAndEmailMethods().

2044  {
2045  global $ilDB;
2046 
2047  $ilDB->manipulateF("UPDATE usr_data ".
2048  " SET auth_mode = %s WHERE usr_id = %s",
2049  array("text", "integer"),
2050  array($a_auth_mode, $a_usr_id));
2051  }
global $ilDB
+ Here is the caller graph for this function:

◆ _writeExternalAccount()

ilObjUser::_writeExternalAccount (   $a_usr_id,
  $a_ext_id 
)

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

References $ilDB.

Referenced by ilObjUserTest\testAuthAndEmailMethods().

2034  {
2035  global $ilDB;
2036 
2037  $ilDB->manipulateF("UPDATE usr_data ".
2038  " SET ext_account = %s WHERE usr_id = %s",
2039  array("text", "integer"),
2040  array($a_ext_id, $a_usr_id));
2041  }
global $ilDB
+ Here is the caller graph for this function:

◆ _writeHistory()

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

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

References $ilDB, $r, $res, $timestamp, ilUserAccountSettings\getInstance(), and ilUserFilter\getInstance().

Referenced by updateLogin().

4822  {
4823  global $ilDB;
4824 
4825  $timestamp = time();
4826 
4827  $res = $ilDB->queryF('SELECT * FROM loginname_history WHERE usr_id = %s AND login = %s AND history_date = %s',
4828  array('integer', 'text', 'integer'),
4829  array($a_usr_id, $a_login, $timestamp));
4830 
4831  if( $ilDB->numRows($res) == 0 )
4832  {
4833  $ilDB->manipulateF('
4834  INSERT INTO loginname_history
4835  (usr_id, login, history_date)
4836  VALUES (%s, %s, %s)',
4837  array('integer', 'text', 'integer'),
4838  array($a_usr_id, $a_login, $timestamp));
4839  }
4840 
4841  return true;
4842  }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
global $ilDB
+ Here is the call graph for this function:
+ 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 1134 of file class.ilObjUser.php.

References $ilDB.

Referenced by ilOpenIdAttributeToUser\create(), and ilChatroomBlockGUI\getChatroomSelectionList().

1135  {
1136  global $ilDB;
1137  $ilDB->replace("usr_pref",
1138  array(
1139  "usr_id" => array("integer", $a_usr_id),
1140  "keyword" => array("text", $a_keyword),
1141  ),
1142  array(
1143  "value" => array("text",$a_value)
1144  )
1145  );
1146 
1147  /*
1148  self::_deletePref($a_usr_id, $a_keyword);
1149  if(strlen($a_value))
1150  {
1151  $ilDB->manipulateF(
1152  'INSERT INTO usr_pref (usr_id, keyword, value) VALUES (%s, %s, %s)',
1153  array('integer', 'text', 'text'),
1154  array($a_usr_id, $a_keyword, $a_value)
1155  );
1156  }*/
1157  }
global $ilDB
+ Here is the caller graph for this function:

◆ activateDeletionFlag()

ilObjUser::activateDeletionFlag ( )

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

References writePref().

5560  {
5561  $this->writePref("delete_flag", true);
5562  }
writePref($a_keyword, $a_value)
write userpref to user table private
+ 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 3084 of file class.ilObjUser.php.

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

3085  {
3086  ilObjUser::_addDesktopItem($this->getId(), $a_item_id, $a_type, $a_par);
3087  }
getId()
get object id public
static _addDesktopItem($a_usr_id, $a_item_id, $a_type, $a_par="")
add an item to user&#39;s personal desktop
+ 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 3373 of file class.ilObjUser.php.

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

3375  {
3376  global $ilDB;
3377 
3378  if ($a_time == 0)
3379  {
3380  $a_time = date("Y-m-d H:i:s", time());
3381  }
3382 
3383  $item_set = $ilDB->queryF("SELECT * FROM personal_clipboard WHERE ".
3384  "parent = %s AND item_id = %s AND type = %s AND user_id = %s",
3385  array("integer", "integer", "text", "integer"),
3386  array(0, $a_item_id, $a_type, $this->getId()));
3387 
3388  // only insert if item is not already in clipboard
3389  if (!$d = $item_set->fetchRow())
3390  {
3391  $ilDB->manipulateF("INSERT INTO personal_clipboard ".
3392  "(item_id, type, user_id, title, parent, insert_time, order_nr) VALUES ".
3393  " (%s,%s,%s,%s,%s,%s,%s)",
3394  array("integer", "text", "integer", "text", "integer", "timestamp", "integer"),
3395  array($a_item_id, $a_type, $this->getId(), $a_title, (int) $a_parent, $a_time, (int) $a_order_nr));
3396  }
3397  else
3398  {
3399  $ilDB->manipulateF("UPDATE personal_clipboard SET insert_time = %s ".
3400  "WHERE user_id = %s AND item_id = %s AND type = %s AND parent = 0",
3401  array("timestamp", "integer", "integer", "text"),
3402  array($a_time, $this->getId(), $a_item_id, $a_type));
3403  }
3404  }
getId()
get object id public
global $ilDB
+ 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 3409 of file class.ilObjUser.php.

References $ilDB, and ilObject\getId().

3410  {
3411  global $ilDB;
3412  if ($a_time == 0)
3413  {
3414  $a_time = date("Y-m-d H:i:s", time());
3415  }
3416  $ilDB->insert("personal_pc_clipboard", array(
3417  "user_id" => array("integer", $this->getId()),
3418  "content" => array("clob", $a_content),
3419  "insert_time" => array("timestamp", $a_time),
3420  "order_nr" => array("integer", $a_nr)
3421  ));
3422  }
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:

◆ addUserDefinedFieldEntry()

ilObjUser::addUserDefinedFieldEntry ( )

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

References $ilDB.

Referenced by assignData().

4163  {
4164  global $ilDB;
4165 
4166 // not needed. no entry in udf_text/udf_clob means no value
4167 
4168 /* $query = "INSERT INTO udf_data (usr_id ) ".
4169  "VALUES( ".
4170  $ilDB->quote($this->getId(),'integer').
4171  ")";
4172  $res = $ilDB->manipulate($query);
4173 */
4174  return true;
4175  }
global $ilDB
+ Here is the caller graph for this function:

◆ assignData()

ilObjUser::assignData (   $a_data)

loads a record "user" from array public

Parameters
arrayuserdata

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

References $ilDB, $ilErr, ilObject\$lng, $passwd, addUserDefinedFieldEntry(), getAuthMode(), getBirthday(), getExternalAccount(), ilUserPasswordManager\getInstance(), getPasswd(), getPasswordEncodingType(), getPasswordSalt(), getProfileIncomplete(), getStoredActive(), getTimeLimitFrom(), getTimeLimitMessage(), getTimeLimitOwner(), getTimeLimitUnlimited(), getTimeLimitUntil(), IL_PASSWD_CRYPTED, IL_PASSWD_PLAIN, ilUtil\now(), read(), setAuthMode(), setBirthday(), setCity(), setClientIP(), setComment(), setCountry(), setDelicious(), setDepartment(), setEmail(), setExternalAccount(), setFax(), setFirstname(), setFullname(), setGender(), setHobby(), setInactivationDate(), setInstantMessengerId(), setInstitution(), setIsSelfRegistered(), setLastLogin(), setLastname(), setLastUpdate(), setLatitude(), setLocationZoom(), setLogin(), setLongitude(), setMatriculation(), setPasswd(), setPasswordEncodingType(), setPasswordSalt(), setPhoneHome(), setPhoneMobile(), setPhoneOffice(), setProfileIncomplete(), setSelectedCountry(), setStreet(), setTimeLimitFrom(), setTimeLimitMessage(), setTimeLimitOwner(), setTimeLimitUnlimited(), setTimeLimitUntil(), setUTitle(), setZipcode(), syncActive(), ilObject\update(), updateMultiTextFields(), updateUserDefinedFields(), and writePrefs().

Referenced by read().

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

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

5689  {
5690  $current = $this->$a_attr;
5691  if(is_array($current) && sizeof($current))
5692  {
5693  return implode(", ", $current);
5694  }
5695  }
+ Here is the caller graph for this function:

◆ checkTimeLimit()

ilObjUser::checkTimeLimit ( )

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

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

2322  {
2323  if($this->getTimeLimitUnlimited())
2324  {
2325  return true;
2326  }
2327  if($this->getTimeLimitFrom() < time() and $this->getTimeLimitUntil() > time())
2328  {
2329  return true;
2330  }
2331  return false;
2332  }
+ Here is the call graph for this function:

◆ checkUserId()

ilObjUser::checkUserId ( )

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

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

2557  {
2558  global $ilAuth, $ilSetting;
2559 
2562  if ($id > 0)
2563  {
2564  return $id;
2565  }
2566  return false;
2567  }
$login
all user related data in single vars public
static _lookupId($a_user_str)
Lookup id by login.
static getLoginFromAuth()
Gets the username from $ilAuth, and converts it into an ILIAS login name.
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ clipboardDeleteAll()

ilObjUser::clipboardDeleteAll ( )

Delete objects of type for user.

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

References $ilDB, and ilObject\getId().

Referenced by delete().

3484  {
3485  global $ilDB;
3486 
3487  $ilDB->manipulateF("DELETE FROM personal_clipboard WHERE ".
3488  "user_id = %s", array("integer"), array($this->getId()));
3489  }
getId()
get object id public
global $ilDB
+ 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 3470 of file class.ilObjUser.php.

References $ilDB, and ilObject\getId().

3471  {
3472  global $ilDB;
3473 
3474  $ilDB->manipulateF("DELETE FROM personal_clipboard WHERE ".
3475  "type = %s AND user_id = %s",
3476  array("text", "integer"),
3477  array($a_type, $this->getId()));
3478  }
getId()
get object id public
global $ilDB
+ 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 3451 of file class.ilObjUser.php.

References $ilDB, and ilObject\getId().

3452  {
3453  global $ilDB;
3454 
3455  $set = $ilDB->queryF("SELECT * FROM personal_clipboard WHERE ".
3456  "parent = %s AND type = %s AND user_id = %s",
3457  array("integer", "text", "integer"),
3458  array(0, $a_type, $this->getId()));
3459  if ($rec = $ilDB->fetchAssoc($set))
3460  {
3461  return true;
3462  }
3463 
3464  return false;
3465  }
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:

◆ copyProfilePicturesToDirectory()

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

Get profile picture direcotory.

Parameters

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

References ilUtil\getWebspaceDir().

Referenced by ilUserDataSet\getXmlRecord().

4006  {
4007  $a_dir = trim(str_replace("..", "", $a_dir));
4008  if ($a_dir == "" || !is_dir($a_dir))
4009  {
4010  return;
4011  }
4012 
4013  $webspace_dir = ilUtil::getWebspaceDir();
4014  $image_dir = $webspace_dir."/usr_images";
4015  $images = array(
4016  "upload_".$a_user_id."pic",
4017  "usr_".$a_user_id."."."jpg",
4018  "usr_".$a_user_id."_small.jpg",
4019  "usr_".$a_user_id."_xsmall.jpg",
4020  "usr_".$a_user_id."_xxsmall.jpg",
4021  "upload_".$a_user_id);
4022  foreach ($images as $image)
4023  {
4024  if (is_file($image_dir."/".$image))
4025  {
4026  copy($image_dir."/".$image, $a_dir."/".$image);
4027  }
4028  }
4029  }
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilObjUser::delete ( )

deletes a user public

Parameters
integeruser_id

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

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

1302  {
1303  global $rbacadmin, $ilDB;
1304 
1305  // deassign from ldap groups
1306  include_once('Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php');
1308  $mapping->deleteUser($this->getId());
1309 
1310  // remove mailbox / update sent mails
1311  include_once ("Services/Mail/classes/class.ilMailbox.php");
1312  $mailbox = new ilMailbox($this->getId());
1313  $mailbox->delete();
1314  $mailbox->updateMailsOfDeletedUser($this->getLogin());
1315 
1316  // delete feed blocks on personal desktop
1317  include_once("./Services/Block/classes/class.ilCustomBlock.php");
1318  $costum_block = new ilCustomBlock();
1319  $costum_block->setContextObjId($this->getId());
1320  $costum_block->setContextObjType("user");
1321  $c_blocks = $costum_block->queryBlocksForContext();
1322  include_once("./Services/Feeds/classes/class.ilPDExternalFeedBlock.php");
1323  foreach($c_blocks as $c_block)
1324  {
1325  if ($c_block["type"] == "pdfeed")
1326  {
1327  $fb = new ilPDExternalFeedBlock($c_block["id"]);
1328  $fb->delete();
1329  }
1330  }
1331 
1332 
1333  // delete block settings
1334  include_once("./Services/Block/classes/class.ilBlockSetting.php");
1336 
1337  // delete user_account
1338  $ilDB->manipulateF("DELETE FROM usr_data WHERE usr_id = %s",
1339  array("integer"), array($this->getId()));
1340 
1341  $this->deleteMultiTextFields();
1342 
1343  // delete user_prefs
1344  ilObjUser::_deleteAllPref($this->getId());
1345 
1346  $this->removeUserPicture(false); // #8597
1347 
1348  // delete user_session
1349  include_once("./Services/Authentication/classes/class.ilSession.php");
1351 
1352  // remove user from rbac
1353  $rbacadmin->removeUser($this->getId());
1354 
1355  // remove bookmarks
1356  // TODO: move this to class.ilBookmarkFolder
1357  $q = "DELETE FROM bookmark_tree WHERE tree = ".
1358  $ilDB->quote($this->getId(), "integer");
1359  $ilDB->manipulate($q);
1360 
1361  $q = "DELETE FROM bookmark_data WHERE user_id = ".
1362  $ilDB->quote($this->getId(), "integer");
1363  $ilDB->manipulate($q);
1364 
1365  // DELETE FORUM ENTRIES (not complete in the moment)
1366  include_once './Modules/Forum/classes/class.ilObjForum.php';
1367  ilObjForum::_deleteUser($this->getId());
1368 
1369  // Delete link check notify entries
1370  include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
1372 
1373  // Delete crs entries
1374  include_once './Modules/Course/classes/class.ilObjCourse.php';
1375  ilObjCourse::_deleteUser($this->getId());
1376 
1377  // Delete user tracking
1378  include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
1380 
1381  include_once 'Modules/Session/classes/class.ilEventParticipants.php';
1383 
1384  // Delete Tracking data SCORM 2004 RTE
1385  include_once 'Modules/Scorm2004/classes/ilSCORM13Package.php';
1387 
1388  // Delete Tracking data SCORM 1.2 RTE
1389  include_once 'Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
1391 
1392  // remove all notifications
1393  include_once "./Services/Notification/classes/class.ilNotification.php";
1395 
1396  // remove portfolios
1397  include_once "./Modules/Portfolio/classes/class.ilObjPortfolio.php";
1399 
1400  // remove workspace
1401  include_once "./Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
1402  $tree = new ilWorkspaceTree($this->getId());
1403  $tree->cascadingDelete();
1404 
1405  // remove disk quota entries
1406  include_once "./Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
1408 
1409  // remove reminder entries
1410  require_once 'Services/User/classes/class.ilCronDeleteInactiveUserReminderMail.php';
1412 
1413  // Delete user defined field entries
1415 
1416  // Delete clipboard entries
1417  $this->clipboardDeleteAll();
1418 
1419  // Reset owner
1420  $this->resetOwner();
1421 
1422  // Trigger deleteUser Event
1423  global $ilAppEventHandler;
1424  $ilAppEventHandler->raise(
1425  'Services/User', 'deleteUser', array('usr_id' => $this->getId())
1426  );
1427 
1428  // delete object data
1429  parent::delete();
1430  return true;
1431  }
getLogin()
get login / username public
static _deleteUser($a_usr_id)
clipboardDeleteAll()
Delete objects of type for user.
static _deleteSettingsOfUser($a_user)
Delete block settings of user.
removeUserPicture($a_do_update=true)
Remove user picture.
Custom block for external feeds on personal desktop.
static deleteByOwner($a_owner_id)
Delete all entries for owner.
deleteUserDefinedFieldEntries()
Tree handler for personal workspace.
static removeForUser($user_id)
Remove all notifications for given user.
static _getInstance()
Get singleton instance of this class.
getId()
get object id public
Mail Box class Base class for creating and handling mail boxes.
static _removeTrackingDataForUser($user_id)
static _destroyByUserId($a_user_id)
Destroy session.
This is the super class of all custom blocks.
deleteMultiTextFields()
Remove multi-text values from DB.
_deleteAllPref($a_user_id)
Deletes a userpref value of the user from the database public.
global $ilDB
static deleteUserPortfolios($a_user_id)
Delete all portfolio data for user.
_deleteUser($a_usr_id)
+ Here is the call graph for this function:

◆ deleteMultiTextFields()

ilObjUser::deleteMultiTextFields ( )
protected

Remove multi-text values from DB.

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

References $ilDB, and ilObject\getId().

Referenced by delete(), and updateMultiTextFields().

5797  {
5798  global $ilDB;
5799 
5800  if(!$this->getId())
5801  {
5802  return;
5803  }
5804 
5805  $ilDB->manipulate("DELETE FROM usr_data_multi".
5806  " WHERE usr_id = ".$ilDB->quote($this->getId(), "integer"));
5807  }
getId()
get object id public
global $ilDB
+ 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 public.

Parameters
stringkeyword

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

References $ilDB, and ilObject\getId().

1092  {
1093  self::_deletePref($this->getId(), $a_keyword);
1094  }
getId()
get object id public
+ Here is the call graph for this function:

◆ deleteUserDefinedFieldEntries()

ilObjUser::deleteUserDefinedFieldEntries ( )

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

References $data, $ilDB, ilObject\$lng, ilUserDefinedFields\_getInstance(), ilObject\_lookupTitle(), ilUserDefinedData\deleteEntriesOfUser(), ilDatePresentation\formatDate(), ilDatePresentation\formatPeriod(), getCity(), getComment(), getCountry(), ilObject\getCreateDate(), getDepartment(), getEmail(), getFax(), getFirstname(), getGender(), getHobby(), ilObject\getId(), getInstitution(), getLastname(), getLogin(), getMatriculation(), getPhoneHome(), getPhoneMobile(), getPhoneOffice(), getSelectedCountry(), getStreet(), getTimeLimitFrom(), getTimeLimitUnlimited(), getTimeLimitUntil(), getUserDefinedData(), getUTitle(), getZipcode(), IL_CAL_DATETIME, IL_CAL_UNIX, ilDatePresentation\resetToDefaults(), ilDatePresentation\setLanguage(), ilDatePresentation\setUseRelativeDates(), and UDF_TYPE_WYSIWYG.

Referenced by delete().

4178  {
4179  global $ilDB;
4180 
4181  include_once("./Services/User/classes/class.ilUserDefinedData.php");
4183 
4184  // wrong place...
4185 /* $query = "DELETE FROM udf_data ".
4186  "WHERE usr_id = ".$ilDB->quote($this->getId(),'integer');
4187  $res = $ilDB->manipulate($query);*/
4188 
4189  return true;
4190  }
getId()
get object id public
static deleteEntriesOfUser($a_user_id)
Delete data of user.
global $ilDB
+ 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 3137 of file class.ilObjUser.php.

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

Referenced by ilObjGroup\leaveGroup().

3138  {
3139  ilObjUser::_dropDesktopItem($this->getId(), $a_item_id, $a_type);
3140  }
getId()
get object id public
static _dropDesktopItem($a_usr_id, $a_item_id, $a_type)
drop an item from user&#39;s personal desktop
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exportPersonalData()

ilObjUser::exportPersonalData ( )

Export personal data.

Parameters

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

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

5296  {
5297  include_once("./Services/Export/classes/class.ilExport.php");
5298  $exp = new ilExport();
5299  $dir = ilExport::_getExportDirectory($this->getId(), "xml", "usr", "personal_data");
5300  ilUtil::delDir($dir, true);
5301  $title = $this->getLastname().", ".$this->getLastname()." [".$this->getLogin()."]";
5302  $exp->exportEntity("personal_data", $this->getId(), "4.5.0",
5303  "Services/User", $title, $dir);
5304  }
getLogin()
get login / username public
getLastname()
get lastname public
getId()
get object id public
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ findInterests()

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

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

References $ilDB, $res, and $row.

Referenced by ilPublicUserProfileGUI\getAutocompleteResult().

5810  {
5811  global $ilDB;
5812 
5813  $res = array();
5814 
5815  $sql = "SELECT DISTINCT(value)".
5816  " FROM usr_data_multi".
5817  " WHERE ".$ilDB->like("value", "text", "%".$a_term."%");
5818  if($a_field_id)
5819  {
5820  $sql .= " AND field_id = ".$ilDB->quote($a_field_id, "text");
5821  }
5822  if($a_user_id)
5823  {
5824  $sql .= " AND usr_id <> ".$ilDB->quote($a_user_id, "integer");
5825  }
5826  $sql .= " ORDER BY value";
5827  $set = $ilDB->query($sql);
5828  while($row = $ilDB->fetchAssoc($set))
5829  {
5830  $res[] = $row["value"];
5831  }
5832 
5833  return $res;
5834  }
global $ilDB
+ Here is the caller graph for this function:

◆ getActive()

ilObjUser::getActive ( )

get user active state public

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

References $active.

Referenced by ilAuthBase\checkExceededLoginAttempts().

2196  {
2197  return $this->active;
2198  }
+ Here is the caller graph for this function:

◆ getAgreeDate()

ilObjUser::getAgreeDate ( )

get the date when the user accepted the user agreement public

Returns
string date of last update

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

References $agree_date.

2153  {
2154  return $this->agree_date;
2155  }

◆ getAppliedUsers()

& ilObjUser::getAppliedUsers ( )

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

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

2496  {
2497  $this->applied_users = array();
2498  $this->__readAppliedUsers($this->getId());
2499 
2500  return $this->applied_users ? $this->applied_users : array();
2501  }
getId()
get object id public
__readAppliedUsers($a_parent_id)
+ Here is the call graph for this function:

◆ getApproveDate()

ilObjUser::getApproveDate ( )

get the date when the user account was approved public

Returns
string approve date

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

References $approve_date.

2142  {
2143  return $this->approve_date;
2144  }

◆ getAuthMode()

ilObjUser::getAuthMode (   $a_auth_key = false)

get auth mode public

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

References $auth_mode, and ilAuthUtils\_getAuthMode().

Referenced by assignData(), ilECSAppEventListener\handleMembership(), and isPasswordChangeDemanded().

3628  {
3629  if (!$a_auth_key)
3630  {
3631  return $this->auth_mode;
3632  }
3633 
3634  include_once('./Services/Authentication/classes/class.ilAuthUtils.php');
3635  return ilAuthUtils::_getAuthMode($this->auth_mode);
3636  }
_getAuthMode($a_auth_mode, $a_db_handler='')
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBirthday()

ilObjUser::getBirthday ( )

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

References $birthday.

Referenced by assignData().

5132  {
5133  return $this->birthday;
5134  }
+ Here is the caller graph for this function:

◆ getCity()

ilObjUser::getCity ( )

get city public

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

References $city.

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

1720  {
1721  return $this->city;
1722  }
+ Here is the caller graph for this function:

◆ getClientIP()

ilObjUser::getClientIP ( )

get client ip number public

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

References $client_ip.

1875  {
1876  return $this->client_ip;
1877  }

◆ getClipboardChilds()

ilObjUser::getClipboardChilds (   $a_parent,
  $a_insert_time 
)

Get childs of an item.

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

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

3535  {
3536  global $ilDB, $ilUser;
3537 
3538  $objs = $ilDB->queryF("SELECT * FROM personal_clipboard WHERE ".
3539  "user_id = %s AND parent = %s AND insert_time = %s ".
3540  " ORDER BY order_nr",
3541  array("integer", "integer", "timestamp"),
3542  array($ilUser->getId(), (int) $a_parent, $a_insert_time));
3543  $objects = array();
3544  while ($obj = $ilDB->fetchAssoc($objs))
3545  {
3546  if ($obj["type"] == "mob")
3547  {
3548  $obj["title"] = ilObject::_lookupTitle($obj["item_id"]);
3549  }
3550  $objects[] = array ("id" => $obj["item_id"],
3551  "type" => $obj["type"], "title" => $obj["title"], "insert_time" => $obj["insert_time"]);
3552  }
3553  return $objects;
3554  }
static _lookupTitle($a_id)
lookup object title
global $ilUser
Definition: imgupload.php:15
global $ilDB
+ 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 3494 of file class.ilObjUser.php.

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

3495  {
3496  global $ilDB;
3497 
3498  $par = "";
3499  if ($a_top_nodes_only)
3500  {
3501  $par = " AND parent = ".$ilDB->quote(0, "integer")." ";
3502  }
3503 
3504  $type_str = ($a_type != "")
3505  ? " AND type = ".$ilDB->quote($a_type, "text")." "
3506  : "";
3507  $q = "SELECT * FROM personal_clipboard WHERE ".
3508  "user_id = ".$ilDB->quote($this->getId(), "integer")." ".
3509  $type_str.$par.
3510  " ORDER BY order_nr";
3511  $objs = $ilDB->query($q);
3512  $objects = array();
3513  while ($obj = $ilDB->fetchAssoc($objs))
3514  {
3515  if ($obj["type"] == "mob")
3516  {
3517  $obj["title"] = ilObject::_lookupTitle($obj["item_id"]);
3518  }
3519  if ($obj["type"] == "incl")
3520  {
3521  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
3522  $obj["title"] = ilMediaPoolPage::lookupTitle($obj["item_id"]);
3523  }
3524  $objects[] = array ("id" => $obj["item_id"],
3525  "type" => $obj["type"], "title" => $obj["title"],
3526  "insert_time" => $obj["insert_time"]);
3527  }
3528  return $objects;
3529  }
static _lookupTitle($a_id)
lookup object title
static lookupTitle($a_page_id)
Lookup title.
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:

◆ getComment()

ilObjUser::getComment ( )

get referral comment public

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

References $referral_comment.

Referenced by deleteUserDefinedFieldEntries().

2121  {
2122  return $this->referral_comment;
2123  }
+ Here is the caller graph for this function:

◆ getCountry()

ilObjUser::getCountry ( )

Get country (free text)

public

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

References $country.

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

1760  {
1761  return $this->country;
1762  }
+ 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 2057 of file class.ilObjUser.php.

References $_SESSION.

2058  {
2059  return $_SESSION['lang'];
2060  }
$_SESSION["AccountId"]

◆ getDateFormat()

ilObjUser::getDateFormat ( )

get date format

public

Returns

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

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

1221  {
1222  if($format = $this->getPref('date_format'))
1223  {
1224  return $format;
1225  }
1226  else
1227  {
1228  include_once('Services/Calendar/classes/class.ilCalendarSettings.php');
1229  $settings = ilCalendarSettings::_getInstance();
1230  return $settings->getDefaultDateFormat();
1231  }
1232  }
static _getInstance()
get singleton instance
getPref($a_keyword)
get a user preference
+ Here is the call graph for this function:

◆ getDelicious()

ilObjUser::getDelicious ( )

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

References $delicious.

4384  {
4385  return $this->delicious;
4386  }

◆ getDepartment()

ilObjUser::getDepartment ( )

get department public

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

References $department.

Referenced by deleteUserDefinedFieldEntries().

1682  {
1683  return $this->department;
1684  }
+ Here is the caller graph for this function:

◆ getDesktopItems()

ilObjUser::getDesktopItems (   $a_types = "")

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

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

3254  {
3255  return $this->_lookupDesktopItems($this->getId(), $a_types);
3256  }
getId()
get object id public
static _lookupDesktopItems($user_id, $a_types="")
get all desktop items of user and specified type
+ 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.

public

Returns
integer

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

1997  {
1998  return $this->prefs["disk_quota"] ? $this->prefs["disk_quota"] : 0;
1999  }

◆ getEmail()

ilObjUser::getEmail ( )

get email address public

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

References $email.

Referenced by shibUser\createFields(), deleteUserDefinedFieldEntries(), ilPasswordAssistanceGUI\sendPasswordAssistanceMail(), and shibUser\updateFields().

1930  {
1931  return $this->email;
1932  }
+ 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.

public

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

Referenced by assignData(), and ilECSAppEventListener\handleMembership().

3658  {
3659  return $this->ext_account;
3660  }
+ Here is the caller graph for this function:

◆ getFax()

ilObjUser::getFax ( )

get fax public

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

References $fax.

Referenced by deleteUserDefinedFieldEntries().

1856  {
1857  return $this->fax;
1858  }
+ Here is the caller graph for this function:

◆ getFirstLettersOfLastnames()

static ilObjUser::getFirstLettersOfLastnames ( )
static

Get first letters of all lastnames.

Parameters

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

References $ilDB.

Referenced by ilObjUserFolderGUI\viewObject().

5240  {
5241  global $ilDB;
5242 
5243  $q = "SELECT DISTINCT ".$ilDB->upper($ilDB->substr("lastname", 1, 1))." let".
5244  " FROM usr_data".
5245  " WHERE usr_id <> ".$ilDB->quote(ANONYMOUS_USER_ID, "integer").
5246  " ORDER BY let";
5247  $let_set = $ilDB->query($q);
5248 
5249  $lets = array();
5250  while ($let_rec = $ilDB->fetchAssoc($let_set))
5251  {
5252  $let[$let_rec["let"]] = $let_rec["let"];
5253  }
5254  return $let;
5255  }
global $ilDB
+ Here is the caller graph for this function:

◆ getFirstname()

ilObjUser::getFirstname ( )

get firstname public

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

References $firstname.

Referenced by deleteUserDefinedFieldEntries(), getPublicName(), and shibUser\returnNewLoginName().

1625  {
1626  return $this->firstname;
1627  }
+ Here is the caller graph for this function:

◆ getFullname()

ilObjUser::getFullname (   $a_max_strlen = 0)

get fullname 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 1486 of file class.ilObjUser.php.

References ilUtil\stripSlashes().

Referenced by shibUser\createFields().

1487  {
1488  if (!$a_max_strlen)
1489  {
1490  return ilUtil::stripSlashes($this->fullname);
1491  }
1492 
1493  if (strlen($this->fullname) <= $a_max_strlen)
1494  {
1495  return ilUtil::stripSlashes($this->fullname);
1496  }
1497 
1498  if ((strlen($this->utitle) + strlen($this->lastname) + 4) <= $a_max_strlen)
1499  {
1500  return ilUtil::stripSlashes($this->utitle." ".substr($this->firstname,0,1).". ".$this->lastname);
1501  }
1502 
1503  if ((strlen($this->firstname) + strlen($this->lastname) + 1) <= $a_max_strlen)
1504  {
1505  return ilUtil::stripSlashes($this->firstname." ".$this->lastname);
1506  }
1507 
1508  if ((strlen($this->lastname) + 3) <= $a_max_strlen)
1509  {
1510  return ilUtil::stripSlashes(substr($this->firstname,0,1).". ".$this->lastname);
1511  }
1512 
1513  return ilUtil::stripSlashes(substr($this->lastname,0,$a_max_strlen));
1514  }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGender()

ilObjUser::getGender ( )

get gender public

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

References $gender.

Referenced by deleteUserDefinedFieldEntries().

1583  {
1584  return $this->gender;
1585  }
+ Here is the caller graph for this function:

◆ getGeneralInterests()

ilObjUser::getGeneralInterests ( )

Get general interests.

Returns
array $value

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

References $interests_general.

Referenced by updateMultiTextFields().

5608  {
5609  return $this->interests_general;
5610  }
+ Here is the caller graph for this function:

◆ getGeneralInterestsAsText()

ilObjUser::getGeneralInterestsAsText ( )

Get general interests as plain text.

Returns
string

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

References buildTextFromArray().

5618  {
5619  return $this->buildTextFromArray("interests_general");
5620  }
buildTextFromArray($a_attr)
Convert multi-text values to plain text.
+ Here is the call graph for this function:

◆ getHobby()

ilObjUser::getHobby ( )

get hobby public

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

References $hobby.

Referenced by deleteUserDefinedFieldEntries().

1949  {
1950  return $this->hobby;
1951  }
+ Here is the caller graph for this function:

◆ getInactivationDate()

ilObjUser::getInactivationDate ( )

getter for inactivation date

Returns
string $inactivation_date

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

References $inactivation_date.

5442  {
5443  return $this->inactivation_date;
5444  }

◆ getInstantMessengerId()

ilObjUser::getInstantMessengerId (   $a_im_type)

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

4373  {
4374  $var = "im_".$a_im_type;
4375  return $this->$var;
4376  }

◆ getInstitution()

ilObjUser::getInstitution ( )

get institution public

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

References $institution.

Referenced by deleteUserDefinedFieldEntries().

1663  {
1664  return $this->institution;
1665  }
+ Here is the caller graph for this function:

◆ getLanguage()

ilObjUser::getLanguage ( )

returns a 2char-language-string public

Returns
string language

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

Referenced by ilNotificationConfig\getUserInstance(), and ilMailTemplateContext\initLanguage().

1970  {
1971  return $this->prefs["language"];
1972  }
+ Here is the caller graph for this function:

◆ getLastLogin()

ilObjUser::getLastLogin ( )

returns last login date public

Returns
string date

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

2088  {
2089  return $this->last_login;
2090  }

◆ getLastname()

ilObjUser::getLastname ( )

get lastname public

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

References $lastname.

Referenced by deleteUserDefinedFieldEntries(), exportPersonalData(), getPublicName(), and shibUser\returnNewLoginName().

1644  {
1645  return $this->lastname;
1646  }
+ Here is the caller graph for this function:

◆ getLastPasswordChangeTS()

ilObjUser::getLastPasswordChangeTS ( )

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

References $last_password_change_ts.

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

2012  {
2014  }
+ Here is the caller graph for this function:

◆ getLastUpdate()

ilObjUser::getLastUpdate ( )

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

References ilObject\$last_update.

2102  {
2103  return $this->last_update;
2104  }

◆ getLatitude()

ilObjUser::getLatitude ( )

Get Latitude.

Returns
string Latitude

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

References $latitude.

Referenced by ilPersonalProfileGUI\addLocationToForm().

2451  {
2452  return $this->latitude;
2453  }
+ Here is the caller graph for this function:

◆ getLocationZoom()

ilObjUser::getLocationZoom ( )

Get Location Zoom.

Returns
int Location Zoom

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

References $loc_zoom.

Referenced by ilPersonalProfileGUI\addLocationToForm().

2491  {
2492  return $this->loc_zoom;
2493  }
+ Here is the caller graph for this function:

◆ getLogin()

ilObjUser::getLogin ( )

get login / username public

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

References $login.

Referenced by shibUser\create(), delete(), deleteUserDefinedFieldEntries(), exportPersonalData(), getPublicName(), ilPasswordAssistanceGUI\sendPasswordAssistanceMail(), and updateLogin().

1531  {
1532  return $this->login;
1533  }
$login
all user related data in single vars public
+ Here is the caller graph for this function:

◆ getLoginAttempts()

ilObjUser::getLoginAttempts ( )

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

References $login_attempts.

2316  {
2317  return $this->login_attempts;
2318  }

◆ getLoginByUserId()

ilObjUser::getLoginByUserId (   $a_userid)

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

References $login, and _lookupLogin().

Referenced by ilObjPaymentSettingsGUI\editVendorObject().

2684  {
2685  $login = ilObjUser::_lookupLogin($a_userid);
2686  return $login ? $login : false;
2687  }
static _lookupLogin($a_user_id)
lookup login
$login
all user related data in single vars public
+ Here is the call graph for this function:
+ Here is the caller 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 2572 of file class.ilObjUser.php.

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

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

2572  {
2573  global $ilAuth;
2574 
2575  // BEGIN WebDAV: Strip Microsoft Domain Names from logins
2576  require_once ('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
2578  {
2579  require_once ('Services/WebDAV/classes/class.ilDAVServer.php');
2580  require_once ('Services/Database/classes/class.ilAuthContainerMDB2.php');
2581  $login = ilAuthContainerMDB2::toUsernameWithoutDomain($ilAuth->getUsername());
2582  }
2583  else
2584  {
2585  $login =$ilAuth->getUsername();
2586  }
2587 
2588  return $login;
2589  }
$login
all user related data in single vars public
static _isActive()
Static getter.
static toUsernameWithoutDomain($username)
Static function removes Microsoft domain name from username.
+ 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 2470 of file class.ilObjUser.php.

References $longitude.

Referenced by ilPersonalProfileGUI\addLocationToForm().

2471  {
2472  return $this->longitude;
2473  }
+ Here is the caller graph for this function:

◆ getLookingForHelp()

ilObjUser::getLookingForHelp ( )

Get help looking for.

Returns
array $value

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

References $interests_help_looking.

Referenced by updateMultiTextFields().

5668  {
5670  }
+ Here is the caller graph for this function:

◆ getLookingForHelpAsText()

ilObjUser::getLookingForHelpAsText ( )

Get help looking for as plain text.

Returns
string

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

References buildTextFromArray().

5678  {
5679  return $this->buildTextFromArray("interests_help_looking");
5680  }
buildTextFromArray($a_attr)
Convert multi-text values to plain text.
+ Here is the call graph for this function:

◆ getMatriculation()

ilObjUser::getMatriculation ( )

get matriculation number public

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

References $matriculation.

Referenced by deleteUserDefinedFieldEntries().

1894  {
1895  return $this->matriculation;
1896  }
+ Here is the caller graph for this function:

◆ getOfferingHelp()

ilObjUser::getOfferingHelp ( )

Get help offering.

Returns
array $value

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

References $interests_help_offered.

Referenced by updateMultiTextFields().

5638  {
5640  }
+ Here is the caller graph for this function:

◆ getOfferingHelpAsText()

ilObjUser::getOfferingHelpAsText ( )

Get help offering as plain text.

Returns
string

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

References buildTextFromArray().

5648  {
5649  return $this->buildTextFromArray("interests_help_offered");
5650  }
buildTextFromArray($a_attr)
Convert multi-text values to plain text.
+ 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. public
See also
getPasswdType

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

References $passwd.

Referenced by assignData(), refreshLogin(), and ilUserPasswordManager\verifyPassword().

1554  {
1555  return $this->passwd;
1556  }
+ Here is the caller graph for this function:

◆ getPasswdType()

ilObjUser::getPasswdType ( )

get password type

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

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

References $passwd_type.

1564  {
1565  return $this->passwd_type;
1566  }

◆ getPasswordAge()

ilObjUser::getPasswordAge ( )

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

References getLastPasswordChangeTS().

2401  {
2402  $current_ts = time();
2403  $pass_change_ts = $this->getLastPasswordChangeTS();
2404  $password_age = (int) ( ($current_ts - $pass_change_ts) / 86400 );
2405  return $password_age;
2406  }
+ Here is the call graph for this function:

◆ getPasswordEncodingType()

ilObjUser::getPasswordEncodingType ( )
Returns
string

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

References $password_encoding_type.

Referenced by assignData(), refreshLogin(), and ilUserPasswordManager\verifyPassword().

299  {
301  }
+ Here is the caller graph for this function:

◆ getPasswordSalt()

ilObjUser::getPasswordSalt ( )
Returns
string|null

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

References $password_salt.

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

315  {
316  return $this->password_salt;
317  }
+ Here is the caller graph for this function:

◆ getPCClipboardContent()

ilObjUser::getPCClipboardContent ( )

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

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

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

3428  {
3429  global $ilDB;
3430 
3431  $set = $ilDB->queryF("SELECT MAX(insert_time) mtime FROM personal_pc_clipboard ".
3432  " WHERE user_id = %s", array("integer"), array($this->getId()));
3433  $row = $ilDB->fetchAssoc($set);
3434 
3435  $set = $ilDB->queryF("SELECT * FROM personal_pc_clipboard ".
3436  " WHERE user_id = %s AND insert_time = %s ORDER BY order_nr ASC",
3437  array("integer", "timestamp"),
3438  array($this->getId(), $row["mtime"]));
3439  $content = array();
3440  while ($row = $ilDB->fetchAssoc($set))
3441  {
3442  $content[] = $row["content"];
3443  }
3444 
3445  return $content;
3446  }
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:

◆ getPersonalDataExportFile()

ilObjUser::getPersonalDataExportFile ( )

Get personal data export file.

Parameters

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

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

Referenced by sendPersonalDataFile().

5313  {
5314  include_once("./Services/Export/classes/class.ilExport.php");
5315  $dir = ilExport::_getExportDirectory($this->getId(), "xml", "usr", "personal_data");
5316  if (!is_dir($dir))
5317  {
5318  return "";
5319  }
5320  foreach(ilUtil::getDir($dir) as $entry)
5321  {
5322  if (is_int(strpos($entry["entry"], ".zip")))
5323  {
5324  return $entry["entry"];
5325  }
5326  }
5327 
5328  return "";
5329  }
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
getId()
get object id public
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
+ 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 3911 of file class.ilObjUser.php.

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

3912  {
3913  if(isset(self::$personal_image_cache[$this->getId()][$a_size][(int)$a_force_pic]))
3914  {
3915  return self::$personal_image_cache[$this->getId()][$a_size][(int)$a_force_pic];
3916  }
3917 
3918  self::$personal_image_cache[$this->getId()][$a_size][(int)$a_force_pic] = ilObjUser::_getPersonalPicturePath($this->getId(), $a_size, $a_force_pic);
3919 
3920  return self::$personal_image_cache[$this->getId()][$a_size][(int)$a_force_pic];
3921  }
getId()
get object id public
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
+ Here is the call graph for this function:

◆ getPersonalWorkspaceDiskQuota()

ilObjUser::getPersonalWorkspaceDiskQuota ( )

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

2002  {
2003  return $this->prefs["wsp_disk_quota"] ? $this->prefs["wsp_disk_quota"] : 0;
2004  }

◆ getPhoneHome()

ilObjUser::getPhoneHome ( )

get home phone public

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

References $phone_home.

Referenced by deleteUserDefinedFieldEntries().

1818  {
1819  return $this->phone_home;
1820  }
+ Here is the caller graph for this function:

◆ getPhoneMobile()

ilObjUser::getPhoneMobile ( )

get mobile phone public

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

References $phone_mobile.

Referenced by deleteUserDefinedFieldEntries().

1837  {
1838  return $this->phone_mobile;
1839  }
+ Here is the caller graph for this function:

◆ getPhoneOffice()

ilObjUser::getPhoneOffice ( )

get office phone public

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

References $phone_office.

Referenced by deleteUserDefinedFieldEntries().

1799  {
1800  return $this->phone_office;
1801  }
+ Here is the caller graph for this function:

◆ getPref()

ilObjUser::getPref (   $a_keyword)

get a user preference

Parameters
stringname of parameter public

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

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

1254  {
1255  if (array_key_exists($a_keyword, $this->prefs))
1256  {
1257  return $this->prefs[$a_keyword];
1258  }
1259  else
1260  {
1261  return FALSE;
1262  }
1263  }
+ Here is the caller graph for this function:

◆ getProfileIncomplete()

ilObjUser::getProfileIncomplete ( )

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

Referenced by assignData().

2338  {
2339  if($this->id == ANONYMOUS_USER_ID)
2340  {
2341  return false;
2342  }
2343  return $this->profile_incomplete;
2344  }
+ 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 4812 of file class.ilObjUser.php.

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

4813  {
4814  if ($this->hasPublicProfile())
4815  return $this->getFirstname()." ".$this->getLastname()." (".$this->getLogin().")";
4816  else
4817  return $this->getLogin();
4818 
4819  }
getLogin()
get login / username public
getFirstname()
get firstname public
getLastname()
get lastname public
hasPublicProfile()
returns true if public is profile, false otherwise
+ Here is the call graph for this function:

◆ getSelectedCountry()

ilObjUser::getSelectedCountry ( )

Get selected country (selection drop down)

Returns
string selected country

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

References $sel_country.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getStoredActive()

ilObjUser::getStoredActive (   $a_id)

get user active state

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

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

References _lookup().

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

2253  {
2254  $active = ilObjUser::_lookup($a_id, "active");
2255  return $active ? true : false;
2256  }
static _lookup($a_user_id, $a_field)
Private function for lookup methods.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStreet()

ilObjUser::getStreet ( )

get street public

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

References $street.

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

1701  {
1702  return $this->street;
1703  }
+ Here is the caller graph for this function:

◆ getTimeFormat()

ilObjUser::getTimeFormat ( )

get time format

public

Returns

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

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

1201  {
1202  if($format = $this->getPref('time_format'))
1203  {
1204  return $format;
1205  }
1206  else
1207  {
1208  include_once('Services/Calendar/classes/class.ilCalendarSettings.php');
1209  $settings = ilCalendarSettings::_getInstance();
1210  return $settings->getDefaultTimeFormat();
1211  }
1212  }
static _getInstance()
get singleton instance
getPref($a_keyword)
get a user preference
+ Here is the call graph for this function:

◆ getTimeLimitFrom()

ilObjUser::getTimeLimitFrom ( )

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

Referenced by assignData(), checkTimeLimit(), and deleteUserDefinedFieldEntries().

2282  {
2283  return $this->time_limit_from ? $this->time_limit_from : time();
2284  }
+ Here is the caller graph for this function:

◆ getTimeLimitMessage()

ilObjUser::getTimeLimitMessage ( )

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

Referenced by assignData().

2306  {
2307  return $this->time_limit_message;
2308  }
+ Here is the caller graph for this function:

◆ getTimeLimitOwner()

ilObjUser::getTimeLimitOwner ( )

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

Referenced by assignData().

2274  {
2275  return $this->time_limit_owner ? $this->time_limit_owner : 7;
2276  }
+ Here is the caller graph for this function:

◆ getTimeLimitUnlimited()

ilObjUser::getTimeLimitUnlimited ( )

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

Referenced by assignData(), checkTimeLimit(), and deleteUserDefinedFieldEntries().

2298  {
2299  return $this->time_limit_unlimited;
2300  }
+ Here is the caller graph for this function:

◆ getTimeLimitUntil()

ilObjUser::getTimeLimitUntil ( )

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

Referenced by assignData(), checkTimeLimit(), deleteUserDefinedFieldEntries(), and ilECSAppEventListener\extendAccount().

2290  {
2291  return $this->time_limit_until ? $this->time_limit_until : time();
2292  }
+ Here is the caller graph for this function:

◆ getTimeZone()

ilObjUser::getTimeZone ( )

get timezone of user

public

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

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

1181  {
1182  if($tz = $this->getPref('user_tz'))
1183  {
1184  return $tz;
1185  }
1186  else
1187  {
1188  include_once('Services/Calendar/classes/class.ilCalendarSettings.php');
1189  $settings = ilCalendarSettings::_getInstance();
1190  return $settings->getDefaultTimeZone();
1191  }
1192  }
static _getInstance()
get singleton instance
getPref($a_keyword)
get a user preference
+ Here is the call graph for this function:

◆ getUserDefinedData()

ilObjUser::getUserDefinedData ( )

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

Referenced by deleteUserDefinedFieldEntries().

4093  {
4094  return $this->user_defined_data ? $this->user_defined_data : array();
4095  }
+ Here is the caller graph for this function:

◆ getUserIdByEmail()

ilObjUser::getUserIdByEmail (   $a_email)
static

STATIC METHOD get the user_id of an email address.

Parameters
stringemail of user
Returns
integer id of user public

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

References $ilDB, $res, and $row.

Referenced by ilObjUserTest\testAuthAndEmailMethods().

2665  {
2666  global $ilDB;
2667 
2668  $res = $ilDB->queryF("SELECT usr_id FROM usr_data ".
2669  "WHERE email = %s", array("text"), array($a_email));
2670 
2671  $row = $ilDB->fetchObject($res);
2672  return $row->usr_id ? $row->usr_id : 0;
2673  }
global $ilDB
+ Here is the caller graph for this function:

◆ getUserIdByLogin()

ilObjUser::getUserIdByLogin (   $a_login)

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

References $ilDB, and $ret.

Referenced by ilAwarenessUserCollector\collectUsers().

5501  {
5502  global $ilDB;
5503 
5504  $date_is = ($a_agreed)
5505  ? "IS NOT NULL"
5506  : "IS NULL";
5507 
5508  $users = (is_array($a_users))
5509  ? " AND ".$ilDB->in("usr_id", $a_users, false, "integer")
5510  : "";
5511 
5512  $set = $ilDB->query("SELECT usr_id FROM usr_data ".
5513  " WHERE agree_date ".$date_is.
5514  $users);
5515  $ret = array();
5516  while ($rec = $ilDB->fetchAssoc($set))
5517  {
5518  $ret[] = $rec["usr_id"];
5519  }
5520  return $ret;
5521  }
global $ilDB
+ 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 4735 of file class.ilObjUser.php.

References $ilDB.

Referenced by ilAwarenessUserCollector\collectUsers().

4736  {
4737  global $ilDB;
4738 
4739  $users = array();
4740  $set = $ilDB->query("SELECT usr_id FROM usr_pref ".
4741  " WHERE keyword = ".$ilDB->quote($a_keyword, "text").
4742  " AND ".$ilDB->in("usr_id", $a_user_ids, false, "integer").
4743  " AND value = ".$ilDB->quote($a_val, "text")
4744  );
4745  while ($rec = $ilDB->fetchAssoc($set))
4746  {
4747  $users[] = $rec["usr_id"];
4748  }
4749  return $users;
4750  }
global $ilDB
+ 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) public

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

References $utitle.

Referenced by deleteUserDefinedFieldEntries().

1606  {
1607  return $this->utitle;
1608  }
+ Here is the caller graph for this function:

◆ getZipcode()

ilObjUser::getZipcode ( )

get zipcode public

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

References $zipcode.

Referenced by deleteUserDefinedFieldEntries().

1739  {
1740  return $this->zipcode;
1741  }
+ Here is the caller graph for this function:

◆ hasActiveSession()

static ilObjUser::hasActiveSession (   $a_user_id)
static

Check for simultaneous login.

Returns
bool

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

References $ilDB, and $row.

Referenced by ilAuthBase\loginObserver().

2540  {
2541  global $ilDB;
2542 
2543  $set = $ilDB->queryf('
2544  SELECT COUNT(*) session_count
2545  FROM usr_session WHERE user_id = %s AND expires > %s',
2546  array('integer', 'integer'),
2547  array($a_user_id, time()));
2548  $row = $ilDB->fetchAssoc($set);
2549  return (bool)$row['session_count'];
2550  }
global $ilDB
+ Here is the caller graph for this function:

◆ hasDeletionFlag()

ilObjUser::hasDeletionFlag ( )

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

References getPref().

5570  {
5571  return (bool)$this->getPref("delete_flag");
5572  }
getPref($a_keyword)
get a user preference
+ Here is the call graph for this function:

◆ hasPublicProfile()

ilObjUser::hasPublicProfile ( )

returns true if public is profile, false otherwise

Returns
boolean

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

References getPref().

Referenced by getPublicName().

4803  {
4804  return in_array($this->getPref("public_profile"), array("y", "g"));
4805  }
getPref($a_keyword)
get a user preference
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasToAcceptTermsOfService()

ilObjUser::hasToAcceptTermsOfService ( )
Returns
bool

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

References $ilDB, $in, $res, and ilObject\getId().

5450  {
5451  require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
5452 
5453  if(
5454  ilTermsOfServiceHelper::isEnabled() &&
5455  null == $this->agree_date &&
5456  'root' != $this->login &&
5457  !in_array($this->getId(), array(ANONYMOUS_USER_ID, SYSTEM_USER_ID))
5458  )
5459  {
5460  return true;
5461  }
5462 
5463  return false;
5464  }
getId()
get object id public
+ Here is the call graph for this function:

◆ hasToAcceptTermsOfServiceInSession()

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

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

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

Referenced by ilTermsOfServiceHelper\trackAcceptance().

5529  {
5530  if(null === $status)
5531  {
5532  return ilSession::get('has_to_accept_agr_in_session');
5533  }
5534 
5535  require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
5536  if(ilTermsOfServiceHelper::isEnabled())
5537  {
5538  ilSession::set('has_to_accept_agr_in_session', (int)$status);
5539  }
5540  }
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importPersonalData()

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

Import personal data.

Parameters

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

5356  {
5357  include_once("./Services/Export/classes/class.ilImport.php");
5358  $imp = new ilImport();
5359  if (!$a_profile_data)
5360  {
5361  $imp->addSkipEntity("Services/User", "usr_profile");
5362  }
5363  if (!$a_settings)
5364  {
5365  $imp->addSkipEntity("Services/User", "usr_setting");
5366  }
5367  if (!$a_bookmarks)
5368  {
5369  $imp->addSkipEntity("Services/Bookmarks", "bookmarks");
5370  }
5371  if (!$a_notes)
5372  {
5373  $imp->addSkipEntity("Services/Notes", "user_notes");
5374  }
5375  if (!$a_calendar)
5376  {
5377  $imp->addSkipEntity("Services/Calendar", "calendar");
5378  }
5379  $imp->importEntity($a_file["tmp_name"], $a_file["name"], "personal_data",
5380  "Services/User");
5381  }
Import class.

◆ initInactivationDate()

static ilObjUser::initInactivationDate (   $usrIds)
staticprivate

type $ilDB

Parameters
type$usrIds

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

References $ilDB.

5389  {
5390  global $ilDB;
5391 
5392  $NOW = $ilDB->now();
5393 
5394  $usrId_IN_usrIds = $ilDB->in('usr_id', $usrIds, false, 'integer');
5395 
5396  $queryString = "
5397  UPDATE usr_data
5398  SET inactivation_date = $NOW
5399  WHERE inactivation_date IS NULL
5400  AND $usrId_IN_usrIds
5401  ";
5402 
5403  $ilDB->manipulate($queryString);
5404  }
global $ilDB

◆ isAnonymous()

ilObjUser::isAnonymous ( )
Returns
bool

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

References ilObject\getId().

Referenced by ilUsersGalleryGUI\renderLinkButton().

5546  {
5547  return self::_isAnonymous($this->getId());
5548  }
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCaptchaVerified()

ilObjUser::isCaptchaVerified ( )

Is user captcha verified?

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

References $_SESSION.

5275  {
5276  return (boolean) $_SESSION["user_captcha_verified"];
5277  }
$_SESSION["AccountId"]

◆ isChild()

ilObjUser::isChild (   $a_usr_id)

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

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

2504  {
2505  if($a_usr_id == $this->getId())
2506  {
2507  return true;
2508  }
2509 
2510  $this->applied_users = array();
2511  $this->__readAppliedUsers($this->getId());
2512 
2513  return in_array($a_usr_id,$this->applied_users);
2514  }
getId()
get object id public
__readAppliedUsers($a_parent_id)
+ Here is the call graph for this function:

◆ isCurrentUserActive()

ilObjUser::isCurrentUserActive ( )

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

References $ilDB, and getLoginFromAuth().

2597  {
2598  global $ilDB,$ilAuth;
2599 
2601  $set = $ilDB->queryF("SELECT active FROM usr_data WHERE login= %s",
2602  array("text"),
2603  array($login));
2604  //query has got a result
2605  if ($rec = $ilDB->fetchAssoc($set))
2606  {
2607  if ($rec["active"])
2608  {
2609  return true;
2610  }
2611  }
2612 
2613  return false;
2614  }
$login
all user related data in single vars public
static getLoginFromAuth()
Gets the username from $ilAuth, and converts it into an ILIAS login name.
global $ilDB
+ 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 3248 of file class.ilObjUser.php.

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

3249  {
3250  return ilObjUser::_isDesktopItem($this->getId(), $a_item_id, $a_type);
3251  }
getId()
get object id public
static _isDesktopItem($a_usr_id, $a_item_id, $a_type)
check wether an item is on the users desktop or not
+ Here is the call graph for this function:

◆ isPasswordChangeDemanded()

ilObjUser::isPasswordChangeDemanded ( )

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

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

2347  {
2348  //error_reporting(E_ALL);
2349  if( $this->id == ANONYMOUS_USER_ID )
2350  return false;
2351 
2352  if ($this->id == SYSTEM_USER_ID) {
2353  require_once './Services/User/classes/class.ilUserPasswordManager.php';
2354  if (
2355  \ilUserPasswordManager::getInstance()->verifyPassword($this, base64_decode('aG9tZXI=')) &&
2357  ) {
2358  return true;
2359  } else {
2360  return false;
2361  }
2362  }
2363 
2364  require_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
2365  $security = ilSecuritySettings::_getInstance();
2366 
2368  && $security->isPasswordChangeOnFirstLoginEnabled()
2369  && $this->getLastPasswordChangeTS() == 0
2370  && $this->is_self_registered == false
2371  ){
2372  return true;
2373  }
2374  else return false;
2375  }
getAuthMode($a_auth_key=false)
get auth mode public
static _needsExternalAccountByAuthMode($a_auth_mode)
Check if chosen auth mode needs an external account entry.
static _getInstance()
Get instance of ilSecuritySettings.
static getInstance()
Single method to reduce footprint (included files, created instances)
+ Here is the call graph for this function:

◆ isPasswordExpired()

ilObjUser::isPasswordExpired ( )

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

References ilSecuritySettings\_getInstance(), and getLastPasswordChangeTS().

2378  {
2379  //error_reporting(E_ALL);
2380  if($this->id == ANONYMOUS_USER_ID) return false;
2381 
2382  require_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
2383  $security = ilSecuritySettings::_getInstance();
2384  if( $this->getLastPasswordChangeTS() > 0 )
2385  {
2386  $max_pass_age = $security->getPasswordMaxAge();
2387  if( $max_pass_age > 0 )
2388  {
2389  $max_pass_age_ts = ( $max_pass_age * 86400 );
2390  $pass_change_ts = $this->getLastPasswordChangeTS();
2391  $current_ts = time();
2392 
2393  if( ($current_ts - $pass_change_ts) > $max_pass_age_ts )
2394  return true;
2395  }
2396  }
2397  return false;
2398  }
static _getInstance()
Get instance of ilSecuritySettings.
+ Here is the call graph for this function:

◆ isSelfRegistered()

ilObjUser::isSelfRegistered ( )

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

References $is_self_registered.

5583  {
5584  return (bool) $this->is_self_registered;
5585  }

◆ lookupMatriculation()

static ilObjUser::lookupMatriculation (   $a_usr_id)
static

Lookup matriculation.

Returns
string matricualtion
Parameters
int$a_usr_idpublic

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

1905  {
1906  global $ilDB;
1907 
1908  $query = "SELECT matriculation FROM usr_data ".
1909  "WHERE usr_id = ".$ilDB->quote($a_usr_id);
1910  $res = $ilDB->query($query);
1911  $row = $res->fetchRow(DB_FETCHMODE_OBJECT);
1912  return $row->matriculation ? $row->matriculation : '';
1913  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the caller graph for this function:

◆ preloadIsDesktopItem()

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

Preload desktop item information.

Parameters

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

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

Referenced by ilObjectListGUIPreloader\preload().

3210  {
3211  global $ilDB;
3212 
3213  if (!is_array($a_item_ids))
3214  {
3215  return;
3216  }
3217 
3218  $item_ids = array();
3219  foreach ($a_item_ids as $id)
3220  {
3221  if (!self::$is_desktop_item_loaded[$a_usr_id.":".$id])
3222  {
3223  $item_ids[] = $id;
3224  }
3225  self::$is_desktop_item_loaded[$a_usr_id.":".$id] = true;
3226  }
3227 
3228  if (count($item_ids) > 0)
3229  {
3230  $item_set = $ilDB->query("SELECT item_id, type FROM desktop_item WHERE ".
3231  $ilDB->in("item_id", $item_ids, false, "integer").
3232  " AND user_id = ".$ilDB->quote($a_usr_id, "integer"));
3233  while ($r = $ilDB->fetchAssoc($item_set))
3234  {
3235  self::$is_desktop_item_cache[$a_usr_id.":".$r["item_id"].":".$r["type"]]
3236  = true;
3237  }
3238  }
3239  }
$r
Definition: example_031.php:79
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilObjUser::read ( )

loads a record "user" from database private

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

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

Referenced by __construct(), and assignData().

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

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

Referenced by read().

5701  {
5702  global $ilDB;
5703 
5704  if(!$this->getId())
5705  {
5706  return;
5707  }
5708 
5709  $set = $ilDB->query("SELECT field_id,value".
5710  " FROM usr_data_multi".
5711  " WHERE usr_id = ".$ilDB->quote($this->getId(), "integer").
5712  " ORDER BY value");
5713  while($row = $ilDB->fetchAssoc($set))
5714  {
5715  $values[$row["field_id"]][] = $row["value"];
5716  }
5717 
5718  if(isset($values["interests_general"]))
5719  {
5720  $this->setGeneralInterests($values["interests_general"]);
5721  }
5722  else
5723  {
5724  $this->setGeneralInterests();
5725  }
5726  if(isset($values["interests_help_offered"]))
5727  {
5728  $this->setOfferingHelp($values["interests_help_offered"]);
5729  }
5730  else
5731  {
5732  $this->setOfferingHelp();
5733  }
5734  if(isset($values["interests_help_looking"]))
5735  {
5736  $this->setLookingForHelp($values["interests_help_looking"]);
5737  }
5738  else
5739  {
5740  $this->setLookingForHelp();
5741  }
5742  }
setOfferingHelp(array $value=null)
Set help offering.
getId()
get object id public
setGeneralInterests(array $value=null)
Set general interests.
setLookingForHelp(array $value=null)
Set help looking for.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readPrefs()

ilObjUser::readPrefs ( )

get all user preferences private

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

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

Referenced by read().

1285  {
1286  global $ilDB;
1287 
1288  if (is_array($this->prefs))
1289  {
1290  $this->oldPrefs = $this->prefs;
1291  }
1292 
1293  $this->prefs = ilObjUser::_getPreferences($this->id);
1294  }
global $ilDB
static _getPreferences($user_id)
get preferences for user
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readUserDefinedFields()

ilObjUser::readUserDefinedFields ( )

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

References $ilDB, and ilObject\getId().

Referenced by read().

4142  {
4143  global $ilDB;
4144 
4145  include_once("./Services/User/classes/class.ilUserDefinedData.php");
4146  $udata = new ilUserDefinedData($this->getId());
4147 
4148 /* $query = "SELECT * FROM udf_data ".
4149  "WHERE usr_id = ".$ilDB->quote($this->getId(),'integer');
4150 
4151  $res = $this->db->query($query);
4152  while($row = $res->fetchRow(DB_FETCHMODE_ASSOC))
4153  {
4154  $this->user_defined_data = $row;
4155  }*/
4156 
4157  $this->user_defined_data = $udata->getAll();
4158 
4159  return true;
4160  }
Class ilUserDefinedData.
getId()
get object id public
global $ilDB
+ 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 public

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

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

864  {
865  global $ilDB;
866 
867  $ilDB->manipulateF("UPDATE usr_data SET ".
868  "last_login = ".$ilDB->now().
869  " WHERE usr_id = %s",
870  array("integer"), array($this->id));
871  }
global $ilDB
+ Here is the call graph for this function:

◆ removeDeletionFlag()

ilObjUser::removeDeletionFlag ( )

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

References writePref().

5565  {
5566  $this->writePref("delete_flag", false);
5567  }
writePref($a_keyword, $a_value)
write userpref to user table private
+ 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 3588 of file class.ilObjUser.php.

References $ilDB, and ilObject\getId().

3589  {
3590  global $ilDB;
3591 
3592  $q = "DELETE FROM personal_clipboard WHERE ".
3593  "item_id = ".$ilDB->quote($a_item_id, "integer").
3594  " AND type = ".$ilDB->quote($a_type, "text")." ".
3595  " AND user_id = ".$ilDB->quote($this->getId(), "integer");
3596  $ilDB->manipulate($q);
3597  }
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:

◆ removeUserPicture()

ilObjUser::removeUserPicture (   $a_do_update = true)

Remove user picture.

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

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

Referenced by delete().

4036  {
4037  $webspace_dir = ilUtil::getWebspaceDir();
4038  $image_dir = $webspace_dir."/usr_images";
4039  $file = $image_dir."/usr_".$this->getID()."."."jpg";
4040  $thumb_file = $image_dir."/usr_".$this->getID()."_small.jpg";
4041  $xthumb_file = $image_dir."/usr_".$this->getID()."_xsmall.jpg";
4042  $xxthumb_file = $image_dir."/usr_".$this->getID()."_xxsmall.jpg";
4043  $upload_file = $image_dir."/upload_".$this->getID();
4044 
4045  if($a_do_update)
4046  {
4047  // remove user pref file name
4048  $this->setPref("profile_image", "");
4049  $this->update();
4050  }
4051 
4052  if (@is_file($file))
4053  {
4054  unlink($file);
4055  }
4056  if (@is_file($thumb_file))
4057  {
4058  unlink($thumb_file);
4059  }
4060  if (@is_file($xthumb_file))
4061  {
4062  unlink($xthumb_file);
4063  }
4064  if (@is_file($xxthumb_file))
4065  {
4066  unlink($xxthumb_file);
4067  }
4068  if (@is_file($upload_file))
4069  {
4070  unlink($upload_file);
4071  }
4072  }
print $file
setPref($a_keyword, $a_value)
set a user preference
update()
update object in db
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetInactivationDate()

static ilObjUser::resetInactivationDate (   $usrIds)
staticprivate

type $ilDB

Parameters
type$usrIds

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

References $ilDB.

5412  {
5413  global $ilDB;
5414 
5415  $usrId_IN_usrIds = $ilDB->in('usr_id', $usrIds, false, 'integer');
5416 
5417  $queryString = "
5418  UPDATE usr_data
5419  SET inactivation_date = NULL
5420  WHERE $usrId_IN_usrIds
5421  ";
5422 
5423  $ilDB->manipulate($queryString);
5424  }
global $ilDB

◆ resetLastPasswordChange()

ilObjUser::resetLastPasswordChange ( )

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

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

2424  {
2425  global $ilDB;
2426 
2427  $query = "UPDATE usr_data SET last_password_change = 0 " .
2428  "WHERE usr_id = %s";
2429  $affected = $ilDB->manipulateF( $query, array('integer'),
2430  array($this->getId()) );
2431  if($affected) return true;
2432  else return false;
2433  }
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:

◆ resetOwner()

ilObjUser::resetOwner ( )

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

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

Referenced by delete().

5222  {
5223  global $ilDB;
5224 
5225  $query = "UPDATE object_data SET owner = 0 ".
5226  "WHERE owner = ".$ilDB->quote($this->getId(),'integer');
5227  $ilDB->query($query);
5228 
5229  return true;
5230  }
getId()
get object id public
global $ilDB
+ 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 public

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

References $_SESSION, $ilDB, $ilias, $ilLog, $query, ilObject\$ref_id, $res, and $row.

Referenced by ilObjSurveyAdministrationGUI\searchObject(), and ilObjUserTest\testSearch().

2700  {
2701  global $ilias, $ilDB, $ilLog;
2702 
2703 
2704  $query = "SELECT usr_data.usr_id, usr_data.login, usr_data.firstname, usr_data.lastname, usr_data.email, usr_data.active FROM usr_data ";
2705 
2706  $without_anonymous_users = true;
2707 
2708  // determine join filter
2709  $join_filter = " WHERE ";
2710  if ($filter_settings !== FALSE && strlen($filter_settings))
2711  {
2712  switch ($filter_settings)
2713  {
2714  case 3:
2715  // show only users without courses
2716  $join_filter = " LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id WHERE obj_members.usr_id IS NULL AND ";
2717  break;
2718  case 5:
2719  // show only users with a certain course membership
2720  $ref_id = $_SESSION["user_filter_data"];
2721  if ($ref_id)
2722  {
2723  $join_filter = " LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id WHERE obj_members.obj_id = ".
2724  "(SELECT obj_id FROM object_reference WHERE ref_id = ".$ilDB->quote($ref_id, "integer").") AND ";
2725  }
2726  break;
2727  case 6:
2728  global $rbacreview;
2729  $ref_id = $_SESSION["user_filter_data"];
2730  if ($ref_id)
2731  {
2732  $local_roles = $rbacreview->getRolesOfRoleFolder($ref_id,false);
2733  if (is_array($local_roles) && count($local_roles))
2734  {
2735  $join_filter = " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE ".
2736  $ilDB->in("rbac_ua.rol_id", $local_roles, false, $local_roles)." AND ";
2737  }
2738  }
2739  break;
2740  case 7:
2741  global $rbacreview;
2742  $rol_id = $_SESSION["user_filter_data"];
2743  if ($rol_id)
2744  {
2745  $join_filter = " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id = ".
2746  $ilDB->quote($rol_id, "integer")." AND ";
2747  $without_anonymous_users = false;
2748  }
2749  break;
2750  }
2751  }
2752  // This is a temporary hack to search users by their role
2753  // See Mantis #338. This is a hack due to Mantis #337.
2754  if (strtolower(substr($a_search_str, 0, 5)) == "role:")
2755  {
2756  $query = "SELECT DISTINCT usr_data.usr_id,usr_data.login,usr_data.firstname,usr_data.lastname,usr_data.email ".
2757  "FROM object_data,rbac_ua,usr_data ".
2758  "WHERE ".$ilDB->like("object_data.title", "text", "%".substr($a_search_str,5)."%").
2759  " AND object_data.type = 'role' ".
2760  "AND rbac_ua.rol_id = object_data.obj_id ".
2761  "AND usr_data.usr_id = rbac_ua.usr_id ".
2762  "AND rbac_ua.usr_id != ".$ilDB->quote(ANONYMOUS_USER_ID, "integer");
2763  }
2764  else
2765  {
2766  $query.= $join_filter.
2767  "(".$ilDB->like("usr_data.login", "text", "%".$a_search_str."%")." ".
2768  "OR ".$ilDB->like("usr_data.firstname", "text", "%".$a_search_str."%")." ".
2769  "OR ".$ilDB->like("usr_data.lastname", "text", "%".$a_search_str."%")." ".
2770  "OR ".$ilDB->like("usr_data.email", "text", "%".$a_search_str."%").") ";
2771 
2772  if ($filter_settings !== FALSE && strlen($filter_settings))
2773  {
2774  switch ($filter_settings)
2775  {
2776  case 0:
2777  $query.= " AND usr_data.active = ".$ilDB->quote(0, "integer")." ";
2778  break;
2779  case 1:
2780  $query.= " AND usr_data.active = ".$ilDB->quote(1, "integer")." ";
2781  break;
2782  case 2:
2783  $query.= " AND usr_data.time_limit_unlimited = ".$ilDB->quote(0, "integer")." ";
2784  break;
2785  case 4:
2786  $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"]));
2787  $query.= " AND last_login < ".$ilDB->quote($date, "timestamp")." ";
2788  break;
2789  }
2790  }
2791 
2792  if ($without_anonymous_users)
2793  {
2794  $query.= "AND usr_data.usr_id != ".$ilDB->quote(ANONYMOUS_USER_ID, "integer");
2795  }
2796 
2797  if (is_numeric($active) && $active > -1 && $filter_settings === FALSE)
2798  {
2799  $query.= " AND active = ".$ilDB->quote($active, "integer")." ";
2800  }
2801 
2802  }
2803  $ilLog->write($query);
2804  $res = $ilDB->query($query);
2805  while ($row = $ilDB->fetchObject($res))
2806  {
2807  $users[] = array(
2808  "usr_id" => $row->usr_id,
2809  "login" => $row->login,
2810  "firstname" => $row->firstname,
2811  "lastname" => $row->lastname,
2812  "email" => $row->email,
2813  "active" => $row->active);
2814  $ids[] = $row->usr_id;
2815  }
2816  if ($a_return_ids_only)
2817  return $ids ? $ids : array();
2818  else
2819  return $users ? $users : array();
2820  }
$_SESSION["AccountId"]
global $ilDB
+ Here is the caller graph for this function:

◆ sendPersonalDataFile()

ilObjUser::sendPersonalDataFile ( )

Send personal data file.

Parameters

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

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

5338  {
5339  include_once("./Services/Export/classes/class.ilExport.php");
5340  $file = ilExport::_getExportDirectory($this->getId(), "xml", "usr", "personal_data").
5341  "/".$this->getPersonalDataExportFile();
5342  if (is_file($file))
5343  {
5345  }
5346  }
print $file
getId()
get object id public
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
getPersonalDataExportFile()
Get personal data export file.
static _getExportDirectory($a_obj_id, $a_type="xml", $a_obj_type="", $a_entity="")
Get export directory for an repository object.
+ 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 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 2174 of file class.ilObjUser.php.

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

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

2175  {
2176  $this->setOwner($a_owner);
2177 
2178  if ($a_active)
2179  {
2180  $this->active = 1;
2181  $this->setApproveDate(date('Y-m-d H:i:s'));
2182  $this->setOwner($a_owner);
2183  }
2184  else
2185  {
2186  $this->active = 0;
2187  $this->setApproveDate(null);
2188  }
2189  }
setOwner($a_owner)
set object owner
setApproveDate($a_str)
set date the user account was activated null indicates that the user has not yet been activated publ...
+ 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 public

Returns
void

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

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

◆ setApproveDate()

ilObjUser::setApproveDate (   $a_str)

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

Returns
void

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

Referenced by setActive().

2132  {
2133  $this->approve_date = $a_str;
2134  }
+ Here is the caller graph for this function:

◆ setAuthMode()

ilObjUser::setAuthMode (   $a_str)

set auth mode public

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

Referenced by assignData().

3619  {
3620  $this->auth_mode = $a_str;
3621  }
+ Here is the caller graph for this function:

◆ setBirthday()

ilObjUser::setBirthday (   $a_birthday)

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

References IL_CAL_DATE.

Referenced by assignData().

5119  {
5120  if (strlen($a_birthday))
5121  {
5122  $date = new ilDate($a_birthday, IL_CAL_DATE);
5123  $this->birthday = $date->get(IL_CAL_DATE);
5124  }
5125  else
5126  {
5127  $this->birthday = null;
5128  }
5129  }
Class for single dates.
const IL_CAL_DATE
+ Here is the caller graph for this function:

◆ setCaptchaVerified()

ilObjUser::setCaptchaVerified (   $a_val)

Set captcha verified.

Parameters

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

References $_SESSION.

5285  {
5286  $_SESSION["user_captcha_verified"] = $a_val;
5287  }
$_SESSION["AccountId"]

◆ setCity()

ilObjUser::setCity (   $a_str)

set city public

Parameters
stringcity

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

Referenced by assignData().

1711  {
1712  $this->city = $a_str;
1713  }
+ Here is the caller graph for this function:

◆ setClientIP()

ilObjUser::setClientIP (   $a_str)

set client ip number public

Parameters
stringclient ip

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

Referenced by assignData().

1866  {
1867  $this->client_ip = $a_str;
1868  }
+ Here is the caller graph for this function:

◆ setComment()

ilObjUser::setComment (   $a_str)

set referral comment public

Parameters
stringhobby

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

Referenced by assignData().

2112  {
2113  $this->referral_comment = $a_str;
2114  }
+ Here is the caller graph for this function:

◆ setCountry()

ilObjUser::setCountry (   $a_str)

Set country (free text)

public

Parameters
stringcountry

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

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

1750  {
1751  $this->country = $a_str;
1752  }
+ Here is the caller graph for this function:

◆ setCurrentLanguage()

ilObjUser::setCurrentLanguage (   $a_val)

Set current language.

Parameters
string$a_valcurrent language

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

References $_SESSION.

2068  {
2069  $_SESSION['lang'] = $a_val;
2070  }
$_SESSION["AccountId"]

◆ setDelicious()

ilObjUser::setDelicious (   $a_delicious)

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

Referenced by assignData().

4379  {
4380  $this->delicious = $a_delicious;
4381  }
+ Here is the caller graph for this function:

◆ setDepartment()

ilObjUser::setDepartment (   $a_str)

set department public

Parameters
stringdepartment

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

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

1673  {
1674  $this->department = $a_str;
1675  }
+ 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 3097 of file class.ilObjUser.php.

References $ilDB, and ilObject\getId().

3098  {
3099  global $ilDB;
3100 
3101  $ilDB->manipulateF("UPDATE desktop_item SET parameters = %s ".
3102  " WHERE item_id = %s AND type = %s AND user_id = %s",
3103  array("text", "integer", "text", "integer"),
3104  array($a_par, $a_item_id, $a_type, $this->getId()));
3105  }
getId()
get object id public
global $ilDB
+ 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
@param      integer

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

References setPref().

1983  {
1984  $this->setPref("disk_quota",$a_disk_quota);
1985  }
setPref($a_keyword, $a_value)
set a user preference
+ Here is the call graph for this function:

◆ setEmail()

ilObjUser::setEmail (   $a_str)

set email public

Parameters
stringemail address

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

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

1921  {
1922  $this->email = $a_str;
1923  }
+ 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.

public

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

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

3646  {
3647  $this->ext_account = $a_str;
3648  }
+ Here is the caller graph for this function:

◆ setFax()

ilObjUser::setFax (   $a_str)

set fax public

Parameters
stringfax

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

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

1847  {
1848  $this->fax = $a_str;
1849  }
+ Here is the caller graph for this function:

◆ setFirstname()

ilObjUser::setFirstname (   $a_str)

set firstname public

Parameters
stringfirstname

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

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

1616  {
1617  $this->firstname = $a_str;
1618  }
+ 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. static

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

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

References $lastname.

Referenced by assignData().

1443  {
1444  $this->fullname = "";
1445 
1446  if ($a_title)
1447  {
1448  $fullname = $a_title." ";
1449  }
1450  elseif ($this->utitle)
1451  {
1452  $this->fullname = $this->utitle." ";
1453  }
1454 
1455  if ($a_firstname)
1456  {
1457  $fullname .= $a_firstname." ";
1458  }
1459  elseif ($this->firstname)
1460  {
1461  $this->fullname .= $this->firstname." ";
1462  }
1463 
1464  if ($a_lastname)
1465  {
1466  return $fullname.$a_lastname;
1467  }
1468 
1469  $this->fullname .= $this->lastname;
1470  }
+ Here is the caller graph for this function:

◆ setGender()

ilObjUser::setGender (   $a_str)

set gender public

Parameters
stringgender

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

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

1574  {
1575  $this->gender = substr($a_str,-1);
1576  }
+ Here is the caller graph for this function:

◆ setGeneralInterests()

ilObjUser::setGeneralInterests ( array  $value = null)

Set general interests.

Parameters
array$value

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

Referenced by readMultiTextFields().

5598  {
5599  $this->interests_general = $value;
5600  }
+ Here is the caller graph for this function:

◆ setHobby()

ilObjUser::setHobby (   $a_str)

set hobby public

Parameters
stringhobby

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

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

1940  {
1941  $this->hobby = $a_str;
1942  }
+ Here is the caller graph for this function:

◆ setInactivationDate()

ilObjUser::setInactivationDate (   $inactivation_date)

setter for inactivation date

Parameters
string$inactivationDate

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

References $inactivation_date.

Referenced by assignData().

5432  {
5433  $this->inactivation_date = $inactivation_date;
5434  }
+ Here is the caller graph for this function:

◆ setInstantMessengerId()

ilObjUser::setInstantMessengerId (   $a_im_type,
  $a_im_id 
)

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

Referenced by assignData().

4367  {
4368  $var = "im_".$a_im_type;
4369  $this->$var = $a_im_id;
4370  }
+ Here is the caller graph for this function:

◆ setInstitution()

ilObjUser::setInstitution (   $a_str)

set institution public

Parameters
stringinstitution

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

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

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

◆ setIsSelfRegistered()

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

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

Referenced by assignData().

5578  {
5579  $this->is_self_registered = (bool) $status;
5580  }
+ Here is the caller graph for this function:

◆ setLanguage()

ilObjUser::setLanguage (   $a_str)

set user language public

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

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

References $_SESSION, and setPref().

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

1959  {
1960  $this->setPref("language",$a_str);
1961  unset($_SESSION['lang']);
1962  }
$_SESSION["AccountId"]
setPref($a_keyword, $a_value)
set a user preference
+ 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 public

Parameters
stringlogin date

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

Referenced by assignData().

2078  {
2079  $this->last_login = $a_str;
2080  }
+ Here is the caller graph for this function:

◆ setLastname()

ilObjUser::setLastname (   $a_str)

set lastame public

Parameters
stringlastname

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

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

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

◆ setLastPasswordChangeToNow()

ilObjUser::setLastPasswordChangeToNow ( )

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

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

2409  {
2410  global $ilDB;
2411 
2412  $this->setLastPasswordChangeTS( time() );
2413 
2414  $query = "UPDATE usr_data SET last_password_change = %s " .
2415  "WHERE usr_id = %s";
2416  $affected = $ilDB->manipulateF($query,
2417  array('integer','integer'),
2418  array($this->getLastPasswordChangeTS(),$this->id));
2419  if($affected) return true;
2420  else return false;
2421  }
setLastPasswordChangeTS($a_last_password_change_ts)
global $ilDB
+ Here is the call graph for this function:

◆ setLastPasswordChangeTS()

ilObjUser::setLastPasswordChangeTS (   $a_last_password_change_ts)

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

Referenced by read(), and setLastPasswordChangeToNow().

2007  {
2008  $this->last_password_change_ts = $a_last_password_change_ts;
2009  }
+ Here is the caller graph for this function:

◆ setLastUpdate()

ilObjUser::setLastUpdate (   $a_str)

set last update of user data set public

Parameters
stringdate

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

Referenced by assignData().

2098  {
2099  $this->last_update = $a_str;
2100  }
+ Here is the caller graph for this function:

◆ setLatitude()

ilObjUser::setLatitude (   $a_latitude)

Set Latitude.

Parameters
string$a_latitudeLatitude

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

Referenced by assignData().

2441  {
2442  $this->latitude = $a_latitude;
2443  }
+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjUser::setLocationZoom (   $a_locationzoom)

Set Location Zoom.

Parameters
int$a_locationzoomLocation Zoom

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

Referenced by assignData().

2481  {
2482  $this->loc_zoom = $a_locationzoom;
2483  }
+ Here is the caller graph for this function:

◆ setLogin()

ilObjUser::setLogin (   $a_str)

set login / username public

Parameters
stringusername

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

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

1522  {
1523  $this->login = $a_str;
1524  }
+ Here is the caller graph for this function:

◆ setLoginAttempts()

ilObjUser::setLoginAttempts (   $a_login_attempts)

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

Referenced by read().

2311  {
2312  $this->login_attempts = $a_login_attempts;
2313  }
+ Here is the caller graph for this function:

◆ setLongitude()

ilObjUser::setLongitude (   $a_longitude)

Set Longitude.

Parameters
string$a_longitudeLongitude

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

Referenced by assignData().

2461  {
2462  $this->longitude = $a_longitude;
2463  }
+ Here is the caller graph for this function:

◆ setLookingForHelp()

ilObjUser::setLookingForHelp ( array  $value = null)

Set help looking for.

Parameters
array$value

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

Referenced by readMultiTextFields().

5658  {
5659  $this->interests_help_looking = $value;
5660  }
+ Here is the caller graph for this function:

◆ setMatriculation()

ilObjUser::setMatriculation (   $a_str)

set matriculation number public

Parameters
stringmatriculation number

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

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

1885  {
1886  $this->matriculation = $a_str;
1887  }
+ Here is the caller graph for this function:

◆ setOfferingHelp()

ilObjUser::setOfferingHelp ( array  $value = null)

Set help offering.

Parameters
array$value

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

Referenced by readMultiTextFields().

5628  {
5629  $this->interests_help_offered = $value;
5630  }
+ Here is the caller graph for this function:

◆ setPasswd()

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

set password public

Parameters
stringpasswd

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

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

1541  {
1542  $this->passwd = $a_str;
1543  $this->passwd_type = $a_type;
1544  }
+ Here is the caller graph for this function:

◆ setPasswordEncodingType()

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

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

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

307  {
308  $this->password_encoding_type = $password_encryption_type;
309  }
+ Here is the caller graph for this function:

◆ setPasswordSalt()

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

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

References $password_salt.

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

323  {
324  $this->password_salt = $password_salt;
325  }
+ Here is the caller graph for this function:

◆ setPhoneHome()

ilObjUser::setPhoneHome (   $a_str)

set home phone public

Parameters
stringhome phone

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

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

1809  {
1810  $this->phone_home = $a_str;
1811  }
+ Here is the caller graph for this function:

◆ setPhoneMobile()

ilObjUser::setPhoneMobile (   $a_str)

set mobile phone public

Parameters
stringmobile phone

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

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

1828  {
1829  $this->phone_mobile = $a_str;
1830  }
+ Here is the caller graph for this function:

◆ setPhoneOffice()

ilObjUser::setPhoneOffice (   $a_str)

set office phone public

Parameters
stringoffice phone

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

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

1790  {
1791  $this->phone_office = $a_str;
1792  }
+ Here is the caller graph for this function:

◆ setPref()

ilObjUser::setPref (   $a_keyword,
  $a_value 
)

set a user preference

Parameters
stringname of parameter
stringvalue public

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

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

1241  {
1242  if ($a_keyword != "")
1243  {
1244  $this->prefs[$a_keyword] = $a_value;
1245  }
1246  }
+ Here is the caller graph for this function:

◆ setProfileIncomplete()

ilObjUser::setProfileIncomplete (   $a_prof_inc)

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

Referenced by assignData().

2334  {
2335  $this->profile_incomplete = (boolean) $a_prof_inc;
2336  }
+ 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 1769 of file class.ilObjUser.php.

Referenced by assignData().

1770  {
1771  $this->sel_country = $a_val;
1772  }
+ Here is the caller graph for this function:

◆ setSkin()

ilObjUser::setSkin (   $a_str)

set user skin (template set) public

Parameters
stringdirectory name of template set

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

2264  {
2265  // TODO: exception handling (dir exists)
2266  $this->skin = $a_str;
2267  }

◆ setStreet()

ilObjUser::setStreet (   $a_str)

set street public

Parameters
stringstreet

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

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

1692  {
1693  $this->street = $a_str;
1694  }
+ Here is the caller graph for this function:

◆ setTimeLimitFrom()

ilObjUser::setTimeLimitFrom (   $a_from)

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

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

2278  {
2279  $this->time_limit_from = $a_from;
2280  }
+ Here is the caller graph for this function:

◆ setTimeLimitMessage()

ilObjUser::setTimeLimitMessage (   $a_time_limit_message)

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

Referenced by assignData().

2302  {
2303  return $this->time_limit_message = $a_time_limit_message;
2304  }
+ Here is the caller graph for this function:

◆ setTimeLimitOwner()

ilObjUser::setTimeLimitOwner (   $a_owner)

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

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

2270  {
2271  $this->time_limit_owner = $a_owner;
2272  }
+ Here is the caller graph for this function:

◆ setTimeLimitUnlimited()

ilObjUser::setTimeLimitUnlimited (   $a_unlimited)

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

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

2294  {
2295  $this->time_limit_unlimited = $a_unlimited;
2296  }
+ Here is the caller graph for this function:

◆ setTimeLimitUntil()

ilObjUser::setTimeLimitUntil (   $a_until)

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

Referenced by ilAccountCode\applyAccessLimits(), assignData(), shibUser\createFields(), and ilECSAppEventListener\extendAccount().

2286  {
2287  $this->time_limit_until = $a_until;
2288  }
+ Here is the caller graph for this function:

◆ setUserDefinedData()

ilObjUser::setUserDefinedData (   $a_data)

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

References $data.

4076  {
4077  if(!is_array($a_data))
4078  {
4079  return false;
4080  }
4081  foreach($a_data as $field => $data)
4082  {
4083  #$new_data[$field] = ilUtil::stripSlashes($data);
4084  // Assign it directly to avoid update problems of unchangable fields
4085  $this->user_defined_data['f_'.$field] = $data;
4086  }
4087  #$this->user_defined_data = $new_data;
4088 
4089  return true;
4090  }
$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) public

Parameters
stringtitle

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

Referenced by assignData().

1595  {
1596  $this->utitle = $a_str;
1597  }
+ Here is the caller graph for this function:

◆ setZipcode()

ilObjUser::setZipcode (   $a_str)

set zipcode public

Parameters
stringzipcode

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

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

1730  {
1731  $this->zipcode = $a_str;
1732  }
+ 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 public

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

References getLoginFromAuth(), getStoredActive(), getUserIdByLogin(), and setActive().

Referenced by assignData().

2224  {
2225  global $ilAuth;
2226 
2227  $storedActive = 0;
2228  if ($this->getStoredActive($this->id))
2229  {
2230  $storedActive = 1;
2231  }
2232 
2233  $currentActive = 0;
2234  if ($this->active)
2235  {
2236  $currentActive = 1;
2237  }
2238 
2239  if ((!empty($storedActive) && empty($currentActive)) ||
2240  (empty($storedActive) && !empty($currentActive)))
2241  {
2242  $this->setActive($currentActive, $this->getUserIdByLogin(ilObjUser::getLoginFromAuth()));
2243  }
2244  }
setActive($a_active, $a_owner=0)
set user active state and updates system fields appropriately public
getUserIdByLogin($a_login)
static getLoginFromAuth()
Gets the username from $ilAuth, and converts it into an ILIAS login name.
getStoredActive($a_id)
get user active state
+ Here is the call graph for this function:
+ 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 public
Exceptions
ilUserException

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

References $ilDB, $ilSetting, _getLastHistoryDataByUserId(), _writeHistory(), ilDatePresentation\formatDate(), ilObject\getId(), getLogin(), and IL_CAL_UNIX.

1001  {
1002  global $ilDB, $ilSetting;
1003 
1004  if(func_num_args() != 1)
1005  {
1006  return false;
1007  }
1008 
1009  if(!isset($a_login))
1010  {
1011  return false;
1012  }
1013 
1014  $former_login = self::_lookupLogin($this->getId());
1015 
1016  // Update not necessary
1017  if(0 == strcmp($a_login, $former_login))
1018  {
1019  return false;
1020  }
1021 
1022  try
1023  {
1024  $last_history_entry = ilObjUser::_getLastHistoryDataByUserId($this->getId());
1025  }
1026  catch(ilUserException $e) { $last_history_entry = null; }
1027 
1028  // throw exception if the desired loginame is already in history and it is not allowed to reuse it
1029  if((int)$ilSetting->get('allow_change_loginname') &&
1030  (int)$ilSetting->get('reuse_of_loginnames') == 0 &&
1031  self::_doesLoginnameExistInHistory($a_login))
1032  {
1033  throw new ilUserException($this->lng->txt('loginname_already_exists'));
1034  }
1035  else if((int)$ilSetting->get('allow_change_loginname') &&
1036  (int)$ilSetting->get('loginname_change_blocking_time') &&
1037  is_array($last_history_entry) &&
1038  $last_history_entry[1] + (int)$ilSetting->get('loginname_change_blocking_time') > time())
1039  {
1040  include_once 'Services/Calendar/classes/class.ilDate.php';
1041  throw new ilUserException(
1042  sprintf(
1043  $this->lng->txt('changing_loginname_not_possible_info'),
1045  new ilDateTime($last_history_entry[1], IL_CAL_UNIX)),
1047  new ilDateTime(($last_history_entry[1] + (int)$ilSetting->get('loginname_change_blocking_time')), IL_CAL_UNIX))
1048  )
1049  );
1050  }
1051  else
1052  {
1053  // log old loginname in history
1054  if((int)$ilSetting->get('allow_change_loginname') &&
1055  (int)$ilSetting->get('create_history_loginname'))
1056  {
1057  ilObjUser::_writeHistory($this->getId(), $former_login);
1058  }
1059 
1060  //update login
1061  $this->login = $a_login;
1062 
1063  $ilDB->manipulateF('
1064  UPDATE usr_data
1065  SET login = %s
1066  WHERE usr_id = %s',
1067  array('text', 'integer'), array($this->getLogin(), $this->getId()));
1068  }
1069 
1070  return true;
1071  }
Class for user related exception handling in ILIAS.
getLogin()
get login / username public
static _getLastHistoryDataByUserId($a_usr_id)
Returns the last used loginname and the changedate of the passed user_id.
const IL_CAL_UNIX
getId()
get object id public
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
global $ilSetting
Definition: privfeed.php:40
global $ilDB
static _writeHistory($a_usr_id, $a_login)
+ 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 5749 of file class.ilObjUser.php.

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

Referenced by assignData().

5750  {
5751  global $ilDB;
5752 
5753  if(!$this->getId())
5754  {
5755  return;
5756  }
5757 
5758  if(!$a_create)
5759  {
5760  $this->deleteMultiTextFields();
5761  }
5762 
5763  $map = array(
5764  "interests_general" => $this->getGeneralInterests(),
5765  "interests_help_offered" => $this->getOfferingHelp(),
5766  "interests_help_looking" => $this->getLookingForHelp()
5767  );
5768 
5769  foreach($map as $id => $values)
5770  {
5771  if(is_array($values) && sizeof($values))
5772  {
5773  foreach($values as $value)
5774  {
5775  $value = trim($value);
5776  if($value)
5777  {
5778  $uniq_id = $ilDB->nextId('usr_data_multi');
5779 
5780  $ilDB->manipulate("INSERT usr_data_multi".
5781  " (id,usr_id,field_id,value) VALUES".
5782  " (".$ilDB->quote($uniq_id, "integer").
5783  ",".$ilDB->quote($this->getId(), "integer").
5784  ",".$ilDB->quote($id, "text").
5785  ",".$ilDB->quote($value, "text").
5786  ")");
5787  }
5788  }
5789  }
5790  }
5791  }
getLookingForHelp()
Get help looking for.
getGeneralInterests()
Get general interests.
getId()
get object id public
getOfferingHelp()
Get help offering.
deleteMultiTextFields()
Remove multi-text values from DB.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateUserDefinedFields()

ilObjUser::updateUserDefinedFields ( )

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

References $ilDB, and ilObject\getId().

Referenced by assignData().

4098  {
4099  global $ilDB;
4100 
4101  $fields = '';
4102 
4103  $field_def = array();
4104 
4105  include_once("./Services/User/classes/class.ilUserDefinedData.php");
4106  $udata = new ilUserDefinedData($this->getId());
4107 
4108  foreach($this->user_defined_data as $field => $value)
4109  {
4110  if($field != 'usr_id')
4111  {
4112 // $field_def[$field] = array('text',$value);
4113  $udata->set($field, $value);
4114  }
4115  }
4116  $udata->update();
4117 
4118 /* if(!$field_def)
4119  {
4120  return true;
4121  }
4122 
4123  $query = "SELECT usr_id FROM udf_data WHERE usr_id = ".$ilDB->quote($this->getId(),'integer');
4124  $res = $ilDB->query($query);
4125 
4126 
4127  if($res->numRows())
4128  {
4129  // Update
4130  $ilDB->update('udf_data',$field_def,array('usr_id' => array('integer',$this->getId())));
4131  }
4132  else
4133  {
4134  $field_def['usr_id'] = array('integer',$this->getId());
4135  $ilDB->insert('udf_data',$field_def);
4136  }
4137 */
4138  return true;
4139  }
Class ilUserDefinedData.
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userExists()

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

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

References $ilDB, $query, $res, and DB_FETCHMODE_OBJECT.

Referenced by ilInfoScreenGUI\addObjectSections().

5259  {
5260  global $ilDB;
5261 
5262  $query = 'SELECT count(*) num FROM object_data od '.
5263  'JOIN usr_data ud ON obj_id = usr_id '.
5264  'WHERE '.$ilDB->in('obj_id',$a_usr_ids,false,'integer').' ';
5265  $res = $ilDB->query($query);
5266  $num_rows =$res->fetchRow(DB_FETCHMODE_OBJECT)->num;
5267  return $num_rows == count((array) $a_usr_ids);
5268  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the caller graph for this function:

◆ writeAccepted()

ilObjUser::writeAccepted ( )

write accept date of user agreement to db

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

References $ilDB, and ilObject\getId().

Referenced by ilTermsOfServiceHelper\trackAcceptance().

684  {
685  global $ilDB;
686 
687  $ilDB->manipulateF("UPDATE usr_data SET agree_date = ".$ilDB->now().
688  " WHERE usr_id = %s", array("integer"), array($this->getId()));
689  }
getId()
get object id public
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writePref()

ilObjUser::writePref (   $a_keyword,
  $a_value 
)

write userpref to user table private

Parameters
stringkeyword
stringvalue

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

References setPref().

Referenced by activateDeletionFlag(), and removeDeletionFlag().

1080  {
1081  self::_writePref($this->id, $a_keyword, $a_value);
1082  $this->setPref($a_keyword, $a_value);
1083  }
setPref($a_keyword, $a_value)
set a user preference
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writePrefs()

ilObjUser::writePrefs ( )

write all userprefs private

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

References $ilDB, and _deleteAllPref().

Referenced by assignData().

1164  {
1165  global $ilDB;
1166 
1167  ilObjUser::_deleteAllPref($this->id);
1168  foreach ($this->prefs as $keyword => $value)
1169  {
1170  self::_writePref($this->id, $keyword, $value);
1171  }
1172  }
_deleteAllPref($a_user_id)
Deletes a userpref value of the user from the database public.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $active

ilObjUser::$active

◆ $agree_date

ilObjUser::$agree_date = null

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

Referenced by getAgreeDate().

◆ $approve_date

ilObjUser::$approve_date = null

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

Referenced by getApproveDate().

◆ $auth_mode

ilObjUser::$auth_mode

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

Referenced by getAuthMode().

◆ $birthday

ilObjUser::$birthday
protected

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

Referenced by getBirthday().

◆ $city

ilObjUser::$city

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

Referenced by getCity().

◆ $client_ip

ilObjUser::$client_ip

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

Referenced by getClientIP().

◆ $country

ilObjUser::$country

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

Referenced by getCountry().

◆ $default_role

ilObjUser::$default_role

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

◆ $delicious

ilObjUser::$delicious

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

Referenced by getDelicious().

◆ $department

ilObjUser::$department

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

Referenced by getDepartment().

◆ $email

ilObjUser::$email

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

Referenced by getEmail().

◆ $fax

ilObjUser::$fax

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

Referenced by getFax().

◆ $firstname

ilObjUser::$firstname

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

Referenced by getFirstname().

◆ $fullname

ilObjUser::$fullname

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

Referenced by _lookupFullname().

◆ $gender

ilObjUser::$gender

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

Referenced by getGender().

◆ $hobby

ilObjUser::$hobby

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

Referenced by getHobby().

◆ $ilias

ilObjUser::$ilias

◆ $im_aim

ilObjUser::$im_aim

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

◆ $im_icq

ilObjUser::$im_icq

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

◆ $im_jabber

ilObjUser::$im_jabber

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

◆ $im_msn

ilObjUser::$im_msn

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

◆ $im_skype

ilObjUser::$im_skype

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

◆ $im_voip

ilObjUser::$im_voip

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

◆ $im_yahoo

ilObjUser::$im_yahoo

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

◆ $inactivation_date

ilObjUser::$inactivation_date = null
protected

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

Referenced by getInactivationDate(), and setInactivationDate().

◆ $institution

ilObjUser::$institution

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

◆ $is_desktop_item_loaded

ilObjUser::$is_desktop_item_loaded
static

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

◆ $is_self_registered

ilObjUser::$is_self_registered = false
private

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

Referenced by isSelfRegistered().

◆ $last_password_change_ts

ilObjUser::$last_password_change_ts

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

Referenced by getLastPasswordChangeTS().

◆ $lastname

ilObjUser::$lastname

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

Referenced by getLastname(), and setFullname().

◆ $latitude

ilObjUser::$latitude

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

Referenced by getLatitude().

◆ $loc_zoom

ilObjUser::$loc_zoom

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

Referenced by getLocationZoom().

◆ $login

ilObjUser::$login

all user related data in single vars public

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

Referenced by shibUser\cleanName(), getLogin(), getLoginByUserId(), getLoginFromAuth(), and shibUser\returnNewLoginName().

◆ $login_attempts

ilObjUser::$login_attempts

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

Referenced by _getLoginAttempts(), and getLoginAttempts().

◆ $longitude

ilObjUser::$longitude

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

Referenced by getLongitude().

◆ $matriculation

ilObjUser::$matriculation

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

Referenced by getMatriculation().

◆ $passwd

ilObjUser::$passwd
protected

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

Referenced by assignData(), and getPasswd().

◆ $passwd_type

ilObjUser::$passwd_type
protected

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

Referenced by getPasswdType().

◆ $password_encoding_type

ilObjUser::$password_encoding_type
protected

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

Referenced by getPasswordEncodingType().

◆ $password_salt

ilObjUser::$password_salt = null
protected

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

Referenced by getPasswordSalt(), and setPasswordSalt().

◆ $personal_image_cache

ilObjUser::$personal_image_cache = array()
staticprotected

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

◆ $phone_home

ilObjUser::$phone_home

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

Referenced by getPhoneHome().

◆ $phone_mobile

ilObjUser::$phone_mobile

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

Referenced by getPhoneMobile().

◆ $phone_office

ilObjUser::$phone_office

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

Referenced by getPhoneOffice().

◆ $prefs

ilObjUser::$prefs

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

Referenced by _getPreferences(), and readPrefs().

◆ $referral_comment

ilObjUser::$referral_comment

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

Referenced by getComment().

◆ $sel_country

ilObjUser::$sel_country

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

Referenced by getSelectedCountry().

◆ $skin

ilObjUser::$skin

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

Referenced by __construct().

◆ $street

ilObjUser::$street

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

Referenced by getStreet().

◆ $user_defined_data

ilObjUser::$user_defined_data = array()

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

◆ $utitle

ilObjUser::$utitle

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

Referenced by getUTitle().

◆ $zipcode

ilObjUser::$zipcode

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

Referenced by getZipcode().


The documentation for this class was generated from the following file: