ILIAS  trunk Revision v12.0_alpha-1329-g1094ddb0c33
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 ()
 
 saveAsNew ()
 
 update ()
 
 resetPassword (string $new_raw_password)
 
 getLastHistoryData ()
 
 updateLogin (string $login, Context $context)
 
 writePref (string $key, string $value)
 
 deletePref (string $key)
 
 writePrefs ()
 
 getTimeZone ()
 
 getTimeFormat ()
 
 getDateFormat ()
 
 getDateTimeFormat ()
 
 setPref (string $a_keyword, ?string $a_value)
 
 getPref (string $keyword)
 
 getPrefs ()
 
 withProfileData (Data $profile_data)
 
 getProfileData ()
 
 setLogin (string $login)
 
 getLogin ()
 
 setGender (string $gender_string)
 
 getGender ()
 
 setUTitle (string $user_title)
 This sets the USER's title NOT the OBJECT's title! More...
 
 getUTitle ()
 
 setFirstname (string $firstname)
 
 getFirstname ()
 
 setLastname (string $lastname)
 
 getLastname ()
 
 setBirthday (?string $birthday)
 
 getBirthday ()
 
 setInstitution (string $instituion)
 
 getInstitution ()
 
 setDepartment (string $department)
 
 getDepartment ()
 
 setStreet (string $street)
 
 getStreet ()
 
 setCity (string $city)
 
 getCity ()
 
 setZipcode (string $zipcode)
 
 getZipcode ()
 
 setCountry (string $country)
 
 getCountry ()
 
 setPhoneOffice (string $phone)
 
 getPhoneOffice ()
 
 setPhoneHome (string $phone)
 
 getPhoneHome ()
 
 setPhoneMobile (string $phone)
 
 getPhoneMobile ()
 
 setFax (string $fax)
 
 getFax ()
 
 setMatriculation (string $matriculation)
 
 getMatriculation ()
 
 setEmail (string $email)
 
 getEmail ()
 
 setSecondEmail (?string $email)
 
 getSecondEmail ()
 
 setHobby (string $hobby)
 
 getHobby ()
 
 setComment (string $referral_comment)
 
 getComment ()
 
 setLatitude (?string $latitude)
 
 getLatitude ()
 
 setLongitude (?string $longitude)
 
 getLongitude ()
 
 setLocationZoom (?int $zoom)
 
 getLocationZoom ()
 
 getAvatarRid ()
 
 setAvatarRid (?ResourceIdentification $avatar_rid)
 
 setClientIP (string $a_str)
 
 getClientIP ()
 
 setLanguage (string $language)
 
 getLanguage ()
 
 getPasswordEncodingType ()
 
 setPasswordEncodingType (?string $password_encryption_type)
 
 getPasswordSalt ()
 
 setPasswordSalt (?string $password_salt)
 
 setFullname ()
 
 getFullname (int $max_strlen=0)
 
 setPasswd (string $a_str, string $a_type=ilObjUser::PASSWD_PLAIN)
 
 getPasswd ()
 
 getPasswdType ()
 
 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 $language)
 Set current language. More...
 
 setLastLogin (string $a_str)
 
 getLastLogin ()
 
 refreshLogin ()
 
 setFirstLogin (string $date)
 
 getFirstLogin ()
 
 setLastProfilePrompt (string $date)
 
 getLastProfilePrompt ()
 
 setLastUpdate (string $date)
 
 getLastUpdate ()
 
 getLastVisited ()
 
 updateLastVisited (array $last_visited)
 
 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 $date)
 
 setActive (bool $active, int $owner=0)
 set user active state and updates system fields appropriately More...
 
 getActive ()
 
 getSkin ()
 
 setTimeLimitOwner (int $a_owner)
 
 getTimeLimitOwner ()
 
 setTimeLimitFrom (?int $a_from)
 
 getTimeLimitFrom ()
 
 setTimeLimitUntil (?int $a_until)
 
 getTimeLimitUntil ()
 
 setTimeLimitUnlimited (bool $unlimited)
 
 getTimeLimitUnlimited ()
 
 setLoginAttempts (int $a_login_attempts)
 
 getLoginAttempts ()
 
 checkTimeLimit ()
 
 setProfileIncomplete (bool $a_prof_inc)
 
 getProfileIncomplete ()
 
 isPasswordChangeDemanded ()
 
 isPasswordExpired ()
 
 getPasswordAgeInDays ()
 
 setLastPasswordChangeToNow ()
 
 resetLastPasswordChange ()
 
 setAuthMode (?string $a_str)
 
 getAuthMode (bool $a_auth_key=false)
 
 setExternalAccount (string $a_str)
 
 getExternalAccount ()
 
 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 ()
 
 getPersonalPicturePath (string $a_size='small', bool $a_force_pic=false)
 
 hasProfilePicture ()
 
 getAvatar ()
 
 removeUserPicture ()
 
 getProfileAsString (Language $language)
 Get formatted mail body text of user profile data. More...
 
 setFeedPass (string $a_password)
 
 hasPublicProfile ()
 
 getPublicName ()
 
 resetOwner ()
 
 getPersonalDataExportFile ()
 
 sendPersonalDataFile ()
 
 importPersonalData (array $a_file, bool $a_profile_data, bool $a_settings, bool $a_notes, bool $a_calendar)
 
 setInactivationDate (?string $inactivation_date)
 
 getInactivationDate ()
 
 isAnonymous ()
 
 activateDeletionFlag ()
 
 removeDeletionFlag ()
 
 hasDeletionFlag ()
 
 setIsSelfRegistered (bool $status)
 
 isSelfRegistered ()
 
 setGeneralInterests (?array $value=null)
 
 getGeneralInterests ()
 
 getGeneralInterestsAsText ()
 Get general interests as plain text. More...
 
 setOfferingHelp (?array $value=null)
 
 getOfferingHelp ()
 
 getOfferingHelpAsText ()
 Get help offering as plain text. More...
 
 setLookingForHelp (?array $value=null)
 
 getLookingForHelp ()
 
 getLookingForHelpAsText ()
 
 uploadPersonalPicture (string $tmp_file)
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id, int $new_obj_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 _isAnonymous (int $usr_id)
 
static _loginExists (string $a_login, int $a_user_id=0)
 
static _externalAccountExists (string $a_external_account, string $a_auth_mode)
 
static _getUsersForRole (int $role_id, int $active=-1)
 
static _getUsersForFolder (int $ref_id, int $active)
 
static _getUsersForGroup (array $a_mem_ids, int $active=-1)
 
static _getUsersForIds (array $a_mem_ids, int $active=-1, int $timelimitowner=-1)
 
static _getUserData (array $a_internalids)
 
static getUserSubsetByPreferenceValue (array $a_user_ids, string $a_keyword, string $a_val)
 
static _getLoginAttempts (int $a_usr_id)
 
static _incrementLoginAttempts (int $a_usr_id)
 
static _setUserInactive (int $a_usr_id)
 
static _getUsersOnline (int $a_user_id=0, bool $a_no_anonymous=false)
 
static getUserIdsByInactivityPeriod (int $periodInDays)
 
static getUserIdsNeverLoggedIn (int $thresholdInDays)
 
static _getUserIdsByInactivationPeriod (int $period)
 
static getFirstLettersOfLastnames (?array $user_ids=null)
 
static userExists (array $a_usr_ids=[])
 
static _doesLoginnameExistInHistory (string $a_login)
 
static _lookupPref (int $a_usr_id, string $a_keyword)
 
static lookupMatriculation (int $a_usr_id)
 
static findInterests (string $a_term, ?int $a_user_id=null, ?string $a_field_id=null)
 
static getProfileStatusOfUsers (array $a_user_ids)
 
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)
 
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 _lookupFields (int $a_user_id)
 
static _lookupActive (int $a_usr_id)
 
static _lookupLogin (int $a_user_id)
 
static _lookupExternalAccount (int $a_user_id)
 
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 getUserIdByLogin (string $a_login)
 
static getUserIdsByEmail (string $a_email)
 
static getUserLoginsByEmail (string $a_email)
 
static _lookupId (string|array $a_user_str)
 
static _lookupLastLogin (int $a_user_id)
 
static _lookupFirstLogin (int $a_user_id)
 
static hasActiveSession (int $a_user_id, string $a_session_id)
 
static _readUsersProfileData (array $a_user_ids)
 
static _getNumberOfUsersForStyle (string $a_skin, string $a_style)
 
static _getAllUserAssignedStyles ()
 
static _getNumberOfUsersPerAuthMode ()
 get number of users per auth mode More...
 
static _getLocalAccountsForEmail (string $a_email)
 
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)
 
static _getImportedUserId (string $i2_id)
 
static lookupOrgUnitsRepresentation (int $a_usr_id)
 
static _getAvatar (int $a_usr_id)
 
static _getPersonalPicturePath (int $usr_id, string $size='small', bool $force_pic=false)
 
static copyProfilePicturesToDirectory (int $a_user_id, string $a_dir)
 
static _lookupFeedHash (int $a_user_id, bool $a_create=false)
 
static _getFeedPass (int $a_user_id)
 
- 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 getIconForType (string $type)
 
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'
 
const DATABASE_DATE_FORMAT = 'Y-m-d H:i:s'
 
- 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
 

Private Member Functions

 assignSystemInformationFromDB (array $data)
 
 buildSystemInformationArrayForDB ()
 
 prepareAndRetrievePasswordForStorage ()
 
 retrieveAgreeDateForStorage ()
 
 writeHistory (string $login)
 
 readSettings ()
 
 buildTextFromArray (array $a_attr)
 

Static Private Member Functions

static _lookup (int $a_user_id, string $a_field)
 

Private Attributes

string $ext_account = ''
 
string $fullname
 
bool $time_limit_unlimited = false
 
int $time_limit_until = null
 
int $time_limit_from = null
 
int $time_limit_owner = 7
 
string $last_login = ''
 
string $passwd = ''
 
string $passwd_type = ''
 
string $password_encoding_type = null
 
string $password_salt = null
 
string $approve_date = null
 
string $agree_date = null
 
int $active = 0
 
string $client_ip = ''
 
string $auth_mode = null
 
int $last_password_change_ts = 0
 
bool $passwd_policy_reset = false
 
int $login_attempts = 0
 
array $user_settings = []
 
string $inactivation_date = null
 
bool $is_self_registered = false
 
string $last_profile_prompt = ''
 
string $first_login = ''
 
bool $profile_incomplete = false
 
array $last_visited = []
 
Data $profile_data
 
ProfileDataRepository $profile_data_repository
 
ProfileConfigurationRepository $profile_configuration_repository
 
SettingsDataRepository $settings_data_repository
 
StreamDelivery $delivery
 
DataFactory $data_factory
 
ilCronDeleteInactiveUserReminderMail $cron_delete_user_reminder_mail
 
Services $irss
 
ilSetting $ilias_settings
 
ilAuthSession $auth_session
 
ilCtrl $ctrl
 

Static Private Attributes

static array $personal_image_cache = []
 

Additional Inherited Members

- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 
- 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
 
LOMServices $lom_services
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

99 {
100 global $DIC;
101 $this->irss = $DIC['resource_storage'];
102 $this->ilias_settings = $DIC['ilSetting'];
103 $this->auth_session = $DIC['ilAuthSession'];
104 $this->ctrl = $DIC['ilCtrl'];
105 $this->app_event_handler = $DIC['ilAppEventHandler'];
106 $this->delivery = $DIC['file_delivery']->delivery();
107
108 if (defined('USER_FOLDER_ID')) {
109 $this->time_limit_owner = USER_FOLDER_ID;
110 }
111
112 $local_dic = LocalDIC::dic();
113 $this->profile_data_repository = $local_dic[ProfileDataRepository::class];
114 $this->profile_data = $this->profile_data_repository->getDefault();
115 $this->profile_configuration_repository = $local_dic[ProfileConfigurationRepository::class];
116 $this->settings_data_repository = $local_dic[SettingsDataRepository::class];
117
118 $this->data_factory = (new DataFactory());
119
120 $this->type = 'usr';
121 parent::__construct($a_user_id, $a_call_by_reference);
122
123 $this->cron_delete_user_reminder_mail = new ilCronDeleteInactiveUserReminderMail($this->db);
124
125 $this->auth_mode = 'default';
126 $this->passwd_type = self::PASSWD_PLAIN;
127 if ($a_user_id > 0) {
128 $this->setId($a_user_id);
129 $this->read();
130 return;
131 }
132
133 $this->user_settings = [];
134 $this->user_settings['language'] = $this->ilias->ini->readVariable('language', 'default');
135 $this->user_settings['skin'] = $this->ilias->ini->readVariable('layout', 'skin');
136 $this->user_settings['style'] = $this->ilias->ini->readVariable('layout', 'style');
137 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const PASSWD_PLAIN
setId(int $id)
const USER_FOLDER_ID
Definition: constants.php:33
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ilObjForumAdministration.
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), PASSWD_PLAIN, read(), ilObject\setId(), and USER_FOLDER_ID.

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

2722 : ?string {
2723 $db = $GLOBALS['DIC']->database();
2724 $settings = $GLOBALS['DIC']->settings();
2725
2726 // Check directly with auth_mode
2727 $r = $db->queryF(
2728 'SELECT * FROM usr_data WHERE ' .
2729 ' ext_account = %s AND auth_mode = %s',
2730 ['text', 'text'],
2731 [$a_account, $a_auth]
2732 );
2733 if ($usr = $db->fetchAssoc($r)) {
2734 return $usr['login'];
2735 }
2736
2737 if (!$tryFallback) {
2738 return null;
2739 }
2740
2741 // For compatibility, check for login (no ext_account entry given)
2742 $res = $db->queryF(
2743 'SELECT login FROM usr_data ' .
2744 'WHERE login = %s AND auth_mode = %s AND (ext_account IS NULL OR ext_account = "") ',
2745 ['text', 'text'],
2746 [$a_account, $a_auth]
2747 );
2748 if ($usr = $db->fetchAssoc($res)) {
2749 return $usr['login'];
2750 }
2751
2752 // If auth_default == $a_auth => check for login
2753 if (ilAuthUtils::_getAuthModeName($settings->get('auth_mode')) == $a_auth) {
2754 $res = $db->queryF(
2755 'SELECT login FROM usr_data WHERE ' .
2756 ' ext_account = %s AND auth_mode = %s',
2757 ['text', 'text'],
2758 [$a_account, 'default']
2759 );
2760 if ($usr = $db->fetchAssoc($res)) {
2761 return $usr['login'];
2762 }
2763 // Search for login (no ext_account given)
2764 $res = $db->queryF(
2765 'SELECT login FROM usr_data ' .
2766 'WHERE login = %s AND (ext_account IS NULL OR ext_account = "") AND auth_mode = %s',
2767 ['text', 'text'],
2768 [$a_account, 'default']
2769 );
2770 if ($usr = $db->fetchAssoc($res)) {
2771 return $usr['login'];
2772 }
2773 }
2774 return null;
2775 }
static _getAuthModeName($a_auth_key)
ilDBInterface $db
fetchAssoc(ilDBStatement $statement)
queryF(string $query, array $types, array $values)
$res
Definition: ltiservices.php:69
$GLOBALS["DIC"]
Definition: wac.php:54

Referenced by ILIAS\AuthApache\AuthProviderApache\doAuthentication(), ilLTIAppEventListener\doCronUpdate(), ilAuthProviderLTI\findUserId(), ilAuthFrontend\handleLoginAttempts(), ilAuthProviderSaml\handleSamlAuth(), ilAuthProviderSoap\handleSoapAuth(), ilUserImportParser\importEndTag(), ilLDAPUserSynchronisation\readInternalAccount(), ilLDAPQuery\readUserData(), ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus(), ilOpenIdConnectUserSync\updateUser(), and ilUserImportParser\verifyEndTag().

+ Here is the caller graph for this function:

◆ _doesLoginnameExistInHistory()

static ilObjUser::_doesLoginnameExistInHistory ( string  $a_login)
static

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

2358 : bool
2359 {
2360 global $DIC;
2361 $ilDB = $DIC['ilDB'];
2362
2363 $res = $ilDB->queryF(
2364 '
2365 SELECT * FROM loginname_history
2366 WHERE login = %s',
2367 ['text'],
2368 [$a_login]
2369 );
2370
2371 return (bool) $ilDB->fetchAssoc($res);
2372 }

References $DIC, $ilDB, and $res.

Referenced by ilAccountRegistrationGUI\saveForm().

+ Here is the caller graph for this function:

◆ _externalAccountExists()

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

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

1935 : bool {
1936 global $DIC;
1937 $ilDB = $DIC['ilDB'];
1938
1939 $res = $ilDB->queryF(
1940 'SELECT * FROM usr_data ' .
1941 'WHERE ext_account = %s AND auth_mode = %s',
1942 ['text', 'text'],
1943 [$a_external_account, $a_auth_mode]
1944 );
1945 return (bool) $ilDB->fetchAssoc($res);
1946 }

◆ _getAllUserAssignedStyles()

static ilObjUser::_getAllUserAssignedStyles ( )
static

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

2917 : array
2918 {
2919 global $DIC;
2920 $ilDB = $DIC['ilDB'];
2921
2922 $q = 'SELECT DISTINCT up1.value style, up2.value skin FROM usr_pref up1, usr_pref up2 ' .
2923 ' WHERE up1.keyword = ' . $ilDB->quote('style', 'text') .
2924 ' AND up2.keyword = ' . $ilDB->quote('skin', 'text') .
2925 ' AND up1.usr_id = up2.usr_id';
2926
2927 $sty_set = $ilDB->query($q);
2928
2929 $styles = [];
2930 while ($sty_rec = $ilDB->fetchAssoc($sty_set)) {
2931 $styles[] = $sty_rec['skin'] . ':' . $sty_rec['style'];
2932 }
2933
2934 return $styles;
2935 }
$q
Definition: shib_logout.php:25

References $DIC, $ilDB, and $q.

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

+ Here is the caller graph for this function:

◆ _getAvatar()

static ilObjUser::_getAvatar ( int  $a_usr_id)
static

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

3071 : Avatar
3072 {
3073 $define = new ilUserAvatarResolver($a_usr_id ?: ANONYMOUS_USER_ID);
3074 $define->setSize('xsmall');
3075 return $define->getAvatar();
3076 }
Class ilUserAvatarResolver.
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:29

References ANONYMOUS_USER_ID.

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

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

2653 : array {
2654 global $DIC;
2655
2656 $ilDB = $DIC['ilDB'];
2657 $ilSetting = $DIC['ilSetting'];
2658
2659 $q = 'SELECT login,usr_id,ext_account,auth_mode FROM usr_data ' .
2660 'WHERE auth_mode = %s';
2661 $types[] = 'text';
2662 $values[] = $a_auth_mode;
2663 if ($a_read_auth_default and ilAuthUtils::_getAuthModeName($ilSetting->get('auth_mode', ilAuthUtils::AUTH_LOCAL)) == $a_auth_mode) {
2664 $q .= ' OR auth_mode = %s ';
2665 $types[] = 'text';
2666 $values[] = 'default';
2667 }
2668
2669 $res = $ilDB->queryF($q, $types, $values);
2670 $accounts = [];
2671 while ($row = $ilDB->fetchObject($res)) {
2672 if ($row->auth_mode == 'default') {
2673 $accounts[$row->usr_id] = $row->login;
2674 } else {
2675 $accounts[$row->usr_id] = $row->ext_account;
2676 }
2677 }
2678 return $accounts;
2679 }
const int AUTH_LOCAL
global $ilSetting
Definition: privfeed.php:26

References $q.

Referenced by ilLDAPCronSynchronization\deactivateUsers(), ILIAS\LDAP\Server\UI\ServerTable\getRecords(), and ilLDAPRoleGroupMapping\initServers().

+ Here is the caller graph for this function:

◆ _getFeedPass()

static ilObjUser::_getFeedPass ( int  $a_user_id)
static

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

3144 : ?string {
3145 if ($a_user_id > 0) {
3146 return self::_lookupPref($a_user_id, 'priv_feed_pass');
3147 }
3148 return null;
3149 }
static _lookupPref(int $a_usr_id, string $a_keyword)

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

+ Here is the caller graph for this function:

◆ _getImportedUserId()

static ilObjUser::_getImportedUserId ( string  $i2_id)
static

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

3050 : int {
3051 global $DIC;
3052 $ilDB = $DIC['ilDB'];
3053
3054 $query = 'SELECT obj_id FROM object_data WHERE import_id = ' .
3055 $ilDB->quote($i2_id, 'text');
3056
3057 $res = $ilDB->query($query);
3058 $id = 0;
3059 while ($row = $ilDB->fetchObject($res)) {
3060 $id = (int) $row->obj_id;
3061 }
3062 return $id;
3063 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

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

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

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

◆ _getLocalAccountsForEmail()

static ilObjUser::_getLocalAccountsForEmail ( string  $a_email)
static

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

2956 : array // Missing array type.
2957 {
2958 global $DIC;
2959
2960 $ilDB = $DIC['ilDB'];
2961 $ilSetting = $DIC['ilSetting'];
2962
2963 // default set to local (1)?
2964
2965 $q = 'SELECT * FROM usr_data WHERE ' .
2966 ' email = %s AND (auth_mode = %s ';
2967 $types = ['text', 'text'];
2968 $values = [$a_email, 'local'];
2969
2970 if ($ilSetting->get('auth_mode') == 1) {
2971 $q .= ' OR auth_mode = %s';
2972 $types[] = 'text';
2973 $values[] = 'default';
2974 }
2975
2976 $q .= ')';
2977
2978 $users = [];
2979 $usr_set = $ilDB->queryF($q, $types, $values);
2980 while ($usr_rec = $ilDB->fetchAssoc($usr_set)) {
2981 $users[$usr_rec['usr_id']] = $usr_rec['login'];
2982 }
2983
2984 return $users;
2985 }

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

◆ _getLoginAttempts()

static ilObjUser::_getLoginAttempts ( int  $a_usr_id)
static

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

2135 : int {
2136 global $DIC;
2137 $ilDB = $DIC['ilDB'];
2138
2139 $query = 'SELECT login_attempts FROM usr_data WHERE usr_id = %s';
2140 $result = $ilDB->queryF($query, ['integer'], [$a_usr_id]);
2141 $record = $ilDB->fetchAssoc($result);
2142 return (int) ($record['login_attempts'] ?? 0);
2143 }

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

+ Here is the caller graph for this function:

◆ _getNumberOfUsersForStyle()

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

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

2899 : int {
2900 global $DIC;
2901 $ilDB = $DIC['ilDB'];
2902
2903 $q = 'SELECT count(*) as cnt FROM usr_pref up1, usr_pref up2 ' .
2904 ' WHERE up1.keyword= ' . $ilDB->quote('style', 'text') .
2905 ' AND up1.value= ' . $ilDB->quote($a_style, 'text') .
2906 ' AND up2.keyword= ' . $ilDB->quote('skin', 'text') .
2907 ' AND up2.value= ' . $ilDB->quote($a_skin, 'text') .
2908 ' AND up1.usr_id = up2.usr_id ';
2909
2910 $cnt_set = $ilDB->query($q);
2911
2912 $cnt_rec = $ilDB->fetchAssoc($cnt_set);
2913
2914 return (int) $cnt_rec['cnt'];
2915 }

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

+ Here is the caller graph for this function:

◆ _getNumberOfUsersPerAuthMode()

static ilObjUser::_getNumberOfUsersPerAuthMode ( )
static

get number of users per auth mode

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

2940 : array // Missing array type.
2941 {
2942 global $DIC;
2943
2944 $ilDB = $DIC['ilDB'];
2945
2946 $r = $ilDB->query('SELECT count(*) AS cnt, auth_mode FROM usr_data ' .
2947 'GROUP BY auth_mode');
2948 $cnt_arr = [];
2949 while ($cnt = $ilDB->fetchAssoc($r)) {
2950 $cnt_arr[$cnt['auth_mode']] = (int) $cnt['cnt'];
2951 }
2952
2953 return $cnt_arr;
2954 }

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

+ Here is the call graph for this function:

◆ _getPersonalPicturePath()

static ilObjUser::_getPersonalPicturePath ( int  $usr_id,
string  $size = 'small',
bool  $force_pic = false 
)
static

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

3082 : string {
3083 $define = new ilUserAvatarResolver($usr_id);
3084 $define->setForcePicture($force_pic);
3085 $define->setSize($size);
3086 return $define->getLegacyPictureURL();
3087 }

Referenced by ilRepositoryUserResultTableGUI\fillRow(), ILIAS\Awareness\WidgetManager\getListData(), ilUserUtil\getNamePresentation(), ilInternalLinkGUI\getUserSearchResult(), ilUserDataSet\getXmlRecord(), ilLikeGUI\renderModal(), ILIAS\User\Profile\PublicProfileGUI\renderTitle(), and ilMStShowUserGUI\setTitleAndIcon().

+ Here is the caller graph for this function:

◆ _getUserData()

static ilObjUser::_getUserData ( array  $a_internalids)
static

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

2072 : array
2073 {
2074 global $DIC;
2075 $ilDB = $DIC['ilDB'];
2076
2077 $ids = [];
2078 if (is_array($a_internalids)) {
2079 foreach ($a_internalids as $internalid) {
2080 if (is_numeric($internalid)) {
2081 $ids[] = $internalid;
2082 } else {
2083 $parsedid = ilUtil::__extractId($internalid, IL_INST_ID);
2084 if (is_numeric($parsedid) && $parsedid > 0) {
2085 $ids[] = $parsedid;
2086 }
2087 }
2088 }
2089 }
2090 if (count($ids) == 0) {
2091 $ids [] = -1;
2092 }
2093
2094 $query = 'SELECT usr_data.*, usr_pref.value AS language
2095 FROM usr_data
2096 LEFT JOIN usr_pref
2097 ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
2098 WHERE ' . $ilDB->in('usr_data.usr_id', $ids, false, 'integer');
2099 $values[] = 'language';
2100 $types[] = 'text';
2101
2102 $query .= ' ORDER BY usr_data.lastname, usr_data.firstname ';
2103
2104 $data = [];
2105 $result = $ilDB->queryF($query, $types, $values);
2106 while ($row = $ilDB->fetchAssoc($result)) {
2107 $data[] = $row;
2108 }
2109 return $data;
2110 }
static __extractId(string $ilias_id, int $inst_id)
extract ref id from role title, e.g.
const IL_INST_ID
Definition: constants.php:40

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

Referenced by ILIAS\Test\Scoring\Manual\ConsecutiveScoring\getAllFinalizingUserNames(), and ilSoapUserAdministration\getUserXML().

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

◆ _getUserIdsByInactivationPeriod()

static ilObjUser::_getUserIdsByInactivationPeriod ( int  $period)
static

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

2299 : array {
2300 if (!$period) {
2301 throw new ilException('no valid period given');
2302 }
2303
2304 global $DIC;
2305 $db = $DIC['ilDB'];
2306
2307 $res = $db->queryF(
2308 'SELECT usr_id FROM usr_data WHERE inactivation_date < %s AND active = %s',
2309 ['timestamp', 'integer'],
2310 [
2311 date('Y-m-d H:i:s', (time() - ($period * 24 * 60 * 60))),
2312 0
2313 ]
2314 );
2315
2316 $ids = [];
2317 while ($row = $db->fetchObject($res)) {
2318 $ids[] = (int) $row->usr_id;
2319 }
2320
2321 return $ids;
2322 }
Base class for ILIAS Exception handling.
fetchObject(ilDBStatement $query_result)

Referenced by ilCronDeleteInactivatedUserAccounts\run().

+ Here is the caller graph for this function:

◆ _getUsersForClipboadObject()

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

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

3032 : array {
3033 global $DIC;
3034 $ilDB = $DIC['ilDB'];
3035
3036 $q = 'SELECT DISTINCT user_id FROM personal_clipboard WHERE ' .
3037 'item_id = ' . $ilDB->quote($a_id, 'integer') . ' AND ' .
3038 'type = ' . $ilDB->quote($a_type, 'text');
3039 $user_set = $ilDB->query($q);
3040 $users = [];
3041 while ($user_rec = $ilDB->fetchAssoc($user_set)) {
3042 $users[] = (int) $user_rec['user_id'];
3043 }
3044
3045 return $users;
3046 }

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ _getUsersForFolder()

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

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

1989 : array {
1990 global $DIC;
1991 $ilDB = $DIC['ilDB'];
1992
1993 $query = 'SELECT usr_data.*, usr_pref.value AS language FROM usr_data LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id and usr_pref.keyword = %s WHERE 1=1';
1994 $types[] = 'text';
1995 $values[] = 'language';
1996
1997 if (is_numeric($active) && $active > -1) {
1998 $query .= ' AND usr_data.active = %s';
1999 $values[] = $active;
2000 $types[] = 'integer';
2001 }
2002
2003 if ($ref_id != USER_FOLDER_ID) {
2004 $query .= ' AND usr_data.time_limit_owner = %s';
2005 $values[] = $ref_id;
2006 $types[] = 'integer';
2007 }
2008
2009 $query .= ' AND usr_data.usr_id != %s ';
2010 $values[] = ANONYMOUS_USER_ID;
2011 $types[] = 'integer';
2012
2013 $query .= ' ORDER BY usr_data.lastname, usr_data.firstname ';
2014
2015 $result = $ilDB->queryF($query, $types, $values);
2016 $data = [];
2017 while ($row = $ilDB->fetchAssoc($result)) {
2018 $data[] = $row;
2019 }
2020
2021 return $data;
2022 }

Referenced by ilSoapUserAdministration\getUsersForContainer().

+ Here is the caller graph for this function:

◆ _getUsersForGroup()

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

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

2027 : array {
2028 return self::_getUsersForIds($a_mem_ids, $active);
2029 }
static _getUsersForIds(array $a_mem_ids, int $active=-1, int $timelimitowner=-1)

Referenced by ilSoapUserAdministration\getUsersForContainer().

+ Here is the caller graph for this function:

◆ _getUsersForIds()

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

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

2035 : array {
2036 global $DIC;
2037 $ilDB = $DIC['ilDB'];
2038
2039 $query = 'SELECT usr_data.*, usr_pref.value AS language
2040 FROM usr_data
2041 LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
2042 WHERE ' . $ilDB->in('usr_data.usr_id', $a_mem_ids, false, 'integer') . '
2043 AND usr_data.usr_id != %s';
2044 $values[] = 'language';
2045 $types[] = 'text';
2046 $values[] = ANONYMOUS_USER_ID;
2047 $types[] = 'integer';
2048
2049 if (is_numeric($active) && $active > -1) {
2050 $query .= ' AND active = %s';
2051 $values[] = $active;
2052 $types[] = 'integer';
2053 }
2054
2055 if ($timelimitowner != USER_FOLDER_ID && $timelimitowner != -1) {
2056 $query .= ' AND usr_data.time_limit_owner = %s';
2057 $values[] = $timelimitowner;
2058 $types[] = 'integer';
2059 }
2060
2061 $query .= ' ORDER BY usr_data.lastname, usr_data.firstname ';
2062
2063 $result = $ilDB->queryF($query, $types, $values);
2064 $mem_arr = [];
2065 while ($row = $ilDB->fetchAssoc($result)) {
2066 $mem_arr[] = $row;
2067 }
2068
2069 return $mem_arr;
2070 }

Referenced by ilSoapUserAdministration\getUsersForContainer().

+ Here is the caller graph for this function:

◆ _getUsersForRole()

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

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

1951 : array {
1952 global $DIC;
1953 $ilDB = $DIC['ilDB'];
1954 $rbacreview = $DIC['rbacreview'];
1955
1956 $ids = $rbacreview->assignedUsers($role_id);
1957
1958 if (count($ids) == 0) {
1959 $ids = [-1];
1960 }
1961
1962 $query = 'SELECT usr_data.*, usr_pref.value AS language
1963 FROM usr_data
1964 LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
1965 WHERE ' . $ilDB->in('usr_data.usr_id', $ids, false, 'integer');
1966 $values[] = 'language';
1967 $types[] = 'text';
1968
1969
1970 if (is_numeric($active) && $active > -1) {
1971 $query .= ' AND usr_data.active = %s';
1972 $values[] = $active;
1973 $types[] = 'integer';
1974 }
1975
1976 $query .= ' ORDER BY usr_data.lastname, usr_data.firstname ';
1977
1978 $r = $ilDB->queryF($query, $types, $values);
1979 $data = [];
1980 while ($row = $ilDB->fetchAssoc($r)) {
1981 $data[] = $row;
1982 }
1983 return $data;
1984 }

Referenced by ilSoapUserAdministration\getUserForRole().

+ Here is the caller graph for this function:

◆ _getUsersOnline()

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

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

2180 : array {
2181 global $DIC;
2182 $ilDB = $DIC['ilDB'];
2183
2185
2186 $pd_set = new ilSetting('pd');
2187 $atime = $pd_set->get('user_activity_time') * 60;
2188 $ctime = time();
2189
2190 $where = [];
2191
2192 if ($a_user_id === 0) {
2193 $where[] = 'user_id > 0';
2194 } else {
2195 $where[] = 'user_id = ' . $ilDB->quote($a_user_id, 'integer');
2196 }
2197
2198 if ($a_no_anonymous) {
2199 $where[] = 'user_id != ' . $ilDB->quote(ANONYMOUS_USER_ID, 'integer');
2200 }
2201
2202 if (ilUserAccountSettings::getInstance()->isUserAccessRestricted()) {
2203 $where[] = $ilDB->in('time_limit_owner', ilUserFilter::getInstance()->getFolderIds(), false, 'integer');
2204 }
2205
2206 $where[] = 'expires > ' . $ilDB->quote($ctime, 'integer');
2207 $where[] = '(p.value IS NULL OR NOT p.value = ' . $ilDB->quote('y', 'text') . ')';
2208
2209 $where = 'WHERE ' . implode(' AND ', $where);
2210
2211 $r = $ilDB->queryF(
2212 $q = "
2213 SELECT COUNT(user_id) num, user_id, firstname, lastname, title, login, last_login, MAX(ctime) ctime, context, agree_date
2214 FROM usr_session
2215 LEFT JOIN usr_data u
2216 ON user_id = u.usr_id
2217 LEFT JOIN usr_pref p
2218 ON (p.usr_id = u.usr_id AND p.keyword = %s)
2219 {$where}
2220 GROUP BY user_id, firstname, lastname, title, login, last_login, context, agree_date
2221 ORDER BY lastname, firstname
2222 ",
2223 ['text'],
2224 ['hide_own_online_status']
2225 );
2226
2227 $log->debug('Query: ' . $q);
2228
2229 $users = [];
2230 while ($user = $ilDB->fetchAssoc($r)) {
2231 if ($atime <= 0 || $user['ctime'] + $atime > $ctime) {
2232 $users[$user['user_id']] = $user;
2233 }
2234 }
2235
2236 $log->debug('Found users: ' . count($users));
2237
2238 $hide_users = $DIC['legalDocuments']->usersWithHiddenOnlineStatus(array_map(intval(...), array_column($users, 'user_id')));
2239 $users = array_filter(
2240 $users,
2241 fn($user) => !in_array((int) $user['user_id'], $hide_users, true)
2242 );
2243
2244 return $users;
2245 }
static getLogger(string $a_component_id)
Get component logger.
debug(string $message, array $context=[])
ilLogger $log
ilObjUser $user
ILIAS Setting Class.

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

+ Here is the caller graph for this function:

◆ _incrementLoginAttempts()

static ilObjUser::_incrementLoginAttempts ( int  $a_usr_id)
static

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

2147 : bool {
2148 global $DIC;
2149 $ilDB = $DIC['ilDB'];
2150
2151 $query = 'UPDATE usr_data SET login_attempts = (login_attempts + 1) WHERE usr_id = %s';
2152 $affected = $ilDB->manipulateF($query, ['integer'], [$a_usr_id]);
2153
2154 if ($affected) {
2155 return true;
2156 } else {
2157 return false;
2158 }
2159 }

Referenced by ilAuthFrontend\handleLoginAttempts().

+ Here is the caller graph for this function:

◆ _isAnonymous()

◆ _loginExists()

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

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

1909 : ?int {
1910 global $DIC;
1911 $ilDB = $DIC['ilDB'];
1912
1913 $q = 'SELECT DISTINCT login, usr_id FROM usr_data ' .
1914 'WHERE login = %s';
1915 $types[] = 'text';
1916 $values[] = $a_login;
1917
1918 if ($a_user_id != 0) {
1919 $q .= ' AND usr_id != %s ';
1920 $types[] = 'integer';
1921 $values[] = $a_user_id;
1922 }
1923
1924 $r = $ilDB->queryF($q, $types, $values);
1925
1926 if (($row = $ilDB->fetchAssoc($r))) {
1927 return (int) $row['usr_id'];
1928 }
1929 return null;
1930 }

References $q.

Referenced by ilUserLoginInputGUI\checkInput(), ILIAS\Help\GuidedTour\Elements\IdPresentation\getValidIdPresentationUsers(), ilECSAppEventListener\handleNewAccountCreation(), ilAuthProviderSaml\handleSamlAuth(), ilCalendarAppointmentGUI\loadNotificationRecipients(), ilLuceneQueryParser\replaceOwnerCallback(), ilAccountRegistrationGUI\saveForm(), ilObjEmployeeTalkSeriesGUI\saveObject(), ilConsultationHourAppointments\setManager(), and ILIAS\User\Profile\PersonalProfileGUI\updateLoginOrSetErrorMessages().

+ Here is the caller graph for this function:

◆ _lookup()

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

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

2470 : ?string {
2471 global $DIC;
2472 $ilDB = $DIC['ilDB'];
2473
2474 $res = $ilDB->queryF(
2475 'SELECT ' . $a_field . ' FROM usr_data WHERE usr_id = %s',
2476 ['integer'],
2477 [$a_user_id]
2478 );
2479
2480 while ($set = $ilDB->fetchAssoc($res)) {
2481 return $set[$a_field];
2482 }
2483 return null;
2484 }

◆ _lookupActive()

static ilObjUser::_lookupActive ( int  $a_usr_id)
static

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

2619 : bool
2620 {
2621 global $DIC;
2622 $ilDB = $DIC['ilDB'];
2623
2624 $query = 'SELECT usr_id FROM usr_data ' .
2625 'WHERE active = ' . $ilDB->quote(1, 'integer') . ' ' .
2626 'AND usr_id = ' . $ilDB->quote($a_usr_id, 'integer');
2627 $res = $ilDB->query($query);
2628 while ($res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
2629 return true;
2630 }
2631 return false;
2632 }
const FETCHMODE_OBJECT

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

Referenced by ilMailSearchObjectGUI\doesExposeMembers(), ilLearningSequenceParticipantsTableGUI\fillRow(), ILIAS\Contact\BuddySystem\Tables\RelationsTable\filter(), and ILIAS\Contact\Provider\ContactNotificationProvider\getNotifications().

+ Here is the caller graph for this function:

◆ _lookupAuthMode()

static ilObjUser::_lookupAuthMode ( int  $a_usr_id)
static

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

2709 : string
2710 {
2711 return (string) self::_lookup($a_usr_id, 'auth_mode');
2712 }
static _lookup(int $a_user_id, string $a_field)

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

+ Here is the caller graph for this function:

◆ _lookupClientIP()

static ilObjUser::_lookupClientIP ( int  $a_user_id)
static

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

2523 : string
2524 {
2525 return self::_lookup($a_user_id, 'client_ip') ?? '';
2526 }

◆ _lookupEmail()

static ilObjUser::_lookupEmail ( int  $a_user_id)
static

◆ _lookupExternalAccount()

static ilObjUser::_lookupExternalAccount ( int  $a_user_id)
static

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

2639 : string
2640 {
2641 return (string) self::_lookup($a_user_id, 'ext_account') ?? '';
2642 }

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

+ Here is the caller graph for this function:

◆ _lookupFeedHash()

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

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

3114 : ?string {
3115 global $DIC;
3116 $ilDB = $DIC['ilDB'];
3117
3118 if ($a_user_id > 0) {
3119 $set = $ilDB->queryF(
3120 'SELECT feed_hash from usr_data WHERE usr_id = %s',
3121 ['integer'],
3122 [$a_user_id]
3123 );
3124 if ($rec = $ilDB->fetchAssoc($set)) {
3125 if (strlen($rec['feed_hash']) == 32) {
3126 return $rec['feed_hash'];
3127 } elseif ($a_create) {
3128 $hash = md5(random_int(1, 9999999) + str_replace(' ', '', microtime()));
3129 $ilDB->manipulateF(
3130 'UPDATE usr_data SET feed_hash = %s' .
3131 ' WHERE usr_id = %s',
3132 ['text', 'integer'],
3133 [$hash, $a_user_id]
3134 );
3135 return $hash;
3136 }
3137 }
3138 }
3139 return null;
3140 }

References $ilDB.

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

+ Here is the caller graph for this function:

◆ _lookupFields()

static ilObjUser::_lookupFields ( int  $a_user_id)
static
Deprecated:

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

2605 : array // Missing array type.
2606 {
2607 global $DIC;
2608 $ilDB = $DIC['ilDB'];
2609
2610 $res = $ilDB->queryF(
2611 'SELECT * FROM usr_data WHERE usr_id = %s',
2612 ['integer'],
2613 [$a_user_id]
2614 );
2615 $user_rec = $ilDB->fetchAssoc($res);
2616 return $user_rec;
2617 }

References $DIC, $ilDB, and $res.

Referenced by ILIAS\Test\ExportImport\ResultsExportExcel\getUserFieldsForUserID(), and ilCertificateUserObjectHelper\lookupFields().

+ Here is the caller graph for this function:

◆ _lookupFirstLogin()

static ilObjUser::_lookupFirstLogin ( int  $a_user_id)
static

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

2859 : string
2860 {
2861 return self::_lookup($a_user_id, 'first_login') ?? '';
2862 }

Referenced by ilFirstLoginLearningHistoryProvider\getEntries().

+ Here is the caller graph for this function:

◆ _lookupFullname()

static ilObjUser::_lookupFullname ( int  $a_user_id)
static

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

2486 : string
2487 {
2488 global $DIC;
2489 $ilDB = $DIC['ilDB'];
2490
2491 $fullname = '';
2492
2493 $set = $ilDB->queryF(
2494 'SELECT title, firstname, lastname FROM usr_data WHERE usr_id = %s',
2495 ['integer'],
2496 [$a_user_id]
2497 );
2498
2499 if ($rec = $ilDB->fetchAssoc($set)) {
2500 if ($rec['title']) {
2501 $fullname = $rec['title'] . ' ';
2502 }
2503 if ($rec['firstname']) {
2504 $fullname .= $rec['firstname'] . ' ';
2505 }
2506 if ($rec['lastname']) {
2507 $fullname .= $rec['lastname'];
2508 }
2509 }
2510 return $fullname;
2511 }
string $fullname

References $DIC, and $ilDB.

Referenced by ilCalendarAppointmentGUI\book(), ilBookingProcessWithoutScheduleGUI\bookMultipleParticipants(), ILIAS\AccessControl\Log\Table\buildChangeColumn(), ilObjStudyProgrammeIndividualPlanGUI\buildFrame(), ilCalendarAppointmentGUI\cancelBooking(), ilAppointmentPresentationConsultationHoursGUI\collectPropertiesAndActions(), ilObjStudyProgrammeMembersGUI\confirmRemoveUsers(), ILIAS\Calendar\ConsultationHours\BookingCancellationGUI\getBookingInfo(), ilLPTableBaseGUI\getExportMeta(), ilCalendarAppointmentPanelGUI\getHTML(), ilCalendarBlockGUI\getHTML(), ILIAS\Calendar\ConsultationHours\BookingCancellationGUI\getInputs(), ilExAssignmentTeamLogTableGUI\getItems(), ilLearningModuleNotification\getMailBody(), ilConsultationHourAppointments\getManager(), ilExAssignmentTeam\getTeamId(), ilSCORMTrackingItemPerUserTableGUI\initTable(), ilSCORMTrackingItemsPerUserTableGUI\initTable(), ilBookingEntry\lookupManagedBookingsForObject(), ilConsultationHoursTableGUI\parse(), ilSCORMTrackingItemsScoTableGUI\parse(), ilAssignmentsPerParticipantTableGUI\parseData(), ilCalendarPresentationGUI\prepareOutput(), ILIAS\Calendar\ConsultationHours\BookingDataProvider\read(), ilCalendarCategories\readConsultationHoursCalendar(), ilObjStudyProgrammeMembersGUI\removeCertificate(), ilObjStudyProgrammeMembersGUI\removeCertificateMulti(), ilCalendarMailNotification\send(), ilConsultationHoursGUI\sendInfoAboutUnassignedUsers(), ilExAssignmentReminder\sendReminders(), ilObjSurvey\sendTutorNotification(), ilObjStudyProgrammeMembersGUI\updateCertificate(), ilObjStudyProgrammeMembersGUI\updateCertificateMulti(), ilObjStudyProgrammeMembersGUI\updateFromCurrentPlan(), and ilObjStudyProgrammeMembersGUI\updateFromCurrentPlanMulti().

+ Here is the caller graph for this function:

◆ _lookupGender()

static ilObjUser::_lookupGender ( int  $a_user_id)
static

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

2518 : string
2519 {
2520 return (string) self::_lookup($a_user_id, 'gender') ?? '';
2521 }

Referenced by ilMail\getSalutation().

+ Here is the caller graph for this function:

◆ _lookupId()

static ilObjUser::_lookupId ( string|array  $a_user_str)
static

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

2822 : int|null|array {
2823 global $DIC;
2824 $ilDB = $DIC['ilDB'];
2825
2826 if (!is_array($a_user_str)) {
2827 $res = $ilDB->queryF(
2828 'SELECT usr_id FROM usr_data WHERE login = %s',
2829 ['text'],
2830 [$a_user_str]
2831 );
2832
2833 $user_rec = $ilDB->fetchAssoc($res);
2834 if (is_array($user_rec)) {
2835 return (int) $user_rec['usr_id'];
2836 }
2837
2838 return null;
2839 }
2840
2841 $set = $ilDB->query(
2842 'SELECT usr_id FROM usr_data ' .
2843 ' WHERE ' . $ilDB->in('login', $a_user_str, false, 'text')
2844 );
2845
2846 $ids = [];
2847 while ($rec = $ilDB->fetchAssoc($set)) {
2848 $ids[] = (int) $rec['usr_id'];
2849 }
2850
2851 return $ids;
2852 }

References $ilDB, and $res.

Referenced by ilMail\__construct(), ilSurveyRaterGUI\addRater(), ilOrgUnitUserAssignmentGUI\addStaff(), ilObjBlogGUI\addUserFromAutoComplete(), ilRepositorySearchGUI\addUserFromAutoComplete(), ilBookingParticipantGUI\addUserFromAutoCompleteObject(), ilExerciseManagementGUI\addUserFromAutoCompleteObject(), ilExSubmissionTeamGUI\addUserFromAutoCompleteObject(), ilTreeTrashQueries\appendTrashNodeForContainerQueryFilter(), ilSkillProfileGUI\assignUser(), ilOrgUnitSimpleUserImport\buildUserId(), ilChatroomInviteUsersToPrivateRoomGUI\byLogin(), ilPermissionGUI\changeOwner(), ILIAS\AuthApache\AuthProviderApache\doAuthentication(), ilAuthProviderShibboleth\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(), ILIAS\AuthApache\AuthProviderApache\handleLDAPDataSource(), ilAuthProviderECS\handleLogin(), ilAuthFrontend\handleLoginAttempts(), ilSessionControl\handleLoginEvent(), ilAuthProviderSaml\handleSamlAuth(), ilAuthProviderSoap\handleSoapAuth(), ilAuthProviderSaml\importUser(), ilECSCmsCourseMemberCommandQueueHandler\lookupUserIdByLogin(), ilSoapRBACAdministration\parseUserID(), ilStartUpGUI\processCode(), ilDclRecordEditGUI\save(), ilObjEmployeeTalkSeriesGUI\saveObject(), ilSingleUserShareGUI\saveShare(), ilObjSurvey\sent360Reminders(), ilRegistrationSettings\setApproveRecipientLogins(), ilOpenIdConnectUserSync\setInternalAccount(), ilSystemSupportContacts\setList(), ilAccessibilitySupportContacts\setList(), ilAuthProviderLDAP\updateAccount(), ilLDAPAttributeToUser\usersToXML(), ilRegistrationSettings\validate(), and ilUserImportParser\verifyEndTag().

+ Here is the caller graph for this function:

◆ _lookupLanguage()

static ilObjUser::_lookupLanguage ( int  $a_usr_id)
static

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

2554 : string
2555 {
2556 global $DIC;
2557 $ilDB = $DIC['ilDB'];
2558 $lng = $DIC['lng'];
2559
2560 $q = 'SELECT value FROM usr_pref WHERE usr_id= ' .
2561 $ilDB->quote($a_usr_id, 'integer') . ' AND keyword = ' .
2562 $ilDB->quote('language', 'text');
2563 $r = $ilDB->query($q);
2564
2565 while ($row = $ilDB->fetchAssoc($r)) {
2566 return (string) $row['value'];
2567 }
2568 if (is_object($lng)) {
2569 return $lng->getDefaultLanguage();
2570 }
2571 return 'en';
2572 }
getDefaultLanguage()
Return default language.
ilLanguage $lng

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

Referenced by ilLanguageFactory\_getLanguageOfUser().

+ Here is the caller graph for this function:

◆ _lookupLastLogin()

static ilObjUser::_lookupLastLogin ( int  $a_user_id)
static

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

2854 : string
2855 {
2856 return self::_lookup($a_user_id, 'last_login') ?? '';
2857 }

Referenced by ilCronDeleteInactiveUserReminderMail\removeEntriesFromTableIfLastLoginIsNewer().

+ Here is the caller graph for this function:

◆ _lookupLogin()

static ilObjUser::_lookupLogin ( int  $a_user_id)
static

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

2634 : string
2635 {
2636 return (string) self::_lookup($a_user_id, 'login') ?? '';
2637 }

Referenced by ilCourseXMLParser\__parseId(), ILIAS\Mail\Placeholder\MailSignatureUserLoginPlaceholder\addPlaceholder(), ILIAS\Certificate\Overview\CertificateOverviewTable\buildTableRows(), ilContactGUI\chatroomInvitationMessage(), ilChatUserActionProvider\collectActionsForTargetUser(), ilWorkspaceUserActionProvider\collectActionsForTargetUser(), ilOrgUnitUserAssignmentGUI\confirmRemove(), ilContactGUI\confirmUnlinkContact(), ilObjRole\delete(), ilStartUpGUI\doStandardAuthentication(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilStudyProgrammeIndividualPlanTableGUI\fetchData(), ilDclBaseRecordModel\fillRecordFieldExcelExport(), ilPDNewsTableGUI\fillRow(), ilTestServiceGUI\getAdditionalUsrDataHtmlAndPopulateWindowTitle(), ilAccessibilitySupportContactsGUI\getContactLogins(), ILIAS\Container\Skills\ContSkillMemberRetrieval\getData(), ilAttendanceList\getHTML(), ILIAS\Test\ExportImport\CertificateExport\getLoginsForIds(), ilConsultationHourAppointments\getManagedUsers(), ilConsultationHourAppointments\getManager(), ilStudyProgrammeMailMemberSearchGUI\getProcessData(), ILIAS\Forum\Notification\ForumNotificationTable\getUserNotificationTableData(), ilInternalLinkGUI\getUserSearchResult(), ilUserClipboard\getValidatedContent(), ilAuthFrontend\handleAuthenticationSuccess(), ilMailSearchObjectGUI\mailMembers(), ilContactGUI\mailToUsers(), ilPermissionGUI\owner(), ilCalendarSharedUserListTableGUI\parse(), ilTrashTableGUI\parse(), ilUserClipboardTableGUI\parse(), ilRegistrationSettings\read(), ilLearningSequenceRoles\readMemberData(), ilExerciseManagementGUI\redirectFeedbackMailObject(), ilBookingReservationsGUI\redirectMailToBooker(), ilPortfolioRepositoryGUI\redirectSendMailToSharer(), ilBuddyList\request(), ilLearningModuleNotification\send(), ilMailSummaryNotification\send(), ilTimingsCronReminder\sendExceededMail(), ilTimingsCronReminder\sendFreshlyStartedMail(), ilMailNotification\sendMail(), ilLPTableBaseGUI\sendMail(), ilSkillNotifications\sendMail(), ilMembershipCronNotifications\sendMail(), ilObjContentObjectGUI\sendMailToBlockedUsers(), ilConsultationHoursGUI\sendMailToSelectedUsers(), ilMailMemberSearchGUI\sendMailToSelectedUsers(), ilMembershipGUI\sendMailToSelectedUsers(), ilMembershipMailGUI\sendMailToSelectedUsers(), ilStudyProgrammeMailMemberSearchGUI\sendMailToSelectedUsers(), ilMembershipCronMinMembers\sendMessage(), ilExAssignmentReminder\sendReminders(), ilObjSurvey\sendTutorNotification(), ilEmployeeTalkTableGUI\setTalkData(), ilObjBenchmarkGUI\settings(), ilMailSearchGUI\showResults(), ilMailFolderGUI\showUser(), ilContactGUI\submitInvitation(), ILIAS\LegalDocuments\Provide\ProvideHistory\table(), ilBuddySystemGUI\transitionAsyncCommand(), ilContactGUI\updateRelationState(), and ilUserImportParser\verifyEndTag().

+ Here is the caller graph for this function:

◆ _lookupName()

static ilObjUser::_lookupName ( int  $a_user_id)
static

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

2528 : array
2529 {
2530 global $DIC;
2531 $ilDB = $DIC['ilDB'];
2532
2533 $res = $ilDB->queryF(
2534 'SELECT firstname, lastname, title, login FROM usr_data WHERE usr_id = %s',
2535 ['integer'],
2536 [$a_user_id]
2537 );
2538 if (($user_rec = $ilDB->fetchAssoc($res))) {
2539 return ['user_id' => $a_user_id,
2540 'firstname' => $user_rec['firstname'],
2541 'lastname' => $user_rec['lastname'],
2542 'title' => $user_rec['title'],
2543 'login' => $user_rec['login']
2544 ];
2545 }
2546 return ['user_id' => 0,
2547 'firstname' => '',
2548 'lastname' => '',
2549 'title' => '',
2550 'login' => ''
2551 ];
2552 }

References $DIC, $ilDB, and $res.

Referenced by ilBookingAssignObjectsTableGUI\__construct(), ilExGradesTableGUI\__construct(), ILIAS\WOPI\Handler\GetFileInfoResponse\__construct(), ilObjTestAccess\_getParticipantData(), ilSoapLearningProgressAdministration\addUserProgress(), ilTimingsCronReminder\buildMailSalutation(), ilMailUserActionProvider\collectActionsForTargetUser(), ilExerciseManagementCollectFilesJob\collectAssignmentData(), ilMembershipGUI\confirmAssignFromWaitingList(), ilMembershipGUI\confirmAssignSubscribers(), ilMembershipGUI\confirmDeleteParticipants(), ilSessionMembershipGUI\confirmDeleteParticipants(), ilMembershipGUI\confirmRefuseFromList(), ilMembershipGUI\confirmRefuseSubscribers(), ILIAS\Exercise\Submission\SubmissionManager\copySubmissionsToDir(), ilLocalUserGUI\deleteUsers(), ilObjCategoryGUI\deleteUsersObject(), ilPortfolioExerciseGUI\downloadExcSubFile(), ilWikiPageGUI\downloadExcSubFile(), ilObjSessionGUI\eventsListObject(), ilSessionOverviewGUI\exportCSV(), ilObjExercise\exportGradesExcel(), ilDclBaseRecordModel\fillRecordFieldExcelExport(), ilCalendarInboxSharedTableGUI\fillRow(), ilFileVersionsTableGUI\fillRow(), ilObjSurvey\getAppraiseesData(), ilLMTracker\getBlockedUsersInformation(), ILIAS\Container\Skills\ContSkillMemberRetrieval\getData(), ilExSubmission\getDirectoryNameFromUserData(), ILIAS\Exercise\Submission\SubmissionManager\getDirectoryNameFromUserData(), ILIAS\Exercise\TutorFeedbackFile\TutorFeedbackFileManager\getFeedbackTitle(), ILIAS\Exercise\TutorFeedbackFile\TutorFeedbackZipRepository\getFiles(), ilIndividualAssessmentMembersTableGUI\getFullNameFor(), ilAttendanceList\getHTML(), ilSessionOverviewTableGUI\getItems(), ilSurveyParticipantsTableGUI\getItems(), ILIAS\Test\Logging\TestLogViewer\getLegacyLogExportForObjId(), ilExAssignment\getMemberListData(), ILIAS\Portfolio\PortfolioPrintViewProviderGUI\getPages(), ilDownloadSubmissionsBackgroundTask\getParticipantBucketTitle(), ilStudyProgrammeMailMemberSearchGUI\getProcessData(), ilObjWikiListGUI\getProperties(), ILIAS\AccessControl\Log\Table\getRows(), ilMail\getSalutation(), ilDclBaseRecordModel\getStandardField(), ILIAS\Forum\Notification\ForumNotificationTable\getUserNotificationTableData(), ilObjStudyProgrammeAutoCategoriesGUI\getUserRepresentation(), ilObjStudyProgrammeAutoMembershipsGUI\getUserRepresentation(), ilWorkspaceShareTableGUI\importData(), ilCourseParticipantsGroupsTableDataRetrieval\init(), ilLOMemberTestResultTableGUI\init(), ilContSkillAdminGUI\initCompetenceAssignmentForm(), ilWorkspaceShareTableGUI\initFilter(), ilExerciseManagementGUI\initIndividualDeadlineForm(), ilObjectCustomUserFieldsGUI\initMemberForm(), ilAssignmentsPerParticipantTableGUI\initMode(), ilCourseParticipantsTableGUI\lookupUserName(), ilGroupParticipantsTableGUI\lookupUserName(), ilCalendarSharedListTableGUI\parse(), ilCalendarSharedUserListTableGUI\parse(), ilConsultationHoursTableGUI\parse(), ilCourseReferenceDeleteConfirmationTableGUI\parse(), ilUserClipboardTableGUI\parse(), ilGroupXMLParser\parseId(), ilObjCourseGUI\readMemberData(), ilLearningSequenceRoles\readMemberData(), ilSubscriberTableGUI\readSubscriberData(), ilWaitingListTableGUI\readUserData(), ilExerciseManagementGUI\showParticipantObject(), ilMailSearchGUI\showResults(), ilCourseContentGUI\showUserTimings(), ilObjTest\userLookupFullName(), and ilMailNotification\userToString().

+ Here is the caller graph for this function:

◆ _lookupPref()

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

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

2377 : ?string {
2378 global $DIC;
2379 $ilDB = $DIC['ilDB'];
2380
2381 $query = 'SELECT * FROM usr_pref WHERE usr_id = ' . $ilDB->quote($a_usr_id, 'integer') . ' ' .
2382 'AND keyword = ' . $ilDB->quote($a_keyword, 'text');
2383 $res = $ilDB->query($query);
2384
2385 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
2386 return $row->value;
2387 }
2388 return null;
2389 }

Referenced by ilChatUserActionProvider\acceptsMessages(), ilChatroomViewGUI\buildUserActions(), ilObjUserAccess\canBeDelivered(), ilUserUserActionProvider\collectActionsForTargetUser(), ilMailSearchObjectMembershipsTableGUI\fillRow(), ilMail\formatNamesForOutput(), ilSessionReminder\getEffectiveLeadTime(), ilBuddySystemLinkButton\getHtml(), ilUserUtil\getProfileLink(), ilTutorialSupportBlockGUI\hasContactEnabled(), ilContactGUI\linkToProfile(), ilBuddySystemGUI\requestCommand(), ilMailSearchGUI\showResults(), ilBuddySystemGUI\transitionAsyncCommand(), and ilContactGUI\updateRelationState().

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

2992 : void {
2993 global $DIC;
2994 $ilDB = $DIC['ilDB'];
2995
2996 $q = 'SELECT up1.usr_id usr_id FROM usr_pref up1, usr_pref up2 ' .
2997 ' WHERE up1.keyword= ' . $ilDB->quote('style', 'text') .
2998 ' AND up1.value= ' . $ilDB->quote($a_from_style, 'text') .
2999 ' AND up2.keyword= ' . $ilDB->quote('skin', 'text') .
3000 ' AND up2.value= ' . $ilDB->quote($a_from_skin, 'text') .
3001 ' AND up1.usr_id = up2.usr_id ';
3002
3003 $usr_set = $ilDB->query($q);
3004
3005 while ($usr_rec = $ilDB->fetchAssoc($usr_set)) {
3006 $ilDB->replace(
3007 'usr_pref',
3008 [
3009 'usr_id' => [ilDBConstants::T_INTEGER, $usr_rec['usr_id']],
3010 'keyword' => [ilDBConstants::T_TEXT, 'skin'],
3011 ],
3012 [
3013 'value' => [ilDBConstants::T_TEXT, $a_to_skin]
3014 ]
3015 );
3016 $ilDB->replace(
3017 'usr_pref',
3018 [
3019 'usr_id' => [ilDBConstants::T_INTEGER, $usr_rec['usr_id']],
3020 'keyword' => [ilDBConstants::T_TEXT, 'style'],
3021 ],
3022 [
3023 'value' => [ilDBConstants::T_TEXT, $a_to_style]
3024 ]
3025 );
3026 }
3027 }

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

Referenced by ilSystemStyleOverviewGUI\moveUserStyles().

+ Here is the caller graph for this function:

◆ _readUsersProfileData()

static ilObjUser::_readUsersProfileData ( array  $a_user_ids)
static

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

2882 : array
2883 {
2884 global $DIC;
2885 $ilDB = $DIC['ilDB'];
2886
2887 $res = $ilDB->query('SELECT * FROM usr_data WHERE ' .
2888 $ilDB->in('usr_id', $a_user_ids, false, 'integer'));
2889 $user_data = [];
2890 while ($row = $ilDB->fetchAssoc($res)) {
2891 $user_data[$row['usr_id']] = $row;
2892 }
2893 return $user_data;
2894 }

References $DIC, $ilDB, and $res.

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

+ Here is the caller graph for this function:

◆ _setUserInactive()

static ilObjUser::_setUserInactive ( int  $a_usr_id)
static

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

2163 : bool {
2164 global $DIC;
2165 $ilDB = $DIC['ilDB'];
2166
2167 $query = 'UPDATE usr_data SET active = 0, inactivation_date = %s WHERE usr_id = %s';
2168 $affected = $ilDB->manipulateF($query, ['timestamp', 'integer'], [ilUtil::now(), $a_usr_id]);
2169
2170 if ($affected) {
2171 return true;
2172 } else {
2173 return false;
2174 }
2175 }
static now()
Return current timestamp in Y-m-d H:i:s format.

Referenced by ilAuthFrontend\handleLoginAttempts().

+ Here is the caller graph for this function:

◆ _toggleActiveStatusOfUsers()

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

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

2684 : void {
2685 global $DIC;
2686
2687 $ilDB = $DIC['ilDB'];
2688
2689 if ($a_status) {
2690 $q = 'UPDATE usr_data SET active = 1, inactivation_date = NULL WHERE ' .
2691 $ilDB->in('usr_id', $a_usr_ids, false, 'integer');
2692 $ilDB->manipulate($q);
2693 } else {
2694 $usrId_IN_usrIds = $ilDB->in('usr_id', $a_usr_ids, false, 'integer');
2695
2696 $q = 'UPDATE usr_data SET active = 0 WHERE $usrId_IN_usrIds';
2697 $ilDB->manipulate($q);
2698
2699 $queryString = '
2700 UPDATE usr_data
2701 SET inactivation_date = %s
2702 WHERE inactivation_date IS NULL
2703 AND $usrId_IN_usrIds
2704 ';
2705 $ilDB->manipulateF($queryString, ['timestamp'], [ilUtil::now()]);
2706 }
2707 }

References $ilDB, and $q.

Referenced by ilLDAPCronSynchronization\deactivateUsers().

+ Here is the caller graph for this function:

◆ _writeAuthMode()

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

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

2589 : void
2590 {
2591 global $DIC;
2592 $ilDB = $DIC['ilDB'];
2593
2594 $ilDB->manipulateF(
2595 'UPDATE usr_data ' .
2596 ' SET auth_mode = %s WHERE usr_id = %s',
2597 ['text', 'integer'],
2598 [$a_auth_mode, $a_usr_id]
2599 );
2600 }

References $DIC, and $ilDB.

Referenced by ilAuthProviderSaml\handleSamlAuth().

+ Here is the caller graph for this function:

◆ _writeExternalAccount()

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

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

2577 : void {
2578 global $DIC;
2579 $ilDB = $DIC['ilDB'];
2580
2581 $ilDB->manipulateF(
2582 'UPDATE usr_data ' .
2583 ' SET ext_account = %s WHERE usr_id = %s',
2584 ['text', 'integer'],
2585 [$a_ext_id, $a_usr_id]
2586 );
2587 }

◆ activateDeletionFlag()

ilObjUser::activateDeletionFlag ( )

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

1764 : void
1765 {
1766 $this->writePref('delete_flag', true);
1767 }
writePref(string $key, string $value)

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

1251 : void {
1252 global $DIC;
1253
1254 $ilDB = $DIC['ilDB'];
1255
1256 if ($a_time === '') {
1257 $a_time = date('Y-m-d H:i:s');
1258 }
1259
1260 $item_set = $ilDB->queryF(
1261 'SELECT * FROM personal_clipboard WHERE ' .
1262 'parent = %s AND item_id = %s AND type = %s AND user_id = %s',
1263 ['integer', 'integer', 'text', 'integer'],
1264 [0, $a_item_id, $a_type, $this->getId()]
1265 );
1266
1267 // only insert if item is not already in clipboard
1268 if (!$item_set->fetchRow()) {
1269 $ilDB->manipulateF(
1270 'INSERT INTO personal_clipboard ' .
1271 '(item_id, type, user_id, title, parent, insert_time, order_nr) VALUES ' .
1272 ' (%s,%s,%s,%s,%s,%s,%s)',
1273 ['integer', 'text', 'integer', 'text', 'integer', 'timestamp', 'integer'],
1274 [$a_item_id, $a_type, $this->getId(), $a_title, $a_parent, $a_time, $a_order_nr]
1275 );
1276 } else {
1277 $ilDB->manipulateF(
1278 'UPDATE personal_clipboard SET insert_time = %s ' .
1279 'WHERE user_id = %s AND item_id = %s AND type = %s AND parent = 0',
1280 ['timestamp', 'integer', 'integer', 'text'],
1281 [$a_time, $this->getId(), $a_item_id, $a_type]
1282 );
1283 }
1284 }

Referenced by ilPageEditorGUI\copyLinkedMediaToClipboard().

+ Here is the caller graph for this function:

◆ addToPCClipboard()

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

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

Todo:
move to COPage service

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

1294 : void {
1295 $ilDB = $this->db;
1296 if ($a_time == 0) {
1297 $a_time = date('Y-m-d H:i:s');
1298 }
1299 ilSession::set('user_pc_clip', true);
1300 $ilDB->insert('personal_pc_clipboard', [
1301 'user_id' => ['integer', $this->getId()],
1302 'content' => ['clob', $a_content],
1303 'insert_time' => ['timestamp', $a_time],
1304 'order_nr' => ['integer', $a_nr]
1305 ]);
1306 }
static set(string $a_var, $a_val)
Set a value.

◆ assignSystemInformationFromDB()

ilObjUser::assignSystemInformationFromDB ( array  $data)
private

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

207 : void
208 {
209 if (!empty($data['passwd'])) {
210 $this->setPasswd($data['passwd'], self::PASSWD_CRYPTED);
211 }
212
213 $this->password_salt = $data['passwd_salt'];
214 $this->password_encoding_type = $data['passwd_enc_type'];
215 $this->last_password_change_ts = $data['last_password_change'];
216 $this->login_attempts = $data['login_attempts'];
217 $this->passwd_policy_reset = $data['passwd_policy_reset'];
218 $this->client_ip = $data['client_ip'];
219 $this->last_login = $data['last_login'];
220 $this->first_login = $data['first_login'];
221 $this->last_profile_prompt = $data['last_profile_prompt'];
222 $this->last_update = $data['last_update'];
223 $this->create_date = $data['create_date'];
224 $this->approve_date = $data['approve_date'];
225 $this->active = $data['active'];
226 $this->agree_date = $data['agree_date'];
227 $this->inactivation_date = $data['inactivation_date'];
228
229 $this->time_limit_owner = $data['time_limit_owner'];
230 $this->time_limit_unlimited = $data['time_limit_unlimited'];
231 $this->time_limit_from = $data['time_limit_from'];
232 $this->time_limit_until = $data['time_limit_until'];
233
234 $this->profile_incomplete = $data['profile_incomplete'];
235
236 $this->auth_mode = $data['auth_mode'];
237 $this->ext_account = $data['ext_account'] ?? '';
238 $this->is_self_registered = $data['is_self_registered'];
239 $this->last_visited = $data['last_visited'];
240 }
setPasswd(string $a_str, string $a_type=ilObjUser::PASSWD_PLAIN)

References $data, and setPasswd().

Referenced by read().

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

◆ buildSystemInformationArrayForDB()

ilObjUser::buildSystemInformationArrayForDB ( )
private

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

242 : array
243 {
244 return [
245 'last_password_change' => $this->last_password_change_ts,
246 'login_attempts' => $this->login_attempts,
247 'passwd' => $this->prepareAndRetrievePasswordForStorage(),
248 'passwd_salt' => $this->password_salt,
249 'passwd_enc_type' => $this->password_encoding_type,
250 'passwd_policy_reset' => $this->passwd_policy_reset,
251 'client_ip' => $this->client_ip,
252 'last_login' => $this->last_login,
253 'first_login' => $this->first_login,
254 'last_profile_prompt' => $this->last_profile_prompt,
255 'active' => $this->active,
256 'approve_date' => $this->approve_date,
257 'agree_date' => $this->retrieveAgreeDateForStorage(),
258 'inactivation_date' => $this->inactivation_date,
259 'time_limit_owner' => $this->time_limit_owner,
260 'time_limit_unlimited' => $this->time_limit_unlimited,
261 'time_limit_from' => $this->time_limit_from,
262 'time_limit_until' => $this->time_limit_until,
263 'profile_incomplete' => $this->profile_incomplete,
264 'auth_mode' => $this->auth_mode,
265 'ext_account' => $this->ext_account ?? '',
266 'is_self_registered' => $this->is_self_registered,
267 'last_update' => $this->last_update,
268 'create_date' => $this->create_date,
269 'last_visited' => $this->last_visited
270 ];
271 }
string $last_login
string $client_ip
array $last_visited
string $password_encoding_type
prepareAndRetrievePasswordForStorage()
bool $is_self_registered
string $inactivation_date
bool $time_limit_unlimited
bool $passwd_policy_reset
int $time_limit_from
int $last_password_change_ts
string $first_login
string $approve_date
int $time_limit_until
string $password_salt
retrieveAgreeDateForStorage()
int $time_limit_owner
string $last_profile_prompt
string $auth_mode
bool $profile_incomplete
string $create_date
string $last_update

References $active, $approve_date, $auth_mode, $client_ip, ilObject\$create_date, $first_login, $inactivation_date, $is_self_registered, $last_login, $last_password_change_ts, $last_profile_prompt, ilObject\$last_update, $last_visited, $login_attempts, $passwd_policy_reset, $password_encoding_type, $password_salt, $profile_incomplete, $time_limit_from, $time_limit_owner, $time_limit_unlimited, $time_limit_until, prepareAndRetrievePasswordForStorage(), and retrieveAgreeDateForStorage().

Referenced by saveAsNew().

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

◆ buildTextFromArray()

ilObjUser::buildTextFromArray ( array  $a_attr)
private

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

1894 : string
1895 {
1896 if (count($a_attr) > 0) {
1897 return implode(', ', $a_attr);
1898 }
1899 return '';
1900 }

◆ checkTimeLimit()

ilObjUser::checkTimeLimit ( )

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

1134 : bool
1135 {
1136 if ($this->getTimeLimitUnlimited()) {
1137 return true;
1138 }
1139 if ($this->getTimeLimitFrom() < time() and $this->getTimeLimitUntil() > time()) {
1140 return true;
1141 }
1142 return false;
1143 }

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

+ Here is the caller graph for this function:

◆ clipboardDeleteAll()

ilObjUser::clipboardDeleteAll ( )

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

1372 : void
1373 {
1374 global $DIC;
1375
1376 $ilDB = $DIC['ilDB'];
1377
1378 $ilDB->manipulateF('DELETE FROM personal_clipboard WHERE ' .
1379 'user_id = %s', ['integer'], [$this->getId()]);
1380 }

References $DIC, $ilDB, and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ clipboardDeleteObjectsOfType()

ilObjUser::clipboardDeleteObjectsOfType ( string  $a_type)

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

1360 : void
1361 {
1362 $ilDB = $this->db;
1363
1364 $ilDB->manipulateF(
1365 'DELETE FROM personal_clipboard WHERE ' .
1366 'type = %s AND user_id = %s',
1367 ['text', 'integer'],
1368 [$a_type, $this->getId()]
1369 );
1370 }

References $ilDB, and ILIAS\Survey\Mode\getId().

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

1341 : bool
1342 {
1343 global $DIC;
1344
1345 $ilDB = $DIC['ilDB'];
1346
1347 $set = $ilDB->queryF(
1348 'SELECT * FROM personal_clipboard WHERE ' .
1349 'parent = %s AND type = %s AND user_id = %s',
1350 ['integer', 'text', 'integer'],
1351 [0, $a_type, $this->getId()]
1352 );
1353 if ($ilDB->fetchAssoc($set)) {
1354 return true;
1355 }
1356
1357 return false;
1358 }

References $DIC, $ilDB, and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ copyProfilePicturesToDirectory()

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

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

3092 : void {
3093 global $DIC;
3094 $irss = $DIC->resourceStorage();
3095
3096 $clean_dir = trim(str_replace('..', '', $a_dir));
3097 if ($clean_dir == '' || !is_dir($clean_dir)) {
3098 return;
3099 }
3100 $avatar_rid = (new ilObjUser($a_user_id))->getAvatarRid();
3101 if ($avatar_rid === null) {
3102 return;
3103 }
3104
3105 file_put_contents(
3106 $clean_dir . '/usr_' . $a_user_id . '.jpg',
3107 $irss->consume()->stream($avatar_rid)->getStream()->getContents()
3108 );
3109 }
User class.
Services $irss

Referenced by ilUserDataSet\getXmlRecord().

+ Here is the caller graph for this function:

◆ deletePref()

ilObjUser::deletePref ( string  $key)

◆ findInterests()

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

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

2407 : array {
2408 global $DIC;
2409 $ilDB = $DIC['ilDB'];
2410
2411 $res = [];
2412
2413 $sql = 'SELECT DISTINCT(value)' .
2414 ' FROM usr_profile_data' .
2415 ' WHERE ' . $ilDB->like('value', 'text', '%' . $a_term . '%');
2416 if ($a_field_id) {
2417 $sql .= ' AND field_id = ' . $ilDB->quote($a_field_id, 'text');
2418 }
2419 if ($a_user_id) {
2420 $sql .= ' AND usr_id <> ' . $ilDB->quote($a_user_id, 'integer');
2421 }
2422 $sql .= ' ORDER BY value';
2423 $set = $ilDB->query($sql);
2424 while ($row = $ilDB->fetchAssoc($set)) {
2425 $res[] = $row['value'];
2426 }
2427
2428 return $res;
2429 }

References $ilDB.

Referenced by ILIAS\User\Profile\PublicProfileGUI\doProfileAutoComplete().

+ Here is the caller graph for this function:

◆ getActive()

ilObjUser::getActive ( )

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

1074 : bool
1075 {
1076 return $this->active === 1;
1077 }

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

+ Here is the caller graph for this function:

◆ getAgreeDate()

ilObjUser::getAgreeDate ( )

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

1039 : ?string
1040 {
1041 return $this->agree_date;
1042 }
string $agree_date

◆ getApproveDate()

ilObjUser::getApproveDate ( )

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

1034 : ?string
1035 {
1036 return $this->approve_date;
1037 }

◆ getAuthMode()

ilObjUser::getAuthMode ( bool  $a_auth_key = false)

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

1220 : ?string
1221 {
1222 if (!$a_auth_key) {
1223 return $this->auth_mode;
1224 }
1225 return ilAuthUtils::_getAuthMode($this->auth_mode);
1226 }
static _getAuthMode(?string $a_auth_mode)

References ilAuthUtils\_getAuthMode().

Referenced by ILIAS\Authentication\Password\LocalUserPasswordManager\allowPasswordChange(), and ilECSAppEventListener\handleMembership().

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

◆ getAvatar()

ilObjUser::getAvatar ( )

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

1497 : Avatar
1498 {
1499 return self::_getAvatar($this->getId());
1500 }
static _getAvatar(int $a_usr_id)

References ILIAS\Survey\Mode\getId().

Referenced by ilPDMailBlockGUI\getListItemForData().

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

◆ getAvatarRid()

ilObjUser::getAvatarRid ( )

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

805 {
806 return $this->profile_data->getAvatarRid();
807 }

Referenced by ILIAS\User\Profile\Fields\Standard\Avatar\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getBirthday()

ilObjUser::getBirthday ( )

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

613 : ?string
614 {
615 return $this->profile_data->getBirthday()?->format('Y-m-d');
616 }

Referenced by ILIAS\User\Profile\Fields\Standard\Birthday\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getCity()

ilObjUser::getCity ( )

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

653 : string
654 {
655 return $this->profile_data->getCity();
656 }

Referenced by ILIAS\User\Profile\Fields\Standard\City\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getClientIP()

ilObjUser::getClientIP ( )

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

819 : string
820 {
821 return $this->client_ip;
822 }

Referenced by ilAuthFrontend\checkIp(), and ILIAS\User\Profile\Fields\Standard\ClientIP\retrieveValueFromUser().

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

1433 : array {
1434 global $DIC;
1435
1436 $ilDB = $DIC['ilDB'];
1437 $ilUser = $DIC['ilUser'];
1438
1439 $objs = $ilDB->queryF(
1440 'SELECT * FROM personal_clipboard WHERE ' .
1441 'user_id = %s AND parent = %s AND insert_time = %s ' .
1442 ' ORDER BY order_nr',
1443 ['integer', 'integer', 'timestamp'],
1444 [$ilUser->getId(), $a_parent, $a_insert_time]
1445 );
1446 $objects = [];
1447 while ($obj = $ilDB->fetchAssoc($objs)) {
1448 if ($obj['type'] == 'mob') {
1449 $obj['title'] = ilObject::_lookupTitle($obj['item_id']);
1450 }
1451 $objects[] = ['id' => $obj['item_id'],
1452 'type' => $obj['type'], 'title' => $obj['title'], 'insert_time' => $obj['insert_time']];
1453 }
1454 return $objects;
1455 }
static _lookupTitle(int $obj_id)

References ilObject\_lookupTitle().

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

1388 : array {
1389 global $DIC;
1390
1391 $ilDB = $DIC['ilDB'];
1392
1393 $par = '';
1394 if ($a_top_nodes_only) {
1395 $par = ' AND parent = ' . $ilDB->quote(0, 'integer') . ' ';
1396 }
1397
1398 $type_str = ($a_type != '')
1399 ? ' AND type = ' . $ilDB->quote($a_type, 'text') . ' '
1400 : '';
1401 $q = 'SELECT * FROM personal_clipboard WHERE ' .
1402 'user_id = ' . $ilDB->quote($this->getId(), 'integer') . ' ' .
1403 $type_str . $par .
1404 ' ORDER BY order_nr';
1405 $objs = $ilDB->query($q);
1406 $objects = [];
1407 while ($obj = $ilDB->fetchAssoc($objs)) {
1408 if ($obj['type'] == 'mob') {
1409 $obj['title'] = ilObject::_lookupTitle($obj['item_id']);
1410 if (ilObject::_lookupType((int) $obj['item_id']) !== 'mob') {
1411 continue;
1412 }
1413 }
1414 if ($obj['type'] == 'incl') {
1415 $obj['title'] = ilMediaPoolPage::lookupTitle($obj['item_id']);
1416 if (!ilPageObject::_exists('mep', (int) $obj['item_id'], '-')) {
1417 continue;
1418 }
1419 }
1420 $objects[] = ['id' => $obj['item_id'],
1421 'type' => $obj['type'], 'title' => $obj['title'],
1422 'insert_time' => $obj['insert_time']];
1423 }
1424 return $objects;
1425 }
static lookupTitle(int $a_page_id)
static _lookupType(int $id, bool $reference=false)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.

References $ilDB.

Referenced by ilClipboardTableGUI\getItems().

+ Here is the caller graph for this function:

◆ getComment()

ilObjUser::getComment ( )

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

763 : string
764 {
765 return $this->profile_data->getReferralComment();
766 }

Referenced by ILIAS\User\Profile\Fields\Standard\ReferralComment\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getCountry()

ilObjUser::getCountry ( )

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

673 : string
674 {
675 return $this->profile_data->getCountry();
676 }

Referenced by ILIAS\LegalDocuments\Condition\UserCountry\eval(), and ILIAS\User\Profile\Fields\Standard\Country\retrieveValueFromUser().

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

946 : string
947 {
948 return ilSession::get('lang') ?? '';
949 }
static get(string $a_var)

References ilSession\get().

+ Here is the call graph for this function:

◆ getDateFormat()

ilObjUser::getDateFormat ( )

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

429 : DateFormat
430 {
431 $format = $this->getPref('date_format');
432 if ($format === null) {
433 $format = ilCalendarSettings::_getInstance()->getDefaultDateFormat();
434 }
435
436 return match ((int) $format) {
437 ilCalendarSettings::DATE_FORMAT_DMY => $this->data_factory->dateFormat()->germanShort(),
438 ilCalendarSettings::DATE_FORMAT_MDY => $this->data_factory->dateFormat()->americanShort(),
439 ilCalendarSettings::DATE_FORMAT_YMD => $this->data_factory->dateFormat()->standard(),
440 default => $this->data_factory->dateFormat()->standard()
441 };
442 }
A Date Format provides a format definition akin to PHP's date formatting options, but stores the sing...
Definition: DateFormat.php:27
getPref(string $keyword)

References ilCalendarSettings\_getInstance(), ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, and ilCalendarSettings\DATE_FORMAT_YMD.

Referenced by ilIndividualAssessmentDateFormatter\getUserDateFormat(), and ilDclDateSelectionFieldModel\personalizeOptionValue().

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

◆ getDateTimeFormat()

ilObjUser::getDateTimeFormat ( )

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

444 : DateFormat
445 {
446 if ($this->getTimeFormat() === (string) \ilCalendarSettings::TIME_FORMAT_24) {
447 return $this->data_factory->dateFormat()->withTime24($this->getDateFormat());
448 }
449 return $this->data_factory->dateFormat()->withTime12($this->getDateFormat());
450 }

References ilCalendarSettings\TIME_FORMAT_24.

Referenced by ilDclDatetimeSelectionFieldModel\personalizeOptionValue().

+ Here is the caller graph for this function:

◆ getDepartment()

ilObjUser::getDepartment ( )

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

633 : string
634 {
635 return $this->profile_data->getDepartment();
636 }

Referenced by ILIAS\User\Profile\Fields\Standard\Department\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getEmail()

◆ getExternalAccount()

ilObjUser::getExternalAccount ( )

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

1233 : string
1234 {
1235 return $this->ext_account;
1236 }
string $ext_account

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

+ Here is the caller graph for this function:

◆ getFax()

ilObjUser::getFax ( )

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

713 : string
714 {
715 return $this->profile_data->getFax();
716 }

Referenced by ILIAS\User\Profile\Fields\Standard\Fax\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getFirstLettersOfLastnames()

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

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

2326 : array {
2327 global $DIC;
2328 $ilDB = $DIC['ilDB'];
2329
2330 $q = 'SELECT DISTINCT ' . $ilDB->upper($ilDB->substr('lastname', 1, 1)) . ' let' .
2331 ' FROM usr_data' .
2332 ' WHERE usr_id <> ' . $ilDB->quote(ANONYMOUS_USER_ID, 'integer') .
2333 ($user_ids !== null ? ' AND ' . $ilDB->in('usr_id', $user_ids, false, 'integer') : '') .
2334 ' ORDER BY let';
2335 $let_set = $ilDB->query($q);
2336
2337 $let = [];
2338 while ($let_rec = $ilDB->fetchAssoc($let_set)) {
2339 $let[$let_rec['let']] = $let_rec['let'];
2340 }
2341 return $let;
2342 }

◆ getFirstLogin()

ilObjUser::getFirstLogin ( )

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

989 : string
990 {
991 return $this->first_login;
992 }

◆ getFirstname()

◆ getFullname()

ilObjUser::getFullname ( int  $max_strlen = 0)
Parameters
int$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 873 of file class.ilObjUser.php.

873 : string
874 {
875 if ($max_strlen === 0) {
876 return ilUtil::stripSlashes($this->fullname);
877 }
878
879 if (mb_strlen($this->fullname) <= $max_strlen) {
880 return ilUtil::stripSlashes($this->fullname);
881 }
882
883 $length_lastname = mb_strlen($this->lastname);
884 if (mb_strlen($this->utitle) + $length_lastname + 4 <= $max_strlen) {
885 return ilUtil::stripSlashes($this->utitle . ' ' . substr($this->firstname, 0, 1) . '. ' . $this->lastname);
886 }
887
888 if (mb_strlen($this->firstname) + $length_lastname + 1 <= $max_strlen) {
889 return ilUtil::stripSlashes($this->firstname . ' ' . $this->lastname);
890 }
891
892 if ($length_lastname + 3 <= $max_strlen) {
893 return ilUtil::stripSlashes(substr($this->firstname, 0, 1) . '. ' . $this->lastname);
894 }
895
896 return ilUtil::stripSlashes(substr($this->lastname, 0, $max_strlen));
897 }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

References ilUtil\stripSlashes().

Referenced by shibUser\createFields(), ilCmiXapiUser\getName(), ilTutorialSupportBlockGUI\getTutorData(), ilDclBaseFieldRepresentation\passThroughFilter(), and ilAccountMail\send().

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

◆ getGender()

ilObjUser::getGender ( )

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

560 : string
561 {
562 return $this->profile_data->getGender()?->value ?? '';
563 }

Referenced by ilAccountMail\replacePlaceholders(), and ILIAS\User\Profile\Fields\Standard\Gender\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getGeneralInterests()

ilObjUser::getGeneralInterests ( )
Returns
array<string>

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

1803 : array
1804 {
1805 return $this->profile_data->getAdditionalFieldByIdentifier(
1806 $this->profile_configuration_repository->getByClass(Interests::class)->getIdentifier()
1807 ) ?? [];
1808 }

Referenced by ILIAS\User\Profile\Fields\Standard\Interests\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getGeneralInterestsAsText()

ilObjUser::getGeneralInterestsAsText ( )

Get general interests as plain text.

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

1813 : string
1814 {
1815 return $this->buildTextFromArray($this->getGeneralInterests());
1816 }
buildTextFromArray(array $a_attr)

◆ getHobby()

ilObjUser::getHobby ( )

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

753 : string
754 {
755 return $this->profile_data->getHobby();
756 }

Referenced by ILIAS\User\Profile\Fields\Standard\Hobby\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getInactivationDate()

ilObjUser::getInactivationDate ( )

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

1749 : ?string
1750 {
1752 }

◆ getInstitution()

ilObjUser::getInstitution ( )

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

623 : string
624 {
625 return $this->profile_data->getInstitution();
626 }

Referenced by ILIAS\User\Profile\Fields\Standard\Institution\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getLanguage()

◆ getLastHistoryData()

ilObjUser::getLastHistoryData ( )

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

303 : ?array
304 {
305 $this->db->setLimit(1, 0);
306 $res = $this->db->queryF(
307 '
308 SELECT login, history_date FROM loginname_history
309 WHERE usr_id = %s ORDER BY history_date DESC',
310 ['integer'],
311 [$this->id]
312 );
313 $row = $this->db->fetchAssoc($res);
314 if ($row === null) {
315 return null;
316 }
317
318 return [
319 $row['login'],
320 $row['history_date']
321 ];
322 }

References $res.

Referenced by updateLogin().

+ Here is the caller graph for this function:

◆ getLastLogin()

ilObjUser::getLastLogin ( )

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

964 : string
965 {
966 return $this->last_login;
967 }

◆ getLastname()

◆ getLastPasswordChangeTS()

ilObjUser::getLastPasswordChangeTS ( )

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

928 : int
929 {
931 }

◆ getLastProfilePrompt()

ilObjUser::getLastProfilePrompt ( )

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

999 : string
1000 {
1002 }

◆ getLastUpdate()

ilObjUser::getLastUpdate ( )

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

1009 : string
1010 {
1011 return $this->last_update;
1012 }

◆ getLastVisited()

ilObjUser::getLastVisited ( )

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

1014 : array
1015 {
1016 return $this->last_visited;
1017 }

◆ getLatitude()

ilObjUser::getLatitude ( )

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

775 : ?string
776 {
777 return $this->profile_data->getGeoCoordinates()['latitude'] ?? null;
778 }

Referenced by ILIAS\User\Profile\Fields\Standard\Location\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getLocationZoom()

ilObjUser::getLocationZoom ( )

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

799 : ?int
800 {
801 return $this->profile_data->getGeoCoordinates()['zoom'] ?? null;
802 }

Referenced by ILIAS\User\Profile\Fields\Standard\Location\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getLogin()

◆ getLoginAttempts()

ilObjUser::getLoginAttempts ( )

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

1129 : int
1130 {
1131 return $this->login_attempts;
1132 }

◆ getLongitude()

ilObjUser::getLongitude ( )

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

787 : ?string
788 {
789 return $this->profile_data->getGeoCoordinates()['longitude'] ?? null;
790 }

Referenced by ILIAS\User\Profile\Fields\Standard\Location\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getLookingForHelp()

ilObjUser::getLookingForHelp ( )

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

1855 : array
1856 {
1857 return $this->profile_data->getAdditionalFieldByIdentifier(
1858 $this->profile_configuration_repository->getByClass(HelpLookedFor::class)->getIdentifier()
1859 ) ?? [];
1860 }

Referenced by ILIAS\User\Profile\Fields\Standard\HelpLookedFor\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getLookingForHelpAsText()

ilObjUser::getLookingForHelpAsText ( )

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

1862 : string
1863 {
1864 return $this->buildTextFromArray($this->getLookingForHelp());
1865 }

◆ getMatriculation()

ilObjUser::getMatriculation ( )

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

723 : string
724 {
725 return $this->profile_data->getMatriculation();
726 }

Referenced by ILIAS\User\Profile\Fields\Standard\Matriculation\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getOfferingHelp()

ilObjUser::getOfferingHelp ( )
Returns
string[]

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

1832 : array
1833 {
1834 return $this->profile_data->getAdditionalFieldByIdentifier(
1835 $this->profile_configuration_repository->getByClass(HelpOffered::class)->getIdentifier()
1836 ) ?? [];
1837 }

Referenced by ILIAS\User\Profile\Fields\Standard\HelpOffered\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getOfferingHelpAsText()

ilObjUser::getOfferingHelpAsText ( )

Get help offering as plain text.

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

1842 : string
1843 {
1844 return $this->buildTextFromArray($this->getOfferingHelp());
1845 }

◆ getOrgUnitsRepresentation()

ilObjUser::getOrgUnitsRepresentation ( )

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

1470 : string
1471 {
1473 }
static lookupOrgUnitsRepresentation(int $a_usr_id)

References ILIAS\Survey\Mode\getId().

Referenced by ILIAS\User\Profile\Fields\Standard\OrganisationalUnits\retrieveValueFromUser().

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

◆ getPasswd()

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

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

910 : string
911 {
912 return $this->passwd;
913 }
string $passwd

Referenced by ILIAS\Authentication\Password\LocalUserPasswordManager\verifyPassword().

+ Here is the caller graph for this function:

◆ getPasswdType()

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

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

918 : string
919 {
920 return $this->passwd_type;
921 }
string $passwd_type

◆ getPasswordAgeInDays()

ilObjUser::getPasswordAgeInDays ( )

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

1200 : int
1201 {
1202 return (int) floor((time() - $this->getLastPasswordChangeTS()) / 86400);
1203 }

◆ getPasswordEncodingType()

ilObjUser::getPasswordEncodingType ( )

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

835 : ?string
836 {
838 }

Referenced by ILIAS\Authentication\Password\LocalUserPasswordManager\verifyPassword().

+ Here is the caller graph for this function:

◆ getPasswordPolicyResetStatus()

ilObjUser::getPasswordPolicyResetStatus ( )

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

933 : bool
934 {
936 }

◆ getPasswordSalt()

ilObjUser::getPasswordSalt ( )

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

845 : ?string
846 {
848 }

Referenced by ILIAS\Authentication\Password\LocalUserPasswordManager\encodePassword(), and ILIAS\Authentication\Password\LocalUserPasswordManager\verifyPassword().

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

1312 : array // Missing array type.
1313 {
1314 $ilDB = $this->db;
1315
1316 if (!ilSession::get('user_pc_clip')) {
1317 return [];
1318 }
1319
1320 $set = $ilDB->queryF('SELECT MAX(insert_time) mtime FROM personal_pc_clipboard ' .
1321 ' WHERE user_id = %s', ['integer'], [$this->getId()]);
1322 $row = $ilDB->fetchAssoc($set);
1323
1324 $set = $ilDB->queryF(
1325 'SELECT * FROM personal_pc_clipboard ' .
1326 ' WHERE user_id = %s AND insert_time = %s ORDER BY order_nr ASC',
1327 ['integer', 'timestamp'],
1328 [$this->getId(), $row['mtime']]
1329 );
1330 $content = [];
1331 while ($row = $ilDB->fetchAssoc($set)) {
1332 $content[] = $row['content'];
1333 }
1334
1335 return $content;
1336 }

References $ilDB, ilSession\get(), and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ getPersonalDataExportFile()

ilObjUser::getPersonalDataExportFile ( )

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

1690 : string
1691 {
1692 $dir = ilExport::_getExportDirectory($this->getId(), 'xml', 'usr', 'personal_data');
1693 if (!is_dir($dir)) {
1694 return '';
1695 }
1696 foreach (ilFileUtils::getDir($dir) as $entry) {
1697 if (is_int(strpos($entry['entry'], '.zip'))) {
1698 return $entry['entry'];
1699 }
1700 }
1701
1702 return '';
1703 }
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
@depricated Get export directory for an repository object
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory

References ilExport\_getExportDirectory(), ilFileUtils\getDir(), and ILIAS\Survey\Mode\getId().

+ Here is the call 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 1479 of file class.ilObjUser.php.

1482 : string {
1483 if (isset(self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic])) {
1484 return self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic];
1485 }
1486
1487 self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic] = self::_getPersonalPicturePath($this->getId(), $a_size, $a_force_pic);
1488
1489 return self::$personal_image_cache[$this->getId()][$a_size][(int) $a_force_pic];
1490 }

References ILIAS\Survey\Mode\getId(), and ILIAS\Repository\int().

Referenced by ilForumAuthorInformation\getUserImagePath().

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

◆ getPhoneHome()

ilObjUser::getPhoneHome ( )

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

693 : string
694 {
695 return $this->profile_data->getPhoneHome();
696 }

Referenced by ILIAS\User\Profile\Fields\Standard\PhoneHome\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getPhoneMobile()

ilObjUser::getPhoneMobile ( )

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

703 : string
704 {
705 return $this->profile_data->getPhoneMobile();
706 }

Referenced by ILIAS\User\Profile\Fields\Standard\PhoneMobile\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getPhoneOffice()

ilObjUser::getPhoneOffice ( )

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

683 : string
684 {
685 return $this->profile_data->getPhoneOffice();
686 }

Referenced by ILIAS\User\Profile\Fields\Standard\PhoneOffice\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getPref()

ilObjUser::getPref ( string  $keyword)

◆ getPrefs()

ilObjUser::getPrefs ( )
Deprecated:
11

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

467 : array
468 {
470 }
array $user_settings

◆ getProfileAsString()

ilObjUser::getProfileAsString ( Language  $language)

Get formatted mail body text of user profile data.

Exceptions
ilDateTimeException

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

1516 : string
1517 {
1518 global $DIC;
1519 $rbacreview = $DIC['rbacreview'];
1520 $profile = $DIC['user']->getProfile();
1521
1522 $language->loadLanguageModule('registration');
1523 $language->loadLanguageModule('crs');
1524
1525 $body = "{$language->txt('login')}: {$this->getLogin()}\n";
1526
1527 if ($this->profile_data->getTitle() !== '') {
1528 $body .= "{$language->txt('title')}: {$this->profile_data->getTitle()}\n";
1529 }
1530 if ($this->getGender() !== '') {
1531 $body .= ($language->txt('gender') . ': ' . $language->txt('gender_' . strtolower($this->getGender())) . "\n");
1532 }
1533 if ($this->getFirstname() !== '') {
1534 $body .= ($language->txt('firstname') . ': ' . $this->getFirstname() . "\n");
1535 }
1536 if ($this->getLastname() !== '') {
1537 $body .= ($language->txt('lastname') . ': ' . $this->getLastname() . "\n");
1538 }
1539 if ($this->getInstitution() !== '') {
1540 $body .= ($language->txt('institution') . ': ' . $this->getInstitution() . "\n");
1541 }
1542 if ($this->getDepartment() !== '') {
1543 $body .= ($language->txt('department') . ': ' . $this->getDepartment() . "\n");
1544 }
1545 if ($this->getStreet() !== '') {
1546 $body .= ($language->txt('street') . ': ' . $this->getStreet() . "\n");
1547 }
1548 if ($this->getCity() !== '') {
1549 $body .= ($language->txt('city') . ': ' . $this->getCity() . "\n");
1550 }
1551 if ($this->getZipcode() !== '') {
1552 $body .= ($language->txt('zipcode') . ': ' . $this->getZipcode() . "\n");
1553 }
1554 if ($this->getCountry() !== '') {
1555 $body .= ($language->txt('country') . ': ' . $this->getCountry() . "\n");
1556 }
1557 if ($this->getPhoneOffice() !== '') {
1558 $body .= ($language->txt('phone_office') . ': ' . $this->getPhoneOffice() . "\n");
1559 }
1560 if ($this->getPhoneHome() !== '') {
1561 $body .= ($language->txt('phone_home') . ': ' . $this->getPhoneHome() . "\n");
1562 }
1563 if ($this->getPhoneMobile() !== '') {
1564 $body .= ($language->txt('phone_mobile') . ': ' . $this->getPhoneMobile() . "\n");
1565 }
1566 if ($this->getFax() !== '') {
1567 $body .= ($language->txt('fax') . ': ' . $this->getFax() . "\n");
1568 }
1569 if ($this->getEmail() !== '') {
1570 $body .= ($language->txt('email') . ': ' . $this->getEmail() . "\n");
1571 }
1572 if ($this->getSecondEmail() !== null
1573 && $this->getSecondEmail() !== '') {
1574 $body .= ($language->txt('second_email') . ': ' . $this->getSecondEmail() . "\n");
1575 }
1576 if ($this->getHobby() !== '') {
1577 $body .= ($language->txt('hobby') . ': ' . $this->getHobby() . "\n");
1578 }
1579 if ($this->getComment() !== '') {
1580 $body .= ($language->txt('referral_comment') . ': ' . $this->getComment() . "\n");
1581 }
1582 if ($this->getMatriculation() !== '') {
1583 $body .= ($language->txt('matriculation') . ': ' . $this->getMatriculation() . "\n");
1584 }
1585 if ($this->getCreateDate() !== '') {
1590
1591 $body .= ($language->txt('create_date') . ': ' . $date . "\n");
1592 }
1593
1594 $gr = [];
1595 foreach ($rbacreview->getGlobalRoles() as $role) {
1596 if ($rbacreview->isAssigned($this->getId(), $role)) {
1597 $gr[] = ilObjRole::_lookupTitle($role);
1598 }
1599 }
1600 if (count($gr)) {
1601 $body .= ($language->txt('reg_role_info') . ': ' . implode(',', $gr) . "\n");
1602 }
1603
1604 // Time limit
1605 if ($this->getTimeLimitUnlimited()) {
1606 $body .= ($language->txt('time_limit') . ': ' . $language->txt('crs_unlimited') . "\n");
1607 } else {
1613 );
1615
1616 $start = new ilDateTime($this->getTimeLimitFrom(), IL_CAL_UNIX);
1617 $end = new ilDateTime($this->getTimeLimitUntil(), IL_CAL_UNIX);
1618
1619 $body .= $language->txt('time_limit') . ': ' .
1620 $language->txt('from') . ' ' .
1621 $start->get(IL_CAL_DATETIME) . ' ';
1622 $body .= $language->txt('to') . ' ' . $end->get(IL_CAL_DATETIME) . "\n";
1623 }
1624
1625 foreach ($profile->getAllUserDefinedFields() as $field) {
1626 $data = $field->retrieveValueFromUser($this);
1627 if ($data !== '') {
1628 $body .= "{$field->getLabel($this->lng)}: {$data}\n";
1629 }
1630 }
1631
1632 return $body;
1633 }
const IL_CAL_UNIX
const IL_CAL_DATETIME
static resetToDefaults()
reset to defaults
static setUseRelativeDates(bool $a_status)
set use relative dates
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
static setLanguage(ilLanguage $a_lng)
@classDescription Date and time handling
getCreateDate()
Get create date in YYYY-MM-DD HH-MM-SS format.
loadLanguageModule(string $a_module)
txt(string $a_topic, string $a_default_lang_fallback_mod="")

References $data, $DIC, ilObject\_lookupTitle(), ilDatePresentation\formatDate(), ilDatePresentation\formatPeriod(), IL_CAL_DATETIME, IL_CAL_UNIX, ILIAS\Language\Language\loadLanguageModule(), ilDatePresentation\resetToDefaults(), ilDatePresentation\setLanguage(), ilDatePresentation\setUseRelativeDates(), and ILIAS\Language\Language\txt().

Referenced by ilAccountMail\send(), and ilECSAppEventListener\sendNotification().

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

◆ getProfileData()

ilObjUser::getProfileData ( )

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

540 : Data
541 {
542 return $this->profile_data;
543 }
Data $profile_data

Referenced by ILIAS\User\Profile\Fields\Custom\Custom\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getProfileIncomplete()

ilObjUser::getProfileIncomplete ( )

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

1150 : bool
1151 {
1152 if ($this->id == ANONYMOUS_USER_ID) {
1153 return false;
1154 }
1156 }

References ANONYMOUS_USER_ID.

◆ getProfileStatusOfUsers()

static ilObjUser::getProfileStatusOfUsers ( array  $a_user_ids)
static

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

2433 : array {
2434 global $DIC;
2435 $ilDB = $DIC->database();
2436
2437 $set = $ilDB->query(
2438 'SELECT * FROM usr_pref ' .
2439 ' WHERE keyword = ' . $ilDB->quote('public_profile', 'text') .
2440 ' AND ' . $ilDB->in('usr_id', $a_user_ids, false, 'integer')
2441 );
2442 $r = [
2443 'global' => [],
2444 'local' => [],
2445 'public' => [],
2446 'not_public' => []
2447 ];
2448 while ($rec = $ilDB->fetchAssoc($set)) {
2449 if ($rec['value'] == 'g') {
2450 $r['global'][] = $rec['usr_id'];
2451 $r['public'][] = $rec['usr_id'];
2452 }
2453 if ($rec['value'] == 'y') {
2454 $r['local'][] = $rec['usr_id'];
2455 $r['public'][] = $rec['usr_id'];
2456 }
2457 }
2458 foreach ($a_user_ids as $id) {
2459 if (!in_array($id, $r['public'])) {
2460 $r['not_public'][] = $id;
2461 }
2462 }
2463
2464 return $r;
2465 }

Referenced by ilInternalLink\searchUsers().

+ Here is the caller graph for this function:

◆ getPublicName()

ilObjUser::getPublicName ( )

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

1649 : string
1650 {
1651 if ($this->hasPublicProfile()) {
1652 return $this->getFirstname() . ' ' . $this->getLastname() . ' (' . $this->getLogin() . ')';
1653 }
1654
1655 return $this->getLogin();
1656 }

Referenced by ilPDMailBlockGUI\getListItemForData().

+ Here is the caller graph for this function:

◆ getSecondEmail()

ilObjUser::getSecondEmail ( )

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

743 : ?string
744 {
745 return $this->profile_data->getSecondEmail();
746 }

Referenced by ILIAS\Mail\UserSettings\IncomingMail\buildTransformation(), and ILIAS\User\Profile\Fields\Standard\SecondEmail\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getSkin()

ilObjUser::getSkin ( )

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

1079 : string
1080 {
1081 return $this->user_settings['skin'];
1082 }

Referenced by ILIAS\Style\System\UserSettings\Style\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getStreet()

ilObjUser::getStreet ( )

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

643 : string
644 {
645 return $this->profile_data->getStreet();
646 }

Referenced by ILIAS\User\Profile\Fields\Standard\Street\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getTimeFormat()

ilObjUser::getTimeFormat ( )

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

420 : string
421 {
422 $format = $this->getPref('time_format');
423 if ($format !== null) {
424 return $format;
425 }
426 return ilCalendarSettings::_getInstance()->getDefaultTimeFormat();
427 }

References ilCalendarSettings\_getInstance().

Referenced by ilIndividualAssessmentDateFormatter\getUserDateFormat().

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

◆ getTimeLimitFrom()

ilObjUser::getTimeLimitFrom ( )

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

1099 : ?int
1100 {
1102 }

Referenced by ilAccountMail\replacePlaceholders(), and ilAccountMail\send().

+ Here is the caller graph for this function:

◆ getTimeLimitOwner()

ilObjUser::getTimeLimitOwner ( )

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

1089 : int
1090 {
1092 }

◆ getTimeLimitUnlimited()

ilObjUser::getTimeLimitUnlimited ( )

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

1119 : bool
1120 {
1122 }

Referenced by ilAccountMail\replacePlaceholders().

+ Here is the caller graph for this function:

◆ getTimeLimitUntil()

ilObjUser::getTimeLimitUntil ( )

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

1109 : ?int
1110 {
1112 }

Referenced by ilECSAppEventListener\extendAccount(), ilAccountMail\replacePlaceholders(), and ilAccountMail\send().

+ Here is the caller graph for this function:

◆ getTimeZone()

ilObjUser::getTimeZone ( )

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

411 : string
412 {
413 $tz = $this->getPref('user_tz');
414 if ($tz !== null) {
415 return $tz;
416 }
417 return ilCalendarSettings::_getInstance()->getDefaultTimeZone();
418 }

References ilCalendarSettings\_getInstance().

+ Here is the call graph for this function:

◆ getUserIdByLogin()

◆ getUserIdsByEmail()

static ilObjUser::getUserIdsByEmail ( string  $a_email)
static

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

2782 : array
2783 {
2784 global $DIC;
2785 $ilDB = $DIC['ilDB'];
2786
2787 $res = $ilDB->queryF(
2788 'SELECT usr_id FROM usr_data ' .
2789 'WHERE email = %s and active = 1',
2790 ['text'],
2791 [$a_email]
2792 );
2793 $ids = [];
2794 while ($row = $ilDB->fetchObject($res)) {
2795 $ids[] = (int) $row->usr_id;
2796 }
2797
2798 return $ids;
2799 }

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

+ Here is the call graph for this function:

◆ getUserIdsByInactivityPeriod()

static ilObjUser::getUserIdsByInactivityPeriod ( int  $periodInDays)
static

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

2249 : array {
2250 global $DIC;
2251 $ilDB = $DIC['ilDB'];
2252
2253 if ($periodInDays < 1) {
2254 throw new ilException('Invalid period given');
2255 }
2256
2257 $date = date('Y-m-d H:i:s', (time() - ($periodInDays * 24 * 60 * 60)));
2258
2259 $query = 'SELECT usr_id FROM usr_data WHERE last_login IS NOT NULL AND last_login < %s';
2260
2261 $ids = [];
2262
2263 $types = ['timestamp'];
2264 $values = [$date];
2265
2266 $res = $ilDB->queryF($query, $types, $values);
2267 while ($row = $ilDB->fetchAssoc($res)) {
2268 $ids[] = (int) $row['usr_id'];
2269 }
2270
2271 return $ids;
2272 }

Referenced by ilCronDeleteInactiveUserAccounts\run().

+ Here is the caller graph for this function:

◆ getUserIdsNeverLoggedIn()

static ilObjUser::getUserIdsNeverLoggedIn ( int  $thresholdInDays)
static

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

2276 : array {
2277 global $DIC;
2278 $ilDB = $DIC['ilDB'];
2279
2280 $date = date('Y-m-d H:i:s', (time() - ($thresholdInDays * 24 * 60 * 60)));
2281
2282 $query = 'SELECT usr_id FROM usr_data WHERE last_login IS NULL AND create_date < %s';
2283
2284 $ids = [];
2285
2286 $types = ['timestamp'];
2287 $values = [$date];
2288
2289 $res = $ilDB->queryF($query, $types, $values);
2290 while ($row = $ilDB->fetchAssoc($res)) {
2291 $ids[] = (int) $row['usr_id'];
2292 }
2293
2294 return $ids;
2295 }

Referenced by ilCronDeleteNeverLoggedInUserAccounts\run().

+ Here is the caller graph for this function:

◆ getUserLoginsByEmail()

static ilObjUser::getUserLoginsByEmail ( string  $a_email)
static

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

2801 : array
2802 {
2803 global $DIC;
2804 $ilDB = $DIC['ilDB'];
2805
2806 $res = $ilDB->queryF(
2807 'SELECT login FROM usr_data ' .
2808 'WHERE email = %s and active = 1',
2809 ['text'],
2810 [$a_email]
2811 );
2812 $ids = [];
2813 while ($row = $ilDB->fetchObject($res)) {
2814 $ids[] = $row->login;
2815 }
2816
2817 return $ids;
2818 }

References $DIC, $ilDB, and $res.

Referenced by ilPasswordAssistanceGUI\submitUsernameAssistanceForm().

+ Here is the caller graph for this function:

◆ getUserSubsetByPreferenceValue()

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

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

2116 : array {
2117 global $DIC;
2118 $ilDB = $DIC['ilDB'];
2119
2120 $users = [];
2121 $set = $ilDB->query(
2122 'SELECT usr_id FROM usr_pref ' .
2123 ' WHERE keyword = ' . $ilDB->quote($a_keyword, 'text') .
2124 ' AND ' . $ilDB->in('usr_id', $a_user_ids, false, 'integer') .
2125 ' AND value = ' . $ilDB->quote($a_val, 'text')
2126 );
2127 while ($rec = $ilDB->fetchAssoc($set)) {
2128 $users[] = $rec['usr_id'];
2129 }
2130 return $users;
2131 }

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

+ Here is the caller graph for this function:

◆ getUTitle()

ilObjUser::getUTitle ( )

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

574 : string
575 {
576 return $this->profile_data->getTitle();
577 }

Referenced by ilCmiXapiUser\getName(), and ILIAS\User\Profile\Fields\Standard\Title\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ getZipcode()

ilObjUser::getZipcode ( )

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

663 : string
664 {
665 return $this->profile_data->getZipcode();
666 }

Referenced by ILIAS\User\Profile\Fields\Standard\ZipCode\retrieveValueFromUser().

+ Here is the caller graph for this function:

◆ hasActiveSession()

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

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

2867 : bool {
2868 global $DIC;
2869 $ilDB = $DIC['ilDB'];
2870
2871 $set = $ilDB->queryf(
2872 '
2873 SELECT COUNT(*) session_count
2874 FROM usr_session WHERE user_id = %s AND expires > %s AND session_id != %s ',
2875 ['integer', 'integer', 'text'],
2876 [$a_user_id, time(), $a_session_id]
2877 );
2878 $row = $ilDB->fetchAssoc($set);
2879 return (bool) $row['session_count'];
2880 }

Referenced by ilAuthFrontend\checkSimultaneousLogins().

+ Here is the caller graph for this function:

◆ hasDeletionFlag()

ilObjUser::hasDeletionFlag ( )

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

1774 : bool
1775 {
1776 return (bool) $this->getPref('delete_flag');
1777 }

◆ hasProfilePicture()

ilObjUser::hasProfilePicture ( )

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

1492 : bool
1493 {
1494 return (new ilUserAvatarResolver($this->getId()))->hasProfilePicture();
1495 }

References ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ hasPublicProfile()

ilObjUser::hasPublicProfile ( )

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

1644 : bool
1645 {
1646 return in_array($this->getPref('public_profile'), ['y', 'g']);
1647 }

Referenced by ilMailFolderGUI\executeTableAction().

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

1720 : void {
1721 $imp = new ilImport();
1722 // bookmarks need to be skipped, importer does not exist anymore
1723 $imp->addSkipImporter('components/ILIAS/Bookmarks');
1724 if (!$a_profile_data) {
1725 $imp->addSkipEntity('components/ILIAS/User', 'usr_profile');
1726 }
1727 if (!$a_settings) {
1728 $imp->addSkipEntity('components/ILIAS/User', 'usr_setting');
1729 }
1730 if (!$a_notes) {
1731 $imp->addSkipEntity('components/ILIAS/Notes', 'user_notes');
1732 }
1733 if (!$a_calendar) {
1734 $imp->addSkipEntity('components/ILIAS/Calendar', 'calendar');
1735 }
1736 $imp->importEntity(
1737 $a_file['tmp_name'],
1738 $a_file['name'],
1739 'usr',
1740 'components/ILIAS/User'
1741 );
1742 }
Import class.

◆ isAnonymous()

ilObjUser::isAnonymous ( )

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

1754 : bool
1755 {
1756 return self::_isAnonymous($this->getId());
1757 }
static _isAnonymous(int $usr_id)

References ILIAS\Survey\Mode\getId().

Referenced by ilUsersGalleryGUI\getActionsSection(), ilMailGlobalServices\getNewMailsData(), ilTutorialSupportBlockGUI\isUserValid(), and ilADNNotification\isVisibleToUserBasedOnLanguage().

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

◆ isPasswordChangeDemanded()

ilObjUser::isPasswordChangeDemanded ( )

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

1158 : bool
1159 {
1160 if ($this->id === ANONYMOUS_USER_ID) {
1161 return false;
1162 }
1163
1164 if ($this->id === SYSTEM_USER_ID) {
1165 if (LocalUserPasswordManager::getInstance()->verifyPassword($this, base64_decode('aG9tZXI='))
1167 ) {
1168 return true;
1169 }
1170 return false;
1171 }
1172
1174 && ($this->getPasswordPolicyResetStatus()
1175 || ilSecuritySettings::_getInstance()->isPasswordChangeOnFirstLoginEnabled()
1176 && $this->getLastPasswordChangeTS() === 0
1177 && $this->is_self_registered === false);
1178 }
static _needsExternalAccountByAuthMode($a_auth_mode)
Check if chosen auth mode needs an external account entry.
getAuthMode(bool $a_auth_key=false)
getPasswordPolicyResetStatus()
static _getInstance()
Get instance of ilSecuritySettings.
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26

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

Referenced by ILIAS\Authentication\Password\LocalUserPasswordManager\allowPasswordChange().

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

◆ isPasswordExpired()

ilObjUser::isPasswordExpired ( )

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

1180 : bool
1181 {
1182 if ($this->id === ANONYMOUS_USER_ID
1183 || $this->getLastPasswordChangeTS() === 0) {
1184 return false;
1185 }
1186
1187 $max_pass_age_in_seconds = ilSecuritySettings::_getInstance()->getPasswordMaxAge() * 86400;
1188 if ($max_pass_age_in_seconds === 0) {
1189 return false;
1190 }
1191
1192 if (time() - $this->getLastPasswordChangeTS() > $max_pass_age_in_seconds
1194 return true;
1195 }
1196
1197 return false;
1198 }

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

Referenced by ILIAS\Authentication\Password\LocalUserPasswordManager\allowPasswordChange().

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

◆ isSelfRegistered()

ilObjUser::isSelfRegistered ( )

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

1784 : bool
1785 {
1787 }

◆ lookupMatriculation()

static ilObjUser::lookupMatriculation ( int  $a_usr_id)
static

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

2391 : string
2392 {
2393 global $DIC;
2394 $ilDB = $DIC['ilDB'];
2395
2396 $query = 'SELECT matriculation FROM usr_data ' .
2397 'WHERE usr_id = ' . $ilDB->quote($a_usr_id);
2398 $res = $ilDB->query($query);
2399 $row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT);
2400 return $row->matriculation ?: '';
2401 }

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

Referenced by ilObjCourseGrouping\_checkGroupingDependencies().

+ Here is the caller graph for this function:

◆ lookupOrgUnitsRepresentation()

static ilObjUser::lookupOrgUnitsRepresentation ( int  $a_usr_id)
static

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

3067 : string {
3068 return ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_usr_id);
3069 }

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

+ Here is the caller graph for this function:

◆ prepareAndRetrievePasswordForStorage()

ilObjUser::prepareAndRetrievePasswordForStorage ( )
private

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

273 : string
274 {
275 if ($this->passwd_type === self::PASSWD_PLAIN
276 && $this->passwd !== '') {
277 LocalUserPasswordManager::getInstance()->encodePassword($this, $this->passwd);
278 }
279
280 return $this->passwd;
281 }

References $passwd.

Referenced by buildSystemInformationArrayForDB().

+ Here is the caller graph for this function:

◆ read()

ilObjUser::read ( )
Exceptions
ilObjectNotFoundException
ilObjectTypeMismatchException
ilSystemStyleException

Reimplemented from ilObject.

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

144 : void
145 {
146 $this->profile_data = $this->profile_data_repository->getSingle($this->id);
147 $this->setFullname();
148 $this->assignSystemInformationFromDB($this->profile_data->getSystemInformation());
149
150 $this->readSettings();
151
152 parent::read();
153 }
assignSystemInformationFromDB(array $data)

References assignSystemInformationFromDB(), readSettings(), and setFullname().

Referenced by __construct(), and update().

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

◆ readSettings()

ilObjUser::readSettings ( )
private

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

472 : void
473 {
474 $this->user_settings = $this->settings_data_repository->getFor($this->id);
475 if (!isset($this->user_settings['style'])
476 || $this->user_settings['style'] === ''
477 || !ilStyleDefinition::styleExists($this->user_settings['style'])
478 || !ilStyleDefinition::skinExists($this->user_settings['skin'])
479 && ilStyleDefinition::styleExistsForSkinId($this->user_settings['skin'], $this->user_settings['style'])) {
480 $this->user_settings['skin'] = $this->ilias->ini->readVariable('layout', 'skin');
481 $this->user_settings['style'] = $this->ilias->ini->readVariable('layout', 'style');
482 }
483 }
static skinExists(string $skin_id, ?ilSystemStyleConfig $system_style_config=null)
Check whether a skin exists.
static styleExists(string $style_id)
static styleExistsForSkinId(string $skin_id, string $style_id)

References ilStyleDefinition\skinExists(), ilStyleDefinition\styleExists(), and ilStyleDefinition\styleExistsForSkinId().

Referenced by read().

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

◆ refreshLogin()

ilObjUser::refreshLogin ( )

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

969 : void
970 {
971 $this->last_login = $this->db->now();
972
973 $old_first_login = $this->first_login;
974 if ($old_first_login === '') {
975 $this->first_login = $this->db->now();
976 $this->app_event_handler->raise(
977 'components/ILIAS/User',
978 'firstLogin',
979 ['user_obj' => $this]
980 );
981 }
982 }

◆ removeDeletionFlag()

ilObjUser::removeDeletionFlag ( )

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

1769 : void
1770 {
1771 $this->writePref('delete_flag', false);
1772 }

◆ removeObjectFromClipboard()

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

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

1460 : void {
1461 $ilDB = $this->db;
1462
1463 $q = 'DELETE FROM personal_clipboard WHERE ' .
1464 'item_id = ' . $ilDB->quote($a_item_id, 'integer') .
1465 ' AND type = ' . $ilDB->quote($a_type, 'text') . ' ' .
1466 ' AND user_id = ' . $ilDB->quote($this->getId(), 'integer');
1467 $ilDB->manipulate($q);
1468 }

◆ removeUserPicture()

ilObjUser::removeUserPicture ( )

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

1502 : void
1503 {
1504 if ($this->getAvatarRid() !== null) {
1505 $this->irss->manage()->remove($this->getAvatarRid(), new ilUserProfilePictureStakeholder());
1506 }
1507
1508 $this->profile_data = $this->profile_data->withAvatarRid(null);
1509 $this->update();
1510 }

Referenced by ILIAS\User\Profile\Fields\Standard\Avatar\uploadUserPicture().

+ Here is the caller graph for this function:

◆ resetLastPasswordChange()

ilObjUser::resetLastPasswordChange ( )

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

1210 : void
1211 {
1212 $this->last_password_change_ts = 0;
1213 }

◆ resetOwner()

ilObjUser::resetOwner ( )

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

1658 : void
1659 {
1660 $ilDB = $this->db;
1661
1662 $query = 'UPDATE object_data SET owner = 0 ' .
1663 'WHERE owner = ' . $ilDB->quote($this->getId(), 'integer');
1664 $ilDB->query($query);
1665 }

References $ilDB, and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ resetPassword()

ilObjUser::resetPassword ( string  $new_raw_password)

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

291 : bool
292 {
293 LocalUserPasswordManager::getInstance()->encodePassword($this, $new_raw_password);
294 $this->profile_data_repository->storePasswordFor(
295 $this->id,
296 $this->passwd,
297 $this->password_encoding_type,
298 $this->password_salt
299 );
300 return true;
301 }

Referenced by ILIAS\Authentication\Password\LocalUserPasswordManager\verifyPassword().

+ Here is the caller graph for this function:

◆ retrieveAgreeDateForStorage()

ilObjUser::retrieveAgreeDateForStorage ( )
private

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

283 : ?string
284 {
285 if (is_string($this->agree_date && strtotime($this->agree_date) === false)) {
286 return null;
287 }
288 return $this->agree_date;
289 }

References $agree_date.

Referenced by buildSystemInformationArrayForDB().

+ Here is the caller graph for this function:

◆ saveAsNew()

ilObjUser::saveAsNew ( )

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

155 : void
156 {
157 $this->inactivation_date = null;
158 if ($this->active === 0) {
159 $this->inactivation_date = date('Y-m-d H:i:s');
160 }
161
162 $system_information = $this->buildSystemInformationArrayForDB();
163 $system_information['create_date'] = $this->data_factory->clock()->utc()->now()
164 ->format(self::DATABASE_DATE_FORMAT);
165
166 $this->profile_data = $this->profile_data->withId($this->id);
167 $this->profile_data_repository->store(
168 $this->profile_data->withSystemInformation($this->buildSystemInformationArrayForDB())
169 );
170
171 // CREATE ENTRIES FOR MAIL BOX
172 $mbox = new ilMailbox($this->id);
173 $mbox->createDefaultFolder();
174
175 $mail_options = new ilMailOptions($this->id);
176 $mail_options->createMailOptionsEntry();
177
178 $this->app_event_handler->raise(
179 'components/ILIAS/User',
180 'afterCreate',
181 ['user_obj' => $this]
182 );
183 }
buildSystemInformationArrayForDB()

References buildSystemInformationArrayForDB().

+ Here is the call graph for this function:

◆ sendPersonalDataFile()

ilObjUser::sendPersonalDataFile ( )

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

1705 : void
1706 {
1707 $file = ilExport::_getExportDirectory($this->getId(), 'xml', 'usr', 'personal_data') .
1708 '/' . $this->getPersonalDataExportFile();
1709 if (is_file($file)) {
1711 }
1712 }
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)

References ilExport\_getExportDirectory(), ilFileDelivery\deliverFileLegacy(), and ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ setActive()

ilObjUser::setActive ( bool  $active,
int  $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 1052 of file class.ilObjUser.php.

1055 : void {
1056 $this->setOwner($owner);
1057
1058 $current_active = $this->active;
1059 if ($active) {
1060 $this->active = 1;
1061 $this->setApproveDate(date('Y-m-d H:i:s'));
1062 $this->setInactivationDate(null);
1063 return;
1064 }
1065
1066 $this->active = 0;
1067 $this->setApproveDate(null);
1068
1069 if ($this->getId() > 0 && $current_active !== $active) {
1071 }
1072 }
setInactivationDate(?string $inactivation_date)
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)

Referenced by ILIAS\Registration\DualOptIn\Service\DualOptInServiceImpl\activateUser(), shibUser\create(), shibUser\createFields(), and ilStartUpGUI\processCode().

+ Here is the caller graph for this function:

◆ setAgreeDate()

ilObjUser::setAgreeDate ( ?string  $date)

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

1043 : void
1044 {
1045 $this->agree_date = $date;
1046 }

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

1029 : void
1030 {
1031 $this->approve_date = $a_str;
1032 }

◆ setAuthMode()

ilObjUser::setAuthMode ( ?string  $a_str)

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

1215 : void
1216 {
1217 $this->auth_mode = $a_str;
1218 }

◆ setAvatarRid()

ilObjUser::setAvatarRid ( ?ResourceIdentification  $avatar_rid)

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

809 : void
810 {
811 $this->profile_data = $this->profile_data->withAvatarRid($avatar_rid);
812 }

◆ setBirthday()

ilObjUser::setBirthday ( ?string  $birthday)

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

601 : void
602 {
603 if ($birthday === null || $birthday === '') {
604 $this->profile_data = $this->profile_data->withBirthday(null);
605 return;
606 }
607
608 $this->profile_data = $this->profile_data->withBirthday(
609 new \DateTimeImmutable($birthday, new DateTimeZone('UTC'))
610 );
611 }

◆ setCity()

ilObjUser::setCity ( string  $city)

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

648 : void
649 {
650 $this->profile_data = $this->profile_data->withCity($city);
651 }

◆ setClientIP()

ilObjUser::setClientIP ( string  $a_str)

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

814 : void
815 {
816 $this->client_ip = $a_str;
817 }

◆ setComment()

ilObjUser::setComment ( string  $referral_comment)

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

758 : void
759 {
760 $this->profile_data = $this->profile_data->withReferralComment($referral_comment);
761 }

◆ setCountry()

ilObjUser::setCountry ( string  $country)

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

668 : void
669 {
670 $this->profile_data = $this->profile_data->withCountry($country);
671 }

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

+ Here is the caller graph for this function:

◆ setCurrentLanguage()

ilObjUser::setCurrentLanguage ( string  $language)

Set current language.

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

954 : void
955 {
956 ilSession::set('lang', $language);
957 }

References ilSession\set().

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

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

◆ setDepartment()

ilObjUser::setDepartment ( string  $department)

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

628 : void
629 {
630 $this->profile_data = $this->profile_data->withDepartment($department);
631 }

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

+ Here is the caller graph for this function:

◆ setEmail()

ilObjUser::setEmail ( string  $email)

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

728 : void
729 {
730 $this->profile_data = $this->profile_data->withEmail($email);
731 }

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

+ Here is the caller graph for this function:

◆ setExternalAccount()

ilObjUser::setExternalAccount ( string  $a_str)

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

1228 : void
1229 {
1230 $this->ext_account = $a_str;
1231 }

Referenced by shibUser\createFields().

+ Here is the caller graph for this function:

◆ setFax()

ilObjUser::setFax ( string  $fax)

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

708 : void
709 {
710 $this->profile_data = $this->profile_data->withFax($fax);
711 }

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

+ Here is the caller graph for this function:

◆ setFeedPass()

ilObjUser::setFeedPass ( string  $a_password)

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

1637 : void {
1638 $this->writePref(
1639 'priv_feed_pass',
1640 ($a_password == '') ? '' : md5($a_password)
1641 );
1642 }

◆ setFirstLogin()

ilObjUser::setFirstLogin ( string  $date)

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

984 : void
985 {
986 $this->first_login = $date;
987 }

◆ setFirstname()

ilObjUser::setFirstname ( string  $firstname)

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

579 : void
580 {
581 $this->profile_data = $this->profile_data->withFirstname($firstname);
582 $this->setFullname();
583 }

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

+ Here is the caller graph for this function:

◆ setFullname()

ilObjUser::setFullname ( )

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

855 : void
856 {
857 $title = $this->profile_data->getTitle() !== '' ? "{$this->profile_data->getTitle()} " : '';
858 $this->fullname = "{$title}{$this->profile_data->getFirstname()} {$this->profile_data->getLastname()}";
859 }
string $title

Referenced by read().

+ Here is the caller graph for this function:

◆ setGender()

ilObjUser::setGender ( string  $gender_string)

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

555 : void
556 {
557 $this->profile_data = $this->profile_data->withGender(Genders::tryFrom($gender_string));
558 }

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

+ Here is the caller graph for this function:

◆ setGeneralInterests()

ilObjUser::setGeneralInterests ( ?array  $value = null)
Parameters
array<string>|null$value

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

1792 : void
1793 {
1794 $this->profile_data = $this->profile_data->withAdditionalFieldByIdentifier(
1795 $this->profile_configuration_repository->getByClass(Interests::class)->getIdentifier(),
1796 $value ?? []
1797 );
1798 }

◆ setHobby()

ilObjUser::setHobby ( string  $hobby)

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

748 : void
749 {
750 $this->profile_data = $this->profile_data->withHobby($hobby);
751 }

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

+ Here is the caller graph for this function:

◆ setInactivationDate()

ilObjUser::setInactivationDate ( ?string  $inactivation_date)

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

1744 : void
1745 {
1746 $this->inactivation_date = $inactivation_date;
1747 }

◆ setInstitution()

ilObjUser::setInstitution ( string  $instituion)

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

618 : void
619 {
620 $this->profile_data = $this->profile_data->withInstitution($instituion);
621 }

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

+ Here is the caller graph for this function:

◆ setIsSelfRegistered()

ilObjUser::setIsSelfRegistered ( bool  $status)

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

1779 : void
1780 {
1781 $this->is_self_registered = $status;
1782 }

◆ setLanguage()

ilObjUser::setLanguage ( string  $language)

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

824 : void
825 {
826 $this->setPref('language', $language);
827 ilSession::clear('lang');
828 }
setPref(string $a_keyword, ?string $a_value)
static clear(string $a_var)

References ilSession\clear().

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

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

959 : void
960 {
961 $this->last_login = $a_str;
962 }

◆ setLastname()

ilObjUser::setLastname ( string  $lastname)

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

590 : void
591 {
592 $this->profile_data = $this->profile_data->withLastname($lastname);
593 $this->setFullname();
594 }

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

+ Here is the caller graph for this function:

◆ setLastPasswordChangeToNow()

ilObjUser::setLastPasswordChangeToNow ( )

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

1205 : void
1206 {
1207 $this->last_password_change_ts = time();
1208 }

Referenced by shibUser\buildInstance().

+ Here is the caller graph for this function:

◆ setLastPasswordChangeTS()

ilObjUser::setLastPasswordChangeTS ( int  $a_last_password_change_ts)

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

923 : void
924 {
925 $this->last_password_change_ts = $a_last_password_change_ts;
926 }

Referenced by ILIAS\Registration\DualOptIn\Service\DualOptInServiceImpl\activateUser().

+ Here is the caller graph for this function:

◆ setLastProfilePrompt()

ilObjUser::setLastProfilePrompt ( string  $date)

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

994 : void
995 {
996 $this->last_profile_prompt = $date;
997 }

◆ setLastUpdate()

ilObjUser::setLastUpdate ( string  $date)

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

1004 : void
1005 {
1006 $this->last_update = $date;
1007 }

◆ setLatitude()

ilObjUser::setLatitude ( ?string  $latitude)

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

768 : void
769 {
770 $coordinates = $this->profile_data->getGeoCoordinates();
771 $coordinates['latitude'] = $latitude;
772 $this->profile_data = $this->profile_data->withGeoCoordinates($coordinates);
773 }

Referenced by ILIAS\User\Profile\Fields\Standard\Location\addValueToUserObject().

+ Here is the caller graph for this function:

◆ setLocationZoom()

ilObjUser::setLocationZoom ( ?int  $zoom)

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

792 : void
793 {
794 $coordinates = $this->profile_data->getGeoCoordinates();
795 $coordinates['zoom'] = $zoom;
796 $this->profile_data = $this->profile_data->withGeoCoordinates($coordinates);
797 }

◆ setLogin()

ilObjUser::setLogin ( string  $login)

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

545 : void
546 {
547 $this->profile_data = $this->profile_data->withAlias($login);
548 }

Referenced by shibUser\createFields().

+ Here is the caller graph for this function:

◆ setLoginAttempts()

ilObjUser::setLoginAttempts ( int  $a_login_attempts)

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

1124 : void
1125 {
1126 $this->login_attempts = $a_login_attempts;
1127 }

◆ setLongitude()

ilObjUser::setLongitude ( ?string  $longitude)

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

780 : void
781 {
782 $coordinates = $this->profile_data->getGeoCoordinates();
783 $coordinates['longitude'] = $longitude;
784 $this->profile_data = $this->profile_data->withGeoCoordinates($coordinates);
785 }

◆ setLookingForHelp()

ilObjUser::setLookingForHelp ( ?array  $value = null)

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

1847 : void
1848 {
1849 $this->profile_data = $this->profile_data->withAdditionalFieldByIdentifier(
1850 $this->profile_configuration_repository->getByClass(HelpLookedFor::class)->getIdentifier(),
1851 $value ?? []
1852 );
1853 }

◆ setMatriculation()

ilObjUser::setMatriculation ( string  $matriculation)

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

718 : void
719 {
720 $this->profile_data = $this->profile_data->withMatriculation($matriculation);
721 }

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

+ Here is the caller graph for this function:

◆ setOfferingHelp()

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

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

1821 : void
1822 {
1823 $this->profile_data = $this->profile_data->withAdditionalFieldByIdentifier(
1824 $this->profile_configuration_repository->getByClass(HelpOffered::class)->getIdentifier(),
1825 $value ?? []
1826 );
1827 }

◆ setPasswd()

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

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

902 : void {
903 $this->passwd = $a_str;
904 $this->passwd_type = $a_type;
905 }

Referenced by ILIAS\Registration\DualOptIn\Service\DualOptInServiceImpl\activateUser(), assignSystemInformationFromDB(), shibUser\createFields(), and ILIAS\Authentication\Password\LocalUserPasswordManager\encodePassword().

+ Here is the caller graph for this function:

◆ setPasswordEncodingType()

ilObjUser::setPasswordEncodingType ( ?string  $password_encryption_type)

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

840 : void
841 {
842 $this->password_encoding_type = $password_encryption_type;
843 }

Referenced by ILIAS\Authentication\Password\LocalUserPasswordManager\encodePassword().

+ Here is the caller graph for this function:

◆ setPasswordPolicyResetStatus()

ilObjUser::setPasswordPolicyResetStatus ( bool  $status)

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

938 : void
939 {
940 $this->passwd_policy_reset = $status;
941 }

◆ setPasswordSalt()

ilObjUser::setPasswordSalt ( ?string  $password_salt)

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

850 : void
851 {
852 $this->password_salt = $password_salt;
853 }

Referenced by ILIAS\Authentication\Password\LocalUserPasswordManager\encodePassword().

+ Here is the caller graph for this function:

◆ setPhoneHome()

ilObjUser::setPhoneHome ( string  $phone)

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

688 : void
689 {
690 $this->profile_data = $this->profile_data->withPhoneHome($phone);
691 }

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

+ Here is the caller graph for this function:

◆ setPhoneMobile()

ilObjUser::setPhoneMobile ( string  $phone)

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

698 : void
699 {
700 $this->profile_data = $this->profile_data->withPhoneMobile($phone);
701 }

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

+ Here is the caller graph for this function:

◆ setPhoneOffice()

ilObjUser::setPhoneOffice ( string  $phone)

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

678 : void
679 {
680 $this->profile_data = $this->profile_data->withPhoneOffice($phone);
681 }

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

+ Here is the caller graph for this function:

◆ setPref()

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

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

452 : void
453 {
454 if ($a_keyword !== '') {
455 $this->user_settings[$a_keyword] = $a_value;
456 }
457 }

Referenced by ILIAS\Help\UserSettings\Help\persistUserInput(), ILIAS\Style\System\UserSettings\Style\persistUserInput(), ILIAS\User\Profile\ChecklistStatus\setStepSucessOnUser(), and ilMembershipNotifications\toggleUser().

+ Here is the caller graph for this function:

◆ setProfileIncomplete()

ilObjUser::setProfileIncomplete ( bool  $a_prof_inc)

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

1145 : void
1146 {
1147 $this->profile_incomplete = $a_prof_inc;
1148 }

◆ setSecondEmail()

ilObjUser::setSecondEmail ( ?string  $email)

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

738 : void
739 {
740 $this->profile_data = $this->profile_data->withSecondEmail($email);
741 }

◆ setStreet()

ilObjUser::setStreet ( string  $street)

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

638 : void
639 {
640 $this->profile_data = $this->profile_data->withStreet($street);
641 }

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

+ Here is the caller graph for this function:

◆ setTimeLimitFrom()

ilObjUser::setTimeLimitFrom ( ?int  $a_from)

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

1094 : void
1095 {
1096 $this->time_limit_from = $a_from;
1097 }

Referenced by shibUser\createFields().

+ Here is the caller graph for this function:

◆ setTimeLimitOwner()

ilObjUser::setTimeLimitOwner ( int  $a_owner)

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

1084 : void
1085 {
1086 $this->time_limit_owner = $a_owner;
1087 }

Referenced by ilObjUserGUI\addValuesFromSystemInformationToUserSection().

+ Here is the caller graph for this function:

◆ setTimeLimitUnlimited()

ilObjUser::setTimeLimitUnlimited ( bool  $unlimited)

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

1114 : void
1115 {
1116 $this->time_limit_unlimited = $unlimited;
1117 }

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

+ Here is the caller graph for this function:

◆ setTimeLimitUntil()

ilObjUser::setTimeLimitUntil ( ?int  $a_until)

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

1104 : void
1105 {
1106 $this->time_limit_until = $a_until;
1107 }

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

+ Here is the caller graph for this function:

◆ setUTitle()

ilObjUser::setUTitle ( string  $user_title)

This sets the USER's title NOT the OBJECT's title!

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

568 : void
569 {
570 $this->setFullname();
571 $this->profile_data = $this->profile_data->withTitle($user_title);
572 }

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

+ Here is the caller graph for this function:

◆ setZipcode()

ilObjUser::setZipcode ( string  $zipcode)

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

658 : void
659 {
660 $this->profile_data = $this->profile_data->withZipcode($zipcode);
661 }

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

+ Here is the caller graph for this function:

◆ update()

ilObjUser::update ( )

Reimplemented from ilObject.

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

185 : bool
186 {
187 $this->profile_data_repository->store(
188 $this->profile_data->withSystemInformation($this->buildSystemInformationArrayForDB())
189 );
190
191 $this->writePrefs();
192
193 parent::update();
194 $this->updateOwner();
195
196 $this->read();
197
198 $this->app_event_handler->raise(
199 'components/ILIAS/User',
200 'afterUpdate',
201 ['user_obj' => $this]
202 );
203
204 return true;
205 }
updateOwner()
update owner of object in db

References read(), ilObject\updateOwner(), and writePrefs().

Referenced by ILIAS\Registration\DualOptIn\Service\DualOptInServiceImpl\activateUser(), ilECSAppEventListener\extendAccount(), and ilStartUpGUI\processCode().

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

◆ updateLastVisited()

ilObjUser::updateLastVisited ( array  $last_visited)

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

1019 : void
1020 {
1021 $this->last_visited = $last_visited;
1022 $this->profile_data_repository->storeLastVisitedFor($this->id, $last_visited);
1023 }

◆ updateLogin()

ilObjUser::updateLogin ( string  $login,
Context  $context 
)

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

324 : bool
325 {
326 if ($login === '' || $login === $this->profile_data->getAlias()) {
327 return false;
328 }
329
330 $last_history_entry = $this->getLastHistoryData();
331
332 if (!$context->isFieldChangeable(
333 $this->profile_configuration_repository->getByClass(Alias::class),
334 $this
335 )) {
336 throw new ilUserException($this->lng->txt('permission_denied'));
337 }
338
339 // throw exception if the desired loginame is already in history and it is not allowed to reuse it
340 if ($this->ilias_settings->get('reuse_of_loginnames') === '0'
341 && self::_doesLoginnameExistInHistory($login)) {
342 throw new ilUserException($this->lng->txt('loginname_already_exists'));
343 }
344
345 if ((int) $this->ilias_settings->get('loginname_change_blocking_time') > 0
346 && is_array($last_history_entry)
347 && $last_history_entry[1] + (int) $this->ilias_settings->get('loginname_change_blocking_time') > time()) {
348 throw new ilUserException(
349 sprintf(
350 $this->lng->txt('changing_loginname_not_possible_info'),
352 new ilDateTime($last_history_entry[1], IL_CAL_UNIX)
353 ),
355 new ilDateTime(($last_history_entry[1] + (int) $this->ilias_settings->get('loginname_change_blocking_time')), IL_CAL_UNIX)
356 )
357 )
358 );
359 }
360
361 if ($this->ilias_settings->get('create_history_loginname') === '1') {
362 $this->writeHistory($this->profile_data->getAlias());
363 }
364
365 $this->profile_data = $this->profile_data->withAlias($login);
366 $this->profile_data_repository->storeLoginFor($this->id, $this->profile_data->getAlias());
367
368 return true;
369 }
writeHistory(string $login)

References ilDatePresentation\formatDate(), getLastHistoryData(), IL_CAL_UNIX, ILIAS\Repository\lng(), and writeHistory().

+ Here is the call graph for this function:

◆ uploadPersonalPicture()

ilObjUser::uploadPersonalPicture ( string  $tmp_file)

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

1870 : void {
1871 $stakeholder = new ilUserProfilePictureStakeholder();
1872 $stakeholder->setOwner($this->getId());
1873 $stream = Streams::ofResource(fopen($tmp_file, 'rb'));
1874
1875 if ($this->getAvatarRid() !== null) {
1876 // append profile picture
1877 $this->irss->manage()->replaceWithStream(
1878 $this->getAvatarRid(),
1879 $stream,
1880 $stakeholder
1881 );
1882 } else {
1883 // new profile picture
1884 $rid = $this->irss->manage()->stream(
1885 $stream,
1886 $stakeholder
1887 );
1888 }
1889
1890 $this->setAvatarRid($rid);
1891 $this->update();
1892 }
setAvatarRid(?ResourceIdentification $avatar_rid)

◆ userExists()

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

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

2346 : bool {
2347 global $DIC;
2348 $ilDB = $DIC['ilDB'];
2349
2350 $query = 'SELECT count(*) num FROM object_data od ' .
2351 'JOIN usr_data ud ON obj_id = usr_id ' .
2352 'WHERE ' . $ilDB->in('obj_id', $a_usr_ids, false, 'integer') . ' ';
2353 $res = $ilDB->query($query);
2354 $num_rows = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)->num;
2355 return $num_rows == count($a_usr_ids);
2356 }

Referenced by ilObject\_lookupOwnerName(), ilTrQuery\filterOutUsersWithoutData(), ilExerciseManagementCollectFilesJob\getAssignmentMembersIds(), ilObjForumAccess\getCachedUserInstance(), and ilIndividualAssessmentMembersTableGUI\getGradedByInformation().

+ Here is the caller graph for this function:

◆ withProfileData()

ilObjUser::withProfileData ( Data  $profile_data)

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

533 : self
534 {
535 $clone = clone $this;
536 $clone->profile_data = $profile_data;
537 return $clone;
538 }

◆ writeHistory()

ilObjUser::writeHistory ( string  $login)
private

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

371 : void
372 {
373 $res = $this->db->queryF(
374 'SELECT * FROM loginname_history WHERE usr_id = %s AND login = %s AND history_date = %s',
375 ['integer', 'text', 'integer'],
376 [$this->id, $login, time()]
377 );
378
379 if ($this->db->numRows($res) == 0) {
380 $this->db->manipulateF(
381 '
382 INSERT INTO loginname_history
383 (usr_id, login, history_date)
384 VALUES (%s, %s, %s)',
385 ['integer', 'text', 'integer'],
386 [$this->id, $login, time()]
387 );
388 }
389 }

References $res.

Referenced by updateLogin().

+ Here is the caller graph for this function:

◆ writePref()

ilObjUser::writePref ( string  $key,
string  $value 
)

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

394 : void {
395 $this->settings_data_repository->storeSingleFor($this->id, $key, $value);
396 $this->setPref($key, $value);
397 }

Referenced by ilPDNotesGUI\changeRelatedObject(), ilObjSurveyQuestionPoolGUI\createQuestionObject(), and ilPageEditorGUI\setMediaMode().

+ Here is the caller graph for this function:

◆ writePrefs()

ilObjUser::writePrefs ( )

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

405 : void
406 {
407 $this->settings_data_repository->deleteFor($this->id);
408 $this->settings_data_repository->storeFor($this->id, $this->user_settings);
409 }

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

+ Here is the caller graph for this function:

Field Documentation

◆ $active

int ilObjUser::$active = 0
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $agree_date

string ilObjUser::$agree_date = null
private

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

Referenced by retrieveAgreeDateForStorage().

◆ $approve_date

string ilObjUser::$approve_date = null
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $auth_mode

string ilObjUser::$auth_mode = null
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $auth_session

ilAuthSession ilObjUser::$auth_session
private

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

◆ $client_ip

string ilObjUser::$client_ip = ''
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $cron_delete_user_reminder_mail

ilCronDeleteInactiveUserReminderMail ilObjUser::$cron_delete_user_reminder_mail
private

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

◆ $ctrl

ilCtrl ilObjUser::$ctrl
private

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

◆ $data_factory

DataFactory ilObjUser::$data_factory
private

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

◆ $delivery

StreamDelivery ilObjUser::$delivery
private

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

◆ $ext_account

string ilObjUser::$ext_account = ''
private

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

◆ $first_login

string ilObjUser::$first_login = ''
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $fullname

string ilObjUser::$fullname
private

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

◆ $ilias_settings

ilSetting ilObjUser::$ilias_settings
private

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

◆ $inactivation_date

string ilObjUser::$inactivation_date = null
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $irss

Services ilObjUser::$irss
private

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

◆ $is_self_registered

bool ilObjUser::$is_self_registered = false
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $last_login

string ilObjUser::$last_login = ''
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $last_password_change_ts

int ilObjUser::$last_password_change_ts = 0
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $last_profile_prompt

string ilObjUser::$last_profile_prompt = ''
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $last_visited

array ilObjUser::$last_visited = []
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $login_attempts

int ilObjUser::$login_attempts = 0
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $passwd

string ilObjUser::$passwd = ''
private

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

Referenced by prepareAndRetrievePasswordForStorage().

◆ $passwd_policy_reset

bool ilObjUser::$passwd_policy_reset = false
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $passwd_type

string ilObjUser::$passwd_type = ''
private

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

◆ $password_encoding_type

string ilObjUser::$password_encoding_type = null
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $password_salt

string ilObjUser::$password_salt = null
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $personal_image_cache

array ilObjUser::$personal_image_cache = []
staticprivate

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

◆ $profile_configuration_repository

ProfileConfigurationRepository ilObjUser::$profile_configuration_repository
private

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

◆ $profile_data

Data ilObjUser::$profile_data
private

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

◆ $profile_data_repository

ProfileDataRepository ilObjUser::$profile_data_repository
private

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

◆ $profile_incomplete

bool ilObjUser::$profile_incomplete = false
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $settings_data_repository

SettingsDataRepository ilObjUser::$settings_data_repository
private

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

◆ $time_limit_from

int ilObjUser::$time_limit_from = null
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $time_limit_owner

int ilObjUser::$time_limit_owner = 7
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $time_limit_unlimited

bool ilObjUser::$time_limit_unlimited = false
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $time_limit_until

int ilObjUser::$time_limit_until = null
private

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

Referenced by buildSystemInformationArrayForDB().

◆ $user_settings

array ilObjUser::$user_settings = []
private

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

◆ DATABASE_DATE_FORMAT

const ilObjUser::DATABASE_DATE_FORMAT = 'Y-m-d H:i:s'

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

◆ PASSWD_CRYPTED

◆ PASSWD_PLAIN


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