ILIAS  release_4-4 Revision
ilObjUser Class Reference
+ Inheritance diagram for ilObjUser:
+ Collaboration diagram for ilObjUser:

Public Member Functions

 ilObjUser ($a_user_id=0, $a_call_by_reference=false)
 Constructor public. More...
 
 read ()
 loads a record "user" from database private More...
 
 assignData ($a_data)
 loads a record "user" from array public More...
 
 saveAsNew ($a_from_formular=true)
 TODO: drop fields last_update & create_date. More...
 
 update ()
 updates a record "user" and write it into database 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...
 
 _lookupLogin ($a_user_id)
 lookup login 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...
 
 replacePassword ($new_md5)
 replaces password with new md5 hash More...
 
 updatePassword ($a_old, $a_new1, $a_new2)
 updates password More...
 
 resetPassword ($a_new1, $a_new2)
 reset password 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 ()
 
 _checkPassword ($a_usr_id, $a_pw)
 
 _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...
 
 hasToAcceptTermsOfServiceInSession ($status=null)
 
 isAnonymous ()
 
 activateDeletionFlag ()
 
 removeDeletionFlag ()
 
 hasDeletionFlag ()
 
 setIsSelfRegistered ($status)
 
 isSelfRegistered ()
 
- 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...
 
 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...
 
 createRoleFolder ()
 creates a local role folder 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...
 

Static Public Member Functions

static _lookupGender ($a_user_id)
 Lookup gender. More...
 
static _lookupName ($a_user_id)
 lookup user name More...
 
static _lookupId ($a_user_str)
 lookup id by login More...
 
static _makeIlias2Password ($a_passwd)
 get encrypted Ilias 2 password (needed for imported ilias 2 users) 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 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 _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 Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_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 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...
 
 $passwd
 
 $passwd_type
 
 $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 Attributes

 $birthday
 
 $inactivation_date = null
 

Static Protected Attributes

static $personal_image_cache = array()
 

Private Member Functions

 _lookup ($a_user_id, $a_field)
 Private function for lookup methods. More...
 

Static Private Member Functions

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

Member Function Documentation

◆ __readAppliedUsers()

ilObjUser::__readAppliedUsers (   $a_parent_id)

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

References $res, and $row.

Referenced by getAppliedUsers(), and isChild().

2534  {
2535  global $ilDB;
2536 
2537  $res = $ilDB->queryF("SELECT usr_id FROM usr_data ".
2538  "WHERE time_limit_owner = %s",
2539  array("integer"),
2540  array($a_parent_id));
2541  while ($row = $ilDB->fetchObject($res))
2542  {
2543  $this->applied_users[] = $row->usr_id;
2544 
2545  // recursion
2546  $this->__readAppliedUsers($row->usr_id);
2547  }
2548  return true;
2549  }
__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 3075 of file class.ilObjUser.php.

References ilCalendarCategories\deletePDItemsCache().

Referenced by ilParticipant\addDesktopItem(), ilParticipants\addDesktopItem(), addDesktopItem(), ilDesktopItemGUI\addToDesktop(), ilObjGroupGUI\addUserObject(), ilUserImportParser\assignToRole(), ilRbacAdmin\assignUser(), ilObjSurvey\inviteGroup(), ilObjSurvey\inviteRole(), and ilObjSurvey\inviteUser().

3076  {
3077  global $ilDB;
3078 
3079  $item_set = $ilDB->queryF("SELECT * FROM desktop_item WHERE ".
3080  "item_id = %s AND type = %s AND user_id = %s",
3081  array("integer", "text", "integer"),
3082  array($a_item_id, $a_type, $a_usr_id));
3083 
3084  // only insert if item is not already on desktop
3085  if (!$ilDB->fetchAssoc($item_set))
3086  {
3087  $ilDB->manipulateF("INSERT INTO desktop_item (item_id, type, user_id, parameters) VALUES ".
3088  " (%s,%s,%s,%s)", array("integer", "text", "integer", "text"),
3089  array($a_item_id,$a_type,$a_usr_id,$a_par));
3090  }
3091 
3092  include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
3094  }
static deletePDItemsCache($a_usr_id)
Delete cache (add remove desktop item)
+ 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 3803 of file class.ilObjUser.php.

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

Referenced by ilSoapAuthentication\__checkAgreement(), ilSoapAuthenticationCAS\authenticate(), ilAuthContainerLDAP\extractUserName(), ilAuthContainerSOAP\fetchData(), ilAuthContainerApache\forceCreation(), ShibAuth\generateLogin(), 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().

3804  {
3805  global $ilDB,$ilSetting;
3806 
3807  // Check directly with auth_mode
3808  $r = $ilDB->queryF("SELECT * FROM usr_data WHERE ".
3809  " ext_account = %s AND auth_mode = %s",
3810  array("text", "text"),
3811  array($a_account, $a_auth));
3812  if ($usr = $ilDB->fetchAssoc($r))
3813  {
3814  return $usr["login"];
3815  }
3816 
3817  // For compatibility, check for login (no ext_account entry given)
3818  $res = $ilDB->queryF("SELECT login FROM usr_data ".
3819  "WHERE login = %s AND auth_mode = %s",
3820  array("text", "text"),
3821  array($a_account, $a_auth));
3822  if($usr = $ilDB->fetchAssoc($res))
3823  {
3824  return $usr['login'];
3825  }
3826 
3827  // If auth_default == $a_auth => check for login
3828  if(ilAuthUtils::_getAuthModeName($ilSetting->get('auth_mode')) == $a_auth)
3829  {
3830  $res = $ilDB->queryF("SELECT login FROM usr_data WHERE ".
3831  " ext_account = %s AND auth_mode = %s",
3832  array("text", "text"),
3833  array($a_account, "default"));
3834  if ($usr = $ilDB->fetchAssoc($res))
3835  {
3836  return $usr["login"];
3837  }
3838  // Search for login (no ext_account given)
3839  $res = $ilDB->queryF("SELECT login FROM usr_data ".
3840  "WHERE login = %s AND (ext_account IS NULL OR ext_account = '') AND auth_mode = %s",
3841  array("text", "text"),
3842  array($a_account, "default"));
3843  if($usr = $ilDB->fetchAssoc($res))
3844  {
3845  return $usr["login"];
3846  }
3847  }
3848  return false;
3849  }
static _getAuthModeName($a_auth_key)
global $ilSetting
Definition: privfeed.php:40
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _checkPassword()

ilObjUser::_checkPassword (   $a_usr_id,
  $a_pw 
)

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

References _lookup().

Referenced by ilAuthContainerSOAP\loginObserver(), and ilObjUserTest\testCreateSetLookupDelete().

2051  {
2052  global $ilDB;
2053 
2054  $pw = ilObjUser::_lookup($a_usr_id, "passwd");
2055  if ($pw == md5($a_pw))
2056  {
2057  return true;
2058  }
2059  return false;
2060  }
_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:

◆ _deleteAllPref()

ilObjUser::_deleteAllPref (   $a_user_id)

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

Parameters
stringkeyword

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

Referenced by delete(), and writePrefs().

1125  {
1126  global $ilDB;
1127 
1128  $ilDB->manipulateF("DELETE FROM usr_pref WHERE usr_id = %s",
1129  array("integer"), array($a_user_id));
1130  }
+ 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 953 of file class.ilObjUser.php.

References $res.

Referenced by ilAccountRegistrationGUI\saveForm().

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

References ilCalendarCategories\deletePDItemsCache().

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

3137  {
3138  global $ilDB;
3139 
3140  $ilDB->manipulateF("DELETE FROM desktop_item WHERE ".
3141  " item_id = %s AND type = %s AND user_id = %s",
3142  array("integer", "text", "integer"),
3143  array($a_item_id, $a_type, $a_usr_id));
3144 
3145  include_once './Services/Calendar/classes/class.ilCalendarCategories.php';
3147  }
static deletePDItemsCache($a_usr_id)
Delete cache (add remove desktop item)
+ 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 4529 of file class.ilObjUser.php.

References $res.

Referenced by ilObjUserTest\testAuthAndEmailMethods().

4530  {
4531  global $ilDB;
4532 
4533  $res = $ilDB->queryF("SELECT * FROM usr_data ".
4534  "WHERE ext_account = %s AND auth_mode = %s",
4535  array("text", "text"),
4536  array($a_external_account, $a_auth_mode));
4537  return $ilDB->fetchAssoc($res) ? true :false;
4538  }
+ 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 $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
+ Here is the caller graph for this function:

◆ _getAllUserAssignedStyles()

ilObjUser::_getAllUserAssignedStyles ( )

skins and styles

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

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

3023  {
3024  global $ilDB;
3025 
3026  $q = "SELECT DISTINCT up1.value style, up2.value skin FROM usr_pref up1, usr_pref up2 ".
3027  " WHERE up1.keyword = ".$ilDB->quote("style", "text").
3028  " AND up2.keyword = ".$ilDB->quote("skin", "text").
3029  " AND up1.usr_id = up2.usr_id";
3030 
3031  $sty_set = $ilDB->query($q);
3032 
3033  $styles = array();
3034  while($sty_rec = $ilDB->fetchAssoc($sty_set))
3035  {
3036  $styles[] = $sty_rec["skin"].":".$sty_rec["style"];
3037  }
3038 
3039  return $styles;
3040  }
+ 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 2888 of file class.ilObjUser.php.

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

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

2889  {
2890  global $ilDB;
2891 
2892  $result_arr = array();
2893  $types = array();
2894  $values = array();
2895 
2896  if ($a_fields !== NULL and is_array($a_fields))
2897  {
2898  if (count($a_fields) == 0)
2899  {
2900  $select = "*";
2901  }
2902  else
2903  {
2904  if (($usr_id_field = array_search("usr_id",$a_fields)) !== false)
2905  unset($a_fields[$usr_id_field]);
2906 
2907  $select = implode(",",$a_fields).",usr_data.usr_id";
2908  // online time
2909  if(in_array('online_time',$a_fields))
2910  {
2911  $select .= ",ut_online.online_time ";
2912  }
2913  }
2914 
2915  $q = "SELECT ".$select." FROM usr_data ";
2916 
2917  // Add online_time if desired
2918  // Need left join here to show users that never logged in
2919  if(in_array('online_time',$a_fields))
2920  {
2921  $q .= "LEFT JOIN ut_online ON usr_data.usr_id = ut_online.usr_id ";
2922  }
2923 
2924  switch ($active)
2925  {
2926  case 0:
2927  case 1:
2928  $q .= "WHERE active = ".$ilDB->quote($active, "integer");
2929  break;
2930  case 2:
2931  $q .= "WHERE time_limit_unlimited= ".$ilDB->quote(0, "integer");;
2932  break;
2933  case 3:
2934  $qtemp = $q . ", rbac_ua, object_data WHERE rbac_ua.rol_id = object_data.obj_id AND ".
2935  $ilDB->like("object_data.title", "text", "%crs%")." AND usr_data.usr_id = rbac_ua.usr_id";
2936  $r = $ilDB->query($qtemp);
2937  $course_users = array();
2938  while ($row = $ilDB->fetchAssoc($r))
2939  {
2940  array_push($course_users, $row["usr_id"]);
2941  }
2942  if (count($course_users))
2943  {
2944  $q .= " WHERE ".$ilDB->in("usr_data.usr_id", $course_users, true, "integer")." ";
2945  }
2946  else
2947  {
2948  return $result_arr;
2949  }
2950  break;
2951  case 4:
2952  $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"]));
2953  $q.= " AND last_login < ".$ilDB->quote($date, "timestamp");
2954  break;
2955  case 5:
2956  $ref_id = $_SESSION["user_filter_data"];
2957  if ($ref_id)
2958  {
2959  $q .= " LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id ".
2960  "WHERE obj_members.obj_id = (SELECT obj_id FROM object_reference ".
2961  "WHERE ref_id = ".$ilDB->quote($ref_id, "integer").") ";
2962  }
2963  break;
2964  case 6:
2965  global $rbacreview;
2966  $ref_id = $_SESSION["user_filter_data"];
2967  if ($ref_id)
2968  {
2969  $rolf = $rbacreview->getRoleFolderOfObject($ref_id);
2970  $local_roles = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"],false);
2971  if (is_array($local_roles) && count($local_roles))
2972  {
2973  $q.= " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE ".
2974  $ilDB->in("rbac_ua.rol_id", $local_roles, false, "integer")." ";
2975  }
2976  }
2977  break;
2978  case 7:
2979  $rol_id = $_SESSION["user_filter_data"];
2980  if ($rol_id)
2981  {
2982  $q .= " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id = ".
2983  $ilDB->quote($rol_id, "integer");
2984  }
2985  break;
2986  }
2987  $r = $ilDB->query($q);
2988 
2989  while ($row = $ilDB->fetchAssoc($r))
2990  {
2991  $result_arr[] = $row;
2992  }
2993  }
2994 
2995  return $result_arr;
2996  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$r
+ 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 2848 of file class.ilObjUser.php.

References $res, and $row.

Referenced by ilMail\__checkSystemRecipients().

2849  {
2850  global $ilDB;
2851 
2852  $res = $ilDB->query("SELECT login FROM usr_data");
2853  while($row = $ilDB->fetchObject($res))
2854  {
2855  $logins[] = $row->login;
2856  }
2857  return $logins ? $logins : array();
2858  }
+ Here is the caller graph for this function:

◆ _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

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

References $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.parent ".
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.parent ".
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
+ 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 3710 of file class.ilObjUser.php.

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

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

3711  {
3712  global $ilDB,$ilSetting;
3713 
3714  include_once('./Services/Authentication/classes/class.ilAuthUtils.php');
3715  $q = "SELECT login,usr_id,ext_account,auth_mode FROM usr_data ".
3716  "WHERE auth_mode = %s";
3717  $types[] = "text";
3718  $values[] = $a_auth_mode;
3719  if($a_read_auth_default and ilAuthUtils::_getAuthModeName($ilSetting->get('auth_mode',AUTH_LOCAL)) == $a_auth_mode)
3720  {
3721  $q.= " OR auth_mode = %s ";
3722  $types[] = "text";
3723  $values[] = 'default';
3724  }
3725 
3726  $res = $ilDB->queryF($q, $types, $values);
3727  while ($row = $ilDB->fetchObject($res))
3728  {
3729  if($row->auth_mode == 'default')
3730  {
3731  $accounts[$row->usr_id] = $row->login;
3732  }
3733  else
3734  {
3735  $accounts[$row->usr_id] = $row->ext_account;
3736  }
3737  }
3738  return $accounts ? $accounts : array();
3739  }
static _getAuthModeName($a_auth_key)
const AUTH_LOCAL
global $ilSetting
Definition: privfeed.php:40
+ 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 4461 of file class.ilObjUser.php.

References _lookupPref().

4462  {
4463  global $ilDB;
4464 
4465  if ($a_user_id > 0)
4466  {
4467  return ilObjUser::_lookupPref($a_user_id, "priv_feed_pass");
4468  }
4469  return false;
4470  }
_lookupPref($a_usr_id, $a_keyword)
+ Here is the call graph for this function:

◆ _getImportedUserId()

ilObjUser::_getImportedUserId (   $i2_id)

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

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

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

3619  {
3620  global $ilDB;
3621 
3622  $query = "SELECT obj_id FROM object_data WHERE import_id = ".
3623  $ilDB->quote($i2_id, "text");
3624 
3625  $res = $ilDB->query($query);
3626  while($row = $ilDB->fetchObject($res))
3627  {
3628  $id = $row->obj_id;
3629  }
3630  return $id ? $id : 0;
3631  }
+ 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 977 of file class.ilObjUser.php.

References $res, and $row.

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

978  {
979  global $ilDB;
980 
981  $ilDB->setLimit(1, 0);
982  $res = $ilDB->queryF('
983  SELECT login, history_date FROM loginname_history
984  WHERE usr_id = %s ORDER BY history_date DESC',
985  array('integer'), array($a_usr_id));
986  $row = $ilDB->fetchAssoc($res);
987  if(!is_array($row) || !count($row)) throw new ilUserException('');
988 
989  return array(
990  $row['login'], $row['history_date']
991  );
992  }
Class for user related exception handling in ILIAS.
+ 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 3874 of file class.ilObjUser.php.

References $ilSetting.

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

3875  {
3876  global $ilDB, $ilSetting;
3877 
3878  // default set to local (1)?
3879 
3880  $q = "SELECT * FROM usr_data WHERE ".
3881  " email = %s AND (auth_mode = %s ";
3882  $types = array("text", "text");
3883  $values = array($a_email, "local");
3884 
3885  if ($ilSetting->get("auth_mode") == 1)
3886  {
3887  $q.=" OR auth_mode = %s";
3888  $types[] = "text";
3889  $values[] = "default";
3890  }
3891 
3892  $q.= ")";
3893 
3894  $users = array();
3895  $usr_set = $ilDB->queryF($q, $types, $values);
3896  while ($usr_rec = $ilDB->fetchAssoc($usr_set))
3897  {
3898  $users[$usr_rec["usr_id"]] = $usr_rec["login"];
3899  }
3900 
3901  return $users;
3902  }
global $ilSetting
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ _getLoginAttempts()

static ilObjUser::_getLoginAttempts (   $a_usr_id)
static

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

References $login_attempts, $query, and $result.

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

4775  {
4776  global $ilDB;
4777 
4778  $query = "SELECT login_attempts FROM usr_data WHERE usr_id = %s";
4779  $result = $ilDB->queryF( $query, array('integer'), array($a_usr_id) );
4780  $record = $ilDB->fetchAssoc( $result );
4781  $login_attempts = $record['login_attempts'];
4782 
4783  return $login_attempts;
4784  }
$result
+ Here is the caller graph for this function:

◆ _getNumberOfUsersForStyle()

ilObjUser::_getNumberOfUsersForStyle (   $a_skin,
  $a_style 
)

skins and styles

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

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

3002  {
3003  global $ilDB;
3004 
3005  $q = "SELECT count(*) as cnt FROM usr_pref up1, usr_pref up2 ".
3006  " WHERE up1.keyword= ".$ilDB->quote("style", "text").
3007  " AND up1.value= ".$ilDB->quote($a_style, "text").
3008  " AND up2.keyword= ".$ilDB->quote("skin", "text").
3009  " AND up2.value= ".$ilDB->quote($a_skin, "text").
3010  " AND up1.usr_id = up2.usr_id ";
3011 
3012  $cnt_set = $ilDB->query($q);
3013 
3014  $cnt_rec = $ilDB->fetchAssoc($cnt_set);
3015 
3016  return $cnt_rec["cnt"];
3017  }
+ Here is the caller graph for this function:

◆ _getNumberOfUsersPerAuthMode()

ilObjUser::_getNumberOfUsersPerAuthMode ( )

get number of users per auth mode

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

References $r.

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

3855  {
3856  global $ilDB;
3857 
3858  $r = $ilDB->query("SELECT count(*) AS cnt, auth_mode FROM usr_data ".
3859  "GROUP BY auth_mode");
3860  $cnt_arr = array();
3861  while($cnt = $ilDB->fetchAssoc($r))
3862  {
3863  $cnt_arr[$cnt["auth_mode"]] = $cnt["cnt"];
3864  }
3865 
3866  return $cnt_arr;
3867  }
$r
+ 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 3969 of file class.ilObjUser.php.

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

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

3971  {
3972  global $ilDB;
3973 
3974  // BEGIN DiskQuota: Fetch all user preferences in a single query
3975  $res = $ilDB->queryF("SELECT * FROM usr_pref WHERE ".
3976  "keyword IN (%s,%s) ".
3977  "AND usr_id = %s",
3978  array("text", "text", "integer"),
3979  array('public_upload', 'public_profile', $a_usr_id));
3980  while ($row = $ilDB->fetchAssoc($res))
3981  {
3982  switch ($row['keyword'])
3983  {
3984  case 'public_upload' :
3985  $upload = $row['value'] == 'y';
3986  break;
3987  case 'public_profile' :
3988  $profile = ($row['value'] == 'y' ||
3989  $row['value'] == 'g');
3990  break;
3991  }
3992  }
3993 
3994  // END DiskQuota: Fetch all user preferences in a single query
3995  $webspace_dir = "";
3996  if(defined('ILIAS_MODULE'))
3997  {
3998  $webspace_dir = ('.'.$webspace_dir);
3999  }
4000  $webspace_dir .= ('./'.ilUtil::getWebspaceDir());
4001 
4002  $image_dir = $webspace_dir."/usr_images";
4003  // BEGIN DiskQuota: Support 'big' user images
4004  if ($a_size == 'big')
4005  {
4006  $thumb_file = $image_dir."/usr_".$a_usr_id.".jpg";
4007  }
4008  else
4009  {
4010  $thumb_file = $image_dir."/usr_".$a_usr_id."_".$a_size.".jpg";
4011  }
4012  // END DiskQuota: Support 'big' user images
4013 
4014  if((($upload && $profile) || $a_force_pic)
4015  && @is_file($thumb_file))
4016  {
4017  $file = $thumb_file."?t=".rand(1, 99999);
4018  }
4019  else
4020  {
4021  if (!$a_prevent_no_photo_image)
4022  {
4023  // we only have xsmall and xxsmall for this
4024  if($a_size == "small" || $a_size == "big")
4025  {
4026  $a_size = "xsmall";
4027  }
4028  $file = ilUtil::getImagePath("no_photo_".$a_size.".jpg");
4029  }
4030  }
4031 
4032  return $file;
4033  }
print $file
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ 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 4745 of file class.ilObjUser.php.

References $prefs, $r, and $row.

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

4746  {
4747  global $ilDB;
4748 
4749  $prefs = array();
4750 
4751  $r = $ilDB->queryF("SELECT * FROM usr_pref WHERE usr_id = %s",
4752  array("integer"), array($user_id));
4753 
4754  while($row = $ilDB->fetchAssoc($r))
4755  {
4756  $prefs[$row["keyword"]] = $row["value"];
4757  }
4758 
4759  return $prefs;
4760  }
$r
+ 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 4697 of file class.ilObjUser.php.

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

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

4697  {
4698  global $ilDB;
4699 
4700  $ids = array();
4701  if (is_array($a_internalids)) {
4702  foreach ($a_internalids as $internalid) {
4703  if (is_numeric ($internalid))
4704  {
4705  $ids[] = $internalid;
4706  }
4707  else
4708  {
4709  $parsedid = ilUtil::__extractId($internalid, IL_INST_ID);
4710  if (is_numeric($parsedid) && $parsedid > 0)
4711  {
4712  $ids[] = $parsedid;
4713  }
4714  }
4715  }
4716  }
4717  if (count($ids) == 0)
4718  $ids [] = -1;
4719 
4720  $query = "SELECT usr_data.*, usr_pref.value AS language
4721  FROM usr_data
4722  LEFT JOIN usr_pref
4723  ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
4724  WHERE ".$ilDB->in("usr_data.usr_id", $ids, false, "integer");
4725  $values[] = "language";
4726  $types[] = "text";
4727 
4728  $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
4729 
4730  $data = array();
4731  $result = $ilDB->queryF($query, $types, $values);
4732  while ($row = $ilDB->fetchAssoc($result))
4733  {
4734  $data[] = $row;
4735  }
4736  return $data;
4737  }
$result
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
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 2654 of file class.ilObjUser.php.

References $ilias, $res, and $row.

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

2655  {
2656  global $ilias, $ilDB;
2657 
2658  $res = $ilDB->queryF("SELECT login FROM usr_data ".
2659  "WHERE email = %s and active = 1",
2660  array("text"),
2661  array($a_email));
2662  $ids = array ();
2663  while($row = $ilDB->fetchObject($res))
2664  {
2665  $ids[] = $row->login;
2666  }
2667 
2668  return $ids;
2669  }
+ 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 $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
+ 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 $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilCronDeleteInactiveUserAccounts\run().

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";
5153 
5154  $res = $ilDB->queryF($query, array('timestamp'), array($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
+ 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 3583 of file class.ilObjUser.php.

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

3584  {
3585  global $ilDB;
3586 
3587  $q = "SELECT DISTINCT user_id FROM personal_clipboard WHERE ".
3588  "item_id = ".$ilDB->quote($a_id, "integer")." AND ".
3589  "type = ".$ilDB->quote($a_type, "text");
3590  $user_set = $ilDB->query($q);
3591  $users = array();
3592  while ($user_rec = $ilDB->fetchAssoc($user_set))
3593  {
3594  $users[] = $user_rec["user_id"];
3595  }
3596 
3597  return $users;
3598  }
+ 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 4590 of file class.ilObjUser.php.

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

Referenced by ilSoapUserAdministration\getUsersForContainer().

4590  {
4591  global $ilDB;
4592  $data = array();
4593  $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 ";
4594  $types[] = "text";
4595  $values[] = "language";
4596 
4597  if (is_numeric($active) && $active > -1)
4598  {
4599  $query .= " AND usr_data.active = %s";
4600  $values[] = $active;
4601  $types[] = "integer";
4602  }
4603 
4604  if ($ref_id != USER_FOLDER_ID)
4605  {
4606  $query.= " AND usr_data.time_limit_owner = %s";
4607  $values[] = $ref_id;
4608  $types[] = "integer";
4609  }
4610 
4611  $query .= " AND usr_data.usr_id != %s ";
4612  $values[] = ANONYMOUS_USER_ID;
4613  $types[] = "integer";
4614 
4615  $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
4616 
4617  $result = $ilDB->queryF($query, $types, $values);
4618  $data = array();
4619  while ($row = $ilDB->fetchAssoc($result))
4620  {
4621  array_push($data, $row);
4622  }
4623 
4624  return $data;
4625  }
$result
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
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 4633 of file class.ilObjUser.php.

References _getUsersForIds().

Referenced by ilSoapUserAdministration\getUsersForContainer().

4634  {
4635  return ilObjUser::_getUsersForIds($a_mem_ids, $active);
4636  }
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 4644 of file class.ilObjUser.php.

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

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

4645  {
4646  global $rbacadmin, $rbacreview, $ilDB;
4647 
4648  // quote all ids
4649  $ids = array();
4650  foreach ($a_mem_ids as $mem_id) {
4651  $ids [] = $ilDB->quote($mem_id);
4652  }
4653 
4654  $query = "SELECT usr_data.*, usr_pref.value AS language
4655  FROM usr_data
4656  LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
4657  WHERE ".$ilDB->in("usr_data.usr_id", $ids, false, "integer")."
4658  AND usr_data.usr_id != %s";
4659  $values[] = "language";
4660  $types[] = "text";
4661  $values[] = ANONYMOUS_USER_ID;
4662  $types[] = "integer";
4663 
4664  if (is_numeric($active) && $active > -1)
4665  {
4666  $query .= " AND active = %s";
4667  $values[] = $active;
4668  $types[] = "integer";
4669  }
4670 
4671  if ($timelimitowner != USER_FOLDER_ID && $timelimitowner != -1)
4672  {
4673  $query.= " AND usr_data.time_limit_owner = %s";
4674  $values[] = $timelimitowner;
4675  $types[] = "integer";
4676 
4677  }
4678 
4679  $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
4680 
4681  $result = $ilDB->queryF($query, $types, $values);
4682  while ($row = $ilDB->fetchAssoc($result))
4683  {
4684  $mem_arr[] = $row;
4685  }
4686 
4687  return $mem_arr ? $mem_arr : array();
4688  }
$result
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 4547 of file class.ilObjUser.php.

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

Referenced by ilSoapUserAdministration\getUserForRole().

4547  {
4548  global $ilDB, $rbacreview;
4549  $data = array();
4550 
4551  $ids = $rbacreview->assignedUsers($role_id);
4552 
4553  if (count ($ids) == 0)
4554  {
4555  $ids = array (-1);
4556  }
4557 
4558  $query = "SELECT usr_data.*, usr_pref.value AS language
4559  FROM usr_data
4560  LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
4561  WHERE ".$ilDB->in("usr_data.usr_id", $ids, false, "integer");
4562  $values[] = "language";
4563  $types[] = "text";
4564 
4565 
4566  if (is_numeric($active) && $active > -1)
4567  {
4568  $query .= " AND usr_data.active = %s";
4569  $values[] = $active;
4570  $types[] = "integer";
4571  }
4572 
4573  $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
4574 
4575  $r = $ilDB->queryF($query, $types, $values);
4576  $data = array();
4577  while ($row = $ilDB->fetchAssoc($r))
4578  {
4579  $data[] = $row;
4580  }
4581  return $data;
4582  }
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
$r
+ Here is the caller graph for this function:

◆ _incrementLoginAttempts()

static ilObjUser::_incrementLoginAttempts (   $a_usr_id)
static

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

References $query.

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

4787  {
4788  global $ilDB;
4789 
4790  $query = "UPDATE usr_data SET login_attempts = (login_attempts + 1) WHERE usr_id = %s";
4791  $affected = $ilDB->manipulateF( $query, array('integer'), array($a_usr_id) );
4792 
4793  if($affected) return true;
4794  else return false;
4795  }
+ 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 3199 of file class.ilObjUser.php.

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

3200  {
3201  global $ilDB;
3202 
3203  if (self::$is_desktop_item_loaded[$a_usr_id.":".$a_item_id])
3204  {
3205  return self::$is_desktop_item_cache[$a_usr_id.":".$a_item_id.":".$a_type];
3206  }
3207  $item_set = $ilDB->queryF("SELECT item_id FROM desktop_item WHERE ".
3208  "item_id = %s AND type = %s AND user_id = %s",
3209  array("integer", "text", "integer"),
3210  array($a_item_id, $a_type, $a_usr_id));
3211 
3212  if ($ilDB->fetchAssoc($item_set))
3213  {
3214  return true;
3215  }
3216  else
3217  {
3218  return false;
3219  }
3220  }
+ 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 4494 of file class.ilObjUser.php.

References $r, and $row.

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

4495  {
4496  global $ilDB;
4497 
4498  $q = "SELECT DISTINCT login, usr_id FROM usr_data ".
4499  "WHERE login = %s";
4500  $types[] = "text";
4501  $values[] = $a_login;
4502 
4503  if ($a_user_id != 0)
4504  {
4505  $q.= " AND usr_id != %s ";
4506  $types[] = "integer";
4507  $values[] = $a_user_id;
4508  }
4509 
4510  $r = $ilDB->queryF($q, $types, $values);
4511 
4512  if ($row = $ilDB->fetchAssoc($r))
4513  {
4514  return $row['usr_id'];
4515  }
4516  return false;
4517  }
$r
+ Here is the caller graph for this function:

◆ _lookup()

ilObjUser::_lookup (   $a_user_id,
  $a_field 
)
private

Private function for lookup methods.

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

References $res.

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

641  {
642  global $ilDB;
643 
644  $res = $ilDB->queryF("SELECT ".$a_field." FROM usr_data WHERE usr_id = %s",
645  array("integer"), array($a_user_id));
646 
647  while($set = $ilDB->fetchAssoc($res))
648  {
649  return $set[$a_field];
650  }
651  return false;
652  }
+ Here is the caller graph for this function:

◆ _lookupActive()

ilObjUser::_lookupActive (   $a_usr_id)

Check user account active.

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

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

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

2233  {
2234  global $ilDB;
2235 
2236  $query = 'SELECT usr_id FROM usr_data '.
2237  'WHERE active = '.$ilDB->quote(1,'integer').' '.
2238  'AND usr_id = '.$ilDB->quote($a_usr_id,'integer');
2239  $res = $ilDB->query($query);
2240  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
2241  {
2242  return true;
2243  }
2244  return false;
2245  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ 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 3792 of file class.ilObjUser.php.

References _lookup().

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

3793  {
3794  return (string) ilObjUser::_lookup($a_usr_id, "auth_mode");
3795  }
_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 713 of file class.ilObjUser.php.

References _lookup().

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

714  {
715  return ilObjUser::_lookup($a_user_id, "client_ip");
716  }
_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 3283 of file class.ilObjUser.php.

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

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

3284  {
3285  global $ilUser, $rbacsystem, $tree, $ilDB;
3286 
3287  if ($a_types == "")
3288  {
3289  $is_nested_set = ($tree->getTreeImplementation() instanceof ilNestedSetTree);
3290 
3291  $item_set = $ilDB->queryF("SELECT obj.obj_id, obj.description, oref.ref_id, obj.title, obj.type ".
3292  " FROM desktop_item it, object_reference oref ".
3293  ", object_data obj".
3294  " WHERE ".
3295  "it.item_id = oref.ref_id AND ".
3296  "oref.obj_id = obj.obj_id AND ".
3297  "it.user_id = %s", array("integer"), array($user_id));
3298  $items = $all_parent_path = array();
3299  while ($item_rec = $ilDB->fetchAssoc($item_set))
3300  {
3301  if ($tree->isInTree($item_rec["ref_id"])
3302  && $item_rec["type"] != "rolf"
3303  && $item_rec["type"] != "itgr") // due to bug 11508
3304  {
3305  $parent_ref = $tree->getParentId($item_rec["ref_id"]);
3306 
3307  if(!isset($all_parent_path[$parent_ref]))
3308  {
3309  // #15746
3310  if($is_nested_set)
3311  {
3312  $par_left = $tree->getLeftValue($parent_ref);
3313  $all_parent_path[$parent_ref] = sprintf("%010d", $par_left);
3314  }
3315  else
3316  {
3317  $node = $tree->getNodeData($parent_ref);
3318  $all_parent_path[$parent_ref] = $node["path"];
3319  }
3320  }
3321 
3322  $parent_path = $all_parent_path[$parent_ref];
3323 
3324  $title = ilObject::_lookupTitle($item_rec["obj_id"]);
3325  $desc = ilObject::_lookupDescription($item_rec["obj_id"]);
3326  $items[$parent_path.$title.$item_rec["ref_id"]] =
3327  array("ref_id" => $item_rec["ref_id"],
3328  "obj_id" => $item_rec["obj_id"],
3329  "type" => $item_rec["type"],
3330  "title" => $title,
3331  "description" => $desc,
3332  "parent_ref" => $parent_ref);
3333  }
3334  }
3335  ksort($items);
3336  }
3337  else
3338  {
3339  // due to bug 11508
3340  if (!is_array($a_types))
3341  {
3342  $a_types = array($a_types);
3343  }
3344  $items = array();
3345  $foundsurveys = array();
3346  foreach($a_types as $a_type)
3347  {
3348  if ($a_type == "itgr")
3349  {
3350  continue;
3351  }
3352  $item_set = $ilDB->queryF("SELECT obj.obj_id, obj.description, oref.ref_id, obj.title FROM desktop_item it, object_reference oref ".
3353  ", object_data obj WHERE ".
3354  "it.item_id = oref.ref_id AND ".
3355  "oref.obj_id = obj.obj_id AND ".
3356  "it.type = %s AND ".
3357  "it.user_id = %s ".
3358  "ORDER BY title",
3359  array("text", "integer"),
3360  array($a_type, $user_id));
3361 
3362  while ($item_rec = $ilDB->fetchAssoc($item_set))
3363  {
3364  $title = ilObject::_lookupTitle($item_rec["obj_id"]);
3365  $desc = ilObject::_lookupDescription($item_rec["obj_id"]);
3366  $items[$title.$a_type.$item_rec["ref_id"]] =
3367  array("ref_id" => $item_rec["ref_id"],
3368  "obj_id" => $item_rec["obj_id"], "type" => $a_type,
3369  "title" => $title, "description" => $desc);
3370  }
3371 
3372  }
3373  ksort($items);
3374  }
3375 
3376  return $items;
3377  }
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
+ 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 762 of file class.ilObjUser.php.

References _lookup().

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

763  {
764  return ilObjUser::_lookup($a_user_id, "ext_account");
765  }
_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 4427 of file class.ilObjUser.php.

Referenced by ilUserFeedWriter\ilUserFeedWriter().

4428  {
4429  global $ilDB;
4430 
4431  if ($a_user_id > 0)
4432  {
4433  $set = $ilDB->queryF("SELECT feed_hash from usr_data WHERE usr_id = %s",
4434  array("integer"), array($a_user_id));
4435  if ($rec = $ilDB->fetchAssoc($set))
4436  {
4437  if (strlen($rec["feed_hash"]) == 32)
4438  {
4439  return $rec["feed_hash"];
4440  }
4441  else if($a_create)
4442  {
4443  $hash = md5(rand(1,9999999) + str_replace(" ", "", (string) microtime()));
4444  $ilDB->manipulateF("UPDATE usr_data SET feed_hash = %s".
4445  " WHERE usr_id = %s",
4446  array("text", "integer"),
4447  array($hash, $a_user_id));
4448  return $hash;
4449  }
4450  }
4451  }
4452 
4453  return false;
4454  }
+ 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 741 of file class.ilObjUser.php.

References $res.

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

742  {
743  global $ilDB;
744 
745  $res = $ilDB->queryF("SELECT * FROM usr_data WHERE usr_id = %s",
746  array("integer"), array($a_user_id));
747  $user_rec = $ilDB->fetchAssoc($res);
748  return $user_rec;
749  }
+ Here is the caller graph for this function:

◆ _lookupFullname()

ilObjUser::_lookupFullname (   $a_user_id)

Lookup Full Name.

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

References $fullname.

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

658  {
659  global $ilDB;
660 
661  $set = $ilDB->queryF("SELECT title, firstname, lastname FROM usr_data WHERE usr_id = %s",
662  array("integer"), array($a_user_id));
663 
664  if ($rec = $ilDB->fetchAssoc($set))
665  {
666  if ($rec["title"])
667  {
668  $fullname = $rec["title"]." ";
669  }
670  if ($rec["firstname"])
671  {
672  $fullname .= $rec["firstname"]." ";
673  }
674  if ($rec["lastname"])
675  {
676  $fullname .= $rec["lastname"];
677  }
678  }
679  return $fullname;
680  }
+ Here is the caller graph for this function:

◆ _lookupGender()

static ilObjUser::_lookupGender (   $a_user_id)
static

Lookup gender.

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

References _lookup().

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

703  {
704  return ilObjUser::_lookup($a_user_id, "gender");
705  }
_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 770 of file class.ilObjUser.php.

References $res.

Referenced by ilDiskQuotaSummaryNotification\__construct(), ilMail\__getCountRecipient(), ilMail\__getEmailRecipients(), ilObjUserGUI\_goto(), ilShopUtils\_sendNotificationToVATAdministration(), ilSoapObjectAdministration\addObject(), ilOrgUnitStaffGUI\addOtherRoles(), ilOrgUnitStaffGUI\addStaff(), ilRepositorySearchGUI\addUserFromAutoComplete(), ilObjBlogGUI\addUserFromAutoComplete(), ilObjExerciseGUI\addUserFromAutoCompleteObject(), ilSkillProfileGUI\assignUser(), ilOrgUnitSimpleUserImport\buildUserId(), ilChatroomInviteUsersToPrivateRoomTask\byLogin(), ilPermission2GUI\changeOwner(), ilMailAddressbookGUI\checkInput(), checkUserId(), ilOpenIdAttributeToUser\create(), ilAuthBase\failedLoginObserver(), ilMail\formatNamesForOutput(), getUserIdByLogin(), ilMail\getUserIds(), ilSessionControl\handleLoginEvent(), ilObjectStatusGUI\ilObjectStatusGUI(), ilChatroom\inviteUserToPrivateRoomByLogin(), ilAuthContainerMDB2\loginObserver(), ilStartUpGUI\migrateAccount(), ilSoapRBACAdministration\parseUserID(), ilStartUpGUI\processCode(), ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus(), ilDataCollectionRecordEditGUI\save(), ilObjSurveyGUI\savePropertiesObject(), ilDiskQuotaSummaryNotification\send(), ilRegistrationSettings\setApproveRecipientLogins(), ilObjDiskQuotaSettings\setSummaryRecipients(), ilMailSearchGUI\showResults(), ilObjUserTest\testCreateSetLookupDelete(), ilLDAPAttributeToUser\usersToXML(), ilRegistrationSettings\validate(), and ilUserImportParser\verifyEndTag().

771  {
772  global $ilDB;
773 
774  $res = $ilDB->queryF("SELECT usr_id FROM usr_data WHERE login = %s",
775  array("text"), array($a_user_str));
776  $user_rec = $ilDB->fetchAssoc($res);
777  return $user_rec["usr_id"];
778  }
+ Here is the caller graph for this function:

◆ _lookupIm()

ilObjUser::_lookupIm (   $a_user_id,
  $a_type 
)

Lookup IM.

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

References _lookup().

Referenced by ilUsersOnlineBlockGUI\fillRow().

686  {
687  return ilObjUser::_lookup($a_user_id, "im_".$a_type);
688  }
_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 2033 of file class.ilObjUser.php.

References $r, and $row.

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

2034  {
2035  global $ilDB;
2036 
2037  $q = "SELECT value FROM usr_pref WHERE usr_id= ".
2038  $ilDB->quote($a_usr_id, "integer")." AND keyword = ".
2039  $ilDB->quote('language', "text");
2040  $r = $ilDB->query($q);
2041 
2042  while($row = $ilDB->fetchAssoc($r))
2043  {
2044  return $row['value'];
2045  }
2046  return 'en';
2047  }
$r
+ Here is the caller graph for this function:

◆ _lookupLastLogin()

ilObjUser::_lookupLastLogin (   $a_user_id)

lookup last login

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

References _lookup().

Referenced by ilObjUserTest\testCreateSetLookupDelete().

784  {
785  return ilObjUser::_lookup($a_user_id, "last_login");
786  }
_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()

ilObjUser::_lookupLogin (   $a_user_id)

lookup login

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

References _lookup().

Referenced by ilCourseXMLParser\__parseId(), ilRegistrationSettings\__read(), ilPaymentStatisticGUI\addStatisticWorksheet(), ilObjPaymentSettingsGUI\addStatisticWorksheet(), ilMailSearchGroupsGUI\adoptMembers(), ilMailSearchCoursesGUI\adoptMembers(), ilLMStatistics\calcStats(), ilObjUserGUI\editOldObject(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilPageHistoryTableGUI\fillRow(), ilMilestoneResponsiblesTableGUI\fillRow(), ilHistoryGUI\getHistoryTable(), ilAttendanceList\getHTML(), ilDAVServer\getLogin(), getLoginByUserId(), ilConsultationHourAppointments\getManagedUsers(), ilConsultationHourAppointments\getManager(), ilNoteGUI\getNoteListHTML(), ilTestServiceGUI\getResultsHeadUserAndPass(), ilTestServiceGUI\getResultsUserdata(), ilObjSCORM2004LearningModule\getTrackedUsers(), ilObjSurvey\getUserDataFromActiveId(), ilObjForumGUI\getUserNotificationTableData(), ilObjUserGUI\getValues(), ilCalendarAppointmentGUI\initForm(), ilSessionOverviewGUI\listSessions(), ilAuthContainerSOAP\loginObserver(), ilMailSearchGroupsGUI\mailMembers(), ilMailSearchCoursesGUI\mailMembers(), ilPermission2GUI\owner(), ilCalendarSharedUserListTableGUI\parse(), ilSessionParticipantsTableGUI\parse(), ilObjGroupGUI\readMemberData(), ilObjCourseGUI\readMemberData(), ilCalendarEntry\readResponsibleUsers(), ilObjExerciseGUI\redirectFeedbackMailObject(), ilMailSummaryNotification\send(), ilForum\sendForumNotifications(), ilMembershipCronNotifications\sendMail(), ilMailNotification\sendMail(), ilForumCronNotification\sendMails(), ilObjCourseGUI\sendMailToSelectedUsersObject(), ilObjGroupGUI\sendMailToSelectedUsersObject(), ilObjDataCollection\sendNotification(), ilWikiUtil\sendNotification(), ilForum\sendPostActivationNotification(), ilForum\sendThreadNotifications(), ilObjSurvey\sendTutorNotification(), ilObjSurvey\sentReminder(), ilPaymentCouponGUI\showCoupons(), ilMailSearchCoursesGUI\showMembers(), ilMailSearchGUI\showResults(), ilPaymentStatisticGUI\showStatistics(), ilMailFolderGUI\showUser(), ilObjPaymentSettingsGUI\statisticObject(), ilObjUserTest\testCreateSetLookupDelete(), and ilUserImportParser\verifyEndTag().

755  {
756  return ilObjUser::_lookup($a_user_id, "login");
757  }
_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 724 of file class.ilObjUser.php.

References $res.

Referenced by ilExGradesTableGUI\__construct(), ilExParticipantTableGUI\__construct(), ilGroupXMLParser\__parseId(), ilObjTestAccess\_getParticipantData(), ilObjPaymentSettingsGUI\addStatisticWorksheet(), ilMailSearchGroupsGUI\adoptMembers(), ilMailSearchCoursesGUI\adoptMembers(), ilOrgUnitStaffGUI\confirmRemoveUser(), ilSkillProfileGUI\confirmUserRemoval(), ilObjCourseGUI\deleteMembersObject(), ilObjTestGUI\deleteSingleUserResultsObject(), ilLocalUserGUI\deleteUsersObject(), ilObjCategoryGUI\deleteUsersObject(), ilExAssignment\deliverReturnedFiles(), ilFileDataExercise\downloadAllDeliveredFiles(), ilExAssignment\downloadAllDeliveredFiles(), ilObjPortfolioGUI\downloadExcSubFile(), ilObjBlogGUI\downloadExcSubFile(), ilExAssignment\downloadMultipleFiles(), ilExAssignment\downloadSelectedFiles(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilObjExercise\exportGradesExcel(), ilObjAssessmentFolderGUI\exportLogObject(), ilPageHistoryTableGUI\fillRow(), ilAssessmentFolderLogTableGUI\fillRow(), ilCalendarInboxSharedTableGUI\fillRow(), ilFileVersionTableGUI\fillRow(), ilObjSurvey\getAppraiseesData(), ilSkillProfile\getAssignedUsers(), ilHistoryGUI\getHistoryTable(), ilAttendanceList\getHTML(), ilExAssignment\getMultiFeedbackFiles(), ilPageObject\getPageContributors(), ilPageObject\getParentObjectContributors(), ilMilestoneResponsiblesTableGUI\getParticipantsAndResponsibles(), ilObjSurvey\getRatersData(), ilMail\getSalutation(), ilDataCollectionRecord\getStandardField(), ilObjSCORM2004LearningModule\getTrackedUsers(), ilObjForumGUI\getUserNotificationTableData(), ilHistoryGUI\getVersionsTable(), ilWorkspaceShareTableGUI\importData(), ilWorkspaceShareTableGUI\initFilter(), ilObjSurveyGUI\initPropertiesForm(), ilSessionOverviewGUI\listSessions(), ilAuthContainerCalendarToken\loginObserver(), ilTestEvaluationGUI\outParticipantsResultsOverview(), ilCalendarSharedUserListTableGUI\parse(), ilCalendarSharedListTableGUI\parse(), ilSessionParticipantsTableGUI\parse(), ilConsultationHoursTableGUI\parse(), ilCourseParticipantsTableGUI\parse(), ilObjGroupGUI\readMemberData(), ilObjCourseGUI\readMemberData(), ilCalendarEntry\readResponsibleUsers(), ilObjPortfolioBaseGUI\renderFullscreenHeader(), ilObjBlogGUI\renderFullscreenHeader(), ilObjExerciseGUI\saveStatusObject(), ilExAssignment\sendMultiFeedbackStructureFile(), ilMailSearchCoursesGUI\showMembers(), ilObjExerciseGUI\showParticipantObject(), ilMailSearchGUI\showResults(), ilCourseContentGUI\showUserTimings(), ilObjPaymentSettingsGUI\statisticObject(), ilObjUserTest\testCreateSetLookupDelete(), ilObjTest\userLookupFullName(), and ilMailNotification\userToString().

725  {
726  global $ilDB;
727 
728  $res = $ilDB->queryF("SELECT firstname, lastname, title, login FROM usr_data WHERE usr_id = %s",
729  array("integer"), array($a_user_id));
730  $user_rec = $ilDB->fetchAssoc($res);
731  return array("user_id" => $a_user_id,
732  "firstname" => $user_rec["firstname"],
733  "lastname" => $user_rec["lastname"],
734  "title" => $user_rec["title"],
735  "login" => $user_rec["login"]);
736  }
+ Here is the caller graph for this function:

◆ _lookupPref()

ilObjUser::_lookupPref (   $a_usr_id,
  $a_keyword 
)

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

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

Referenced by _getFeedPass(), ilNewsItem\_getNewsItemsOfUser(), ilMailSearchGroupsGUI\adoptMembers(), ilMailSearchCoursesGUI\adoptMembers(), ilMailFolderGUI\cancelDeleteMails(), ilWebAccessChecker\checkAccessUserImage(), ilUsersOnlineBlockGUI\fillRow(), ilMail\formatNamesForOutput(), ilUserUtil\getProfileLink(), ilUsersOnlineBlockGUI\getUsers(), ilMailSearchGroupsGUI\showMembers(), ilMailSearchCoursesGUI\showMembers(), ilMailSearchGUI\showResults(), and ilObjUserTest\testCreateSetLookupDelete().

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

◆ _makeIlias2Password()

static ilObjUser::_makeIlias2Password (   $a_passwd)
static

get encrypted Ilias 2 password (needed for imported ilias 2 users)

Todo:
: Remove this? Alex, Stefan?

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

939  {
940  return (crypt($a_passwd,substr($a_passwd,0,2)));
941  }

◆ _moveUsersToStyle()

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

skins and styles

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

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

3046  {
3047  global $ilDB;
3048 
3049  $q = "SELECT up1.usr_id usr_id FROM usr_pref up1, usr_pref up2 ".
3050  " WHERE up1.keyword= ".$ilDB->quote("style", "text").
3051  " AND up1.value= ".$ilDB->quote($a_from_style, "text").
3052  " AND up2.keyword= ".$ilDB->quote("skin", "text").
3053  " AND up2.value= ".$ilDB->quote($a_from_skin, "text").
3054  " AND up1.usr_id = up2.usr_id ";
3055 
3056  $usr_set = $ilDB->query($q);
3057 
3058  while ($usr_rec = $ilDB->fetchAssoc($usr_set))
3059  {
3060  self::_writePref($usr_rec["usr_id"], "skin", $a_to_skin);
3061  self::_writePref($usr_rec["usr_id"], "style", $a_to_style);
3062  }
3063  }
+ 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 2868 of file class.ilObjUser.php.

References $res, and $row.

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

2869  {
2870  global $ilDB;
2871  $res = $ilDB->query("SELECT * FROM usr_data WHERE ".
2872  $ilDB->in("usr_id", $a_user_ids, false, "integer"));
2873  while ($row = $ilDB->fetchAssoc($res))
2874  {
2875  $user_data["$row[usr_id]"] = $row;
2876  }
2877  return $user_data ? $user_data : array();
2878  }
+ 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 3167 of file class.ilObjUser.php.

References $r, and $row.

Referenced by ilUtil\removeItemFromDesktops().

3168  {
3169  global $ilDB;
3170 
3171  $r = $ilDB->queryF("SELECT user_id FROM desktop_item WHERE item_id = %s",
3172  array("integer"), array($a_id));
3173 
3174  $users = array();
3175 
3176  while ($row = $ilDB->fetchObject($r))
3177  {
3178  $users[] = $row->user_id;
3179  } // while
3180 
3181  if (count($users) > 0)
3182  {
3183  $ilDB->manipulateF("DELETE FROM desktop_item WHERE item_id = %s",
3184  array("integer"), array($a_id));
3185  }
3186 
3187  return $users;
3188  }
$r
+ Here is the caller graph for this function:

◆ _resetLoginAttempts()

static ilObjUser::_resetLoginAttempts (   $a_usr_id)
static

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

References $query.

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

4764  {
4765  global $ilDB;
4766 
4767  $query = "UPDATE usr_data SET login_attempts = 0 WHERE usr_id = %s";
4768  $affected = $ilDB->manipulateF( $query, array('integer'), array($a_usr_id) );
4769 
4770  if($affected) return true;
4771  else return false;
4772  }
+ 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 4477 of file class.ilObjUser.php.

4478  {
4479  global $ilDB;
4480 
4481  self::_writePref($a_user_id, "priv_feed_pass",
4482  ($a_password=="") ? "" : md5($a_password));
4483  }

◆ _setUserInactive()

static ilObjUser::_setUserInactive (   $a_usr_id)
static

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

References $query, and ilUtil\now().

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

4798  {
4799  global $ilDB;
4800 
4801  $query = "UPDATE usr_data SET active = 0, inactivation_date = %s WHERE usr_id = %s";
4802  $affected = $ilDB->manipulateF( $query, array('timestamp', 'integer'), array(ilUtil::now(), $a_usr_id) );
4803 
4804  if($affected) return true;
4805  else return false;
4806  }
static now()
Return current timestamp in Y-m-d H:i:s format.
+ 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 3748 of file class.ilObjUser.php.

References ilUtil\now().

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

3749  {
3750  global $ilDB;
3751 
3752  if(!is_array($a_usr_ids))
3753  {
3754  return false;
3755  }
3756 
3757 
3758  if( $a_status )
3759  {
3760  $q = "UPDATE usr_data SET active = 1, inactivation_date = NULL WHERE ".
3761  $ilDB->in("usr_id", $a_usr_ids, false, "integer");
3762  $ilDB->manipulate($q);
3763  }
3764  else
3765  {
3766  $usrId_IN_usrIds = $ilDB->in("usr_id", $a_usr_ids, false, "integer");
3767 
3768  $q = "UPDATE usr_data SET active = 0 WHERE $usrId_IN_usrIds";
3769  $ilDB->manipulate($q);
3770 
3771  $queryString = "
3772  UPDATE usr_data
3773  SET inactivation_date = %s
3774  WHERE inactivation_date IS NULL
3775  AND $usrId_IN_usrIds
3776  ";
3777  $ilDB->manipulateF($queryString, array('timestamp'), array(ilUtil::now()));
3778  }
3779 
3780  return true;
3781  }
static now()
Return current timestamp in Y-m-d H:i:s format.
+ 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 $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  }
+ 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 3912 of file class.ilObjUser.php.

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

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

3913  {
3914  $webspace_dir = ilUtil::getWebspaceDir();
3915  $image_dir = $webspace_dir."/usr_images";
3916  $store_file = "usr_".$obj_id."."."jpg";
3917  $target_file = $image_dir."/$store_file";
3918 
3919  chmod($tmp_file, 0770);
3920 
3921  // take quality 100 to avoid jpeg artefacts when uploading jpeg files
3922  // taking only frame [0] to avoid problems with animated gifs
3923  $show_file = "$image_dir/usr_".$obj_id.".jpg";
3924  $thumb_file = "$image_dir/usr_".$obj_id."_small.jpg";
3925  $xthumb_file = "$image_dir/usr_".$obj_id."_xsmall.jpg";
3926  $xxthumb_file = "$image_dir/usr_".$obj_id."_xxsmall.jpg";
3927 
3928  ilUtil::execConvert($tmp_file . "[0] -geometry 200x200 -quality 100 JPEG:".$show_file);
3929  ilUtil::execConvert($tmp_file . "[0] -geometry 100x100 -quality 100 JPEG:".$thumb_file);
3930  ilUtil::execConvert($tmp_file . "[0] -geometry 75x75 -quality 100 JPEG:".$xthumb_file);
3931  ilUtil::execConvert($tmp_file . "[0] -geometry 30x30 -quality 100 JPEG:".$xxthumb_file);
3932 
3933  // store filename
3934  self::_writePref($obj_id, "profile_image", $store_file);
3935 
3936  return TRUE;
3937  }
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 $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.
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 2072 of file class.ilObjUser.php.

Referenced by ilAuthContainerSOAP\loginObserver(), and ilObjUserTest\testAuthAndEmailMethods().

2073  {
2074  global $ilDB;
2075 
2076  $ilDB->manipulateF("UPDATE usr_data ".
2077  " SET auth_mode = %s WHERE usr_id = %s",
2078  array("text", "integer"),
2079  array($a_auth_mode, $a_usr_id));
2080  }
+ Here is the caller graph for this function:

◆ _writeExternalAccount()

ilObjUser::_writeExternalAccount (   $a_usr_id,
  $a_ext_id 
)

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

Referenced by ilAuthContainerSOAP\loginObserver(), and ilObjUserTest\testAuthAndEmailMethods().

2063  {
2064  global $ilDB;
2065 
2066  $ilDB->manipulateF("UPDATE usr_data ".
2067  " SET ext_account = %s WHERE usr_id = %s",
2068  array("text", "integer"),
2069  array($a_ext_id, $a_usr_id));
2070  }
+ Here is the caller graph for this function:

◆ _writeHistory()

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

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

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

Referenced by updateLogin().

4832  {
4833  global $ilDB;
4834 
4835  $timestamp = time();
4836 
4837  $res = $ilDB->queryF('SELECT * FROM loginname_history WHERE usr_id = %s AND login = %s AND history_date = %s',
4838  array('integer', 'text', 'integer'),
4839  array($a_usr_id, $a_login, $timestamp));
4840 
4841  if( $ilDB->numRows($res) == 0 )
4842  {
4843  $ilDB->manipulateF('
4844  INSERT INTO loginname_history
4845  (usr_id, login, history_date)
4846  VALUES (%s, %s, %s)',
4847  array('integer', 'text', 'integer'),
4848  array($a_usr_id, $a_login, $timestamp));
4849  }
4850 
4851  return true;
4852  }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ activateDeletionFlag()

ilObjUser::activateDeletionFlag ( )

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

References writePref().

5526  {
5527  $this->writePref("delete_flag", true);
5528  }
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 3103 of file class.ilObjUser.php.

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

3104  {
3105  ilObjUser::_addDesktopItem($this->getId(), $a_item_id, $a_type, $a_par);
3106  }
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 3392 of file class.ilObjUser.php.

References $d, and ilObject\getId().

3394  {
3395  global $ilDB;
3396 
3397  if ($a_time == 0)
3398  {
3399  $a_time = date("Y-m-d H:i:s", time());
3400  }
3401 
3402  $item_set = $ilDB->queryF("SELECT * FROM personal_clipboard WHERE ".
3403  "parent = %s AND item_id = %s AND type = %s AND user_id = %s",
3404  array("integer", "integer", "text", "integer"),
3405  array(0, $a_item_id, $a_type, $this->getId()));
3406 
3407  // only insert if item is not already in clipboard
3408  if (!$d = $item_set->fetchRow())
3409  {
3410  $ilDB->manipulateF("INSERT INTO personal_clipboard ".
3411  "(item_id, type, user_id, title, parent, insert_time, order_nr) VALUES ".
3412  " (%s,%s,%s,%s,%s,%s,%s)",
3413  array("integer", "text", "integer", "text", "integer", "timestamp", "integer"),
3414  array($a_item_id, $a_type, $this->getId(), $a_title, (int) $a_parent, $a_time, (int) $a_order_nr));
3415  }
3416  else
3417  {
3418  $ilDB->manipulateF("UPDATE personal_clipboard SET insert_time = %s ".
3419  "WHERE user_id = %s AND item_id = %s AND type = %s AND parent = 0",
3420  array("timestamp", "integer", "integer", "text"),
3421  array($a_time, $this->getId(), $a_item_id, $a_type));
3422  }
3423  }
getId()
get object id public
+ 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 3428 of file class.ilObjUser.php.

References ilObject\getId().

3429  {
3430  global $ilDB;
3431  if ($a_time == 0)
3432  {
3433  $a_time = date("Y-m-d H:i:s", time());
3434  }
3435  $ilDB->insert("personal_pc_clipboard", array(
3436  "user_id" => array("integer", $this->getId()),
3437  "content" => array("clob", $a_content),
3438  "insert_time" => array("timestamp", $a_time),
3439  "order_nr" => array("integer", $a_nr)
3440  ));
3441  }
getId()
get object id public
+ Here is the call graph for this function:

◆ addUserDefinedFieldEntry()

ilObjUser::addUserDefinedFieldEntry ( )

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

Referenced by saveAsNew().

4199  {
4200  global $ilDB;
4201 
4202 // not needed. no entry in udf_text/udf_clob means no value
4203 
4204 /* $query = "INSERT INTO udf_data (usr_id ) ".
4205  "VALUES( ".
4206  $ilDB->quote($this->getId(),'integer').
4207  ")";
4208  $res = $ilDB->manipulate($query);
4209 */
4210  return true;
4211  }
+ 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 289 of file class.ilObjUser.php.

References $ilErr, ilObject\$lng, 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(), setPhoneHome(), setPhoneMobile(), setPhoneOffice(), setProfileIncomplete(), setSelectedCountry(), setStreet(), setTimeLimitFrom(), setTimeLimitMessage(), setTimeLimitOwner(), setTimeLimitUnlimited(), setTimeLimitUntil(), setUTitle(), and setZipcode().

Referenced by read().

290  {
291  global $ilErr, $ilDB, $lng;
292 
293  // basic personal data
294  $this->setLogin($a_data["login"]);
295  if (! $a_data["passwd_type"])
296  {
297  $ilErr->raiseError("<b>Error: passwd_type missing in function assignData(). ".
298  $this->id."!</b><br />class: ".get_class($this)."<br />Script: "
299  .__FILE__."<br />Line: ".__LINE__, $ilErr->FATAL);
300  }
301  if ($a_data["passwd"] != "********" and strlen($a_data['passwd']))
302  {
303  $this->setPasswd($a_data["passwd"], $a_data["passwd_type"]);
304  }
305 
306  $this->setGender($a_data["gender"]);
307  $this->setUTitle($a_data["title"]);
308  $this->setFirstname($a_data["firstname"]);
309  $this->setLastname($a_data["lastname"]);
310  $this->setFullname();
311  if (!is_array($a_data['birthday']))
312  {
313  $this->setBirthday($a_data['birthday']);
314  }
315  else
316  {
317  $this->setBirthday(null);
318  }
319 
320  // address data
321  $this->setInstitution($a_data["institution"]);
322  $this->setDepartment($a_data["department"]);
323  $this->setStreet($a_data["street"]);
324  $this->setCity($a_data["city"]);
325  $this->setZipcode($a_data["zipcode"]);
326  $this->setCountry($a_data["country"]);
327  $this->setSelectedCountry($a_data["sel_country"]);
328  $this->setPhoneOffice($a_data["phone_office"]);
329  $this->setPhoneHome($a_data["phone_home"]);
330  $this->setPhoneMobile($a_data["phone_mobile"]);
331  $this->setFax($a_data["fax"]);
332  $this->setMatriculation($a_data["matriculation"]);
333  $this->setEmail($a_data["email"]);
334  $this->setHobby($a_data["hobby"]);
335  $this->setClientIP($a_data["client_ip"]);
336 
337  // instant messenger data
338  $this->setInstantMessengerId('icq',$a_data["im_icq"]);
339  $this->setInstantMessengerId('yahoo',$a_data["im_yahoo"]);
340  $this->setInstantMessengerId('msn',$a_data["im_msn"]);
341  $this->setInstantMessengerId('aim',$a_data["im_aim"]);
342  $this->setInstantMessengerId('skype',$a_data["im_skype"]);
343  $this->setInstantMessengerId('jabber',$a_data["im_jabber"]);
344  $this->setInstantMessengerId('voip',$a_data["im_voip"]);
345 
346  // other data
347  $this->setDelicious($a_data["delicious"]);
348  $this->setLatitude($a_data["latitude"]);
349  $this->setLongitude($a_data["longitude"]);
350  $this->setLocationZoom($a_data["loc_zoom"]);
351 
352  // system data
353  $this->setLastLogin($a_data["last_login"]);
354  $this->setLastUpdate($a_data["last_update"]);
355  $this->create_date = $a_data["create_date"];
356  $this->setComment($a_data["referral_comment"]);
357  $this->approve_date = $a_data["approve_date"];
358  $this->active = $a_data["active"];
359  $this->agree_date = $a_data["agree_date"];
360 
361  $this->setInactivationDate($a_data["inactivation_date"]);
362 
363  // time limitation
364  $this->setTimeLimitOwner($a_data["time_limit_owner"]);
365  $this->setTimeLimitUnlimited($a_data["time_limit_unlimited"]);
366  $this->setTimeLimitFrom($a_data["time_limit_from"]);
367  $this->setTimeLimitUntil($a_data["time_limit_until"]);
368  $this->setTimeLimitMessage($a_data['time_limit_message']);
369 
370  // user profile incomplete?
371  $this->setProfileIncomplete($a_data["profile_incomplete"]);
372 
373  //iLinc
374  //$this->setiLincData($a_data['ilinc_id'],$a_data['ilinc_login'],$a_data['ilinc_passwd']);
375 
376  //authentication
377  $this->setAuthMode($a_data['auth_mode']);
378  $this->setExternalAccount($a_data['ext_account']);
379 
380  $this->setIsSelfRegistered((bool)$a_data['is_self_registered']);
381  }
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
setUTitle($a_str)
set user title (note: don&#39;t mix up this method with setTitle() that is derived from ilObject and sets...
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:

◆ checkTimeLimit()

ilObjUser::checkTimeLimit ( )

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

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

2351  {
2352  if($this->getTimeLimitUnlimited())
2353  {
2354  return true;
2355  }
2356  if($this->getTimeLimitFrom() < time() and $this->getTimeLimitUntil() > time())
2357  {
2358  return true;
2359  }
2360  return false;
2361  }
+ Here is the call graph for this function:

◆ checkUserId()

ilObjUser::checkUserId ( )

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

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

2574  {
2575  global $ilAuth, $ilSetting;
2576 
2579  if ($id > 0)
2580  {
2581  return $id;
2582  }
2583  return false;
2584  }
$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 3502 of file class.ilObjUser.php.

References ilObject\getId().

Referenced by delete().

3503  {
3504  global $ilDB;
3505 
3506  $ilDB->manipulateF("DELETE FROM personal_clipboard WHERE ".
3507  "user_id = %s", array("integer"), array($this->getId()));
3508  }
getId()
get object id public
+ 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 3489 of file class.ilObjUser.php.

References ilObject\getId().

3490  {
3491  global $ilDB;
3492 
3493  $ilDB->manipulateF("DELETE FROM personal_clipboard WHERE ".
3494  "type = %s AND user_id = %s",
3495  array("text", "integer"),
3496  array($a_type, $this->getId()));
3497  }
getId()
get object id public
+ 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 3470 of file class.ilObjUser.php.

References ilObject\getId().

3471  {
3472  global $ilDB;
3473 
3474  $set = $ilDB->queryF("SELECT * FROM personal_clipboard WHERE ".
3475  "parent = %s AND type = %s AND user_id = %s",
3476  array("integer", "text", "integer"),
3477  array(0, $a_type, $this->getId()));
3478  if ($rec = $ilDB->fetchAssoc($set))
3479  {
3480  return true;
3481  }
3482 
3483  return false;
3484  }
getId()
get object id public
+ 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 4041 of file class.ilObjUser.php.

References ilUtil\getWebspaceDir().

Referenced by ilUserDataSet\getXmlRecord().

4042  {
4043  $a_dir = trim(str_replace("..", "", $a_dir));
4044  if ($a_dir == "" || !is_dir($a_dir))
4045  {
4046  return;
4047  }
4048 
4049  $webspace_dir = ilUtil::getWebspaceDir();
4050  $image_dir = $webspace_dir."/usr_images";
4051  $images = array(
4052  "upload_".$a_user_id."pic",
4053  "usr_".$a_user_id."."."jpg",
4054  "usr_".$a_user_id."_small.jpg",
4055  "usr_".$a_user_id."_xsmall.jpg",
4056  "usr_".$a_user_id."_xxsmall.jpg",
4057  "upload_".$a_user_id);
4058  foreach ($images as $image)
4059  {
4060  if (is_file($image_dir."/".$image))
4061  {
4062  copy($image_dir."/".$image, $a_dir."/".$image);
4063  }
4064  }
4065  }
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 1298 of file class.ilObjUser.php.

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

1299  {
1300  global $rbacadmin, $ilDB;
1301 
1302  // deassign from ldap groups
1303  include_once('Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php');
1305  $mapping->deleteUser($this->getId());
1306 
1307  // remove mailbox / update sent mails
1308  include_once ("Services/Mail/classes/class.ilMailbox.php");
1309  $mailbox = new ilMailbox($this->getId());
1310  $mailbox->delete();
1311  $mailbox->updateMailsOfDeletedUser($this->getLogin());
1312 
1313  // delete feed blocks on personal desktop
1314  include_once("./Services/Block/classes/class.ilCustomBlock.php");
1315  $costum_block = new ilCustomBlock();
1316  $costum_block->setContextObjId($this->getId());
1317  $costum_block->setContextObjType("user");
1318  $c_blocks = $costum_block->queryBlocksForContext();
1319  include_once("./Services/Feeds/classes/class.ilPDExternalFeedBlock.php");
1320  foreach($c_blocks as $c_block)
1321  {
1322  if ($c_block["type"] == "pdfeed")
1323  {
1324  $fb = new ilPDExternalFeedBlock($c_block["id"]);
1325  $fb->delete();
1326  }
1327  }
1328 
1329 
1330  // delete block settings
1331  include_once("./Services/Block/classes/class.ilBlockSetting.php");
1333 
1334  // delete user_account
1335  $ilDB->manipulateF("DELETE FROM usr_data WHERE usr_id = %s",
1336  array("integer"), array($this->getId()));
1337 
1338  // delete user_prefs
1339  ilObjUser::_deleteAllPref($this->getId());
1340 
1341  $this->removeUserPicture(false); // #8597
1342 
1343  // delete user_session
1344  include_once("./Services/Authentication/classes/class.ilSession.php");
1346 
1347  // remove user from rbac
1348  $rbacadmin->removeUser($this->getId());
1349 
1350  // remove bookmarks
1351  // TODO: move this to class.ilBookmarkFolder
1352  $q = "DELETE FROM bookmark_tree WHERE tree = ".
1353  $ilDB->quote($this->getId(), "integer");
1354  $ilDB->manipulate($q);
1355 
1356  $q = "DELETE FROM bookmark_data WHERE user_id = ".
1357  $ilDB->quote($this->getId(), "integer");
1358  $ilDB->manipulate($q);
1359 
1360  // DELETE FORUM ENTRIES (not complete in the moment)
1361  include_once './Modules/Forum/classes/class.ilObjForum.php';
1362  ilObjForum::_deleteUser($this->getId());
1363 
1364  // Delete link check notify entries
1365  include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
1367 
1368  // Delete crs entries
1369  include_once './Modules/Course/classes/class.ilObjCourse.php';
1370  ilObjCourse::_deleteUser($this->getId());
1371 
1372  // Delete user tracking
1373  include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
1375 
1376  include_once 'Modules/Session/classes/class.ilEventParticipants.php';
1378 
1379  // Delete Tracking data SCORM 2004 RTE
1380  include_once 'Modules/Scorm2004/classes/ilSCORM13Package.php';
1382 
1383  // Delete Tracking data SCORM 1.2 RTE
1384  include_once 'Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
1386 
1387  // remove all notifications
1388  include_once "./Services/Notification/classes/class.ilNotification.php";
1390 
1391  // remove portfolios
1392  include_once "./Modules/Portfolio/classes/class.ilObjPortfolio.php";
1394 
1395  // remove workspace
1396  include_once "./Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
1397  $tree = new ilWorkspaceTree($this->getId());
1398  $tree->cascadingDelete();
1399 
1400  // remove disk quota entries
1401  include_once "./Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
1403 
1404  // Delete user defined field entries
1406 
1407  // Delete clipboard entries
1408  $this->clipboardDeleteAll();
1409 
1410  // Reset owner
1411  $this->resetOwner();
1412 
1413  include_once 'Services/Contact/classes/class.ilAddressbook.php';
1414  ilAddressbook::onUserDeletion($this);
1415 
1416  // Trigger deleteUser Event
1417  global $ilAppEventHandler;
1418  $ilAppEventHandler->raise(
1419  'Services/User', 'deleteUser', array('usr_id' => $this->getId())
1420  );
1421 
1422  // delete object data
1423  parent::delete();
1424  return true;
1425  }
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.
_deleteAllPref($a_user_id)
Deletes a userpref value of the user from the database public.
static deleteUserPortfolios($a_user_id)
Delete all portfolio data for user.
_deleteUser($a_usr_id)
+ Here is the call 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 1095 of file class.ilObjUser.php.

References ilObject\getId().

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

◆ deleteUserDefinedFieldEntries()

ilObjUser::deleteUserDefinedFieldEntries ( )

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

References $data, 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().

4214  {
4215  global $ilDB;
4216 
4217  include_once("./Services/User/classes/class.ilUserDefinedData.php");
4219 
4220  // wrong place...
4221 /* $query = "DELETE FROM udf_data ".
4222  "WHERE usr_id = ".$ilDB->quote($this->getId(),'integer');
4223  $res = $ilDB->manipulate($query);*/
4224 
4225  return true;
4226  }
getId()
get object id public
static deleteEntriesOfUser($a_user_id)
Delete data of user.
+ 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 3156 of file class.ilObjUser.php.

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

Referenced by ilObjGroup\leaveGroup().

3157  {
3158  ilObjUser::_dropDesktopItem($this->getId(), $a_item_id, $a_type);
3159  }
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.3.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:

◆ getActive()

ilObjUser::getActive ( )

get user active state public

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

References $active.

2225  {
2226  return $this->active;
2227  }

◆ getAgreeDate()

ilObjUser::getAgreeDate ( )

get the date when the user accepted the user agreement public

Returns
string date of last update

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

References $agree_date.

2182  {
2183  return $this->agree_date;
2184  }

◆ getAppliedUsers()

& ilObjUser::getAppliedUsers ( )

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

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

2513  {
2514  $this->applied_users = array();
2515  $this->__readAppliedUsers($this->getId());
2516 
2517  return $this->applied_users ? $this->applied_users : array();
2518  }
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 2170 of file class.ilObjUser.php.

References $approve_date.

2171  {
2172  return $this->approve_date;
2173  }

◆ getAuthMode()

ilObjUser::getAuthMode (   $a_auth_key = false)

get auth mode public

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

References $auth_mode, and ilAuthUtils\_getAuthMode().

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

3665  {
3666  if (!$a_auth_key)
3667  {
3668  return $this->auth_mode;
3669  }
3670 
3671  include_once('./Services/Authentication/classes/class.ilAuthUtils.php');
3672  return ilAuthUtils::_getAuthMode($this->auth_mode);
3673  }
_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 saveAsNew(), and update().

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

◆ getCity()

ilObjUser::getCity ( )

get city public

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

References $city.

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

1736  {
1737  return $this->city;
1738  }
+ Here is the caller graph for this function:

◆ getClientIP()

ilObjUser::getClientIP ( )

get client ip number public

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

References $client_ip.

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

◆ getClipboardChilds()

ilObjUser::getClipboardChilds (   $a_parent,
  $a_insert_time 
)

Get childs of an item.

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

References $ilUser, and ilObject\_lookupTitle().

3554  {
3555  global $ilDB, $ilUser;
3556 
3557  $objs = $ilDB->queryF("SELECT * FROM personal_clipboard WHERE ".
3558  "user_id = %s AND parent = %s AND insert_time = %s ".
3559  " ORDER BY order_nr",
3560  array("integer", "integer", "timestamp"),
3561  array($ilUser->getId(), (int) $a_parent, $a_insert_time));
3562  $objects = array();
3563  while ($obj = $ilDB->fetchAssoc($objs))
3564  {
3565  if ($obj["type"] == "mob")
3566  {
3567  $obj["title"] = ilObject::_lookupTitle($obj["item_id"]);
3568  }
3569  $objects[] = array ("id" => $obj["item_id"],
3570  "type" => $obj["type"], "title" => $obj["title"]);
3571  }
3572  return $objects;
3573  }
static _lookupTitle($a_id)
lookup object title
global $ilUser
Definition: imgupload.php:15
+ 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 3513 of file class.ilObjUser.php.

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

3514  {
3515  global $ilDB;
3516 
3517  $par = "";
3518  if ($a_top_nodes_only)
3519  {
3520  $par = " AND parent = ".$ilDB->quote(0, "integer")." ";
3521  }
3522 
3523  $type_str = ($a_type != "")
3524  ? " AND type = ".$ilDB->quote($a_type, "text")." "
3525  : "";
3526  $q = "SELECT * FROM personal_clipboard WHERE ".
3527  "user_id = ".$ilDB->quote($this->getId(), "integer")." ".
3528  $type_str.$par.
3529  " ORDER BY order_nr";
3530  $objs = $ilDB->query($q);
3531  $objects = array();
3532  while ($obj = $ilDB->fetchAssoc($objs))
3533  {
3534  if ($obj["type"] == "mob")
3535  {
3536  $obj["title"] = ilObject::_lookupTitle($obj["item_id"]);
3537  }
3538  if ($obj["type"] == "incl")
3539  {
3540  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
3541  $obj["title"] = ilMediaPoolPage::lookupTitle($obj["item_id"]);
3542  }
3543  $objects[] = array ("id" => $obj["item_id"],
3544  "type" => $obj["type"], "title" => $obj["title"],
3545  "insert_time" => $obj["insert_time"]);
3546  }
3547  return $objects;
3548  }
static _lookupTitle($a_id)
lookup object title
static lookupTitle($a_page_id)
Lookup title.
getId()
get object id public
+ Here is the call graph for this function:

◆ getComment()

ilObjUser::getComment ( )

get referral comment public

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

References $referral_comment.

Referenced by deleteUserDefinedFieldEntries().

2150  {
2151  return $this->referral_comment;
2152  }
+ Here is the caller graph for this function:

◆ getCountry()

ilObjUser::getCountry ( )

Get country (free text)

public

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

References $country.

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

1776  {
1777  return $this->country;
1778  }
+ 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 2086 of file class.ilObjUser.php.

References $_SESSION.

2087  {
2088  return $_SESSION['lang'];
2089  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

◆ getDateFormat()

ilObjUser::getDateFormat ( )

get date format

public

Returns

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

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

1218  {
1219  if($format = $this->getPref('date_format'))
1220  {
1221  return $format;
1222  }
1223  else
1224  {
1225  include_once('Services/Calendar/classes/class.ilCalendarSettings.php');
1226  $settings = ilCalendarSettings::_getInstance();
1227  return $settings->getDefaultDateFormat();
1228  }
1229  }
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 4419 of file class.ilObjUser.php.

References $delicious.

4420  {
4421  return $this->delicious;
4422  }

◆ getDepartment()

ilObjUser::getDepartment ( )

get department public

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

References $department.

Referenced by deleteUserDefinedFieldEntries().

1698  {
1699  return $this->department;
1700  }
+ Here is the caller graph for this function:

◆ getDesktopItems()

ilObjUser::getDesktopItems (   $a_types = "")

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

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

3273  {
3274  return $this->_lookupDesktopItems($this->getId(), $a_types);
3275  }
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 2012 of file class.ilObjUser.php.

2013  {
2014  return $this->prefs["disk_quota"] ? $this->prefs["disk_quota"] : 0;
2015  }

◆ getEmail()

ilObjUser::getEmail ( )

get email address public

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

References $email.

Referenced by deleteUserDefinedFieldEntries(), and ilPasswordAssistanceGUI\sendPasswordAssistanceMail().

1946  {
1947  return $this->email;
1948  }
+ 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 3694 of file class.ilObjUser.php.

Referenced by saveAsNew(), and update().

3695  {
3696  return $this->ext_account;
3697  }
+ Here is the caller graph for this function:

◆ getFax()

ilObjUser::getFax ( )

get fax public

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

References $fax.

Referenced by deleteUserDefinedFieldEntries().

1872  {
1873  return $this->fax;
1874  }
+ 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.

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  }
+ Here is the caller graph for this function:

◆ getFirstname()

ilObjUser::getFirstname ( )

get firstname public

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

References $firstname.

Referenced by deleteUserDefinedFieldEntries(), and getPublicName().

1641  {
1642  return $this->firstname;
1643  }
+ 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 1480 of file class.ilObjUser.php.

References ilObject\getId(), and ilUtil\stripSlashes().

1481  {
1482  if (!$a_max_strlen)
1483  {
1484  return ilUtil::stripSlashes($this->fullname);
1485  }
1486 
1487  if (strlen($this->fullname) <= $a_max_strlen)
1488  {
1489  return ilUtil::stripSlashes($this->fullname);
1490  }
1491 
1492  if ((strlen($this->utitle) + strlen($this->lastname) + 4) <= $a_max_strlen)
1493  {
1494  return ilUtil::stripSlashes($this->utitle." ".substr($this->firstname,0,1).". ".$this->lastname);
1495  }
1496 
1497  if ((strlen($this->firstname) + strlen($this->lastname) + 1) <= $a_max_strlen)
1498  {
1499  return ilUtil::stripSlashes($this->firstname." ".$this->lastname);
1500  }
1501 
1502  if ((strlen($this->lastname) + 3) <= $a_max_strlen)
1503  {
1504  return ilUtil::stripSlashes(substr($this->firstname,0,1).". ".$this->lastname);
1505  }
1506 
1507  return ilUtil::stripSlashes(substr($this->lastname,0,$a_max_strlen));
1508  }
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:

◆ getGender()

ilObjUser::getGender ( )

get gender public

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

References $gender.

Referenced by deleteUserDefinedFieldEntries().

1599  {
1600  return $this->gender;
1601  }
+ Here is the caller graph for this function:

◆ getHobby()

ilObjUser::getHobby ( )

get hobby public

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

References $hobby.

Referenced by deleteUserDefinedFieldEntries().

1965  {
1966  return $this->hobby;
1967  }
+ 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 $in, $inactivation_date, $res, and ilObject\getId().

5442  {
5443  return $this->inactivation_date;
5444  }
+ Here is the call graph for this function:

◆ getInstantMessengerId()

ilObjUser::getInstantMessengerId (   $a_im_type)

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

4409  {
4410  $var = "im_".$a_im_type;
4411  return $this->$var;
4412  }

◆ getInstitution()

ilObjUser::getInstitution ( )

get institution public

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

References $institution.

Referenced by deleteUserDefinedFieldEntries().

1679  {
1680  return $this->institution;
1681  }
+ Here is the caller graph for this function:

◆ getLanguage()

ilObjUser::getLanguage ( )

returns a 2char-language-string public

Returns
string language

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

Referenced by ilNotificationConfig\getUserInstance().

1986  {
1987  return $this->prefs["language"];
1988  }
+ Here is the caller graph for this function:

◆ getLastLogin()

ilObjUser::getLastLogin ( )

returns last login date public

Returns
string date

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

2117  {
2118  return $this->last_login;
2119  }

◆ getLastname()

ilObjUser::getLastname ( )

get lastname public

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

References $lastname.

Referenced by deleteUserDefinedFieldEntries(), exportPersonalData(), and getPublicName().

1660  {
1661  return $this->lastname;
1662  }
+ Here is the caller graph for this function:

◆ getLastPasswordChangeTS()

ilObjUser::getLastPasswordChangeTS ( )

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

References $last_password_change_ts.

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

2028  {
2030  }
+ Here is the caller graph for this function:

◆ getLastUpdate()

ilObjUser::getLastUpdate ( )

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

References ilObject\$last_update.

2131  {
2132  return $this->last_update;
2133  }

◆ getLatitude()

ilObjUser::getLatitude ( )

Get Latitude.

Returns
string Latitude

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

References $latitude.

Referenced by ilPersonalProfileGUI\addLocationToForm().

2468  {
2469  return $this->latitude;
2470  }
+ Here is the caller graph for this function:

◆ getLocationZoom()

ilObjUser::getLocationZoom ( )

Get Location Zoom.

Returns
int Location Zoom

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

References $loc_zoom.

Referenced by ilPersonalProfileGUI\addLocationToForm().

2508  {
2509  return $this->loc_zoom;
2510  }
+ Here is the caller graph for this function:

◆ getLogin()

ilObjUser::getLogin ( )

get login / username public

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

References $login.

Referenced by delete(), deleteUserDefinedFieldEntries(), exportPersonalData(), getPublicName(), ilAddressbook\getSearchQuery(), ilPasswordAssistanceGUI\sendPasswordAssistanceMail(), and updateLogin().

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

◆ getLoginAttempts()

ilObjUser::getLoginAttempts ( )

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

References $login_attempts.

2345  {
2346  return $this->login_attempts;
2347  }

◆ getLoginByUserId()

ilObjUser::getLoginByUserId (   $a_userid)

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

References $login, and _lookupLogin().

Referenced by ilObjPaymentSettingsGUI\editVendorObject().

2701  {
2702  $login = ilObjUser::_lookupLogin($a_userid);
2703  return $login ? $login : false;
2704  }
$login
all user related data in single vars public
_lookupLogin($a_user_id)
lookup login
+ 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 2589 of file class.ilObjUser.php.

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

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

2589  {
2590  global $ilAuth;
2591 
2592  // BEGIN WebDAV: Strip Microsoft Domain Names from logins
2593  require_once ('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
2595  {
2596  require_once ('Services/WebDAV/classes/class.ilDAVServer.php');
2597  require_once ('Services/Database/classes/class.ilAuthContainerMDB2.php');
2598  $login = ilAuthContainerMDB2::toUsernameWithoutDomain($ilAuth->getUsername());
2599  }
2600  else
2601  {
2602  $login =$ilAuth->getUsername();
2603  }
2604 
2605  return $login;
2606  }
$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 2487 of file class.ilObjUser.php.

References $longitude.

Referenced by ilPersonalProfileGUI\addLocationToForm().

2488  {
2489  return $this->longitude;
2490  }
+ Here is the caller graph for this function:

◆ getMatriculation()

ilObjUser::getMatriculation ( )

get matriculation number public

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

References $matriculation.

Referenced by deleteUserDefinedFieldEntries().

1910  {
1911  return $this->matriculation;
1912  }
+ Here is the caller 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 1569 of file class.ilObjUser.php.

References $passwd.

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

◆ getPasswdType()

ilObjUser::getPasswdType ( )

get password type

Returns
password type (IL_PASSWD_PLAIN, IL_PASSWD_MD5 or IL_PASSWD_CRYPT). public
See also
getPasswd

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

References $passwd_type.

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

◆ getPasswordAge()

ilObjUser::getPasswordAge ( )

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

References getLastPasswordChangeTS().

2418  {
2419  $current_ts = time();
2420  $pass_change_ts = $this->getLastPasswordChangeTS();
2421  $password_age = (int) ( ($current_ts - $pass_change_ts) / 86400 );
2422  return $password_age;
2423  }
+ Here is the call graph for this function:

◆ getPCClipboardContent()

ilObjUser::getPCClipboardContent ( )

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

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

References $row, and ilObject\getId().

3447  {
3448  global $ilDB;
3449 
3450  $set = $ilDB->queryF("SELECT MAX(insert_time) mtime FROM personal_pc_clipboard ".
3451  " WHERE user_id = %s", array("integer"), array($this->getId()));
3452  $row = $ilDB->fetchAssoc($set);
3453 
3454  $set = $ilDB->queryF("SELECT * FROM personal_pc_clipboard ".
3455  " WHERE user_id = %s AND insert_time = %s ORDER BY order_nr ASC",
3456  array("integer", "timestamp"),
3457  array($this->getId(), $row["mtime"]));
3458  $content = array();
3459  while ($row = $ilDB->fetchAssoc($set))
3460  {
3461  $content[] = $row["content"];
3462  }
3463 
3464  return $content;
3465  }
getId()
get object id public
+ 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 3948 of file class.ilObjUser.php.

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

3949  {
3950  if(isset(self::$personal_image_cache[$this->getId()][$a_size][(int)$a_force_pic]))
3951  {
3952  return self::$personal_image_cache[$this->getId()][$a_size][(int)$a_force_pic];
3953  }
3954 
3955  self::$personal_image_cache[$this->getId()][$a_size][(int)$a_force_pic] = ilObjUser::_getPersonalPicturePath($this->getId(), $a_size, $a_force_pic);
3956 
3957  return self::$personal_image_cache[$this->getId()][$a_size][(int)$a_force_pic];
3958  }
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 2017 of file class.ilObjUser.php.

2018  {
2019  return $this->prefs["wsp_disk_quota"] ? $this->prefs["wsp_disk_quota"] : 0;
2020  }

◆ getPhoneHome()

ilObjUser::getPhoneHome ( )

get home phone public

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

References $phone_home.

Referenced by deleteUserDefinedFieldEntries().

1834  {
1835  return $this->phone_home;
1836  }
+ Here is the caller graph for this function:

◆ getPhoneMobile()

ilObjUser::getPhoneMobile ( )

get mobile phone public

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

References $phone_mobile.

Referenced by deleteUserDefinedFieldEntries().

1853  {
1854  return $this->phone_mobile;
1855  }
+ Here is the caller graph for this function:

◆ getPhoneOffice()

ilObjUser::getPhoneOffice ( )

get office phone public

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

References $phone_office.

Referenced by deleteUserDefinedFieldEntries().

1815  {
1816  return $this->phone_office;
1817  }
+ 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 1250 of file class.ilObjUser.php.

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

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

◆ getProfileIncomplete()

ilObjUser::getProfileIncomplete ( )

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

Referenced by saveAsNew(), and update().

2367  {
2368  if($this->id == ANONYMOUS_USER_ID)
2369  {
2370  return false;
2371  }
2372  return $this->profile_incomplete;
2373  }
+ 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 4822 of file class.ilObjUser.php.

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

4823  {
4824  if ($this->hasPublicProfile())
4825  return $this->getFirstname()." ".$this->getLastname()." (".$this->getLogin().")";
4826  else
4827  return $this->getLogin();
4828 
4829  }
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 1795 of file class.ilObjUser.php.

References $sel_country.

Referenced by deleteUserDefinedFieldEntries().

1796  {
1797  return $this->sel_country;
1798  }
+ 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 2281 of file class.ilObjUser.php.

References _lookup().

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

2282  {
2283  $active = ilObjUser::_lookup($a_id, "active");
2284  return $active ? true : false;
2285  }
_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 1716 of file class.ilObjUser.php.

References $street.

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

1717  {
1718  return $this->street;
1719  }
+ Here is the caller graph for this function:

◆ getTimeFormat()

ilObjUser::getTimeFormat ( )

get time format

public

Returns

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

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

1198  {
1199  if($format = $this->getPref('time_format'))
1200  {
1201  return $format;
1202  }
1203  else
1204  {
1205  include_once('Services/Calendar/classes/class.ilCalendarSettings.php');
1206  $settings = ilCalendarSettings::_getInstance();
1207  return $settings->getDefaultTimeFormat();
1208  }
1209  }
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 2310 of file class.ilObjUser.php.

Referenced by checkTimeLimit(), deleteUserDefinedFieldEntries(), saveAsNew(), and update().

2311  {
2312  return $this->time_limit_from ? $this->time_limit_from : time();
2313  }
+ Here is the caller graph for this function:

◆ getTimeLimitMessage()

ilObjUser::getTimeLimitMessage ( )

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

Referenced by update().

2335  {
2336  return $this->time_limit_message;
2337  }
+ Here is the caller graph for this function:

◆ getTimeLimitOwner()

ilObjUser::getTimeLimitOwner ( )

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

Referenced by saveAsNew(), and update().

2303  {
2304  return $this->time_limit_owner ? $this->time_limit_owner : 7;
2305  }
+ Here is the caller graph for this function:

◆ getTimeLimitUnlimited()

ilObjUser::getTimeLimitUnlimited ( )

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

Referenced by checkTimeLimit(), deleteUserDefinedFieldEntries(), saveAsNew(), and update().

2327  {
2328  return $this->time_limit_unlimited;
2329  }
+ Here is the caller graph for this function:

◆ getTimeLimitUntil()

ilObjUser::getTimeLimitUntil ( )

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

Referenced by checkTimeLimit(), deleteUserDefinedFieldEntries(), saveAsNew(), and update().

2319  {
2320  return $this->time_limit_until ? $this->time_limit_until : time();
2321  }
+ Here is the caller graph for this function:

◆ getTimeZone()

ilObjUser::getTimeZone ( )

get timezone of user

public

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

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

1178  {
1179  if($tz = $this->getPref('user_tz'))
1180  {
1181  return $tz;
1182  }
1183  else
1184  {
1185  include_once('Services/Calendar/classes/class.ilCalendarSettings.php');
1186  $settings = ilCalendarSettings::_getInstance();
1187  return $settings->getDefaultTimeZone();
1188  }
1189  }
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 4128 of file class.ilObjUser.php.

Referenced by deleteUserDefinedFieldEntries().

4129  {
4130  return $this->user_defined_data ? $this->user_defined_data : array();
4131  }
+ 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 2681 of file class.ilObjUser.php.

References $res, and $row.

Referenced by ilObjUserTest\testAuthAndEmailMethods().

2682  {
2683  global $ilDB;
2684 
2685  $res = $ilDB->queryF("SELECT usr_id FROM usr_data ".
2686  "WHERE email = %s", array("text"), array($a_email));
2687 
2688  $row = $ilDB->fetchObject($res);
2689  return $row->usr_id ? $row->usr_id : 0;
2690  }
+ Here is the caller graph for this function:

◆ getUserIdByLogin()

ilObjUser::getUserIdByLogin (   $a_login)

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

References $utitle.

Referenced by deleteUserDefinedFieldEntries().

1622  {
1623  return $this->utitle;
1624  }
+ Here is the caller graph for this function:

◆ getZipcode()

ilObjUser::getZipcode ( )

get zipcode public

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

References $zipcode.

Referenced by deleteUserDefinedFieldEntries().

1755  {
1756  return $this->zipcode;
1757  }
+ 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 2556 of file class.ilObjUser.php.

References $row.

Referenced by ilAuthBase\loginObserver().

2557  {
2558  global $ilDB;
2559 
2560  $set = $ilDB->queryf('
2561  SELECT COUNT(*) session_count
2562  FROM usr_session WHERE user_id = %s AND expires > %s',
2563  array('integer', 'integer'),
2564  array($a_user_id, time()));
2565  $row = $ilDB->fetchAssoc($set);
2566  return (bool)$row['session_count'];
2567  }
+ Here is the caller graph for this function:

◆ hasDeletionFlag()

ilObjUser::hasDeletionFlag ( )

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

References getPref().

5536  {
5537  return (bool)$this->getPref("delete_flag");
5538  }
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 4813 of file class.ilObjUser.php.

References getPref().

Referenced by getPublicName().

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

◆ hasToAcceptTermsOfServiceInSession()

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

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

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

Referenced by ilTermsOfServiceHelper\trackAcceptance().

5504  {
5505  if(null === $status)
5506  {
5507  return ilSession::get('has_to_accept_agr_in_session');
5508  }
5509 
5510  require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
5511  if(ilTermsOfServiceHelper::isEnabled())
5512  {
5513  ilSession::set('has_to_accept_agr_in_session', (int)$status);
5514  }
5515  }
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:

◆ ilObjUser()

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

Constructor public.

Parameters
integeruser_id

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

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

156  {
157  global $ilias,$ilDB;
158 
159  // init variables
160  $this->ilias =& $ilias;
161  $this->db =& $ilDB;
162 
163  $this->type = "usr";
164  $this->ilObject($a_user_id, $a_call_by_reference);
165  $this->auth_mode = "default";
166  $this->passwd_type = IL_PASSWD_PLAIN;
167 
168  // for gender selection. don't change this
169  /*$this->gender = array(
170  'm' => "salutation_m",
171  'f' => "salutation_f"
172  );*/
173  if ($a_user_id > 0)
174  {
175  $this->setId($a_user_id);
176  $this->read();
177  }
178  else
179  {
180  // TODO: all code in else-structure doesn't belongs in class user !!!
181  //load default data
182  $this->prefs = array();
183  //language
184  $this->prefs["language"] = $this->ilias->ini->readVariable("language","default");
185 
186  //skin and pda support
187  $this->skin = $this->ilias->ini->readVariable("layout","skin");
188 
189  $this->prefs["skin"] = $this->skin;
190  $this->prefs["show_users_online"] = "y";
191 
192  //style (css)
193  $this->prefs["style"] = $this->ilias->ini->readVariable("layout","style");
194  }
195  }
const IL_PASSWD_PLAIN
setId($a_id)
set object id public
read()
loads a record "user" from database private
ilObject($a_id=0, $a_reference=true)
Constructor public.
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ importPersonalData()

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

Import personal data.

Parameters

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.

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  }

◆ isAnonymous()

ilObjUser::isAnonymous ( )
Returns
bool

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

References ilObject\getId().

5521  {
5522  return $this->getId() == ANONYMOUS_USER_ID;
5523  }
getId()
get object id public
+ Here is the call 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  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

◆ isChild()

ilObjUser::isChild (   $a_usr_id)

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

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

2521  {
2522  if($a_usr_id == $this->getId())
2523  {
2524  return true;
2525  }
2526 
2527  $this->applied_users = array();
2528  $this->__readAppliedUsers($this->getId());
2529 
2530  return in_array($a_usr_id,$this->applied_users);
2531  }
getId()
get object id public
__readAppliedUsers($a_parent_id)
+ Here is the call graph for this function:

◆ isCurrentUserActive()

ilObjUser::isCurrentUserActive ( )

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

References getLoginFromAuth().

2614  {
2615  global $ilDB,$ilAuth;
2616 
2618  $set = $ilDB->queryF("SELECT active FROM usr_data WHERE login= %s",
2619  array("text"),
2620  array($login));
2621  //query has got a result
2622  if ($rec = $ilDB->fetchAssoc($set))
2623  {
2624  if ($rec["active"])
2625  {
2626  return true;
2627  }
2628  }
2629 
2630  return false;
2631  }
$login
all user related data in single vars public
static getLoginFromAuth()
Gets the username from $ilAuth, and converts it into an ILIAS login name.
+ 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 3267 of file class.ilObjUser.php.

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

3268  {
3269  return ilObjUser::_isDesktopItem($this->getId(), $a_item_id, $a_type);
3270  }
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 2375 of file class.ilObjUser.php.

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

2376  {
2377  //error_reporting(E_ALL);
2378  if( $this->id == ANONYMOUS_USER_ID || $this->id == SYSTEM_USER_ID )
2379  return false;
2380 
2381  require_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
2382  $security = ilSecuritySettings::_getInstance();
2383 
2385  && $security->isPasswordChangeOnFirstLoginEnabled()
2386  && $this->getLastPasswordChangeTS() == 0
2387  && $this->is_self_registered == false
2388  ){
2389  return true;
2390  }
2391  else return false;
2392  }
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.
+ Here is the call graph for this function:

◆ isPasswordExpired()

ilObjUser::isPasswordExpired ( )

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

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

2395  {
2396  //error_reporting(E_ALL);
2397  if($this->id == ANONYMOUS_USER_ID) return false;
2398 
2399  require_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
2400  $security = ilSecuritySettings::_getInstance();
2401  if( $this->getLastPasswordChangeTS() > 0 )
2402  {
2403  $max_pass_age = $security->getPasswordMaxAge();
2404  if( $max_pass_age > 0 )
2405  {
2406  $max_pass_age_ts = ( $max_pass_age * 86400 );
2407  $pass_change_ts = $this->getLastPasswordChangeTS();
2408  $current_ts = time();
2409 
2410  if( ($current_ts - $pass_change_ts) > $max_pass_age_ts )
2411  return true;
2412  }
2413  }
2414  return false;
2415  }
static _getInstance()
Get instance of ilSecuritySettings.
+ Here is the call graph for this function:

◆ isSelfRegistered()

ilObjUser::isSelfRegistered ( )

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

References $is_self_registered.

5549  {
5550  return (bool) $this->is_self_registered;
5551  }

◆ lookupMatriculation()

static ilObjUser::lookupMatriculation (   $a_usr_id)
static

Lookup matriculation.

Returns
string matricualtion
Parameters
int$a_usr_idpublic

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

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

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

1921  {
1922  global $ilDB;
1923 
1924  $query = "SELECT matriculation FROM usr_data ".
1925  "WHERE usr_id = ".$ilDB->quote($a_usr_id);
1926  $res = $ilDB->query($query);
1927  $row = $res->fetchRow(DB_FETCHMODE_OBJECT);
1928  return $row->matriculation ? $row->matriculation : '';
1929  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ 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 3228 of file class.ilObjUser.php.

References ilObject\$id, and $r.

Referenced by ilObjectListGUIPreloader\preload().

3229  {
3230  global $ilDB;
3231 
3232  if (!is_array($a_item_ids))
3233  {
3234  return;
3235  }
3236 
3237  $item_ids = array();
3238  foreach ($a_item_ids as $id)
3239  {
3240  if (!self::$is_desktop_item_loaded[$a_usr_id.":".$id])
3241  {
3242  $item_ids[] = $id;
3243  }
3244  self::$is_desktop_item_loaded[$a_usr_id.":".$id] = true;
3245  }
3246 
3247  if (count($item_ids) > 0)
3248  {
3249  $item_set = $ilDB->query("SELECT item_id, type FROM desktop_item WHERE ".
3250  $ilDB->in("item_id", $item_ids, false, "integer").
3251  " AND user_id = ".$ilDB->quote($a_usr_id, "integer"));
3252  while ($r = $ilDB->fetchAssoc($item_set))
3253  {
3254  self::$is_desktop_item_cache[$a_usr_id.":".$r["item_id"].":".$r["type"]]
3255  = true;
3256  }
3257  }
3258  }
$r
+ Here is the caller graph for this function:

◆ read()

ilObjUser::read ( )

loads a record "user" from database private

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

References $data, $ilErr, $r, assignData(), ilDB\fetchAssoc(), IL_PASSWD_CRYPT, IL_PASSWD_MD5, readPrefs(), readUserDefinedFields(), setLastPasswordChangeTS(), setLoginAttempts(), and ilStyleDefinition\skinExists().

Referenced by ilObjUser(), and update().

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

References $prefs, and _getPreferences().

Referenced by read().

1282  {
1283  global $ilDB;
1284 
1285  if (is_array($this->prefs))
1286  {
1287  $this->oldPrefs = $this->prefs;
1288  }
1289 
1290  $this->prefs = ilObjUser::_getPreferences($this->id);
1291  }
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 4177 of file class.ilObjUser.php.

References ilObject\getId().

Referenced by read().

4178  {
4179  global $ilDB;
4180 
4181  include_once("./Services/User/classes/class.ilUserDefinedData.php");
4182  $udata = new ilUserDefinedData($this->getId());
4183 
4184 /* $query = "SELECT * FROM udf_data ".
4185  "WHERE usr_id = ".$ilDB->quote($this->getId(),'integer');
4186 
4187  $res = $this->db->query($query);
4188  while($row = $res->fetchRow(DB_FETCHMODE_ASSOC))
4189  {
4190  $this->user_defined_data = $row;
4191  }*/
4192 
4193  $this->user_defined_data = $udata->getAll();
4194 
4195  return true;
4196  }
Class ilUserDefinedData.
getId()
get object id public
+ 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 794 of file class.ilObjUser.php.

795  {
796  global $ilDB;
797 
798  $ilDB->manipulateF("UPDATE usr_data SET ".
799  "last_login = ".$ilDB->now().
800  " WHERE usr_id = %s",
801  array("integer"), array($this->id));
802  }

◆ removeDeletionFlag()

ilObjUser::removeDeletionFlag ( )

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

References writePref().

5531  {
5532  $this->writePref("delete_flag", false);
5533  }
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 3607 of file class.ilObjUser.php.

References ilObject\getId().

3608  {
3609  global $ilDB;
3610 
3611  $q = "DELETE FROM personal_clipboard WHERE ".
3612  "item_id = ".$ilDB->quote($a_item_id, "integer").
3613  " AND type = ".$ilDB->quote($a_type, "text")." ".
3614  " AND user_id = ".$ilDB->quote($this->getId(), "integer");
3615  $ilDB->manipulate($q);
3616  }
getId()
get object id public
+ Here is the call graph for this function:

◆ removeUserPicture()

ilObjUser::removeUserPicture (   $a_do_update = true)

Remove user picture.

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

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

Referenced by delete().

4072  {
4073  $webspace_dir = ilUtil::getWebspaceDir();
4074  $image_dir = $webspace_dir."/usr_images";
4075  $file = $image_dir."/usr_".$this->getID()."."."jpg";
4076  $thumb_file = $image_dir."/usr_".$this->getID()."_small.jpg";
4077  $xthumb_file = $image_dir."/usr_".$this->getID()."_xsmall.jpg";
4078  $xxthumb_file = $image_dir."/usr_".$this->getID()."_xxsmall.jpg";
4079  $upload_file = $image_dir."/upload_".$this->getID();
4080 
4081  if($a_do_update)
4082  {
4083  // remove user pref file name
4084  $this->setPref("profile_image", "");
4085  $this->update();
4086  }
4087 
4088  if (@is_file($file))
4089  {
4090  unlink($file);
4091  }
4092  if (@is_file($thumb_file))
4093  {
4094  unlink($thumb_file);
4095  }
4096  if (@is_file($xthumb_file))
4097  {
4098  unlink($xthumb_file);
4099  }
4100  if (@is_file($xxthumb_file))
4101  {
4102  unlink($xxthumb_file);
4103  }
4104  if (@is_file($upload_file))
4105  {
4106  unlink($upload_file);
4107  }
4108  }
print $file
setPref($a_keyword, $a_value)
set a user preference
update()
updates a record "user" and write it into database public
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ replacePassword()

ilObjUser::replacePassword (   $new_md5)

replaces password with new md5 hash

Parameters
stringnew password as md5
Returns
boolean true on success; otherwise false public

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

References IL_PASSWD_MD5.

811  {
812  global $ilDB;
813 
814  $this->passwd_type = IL_PASSWD_MD5;
815  $this->passwd = $new_md5;
816 
817  $ilDB->manipulateF("UPDATE usr_data SET ".
818  "passwd = %s ".
819  "WHERE usr_id = %s",
820  array("text", "integer"), array($this->passwd, $this->id));
821 
822  return true;
823  }
const IL_PASSWD_MD5

◆ resetInactivationDate()

static ilObjUser::resetInactivationDate (   $usrIds)
staticprivate

type $ilDB

Parameters
type$usrIds

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

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  }

◆ resetLastPasswordChange()

ilObjUser::resetLastPasswordChange ( )

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

References $query, and ilObject\getId().

2441  {
2442  global $ilDB;
2443 
2444  $query = "UPDATE usr_data SET last_password_change = 0 " .
2445  "WHERE usr_id = %s";
2446  $affected = $ilDB->manipulateF( $query, array('integer'),
2447  array($this->getId()) );
2448  if($affected) return true;
2449  else return false;
2450  }
getId()
get object id public
+ Here is the call graph for this function:

◆ resetOwner()

ilObjUser::resetOwner ( )

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

References $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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetPassword()

ilObjUser::resetPassword (   $a_new1,
  $a_new2 
)

reset password

Parameters
stringnew password1 as plaintext
stringnew password2 as plaintext
Returns
boolean true on success; otherwise false public

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

References IL_PASSWD_MD5.

903  {
904  global $ilDB;
905 
906  if (func_num_args() != 2)
907  {
908  return false;
909  }
910 
911  if (!isset($a_new1) or !isset($a_new2))
912  {
913  return false;
914  }
915 
916  if ($a_new1 != $a_new2)
917  {
918  return false;
919  }
920 
921  //update password
922  $this->passwd = md5($a_new1);
923  $this->passwd_type = IL_PASSWD_MD5;
924 
925  $ilDB->manipulateF("UPDATE usr_data SET ".
926  "passwd = %s ".
927  "WHERE usr_id = %s",
928  array("text", "integer"),
929  array($this->passwd, $this->id));
930 
931  return true;
932  }
const IL_PASSWD_MD5

◆ saveAsNew()

ilObjUser::saveAsNew (   $a_from_formular = true)

TODO: drop fields last_update & create_date.

redundant data in object_data! saves a new record "user" to database public

Parameters
booleanuser data from formular (addSlashes) or not (prepareDBString)

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

References $ilErr, $ilSetting, $ilUser, $passwd, addUserDefinedFieldEntry(), getAuthMode(), getBirthday(), getExternalAccount(), getProfileIncomplete(), getTimeLimitFrom(), getTimeLimitOwner(), getTimeLimitUnlimited(), getTimeLimitUntil(), IL_PASSWD_CRYPT, IL_PASSWD_MD5, IL_PASSWD_PLAIN, ilUtil\now(), setInactivationDate(), and updateUserDefinedFields().

390  {
391  global $ilErr, $ilDB, $ilSetting, $ilUser;
392 
393  switch ($this->passwd_type)
394  {
395  case IL_PASSWD_PLAIN:
396  $pw_field = "passwd";
397  if(strlen($this->passwd))
398  {
399  $pw_value = md5($this->passwd);
400  }
401  else
402  {
403  $pw_value = $this->passwd;
404  }
405  break;
406 
407  case IL_PASSWD_MD5:
408  $pw_field = "passwd";
409  $pw_value = $this->passwd;
410  break;
411 
412  case IL_PASSWD_CRYPT:
413  $pw_field = "i2passwd";
414  $pw_value = $this->passwd;
415  break;
416 
417  default :
418  $ilErr->raiseError("<b>Error: passwd_type missing in function saveAsNew. ".
419  $this->id."!</b><br />class: ".get_class($this)."<br />Script: ".__FILE__.
420  "<br />Line: ".__LINE__, $ilErr->FATAL);
421  }
422 
423  if( !$this->active )
424  {
425  $this->setInactivationDate( ilUtil::now() );
426  }
427  else
428  {
429  $this->setInactivationDate(null);
430  }
431 
432  $insert_array = array(
433  "usr_id" => array("integer", $this->id),
434  "login" => array("text", $this->login),
435  $pw_field => array("text", $pw_value),
436  "firstname" => array("text", $this->firstname),
437  "lastname" => array("text", $this->lastname),
438  "title" => array("text", $this->utitle),
439  "gender" => array("text", $this->gender),
440  "email" => array("text", trim($this->email)),
441  "hobby" => array("text", (string) $this->hobby),
442  "institution" => array("text", $this->institution),
443  "department" => array("text", $this->department),
444  "street" => array("text", $this->street),
445  "city" => array("text", $this->city),
446  "zipcode" => array("text", $this->zipcode),
447  "country" => array("text", $this->country),
448  "sel_country" => array("text", $this->sel_country),
449  "phone_office" => array("text", $this->phone_office),
450  "phone_home" => array("text", $this->phone_home),
451  "phone_mobile" => array("text", $this->phone_mobile),
452  "fax" => array("text", $this->fax),
453  "birthday" => array('date', $this->getBirthday()),
454  "last_login" => array("timestamp", null),
455  "last_update" => array("timestamp", ilUtil::now()),
456  "create_date" => array("timestamp", ilUtil::now()),
457  "referral_comment" => array("text", $this->referral_comment),
458  "matriculation" => array("text", $this->matriculation),
459  "client_ip" => array("text", $this->client_ip),
460  "approve_date" => array("timestamp", $this->approve_date),
461  "agree_date" => array("timestamp", $this->agree_date),
462  "active" => array("integer", (int) $this->active),
463  "time_limit_unlimited" => array("integer", $this->getTimeLimitUnlimited()),
464  "time_limit_until" => array("integer", $this->getTimeLimitUntil()),
465  "time_limit_from" => array("integer", $this->getTimeLimitFrom()),
466  "time_limit_owner" => array("integer", $this->getTimeLimitOwner()),
467  "auth_mode" => array("text", $this->getAuthMode()),
468  "ext_account" => array("text", $this->getExternalAccount()),
469  "profile_incomplete" => array("integer", $this->getProfileIncomplete()),
470  "im_icq" => array("text", $this->im_icq),
471  "im_yahoo" => array("text", $this->im_yahoo),
472  "im_msn" => array("text", $this->im_msn),
473  "im_aim" => array("text", $this->im_aim),
474  "im_skype" => array("text", $this->im_skype),
475  "delicious" => array("text", $this->delicious),
476  "latitude" => array("text", $this->latitude),
477  "longitude" => array("text", $this->longitude),
478  "loc_zoom" => array("integer", (int) $this->loc_zoom),
479  "last_password_change" => array("integer", (int) $this->last_password_change_ts),
480  "im_jabber" => array("text", $this->im_jabber),
481  "im_voip" => array("text", $this->im_voip),
482  'inactivation_date' => array('timestamp', $this->inactivation_date),
483  'is_self_registered' => array('integer', (int)$this->is_self_registered)
484  );
485  $ilDB->insert("usr_data", $insert_array);
486 
487  // add new entry in usr_defined_data
488  $this->addUserDefinedFieldEntry();
489  // ... and update
490  $this->updateUserDefinedFields();
491 
492  // CREATE ENTRIES FOR MAIL BOX
493  include_once ("Services/Mail/classes/class.ilMailbox.php");
494  $mbox = new ilMailbox($this->id);
495  $mbox->createDefaultFolder();
496 
497  include_once "Services/Mail/classes/class.ilMailOptions.php";
498  $mail_options = new ilMailOptions($this->id);
499  $mail_options->createMailOptionsEntry();
500 
501  // create personal bookmark folder tree
502  include_once "./Services/Bookmarks/classes/class.ilBookmarkFolder.php";
503  $bmf = new ilBookmarkFolder(0, $this->id);
504  $bmf->createNewBookmarkTree();
505  }
Class UserMail this class handles user mails.
const IL_PASSWD_PLAIN
getAuthMode($a_auth_key=false)
get auth mode public
const IL_PASSWD_CRYPT
static now()
Return current timestamp in Y-m-d H:i:s format.
setInactivationDate($inactivation_date)
setter for inactivation date
getExternalAccount()
get external account
Mail Box class Base class for creating and handling mail boxes.
const IL_PASSWD_MD5
global $ilUser
Definition: imgupload.php:15
bookmark folder (note: this class handles personal bookmarks folders only)
global $ilSetting
Definition: privfeed.php:40
+ Here is the call 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 2716 of file class.ilObjUser.php.

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

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

2717  {
2718  global $ilias, $ilDB, $ilLog;
2719 
2720 
2721  $query = "SELECT usr_data.usr_id, usr_data.login, usr_data.firstname, usr_data.lastname, usr_data.email, usr_data.active FROM usr_data ";
2722 
2723  $without_anonymous_users = true;
2724 
2725  // determine join filter
2726  $join_filter = " WHERE ";
2727  if ($filter_settings !== FALSE && strlen($filter_settings))
2728  {
2729  switch ($filter_settings)
2730  {
2731  case 3:
2732  // show only users without courses
2733  $join_filter = " LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id WHERE obj_members.usr_id IS NULL AND ";
2734  break;
2735  case 5:
2736  // show only users with a certain course membership
2737  $ref_id = $_SESSION["user_filter_data"];
2738  if ($ref_id)
2739  {
2740  $join_filter = " LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id WHERE obj_members.obj_id = ".
2741  "(SELECT obj_id FROM object_reference WHERE ref_id = ".$ilDB->quote($ref_id, "integer").") AND ";
2742  }
2743  break;
2744  case 6:
2745  global $rbacreview;
2746  $ref_id = $_SESSION["user_filter_data"];
2747  if ($ref_id)
2748  {
2749  $rolf = $rbacreview->getRoleFolderOfObject($ref_id);
2750  $local_roles = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"],false);
2751  if (is_array($local_roles) && count($local_roles))
2752  {
2753  $join_filter = " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE ".
2754  $ilDB->in("rbac_ua.rol_id", $local_roles, false, $local_roles)." AND ";
2755  }
2756  }
2757  break;
2758  case 7:
2759  global $rbacreview;
2760  $rol_id = $_SESSION["user_filter_data"];
2761  if ($rol_id)
2762  {
2763  $join_filter = " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id = ".
2764  $ilDB->quote($rol_id, "integer")." AND ";
2765  $without_anonymous_users = false;
2766  }
2767  break;
2768  }
2769  }
2770  // This is a temporary hack to search users by their role
2771  // See Mantis #338. This is a hack due to Mantis #337.
2772  if (strtolower(substr($a_search_str, 0, 5)) == "role:")
2773  {
2774  $query = "SELECT DISTINCT usr_data.usr_id,usr_data.login,usr_data.firstname,usr_data.lastname,usr_data.email ".
2775  "FROM object_data,rbac_ua,usr_data ".
2776  "WHERE ".$ilDB->like("object_data.title", "text", "%".substr($a_search_str,5)."%").
2777  " AND object_data.type = 'role' ".
2778  "AND rbac_ua.rol_id = object_data.obj_id ".
2779  "AND usr_data.usr_id = rbac_ua.usr_id ".
2780  "AND rbac_ua.usr_id != ".$ilDB->quote(ANONYMOUS_USER_ID, "integer");
2781  }
2782  else
2783  {
2784  $query.= $join_filter.
2785  "(".$ilDB->like("usr_data.login", "text", "%".$a_search_str."%")." ".
2786  "OR ".$ilDB->like("usr_data.firstname", "text", "%".$a_search_str."%")." ".
2787  "OR ".$ilDB->like("usr_data.lastname", "text", "%".$a_search_str."%")." ".
2788  "OR ".$ilDB->like("usr_data.email", "text", "%".$a_search_str."%").") ";
2789 
2790  if ($filter_settings !== FALSE && strlen($filter_settings))
2791  {
2792  switch ($filter_settings)
2793  {
2794  case 0:
2795  $query.= " AND usr_data.active = ".$ilDB->quote(0, "integer")." ";
2796  break;
2797  case 1:
2798  $query.= " AND usr_data.active = ".$ilDB->quote(1, "integer")." ";
2799  break;
2800  case 2:
2801  $query.= " AND usr_data.time_limit_unlimited = ".$ilDB->quote(0, "integer")." ";
2802  break;
2803  case 4:
2804  $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"]));
2805  $query.= " AND last_login < ".$ilDB->quote($date, "timestamp")." ";
2806  break;
2807  }
2808  }
2809 
2810  if ($without_anonymous_users)
2811  {
2812  $query.= "AND usr_data.usr_id != ".$ilDB->quote(ANONYMOUS_USER_ID, "integer");
2813  }
2814 
2815  if (is_numeric($active) && $active > -1 && $filter_settings === FALSE)
2816  {
2817  $query.= " AND active = ".$ilDB->quote($active, "integer")." ";
2818  }
2819 
2820  }
2821  $ilLog->write($query);
2822  $res = $ilDB->query($query);
2823  while ($row = $ilDB->fetchObject($res))
2824  {
2825  $users[] = array(
2826  "usr_id" => $row->usr_id,
2827  "login" => $row->login,
2828  "firstname" => $row->firstname,
2829  "lastname" => $row->lastname,
2830  "email" => $row->email,
2831  "active" => $row->active);
2832  $ids[] = $row->usr_id;
2833  }
2834  if ($a_return_ids_only)
2835  return $ids ? $ids : array();
2836  else
2837  return $users ? $users : array();
2838  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ 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 2203 of file class.ilObjUser.php.

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

Referenced by syncActive().

2204  {
2205  $this->setOwner($a_owner);
2206 
2207  if ($a_active)
2208  {
2209  $this->active = 1;
2210  $this->setApproveDate(date('Y-m-d H:i:s'));
2211  $this->setOwner($a_owner);
2212  }
2213  else
2214  {
2215  $this->active = 0;
2216  $this->setApproveDate(null);
2217  }
2218  }
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 2191 of file class.ilObjUser.php.

2192  {
2193  $this->agree_date = $a_str;
2194  }

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

Referenced by setActive().

2161  {
2162  $this->approve_date = $a_str;
2163  }
+ Here is the caller graph for this function:

◆ setAuthMode()

ilObjUser::setAuthMode (   $a_str)

set auth mode public

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

Referenced by assignData().

3656  {
3657  $this->auth_mode = $a_str;
3658  }
+ 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  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

◆ setCity()

ilObjUser::setCity (   $a_str)

set city public

Parameters
stringcity

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

Referenced by assignData().

1727  {
1728  $this->city = $a_str;
1729  }
+ Here is the caller graph for this function:

◆ setClientIP()

ilObjUser::setClientIP (   $a_str)

set client ip number public

Parameters
stringclient ip

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

Referenced by assignData().

1882  {
1883  $this->client_ip = $a_str;
1884  }
+ Here is the caller graph for this function:

◆ setComment()

ilObjUser::setComment (   $a_str)

set referral comment public

Parameters
stringhobby

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

Referenced by assignData().

2141  {
2142  $this->referral_comment = $a_str;
2143  }
+ Here is the caller graph for this function:

◆ setCountry()

ilObjUser::setCountry (   $a_str)

Set country (free text)

public

Parameters
stringcountry

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

Referenced by assignData().

1766  {
1767  $this->country = $a_str;
1768  }
+ Here is the caller graph for this function:

◆ setCurrentLanguage()

ilObjUser::setCurrentLanguage (   $a_val)

Set current language.

Parameters
string$a_valcurrent language

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

References $_SESSION.

2097  {
2098  $_SESSION['lang'] = $a_val;
2099  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

◆ setDelicious()

ilObjUser::setDelicious (   $a_delicious)

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

Referenced by assignData().

4415  {
4416  $this->delicious = $a_delicious;
4417  }
+ Here is the caller graph for this function:

◆ setDepartment()

ilObjUser::setDepartment (   $a_str)

set department public

Parameters
stringdepartment

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

Referenced by assignData().

1689  {
1690  $this->department = $a_str;
1691  }
+ 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 3116 of file class.ilObjUser.php.

References ilObject\getId().

3117  {
3118  global $ilDB;
3119 
3120  $ilDB->manipulateF("UPDATE desktop_item SET parameters = %s ".
3121  " WHERE item_id = %s AND type = %s AND user_id = %s",
3122  array("text", "integer", "text", "integer"),
3123  array($a_par, $a_item_id, $a_type, $this->getId()));
3124  }
getId()
get object id public
+ 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 1998 of file class.ilObjUser.php.

References setPref().

1999  {
2000  $this->setPref("disk_quota",$a_disk_quota);
2001  }
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 1936 of file class.ilObjUser.php.

Referenced by assignData().

1937  {
1938  $this->email = $a_str;
1939  }
+ 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 3682 of file class.ilObjUser.php.

Referenced by assignData().

3683  {
3684  $this->ext_account = $a_str;
3685  }
+ Here is the caller graph for this function:

◆ setFax()

ilObjUser::setFax (   $a_str)

set fax public

Parameters
stringfax

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

Referenced by assignData().

1863  {
1864  $this->fax = $a_str;
1865  }
+ Here is the caller graph for this function:

◆ setFirstname()

ilObjUser::setFirstname (   $a_str)

set firstname public

Parameters
stringfirstname

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

Referenced by assignData().

1632  {
1633  $this->firstname = $a_str;
1634  }
+ 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 1436 of file class.ilObjUser.php.

References $lastname.

Referenced by assignData().

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

◆ setGender()

ilObjUser::setGender (   $a_str)

set gender public

Parameters
stringgender

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

Referenced by assignData().

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

◆ setHobby()

ilObjUser::setHobby (   $a_str)

set hobby public

Parameters
stringhobby

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

Referenced by assignData().

1956  {
1957  $this->hobby = $a_str;
1958  }
+ 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(), saveAsNew(), and update().

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

Referenced by assignData().

4403  {
4404  $var = "im_".$a_im_type;
4405  $this->$var = $a_im_id;
4406  }
+ Here is the caller graph for this function:

◆ setInstitution()

ilObjUser::setInstitution (   $a_str)

set institution public

Parameters
stringinstitution

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

Referenced by assignData().

1670  {
1671  $this->institution = $a_str;
1672  }
+ Here is the caller graph for this function:

◆ setIsSelfRegistered()

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

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

Referenced by assignData().

5544  {
5545  $this->is_self_registered = (bool) $status;
5546  }
+ 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 1974 of file class.ilObjUser.php.

References $_SESSION, and setPref().

1975  {
1976  $this->setPref("language",$a_str);
1977  unset($_SESSION['lang']);
1978  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
setPref($a_keyword, $a_value)
set a user preference
+ Here is the call graph for this function:

◆ setLastLogin()

ilObjUser::setLastLogin (   $a_str)

set user's last login public

Parameters
stringlogin date

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

Referenced by assignData().

2107  {
2108  $this->last_login = $a_str;
2109  }
+ Here is the caller graph for this function:

◆ setLastname()

ilObjUser::setLastname (   $a_str)

set lastame public

Parameters
stringlastname

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

Referenced by assignData().

1651  {
1652  $this->lastname = $a_str;
1653  }
+ Here is the caller graph for this function:

◆ setLastPasswordChangeToNow()

ilObjUser::setLastPasswordChangeToNow ( )

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

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

2426  {
2427  global $ilDB;
2428 
2429  $this->setLastPasswordChangeTS( time() );
2430 
2431  $query = "UPDATE usr_data SET last_password_change = %s " .
2432  "WHERE usr_id = %s";
2433  $affected = $ilDB->manipulateF($query,
2434  array('integer','integer'),
2435  array($this->getLastPasswordChangeTS(),$this->id));
2436  if($affected) return true;
2437  else return false;
2438  }
setLastPasswordChangeTS($a_last_password_change_ts)
+ Here is the call graph for this function:

◆ setLastPasswordChangeTS()

ilObjUser::setLastPasswordChangeTS (   $a_last_password_change_ts)

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

Referenced by read(), and setLastPasswordChangeToNow().

2023  {
2024  $this->last_password_change_ts = $a_last_password_change_ts;
2025  }
+ 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 2126 of file class.ilObjUser.php.

Referenced by assignData().

2127  {
2128  $this->last_update = $a_str;
2129  }
+ Here is the caller graph for this function:

◆ setLatitude()

ilObjUser::setLatitude (   $a_latitude)

Set Latitude.

Parameters
string$a_latitudeLatitude

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

Referenced by assignData().

2458  {
2459  $this->latitude = $a_latitude;
2460  }
+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjUser::setLocationZoom (   $a_locationzoom)

Set Location Zoom.

Parameters
int$a_locationzoomLocation Zoom

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

Referenced by assignData().

2498  {
2499  $this->loc_zoom = $a_locationzoom;
2500  }
+ Here is the caller graph for this function:

◆ setLogin()

ilObjUser::setLogin (   $a_str)

set login / username public

Parameters
stringusername

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

Referenced by assignData().

1538  {
1539  $this->login = $a_str;
1540  }
+ Here is the caller graph for this function:

◆ setLoginAttempts()

ilObjUser::setLoginAttempts (   $a_login_attempts)

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

Referenced by read().

2340  {
2341  $this->login_attempts = $a_login_attempts;
2342  }
+ Here is the caller graph for this function:

◆ setLongitude()

ilObjUser::setLongitude (   $a_longitude)

Set Longitude.

Parameters
string$a_longitudeLongitude

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

Referenced by assignData().

2478  {
2479  $this->longitude = $a_longitude;
2480  }
+ Here is the caller graph for this function:

◆ setMatriculation()

ilObjUser::setMatriculation (   $a_str)

set matriculation number public

Parameters
stringmatriculation number

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

Referenced by assignData().

1901  {
1902  $this->matriculation = $a_str;
1903  }
+ 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 1556 of file class.ilObjUser.php.

Referenced by assignData().

1557  {
1558  $this->passwd = $a_str;
1559  $this->passwd_type = $a_type;
1560  }
+ Here is the caller graph for this function:

◆ setPhoneHome()

ilObjUser::setPhoneHome (   $a_str)

set home phone public

Parameters
stringhome phone

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

Referenced by assignData().

1825  {
1826  $this->phone_home = $a_str;
1827  }
+ Here is the caller graph for this function:

◆ setPhoneMobile()

ilObjUser::setPhoneMobile (   $a_str)

set mobile phone public

Parameters
stringmobile phone

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

Referenced by assignData().

1844  {
1845  $this->phone_mobile = $a_str;
1846  }
+ Here is the caller graph for this function:

◆ setPhoneOffice()

ilObjUser::setPhoneOffice (   $a_str)

set office phone public

Parameters
stringoffice phone

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

Referenced by assignData().

1806  {
1807  $this->phone_office = $a_str;
1808  }
+ 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 1237 of file class.ilObjUser.php.

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

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

◆ setProfileIncomplete()

ilObjUser::setProfileIncomplete (   $a_prof_inc)

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

Referenced by assignData().

2363  {
2364  $this->profile_incomplete = (boolean) $a_prof_inc;
2365  }
+ 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 1785 of file class.ilObjUser.php.

Referenced by assignData().

1786  {
1787  $this->sel_country = $a_val;
1788  }
+ 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 2292 of file class.ilObjUser.php.

2293  {
2294  // TODO: exception handling (dir exists)
2295  $this->skin = $a_str;
2296  }

◆ setStreet()

ilObjUser::setStreet (   $a_str)

set street public

Parameters
stringstreet

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

Referenced by assignData().

1708  {
1709  $this->street = $a_str;
1710  }
+ Here is the caller graph for this function:

◆ setTimeLimitFrom()

ilObjUser::setTimeLimitFrom (   $a_from)

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

Referenced by assignData().

2307  {
2308  $this->time_limit_from = $a_from;
2309  }
+ Here is the caller graph for this function:

◆ setTimeLimitMessage()

ilObjUser::setTimeLimitMessage (   $a_time_limit_message)

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

Referenced by assignData().

2331  {
2332  return $this->time_limit_message = $a_time_limit_message;
2333  }
+ Here is the caller graph for this function:

◆ setTimeLimitOwner()

ilObjUser::setTimeLimitOwner (   $a_owner)

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

Referenced by assignData().

2299  {
2300  $this->time_limit_owner = $a_owner;
2301  }
+ Here is the caller graph for this function:

◆ setTimeLimitUnlimited()

ilObjUser::setTimeLimitUnlimited (   $a_unlimited)

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

Referenced by assignData().

2323  {
2324  $this->time_limit_unlimited = $a_unlimited;
2325  }
+ Here is the caller graph for this function:

◆ setTimeLimitUntil()

ilObjUser::setTimeLimitUntil (   $a_until)

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

Referenced by assignData().

2315  {
2316  $this->time_limit_until = $a_until;
2317  }
+ Here is the caller graph for this function:

◆ setUserDefinedData()

ilObjUser::setUserDefinedData (   $a_data)

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

References $data.

4112  {
4113  if(!is_array($a_data))
4114  {
4115  return false;
4116  }
4117  foreach($a_data as $field => $data)
4118  {
4119  #$new_data[$field] = ilUtil::stripSlashes($data);
4120  // Assign it directly to avoid update problems of unchangable fields
4121  $this->user_defined_data['f_'.$field] = $data;
4122  }
4123  #$this->user_defined_data = $new_data;
4124 
4125  return true;
4126  }
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $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 1610 of file class.ilObjUser.php.

Referenced by assignData().

1611  {
1612  $this->utitle = $a_str;
1613  }
+ Here is the caller graph for this function:

◆ setZipcode()

ilObjUser::setZipcode (   $a_str)

set zipcode public

Parameters
stringzipcode

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

Referenced by assignData().

1746  {
1747  $this->zipcode = $a_str;
1748  }
+ 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 2252 of file class.ilObjUser.php.

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

Referenced by update().

2253  {
2254  global $ilAuth;
2255 
2256  $storedActive = 0;
2257  if ($this->getStoredActive($this->id))
2258  {
2259  $storedActive = 1;
2260  }
2261 
2262  $currentActive = 0;
2263  if ($this->active)
2264  {
2265  $currentActive = 1;
2266  }
2267 
2268  if ((!empty($storedActive) && empty($currentActive)) ||
2269  (empty($storedActive) && !empty($currentActive)))
2270  {
2271  $this->setActive($currentActive, $this->getUserIdByLogin(ilObjUser::getLoginFromAuth()));
2272  }
2273  }
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:

◆ update()

ilObjUser::update ( )

updates a record "user" and write it into database public

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

References $ilErr, getAuthMode(), getBirthday(), getExternalAccount(), getProfileIncomplete(), getStoredActive(), getTimeLimitFrom(), getTimeLimitMessage(), getTimeLimitOwner(), getTimeLimitUnlimited(), getTimeLimitUntil(), IL_PASSWD_CRYPT, IL_PASSWD_MD5, IL_PASSWD_PLAIN, ilUtil\now(), read(), setInactivationDate(), syncActive(), updateUserDefinedFields(), and writePrefs().

Referenced by removeUserPicture().

512  {
513  global $ilErr, $ilDB, $ilAppEventHandler;
514 
515  $this->syncActive();
516 
517  if( $this->getStoredActive($this->id) && !$this->active )
518  {
519  $this->setInactivationDate( ilUtil::now() );
520  }
521  else if($this->active)
522  {
523  $this->setInactivationDate(null);
524  }
525 
526  $update_array = array(
527  "gender" => array("text", $this->gender),
528  "title" => array("text", $this->utitle),
529  "firstname" => array("text", $this->firstname),
530  "lastname" => array("text", $this->lastname),
531  "email" => array("text", trim($this->email)),
532  "birthday" => array('date', $this->getBirthday()),
533  "hobby" => array("text", $this->hobby),
534  "institution" => array("text", $this->institution),
535  "department" => array("text", $this->department),
536  "street" => array("text", $this->street),
537  "city" => array("text", $this->city),
538  "zipcode" => array("text", $this->zipcode),
539  "country" => array("text", $this->country),
540  "sel_country" => array("text", $this->sel_country),
541  "phone_office" => array("text", $this->phone_office),
542  "phone_home" => array("text", $this->phone_home),
543  "phone_mobile" => array("text", $this->phone_mobile),
544  "fax" => array("text", $this->fax),
545  "referral_comment" => array("text", $this->referral_comment),
546  "matriculation" => array("text", $this->matriculation),
547  "client_ip" => array("text", $this->client_ip),
548  "approve_date" => array("timestamp", $this->approve_date),
549  "active" => array("integer", $this->active),
550  "time_limit_unlimited" => array("integer", $this->getTimeLimitUnlimited()),
551  "time_limit_until" => array("integer", $this->getTimeLimitUntil()),
552  "time_limit_from" => array("integer", $this->getTimeLimitFrom()),
553  "time_limit_owner" => array("integer", $this->getTimeLimitOwner()),
554  "time_limit_message" => array("integer", $this->getTimeLimitMessage()),
555  "profile_incomplete" => array("integer", $this->getProfileIncomplete()),
556  "auth_mode" => array("text", $this->getAuthMode()),
557  "ext_account" => array("text", $this->getExternalAccount()),
558  "im_icq" => array("text", $this->im_icq),
559  "im_yahoo" => array("text", $this->im_yahoo),
560  "im_msn" => array("text", $this->im_msn),
561  "im_aim" => array("text", $this->im_aim),
562  "im_skype" => array("text", $this->im_skype),
563  "delicious" => array("text", $this->delicious),
564  "latitude" => array("text", $this->latitude),
565  "longitude" => array("text", $this->longitude),
566  "loc_zoom" => array("integer", (int) $this->loc_zoom),
567  "last_password_change" => array("integer", $this->last_password_change_ts),
568  "im_jabber" => array("text", $this->im_jabber),
569  "im_voip" => array("text", $this->im_voip),
570  "last_update" => array("timestamp", ilUtil::now()),
571  'inactivation_date' => array('timestamp', $this->inactivation_date)
572  );
573 
574  if (isset($this->agree_date) && (strtotime($this->agree_date) !== false || $this->agree_date == null))
575  {
576  $update_array["agree_date"] = array("timestamp", $this->agree_date);
577  }
578  switch ($this->passwd_type)
579  {
580  case IL_PASSWD_PLAIN:
581  if(strlen($this->passwd))
582  {
583  $update_array["i2passwd"] = array("text", (string) "");
584  $update_array["passwd"] = array("text", (string) md5($this->passwd));
585  }
586  else
587  {
588  $update_array["i2passwd"] = array("text", (string) "");
589  $update_array["passwd"] = array("text", (string) $this->passwd);
590  }
591  break;
592 
593  case IL_PASSWD_MD5:
594  $update_array["i2passwd"] = array("text", (string) "");
595  $update_array["passwd"] = array("text", (string) $this->passwd);
596  break;
597 
598  case IL_PASSWD_CRYPT:
599  $update_array["i2passwd"] = array("text", (string) $this->passwd);
600  $update_array["passwd"] = array("text", (string) "");
601  break;
602 
603  default :
604  $ilErr->raiseError("<b>Error: passwd_type missing in function update()".$this->id."!</b><br />class: ".
605  get_class($this)."<br />Script: ".__FILE__."<br />Line: ".__LINE__, $ilErr->FATAL);
606  }
607 
608  $ilDB->update("usr_data", $update_array, array("usr_id" => array("integer", $this->id)));
609 
610  $this->writePrefs();
611 
612  // update user defined fields
613  $this->updateUserDefinedFields();
614 
615  parent::update();
616  parent::updateOwner();
617 
618  $this->read();
619 
620  $ilAppEventHandler->raise("Services/User", "afterUpdate",
621  array("user_obj" => $this));
622 
623  return true;
624  }
const IL_PASSWD_PLAIN
getAuthMode($a_auth_key=false)
get auth mode public
const IL_PASSWD_CRYPT
static now()
Return current timestamp in Y-m-d H:i:s format.
read()
loads a record "user" from database private
setInactivationDate($inactivation_date)
setter for inactivation date
getExternalAccount()
get external account
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
writePrefs()
write all userprefs private
const IL_PASSWD_MD5
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 1001 of file class.ilObjUser.php.

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

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

◆ updatePassword()

ilObjUser::updatePassword (   $a_old,
  $a_new1,
  $a_new2 
)

updates password

Parameters
stringold password as plaintext
stringnew password1 as plaintext
stringnew password2 as plaintext
Returns
boolean true on success; otherwise false public

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

References IL_PASSWD_CRYPT, IL_PASSWD_MD5, and IL_PASSWD_PLAIN.

834  {
835  global $ilDB;
836 
837  if (func_num_args() != 3)
838  {
839  return false;
840  }
841 
842  if (!isset($a_old) or !isset($a_new1) or !isset($a_new2))
843  {
844  return false;
845  }
846 
847  if ($a_new1 != $a_new2)
848  {
849  return false;
850  }
851 
852  // is catched by isset() ???
853  if ($a_new1 == "" || $a_old == "")
854  {
855  return false;
856  }
857 
858  //check old password
859  switch ($this->passwd_type)
860  {
861  case IL_PASSWD_PLAIN:
862  if ($a_old != $this->passwd)
863  {
864  return false;
865  }
866  break;
867 
868  case IL_PASSWD_MD5:
869  if (md5($a_old) != $this->passwd)
870  {
871  return false;
872  }
873  break;
874 
875  case IL_PASSWD_CRYPT:
876  if (self::_makeIlias2Password($a_old) != $this->passwd)
877  {
878  return false;
879  }
880  break;
881  }
882 
883  //update password
884  $this->passwd = md5($a_new1);
885  $this->passwd_type = IL_PASSWD_MD5;
886 
887  $ilDB->manipulateF("UPDATE usr_data SET ".
888  "passwd = %s ".
889  "WHERE usr_id = %s",
890  array("text", "integer"), array($this->passwd, $this->id));
891 
892  return true;
893  }
const IL_PASSWD_PLAIN
const IL_PASSWD_CRYPT
const IL_PASSWD_MD5

◆ updateUserDefinedFields()

ilObjUser::updateUserDefinedFields ( )

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

References ilObject\getId().

Referenced by saveAsNew(), and update().

4134  {
4135  global $ilDB;
4136 
4137  $fields = '';
4138 
4139  $field_def = array();
4140 
4141  include_once("./Services/User/classes/class.ilUserDefinedData.php");
4142  $udata = new ilUserDefinedData($this->getId());
4143 
4144  foreach($this->user_defined_data as $field => $value)
4145  {
4146  if($field != 'usr_id')
4147  {
4148 // $field_def[$field] = array('text',$value);
4149  $udata->set($field, $value);
4150  }
4151  }
4152  $udata->update();
4153 
4154 /* if(!$field_def)
4155  {
4156  return true;
4157  }
4158 
4159  $query = "SELECT usr_id FROM udf_data WHERE usr_id = ".$ilDB->quote($this->getId(),'integer');
4160  $res = $ilDB->query($query);
4161 
4162 
4163  if($res->numRows())
4164  {
4165  // Update
4166  $ilDB->update('udf_data',$field_def,array('usr_id' => array('integer',$this->getId())));
4167  }
4168  else
4169  {
4170  $field_def['usr_id'] = array('integer',$this->getId());
4171  $ilDB->insert('udf_data',$field_def);
4172  }
4173 */
4174  return true;
4175  }
Class ilUserDefinedData.
getId()
get object id public
+ 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 $query, $res, and DB_FETCHMODE_OBJECT.

Referenced by ilInfoScreenGUI\addObjectSections(), and ilSoapLearningProgressAdministration\deleteProgress().

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
+ Here is the caller graph for this function:

◆ writeAccepted()

ilObjUser::writeAccepted ( )

write accept date of user agreement to db

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

References ilObject\getId().

Referenced by ilTermsOfServiceHelper\trackAcceptance().

630  {
631  global $ilDB;
632 
633  $ilDB->manipulateF("UPDATE usr_data SET agree_date = ".$ilDB->now().
634  " WHERE usr_id = %s", array("integer"), array($this->getId()));
635  }
getId()
get object id public
+ 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 1083 of file class.ilObjUser.php.

References setPref().

Referenced by activateDeletionFlag(), and removeDeletionFlag().

1084  {
1085  self::_writePref($this->id, $a_keyword, $a_value);
1086  $this->setPref($a_keyword, $a_value);
1087  }
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 1160 of file class.ilObjUser.php.

References _deleteAllPref().

Referenced by update().

1161  {
1162  global $ilDB;
1163 
1164  ilObjUser::_deleteAllPref($this->id);
1165  foreach ($this->prefs as $keyword => $value)
1166  {
1167  self::_writePref($this->id, $keyword, $value);
1168  }
1169  }
_deleteAllPref($a_user_id)
Deletes a userpref value of the user from the database public.
+ 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 76 of file class.ilObjUser.php.

Referenced by getAgreeDate().

◆ $approve_date

ilObjUser::$approve_date = null

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

Referenced by getApproveDate().

◆ $auth_mode

ilObjUser::$auth_mode

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

Referenced by getAuthMode().

◆ $birthday

ilObjUser::$birthday
protected

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

Referenced by getBirthday().

◆ $city

ilObjUser::$city

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

Referenced by getCity().

◆ $client_ip

ilObjUser::$client_ip

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

Referenced by getClientIP().

◆ $country

ilObjUser::$country

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

Referenced by getCountry().

◆ $default_role

ilObjUser::$default_role

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

◆ $delicious

ilObjUser::$delicious

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

Referenced by getDelicious().

◆ $department

ilObjUser::$department

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

Referenced by getDepartment().

◆ $email

ilObjUser::$email

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

Referenced by getEmail().

◆ $fax

ilObjUser::$fax

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

Referenced by getFax().

◆ $firstname

ilObjUser::$firstname

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

Referenced by getFirstname().

◆ $fullname

ilObjUser::$fullname

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

Referenced by _lookupFullname().

◆ $gender

ilObjUser::$gender

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

Referenced by getGender().

◆ $hobby

ilObjUser::$hobby

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

Referenced by getHobby().

◆ $ilias

ilObjUser::$ilias

◆ $im_aim

ilObjUser::$im_aim

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

◆ $im_icq

ilObjUser::$im_icq

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

◆ $im_jabber

ilObjUser::$im_jabber

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

◆ $im_msn

ilObjUser::$im_msn

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

◆ $im_skype

ilObjUser::$im_skype

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

◆ $im_voip

ilObjUser::$im_voip

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

◆ $im_yahoo

ilObjUser::$im_yahoo

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

◆ $inactivation_date

ilObjUser::$inactivation_date = null
protected

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

Referenced by getInactivationDate(), and setInactivationDate().

◆ $institution

ilObjUser::$institution

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

Referenced by getInstitution().

◆ $is_desktop_item_cache

ilObjUser::$is_desktop_item_cache
static

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

◆ $is_desktop_item_loaded

ilObjUser::$is_desktop_item_loaded
static

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

◆ $is_self_registered

ilObjUser::$is_self_registered = false
private

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

Referenced by isSelfRegistered().

◆ $last_password_change_ts

ilObjUser::$last_password_change_ts

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

Referenced by getLastPasswordChangeTS().

◆ $lastname

ilObjUser::$lastname

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

Referenced by getLastname(), and setFullname().

◆ $latitude

ilObjUser::$latitude

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

Referenced by getLatitude().

◆ $loc_zoom

ilObjUser::$loc_zoom

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

Referenced by getLocationZoom().

◆ $login

ilObjUser::$login

all user related data in single vars public

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

Referenced by getLogin(), getLoginByUserId(), and getLoginFromAuth().

◆ $login_attempts

ilObjUser::$login_attempts

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

Referenced by _getLoginAttempts(), and getLoginAttempts().

◆ $longitude

ilObjUser::$longitude

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

Referenced by getLongitude().

◆ $matriculation

ilObjUser::$matriculation

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

Referenced by getMatriculation().

◆ $passwd

ilObjUser::$passwd

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

Referenced by getPasswd(), and saveAsNew().

◆ $passwd_type

ilObjUser::$passwd_type

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

Referenced by getPasswdType().

◆ $personal_image_cache

ilObjUser::$personal_image_cache = array()
staticprotected

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

◆ $phone_home

ilObjUser::$phone_home

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

Referenced by getPhoneHome().

◆ $phone_mobile

ilObjUser::$phone_mobile

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

Referenced by getPhoneMobile().

◆ $phone_office

ilObjUser::$phone_office

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

Referenced by getPhoneOffice().

◆ $prefs

ilObjUser::$prefs

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

Referenced by _getPreferences(), and readPrefs().

◆ $referral_comment

ilObjUser::$referral_comment

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

Referenced by getComment().

◆ $sel_country

ilObjUser::$sel_country

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

Referenced by getSelectedCountry().

◆ $skin

ilObjUser::$skin

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

Referenced by ilObjUser().

◆ $street

ilObjUser::$street

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

Referenced by getStreet().

◆ $user_defined_data

ilObjUser::$user_defined_data = array()

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

◆ $utitle

ilObjUser::$utitle

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

Referenced by getUTitle().

◆ $zipcode

ilObjUser::$zipcode

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

Referenced by getZipcode().


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