ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjUser Class Reference

User class. More...

+ Inheritance diagram for ilObjUser:
+ Collaboration diagram for ilObjUser:

Public Member Functions

 __construct (int $a_user_id=0, bool $a_call_by_reference=false)
 
 read ()
 
 getPasswordEncodingType ()
 
 setPasswordEncodingType (?string $password_encryption_type)
 
 getPasswordSalt ()
 
 setPasswordSalt (?string $password_salt)
 
 assignData (array $a_data)
 loads a record "user" from array More...
 
 saveAsNew ()
 
 update ()
 
 writeAccepted ()
 write accept date of user agreement More...
 
 refreshLogin ()
 updates the login data of a "user" More...
 
 resetPassword (string $raw, string $raw_retype)
 Resets the user password. More...
 
 updateLogin (string $a_login)
 update login name More...
 
 writePref (string $a_keyword, string $a_value)
 
 deletePref (string $a_keyword)
 
 writePrefs ()
 
 getTimeZone ()
 
 getTimeFormat ()
 
 getDateFormat ()
 
 setPref (string $a_keyword, ?string $a_value)
 
 getPref (string $a_keyword)
 
 existsPref (string $a_keyword)
 
 readPrefs ()
 
 delete ()
 
 setFullname ()
 builds a string with title + firstname + lastname method is used to build fullname in member variable $this->fullname. More...
 
 getFullname (int $a_max_strlen=0)
 
 setLogin (string $a_str)
 
 getLogin ()
 
 setPasswd (string $a_str, string $a_type=ilObjUser::PASSWD_PLAIN)
 
 getPasswd ()
 
 getPasswdType ()
 
 setGender (string $a_str)
 
 getGender ()
 
 setUTitle (string $a_str)
 set user title (note: don't mix up this method with setTitle() that is derived from ilObject and sets the user object's title) More...
 
 getUTitle ()
 
 setFirstname (string $a_str)
 
 getFirstname ()
 
 setLastname (string $a_str)
 
 getLastname ()
 
 setInstitution (string $a_str)
 
 getInstitution ()
 
 setDepartment (string $a_str)
 
 getDepartment ()
 
 setStreet (string $a_str)
 
 getStreet ()
 
 setCity (string $a_str)
 
 getCity ()
 
 setZipcode (string $a_str)
 
 getZipcode ()
 
 setCountry (string $a_str)
 
 getCountry ()
 
 setSelectedCountry (string $a_val)
 Set selected country (selection drop down) More...
 
 getSelectedCountry ()
 Get selected country (selection drop down) More...
 
 setPhoneOffice (string $a_str)
 
 getPhoneOffice ()
 
 setPhoneHome (string $a_str)
 
 getPhoneHome ()
 
 setPhoneMobile (string $a_str)
 
 getPhoneMobile ()
 
 setFax (string $a_str)
 
 getFax ()
 
 setClientIP (string $a_str)
 
 getClientIP ()
 
 setMatriculation (string $a_str)
 
 getMatriculation ()
 
 setEmail (string $a_str)
 
 getEmail ()
 
 getSecondEmail ()
 
 setSecondEmail (?string $second_email)
 
 setHobby (string $a_str)
 
 getHobby ()
 
 setLanguage (string $a_str)
 
 getLanguage ()
 
 setLastPasswordChangeTS (int $a_last_password_change_ts)
 
 getLastPasswordChangeTS ()
 
 getPasswordPolicyResetStatus ()
 
 setPasswordPolicyResetStatus (bool $status)
 
 getCurrentLanguage ()
 returns the current language (may differ from user's pref setting!) More...
 
 setCurrentLanguage (string $a_val)
 Set current language. More...
 
 setLastLogin (string $a_str)
 
 getLastLogin ()
 
 setFirstLogin (string $a_str)
 
 getFirstLogin ()
 
 setLastProfilePrompt (string $a_str)
 
 getLastProfilePrompt ()
 
 setLastUpdate (string $a_str)
 
 getLastUpdate ()
 
 setComment (string $a_str)
 
 getComment ()
 
 setApproveDate (?string $a_str)
 set date the user account was activated null indicates that the user has not yet been activated More...
 
 getApproveDate ()
 
 getAgreeDate ()
 
 setAgreeDate (?string $a_str)
 
 setActive (bool $a_active, int $a_owner=0)
 set user active state and updates system fields appropriately More...
 
 getActive ()
 
 syncActive ()
 synchronizes current and stored user active values for the owner value to be set correctly, this function should only be called when an admin is approving a user account More...
 
 getStoredActive (int $a_id)
 get user active state More...
 
 setSkin (string $a_str)
 
 setTimeLimitOwner (int $a_owner)
 
 getTimeLimitOwner ()
 
 setTimeLimitFrom (?int $a_from)
 
 getTimeLimitFrom ()
 
 setTimeLimitUntil (?int $a_until)
 
 getTimeLimitUntil ()
 
 setTimeLimitUnlimited (bool $a_unlimited)
 
 getTimeLimitUnlimited ()
 
 setTimeLimitMessage (string $a_time_limit_message)
 
 getTimeLimitMessage ()
 
 setLoginAttempts (int $a_login_attempts)
 
 getLoginAttempts ()
 
 checkTimeLimit ()
 
 setProfileIncomplete (bool $a_prof_inc)
 
 getProfileIncomplete ()
 
 isPasswordChangeDemanded ()
 
 isPasswordExpired ()
 
 getPasswordAge ()
 
 setLastPasswordChangeToNow ()
 
 resetLastPasswordChange ()
 
 setLatitude (?string $a_latitude)
 
 getLatitude ()
 
 setLongitude (?string $a_longitude)
 
 getLongitude ()
 
 setLocationZoom (?int $a_locationzoom)
 
 getLocationZoom ()
 
 checkUserId ()
 check user id with login name More...
 
 isCurrentUserActive ()
 
 getLoginByUserId (int $a_userid)
 
 addObjectToClipboard (int $a_item_id, string $a_type, string $a_title, int $a_parent=0, string $a_time="", int $a_order_nr=0)
 add an item to user's personal clipboard More...
 
 addToPCClipboard (string $a_content, string $a_time, int $a_nr)
 Add a page content item to PC clipboard (should go to another class) More...
 
 getPCClipboardContent ()
 Add a page content item to PC clipboard (should go to another class) More...
 
 clipboardHasObjectsOfType (string $a_type)
 Check whether clipboard has objects of a certain type. More...
 
 clipboardDeleteObjectsOfType (string $a_type)
 
 clipboardDeleteAll ()
 
 getClipboardObjects (string $a_type="", bool $a_top_nodes_only=false)
 get all clipboard objects of user and specified type More...
 
 getClipboardChilds (int $a_parent, string $a_insert_time)
 Get children of an item. More...
 
 removeObjectFromClipboard (int $a_item_id, string $a_type)
 
 getOrgUnitsRepresentation ()
 
 setAuthMode (?string $a_str)
 
 getAuthMode (bool $a_auth_key=false)
 
 setExternalAccount (string $a_str)
 
 getExternalAccount ()
 
 getPersonalPicturePath (string $a_size="small", bool $a_force_pic=false)
 
 getAvatar ()
 
 removeUserPicture (bool $a_do_update=true)
 
 setUserDefinedData (array $a_data)
 
 getUserDefinedData ()
 
 updateUserDefinedFields ()
 
 readUserDefinedFields ()
 
 deleteUserDefinedFieldEntries ()
 
 hasPublicProfile ()
 returns true if public is profile, false otherwise More...
 
 getPublicName ()
 returns firstname lastname and login if profile is public, login otherwise More...
 
 setBirthday (?string $a_birthday)
 
 getBirthday ()
 
 resetOwner ()
 
 exportPersonalData ()
 
 getPersonalDataExportFile ()
 
 sendPersonalDataFile ()
 
 importPersonalData (array $a_file, bool $a_profile_data, bool $a_settings, bool $a_notes, bool $a_calendar)
 
 setInactivationDate (?string $inactivation_date)
 
 getInactivationDate ()
 
 hasToAcceptTermsOfService ()
 
 hasToAcceptTermsOfServiceInSession (?bool $status=null)
 
 isAnonymous ()
 
 activateDeletionFlag ()
 
 removeDeletionFlag ()
 
 hasDeletionFlag ()
 
 setIsSelfRegistered (bool $status)
 
 isSelfRegistered ()
 
 setGeneralInterests (?array $value=null)
 
 getGeneralInterests ()
 
 getGeneralInterestsAsText ()
 Get general interests as plain text. More...
 
 setOfferingHelp (?array $value=null)
 
 getOfferingHelp ()
 
 getOfferingHelpAsText ()
 Get help offering as plain text. More...
 
 setLookingForHelp (?array $value=null)
 
 getLookingForHelp ()
 
 getLookingForHelpAsText ()
 Get help looking for as plain text. More...
 
 updateMultiTextFields (bool $a_create=false)
 
- Public Member Functions inherited from ilObject
 __construct (int $id=0, bool $reference=true)
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $desc)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

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

Data Fields

const PASSWD_PLAIN = "plain"
 
const PASSWD_CRYPTED = "crypted"
 
string $login = ''
 
string $gender = ""
 
string $utitle = ""
 
string $firstname = ""
 
string $lastname = ""
 
string $fullname = ""
 
string $institution = ""
 
string $department = ""
 
string $street = ""
 
string $city = ""
 
string $zipcode = ""
 
string $country = ""
 
string $sel_country = ""
 
string $phone_office = ""
 
string $phone_home = ""
 
string $phone_mobile = ""
 
string $fax = ""
 
string $email = ""
 
string $hobby = ""
 
string $matriculation = ""
 
string $referral_comment = ""
 
string $approve_date = null
 
string $agree_date = null
 
int $active = 0
 
string $client_ip = ""
 
string $auth_mode = null
 
string $latitude = null
 
string $longitude = null
 
string $loc_zoom = null
 
int $last_password_change_ts = 0
 
int $login_attempts = 0
 
array $user_defined_data = array()
 
array $prefs = []
 
string $skin = ""
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 

Protected Member Functions

 buildTextFromArray (array $a_attr)
 Convert multi-text values to plain text. More...
 
 readMultiTextFields ()
 
 deleteMultiTextFields ()
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 

Protected Attributes

string $ext_account = ""
 
string $time_limit_message = ""
 
bool $time_limit_unlimited = false
 
int $time_limit_until = null
 
int $time_limit_from = null
 
int $time_limit_owner = null
 
string $last_login = ""
 
string $passwd = ""
 
string $passwd_type = ""
 
string $password_encoding_type = null
 
string $password_salt = null
 
string $birthday = null
 
string $second_email = null
 
bool $passwd_policy_reset = false
 
array $oldPrefs = []
 
string $inactivation_date = null
 
string $org_units = ""
 
array $interests_general = []
 
array $interests_help_offered = []
 
array $interests_help_looking = []
 
string $last_profile_prompt = ""
 
string $first_login = ""
 
bool $profile_incomplete = false
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
int $id
 
bool $referenced
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
bool $offline = false
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Static Protected Attributes

static array $personal_image_cache = array()
 

Static Private Member Functions

static _lookup (int $a_user_id, string $a_field)
 
static getLoginFromAuth ()
 Gets the username from $ilAuth, and converts it into an ILIAS login name. More...
 

Private Attributes

bool $is_self_registered = false
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

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

114  {
115  global $DIC;
116 
117  $ilias = $DIC['ilias'];
118  $this->ilias = $ilias;
119  $this->db = $DIC->database();
120  $this->type = "usr";
121  parent::__construct($a_user_id, $a_call_by_reference);
122  $this->auth_mode = "default";
123  $this->passwd_type = self::PASSWD_PLAIN;
124  if ($a_user_id > 0) {
125  $this->setId($a_user_id);
126  $this->read();
127  } else {
128  $this->prefs = array();
129  $this->prefs["language"] = $this->ilias->ini->readVariable("language", "default");
130  $this->skin = $this->ilias->ini->readVariable("layout", "skin");
131  $this->prefs["skin"] = $this->skin;
132  $this->prefs["style"] = $this->ilias->ini->readVariable("layout", "style");
133  }
134 
135  $this->app_event_handler = $DIC['ilAppEventHandler'];
136  }
ILIAS $ilias
setId(int $id)
global $DIC
Definition: feed.php:28
header include for all ilias files.
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _checkExternalAuthAccount()

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

check whether external account and authentication method matches with a user

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

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

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

2704  : ?string {
2705  $db = $GLOBALS['DIC']->database();
2706  $settings = $GLOBALS['DIC']->settings();
2707 
2708  // Check directly with auth_mode
2709  $r = $db->queryF(
2710  "SELECT * FROM usr_data WHERE " .
2711  " ext_account = %s AND auth_mode = %s",
2712  array("text", "text"),
2713  array($a_account, $a_auth)
2714  );
2715  if ($usr = $db->fetchAssoc($r)) {
2716  return $usr["login"];
2717  }
2718 
2719  if (!$tryFallback) {
2720  return null;
2721  }
2722 
2723  // For compatibility, check for login (no ext_account entry given)
2724  $res = $db->queryF(
2725  "SELECT login FROM usr_data " .
2726  "WHERE login = %s AND auth_mode = %s AND (ext_account IS NULL OR ext_account = '') ",
2727  array("text", "text"),
2728  array($a_account, $a_auth)
2729  );
2730  if ($usr = $db->fetchAssoc($res)) {
2731  return $usr['login'];
2732  }
2733 
2734  // If auth_default == $a_auth => check for login
2735  if (ilAuthUtils::_getAuthModeName($settings->get('auth_mode')) == $a_auth) {
2736  $res = $db->queryF(
2737  "SELECT login FROM usr_data WHERE " .
2738  " ext_account = %s AND auth_mode = %s",
2739  array("text", "text"),
2740  array($a_account, "default")
2741  );
2742  if ($usr = $db->fetchAssoc($res)) {
2743  return $usr["login"];
2744  }
2745  // Search for login (no ext_account given)
2746  $res = $db->queryF(
2747  "SELECT login FROM usr_data " .
2748  "WHERE login = %s AND (ext_account IS NULL OR ext_account = '') AND auth_mode = %s",
2749  array("text", "text"),
2750  array($a_account, "default")
2751  );
2752  if ($usr = $db->fetchAssoc($res)) {
2753  return $usr["login"];
2754  }
2755  }
2756  return null;
2757  }
$res
Definition: ltiservices.php:69
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
fetchAssoc(ilDBStatement $statement)
static _getAuthModeName($a_auth_key)
ilDBInterface $db
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
queryF(string $query, array $types, array $values)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _deleteAllPref()

static ilObjUser::_deleteAllPref ( int  $a_user_id)
static

Deletes a userpref value of the user from the database.

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

References $DIC, and $ilDB.

949  : void
950  {
951  global $DIC;
952 
953  $ilDB = $DIC->database();
954 
955  $ilDB->manipulateF(
956  "DELETE FROM usr_pref WHERE usr_id = %s",
957  array("integer"),
958  array($a_user_id)
959  );
960  }
global $DIC
Definition: feed.php:28

◆ _deletePref()

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

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

References $DIC, and $ilDB.

933  : void
934  {
935  global $DIC;
936 
937  $ilDB = $DIC->database();
938 
939  $ilDB->manipulateF(
940  'DELETE FROM usr_pref WHERE usr_id = %s AND keyword = %s',
941  array('integer', 'text'),
942  array($a_user_id, $a_keyword)
943  );
944  }
global $DIC
Definition: feed.php:28

◆ _doesLoginnameExistInHistory()

static ilObjUser::_doesLoginnameExistInHistory ( string  $a_login)
static

Checks whether the passed loginname already exists in history.

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

References $DIC, $ilDB, and $res.

Referenced by ilAccountRegistrationGUI\saveForm().

794  : bool
795  {
796  global $DIC;
797 
798  $ilDB = $DIC->database();
799 
800  $res = $ilDB->queryF(
801  '
802  SELECT * FROM loginname_history
803  WHERE login = %s',
804  array('text'),
805  array($a_login)
806  );
807 
808  return (bool) $ilDB->fetchAssoc($res);
809  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _externalAccountExists()

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

Check if an external account name already exists.

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

References $DIC, $ilDB, and $res.

3237  : bool {
3238  global $DIC;
3239 
3240  $ilDB = $DIC['ilDB'];
3241 
3242  $res = $ilDB->queryF(
3243  "SELECT * FROM usr_data " .
3244  "WHERE ext_account = %s AND auth_mode = %s",
3245  array("text", "text"),
3246  array($a_external_account, $a_auth_mode)
3247  );
3248  return (bool) $ilDB->fetchAssoc($res);
3249  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28

◆ _generateRegistrationHash()

static ilObjUser::_generateRegistrationHash ( int  $a_usr_id)
static

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

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

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

3677  : string
3678  {
3679  global $DIC;
3680 
3681  $ilDB = $DIC['ilDB'];
3682 
3683  do {
3684  $continue = false;
3685 
3686  $hashcode = substr(md5(uniqid(mt_rand(), true)), 0, 16);
3687 
3688  $res = $ilDB->queryf(
3689  '
3690  SELECT COUNT(usr_id) cnt FROM usr_data
3691  WHERE reg_hash = %s',
3692  array('text'),
3693  array($hashcode)
3694  );
3695  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
3696  if ($row->cnt > 0) {
3697  $continue = true;
3698  }
3699  break;
3700  }
3701 
3702  if ($continue) {
3703  continue;
3704  }
3705 
3706  $ilDB->manipulateF(
3707  '
3708  UPDATE usr_data
3709  SET reg_hash = %s
3710  WHERE usr_id = %s',
3711  array('text', 'integer'),
3712  array($hashcode, $a_usr_id)
3713  );
3714 
3715  break;
3716  } while (true);
3717 
3718  return $hashcode;
3719  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28

◆ _getAllUserAssignedStyles()

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

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

References $DIC, and $ilDB.

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

2262  : array
2263  {
2264  global $DIC;
2265 
2266  $ilDB = $DIC['ilDB'];
2267 
2268  $q = "SELECT DISTINCT up1.value style, up2.value skin FROM usr_pref up1, usr_pref up2 " .
2269  " WHERE up1.keyword = " . $ilDB->quote("style", "text") .
2270  " AND up2.keyword = " . $ilDB->quote("skin", "text") .
2271  " AND up1.usr_id = up2.usr_id";
2272 
2273  $sty_set = $ilDB->query($q);
2274 
2275  $styles = array();
2276  while ($sty_rec = $ilDB->fetchAssoc($sty_set)) {
2277  $styles[] = $sty_rec["skin"] . ":" . $sty_rec["style"];
2278  }
2279 
2280  return $styles;
2281  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _getAllUserData()

static ilObjUser::_getAllUserData ( ?array  $a_fields = null,
int  $active = -1 
)
static
Parameters
?array$a_fields
int$activeall kind of undocumented options, see code, needs refactoring
Returns
array

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

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

2141  : array {
2142  global $DIC;
2143 
2144  $ilDB = $DIC['ilDB'];
2145 
2146  $result_arr = array();
2147 
2148  if ($a_fields !== null and is_array($a_fields)) {
2149  if (count($a_fields) == 0) {
2150  $select = "*";
2151  } else {
2152  if (($usr_id_field = array_search("usr_id", $a_fields)) !== false) {
2153  unset($a_fields[$usr_id_field]);
2154  }
2155 
2156  $select = implode(",", $a_fields) . ",usr_data.usr_id";
2157  // online time
2158  if (in_array('online_time', $a_fields)) {
2159  $select .= ",ut_online.online_time ";
2160  }
2161  }
2162 
2163  $q = "SELECT " . $select . " FROM usr_data ";
2164 
2165  // Add online_time if desired
2166  // Need left join here to show users that never logged in
2167  if (in_array('online_time', $a_fields)) {
2168  $q .= "LEFT JOIN ut_online ON usr_data.usr_id = ut_online.usr_id ";
2169  }
2170 
2171  switch ($active) {
2172  case 0:
2173  case 1:
2174  $q .= "WHERE active = " . $ilDB->quote($active, "integer");
2175  break;
2176  case 2:
2177  $q .= "WHERE time_limit_unlimited= " . $ilDB->quote(0, "integer");
2178  break;
2179  case 3:
2180  $qtemp = $q . ", rbac_ua, object_data WHERE rbac_ua.rol_id = object_data.obj_id AND " .
2181  $ilDB->like("object_data.title", "text", "%crs%") . " AND usr_data.usr_id = rbac_ua.usr_id";
2182  $r = $ilDB->query($qtemp);
2183  $course_users = array();
2184  while ($row = $ilDB->fetchAssoc($r)) {
2185  $course_users[] = $row["usr_id"];
2186  }
2187  if (count($course_users)) {
2188  $q .= " WHERE " . $ilDB->in("usr_data.usr_id", $course_users, true, "integer") . " ";
2189  } else {
2190  return $result_arr;
2191  }
2192  break;
2193  case 4:
2194  $session_data = ilSession::get('user_filter_data');
2195  $date = strftime("%Y-%m-%d %H:%I:%S", mktime(0, 0, 0, $session_data["m"], $session_data["d"], $session_data["y"]));
2196  $q .= " AND last_login < " . $ilDB->quote($date, "timestamp");
2197  break;
2198  case 5:
2199  $ref_id = ilSession::get('user_filter_data');
2200  if ($ref_id) {
2201  $q .= " LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id " .
2202  "WHERE obj_members.obj_id = (SELECT obj_id FROM object_reference " .
2203  "WHERE ref_id = " . $ilDB->quote($ref_id, "integer") . ") ";
2204  }
2205  break;
2206  case 6:
2207  global $DIC;
2208 
2209  $rbacreview = $DIC['rbacreview'];
2210  $ref_id = ilSession::get('user_filter_data');
2211  if ($ref_id) {
2212  $local_roles = $rbacreview->getRolesOfRoleFolder($ref_id, false);
2213  if (is_array($local_roles) && count($local_roles)) {
2214  $q .= " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE " .
2215  $ilDB->in("rbac_ua.rol_id", $local_roles, false, "integer") . " ";
2216  }
2217  }
2218  break;
2219  case 7:
2220  $rol_id = ilSession::get('user_filter_data');
2221  if ($rol_id) {
2222  $q .= " LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id = " .
2223  $ilDB->quote($rol_id, "integer");
2224  }
2225  break;
2226  }
2227  $r = $ilDB->query($q);
2228 
2229  while ($row = $ilDB->fetchAssoc($r)) {
2230  $result_arr[] = $row;
2231  }
2232  }
2233 
2234  return $result_arr;
2235  }
static get(string $a_var)
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ _getAvatar()

static ilObjUser::_getAvatar ( int  $a_usr_id)
static

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

References ANONYMOUS_USER_ID.

Referenced by ilWikiContributorsTableGUI\fillRow(), and ilNoteGUI\getItemForNote().

2881  : Avatar
2882  {
2883  $define = new ilUserAvatarResolver($a_usr_id ?: ANONYMOUS_USER_ID);
2884  return $define->getAvatar();
2885  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
This describes how a letter or a picture avatar could be modified during construction of UI...
Definition: Avatar.php:28
Class ilUserAvatarResolver.
+ Here is the caller graph for this function:

◆ _getExternalAccountsByAuthMode()

static ilObjUser::_getExternalAccountsByAuthMode ( string  $a_auth_mode,
bool  $a_read_auth_default = false 
)
static

Get list of external account by authentication method Note: If login == ext_account for two user with auth_mode 'default' and auth_mode 'ldap' The ldap auth mode chosen.

Parameters
bool$a_read_auth_defaultalso get users with authentication method 'default'

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

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

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

2635  : array {
2636  global $DIC;
2637 
2638  $ilDB = $DIC['ilDB'];
2639  $ilSetting = $DIC['ilSetting'];
2640 
2641  $q = "SELECT login,usr_id,ext_account,auth_mode FROM usr_data " .
2642  "WHERE auth_mode = %s";
2643  $types[] = "text";
2644  $values[] = $a_auth_mode;
2645  if ($a_read_auth_default and ilAuthUtils::_getAuthModeName($ilSetting->get('auth_mode', ilAuthUtils::AUTH_LOCAL)) == $a_auth_mode) {
2646  $q .= " OR auth_mode = %s ";
2647  $types[] = "text";
2648  $values[] = 'default';
2649  }
2650 
2651  $res = $ilDB->queryF($q, $types, $values);
2652  $accounts = [];
2653  while ($row = $ilDB->fetchObject($res)) {
2654  if ($row->auth_mode == 'default') {
2655  $accounts[$row->usr_id] = $row->login;
2656  } else {
2657  $accounts[$row->usr_id] = $row->ext_account;
2658  }
2659  }
2660  return $accounts;
2661  }
$res
Definition: ltiservices.php:69
static _getAuthModeName($a_auth_key)
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getFeedPass()

static ilObjUser::_getFeedPass ( int  $a_user_id)
static

Lookup news feed password for user.

Returns
?string feed_password md5-encoded, or false
Todo:
move to news service

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

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

3178  : ?string {
3179  if ($a_user_id > 0) {
3180  return self::_lookupPref($a_user_id, "priv_feed_pass");
3181  }
3182  return null;
3183  }
+ Here is the caller graph for this function:

◆ _getImportedUserId()

static ilObjUser::_getImportedUserId ( string  $i2_id)
static

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

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

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

2573  : int {
2574  global $DIC;
2575 
2576  $ilDB = $DIC['ilDB'];
2577 
2578  $query = "SELECT obj_id FROM object_data WHERE import_id = " .
2579  $ilDB->quote($i2_id, "text");
2580 
2581  $res = $ilDB->query($query);
2582  $id = 0;
2583  while ($row = $ilDB->fetchObject($res)) {
2584  $id = (int) $row->obj_id;
2585  }
2586  return $id;
2587  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getLastHistoryDataByUserId()

static ilObjUser::_getLastHistoryDataByUserId ( int  $a_usr_id)
static

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

Throws an ilUserException in case no entry could be found.

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

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

References $DIC, $ilDB, and $res.

Referenced by ilObjUserGUI\initForm().

817  : array
818  {
819  global $DIC;
820 
821  $ilDB = $DIC['ilDB'];
822 
823  $ilDB->setLimit(1, 0);
824  $res = $ilDB->queryF(
825  '
826  SELECT login, history_date FROM loginname_history
827  WHERE usr_id = %s ORDER BY history_date DESC',
828  array('integer'),
829  array($a_usr_id)
830  );
831  $row = $ilDB->fetchAssoc($res);
832  if (!is_array($row) || !count($row)) {
833  throw new ilUserException('');
834  }
835 
836  return array(
837  $row['login'], $row['history_date']
838  );
839  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _getLocalAccountsForEmail()

static ilObjUser::_getLocalAccountsForEmail ( string  $a_email)
static

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

References $DIC, $ilDB, and $ilSetting.

2778  : array // Missing array type.
2779  {
2780  global $DIC;
2781 
2782  $ilDB = $DIC['ilDB'];
2783  $ilSetting = $DIC['ilSetting'];
2784 
2785  // default set to local (1)?
2786 
2787  $q = "SELECT * FROM usr_data WHERE " .
2788  " email = %s AND (auth_mode = %s ";
2789  $types = array("text", "text");
2790  $values = array($a_email, "local");
2791 
2792  if ($ilSetting->get("auth_mode") == 1) {
2793  $q .= " OR auth_mode = %s";
2794  $types[] = "text";
2795  $values[] = "default";
2796  }
2797 
2798  $q .= ")";
2799 
2800  $users = array();
2801  $usr_set = $ilDB->queryF($q, $types, $values);
2802  while ($usr_rec = $ilDB->fetchAssoc($usr_set)) {
2803  $users[$usr_rec["usr_id"]] = $usr_rec["login"];
2804  }
2805 
2806  return $users;
2807  }
global $DIC
Definition: feed.php:28
global $ilSetting
Definition: privfeed.php:17

◆ _getLoginAttempts()

static ilObjUser::_getLoginAttempts ( int  $a_usr_id)
static

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

References $DIC, $ilDB, and $query.

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

3499  : int {
3500  global $DIC;
3501 
3502  $ilDB = $DIC['ilDB'];
3503 
3504  $query = "SELECT login_attempts FROM usr_data WHERE usr_id = %s";
3505  $result = $ilDB->queryF($query, array('integer'), array($a_usr_id));
3506  $record = $ilDB->fetchAssoc($result);
3507  return (int) ($record['login_attempts'] ?? 0);
3508  }
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ _getNumberOfUsersForStyle()

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

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

References $DIC, and $ilDB.

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

2240  : int {
2241  global $DIC;
2242 
2243  $ilDB = $DIC['ilDB'];
2244 
2245  $q = "SELECT count(*) as cnt FROM usr_pref up1, usr_pref up2 " .
2246  " WHERE up1.keyword= " . $ilDB->quote("style", "text") .
2247  " AND up1.value= " . $ilDB->quote($a_style, "text") .
2248  " AND up2.keyword= " . $ilDB->quote("skin", "text") .
2249  " AND up2.value= " . $ilDB->quote($a_skin, "text") .
2250  " AND up1.usr_id = up2.usr_id ";
2251 
2252  $cnt_set = $ilDB->query($q);
2253 
2254  $cnt_rec = $ilDB->fetchAssoc($cnt_set);
2255 
2256  return (int) $cnt_rec["cnt"];
2257  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _getNumberOfUsersPerAuthMode()

static ilObjUser::_getNumberOfUsersPerAuthMode ( )
static

get number of users per auth mode

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

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

Referenced by ilObjAuthSettingsGUI\authSettingsObject().

2762  : array // Missing array type.
2763  {
2764  global $DIC;
2765 
2766  $ilDB = $DIC['ilDB'];
2767 
2768  $r = $ilDB->query("SELECT count(*) AS cnt, auth_mode FROM usr_data " .
2769  "GROUP BY auth_mode");
2770  $cnt_arr = array();
2771  while ($cnt = $ilDB->fetchAssoc($r)) {
2772  $cnt_arr[$cnt["auth_mode"]] = (int) $cnt["cnt"];
2773  }
2774 
2775  return $cnt_arr;
2776  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getPersonalPicturePath()

static ilObjUser::_getPersonalPicturePath ( int  $a_usr_id,
string  $a_size = "small",
bool  $a_force_pic = false,
bool  $a_prevent_no_photo_image = false,
bool  $html_export = false 
)
static
Parameters
string$a_size"small", "xsmall" or "xxsmall"
Exceptions
ilWACException

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

References ilWACSignedPath\signFile().

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

2897  : string {
2898  $define = new ilUserAvatarResolver($a_usr_id);
2899  $define->setForcePicture($a_force_pic);
2900  $define->setSize($a_size);
2901  return ilWACSignedPath::signFile($define->getLegacyPictureURL());
2902  }
Class ilUserAvatarResolver.
static signFile(string $path_to_file)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getPreferences()

static ilObjUser::_getPreferences ( int  $user_id)
static

get preferences for user

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

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

References $DIC, $ilDB, and $prefs.

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

3450  : array
3451  {
3452  global $DIC;
3453 
3454  $ilDB = $DIC['ilDB'];
3455 
3456  $prefs = array();
3457 
3458  $r = $ilDB->queryF(
3459  "SELECT * FROM usr_pref WHERE usr_id = %s",
3460  array("integer"),
3461  array($user_id)
3462  );
3463 
3464  while ($row = $ilDB->fetchAssoc($r)) {
3465  $prefs[$row["keyword"]] = $row["value"];
3466  }
3467 
3468  return $prefs;
3469  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _getUserData()

static ilObjUser::_getUserData ( array  $a_internalids)
static

return user data for given user ids

Parameters
array$a_internalidsof internal ids or numerics

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

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

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

3403  : array
3404  {
3405  global $DIC;
3406 
3407  $ilDB = $DIC['ilDB'];
3408 
3409  $ids = array();
3410  if (is_array($a_internalids)) {
3411  foreach ($a_internalids as $internalid) {
3412  if (is_numeric($internalid)) {
3413  $ids[] = $internalid;
3414  } else {
3415  $parsedid = ilUtil::__extractId($internalid, IL_INST_ID);
3416  if (is_numeric($parsedid) && $parsedid > 0) {
3417  $ids[] = $parsedid;
3418  }
3419  }
3420  }
3421  }
3422  if (count($ids) == 0) {
3423  $ids [] = -1;
3424  }
3425 
3426  $query = "SELECT usr_data.*, usr_pref.value AS language
3427  FROM usr_data
3428  LEFT JOIN usr_pref
3429  ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
3430  WHERE " . $ilDB->in("usr_data.usr_id", $ids, false, "integer");
3431  $values[] = "language";
3432  $types[] = "text";
3433 
3434  $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
3435 
3436  $data = array();
3437  $result = $ilDB->queryF($query, $types, $values);
3438  while ($row = $ilDB->fetchAssoc($result)) {
3439  $data[] = $row;
3440  }
3441  return $data;
3442  }
const IL_INST_ID
Definition: constants.php:40
global $DIC
Definition: feed.php:28
$query
static __extractId(string $ilias_id, int $inst_id)
extract ref id from role title, e.g.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getUserIdsByInactivationPeriod()

static ilObjUser::_getUserIdsByInactivationPeriod ( int  $period)
static

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

Parameters
int$period(in days)
Returns
list<int> A list of user ids
Exceptions
ilException

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

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

Referenced by ilCronDeleteInactivatedUserAccounts\run().

3848  : array {
3850  $field = 'inactivation_date';
3852 
3853  if (!$period) {
3854  throw new ilException('no valid period given');
3855  }
3856 
3857  global $DIC;
3858 
3859  $ilDB = $DIC['ilDB'];
3860 
3861  $date = date('Y-m-d H:i:s', (time() - ($period * 24 * 60 * 60)));
3862 
3863  $query = "SELECT usr_id FROM usr_data WHERE $field < %s AND active = %s";
3864 
3865  $res = $ilDB->queryF($query, ['timestamp', 'integer'], [$date, 0]);
3866 
3867  $ids = [];
3868  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
3869  $ids[] = (int) $row->usr_id;
3870  }
3871 
3872  return $ids;
3873  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getUsersForClipboadObject()

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

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

Returns
int[] array of user IDs

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

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

Referenced by ilObjMediaObject\lookupUsages().

2541  : array {
2542  global $DIC;
2543 
2544  $ilDB = $DIC['ilDB'];
2545 
2546  $q = "SELECT DISTINCT user_id FROM personal_clipboard WHERE " .
2547  "item_id = " . $ilDB->quote($a_id, "integer") . " AND " .
2548  "type = " . $ilDB->quote($a_type, "text");
2549  $user_set = $ilDB->query($q);
2550  $users = array();
2551  while ($user_rec = $ilDB->fetchAssoc($user_set)) {
2552  $users[] = (int) $user_rec["user_id"];
2553  }
2554 
2555  return $users;
2556  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getUsersForFolder()

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

get users for a category or from system folder

Parameters
$active-1 (ignore), 1 = active, 0 = not active user

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

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

Referenced by ilSoapUserAdministration\getUsersForContainer().

3301  : array {
3302  global $DIC;
3303 
3304  $ilDB = $DIC['ilDB'];
3305  $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";
3306  $types[] = "text";
3307  $values[] = "language";
3308 
3309  if (is_numeric($active) && $active > -1) {
3310  $query .= " AND usr_data.active = %s";
3311  $values[] = $active;
3312  $types[] = "integer";
3313  }
3314 
3315  if ($ref_id != USER_FOLDER_ID) {
3316  $query .= " AND usr_data.time_limit_owner = %s";
3317  $values[] = $ref_id;
3318  $types[] = "integer";
3319  }
3320 
3321  $query .= " AND usr_data.usr_id != %s ";
3322  $values[] = ANONYMOUS_USER_ID;
3323  $types[] = "integer";
3324 
3325  $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
3326 
3327  $result = $ilDB->queryF($query, $types, $values);
3328  $data = array();
3329  while ($row = $ilDB->fetchAssoc($result)) {
3330  $data[] = $row;
3331  }
3332 
3333  return $data;
3334  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
const USER_FOLDER_ID
Definition: constants.php:33
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ _getUsersForGroup()

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

return user data for group members

Parameters
int[]$a_mem_ids array of member ids
int$activeactive can be -1 (ignore), 1 = active, 0 = not active user

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

Referenced by ilSoapUserAdministration\getUsersForContainer().

3345  : array {
3346  return self::_getUsersForIds($a_mem_ids, $active);
3347  }
+ Here is the caller graph for this function:

◆ _getUsersForIds()

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

return user data for given user id

Parameters
int[]array of member ids
intactive can be -1 (ignore), 1 = active, 0 = not active user

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

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

Referenced by ilSoapUserAdministration\getUsersForContainer().

3359  : array {
3360  global $DIC;
3361 
3362  $ilDB = $DIC['ilDB'];
3363 
3364  $query = "SELECT usr_data.*, usr_pref.value AS language
3365  FROM usr_data
3366  LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
3367  WHERE " . $ilDB->in("usr_data.usr_id", $a_mem_ids, false, "integer") . "
3368  AND usr_data.usr_id != %s";
3369  $values[] = "language";
3370  $types[] = "text";
3371  $values[] = ANONYMOUS_USER_ID;
3372  $types[] = "integer";
3373 
3374  if (is_numeric($active) && $active > -1) {
3375  $query .= " AND active = %s";
3376  $values[] = $active;
3377  $types[] = "integer";
3378  }
3379 
3380  if ($timelimitowner != USER_FOLDER_ID && $timelimitowner != -1) {
3381  $query .= " AND usr_data.time_limit_owner = %s";
3382  $values[] = $timelimitowner;
3383  $types[] = "integer";
3384  }
3385 
3386  $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
3387 
3388  $result = $ilDB->queryF($query, $types, $values);
3389  $mem_arr = [];
3390  while ($row = $ilDB->fetchAssoc($result)) {
3391  $mem_arr[] = $row;
3392  }
3393 
3394  return $mem_arr;
3395  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
const USER_FOLDER_ID
Definition: constants.php:33
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ _getUsersForRole()

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

return array of complete users which belong to a specific role

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

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

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

Referenced by ilSoapUserAdministration\getUserForRole().

3258  : array {
3259  global $DIC;
3260 
3261  $ilDB = $DIC['ilDB'];
3262  $rbacreview = $DIC['rbacreview'];
3263  $ids = $rbacreview->assignedUsers($role_id);
3264 
3265  if (count($ids) == 0) {
3266  $ids = array(-1);
3267  }
3268 
3269  $query = "SELECT usr_data.*, usr_pref.value AS language
3270  FROM usr_data
3271  LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
3272  WHERE " . $ilDB->in("usr_data.usr_id", $ids, false, "integer");
3273  $values[] = "language";
3274  $types[] = "text";
3275 
3276 
3277  if (is_numeric($active) && $active > -1) {
3278  $query .= " AND usr_data.active = %s";
3279  $values[] = $active;
3280  $types[] = "integer";
3281  }
3282 
3283  $query .= " ORDER BY usr_data.lastname, usr_data.firstname ";
3284 
3285  $r = $ilDB->queryF($query, $types, $values);
3286  $data = array();
3287  while ($row = $ilDB->fetchAssoc($r)) {
3288  $data[] = $row;
3289  }
3290  return $data;
3291  }
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ _getUsersOnline()

static ilObjUser::_getUsersOnline ( int  $a_user_id = 0,
bool  $a_no_anonymous = false 
)
static

reads all active sessions from db and returns users that are online OR returns only one active user if a user_id is given

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

References $DIC, $ilDB, ilObject\$log, ilObject\$user, ANONYMOUS_USER_ID, ilLogger\debug(), ilUserFilter\getInstance(), ilUserAccountSettings\getInstance(), ilLoggerFactory\getLogger(), ilTermsOfServiceHelper\isEnabled(), and SYSTEM_USER_ID.

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

3599  : array {
3600  global $DIC;
3601 
3602  $ilDB = $DIC->database();
3603 
3604  $log = ilLoggerFactory::getLogger("user");
3605 
3606  $pd_set = new ilSetting('pd');
3607  $atime = $pd_set->get('user_activity_time') * 60;
3608  $ctime = time();
3609 
3610  $where = array();
3611 
3612  if ($a_user_id === 0) {
3613  $where[] = 'user_id > 0';
3614  } else {
3615  $where[] = 'user_id = ' . $ilDB->quote($a_user_id, 'integer');
3616  }
3617 
3618  if ($a_no_anonymous) {
3619  $where[] = 'user_id != ' . $ilDB->quote(ANONYMOUS_USER_ID, 'integer');
3620  }
3621 
3622  if (ilUserAccountSettings::getInstance()->isUserAccessRestricted()) {
3623  $where[] = $ilDB->in('time_limit_owner', ilUserFilter::getInstance()->getFolderIds(), false, 'integer');
3624  }
3625 
3626  $where[] = 'expires > ' . $ilDB->quote($ctime, 'integer');
3627  $where[] = '(p.value IS NULL OR NOT p.value = ' . $ilDB->quote('y', 'text') . ')';
3628 
3629  $where = 'WHERE ' . implode(' AND ', $where);
3630 
3631  $r = $ilDB->queryF(
3632  $q = "
3633  SELECT COUNT(user_id) num, user_id, firstname, lastname, title, login, last_login, MAX(ctime) ctime, context, agree_date
3634  FROM usr_session
3635  LEFT JOIN usr_data u
3636  ON user_id = u.usr_id
3637  LEFT JOIN usr_pref p
3638  ON (p.usr_id = u.usr_id AND p.keyword = %s)
3639  $where
3640  GROUP BY user_id, firstname, lastname, title, login, last_login, context, agree_date
3641  ORDER BY lastname, firstname
3642  ",
3643  array('text'),
3644  array('hide_own_online_status')
3645  );
3646 
3647  $log->debug("Query: " . $q);
3648 
3649  $users = array();
3650  while ($user = $ilDB->fetchAssoc($r)) {
3651  if ($atime <= 0 || $user['ctime'] + $atime > $ctime) {
3652  $users[$user['user_id']] = $user;
3653  }
3654  }
3655 
3656  $log->debug("Found users: " . count($users));
3657 
3659  $users = array_filter($users, static function (array $user) {
3660  if ($user['agree_date'] || $user['user_id'] == SYSTEM_USER_ID || 'root' === $user['login']) {
3661  return true;
3662  }
3663 
3664  return false;
3665  });
3666 
3667  $log->debug("TOS filtered to users: " . count($users));
3668  }
3669 
3670  return $users;
3671  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
static getLogger(string $a_component_id)
Get component logger.
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26
debug(string $a_message, array $a_context=array())
global $DIC
Definition: feed.php:28
ilLogger $log
ilObjUser $user
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _incrementLoginAttempts()

static ilObjUser::_incrementLoginAttempts ( int  $a_usr_id)
static

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

References $DIC, $ilDB, and $query.

Referenced by ilAuthFrontend\handleAuthenticationFail().

3512  : bool {
3513  global $DIC;
3514 
3515  $ilDB = $DIC['ilDB'];
3516 
3517  $query = "UPDATE usr_data SET login_attempts = (login_attempts + 1) WHERE usr_id = %s";
3518  $affected = $ilDB->manipulateF($query, array('integer'), array($a_usr_id));
3519 
3520  if ($affected) {
3521  return true;
3522  } else {
3523  return false;
3524  }
3525  }
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ _isAnonymous()

static ilObjUser::_isAnonymous ( int  $usr_id)
static

◆ _loginExists()

static ilObjUser::_loginExists ( string  $a_login,
int  $a_user_id = 0 
)
static

check if a login name already exists You may exclude a user from the check by giving his user id as 2nd paramter

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

References $DIC, and $ilDB.

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

3207  : ?int {
3208  global $DIC;
3209 
3210  $ilDB = $DIC['ilDB'];
3211 
3212  $q = "SELECT DISTINCT login, usr_id FROM usr_data " .
3213  "WHERE login = %s";
3214  $types[] = "text";
3215  $values[] = $a_login;
3216 
3217  if ($a_user_id != 0) {
3218  $q .= " AND usr_id != %s ";
3219  $types[] = "integer";
3220  $values[] = $a_user_id;
3221  }
3222 
3223  $r = $ilDB->queryF($q, $types, $values);
3224 
3225  if ($row = $ilDB->fetchAssoc($r)) {
3226  return (int) $row['usr_id'];
3227  }
3228  return null;
3229  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _lookup()

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

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

References $DIC, $ilDB, and $res.

551  : ?string {
552  global $DIC;
553 
554  $ilDB = $DIC->database();
555 
556  $res = $ilDB->queryF(
557  "SELECT " . $a_field . " FROM usr_data WHERE usr_id = %s",
558  array("integer"),
559  array($a_user_id)
560  );
561 
562  while ($set = $ilDB->fetchAssoc($res)) {
563  return $set[$a_field];
564  }
565  return null;
566  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28

◆ _lookupActive()

static ilObjUser::_lookupActive ( int  $a_usr_id)
static

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

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

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

1675  : bool
1676  {
1677  global $DIC;
1678 
1679  $ilDB = $DIC['ilDB'];
1680 
1681  $query = 'SELECT usr_id FROM usr_data ' .
1682  'WHERE active = ' . $ilDB->quote(1, 'integer') . ' ' .
1683  'AND usr_id = ' . $ilDB->quote($a_usr_id, 'integer');
1684  $res = $ilDB->query($query);
1685  while ($res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1686  return true;
1687  }
1688  return false;
1689  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ _lookupAuthMode()

static ilObjUser::_lookupAuthMode ( int  $a_usr_id)
static

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

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

2691  : string
2692  {
2693  return (string) self::_lookup($a_usr_id, "auth_mode");
2694  }
+ Here is the caller graph for this function:

◆ _lookupClientIP()

static ilObjUser::_lookupClientIP ( int  $a_user_id)
static

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

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

605  : string
606  {
607  return self::_lookup($a_user_id, "client_ip") ?? '';
608  }
+ Here is the caller graph for this function:

◆ _lookupEmail()

static ilObjUser::_lookupEmail ( int  $a_user_id)
static

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

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

595  : string
596  {
597  return self::_lookup($a_user_id, "email") ?? '';
598  }
+ Here is the caller graph for this function:

◆ _lookupExternalAccount()

static ilObjUser::_lookupExternalAccount ( int  $a_user_id)
static

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

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

665  : string
666  {
667  return (string) self::_lookup($a_user_id, "ext_account") ?? '';
668  }
+ Here is the caller graph for this function:

◆ _lookupFeedHash()

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

Lookup news feed hash for user.

If hash does not exist, create one.

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

References $DIC, and $ilDB.

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

3142  : ?string {
3143  global $DIC;
3144 
3145  $ilDB = $DIC['ilDB'];
3146 
3147  if ($a_user_id > 0) {
3148  $set = $ilDB->queryF(
3149  "SELECT feed_hash from usr_data WHERE usr_id = %s",
3150  array("integer"),
3151  array($a_user_id)
3152  );
3153  if ($rec = $ilDB->fetchAssoc($set)) {
3154  if (strlen($rec["feed_hash"]) == 32) {
3155  return $rec["feed_hash"];
3156  } elseif ($a_create) {
3157  $hash = md5(random_int(1, 9999999) + str_replace(" ", "", microtime()));
3158  $ilDB->manipulateF(
3159  "UPDATE usr_data SET feed_hash = %s" .
3160  " WHERE usr_id = %s",
3161  array("text", "integer"),
3162  array($hash, $a_user_id)
3163  );
3164  return $hash;
3165  }
3166  }
3167  }
3168  return null;
3169  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _lookupFields()

static ilObjUser::_lookupFields ( int  $a_user_id)
static

lookup fields (deprecated; use more specific methods instead)

Deprecated:

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

References $DIC, $ilDB, and $res.

Referenced by ilTestExport\exportToCSV(), ilTestExport\exportToExcel(), ilCertificateUserObjectHelper\lookupFields(), and ilTestEvaluationGUI\outEvaluation().

645  : array // Missing array type.
646  {
647  global $DIC;
648 
649  $ilDB = $DIC['ilDB'];
650 
651  $res = $ilDB->queryF(
652  "SELECT * FROM usr_data WHERE usr_id = %s",
653  array("integer"),
654  array($a_user_id)
655  );
656  $user_rec = $ilDB->fetchAssoc($res);
657  return $user_rec;
658  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _lookupFirstLogin()

static ilObjUser::_lookupFirstLogin ( int  $a_user_id)
static

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

Referenced by ilFirstLoginLearningHistoryProvider\getEntries().

713  : string
714  {
715  return self::_lookup($a_user_id, "first_login") ?? '';
716  }
+ Here is the caller graph for this function:

◆ _lookupFullname()

static ilObjUser::_lookupFullname ( int  $a_user_id)
static

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

References $DIC, $fullname, and $ilDB.

Referenced by ilExAssignmentTeam\addTeamMember(), ilCalendarAppointmentGUI\book(), ilBookingProcessGUI\bookMultipleParticipants(), ilObjStudyProgrammeIndividualPlanGUI\buildFrame(), ilCalendarAppointmentGUI\cancelBooking(), ilObjSurvey\checkReminder(), ilExAssignmentReminder\checkReminders(), ilAppointmentPresentationConsultationHoursGUI\collectPropertiesAndActions(), ilObjStudyProgrammeMembersGUI\confirmRemoveUsers(), ilExAssignmentTeam\createTeam(), ilObjDataCollection\doUpdate(), ilRbacLogTableGUI\fillRow(), ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI\fillRow(), ilConsultationHourUtils\getConsultationHourLinksForRepositoryObject(), ilLPTableBaseGUI\getExportMeta(), ilCalendarAppointmentPanelGUI\getHTML(), ilCalendarBlockGUI\getHTML(), ilExAssignmentTeamLogTableGUI\getItems(), ilLearningModuleNotification\getMailBody(), ilConsultationHourAppointments\getManager(), ilObjStudyProgramme\getProgressIdString(), ilObjSurvey\getSurveyParticipants(), ilExAssignmentTeam\getTeamId(), ilSCORMTrackingItemsPerUserTableGUI\initTable(), ilSCORMTrackingItemPerUserTableGUI\initTable(), ilBookingEntry\lookupManagedBookingsForObject(), ilSCORMTrackingItemsScoTableGUI\parse(), ilConsultationHoursTableGUI\parse(), ilAssignmentsPerParticipantTableGUI\parseData(), ilCalendarPresentationGUI\prepareOutput(), ilCalendarCategories\readConsultationHoursCalendar(), ilExAssignmentTeam\removeTeamMember(), ilIndividualAssessmentMembersGUI\removeUserConfirmation(), ilCalendarMailNotification\send(), ilConsultationHoursGUI\sendInfoAboutUnassignedUsers(), ilWikiUtil\sendNotification(), ILIAS\Notes\NotificationsManager\sendNotifications(), ilObjSurvey\sendTutorNotification(), ilTestScoringByQuestionsGUI\showManScoringByQuestionParticipantsTable(), ilObjStudyProgrammeMembersGUI\updateFromCurrentPlan(), and ilObjStudyProgrammeMembersGUI\updateFromCurrentPlanMulti().

568  : string
569  {
570  global $DIC;
571 
572  $fullname = "";
573  $ilDB = $DIC['ilDB'];
574 
575  $set = $ilDB->queryF(
576  "SELECT title, firstname, lastname FROM usr_data WHERE usr_id = %s",
577  array("integer"),
578  array($a_user_id)
579  );
580 
581  if ($rec = $ilDB->fetchAssoc($set)) {
582  if ($rec["title"]) {
583  $fullname = $rec["title"] . " ";
584  }
585  if ($rec["firstname"]) {
586  $fullname .= $rec["firstname"] . " ";
587  }
588  if ($rec["lastname"]) {
589  $fullname .= $rec["lastname"];
590  }
591  }
592  return $fullname;
593  }
string $fullname
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _lookupGender()

static ilObjUser::_lookupGender ( int  $a_user_id)
static

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

Referenced by ilMail\getSalutation().

600  : string
601  {
602  return (string) self::_lookup($a_user_id, "gender") ?? '';
603  }
+ Here is the caller graph for this function:

◆ _lookupId()

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

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

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

Referenced by ilMail\__construct(), ilObjUserGUI\addAdminLocatorItems(), ilOrgUnitStaffGUI\addOtherRoles(), ilSurveyRaterGUI\addRater(), ilOrgUnitStaffGUI\addStaff(), ilOrgUnitUserAssignmentGUI\addStaff(), ilRepositorySearchGUI\addUserFromAutoComplete(), ilObjBlogGUI\addUserFromAutoComplete(), ilBookingParticipantGUI\addUserFromAutoCompleteObject(), ilExSubmissionTeamGUI\addUserFromAutoCompleteObject(), ilExerciseManagementGUI\addUserFromAutoCompleteObject(), ilTreeTrashQueries\appendTrashNodeForContainerQueryFilter(), ilSkillProfileGUI\assignUser(), ilOrgUnitSimpleUserImport\buildUserId(), ilChatroomInviteUsersToPrivateRoomGUI\byLogin(), ilPermission2GUI\changeOwner(), ilAuthProviderShibboleth\doAuthentication(), ilAuthProviderCAS\doAuthentication(), ilAuthProviderApache\doAuthentication(), ilLTIAppEventListener\doCronUpdate(), ilBenchmark\enableDbBenchmarkForUserName(), ilAuthProviderLTI\findUserId(), ilMail\formatNamesForOutput(), ILIAS\Survey\Evaluation\EvaluationManager\getSelectableAppraisees(), ILIAS\Survey\Settings\SettingsFormGUI\getTutorIdsFromForm(), ILIAS\Survey\Settings\SettingsFormGUI\getTutorResIdsFromForm(), ilObjectPermissionStatusGUI\getUser(), ilAccessibilitySupportContacts\getValidSupportContactIds(), ilSystemSupportContacts\getValidSupportContactIds(), ilDclStandardField\getValueFromExcel(), ilSoapObjectAdministration\getXMLTree(), ilAuthFrontend\handleAuthenticationFail(), ilAuthProviderCAS\handleLDAPDataSource(), ilAuthProviderApache\handleLDAPDataSource(), ilAuthProviderECS\handleLogin(), ilSessionControl\handleLoginEvent(), ilAuthProviderSaml\handleSamlAuth(), ilAuthProviderSoap\handleSoapAuth(), ilAuthProviderSaml\importUser(), ilPCParagraph\intLinks2xml(), ilChatroom\inviteUserToPrivateRoomByLogin(), ilSoapRBACAdministration\parseUserID(), ilStartUpGUI\processCode(), ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus(), ilDclRecordEditGUI\save(), ilObjEmployeeTalkSeriesGUI\saveObject(), ilSingleUserShareGUI\saveShare(), ilObjSurvey\sendNotificationMail(), ILIAS\Notes\NotificationsManager\sendNotifications(), ilObjSurvey\sent360Reminders(), ilRegistrationSettings\setApproveRecipientLogins(), ilOpenIdConnectUserSync\setInternalAccount(), ilAccessibilitySupportContacts\setList(), ilSystemSupportContacts\setList(), ilAuthProviderLDAP\updateAccount(), ilLDAPAttributeToUser\usersToXML(), ilRegistrationSettings\validate(), and ilUserImportParser\verifyEndTag().

675  {
676  global $DIC;
677 
678  $ilDB = $DIC['ilDB'];
679 
680  if (!is_array($a_user_str)) {
681  $res = $ilDB->queryF(
682  "SELECT usr_id FROM usr_data WHERE login = %s",
683  array("text"),
684  array($a_user_str)
685  );
686 
687  $user_rec = $ilDB->fetchAssoc($res);
688  if (is_array($user_rec)) {
689  return (int) $user_rec["usr_id"];
690  }
691 
692  return null;
693  }
694 
695  $set = $ilDB->query(
696  "SELECT usr_id FROM usr_data " .
697  " WHERE " . $ilDB->in("login", $a_user_str, false, "text")
698  );
699 
700  $ids = [];
701  while ($rec = $ilDB->fetchAssoc($set)) {
702  $ids[] = (int) $rec['usr_id'];
703  }
704 
705  return $ids;
706  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupLanguage()

static ilObjUser::_lookupLanguage ( int  $a_usr_id)
static

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

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

Referenced by ilLanguageFactory\_getLanguageOfUser().

1510  : string
1511  {
1512  global $DIC;
1513 
1514  $ilDB = $DIC->database();
1515  $lng = $DIC->language();
1516 
1517  $q = "SELECT value FROM usr_pref WHERE usr_id= " .
1518  $ilDB->quote($a_usr_id, "integer") . " AND keyword = " .
1519  $ilDB->quote('language', "text");
1520  $r = $ilDB->query($q);
1521 
1522  while ($row = $ilDB->fetchAssoc($r)) {
1523  return (string) $row['value'];
1524  }
1525  if (is_object($lng)) {
1526  return $lng->getDefaultLanguage();
1527  }
1528  return 'en';
1529  }
getDefaultLanguage()
Return default language.
global $DIC
Definition: feed.php:28
ilLanguage $lng
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupLastLogin()

static ilObjUser::_lookupLastLogin ( int  $a_user_id)
static

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

Referenced by ilCronDeleteInactiveUserReminderMail\removeEntriesFromTableIfLastLoginIsNewer().

708  : string
709  {
710  return self::_lookup($a_user_id, "last_login") ?? '';
711  }
+ Here is the caller graph for this function:

◆ _lookupLogin()

static ilObjUser::_lookupLogin ( int  $a_user_id)
static

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

Referenced by ilCourseXMLParser\__parseId(), ilObjSystemFolderGUI\benchmarkObject(), ilObjEmployeeTalkGUI\cancelDeleteObject(), ilObjSurvey\checkReminder(), ilExAssignmentReminder\checkReminders(), ilWorkspaceUserActionProvider\collectActionsForTargetUser(), ilChatUserActionProvider\collectActionsForTargetUser(), ilForumMailEventNotificationSender\createMailValueObjectsWithAttachments(), ilForumMailEventNotificationSender\createMailValueObjectWithoutAttachments(), ilObjRole\delete(), ilStartUpGUI\doStandardAuthentication(), ilObjDataCollection\doUpdate(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilStudyProgrammeIndividualPlanTableGUI\fetchData(), ilDclBaseRecordModel\fillRecordFieldExcelExport(), ilMilestoneResponsiblesTableGUI\fillRow(), ilPDNewsTableGUI\fillRow(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), ilUserAvatarResolver\getAvatar(), ilOrgUnitUserAssignmentGUI\getConfirmationGUI(), ilAccessibilitySupportContactsGUI\getContactLogins(), ilAttendanceList\getHTML(), ilConsultationHourAppointments\getManagedUsers(), ilConsultationHourAppointments\getManager(), ilStudyProgrammeMailMemberSearchGUI\getProcessData(), ilTestServiceGUI\getResultsHeadUserAndPass(), ilStudyProgrammeMailTemplateContext\getSpecificPlaceholders(), ilObjSurvey\getUserDataFromActiveId(), ilForumSettingsGUI\getUserNotificationTableData(), ilInternalLinkGUI\getUserSearchResult(), ilUserClipboard\getValidatedContent(), ilObjUserGUI\getValues(), ilAuthFrontend\handleAuthenticationSuccess(), ilCalendarAppointmentGUI\initForm(), ilMailSearchObjectGUI\mailMembers(), ilContactGUI\mailToUsers(), ilPermission2GUI\owner(), ilCalendarSharedUserListTableGUI\parse(), ilUserClipboardTableGUI\parse(), ilTrashTableGUI\parse(), ilRegistrationSettings\read(), ilLearningSequenceRoles\readMemberData(), ilCalendarEntry\readResponsibleUsers(), ilExerciseManagementGUI\redirectFeedbackMailObject(), ilBuddyList\request(), ilMailSummaryNotification\send(), ILIAS\EmployeeTalk\Service\EmployeeTalkEmailNotificationService\send(), ilLearningModuleNotification\send(), ilObjSurvey\send360ReminderToUser(), ilObjSurvey\sendAppraiseeCloseNotification(), ilObjSurvey\sendAppraiseeNotification(), ilTimingsCronReminder\sendExceededMail(), ilTimingsCronReminder\sendFreshlyStartedMail(), ilSkillNotifications\sendMail(), ilLPTableBaseGUI\sendMail(), ilMailNotification\sendMail(), ilMembershipCronNotifications\sendMail(), ilObjContentObjectGUI\sendMailToBlockedUsers(), ilMembershipMailGUI\sendMailToSelectedUsers(), ilStudyProgrammeMailMemberSearchGUI\sendMailToSelectedUsers(), ilMailMemberSearchGUI\sendMailToSelectedUsers(), ilMembershipGUI\sendMailToSelectedUsers(), ilMembershipCronMinMembers\sendMessage(), ilWikiUtil\sendNotification(), ILIAS\Notes\NotificationsManager\sendNotifications(), ilObjSurvey\sendRaterNotification(), ilObjSurvey\sendTutorNotification(), ilEmployeeTalkTableGUI\setTalkData(), ilContactGUI\showContacts(), ilMailSearchGUI\showResults(), ilMailFolderGUI\showUser(), ilContactGUI\submitInvitation(), ilBuddySystemGUI\transitionAsyncCommand(), ilBuddySystemGUI\transitionCommand(), ilUserImportParser\verifyEndTag(), and ilPCParagraph\xml2output().

660  : string
661  {
662  return (string) self::_lookup($a_user_id, "login") ?? '';
663  }
+ Here is the caller graph for this function:

◆ _lookupName()

static ilObjUser::_lookupName ( int  $a_user_id)
static

lookup user name

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

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

References $DIC, $ilDB, and $res.

Referenced by ilBookingAssignObjectsTableGUI\__construct(), ilExGradesTableGUI\__construct(), ilObjTestAccess\_getParticipantData(), ilSoapLearningProgressAdministration\addUserProgress(), ilTimingsCronReminder\buildMailSalutation(), ilMailUserActionProvider\collectActionsForTargetUser(), ilExerciseManagementCollectFilesJob\collectAssignmentData(), ilMembershipGUI\confirmAssignFromWaitingList(), ilMembershipGUI\confirmAssignSubscribers(), ilSessionMembershipGUI\confirmDeleteParticipants(), ilMembershipGUI\confirmDeleteParticipants(), ilMembershipGUI\confirmRefuseFromList(), ilMembershipGUI\confirmRefuseSubscribers(), ilOrgUnitStaffGUI\confirmRemoveUser(), ilLocalUserGUI\deleteUsers(), ilObjCategoryGUI\deleteUsersObject(), ilBlogExerciseGUI\downloadExcSubFile(), ilPortfolioExerciseGUI\downloadExcSubFile(), ilWikiPageGUI\downloadExcSubFile(), ilExSubmission\downloadFiles(), ilExSubmission\downloadMultipleFiles(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilObjExercise\exportGradesExcel(), ilObjAssessmentFolderGUI\exportLogObject(), ilDclBaseRecordModel\fillRecordFieldExcelExport(), ilAssessmentFolderLogTableGUI\fillRow(), ilCalendarInboxSharedTableGUI\fillRow(), ilFileVersionsTableGUI\fillRow(), ilRbacLogTableGUI\fillRow(), ilObjSurvey\getAppraiseesData(), ilBookingParticipant\getAssignableParticipants(), ilLMTracker\getBlockedUsersInformation(), ilExSubmission\getDirectoryNameFromUserData(), ilIndividualAssessmentMembersTableGUI\getFullNameFor(), ilAttendanceList\getHTML(), ilSurveyParticipantsTableGUI\getItems(), ilSessionOverviewTableGUI\getItems(), ilCourseParticipantsGroupsTableGUI\getItems(), ilBookingParticipant\getList(), ilBookingReservationDBRepository\getListByDate(), ilExAssignment\getMemberListData(), ilContSkillMemberTableGUI\getMembers(), ilExAssignment\getMultiFeedbackFiles(), ilPageObject\getPageContributors(), ILIAS\Portfolio\PortfolioPrintViewProviderGUI\getPages(), ilPageObject\getParentObjectContributors(), ilDownloadSubmissionsBackgroundTask\getParticipantBucketTitle(), ilMilestoneResponsiblesTableGUI\getParticipantsAndResponsibles(), ilStudyProgrammeMailMemberSearchGUI\getProcessData(), ilObjWikiListGUI\getProperties(), ilObjSurvey\getRatersData(), ilMail\getSalutation(), ilDclBaseRecordModel\getStandardField(), ilObjSurvey\getSurveyParticipants(), ilForumSettingsGUI\getUserNotificationTableData(), ilObjStudyProgrammeAutoCategoriesGUI\getUserRepresentation(), ilObjStudyProgrammeAutoMembershipsGUI\getUserRepresentation(), ilExerciseXMLWriter\handleAssignmentMembers(), ilWorkspaceShareTableGUI\importData(), ilLOMemberTestResultTableGUI\init(), ilContSkillAdminGUI\initCompetenceAssignmentForm(), ilWorkspaceShareTableGUI\initFilter(), ilExerciseManagementGUI\initIndividualDeadlineForm(), ilObjectCustomUserFieldsGUI\initMemberForm(), ilAssignmentsPerParticipantTableGUI\initMode(), ilGroupParticipantsTableGUI\lookupUserName(), ilCourseParticipantsTableGUI\lookupUserName(), ilTestEvaluationGUI\outParticipantsResultsOverview(), ilCalendarSharedUserListTableGUI\parse(), ilCourseReferenceDeleteConfirmationTableGUI\parse(), ilCalendarSharedListTableGUI\parse(), ilUserClipboardTableGUI\parse(), ilConsultationHoursTableGUI\parse(), ilGroupXMLParser\parseId(), ilLearningSequenceRoles\readMemberData(), ilObjCourseGUI\readMemberData(), ilCalendarEntry\readResponsibleUsers(), ilSubscriberTableGUI\readSubscriberData(), ilWaitingListTableGUI\readUserData(), ilObjPortfolioBaseGUI\renderFullscreenHeader(), ilObjBlogGUI\renderFullscreenHeader(), ilObjBlogGUI\renderNavigationByAuthors(), ilTestScoringGUI\saveManScoringParticipantScreen(), ilExerciseManagementGUI\saveStatus(), ilExAssignment\sendMultiFeedbackStructureFile(), ilExerciseManagementGUI\showParticipantObject(), ilMailSearchGUI\showResults(), ilCourseContentGUI\showUserTimings(), ilObjTest\userLookupFullName(), ilMailNotification\userToString(), and ILIAS\Survey\Settings\SettingsFormGUI\withAfterEnd().

614  : array
615  {
616  global $DIC;
617 
618  $ilDB = $DIC['ilDB'];
619 
620  $res = $ilDB->queryF(
621  "SELECT firstname, lastname, title, login FROM usr_data WHERE usr_id = %s",
622  array("integer"),
623  array($a_user_id)
624  );
625  if ($user_rec = $ilDB->fetchAssoc($res)) {
626  return array("user_id" => $a_user_id,
627  "firstname" => $user_rec["firstname"],
628  "lastname" => $user_rec["lastname"],
629  "title" => $user_rec["title"],
630  "login" => $user_rec["login"]
631  );
632  }
633  return array("user_id" => 0,
634  "firstname" => "",
635  "lastname" => "",
636  "title" => "",
637  "login" => ""
638  );
639  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _lookupPref()

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

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

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

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

1040  : ?string {
1041  global $DIC;
1042 
1043  $ilDB = $DIC['ilDB'];
1044 
1045  $query = "SELECT * FROM usr_pref WHERE usr_id = " . $ilDB->quote($a_usr_id, "integer") . " " .
1046  "AND keyword = " . $ilDB->quote($a_keyword, "text");
1047  $res = $ilDB->query($query);
1048 
1049  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
1050  return $row->value;
1051  }
1052  return null;
1053  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ _moveUsersToStyle()

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

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

References $DIC, and $ilDB.

Referenced by ilSystemStyleOverviewGUI\moveUserStyles().

2288  : void {
2289  global $DIC;
2290 
2291  $ilDB = $DIC['ilDB'];
2292 
2293  $q = "SELECT up1.usr_id usr_id FROM usr_pref up1, usr_pref up2 " .
2294  " WHERE up1.keyword= " . $ilDB->quote("style", "text") .
2295  " AND up1.value= " . $ilDB->quote($a_from_style, "text") .
2296  " AND up2.keyword= " . $ilDB->quote("skin", "text") .
2297  " AND up2.value= " . $ilDB->quote($a_from_skin, "text") .
2298  " AND up1.usr_id = up2.usr_id ";
2299 
2300  $usr_set = $ilDB->query($q);
2301 
2302  while ($usr_rec = $ilDB->fetchAssoc($usr_set)) {
2303  self::_writePref($usr_rec["usr_id"], "skin", $a_to_skin);
2304  self::_writePref($usr_rec["usr_id"], "style", $a_to_style);
2305  }
2306  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _readUsersProfileData()

static ilObjUser::_readUsersProfileData ( array  $a_user_ids)
static
Parameters
int[]$a_user_ids
Returns
array

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

References $DIC, $ilDB, and $res.

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

2119  : array
2120  {
2121  global $DIC;
2122 
2123  $ilDB = $DIC['ilDB'];
2124  $res = $ilDB->query("SELECT * FROM usr_data WHERE " .
2125  $ilDB->in("usr_id", $a_user_ids, false, "integer"));
2126  $user_data = [];
2127  while ($row = $ilDB->fetchAssoc($res)) {
2128  $user_data[$row['usr_id']] = $row;
2129  }
2130  return $user_data;
2131  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _setFeedPass()

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

Set news feed password for user.

Todo:
move to news service

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

Referenced by ilPDNewsBlockGUI\changeFeedSettings().

3192  : void {
3193  self::_writePref(
3194  $a_user_id,
3195  "priv_feed_pass",
3196  ($a_password == "") ? "" : md5($a_password)
3197  );
3198  }
+ Here is the caller graph for this function:

◆ _setUserInactive()

static ilObjUser::_setUserInactive ( int  $a_usr_id)
static

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

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

Referenced by ilAuthFrontend\handleAuthenticationFail().

3529  : bool {
3530  global $DIC;
3531 
3532  $ilDB = $DIC['ilDB'];
3533 
3534  $query = "UPDATE usr_data SET active = 0, inactivation_date = %s WHERE usr_id = %s";
3535  $affected = $ilDB->manipulateF($query, array('timestamp', 'integer'), array(ilUtil::now(), $a_usr_id));
3536 
3537  if ($affected) {
3538  return true;
3539  } else {
3540  return false;
3541  }
3542  }
static now()
Return current timestamp in Y-m-d H:i:s format.
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _toggleActiveStatusOfUsers()

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

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

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

Referenced by ilLDAPCronSynchronization\deactivateUsers().

2666  : void {
2667  global $DIC;
2668 
2669  $ilDB = $DIC['ilDB'];
2670 
2671  if ($a_status) {
2672  $q = "UPDATE usr_data SET active = 1, inactivation_date = NULL WHERE " .
2673  $ilDB->in("usr_id", $a_usr_ids, false, "integer");
2674  $ilDB->manipulate($q);
2675  } else {
2676  $usrId_IN_usrIds = $ilDB->in("usr_id", $a_usr_ids, false, "integer");
2677 
2678  $q = "UPDATE usr_data SET active = 0 WHERE $usrId_IN_usrIds";
2679  $ilDB->manipulate($q);
2680 
2681  $queryString = "
2682  UPDATE usr_data
2683  SET inactivation_date = %s
2684  WHERE inactivation_date IS NULL
2685  AND $usrId_IN_usrIds
2686  ";
2687  $ilDB->manipulateF($queryString, array('timestamp'), array(ilUtil::now()));
2688  }
2689  }
static now()
Return current timestamp in Y-m-d H:i:s format.
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _uploadPersonalPicture()

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

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

Parameters
int$obj_idThe object id of the related user account

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

References ilShellUtil\execConvert(), ilFileUtils\getWebspaceDir(), ilShellUtil\isConvertVersionAtLeast(), and ilFileUtils\makeDir().

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

2817  : bool {
2818  $webspace_dir = ilFileUtils::getWebspaceDir();
2819  $image_dir = $webspace_dir . "/usr_images";
2820  ilFileUtils::makeDir($image_dir);
2821  $store_file = "usr_" . $obj_id . "." . "jpg";
2822 
2823  chmod($tmp_file, 0770);
2824 
2825  // take quality 100 to avoid jpeg artefacts when uploading jpeg files
2826  // taking only frame [0] to avoid problems with animated gifs
2827  $show_file = "$image_dir/usr_" . $obj_id . ".jpg";
2828  $thumb_file = "$image_dir/usr_" . $obj_id . "_small.jpg";
2829  $xthumb_file = "$image_dir/usr_" . $obj_id . "_xsmall.jpg";
2830  $xxthumb_file = "$image_dir/usr_" . $obj_id . "_xxsmall.jpg";
2831 
2832  if (ilShellUtil::isConvertVersionAtLeast("6.3.8-3")) {
2834  $tmp_file . "[0] -geometry 200x200^ -gravity center -extent 200x200 -quality 100 JPEG:" . $show_file
2835  );
2837  $tmp_file . "[0] -geometry 100x100^ -gravity center -extent 100x100 -quality 100 JPEG:" . $thumb_file
2838  );
2840  $tmp_file . "[0] -geometry 75x75^ -gravity center -extent 75x75 -quality 100 JPEG:" . $xthumb_file
2841  );
2843  $tmp_file . "[0] -geometry 30x30^ -gravity center -extent 30x30 -quality 100 JPEG:" . $xxthumb_file
2844  );
2845  } else {
2846  ilShellUtil::execConvert($tmp_file . "[0] -geometry 200x200 -quality 100 JPEG:" . $show_file);
2847  ilShellUtil::execConvert($tmp_file . "[0] -geometry 100x100 -quality 100 JPEG:" . $thumb_file);
2848  ilShellUtil::execConvert($tmp_file . "[0] -geometry 75x75 -quality 100 JPEG:" . $xthumb_file);
2849  ilShellUtil::execConvert($tmp_file . "[0] -geometry 30x30 -quality 100 JPEG:" . $xxthumb_file);
2850  }
2851 
2852  // store filename
2853  self::_writePref($obj_id, "profile_image", $store_file);
2854 
2855  return true;
2856  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static isConvertVersionAtLeast(string $a_version)
Compare convert version numbers.
static execConvert(string $args)
execute convert command
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _verifyRegistrationHash()

static ilObjUser::_verifyRegistrationHash ( string  $a_hash)
static

Verifies a registration hash.

Exceptions
ilRegConfirmationLinkExpiredException
ilRegistrationHashNotFoundException

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

References $DIC, $ilDB, and $res.

Referenced by ilStartUpGUI\_checkGoto().

3728  : int {
3729  global $DIC;
3730 
3731  $ilDB = $DIC['ilDB'];
3732 
3733  $res = $ilDB->queryf(
3734  '
3735  SELECT usr_id, create_date FROM usr_data
3736  WHERE reg_hash = %s',
3737  array('text'),
3738  array($a_hash)
3739  );
3740  while ($row = $ilDB->fetchAssoc($res)) {
3741  $oRegSettigs = new ilRegistrationSettings();
3742 
3743  if ($oRegSettigs->getRegistrationHashLifetime() != 0 &&
3744  time() - $oRegSettigs->getRegistrationHashLifetime() > strtotime($row['create_date'])) {
3746  'reg_confirmation_hash_life_time_expired',
3747  (int) $row['usr_id']
3748  );
3749  }
3750 
3751  $ilDB->manipulateF(
3752  '
3753  UPDATE usr_data
3754  SET reg_hash = %s
3755  WHERE usr_id = %s',
3756  array('text', 'integer'),
3757  array('', (int) $row['usr_id'])
3758  );
3759 
3760  return (int) $row['usr_id'];
3761  }
3762 
3763  throw new ilRegistrationHashNotFoundException('reg_confirmation_hash_not_found');
3764  }
$res
Definition: ltiservices.php:69
Class for user related exception handling in ILIAS.
global $DIC
Definition: feed.php:28
Class ilObjAuthSettingsGUI.
Class for user related exception handling in ILIAS.
+ Here is the caller graph for this function:

◆ _writeAuthMode()

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

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

References $DIC, and $ilDB.

Referenced by ilAuthProviderSaml\handleSamlAuth().

1547  : void
1548  {
1549  global $DIC;
1550 
1551  $ilDB = $DIC['ilDB'];
1552 
1553  $ilDB->manipulateF(
1554  "UPDATE usr_data " .
1555  " SET auth_mode = %s WHERE usr_id = %s",
1556  array("text", "integer"),
1557  array($a_auth_mode, $a_usr_id)
1558  );
1559  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _writeExternalAccount()

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

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

References $DIC, and $ilDB.

1534  : void {
1535  global $DIC;
1536 
1537  $ilDB = $DIC['ilDB'];
1538 
1539  $ilDB->manipulateF(
1540  "UPDATE usr_data " .
1541  " SET ext_account = %s WHERE usr_id = %s",
1542  array("text", "integer"),
1543  array($a_ext_id, $a_usr_id)
1544  );
1545  }
global $DIC
Definition: feed.php:28

◆ _writeHistory()

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

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

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

3567  : void {
3568  global $DIC;
3569 
3570  $ilDB = $DIC['ilDB'];
3571 
3572  $timestamp = time();
3573 
3574  $res = $ilDB->queryF(
3575  'SELECT * FROM loginname_history WHERE usr_id = %s AND login = %s AND history_date = %s',
3576  array('integer', 'text', 'integer'),
3577  array($a_usr_id, $a_login, $timestamp)
3578  );
3579 
3580  if ($ilDB->numRows($res) == 0) {
3581  $ilDB->manipulateF(
3582  '
3583  INSERT INTO loginname_history
3584  (usr_id, login, history_date)
3585  VALUES (%s, %s, %s)',
3586  array('integer', 'text', 'integer'),
3587  array($a_usr_id, $a_login, $timestamp)
3588  );
3589  }
3590  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70

◆ _writePref()

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

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

References $DIC, and $ilDB.

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

966  : void {
967  global $DIC;
968 
969  $ilDB = $DIC->database();
970  $ilDB->replace(
971  "usr_pref",
972  array(
973  "usr_id" => array("integer", $a_usr_id),
974  "keyword" => array("text", $a_keyword),
975  ),
976  array(
977  "value" => array("text",$a_value)
978  )
979  );
980  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ activateDeletionFlag()

ilObjUser::activateDeletionFlag ( )

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

References writePref().

4073  : void
4074  {
4075  $this->writePref("delete_flag", true);
4076  }
writePref(string $a_keyword, string $a_value)
+ Here is the call graph for this function:

◆ addObjectToClipboard()

ilObjUser::addObjectToClipboard ( int  $a_item_id,
string  $a_type,
string  $a_title,
int  $a_parent = 0,
string  $a_time = "",
int  $a_order_nr = 0 
)

add an item to user's personal clipboard

Parameters
int$a_item_idref_id for objects, that are in the main tree (learning modules, forums) obj_id for others
string$a_typeobject type

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

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

2328  : void {
2329  global $DIC;
2330 
2331  $ilDB = $DIC['ilDB'];
2332 
2333  if ($a_time === "") {
2334  $a_time = date("Y-m-d H:i:s");
2335  }
2336 
2337  $item_set = $ilDB->queryF(
2338  "SELECT * FROM personal_clipboard WHERE " .
2339  "parent = %s AND item_id = %s AND type = %s AND user_id = %s",
2340  array("integer", "integer", "text", "integer"),
2341  array(0, $a_item_id, $a_type, $this->getId())
2342  );
2343 
2344  // only insert if item is not already in clipboard
2345  if (!$item_set->fetchRow()) {
2346  $ilDB->manipulateF(
2347  "INSERT INTO personal_clipboard " .
2348  "(item_id, type, user_id, title, parent, insert_time, order_nr) VALUES " .
2349  " (%s,%s,%s,%s,%s,%s,%s)",
2350  array("integer", "text", "integer", "text", "integer", "timestamp", "integer"),
2351  array($a_item_id, $a_type, $this->getId(), $a_title, $a_parent, $a_time, $a_order_nr)
2352  );
2353  } else {
2354  $ilDB->manipulateF(
2355  "UPDATE personal_clipboard SET insert_time = %s " .
2356  "WHERE user_id = %s AND item_id = %s AND type = %s AND parent = 0",
2357  array("timestamp", "integer", "integer", "text"),
2358  array($a_time, $this->getId(), $a_item_id, $a_type)
2359  );
2360  }
2361  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ addToPCClipboard()

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

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

Todo:
move to COPage service

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

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

Referenced by ilPageObject\copyContents().

2371  : void {
2372  $ilDB = $this->db;
2373  if ($a_time == 0) {
2374  $a_time = date("Y-m-d H:i:s");
2375  }
2376  ilSession::set("user_pc_clip", true);
2377  $ilDB->insert("personal_pc_clipboard", array(
2378  "user_id" => array("integer", $this->getId()),
2379  "content" => array("clob", $a_content),
2380  "insert_time" => array("timestamp", $a_time),
2381  "order_nr" => array("integer", $a_nr)
2382  ));
2383  }
ilDBInterface $db
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assignData()

ilObjUser::assignData ( array  $a_data)

loads a record "user" from array

Parameters
array$a_data,<string,mixed>

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

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

Referenced by read().

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

◆ buildTextFromArray()

ilObjUser::buildTextFromArray ( array  $a_attr)
protected

Convert multi-text values to plain text.

Parameters
string[]
Returns
string

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

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

4180  : string
4181  {
4182  if (count($a_attr) > 0) {
4183  return implode(", ", $a_attr);
4184  }
4185  return "";
4186  }
+ Here is the caller graph for this function:

◆ checkTimeLimit()

ilObjUser::checkTimeLimit ( )

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

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

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

1787  : bool
1788  {
1789  if ($this->getTimeLimitUnlimited()) {
1790  return true;
1791  }
1792  if ($this->getTimeLimitFrom() < time() and $this->getTimeLimitUntil() > time()) {
1793  return true;
1794  }
1795  return false;
1796  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkUserId()

ilObjUser::checkUserId ( )

check user id with login name

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

References ilObject\$id.

1966  : bool
1967  {
1968  $login = self::getLoginFromAuth();
1969  $id = self::_lookupId($login);
1970  if ($id > 0) {
1971  return $id;
1972  }
1973  return false;
1974  }

◆ clipboardDeleteAll()

ilObjUser::clipboardDeleteAll ( )

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

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

Referenced by delete().

2449  : void
2450  {
2451  global $DIC;
2452 
2453  $ilDB = $DIC['ilDB'];
2454 
2455  $ilDB->manipulateF("DELETE FROM personal_clipboard WHERE " .
2456  "user_id = %s", array("integer"), array($this->getId()));
2457  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clipboardDeleteObjectsOfType()

ilObjUser::clipboardDeleteObjectsOfType ( string  $a_type)

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

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

2437  : void
2438  {
2439  $ilDB = $this->db;
2440 
2441  $ilDB->manipulateF(
2442  "DELETE FROM personal_clipboard WHERE " .
2443  "type = %s AND user_id = %s",
2444  array("text", "integer"),
2445  array($a_type, $this->getId())
2446  );
2447  }
ilDBInterface $db
+ Here is the call graph for this function:

◆ clipboardHasObjectsOfType()

ilObjUser::clipboardHasObjectsOfType ( string  $a_type)

Check whether clipboard has objects of a certain type.

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

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

2418  : bool
2419  {
2420  global $DIC;
2421 
2422  $ilDB = $DIC['ilDB'];
2423 
2424  $set = $ilDB->queryF(
2425  "SELECT * FROM personal_clipboard WHERE " .
2426  "parent = %s AND type = %s AND user_id = %s",
2427  array("integer", "text", "integer"),
2428  array(0, $a_type, $this->getId())
2429  );
2430  if ($ilDB->fetchAssoc($set)) {
2431  return true;
2432  }
2433 
2434  return false;
2435  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ copyProfilePicturesToDirectory()

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

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

References ilFileUtils\getWebspaceDir().

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

2907  : void {
2908  $a_dir = trim(str_replace("..", "", $a_dir));
2909  if ($a_dir == "" || !is_dir($a_dir)) {
2910  return;
2911  }
2912 
2913  $webspace_dir = ilFileUtils::getWebspaceDir();
2914  $image_dir = $webspace_dir . "/usr_images";
2915  $images = array(
2916  "upload_" . $a_user_id . "pic",
2917  "usr_" . $a_user_id . "." . "jpg",
2918  "usr_" . $a_user_id . "_small.jpg",
2919  "usr_" . $a_user_id . "_xsmall.jpg",
2920  "usr_" . $a_user_id . "_xxsmall.jpg",
2921  "upload_" . $a_user_id);
2922  foreach ($images as $image) {
2923  if (is_file($image_dir . "/" . $image)) {
2924  copy($image_dir . "/" . $image, $a_dir . "/" . $image);
2925  }
2926  }
2927  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilObjUser::delete ( )

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

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

1063  : bool
1064  {
1065  global $DIC;
1066 
1067  $rbacadmin = $DIC->rbac()->admin();
1068  $ilDB = $this->db;
1069 
1070  // deassign from ldap groups
1072  $mapping->deleteUser($this->getId());
1073 
1074  // remove mailbox / update sent mails
1075  $mailbox = new ilMailbox($this->getId());
1076  $mailbox->delete();
1077  $mailbox->updateMailsOfDeletedUser($this->getLogin());
1078 
1079  // delete block settings
1081 
1082  // delete user_account
1083  $ilDB->manipulateF(
1084  "DELETE FROM usr_data WHERE usr_id = %s",
1085  array("integer"),
1086  array($this->getId())
1087  );
1088 
1089  $this->deleteMultiTextFields();
1090 
1091  // delete user_prefs
1092  self::_deleteAllPref($this->getId());
1093 
1094  $this->removeUserPicture(false); // #8597
1095 
1096  // delete user_session
1098 
1099  // remove user from rbac
1100  $rbacadmin->removeUser($this->getId());
1101 
1102  // remove bookmarks
1103  // TODO: move this to class.ilBookmarkFolder
1104  $q = "DELETE FROM bookmark_tree WHERE tree = " .
1105  $ilDB->quote($this->getId(), "integer");
1106  $ilDB->manipulate($q);
1107 
1108  $q = "DELETE FROM bookmark_data WHERE user_id = " .
1109  $ilDB->quote($this->getId(), "integer");
1110  $ilDB->manipulate($q);
1111 
1112  // Delete crs entries
1113  ilObjCourse::_deleteUser($this->getId());
1114 
1115  // Delete user tracking
1117 
1119 
1120  // Delete Tracking data SCORM 2004 RTE
1122 
1123  // Delete Tracking data SCORM 1.2 RTE
1125 
1126  // remove all notifications
1128 
1129  // remove portfolios
1131 
1132  // remove workspace
1133  $tree = new ilWorkspaceTree($this->getId());
1134  $tree->cascadingDelete();
1135 
1136  // remove reminder entries
1138 
1139  // badges
1141 
1142  // remove org unit assignments
1143  $ilOrgUnitUserAssignmentQueries = ilOrgUnitUserAssignmentQueries::getInstance();
1144  $ilOrgUnitUserAssignmentQueries->deleteAllAssignmentsOfUser($this->getId());
1145 
1146  // Delete user defined field entries
1148 
1149  // Delete clipboard entries
1150  $this->clipboardDeleteAll();
1151 
1152  // Reset owner
1153  $this->resetOwner();
1154 
1155  // Trigger deleteUser Event
1156  global $DIC;
1157 
1158  $ilAppEventHandler = $DIC['ilAppEventHandler'];
1159  $ilAppEventHandler->raise(
1160  'Services/User',
1161  'deleteUser',
1162  array('usr_id' => $this->getId())
1163  );
1164 
1165  // delete object data
1166  parent::delete();
1167  return true;
1168  }
static _destroyByUserId(int $a_user_id)
Destroy session.
static _deleteUser(int $a_usr_id)
static _removeTrackingDataForUser(int $user_id)
to be called from IlObjUser
ilTree $tree
static _deleteSettingsOfUser(int $a_user)
removeUserPicture(bool $a_do_update=true)
static _deleteByUser(int $a_usr_id)
deleteUserDefinedFieldEntries()
static _deleteUser(int $a_usr_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
static _getInstance()
Get singleton instance of this class.
Mail Box class Base class for creating and handling mail boxes.
static removeForUser(int $user_id)
Remove all notifications for given user.
ilDBInterface $db
static deleteByUserId(int $a_user_id)
static deleteUserPortfolios(int $a_user_id)
Delete all portfolio data for user.
static _removeTrackingDataForUser(int $user_id)
+ Here is the call graph for this function:

◆ deleteMultiTextFields()

ilObjUser::deleteMultiTextFields ( )
protected

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

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

Referenced by delete(), and updateMultiTextFields().

4263  : void
4264  {
4265  global $DIC;
4266 
4267  $ilDB = $DIC['ilDB'];
4268 
4269  if (!$this->getId()) {
4270  return;
4271  }
4272 
4273  $ilDB->manipulate("DELETE FROM usr_data_multi" .
4274  " WHERE usr_id = " . $ilDB->quote($this->getId(), "integer"));
4275  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deletePref()

ilObjUser::deletePref ( string  $a_keyword)

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

References ilObject\getId().

928  : void
929  {
930  self::_deletePref($this->getId(), $a_keyword);
931  }
+ Here is the call graph for this function:

◆ deleteUserDefinedFieldEntries()

◆ existsPref()

ilObjUser::existsPref ( string  $a_keyword)

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

1032  : bool
1033  {
1034  return (array_key_exists($a_keyword, $this->prefs));
1035  }

◆ exportPersonalData()

ilObjUser::exportPersonalData ( )

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

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

3924  : void
3925  {
3926  $exp = new ilExport();
3927  $dir = ilExport::_getExportDirectory($this->getId(), "xml", "usr", "personal_data");
3928  ilFileUtils::delDir($dir, true);
3929  $title = $this->getLastname() . ", " . $this->getLastname() . " [" . $this->getLogin() . "]";
3930  $exp->exportEntity(
3931  "personal_data",
3932  $this->getId(),
3933  "",
3934  "Services/User",
3935  $title,
3936  $dir
3937  );
3938  }
string $title
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object.
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ findInterests()

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

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

References $DIC, $ilDB, and $res.

Referenced by ilPublicUserProfileGUI\getAutocompleteResult().

4281  : array {
4282  global $DIC;
4283 
4284  $ilDB = $DIC['ilDB'];
4285 
4286  $res = array();
4287 
4288  $sql = "SELECT DISTINCT(value)" .
4289  " FROM usr_data_multi" .
4290  " WHERE " . $ilDB->like("value", "text", "%" . $a_term . "%");
4291  if ($a_field_id) {
4292  $sql .= " AND field_id = " . $ilDB->quote($a_field_id, "text");
4293  }
4294  if ($a_user_id) {
4295  $sql .= " AND usr_id <> " . $ilDB->quote($a_user_id, "integer");
4296  }
4297  $sql .= " ORDER BY value";
4298  $set = $ilDB->query($sql);
4299  while ($row = $ilDB->fetchAssoc($set)) {
4300  $res[] = $row["value"];
4301  }
4302 
4303  return $res;
4304  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getActive()

ilObjUser::getActive ( )

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

References $active.

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

1670  : bool
1671  {
1672  return (bool) $this->active;
1673  }
+ Here is the caller graph for this function:

◆ getAgreeDate()

ilObjUser::getAgreeDate ( )

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

References $agree_date.

Referenced by ilTermsOfServiceHelper\hasToResignAcceptance().

1641  : ?string
1642  {
1643  return $this->agree_date;
1644  }
string $agree_date
+ Here is the caller graph for this function:

◆ getApproveDate()

ilObjUser::getApproveDate ( )

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

References $approve_date.

1636  : ?string
1637  {
1638  return $this->approve_date;
1639  }
string $approve_date

◆ getAuthMode()

ilObjUser::getAuthMode ( bool  $a_auth_key = false)

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

References $auth_mode, and ilAuthUtils\_getAuthMode().

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

2608  : ?string
2609  {
2610  if (!$a_auth_key) {
2611  return $this->auth_mode;
2612  }
2613  return ilAuthUtils::_getAuthMode($this->auth_mode);
2614  }
static _getAuthMode(?string $a_auth_mode)
string $auth_mode
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAvatar()

ilObjUser::getAvatar ( )

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

References ilObject\getId().

2876  : Avatar
2877  {
2878  return self::_getAvatar($this->getId());
2879  }
This describes how a letter or a picture avatar could be modified during construction of UI...
Definition: Avatar.php:28
+ Here is the call graph for this function:

◆ getBirthday()

ilObjUser::getBirthday ( )

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

References $birthday.

Referenced by saveAsNew(), and update().

3776  : ?string
3777  {
3778  return $this->birthday;
3779  }
string $birthday
+ Here is the caller graph for this function:

◆ getCity()

ilObjUser::getCity ( )

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

References $city.

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

1335  : string
1336  {
1337  return $this->city;
1338  }
+ Here is the caller graph for this function:

◆ getClientIP()

ilObjUser::getClientIP ( )

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

References $client_ip.

Referenced by ilAuthFrontend\checkIp().

1421  : string
1422  {
1423  return $this->client_ip;
1424  }
string $client_ip
+ Here is the caller graph for this function:

◆ getClipboardChilds()

ilObjUser::getClipboardChilds ( int  $a_parent,
string  $a_insert_time 
)

Get children of an item.

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

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

2510  : array {
2511  global $DIC;
2512 
2513  $ilDB = $DIC['ilDB'];
2514  $ilUser = $DIC['ilUser'];
2515 
2516  $objs = $ilDB->queryF(
2517  "SELECT * FROM personal_clipboard WHERE " .
2518  "user_id = %s AND parent = %s AND insert_time = %s " .
2519  " ORDER BY order_nr",
2520  array("integer", "integer", "timestamp"),
2521  array($ilUser->getId(), $a_parent, $a_insert_time)
2522  );
2523  $objects = array();
2524  while ($obj = $ilDB->fetchAssoc($objs)) {
2525  if ($obj["type"] == "mob") {
2526  $obj["title"] = ilObject::_lookupTitle($obj["item_id"]);
2527  }
2528  $objects[] = array("id" => $obj["item_id"],
2529  "type" => $obj["type"], "title" => $obj["title"], "insert_time" => $obj["insert_time"]);
2530  }
2531  return $objects;
2532  }
global $DIC
Definition: feed.php:28
static _lookupTitle(int $obj_id)
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ getClipboardObjects()

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

get all clipboard objects of user and specified type

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

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

2465  : array {
2466  global $DIC;
2467 
2468  $ilDB = $DIC['ilDB'];
2469 
2470  $par = "";
2471  if ($a_top_nodes_only) {
2472  $par = " AND parent = " . $ilDB->quote(0, "integer") . " ";
2473  }
2474 
2475  $type_str = ($a_type != "")
2476  ? " AND type = " . $ilDB->quote($a_type, "text") . " "
2477  : "";
2478  $q = "SELECT * FROM personal_clipboard WHERE " .
2479  "user_id = " . $ilDB->quote($this->getId(), "integer") . " " .
2480  $type_str . $par .
2481  " ORDER BY order_nr";
2482  $objs = $ilDB->query($q);
2483  $objects = array();
2484  while ($obj = $ilDB->fetchAssoc($objs)) {
2485  if ($obj["type"] == "mob") {
2486  $obj["title"] = ilObject::_lookupTitle($obj["item_id"]);
2487  if (ilObject::_lookupType((int) $obj["item_id"]) !== "mob") {
2488  continue;
2489  }
2490  }
2491  if ($obj["type"] == "incl") {
2492  $obj["title"] = ilMediaPoolPage::lookupTitle($obj["item_id"]);
2493  if (!ilPageObject::_exists("mep", (int) $obj["item_id"], "-")) {
2494  continue;
2495  }
2496  }
2497  $objects[] = array("id" => $obj["item_id"],
2498  "type" => $obj["type"], "title" => $obj["title"],
2499  "insert_time" => $obj["insert_time"]);
2500  }
2501  return $objects;
2502  }
static lookupTitle(int $a_page_id)
global $DIC
Definition: feed.php:28
static _lookupTitle(int $obj_id)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ getComment()

ilObjUser::getComment ( )

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

References $referral_comment.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getCountry()

ilObjUser::getCountry ( )

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

References $country.

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

1355  : string
1356  {
1357  return $this->country;
1358  }
string $country
+ Here is the caller graph for this function:

◆ getCurrentLanguage()

ilObjUser::getCurrentLanguage ( )

returns the current language (may differ from user's pref setting!)

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

References ilSession\get().

1564  : string
1565  {
1566  return (string) ilSession::get('lang');
1567  }
static get(string $a_var)
+ Here is the call graph for this function:

◆ getDateFormat()

ilObjUser::getDateFormat ( )

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

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

Referenced by ilIndividualAssessmentDateFormatter\getUserDateFormat().

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

◆ getDepartment()

ilObjUser::getDepartment ( )

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

References $department.

Referenced by deleteUserDefinedFieldEntries().

1315  : string
1316  {
1317  return $this->department;
1318  }
string $department
+ Here is the caller graph for this function:

◆ getEmail()

◆ getExternalAccount()

ilObjUser::getExternalAccount ( )

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

References $ext_account.

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

2621  : string
2622  {
2623  return $this->ext_account;
2624  }
string $ext_account
+ Here is the caller graph for this function:

◆ getFax()

ilObjUser::getFax ( )

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

References $fax.

Referenced by deleteUserDefinedFieldEntries().

1411  : string
1412  {
1413  return $this->fax;
1414  }
+ Here is the caller graph for this function:

◆ getFirstLettersOfLastnames()

static ilObjUser::getFirstLettersOfLastnames ( ?array  $user_ids = null)
static

Get first letters of all lastnames.

Parameters
int[]$user_ids

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

References $DIC, $ilDB, and ANONYMOUS_USER_ID.

Referenced by ilObjUserFolderGUI\viewObject().

3890  : array {
3891  global $DIC;
3892 
3893  $ilDB = $DIC->database();
3894 
3895  $q = "SELECT DISTINCT " . $ilDB->upper($ilDB->substr("lastname", 1, 1)) . " let" .
3896  " FROM usr_data" .
3897  " WHERE usr_id <> " . $ilDB->quote(ANONYMOUS_USER_ID, "integer") .
3898  ($user_ids !== null ? " AND " . $ilDB->in('usr_id', $user_ids, false, "integer") : "") .
3899  " ORDER BY let";
3900  $let_set = $ilDB->query($q);
3901 
3902  $let = array();
3903  while ($let_rec = $ilDB->fetchAssoc($let_set)) {
3904  $let[$let_rec["let"]] = $let_rec["let"];
3905  }
3906  return $let;
3907  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getFirstLogin()

ilObjUser::getFirstLogin ( )

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

References $first_login.

Referenced by refreshLogin().

1592  : string
1593  {
1594  return $this->first_login;
1595  }
string $first_login
+ Here is the caller graph for this function:

◆ getFirstname()

◆ getFullname()

ilObjUser::getFullname ( int  $a_max_strlen = 0)
Parameters
int$a_max_strlenmax. string length to return (optional) if string length of fullname is greater than given a_max_strlen the name is shortened in the following way:
  1. abreviate firstname (-> Dr. J. Smith) if fullname is still too long
  2. drop title (-> John Smith) if fullname is still too long
  3. drop title and abreviate first name (J. Smith) if fullname is still too long
  4. drop title and firstname and shorten lastname to max length (–> Smith)

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

References ilUtil\stripSlashes().

Referenced by ilIndividualAssessmentMembersStorageDB\createAssessmentMember(), shibUser\createFields(), ILIAS\EmployeeTalk\Service\VEventFactory\getInstanceFromTalk(), ilCmiXapiUser\getName(), ilObjSurvey\getUserDataFromActiveId(), ilAccountMail\send(), ilAccountRegistrationMail\sendLanguageVariableBasedAccountMail(), and ilObjUserFolderGUI\showActionConfirmation().

1196  : string
1197  {
1198  if (!$a_max_strlen) {
1199  return ilUtil::stripSlashes($this->fullname);
1200  }
1201 
1202  if (strlen($this->fullname) <= $a_max_strlen) {
1203  return ilUtil::stripSlashes($this->fullname);
1204  }
1205 
1206  if ((strlen($this->utitle) + strlen($this->lastname) + 4) <= $a_max_strlen) {
1207  return ilUtil::stripSlashes($this->utitle . " " . substr($this->firstname, 0, 1) . ". " . $this->lastname);
1208  }
1209 
1210  if ((strlen($this->firstname) + strlen($this->lastname) + 1) <= $a_max_strlen) {
1211  return ilUtil::stripSlashes($this->firstname . " " . $this->lastname);
1212  }
1213 
1214  if ((strlen($this->lastname) + 3) <= $a_max_strlen) {
1215  return ilUtil::stripSlashes(substr($this->firstname, 0, 1) . ". " . $this->lastname);
1216  }
1217 
1218  return ilUtil::stripSlashes(substr($this->lastname, 0, $a_max_strlen));
1219  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGender()

ilObjUser::getGender ( )

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

References $gender.

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

1260  : string
1261  {
1262  return $this->gender;
1263  }
string $gender
+ Here is the caller graph for this function:

◆ getGeneralInterests()

ilObjUser::getGeneralInterests ( )
Returns
string[]

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

References $interests_general.

Referenced by updateMultiTextFields().

4114  : array
4115  {
4116  return $this->interests_general;
4117  }
array $interests_general
+ Here is the caller graph for this function:

◆ getGeneralInterestsAsText()

ilObjUser::getGeneralInterestsAsText ( )

Get general interests as plain text.

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

References buildTextFromArray().

4122  : string
4123  {
4124  return $this->buildTextFromArray($this->interests_general);
4125  }
buildTextFromArray(array $a_attr)
Convert multi-text values to plain text.
+ Here is the call graph for this function:

◆ getHobby()

ilObjUser::getHobby ( )

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

References $hobby.

Referenced by deleteUserDefinedFieldEntries().

1474  : string
1475  {
1476  return $this->hobby;
1477  }
+ Here is the caller graph for this function:

◆ getInactivationDate()

ilObjUser::getInactivationDate ( )

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

References $inactivation_date.

3999  : ?string
4000  {
4001  return $this->inactivation_date;
4002  }
string $inactivation_date

◆ getInstitution()

ilObjUser::getInstitution ( )

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

References $institution.

Referenced by deleteUserDefinedFieldEntries().

1305  : string
1306  {
1307  return $this->institution;
1308  }
string $institution
+ Here is the caller graph for this function:

◆ getLanguage()

◆ getLastLogin()

ilObjUser::getLastLogin ( )

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

References $last_login.

Referenced by ilObjUserFolderGUI\showActionConfirmation().

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

◆ getLastname()

◆ getLastPasswordChangeTS()

ilObjUser::getLastPasswordChangeTS ( )

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

References $last_password_change_ts.

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

1495  : int
1496  {
1498  }
int $last_password_change_ts
+ Here is the caller graph for this function:

◆ getLastProfilePrompt()

ilObjUser::getLastProfilePrompt ( )

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

References $last_profile_prompt.

1602  : string
1603  {
1605  }
string $last_profile_prompt

◆ getLastUpdate()

ilObjUser::getLastUpdate ( )

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

References ilObject\$last_update.

1612  : string
1613  {
1614  return $this->last_update;
1615  }
string $last_update

◆ getLatitude()

ilObjUser::getLatitude ( )

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

References $latitude.

Referenced by ilPersonalProfileGUI\addLocationToForm().

1918  : ?string
1919  {
1920  return $this->latitude;
1921  }
string $latitude
+ Here is the caller graph for this function:

◆ getLocationZoom()

ilObjUser::getLocationZoom ( )

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

References $loc_zoom.

Referenced by ilPersonalProfileGUI\addLocationToForm().

1938  : ?int
1939  {
1940  return $this->loc_zoom;
1941  }
string $loc_zoom
+ Here is the caller graph for this function:

◆ getLogin()

◆ getLoginAttempts()

ilObjUser::getLoginAttempts ( )

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

References $login_attempts.

1782  : int
1783  {
1784  return $this->login_attempts;
1785  }

◆ getLoginByUserId()

ilObjUser::getLoginByUserId ( int  $a_userid)

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

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

2085  : ?string
2086  {
2087  $login = self::_lookupLogin($a_userid);
2088  return $login ?: null;
2089  }

◆ getLoginFromAuth()

static ilObjUser::getLoginFromAuth ( )
staticprivate

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

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

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

1979  : string
1980  {
1981  $uid = $GLOBALS['DIC']['ilAuthSession']->getUserId();
1982  $login = self::_lookupLogin($uid);
1983 
1984  // BEGIN WebDAV: Strip Microsoft Domain Names from logins
1986  $login = self::toUsernameWithoutDomain($login);
1987  }
1988  return $login;
1989  }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the call graph for this function:

◆ getLongitude()

ilObjUser::getLongitude ( )

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

References $longitude.

Referenced by ilPersonalProfileGUI\addLocationToForm().

1928  : ?string
1929  {
1930  return $this->longitude;
1931  }
string $longitude
+ Here is the caller graph for this function:

◆ getLookingForHelp()

ilObjUser::getLookingForHelp ( )
Returns
string[]

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

References $interests_help_looking.

Referenced by updateMultiTextFields().

4162  : array
4163  {
4165  }
array $interests_help_looking
+ Here is the caller graph for this function:

◆ getLookingForHelpAsText()

ilObjUser::getLookingForHelpAsText ( )

Get help looking for as plain text.

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

References buildTextFromArray().

4170  : string
4171  {
4172  return $this->buildTextFromArray($this->interests_help_looking);
4173  }
buildTextFromArray(array $a_attr)
Convert multi-text values to plain text.
+ Here is the call graph for this function:

◆ getMatriculation()

ilObjUser::getMatriculation ( )

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

References $matriculation.

Referenced by deleteUserDefinedFieldEntries().

1431  : string
1432  {
1433  return $this->matriculation;
1434  }
string $matriculation
+ Here is the caller graph for this function:

◆ getOfferingHelp()

ilObjUser::getOfferingHelp ( )
Returns
string[]

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

References $interests_help_offered.

Referenced by updateMultiTextFields().

4138  : array
4139  {
4141  }
array $interests_help_offered
+ Here is the caller graph for this function:

◆ getOfferingHelpAsText()

ilObjUser::getOfferingHelpAsText ( )

Get help offering as plain text.

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

References buildTextFromArray().

4146  : string
4147  {
4148  return $this->buildTextFromArray($this->interests_help_offered);
4149  }
buildTextFromArray(array $a_attr)
Convert multi-text values to plain text.
+ Here is the call graph for this function:

◆ getOrgUnitsRepresentation()

ilObjUser::getOrgUnitsRepresentation ( )

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

References ilObject\getId().

2598  : string
2599  {
2600  return self::lookupOrgUnitsRepresentation($this->getId());
2601  }
+ Here is the call graph for this function:

◆ getPasswd()

ilObjUser::getPasswd ( )
Returns
string The password is encoded depending on the current password type.

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

References $passwd.

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

1242  : string
1243  {
1244  return $this->passwd;
1245  }
string $passwd
+ Here is the caller graph for this function:

◆ getPasswdType()

ilObjUser::getPasswdType ( )
Returns
string password type (ilObjUser::PASSWD_PLAIN, ilObjUser::PASSWD_CRYPTED).

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

References $passwd_type.

1250  : string
1251  {
1252  return $this->passwd_type;
1253  }
string $passwd_type

◆ getPasswordAge()

ilObjUser::getPasswordAge ( )

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

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

1865  : int
1866  {
1867  $current_ts = time();
1868  $pass_change_ts = $this->getLastPasswordChangeTS();
1869  $password_age = (int) (($current_ts - $pass_change_ts) / 86400);
1870  return $password_age;
1871  }
+ Here is the call graph for this function:

◆ getPasswordEncodingType()

ilObjUser::getPasswordEncodingType ( )

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

References $password_encoding_type.

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

212  : ?string
213  {
215  }
string $password_encoding_type
+ Here is the caller graph for this function:

◆ getPasswordPolicyResetStatus()

ilObjUser::getPasswordPolicyResetStatus ( )

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

References $passwd_policy_reset.

Referenced by isPasswordChangeDemanded().

1500  : bool
1501  {
1503  }
bool $passwd_policy_reset
+ Here is the caller graph for this function:

◆ getPasswordSalt()

ilObjUser::getPasswordSalt ( )

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

References $password_salt.

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

222  : ?string
223  {
224  return $this->password_salt;
225  }
string $password_salt
+ Here is the caller graph for this function:

◆ getPCClipboardContent()

ilObjUser::getPCClipboardContent ( )

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

Todo:
move to COPage service

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

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

Referenced by ilPageObject\pasteContents().

2389  : array // Missing array type.
2390  {
2391  $ilDB = $this->db;
2392 
2393  if (!ilSession::get("user_pc_clip")) {
2394  return [];
2395  }
2396 
2397  $set = $ilDB->queryF("SELECT MAX(insert_time) mtime FROM personal_pc_clipboard " .
2398  " WHERE user_id = %s", array("integer"), array($this->getId()));
2399  $row = $ilDB->fetchAssoc($set);
2400 
2401  $set = $ilDB->queryF(
2402  "SELECT * FROM personal_pc_clipboard " .
2403  " WHERE user_id = %s AND insert_time = %s ORDER BY order_nr ASC",
2404  array("integer", "timestamp"),
2405  array($this->getId(), $row["mtime"])
2406  );
2407  $content = array();
2408  while ($row = $ilDB->fetchAssoc($set)) {
2409  $content[] = $row["content"];
2410  }
2411 
2412  return $content;
2413  }
static get(string $a_var)
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPersonalDataExportFile()

ilObjUser::getPersonalDataExportFile ( )

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

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

Referenced by sendPersonalDataFile().

3940  : string
3941  {
3942  $dir = ilExport::_getExportDirectory($this->getId(), "xml", "usr", "personal_data");
3943  if (!is_dir($dir)) {
3944  return "";
3945  }
3946  foreach (ilFileUtils::getDir($dir) as $entry) {
3947  if (is_int(strpos($entry["entry"], ".zip"))) {
3948  return $entry["entry"];
3949  }
3950  }
3951 
3952  return "";
3953  }
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object.
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPersonalPicturePath()

ilObjUser::getPersonalPicturePath ( string  $a_size = "small",
bool  $a_force_pic = false 
)
Parameters
string$a_size"small", "xsmall" or "xxsmall"
Exceptions
ilWACException

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

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

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

2866  : string {
2867  if (isset(self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic])) {
2868  return self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic];
2869  }
2870 
2871  self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic] = self::_getPersonalPicturePath($this->getId(), $a_size, $a_force_pic);
2872 
2873  return self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic];
2874  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPhoneHome()

ilObjUser::getPhoneHome ( )

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

References $phone_home.

Referenced by deleteUserDefinedFieldEntries().

1391  : string
1392  {
1393  return $this->phone_home;
1394  }
string $phone_home
+ Here is the caller graph for this function:

◆ getPhoneMobile()

ilObjUser::getPhoneMobile ( )

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

References $phone_mobile.

Referenced by deleteUserDefinedFieldEntries().

1401  : string
1402  {
1403  return $this->phone_mobile;
1404  }
string $phone_mobile
+ Here is the caller graph for this function:

◆ getPhoneOffice()

ilObjUser::getPhoneOffice ( )

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

References $phone_office.

Referenced by deleteUserDefinedFieldEntries().

1381  : string
1382  {
1383  return $this->phone_office;
1384  }
string $phone_office
+ Here is the caller graph for this function:

◆ getPref()

ilObjUser::getPref ( string  $a_keyword)

◆ getProfileIncomplete()

ilObjUser::getProfileIncomplete ( )

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

References $profile_incomplete, and ANONYMOUS_USER_ID.

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

1803  : bool
1804  {
1805  if ($this->id == ANONYMOUS_USER_ID) {
1806  return false;
1807  }
1809  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
bool $profile_incomplete
+ Here is the caller graph for this function:

◆ getProfileStatusOfUsers()

static ilObjUser::getProfileStatusOfUsers ( array  $a_user_ids)
static

Get profile status.

Parameters
int[]$a_user_ids user ids
Returns
array[] array["global"] => all user ids having their profile global (www) activated, array["local"] => all user ids having their profile only locally (logged in users) activated, array["public"] => all user ids having their profile either locally or globally activated, array["not_public"] => all user ids having their profile deactivated

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

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

Referenced by ilInternalLink\searchUsers().

4316  : array {
4317  global $DIC;
4318 
4319  $ilDB = $DIC->database();
4320 
4321  $set = $ilDB->query(
4322  "SELECT * FROM usr_pref " .
4323  " WHERE keyword = " . $ilDB->quote("public_profile", "text") .
4324  " AND " . $ilDB->in("usr_id", $a_user_ids, false, "integer")
4325  );
4326  $r = array(
4327  "global" => array(),
4328  "local" => array(),
4329  "public" => array(),
4330  "not_public" => array()
4331  );
4332  while ($rec = $ilDB->fetchAssoc($set)) {
4333  if ($rec["value"] == "g") {
4334  $r["global"][] = $rec["usr_id"];
4335  $r["public"][] = $rec["usr_id"];
4336  }
4337  if ($rec["value"] == "y") {
4338  $r["local"][] = $rec["usr_id"];
4339  $r["public"][] = $rec["usr_id"];
4340  }
4341  }
4342  foreach ($a_user_ids as $id) {
4343  if (!in_array($id, $r["public"])) {
4344  $r["not_public"][] = $id;
4345  }
4346  }
4347 
4348  return $r;
4349  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getPublicName()

ilObjUser::getPublicName ( )

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

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

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

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

3555  : string
3556  {
3557  if ($this->hasPublicProfile()) {
3558  return $this->getFirstname() . " " . $this->getLastname() . " (" . $this->getLogin() . ")";
3559  } else {
3560  return $this->getLogin();
3561  }
3562  }
hasPublicProfile()
returns true if public is profile, false otherwise
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSecondEmail()

ilObjUser::getSecondEmail ( )

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

References $second_email.

Referenced by deleteUserDefinedFieldEntries().

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

◆ getSelectedCountry()

ilObjUser::getSelectedCountry ( )

Get selected country (selection drop down)

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

References $sel_country.

Referenced by deleteUserDefinedFieldEntries(), and ilTermsOfServiceUserHasCountryCriterion\evaluate().

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

◆ getStoredActive()

ilObjUser::getStoredActive ( int  $a_id)

get user active state

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

Referenced by syncActive(), and update().

1717  : bool
1718  {
1719  return (bool) self::_lookup($a_id, "active");
1720  }
+ Here is the caller graph for this function:

◆ getStreet()

ilObjUser::getStreet ( )

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

References $street.

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

1325  : string
1326  {
1327  return $this->street;
1328  }
string $street
+ Here is the caller graph for this function:

◆ getTimeFormat()

ilObjUser::getTimeFormat ( )

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

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

Referenced by ilIndividualAssessmentDateFormatter\getUserDateFormat().

1000  : string
1001  {
1002  if ($format = $this->getPref('time_format')) {
1003  return $format;
1004  } else {
1006  return $settings->getDefaultTimeFormat();
1007  }
1008  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
getPref(string $a_keyword)
$format
Definition: metadata.php:235
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTimeLimitFrom()

ilObjUser::getTimeLimitFrom ( )

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

References $time_limit_from.

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

1742  : ?int
1743  {
1744  return $this->time_limit_from;
1745  }
int $time_limit_from
+ Here is the caller graph for this function:

◆ getTimeLimitMessage()

ilObjUser::getTimeLimitMessage ( )

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

References $time_limit_message.

Referenced by update().

1772  : string
1773  {
1775  }
string $time_limit_message
+ Here is the caller graph for this function:

◆ getTimeLimitOwner()

ilObjUser::getTimeLimitOwner ( )

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

Referenced by saveAsNew(), and update().

1732  : int
1733  {
1734  return $this->time_limit_owner ?: 7;
1735  }
+ Here is the caller graph for this function:

◆ getTimeLimitUnlimited()

ilObjUser::getTimeLimitUnlimited ( )

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

References $time_limit_unlimited.

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

1762  : bool
1763  {
1765  }
bool $time_limit_unlimited
+ Here is the caller graph for this function:

◆ getTimeLimitUntil()

ilObjUser::getTimeLimitUntil ( )

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

References $time_limit_until.

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

1752  : ?int
1753  {
1754  return $this->time_limit_until;
1755  }
int $time_limit_until
+ Here is the caller graph for this function:

◆ getTimeZone()

ilObjUser::getTimeZone ( )

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

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

Referenced by ilObjEmployeeTalkGUI\sendNotification(), ilEmployeeTalkAppointmentGUI\sendNotification(), ilObjEmployeeTalkSeriesGUI\sendNotification(), and ilObjEmployeeTalkGUI\sendUpdateNotification().

990  : string
991  {
992  if ($tz = $this->getPref('user_tz')) {
993  return $tz;
994  } else {
996  return $settings->getDefaultTimeZone();
997  }
998  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
getPref(string $a_keyword)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUserDefinedData()

ilObjUser::getUserDefinedData ( )

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

Referenced by deleteUserDefinedFieldEntries(), and ilUserProfile\isProfileIncomplete().

2972  : array // Missing array type.
2973  {
2974  return $this->user_defined_data ?: array();
2975  }
+ Here is the caller graph for this function:

◆ getUserIdByLogin()

◆ getUserIdsByEmail()

static ilObjUser::getUserIdsByEmail ( string  $a_email)
static
Returns
int[] of user ids

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

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

Referenced by ilObjSurvey\sendNotificationMail().

2041  : array
2042  {
2043  global $DIC;
2044 
2045  $ilDB = $DIC->database();
2046 
2047  $res = $ilDB->queryF(
2048  "SELECT usr_id FROM usr_data " .
2049  "WHERE email = %s and active = 1",
2050  array("text"),
2051  array($a_email)
2052  );
2053  $ids = array();
2054  while ($row = $ilDB->fetchObject($res)) {
2055  $ids[] = (int) $row->usr_id;
2056  }
2057 
2058  return $ids;
2059  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUserIdsByInactivityPeriod()

static ilObjUser::getUserIdsByInactivityPeriod ( int  $periodInDays)
static

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

Parameters
int$periodInDays
Returns
int[]
Exceptions
ilException

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

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

Referenced by ilCronDeleteInactiveUserAccounts\hasCustomSettings().

3789  : array {
3790  global $DIC;
3791 
3792  if ($periodInDays < 1) {
3793  throw new ilException('Invalid period given');
3794  }
3795 
3796  $date = date('Y-m-d H:i:s', (time() - ($periodInDays * 24 * 60 * 60)));
3797 
3798  $query = "SELECT usr_id FROM usr_data WHERE last_login IS NOT NULL AND last_login < %s";
3799 
3800  $ids = [];
3801 
3802  $types = ['timestamp'];
3803  $values = [$date];
3804 
3805  $res = $DIC->database()->queryF($query, $types, $values);
3806  while ($row = $DIC->database()->fetchAssoc($res)) {
3807  $ids[] = (int) $row['usr_id'];
3808  }
3809 
3810  return $ids;
3811  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUserIdsNeverLoggedIn()

static ilObjUser::getUserIdsNeverLoggedIn ( int  $thresholdInDays)
static

Get ids of all users that have never logged in.

Parameters
int$thresholdInDays
Returns
int[]

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

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

Referenced by ilCronDeleteNeverLoggedInUserAccounts\run().

3820  : array {
3821  global $DIC;
3822 
3823  $date = date('Y-m-d H:i:s', (time() - ($thresholdInDays * 24 * 60 * 60)));
3824 
3825  $query = "SELECT usr_id FROM usr_data WHERE last_login IS NULL AND create_date < %s";
3826 
3827  $ids = [];
3828 
3829  $types = ['timestamp'];
3830  $values = [$date];
3831 
3832  $res = $DIC->database()->queryF($query, $types, $values);
3833  while ($row = $DIC->database()->fetchAssoc($res)) {
3834  $ids[] = (int) $row['usr_id'];
3835  }
3836 
3837  return $ids;
3838  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUserLoginsByEmail()

static ilObjUser::getUserLoginsByEmail ( string  $a_email)
static
Returns
string[] with all user login names

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

References $DIC, $ilDB, and $res.

Referenced by ilPasswordAssistanceGUI\submitUsernameAssistanceForm().

2065  : array
2066  {
2067  global $DIC;
2068 
2069  $ilDB = $DIC->database();
2070 
2071  $res = $ilDB->queryF(
2072  "SELECT login FROM usr_data " .
2073  "WHERE email = %s and active = 1",
2074  array("text"),
2075  array($a_email)
2076  );
2077  $ids = array();
2078  while ($row = $ilDB->fetchObject($res)) {
2079  $ids[] = $row->login;
2080  }
2081 
2082  return $ids;
2083  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getUsersAgreed()

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

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

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

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

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

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

4027  : array {
4028  global $DIC;
4029 
4030  $ilDB = $DIC['ilDB'];
4031 
4032  $date_is = ($a_agreed)
4033  ? "IS NOT NULL"
4034  : "IS NULL";
4035 
4036  $users = (is_array($a_users))
4037  ? " AND " . $ilDB->in("usr_id", $a_users, false, "integer")
4038  : "";
4039 
4040  $set = $ilDB->query("SELECT usr_id FROM usr_data " .
4041  " WHERE agree_date " . $date_is .
4042  $users);
4043  $ret = array();
4044  while ($rec = $ilDB->fetchAssoc($set)) {
4045  $ret[] = (int) $rec["usr_id"];
4046  }
4047  return $ret;
4048  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUserSubsetByPreferenceValue()

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

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

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

References $DIC, and $ilDB.

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

3479  : array {
3480  global $DIC;
3481 
3482  $ilDB = $DIC['ilDB'];
3483 
3484  $users = array();
3485  $set = $ilDB->query(
3486  "SELECT usr_id FROM usr_pref " .
3487  " WHERE keyword = " . $ilDB->quote($a_keyword, "text") .
3488  " AND " . $ilDB->in("usr_id", $a_user_ids, false, "integer") .
3489  " AND value = " . $ilDB->quote($a_val, "text")
3490  );
3491  while ($rec = $ilDB->fetchAssoc($set)) {
3492  $users[] = $rec["usr_id"];
3493  }
3494  return $users;
3495  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getUTitle()

ilObjUser::getUTitle ( )

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

References $utitle.

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

1275  : string
1276  {
1277  return $this->utitle;
1278  }
string $utitle
+ Here is the caller graph for this function:

◆ getZipcode()

ilObjUser::getZipcode ( )

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

References $zipcode.

Referenced by deleteUserDefinedFieldEntries().

1345  : string
1346  {
1347  return $this->zipcode;
1348  }
string $zipcode
+ Here is the caller graph for this function:

◆ hasActiveSession()

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

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

References $DIC, and $ilDB.

Referenced by ilAuthFrontend\checkSimultaneousLogins().

1947  : bool {
1948  global $DIC;
1949 
1950  $ilDB = $DIC['ilDB'];
1951 
1952  $set = $ilDB->queryf(
1953  '
1954  SELECT COUNT(*) session_count
1955  FROM usr_session WHERE user_id = %s AND expires > %s AND session_id != %s ',
1956  array('integer', 'integer', 'text'),
1957  array($a_user_id, time(), $a_session_id)
1958  );
1959  $row = $ilDB->fetchAssoc($set);
1960  return (bool) $row['session_count'];
1961  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ hasDeletionFlag()

ilObjUser::hasDeletionFlag ( )

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

References getPref().

4083  : bool
4084  {
4085  return (bool) $this->getPref("delete_flag");
4086  }
getPref(string $a_keyword)
+ Here is the call graph for this function:

◆ hasPublicProfile()

ilObjUser::hasPublicProfile ( )

returns true if public is profile, false otherwise

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

References getPref().

Referenced by getPublicName().

3547  : bool
3548  {
3549  return in_array($this->getPref("public_profile"), array("y", "g"));
3550  }
getPref(string $a_keyword)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasToAcceptTermsOfService()

ilObjUser::hasToAcceptTermsOfService ( )

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

References ANONYMOUS_USER_ID, ilObject\getId(), ilTermsOfServiceHelper\isEnabled(), ILIAS\UI\examples\Symbol\Glyph\Login\login(), and SYSTEM_USER_ID.

4004  : bool
4005  {
4006  if (
4008  null == $this->agree_date &&
4009  'root' != $this->login &&
4010  !in_array($this->getId(), array(ANONYMOUS_USER_ID, SYSTEM_USER_ID))
4011  ) {
4012  return true;
4013  }
4014 
4015  return false;
4016  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26
+ Here is the call graph for this function:

◆ hasToAcceptTermsOfServiceInSession()

ilObjUser::hasToAcceptTermsOfServiceInSession ( ?bool  $status = null)

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

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

Referenced by ilTermsOfServiceHelper\trackAcceptance().

4052  : bool {
4053  if (null === $status) {
4054  return (bool) ilSession::get('has_to_accept_agr_in_session');
4055  }
4056 
4058  ilSession::set('has_to_accept_agr_in_session', $status);
4059  }
4060  return $status;
4061  }
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importPersonalData()

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

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

3970  : void {
3971  $imp = new ilImport();
3972  // bookmarks need to be skipped, importer does not exist anymore
3973  $imp->addSkipImporter("Services/Bookmarks");
3974  if (!$a_profile_data) {
3975  $imp->addSkipEntity("Services/User", "usr_profile");
3976  }
3977  if (!$a_settings) {
3978  $imp->addSkipEntity("Services/User", "usr_setting");
3979  }
3980  if (!$a_notes) {
3981  $imp->addSkipEntity("Services/Notes", "user_notes");
3982  }
3983  if (!$a_calendar) {
3984  $imp->addSkipEntity("Services/Calendar", "calendar");
3985  }
3986  $imp->importEntity(
3987  $a_file["tmp_name"],
3988  $a_file["name"],
3989  "personal_data",
3990  "Services/User"
3991  );
3992  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ isAnonymous()

ilObjUser::isAnonymous ( )

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

References ilObject\getId().

Referenced by ilUsersGalleryGUI\addActionSection(), ilMailGlobalServices\getNewMailsData(), and ilTermsOfServiceHelper\isIncludedUser().

4063  : bool
4064  {
4065  return self::_isAnonymous($this->getId());
4066  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCurrentUserActive()

ilObjUser::isCurrentUserActive ( )

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

References ilObject\$db, and $ilDB.

2013  : bool
2014  {
2015  $ilDB = $this->db;
2016 
2017  $login = self::getLoginFromAuth();
2018  $set = $ilDB->queryF(
2019  "SELECT active FROM usr_data WHERE login= %s",
2020  array("text"),
2021  array($login)
2022  );
2023  //query has got a result
2024  if ($rec = $ilDB->fetchAssoc($set)) {
2025  if ($rec["active"]) {
2026  return true;
2027  }
2028  }
2029 
2030  return false;
2031  }
ilDBInterface $db

◆ isPasswordChangeDemanded()

ilObjUser::isPasswordChangeDemanded ( )

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

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

1811  : bool
1812  {
1813  if ($this->id == ANONYMOUS_USER_ID) {
1814  return false;
1815  }
1816 
1817  if ($this->id == SYSTEM_USER_ID) {
1818  if (
1819  \ilUserPasswordManager::getInstance()->verifyPassword($this, base64_decode('aG9tZXI=')) &&
1821  ) {
1822  return true;
1823  } else {
1824  return false;
1825  }
1826  }
1827 
1828  $security = ilSecuritySettings::_getInstance();
1829 
1830  $authModeAllowsPasswordChange = !ilAuthUtils::_needsExternalAccountByAuthMode($this->getAuthMode(true));
1831  $passwordResetOnFirstLogin = (
1832  $security->isPasswordChangeOnFirstLoginEnabled() &&
1833  $this->getLastPasswordChangeTS() == 0 && $this->is_self_registered == false
1834  );
1835  $passwordResetOnChangedPolicy = $this->getPasswordPolicyResetStatus();
1836 
1837  return ($authModeAllowsPasswordChange && ($passwordResetOnFirstLogin || $passwordResetOnChangedPolicy));
1838  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
getPasswordPolicyResetStatus()
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26
static _needsExternalAccountByAuthMode($a_auth_mode)
Check if chosen auth mode needs an external account entry.
getAuthMode(bool $a_auth_key=false)
static _getInstance()
Get instance of ilSecuritySettings.
static getInstance()
Singleton method to reduce footprint (included files, created instances)
+ Here is the call graph for this function:

◆ isPasswordExpired()

ilObjUser::isPasswordExpired ( )

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

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

1840  : bool
1841  {
1842  if ($this->id == ANONYMOUS_USER_ID) {
1843  return false;
1844  }
1845 
1846  $security = ilSecuritySettings::_getInstance();
1847  if ($this->getLastPasswordChangeTS() > 0) {
1848  $max_pass_age = $security->getPasswordMaxAge();
1849  if ($max_pass_age > 0) {
1850  $max_pass_age_ts = ($max_pass_age * 86400);
1851  $pass_change_ts = $this->getLastPasswordChangeTS();
1852  $current_ts = time();
1853 
1854  if (($current_ts - $pass_change_ts) > $max_pass_age_ts) {
1856  return true;
1857  }
1858  }
1859  }
1860  }
1861 
1862  return false;
1863  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
static _needsExternalAccountByAuthMode($a_auth_mode)
Check if chosen auth mode needs an external account entry.
getAuthMode(bool $a_auth_key=false)
static _getInstance()
Get instance of ilSecuritySettings.
+ Here is the call graph for this function:

◆ isSelfRegistered()

ilObjUser::isSelfRegistered ( )

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

References $is_self_registered.

4093  : bool
4094  {
4096  }
bool $is_self_registered

◆ lookupMatriculation()

static ilObjUser::lookupMatriculation ( int  $a_usr_id)
static

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

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

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

1436  : string
1437  {
1438  global $DIC;
1439 
1440  $ilDB = $DIC['ilDB'];
1441 
1442  $query = "SELECT matriculation FROM usr_data " .
1443  "WHERE usr_id = " . $ilDB->quote($a_usr_id);
1444  $res = $ilDB->query($query);
1445  $row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT);
1446  return $row->matriculation ?: '';
1447  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ lookupOrgUnitsRepresentation()

static ilObjUser::lookupOrgUnitsRepresentation ( int  $a_usr_id)
static

lookup org unit representation

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

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

2594  : string {
2595  return ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_usr_id);
2596  }
+ Here is the caller graph for this function:

◆ read()

ilObjUser::read ( )
Exceptions
ilObjectNotFoundException
ilObjectTypeMismatchException
ilSystemStyleException

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

References $data, ilObject\$db, $DIC, $ilDB, $ilErr, assignData(), readMultiTextFields(), readPrefs(), readUserDefinedFields(), setLastPasswordChangeTS(), setLoginAttempts(), setPasswordPolicyResetStatus(), ilStyleDefinition\skinExists(), ilStyleDefinition\styleExists(), and ilStyleDefinition\styleExistsForSkinId().

Referenced by __construct(), and update().

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

◆ readMultiTextFields()

ilObjUser::readMultiTextFields ( )
protected

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

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

Referenced by read().

4188  : void
4189  {
4190  global $DIC;
4191 
4192  $ilDB = $DIC['ilDB'];
4193 
4194  if (!$this->getId()) {
4195  return;
4196  }
4197 
4198  $set = $ilDB->query("SELECT field_id,value" .
4199  " FROM usr_data_multi" .
4200  " WHERE usr_id = " . $ilDB->quote($this->getId(), "integer") .
4201  " ORDER BY value");
4202  while ($row = $ilDB->fetchAssoc($set)) {
4203  $values[$row["field_id"]][] = $row["value"];
4204  }
4205 
4206  if (isset($values["interests_general"])) {
4207  $this->setGeneralInterests($values["interests_general"]);
4208  } else {
4209  $this->setGeneralInterests();
4210  }
4211  if (isset($values["interests_help_offered"])) {
4212  $this->setOfferingHelp($values["interests_help_offered"]);
4213  } else {
4214  $this->setOfferingHelp();
4215  }
4216  if (isset($values["interests_help_looking"])) {
4217  $this->setLookingForHelp($values["interests_help_looking"]);
4218  } else {
4219  $this->setLookingForHelp();
4220  }
4221  }
global $DIC
Definition: feed.php:28
setOfferingHelp(?array $value=null)
setGeneralInterests(?array $value=null)
setLookingForHelp(?array $value=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readPrefs()

ilObjUser::readPrefs ( )

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

References $prefs.

Referenced by read().

1055  : void
1056  {
1057  if (is_array($this->prefs)) {
1058  $this->oldPrefs = $this->prefs;
1059  }
1060  $this->prefs = self::_getPreferences($this->id);
1061  }
+ Here is the caller graph for this function:

◆ readUserDefinedFields()

ilObjUser::readUserDefinedFields ( )

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

References ilObject\getId().

Referenced by read().

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

◆ refreshLogin()

ilObjUser::refreshLogin ( )

updates the login data of a "user"

Todo:
set date with now() should be enough

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

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

723  : void
724  {
725  $ilDB = $this->db;
726 
727  $ilDB->manipulateF(
728  "UPDATE usr_data SET " .
729  "last_login = " . $ilDB->now() .
730  " WHERE usr_id = %s",
731  array("integer"),
732  array($this->id)
733  );
734 
735  if ($this->getFirstLogin() == "") {
736  $ilDB->manipulateF(
737  "UPDATE usr_data SET " .
738  "first_login = " . $ilDB->now() .
739  " WHERE usr_id = %s",
740  array("integer"),
741  array($this->id)
742  );
743  $this->app_event_handler->raise(
744  "Services/User",
745  "firstLogin",
746  array("user_obj" => $this)
747  );
748  }
749  }
ilDBInterface $db
+ Here is the call graph for this function:

◆ removeDeletionFlag()

ilObjUser::removeDeletionFlag ( )

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

References writePref().

4078  : void
4079  {
4080  $this->writePref("delete_flag", false);
4081  }
writePref(string $a_keyword, string $a_value)
+ Here is the call graph for this function:

◆ removeObjectFromClipboard()

ilObjUser::removeObjectFromClipboard ( int  $a_item_id,
string  $a_type 
)

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

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

2561  : void {
2562  $ilDB = $this->db;
2563 
2564  $q = "DELETE FROM personal_clipboard WHERE " .
2565  "item_id = " . $ilDB->quote($a_item_id, "integer") .
2566  " AND type = " . $ilDB->quote($a_type, "text") . " " .
2567  " AND user_id = " . $ilDB->quote($this->getId(), "integer");
2568  $ilDB->manipulate($q);
2569  }
ilDBInterface $db
+ Here is the call graph for this function:

◆ removeUserPicture()

ilObjUser::removeUserPicture ( bool  $a_do_update = true)

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

References ilObject\getId(), ilFileUtils\getWebspaceDir(), setPref(), and update().

Referenced by delete().

2932  : void {
2933  $webspace_dir = ilFileUtils::getWebspaceDir();
2934  $image_dir = $webspace_dir . "/usr_images";
2935  $file = $image_dir . "/usr_" . $this->getId() . "." . "jpg";
2936  $thumb_file = $image_dir . "/usr_" . $this->getId() . "_small.jpg";
2937  $xthumb_file = $image_dir . "/usr_" . $this->getId() . "_xsmall.jpg";
2938  $xxthumb_file = $image_dir . "/usr_" . $this->getId() . "_xxsmall.jpg";
2939  $upload_file = $image_dir . "/upload_" . $this->getId();
2940 
2941  if ($a_do_update) {
2942  // remove user pref file name
2943  $this->setPref("profile_image", "");
2944  $this->update();
2945  }
2946 
2947  if (is_file($file)) {
2948  unlink($file);
2949  }
2950  if (is_file($thumb_file)) {
2951  unlink($thumb_file);
2952  }
2953  if (is_file($xthumb_file)) {
2954  unlink($xthumb_file);
2955  }
2956  if (is_file($xxthumb_file)) {
2957  unlink($xxthumb_file);
2958  }
2959  if (is_file($upload_file)) {
2960  unlink($upload_file);
2961  }
2962  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
setPref(string $a_keyword, ?string $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetLastPasswordChange()

ilObjUser::resetLastPasswordChange ( )

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

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

1895  : bool
1896  {
1897  $ilDB = $this->db;
1898 
1899  $query = "UPDATE usr_data SET last_password_change = 0 " .
1900  "WHERE usr_id = %s";
1901  $affected = $ilDB->manipulateF(
1902  $query,
1903  array('integer'),
1904  array($this->getId())
1905  );
1906  if ($affected) {
1907  return true;
1908  } else {
1909  return false;
1910  }
1911  }
ilDBInterface $db
$query
+ Here is the call graph for this function:

◆ resetOwner()

ilObjUser::resetOwner ( )

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

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

Referenced by delete().

3875  : void
3876  {
3877  $ilDB = $this->db;
3878 
3879  $query = "UPDATE object_data SET owner = 0 " .
3880  "WHERE owner = " . $ilDB->quote($this->getId(), 'integer');
3881  $ilDB->query($query);
3882  }
ilDBInterface $db
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetPassword()

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

Resets the user password.

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

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

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

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

763  : bool {
764  $ilDB = $this->db;
765 
766  if (func_num_args() != 2) {
767  return false;
768  }
769 
770  if (!isset($raw) || !isset($raw_retype)) {
771  return false;
772  }
773 
774  if ($raw != $raw_retype) {
775  return false;
776  }
777 
778  ilUserPasswordManager::getInstance()->encodePassword($this, $raw);
779 
780  $ilDB->manipulateF(
781  'UPDATE usr_data
782  SET passwd = %s, passwd_enc_type = %s, passwd_salt = %s
783  WHERE usr_id = %s',
784  array('text', 'text', 'text', 'integer'),
785  array($this->getPasswd(), $this->getPasswordEncodingType(), $this->getPasswordSalt(), $this->getId())
786  );
787 
788  return true;
789  }
ilDBInterface $db
static getInstance()
Singleton method to reduce footprint (included files, created instances)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveAsNew()

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

redundant data in object_data!

Exceptions
ilPasswordException
ilUserException

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

References ilObject\$db, $DIC, $ilDB, $ilErr, $passwd, getAuthMode(), getBirthday(), getExternalAccount(), ilUserPasswordManager\getInstance(), getPasswd(), getPasswordEncodingType(), getPasswordSalt(), getProfileIncomplete(), getTimeLimitFrom(), getTimeLimitOwner(), getTimeLimitUnlimited(), getTimeLimitUntil(), ILIAS\UI\examples\Symbol\Glyph\Login\login(), ilUtil\now(), setInactivationDate(), updateMultiTextFields(), and updateUserDefinedFields().

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

◆ sendPersonalDataFile()

ilObjUser::sendPersonalDataFile ( )

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

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

3955  : void
3956  {
3957  $file = ilExport::_getExportDirectory($this->getId(), "xml", "usr", "personal_data") .
3958  "/" . $this->getPersonalDataExportFile();
3959  if (is_file($file)) {
3961  }
3962  }
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object.
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
+ Here is the call graph for this function:

◆ setActive()

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

set user active state and updates system fields appropriately

Parameters
int$a_ownerthe id of the person who approved the account, defaults to 6 (root)

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

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

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

1657  : void {
1658  $this->setOwner($a_owner);
1659 
1660  if ($a_active) {
1661  $this->active = 1;
1662  $this->setApproveDate(date('Y-m-d H:i:s'));
1663  $this->setOwner($a_owner);
1664  } else {
1665  $this->active = 0;
1666  $this->setApproveDate(null);
1667  }
1668  }
setApproveDate(?string $a_str)
set date the user account was activated null indicates that the user has not yet been activated ...
setOwner(int $usr_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAgreeDate()

ilObjUser::setAgreeDate ( ?string  $a_str)

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

Referenced by ilTermsOfServiceHelper\resetAcceptance().

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

◆ setApproveDate()

ilObjUser::setApproveDate ( ?string  $a_str)

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

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

Referenced by setActive().

1631  : void
1632  {
1633  $this->approve_date = $a_str;
1634  }
+ Here is the caller graph for this function:

◆ setAuthMode()

ilObjUser::setAuthMode ( ?string  $a_str)

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

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

2603  : void
2604  {
2605  $this->auth_mode = $a_str;
2606  }
+ Here is the caller graph for this function:

◆ setBirthday()

ilObjUser::setBirthday ( ?string  $a_birthday)

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

References IL_CAL_DATE.

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

3766  : void
3767  {
3768  if (strlen($a_birthday)) {
3769  $date = new ilDate($a_birthday, IL_CAL_DATE);
3770  $this->birthday = $date->get(IL_CAL_DATE);
3771  } else {
3772  $this->birthday = null;
3773  }
3774  }
const IL_CAL_DATE
+ Here is the caller graph for this function:

◆ setCity()

ilObjUser::setCity ( string  $a_str)

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

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

1330  : void
1331  {
1332  $this->city = $a_str;
1333  }
+ Here is the caller graph for this function:

◆ setClientIP()

ilObjUser::setClientIP ( string  $a_str)

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

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

1416  : void
1417  {
1418  $this->client_ip = $a_str;
1419  }
+ Here is the caller graph for this function:

◆ setComment()

ilObjUser::setComment ( string  $a_str)

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

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

1617  : void
1618  {
1619  $this->referral_comment = $a_str;
1620  }
+ Here is the caller graph for this function:

◆ setCountry()

ilObjUser::setCountry ( string  $a_str)

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

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

1350  : void
1351  {
1352  $this->country = $a_str;
1353  }
+ Here is the caller graph for this function:

◆ setCurrentLanguage()

ilObjUser::setCurrentLanguage ( string  $a_val)

Set current language.

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

References ilSession\set().

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

1572  : void
1573  {
1574  ilSession::set('lang', $a_val);
1575  }
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDepartment()

ilObjUser::setDepartment ( string  $a_str)

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

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

1310  : void
1311  {
1312  $this->department = $a_str;
1313  }
+ Here is the caller graph for this function:

◆ setEmail()

ilObjUser::setEmail ( string  $a_str)

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

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

1449  : void
1450  {
1451  $this->email = $a_str;
1452  }
+ Here is the caller graph for this function:

◆ setExternalAccount()

ilObjUser::setExternalAccount ( string  $a_str)

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

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

2616  : void
2617  {
2618  $this->ext_account = $a_str;
2619  }
+ Here is the caller graph for this function:

◆ setFax()

ilObjUser::setFax ( string  $a_str)

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

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

1406  : void
1407  {
1408  $this->fax = $a_str;
1409  }
+ Here is the caller graph for this function:

◆ setFirstLogin()

ilObjUser::setFirstLogin ( string  $a_str)

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

Referenced by assignData().

1587  : void
1588  {
1589  $this->first_login = $a_str;
1590  }
+ Here is the caller graph for this function:

◆ setFirstname()

ilObjUser::setFirstname ( string  $a_str)

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

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

1280  : void
1281  {
1282  $this->firstname = $a_str;
1283  }
+ Here is the caller graph for this function:

◆ setFullname()

ilObjUser::setFullname ( )

builds a string with title + firstname + lastname method is used to build fullname in member variable $this->fullname.

But you may use the function in static manner.

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

References $lastname.

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

1175  : void
1176  {
1177  $this->fullname = ($this->utitle != "")
1178  ? $this->utitle . " "
1179  : "";
1180  $this->fullname .= $this->firstname . " ";
1181  $this->fullname .= $this->lastname;
1182  }
string $lastname
+ Here is the caller graph for this function:

◆ setGender()

ilObjUser::setGender ( string  $a_str)

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

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

1255  : void
1256  {
1257  $this->gender = substr($a_str, -1);
1258  }
+ Here is the caller graph for this function:

◆ setGeneralInterests()

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

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

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

4106  : void
4107  {
4108  $this->interests_general = $value ?? [];
4109  }
+ Here is the caller graph for this function:

◆ setHobby()

ilObjUser::setHobby ( string  $a_str)

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

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

1469  : void
1470  {
1471  $this->hobby = $a_str;
1472  }
+ Here is the caller graph for this function:

◆ setInactivationDate()

ilObjUser::setInactivationDate ( ?string  $inactivation_date)

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

References $inactivation_date.

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

3994  : void
3995  {
3996  $this->inactivation_date = $inactivation_date;
3997  }
string $inactivation_date
+ Here is the caller graph for this function:

◆ setInstitution()

ilObjUser::setInstitution ( string  $a_str)

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

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

1300  : void
1301  {
1302  $this->institution = $a_str;
1303  }
+ Here is the caller graph for this function:

◆ setIsSelfRegistered()

ilObjUser::setIsSelfRegistered ( bool  $status)

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

Referenced by assignData().

4088  : void
4089  {
4090  $this->is_self_registered = $status;
4091  }
+ Here is the caller graph for this function:

◆ setLanguage()

ilObjUser::setLanguage ( string  $a_str)

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

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

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

1479  : void
1480  {
1481  $this->setPref("language", $a_str);
1482  ilSession::clear('lang');
1483  }
setPref(string $a_keyword, ?string $a_value)
static clear(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLastLogin()

ilObjUser::setLastLogin ( string  $a_str)

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

Referenced by assignData().

1577  : void
1578  {
1579  $this->last_login = $a_str;
1580  }
+ Here is the caller graph for this function:

◆ setLastname()

ilObjUser::setLastname ( string  $a_str)

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

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

1290  : void
1291  {
1292  $this->lastname = $a_str;
1293  }
+ Here is the caller graph for this function:

◆ setLastPasswordChangeToNow()

ilObjUser::setLastPasswordChangeToNow ( )

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

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

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

1873  : bool
1874  {
1875  global $DIC;
1876 
1877  $ilDB = $DIC['ilDB'];
1878 
1879  $this->setLastPasswordChangeTS(time());
1880 
1881  $query = "UPDATE usr_data SET last_password_change = %s " .
1882  "WHERE usr_id = %s";
1883  $affected = $ilDB->manipulateF(
1884  $query,
1885  array('integer','integer'),
1886  array($this->getLastPasswordChangeTS(),$this->id)
1887  );
1888  if ($affected) {
1889  return true;
1890  } else {
1891  return false;
1892  }
1893  }
global $DIC
Definition: feed.php:28
$query
setLastPasswordChangeTS(int $a_last_password_change_ts)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLastPasswordChangeTS()

ilObjUser::setLastPasswordChangeTS ( int  $a_last_password_change_ts)

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

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

1490  : void
1491  {
1492  $this->last_password_change_ts = $a_last_password_change_ts;
1493  }
+ Here is the caller graph for this function:

◆ setLastProfilePrompt()

ilObjUser::setLastProfilePrompt ( string  $a_str)

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

Referenced by assignData().

1597  : void
1598  {
1599  $this->last_profile_prompt = $a_str;
1600  }
+ Here is the caller graph for this function:

◆ setLastUpdate()

ilObjUser::setLastUpdate ( string  $a_str)

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

Referenced by assignData().

1607  : void
1608  {
1609  $this->last_update = $a_str;
1610  }
+ Here is the caller graph for this function:

◆ setLatitude()

ilObjUser::setLatitude ( ?string  $a_latitude)

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

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

1913  : void
1914  {
1915  $this->latitude = $a_latitude;
1916  }
+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjUser::setLocationZoom ( ?int  $a_locationzoom)

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

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

1933  : void
1934  {
1935  $this->loc_zoom = $a_locationzoom;
1936  }
+ Here is the caller graph for this function:

◆ setLogin()

ilObjUser::setLogin ( string  $a_str)

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

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

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

1221  : void
1222  {
1223  $this->login = $a_str;
1224  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLoginAttempts()

ilObjUser::setLoginAttempts ( int  $a_login_attempts)

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

Referenced by read().

1777  : void
1778  {
1779  $this->login_attempts = $a_login_attempts;
1780  }
+ Here is the caller graph for this function:

◆ setLongitude()

ilObjUser::setLongitude ( ?string  $a_longitude)

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

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

1923  : void
1924  {
1925  $this->longitude = $a_longitude;
1926  }
+ Here is the caller graph for this function:

◆ setLookingForHelp()

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

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

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

4154  : void
4155  {
4156  $this->interests_help_looking = $value ?? [];
4157  }
+ Here is the caller graph for this function:

◆ setMatriculation()

ilObjUser::setMatriculation ( string  $a_str)

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

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

1426  : void
1427  {
1428  $this->matriculation = $a_str;
1429  }
+ Here is the caller graph for this function:

◆ setOfferingHelp()

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

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

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

4130  : void
4131  {
4132  $this->interests_help_offered = $value ?? [];
4133  }
+ Here is the caller graph for this function:

◆ setPasswd()

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

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

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

1234  : void {
1235  $this->passwd = $a_str;
1236  $this->passwd_type = $a_type;
1237  }
+ Here is the caller graph for this function:

◆ setPasswordEncodingType()

ilObjUser::setPasswordEncodingType ( ?string  $password_encryption_type)

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

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

217  : void
218  {
219  $this->password_encoding_type = $password_encryption_type;
220  }
+ Here is the caller graph for this function:

◆ setPasswordPolicyResetStatus()

ilObjUser::setPasswordPolicyResetStatus ( bool  $status)

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

Referenced by read().

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

◆ setPasswordSalt()

ilObjUser::setPasswordSalt ( ?string  $password_salt)

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

References $password_salt.

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

227  : void
228  {
229  $this->password_salt = $password_salt;
230  }
string $password_salt
+ Here is the caller graph for this function:

◆ setPhoneHome()

ilObjUser::setPhoneHome ( string  $a_str)

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

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

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

◆ setPhoneMobile()

ilObjUser::setPhoneMobile ( string  $a_str)

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

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

1396  : void
1397  {
1398  $this->phone_mobile = $a_str;
1399  }
+ Here is the caller graph for this function:

◆ setPhoneOffice()

ilObjUser::setPhoneOffice ( string  $a_str)

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

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

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

◆ setPref()

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

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

Referenced by removeUserPicture(), assQuestionGUI\save(), assQuestionGUI\saveEdit(), ilUserPrivacySettingsGUI\savePrivacySettings(), assQuestionGUI\saveReturn(), assFormulaQuestionGUI\saveReturnFQ(), ilProfileChecklistStatus\saveStepSucess(), setLanguage(), ilMembershipNotifications\toggleUser(), and writePref().

1020  : void
1021  {
1022  if ($a_keyword != "") {
1023  $this->prefs[$a_keyword] = $a_value;
1024  }
1025  }
+ Here is the caller graph for this function:

◆ setProfileIncomplete()

ilObjUser::setProfileIncomplete ( bool  $a_prof_inc)

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

Referenced by assignData().

1798  : void
1799  {
1800  $this->profile_incomplete = $a_prof_inc;
1801  }
+ Here is the caller graph for this function:

◆ setSecondEmail()

ilObjUser::setSecondEmail ( ?string  $second_email)

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

References $second_email.

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

1464  : void
1465  {
1466  $this->second_email = $second_email;
1467  }
string $second_email
+ Here is the caller graph for this function:

◆ setSelectedCountry()

ilObjUser::setSelectedCountry ( string  $a_val)

Set selected country (selection drop down)

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

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

1363  : void
1364  {
1365  $this->sel_country = $a_val;
1366  }
+ Here is the caller graph for this function:

◆ setSkin()

ilObjUser::setSkin ( string  $a_str)

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

1722  : void
1723  {
1724  $this->skin = $a_str;
1725  }

◆ setStreet()

ilObjUser::setStreet ( string  $a_str)

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

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

1320  : void
1321  {
1322  $this->street = $a_str;
1323  }
+ Here is the caller graph for this function:

◆ setTimeLimitFrom()

ilObjUser::setTimeLimitFrom ( ?int  $a_from)

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

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

1737  : void
1738  {
1739  $this->time_limit_from = $a_from;
1740  }
+ Here is the caller graph for this function:

◆ setTimeLimitMessage()

ilObjUser::setTimeLimitMessage ( string  $a_time_limit_message)

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

Referenced by assignData().

1767  : void
1768  {
1769  $this->time_limit_message = $a_time_limit_message;
1770  }
+ Here is the caller graph for this function:

◆ setTimeLimitOwner()

ilObjUser::setTimeLimitOwner ( int  $a_owner)

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

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

1727  : void
1728  {
1729  $this->time_limit_owner = $a_owner;
1730  }
+ Here is the caller graph for this function:

◆ setTimeLimitUnlimited()

ilObjUser::setTimeLimitUnlimited ( bool  $a_unlimited)

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

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

1757  : void
1758  {
1759  $this->time_limit_unlimited = $a_unlimited;
1760  }
+ Here is the caller graph for this function:

◆ setTimeLimitUntil()

ilObjUser::setTimeLimitUntil ( ?int  $a_until)

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

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

1747  : void
1748  {
1749  $this->time_limit_until = $a_until;
1750  }
+ Here is the caller graph for this function:

◆ setUserDefinedData()

ilObjUser::setUserDefinedData ( array  $a_data)

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

References $data.

Referenced by ilObjUserGUI\loadUserDefinedDataFromForm().

2965  : void // Missing array type.
2966  {
2967  foreach ($a_data as $field => $data) {
2968  $this->user_defined_data['f_' . $field] = $data;
2969  }
2970  }
+ Here is the caller graph for this function:

◆ setUTitle()

ilObjUser::setUTitle ( string  $a_str)

set user title (note: don't mix up this method with setTitle() that is derived from ilObject and sets the user object's title)

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

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

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

◆ setZipcode()

ilObjUser::setZipcode ( string  $a_str)

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

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

1340  : void
1341  {
1342  $this->zipcode = $a_str;
1343  }
+ Here is the caller graph for this function:

◆ syncActive()

ilObjUser::syncActive ( )

synchronizes current and stored user active values for the owner value to be set correctly, this function should only be called when an admin is approving a user account

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

References getStoredActive(), and setActive().

Referenced by update().

1696  : void
1697  {
1698  $storedActive = 0;
1699  if ($this->getStoredActive($this->id)) {
1700  $storedActive = 1;
1701  }
1702 
1703  $currentActive = 0;
1704  if ($this->active) {
1705  $currentActive = 1;
1706  }
1707 
1708  if ((!empty($storedActive) && empty($currentActive)) ||
1709  (empty($storedActive) && !empty($currentActive))) {
1710  $this->setActive($currentActive, self::getUserIdByLogin(self::getLoginFromAuth()));
1711  }
1712  }
getStoredActive(int $a_id)
get user active state
setActive(bool $a_active, int $a_owner=0)
set user active state and updates system fields appropriately
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toUsernameWithoutDomain()

static ilObjUser::toUsernameWithoutDomain ( string  $a_login)
static

Static function removes Microsoft domain name from username webdav related.

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

1995  : string
1996  {
1997  // Remove all characters including the last slash or the last backslash
1998  // in the username
1999  $pos = strrpos($a_login, '/');
2000  $pos2 = strrpos($a_login, '\\');
2001  if ($pos === false || $pos < $pos2) {
2002  $pos = $pos2;
2003  }
2004  if (is_int($pos)) {
2005  $a_login = substr($a_login, $pos + 1);
2006  }
2007  return $a_login;
2008  }

◆ update()

ilObjUser::update ( )

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

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

Referenced by ilStartUpGUI\_checkGoto(), ilECSAppEventListener\extendAccount(), ilStartUpGUI\processCode(), removeUserPicture(), ilTermsOfServiceHelper\resetAcceptance(), ilUserPrivacySettingsGUI\savePrivacySettings(), ilProfileChecklistStatus\saveStepSucess(), and ilPasswordAssistanceGUI\submitAssignPasswordForm().

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

◆ updateLogin()

ilObjUser::updateLogin ( string  $a_login)

update login name

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

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

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

848  : bool
849  {
850  global $DIC;
851 
852  $ilDB = $this->db;
853  $ilSetting = $DIC['ilSetting'];
854  $lng = $DIC->language();
855 
856  if (func_num_args() != 1) {
857  return false;
858  }
859 
860  if (!isset($a_login)) {
861  return false;
862  }
863 
864  $former_login = self::_lookupLogin($this->getId());
865 
866  // Update not necessary
867  if (0 == strcmp($a_login, $former_login)) {
868  return false;
869  }
870 
871  try {
872  $last_history_entry = self::_getLastHistoryDataByUserId($this->getId());
873  } catch (ilUserException $e) {
874  $last_history_entry = null;
875  }
876 
877  // throw exception if the desired loginame is already in history and it is not allowed to reuse it
878  if ((int) $ilSetting->get('allow_change_loginname') &&
879  (int) $ilSetting->get('reuse_of_loginnames') == 0 &&
880  self::_doesLoginnameExistInHistory($a_login)) {
881  throw new ilUserException($lng->txt('loginname_already_exists'));
882  } elseif ((int) $ilSetting->get('allow_change_loginname') &&
883  (int) $ilSetting->get('loginname_change_blocking_time') &&
884  is_array($last_history_entry) &&
885  $last_history_entry[1] + (int) $ilSetting->get('loginname_change_blocking_time') > time()) {
886  throw new ilUserException(
887  sprintf(
888  $lng->txt('changing_loginname_not_possible_info'),
890  new ilDateTime($last_history_entry[1], IL_CAL_UNIX)
891  ),
893  new ilDateTime(($last_history_entry[1] + (int) $ilSetting->get('loginname_change_blocking_time')), IL_CAL_UNIX)
894  )
895  )
896  );
897  } else {
898  // log old loginname in history
899  if ((int) $ilSetting->get('allow_change_loginname') &&
900  (int) $ilSetting->get('create_history_loginname')) {
901  self::_writeHistory($this->getId(), $former_login);
902  }
903 
904  //update login
905  $this->login = $a_login;
906 
907  $ilDB->manipulateF(
908  '
909  UPDATE usr_data
910  SET login = %s
911  WHERE usr_id = %s',
912  array('text', 'integer'),
913  array($this->getLogin(), $this->getId())
914  );
915  }
916 
917  return true;
918  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
const IL_CAL_UNIX
global $DIC
Definition: feed.php:28
ilLanguage $lng
ilDBInterface $db
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ updateMultiTextFields()

ilObjUser::updateMultiTextFields ( bool  $a_create = false)

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

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

Referenced by saveAsNew(), and update().

4223  : void
4224  {
4225  global $DIC;
4226 
4227  $ilDB = $DIC['ilDB'];
4228 
4229  if (!$this->getId()) {
4230  return;
4231  }
4232 
4233  if (!$a_create) {
4234  $this->deleteMultiTextFields();
4235  }
4236 
4237  $map = array(
4238  "interests_general" => $this->getGeneralInterests(),
4239  "interests_help_offered" => $this->getOfferingHelp(),
4240  "interests_help_looking" => $this->getLookingForHelp()
4241  );
4242 
4243  foreach ($map as $id => $values) {
4244  if (is_array($values) && count($values)) {
4245  foreach ($values as $value) {
4246  $value = trim($value);
4247  if ($value) {
4248  $uniq_id = $ilDB->nextId('usr_data_multi');
4249 
4250  $ilDB->manipulate("INSERT usr_data_multi" .
4251  " (id,usr_id,field_id,value) VALUES" .
4252  " (" . $ilDB->quote($uniq_id, "integer") .
4253  "," . $ilDB->quote($this->getId(), "integer") .
4254  "," . $ilDB->quote($id, "text") .
4255  "," . $ilDB->quote($value, "text") .
4256  ")");
4257  }
4258  }
4259  }
4260  }
4261  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateUserDefinedFields()

ilObjUser::updateUserDefinedFields ( )

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

References ilObject\getId().

Referenced by saveAsNew(), and update().

2977  : void
2978  {
2979  $udata = new ilUserDefinedData($this->getId());
2980  foreach ($this->user_defined_data as $field => $value) {
2981  if ($field !== 'usr_id' && $value !== null) {
2982  $udata->set($field, $value);
2983  }
2984  }
2985  $udata->update();
2986  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userExists()

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

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

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

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

3911  : bool {
3912  global $DIC;
3913 
3914  $ilDB = $DIC['ilDB'];
3915 
3916  $query = 'SELECT count(*) num FROM object_data od ' .
3917  'JOIN usr_data ud ON obj_id = usr_id ' .
3918  'WHERE ' . $ilDB->in('obj_id', $a_usr_ids, false, 'integer') . ' ';
3919  $res = $ilDB->query($query);
3920  $num_rows = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)->num;
3921  return $num_rows == count($a_usr_ids);
3922  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ writeAccepted()

ilObjUser::writeAccepted ( )

write accept date of user agreement

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

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

Referenced by ilTermsOfServiceHelper\trackAcceptance().

541  : void
542  {
543  $ilDB = $this->db;
544  $ilDB->manipulateF("UPDATE usr_data SET agree_date = " . $ilDB->now() .
545  " WHERE usr_id = %s", array("integer"), array($this->getId()));
546  }
ilDBInterface $db
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writePref()

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

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

References setPref().

Referenced by activateDeletionFlag(), ilContainerSessionsContentGUI\initDetails(), removeDeletionFlag(), assQuestionGUI\save(), assQuestionGUI\saveEdit(), assQuestionGUI\saveReturn(), and assFormulaQuestionGUI\saveReturnFQ().

923  : void {
924  self::_writePref($this->id, $a_keyword, $a_value);
925  $this->setPref($a_keyword, $a_value);
926  }
setPref(string $a_keyword, ?string $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writePrefs()

ilObjUser::writePrefs ( )

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

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

982  : void
983  {
984  self::_deleteAllPref($this->id);
985  foreach ($this->prefs as $keyword => $value) {
986  self::_writePref($this->id, $keyword, (string) $value);
987  }
988  }
+ Here is the caller graph for this function:

Field Documentation

◆ $active

int ilObjUser::$active = 0

◆ $agree_date

string ilObjUser::$agree_date = null

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

Referenced by getAgreeDate(), and update().

◆ $approve_date

string ilObjUser::$approve_date = null

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

Referenced by getApproveDate(), and update().

◆ $auth_mode

string ilObjUser::$auth_mode = null

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

Referenced by getAuthMode().

◆ $birthday

string ilObjUser::$birthday = null
protected

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

Referenced by getBirthday().

◆ $city

string ilObjUser::$city = ""

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

Referenced by getCity(), and update().

◆ $client_ip

string ilObjUser::$client_ip = ""

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

Referenced by getClientIP(), and update().

◆ $country

string ilObjUser::$country = ""

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

Referenced by getCountry(), and update().

◆ $department

string ilObjUser::$department = ""

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

Referenced by getDepartment(), and update().

◆ $email

string ilObjUser::$email = ""

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

Referenced by getEmail().

◆ $ext_account

string ilObjUser::$ext_account = ""
protected

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

Referenced by getExternalAccount().

◆ $fax

string ilObjUser::$fax = ""

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

Referenced by getFax(), and update().

◆ $first_login

string ilObjUser::$first_login = ""
protected

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

Referenced by getFirstLogin().

◆ $firstname

string ilObjUser::$firstname = ""

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

Referenced by getFirstname().

◆ $fullname

string ilObjUser::$fullname = ""

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

Referenced by _lookupFullname().

◆ $gender

string ilObjUser::$gender = ""

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

Referenced by getGender(), and update().

◆ $hobby

string ilObjUser::$hobby = ""

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

Referenced by getHobby(), and update().

◆ $inactivation_date

string ilObjUser::$inactivation_date = null
protected

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

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

◆ $institution

string ilObjUser::$institution = ""

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

Referenced by getInstitution(), and update().

◆ $interests_general

array ilObjUser::$interests_general = []
protected

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

Referenced by getGeneralInterests().

◆ $interests_help_looking

array ilObjUser::$interests_help_looking = []
protected

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

Referenced by getLookingForHelp().

◆ $interests_help_offered

array ilObjUser::$interests_help_offered = []
protected

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

Referenced by getOfferingHelp().

◆ $is_self_registered

bool ilObjUser::$is_self_registered = false
private

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

Referenced by isSelfRegistered().

◆ $last_login

string ilObjUser::$last_login = ""
protected

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

Referenced by getLastLogin().

◆ $last_password_change_ts

int ilObjUser::$last_password_change_ts = 0

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

Referenced by getLastPasswordChangeTS().

◆ $last_profile_prompt

string ilObjUser::$last_profile_prompt = ""
protected

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

Referenced by getLastProfilePrompt().

◆ $lastname

string ilObjUser::$lastname = ""

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

Referenced by getLastname(), and setFullname().

◆ $latitude

string ilObjUser::$latitude = null

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

Referenced by getLatitude(), and update().

◆ $loc_zoom

string ilObjUser::$loc_zoom = null

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

Referenced by getLocationZoom().

◆ $login

string ilObjUser::$login = ''

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

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

◆ $login_attempts

int ilObjUser::$login_attempts = 0

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

Referenced by getLoginAttempts().

◆ $longitude

string ilObjUser::$longitude = null

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

Referenced by getLongitude(), and update().

◆ $matriculation

string ilObjUser::$matriculation = ""

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

Referenced by getMatriculation(), and update().

◆ $oldPrefs

array ilObjUser::$oldPrefs = []
protected

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

◆ $org_units

string ilObjUser::$org_units = ""
protected

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

◆ $passwd

string ilObjUser::$passwd = ""
protected

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

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

◆ $passwd_policy_reset

bool ilObjUser::$passwd_policy_reset = false
protected

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

Referenced by getPasswordPolicyResetStatus().

◆ $passwd_type

string ilObjUser::$passwd_type = ""
protected

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

Referenced by getPasswdType().

◆ $password_encoding_type

string ilObjUser::$password_encoding_type = null
protected

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

Referenced by getPasswordEncodingType().

◆ $password_salt

string ilObjUser::$password_salt = null
protected

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

Referenced by getPasswordSalt(), and setPasswordSalt().

◆ $personal_image_cache

array ilObjUser::$personal_image_cache = array()
staticprotected

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

◆ $phone_home

string ilObjUser::$phone_home = ""

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

Referenced by getPhoneHome(), and update().

◆ $phone_mobile

string ilObjUser::$phone_mobile = ""

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

Referenced by getPhoneMobile(), and update().

◆ $phone_office

string ilObjUser::$phone_office = ""

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

Referenced by getPhoneOffice(), and update().

◆ $prefs

array ilObjUser::$prefs = []

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

Referenced by _getPreferences(), and readPrefs().

◆ $profile_incomplete

bool ilObjUser::$profile_incomplete = false
protected

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

Referenced by getProfileIncomplete().

◆ $referral_comment

string ilObjUser::$referral_comment = ""

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

Referenced by getComment(), and update().

◆ $second_email

string ilObjUser::$second_email = null
protected

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

Referenced by getSecondEmail(), and setSecondEmail().

◆ $sel_country

string ilObjUser::$sel_country = ""

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

Referenced by getSelectedCountry(), and update().

◆ $skin

string ilObjUser::$skin = ""

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

Referenced by __construct().

◆ $street

string ilObjUser::$street = ""

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

Referenced by getStreet(), and update().

◆ $time_limit_from

int ilObjUser::$time_limit_from = null
protected

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

Referenced by getTimeLimitFrom().

◆ $time_limit_message

string ilObjUser::$time_limit_message = ""
protected

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

Referenced by getTimeLimitMessage().

◆ $time_limit_owner

int ilObjUser::$time_limit_owner = null
protected

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

◆ $time_limit_unlimited

bool ilObjUser::$time_limit_unlimited = false
protected

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

Referenced by getTimeLimitUnlimited().

◆ $time_limit_until

int ilObjUser::$time_limit_until = null
protected

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

Referenced by getTimeLimitUntil().

◆ $user_defined_data

array ilObjUser::$user_defined_data = array()

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

◆ $utitle

string ilObjUser::$utitle = ""

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

Referenced by getUTitle(), and update().

◆ $zipcode

string ilObjUser::$zipcode = ""

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

Referenced by getZipcode(), and update().

◆ PASSWD_CRYPTED

◆ PASSWD_PLAIN


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