ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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 2721 of file class.ilObjUser.php.

2725 : ?string {
2726 $db = $GLOBALS['DIC']->database();
2727 $settings = $GLOBALS['DIC']->settings();
2728
2729 // Check directly with auth_mode
2730 $r = $db->queryF(
2731 'SELECT * FROM usr_data WHERE ' .
2732 ' ext_account = %s AND auth_mode = %s',
2733 ['text', 'text'],
2734 [$a_account, $a_auth]
2735 );
2736 if ($usr = $db->fetchAssoc($r)) {
2737 return $usr['login'];
2738 }
2739
2740 if (!$tryFallback) {
2741 return null;
2742 }
2743
2744 // For compatibility, check for login (no ext_account entry given)
2745 $res = $db->queryF(
2746 'SELECT login FROM usr_data ' .
2747 'WHERE login = %s AND auth_mode = %s AND (ext_account IS NULL OR ext_account = "") ',
2748 ['text', 'text'],
2749 [$a_account, $a_auth]
2750 );
2751 if ($usr = $db->fetchAssoc($res)) {
2752 return $usr['login'];
2753 }
2754
2755 // If auth_default == $a_auth => check for login
2756 if (ilAuthUtils::_getAuthModeName($settings->get('auth_mode')) == $a_auth) {
2757 $res = $db->queryF(
2758 'SELECT login FROM usr_data WHERE ' .
2759 ' ext_account = %s AND auth_mode = %s',
2760 ['text', 'text'],
2761 [$a_account, 'default']
2762 );
2763 if ($usr = $db->fetchAssoc($res)) {
2764 return $usr['login'];
2765 }
2766 // Search for login (no ext_account given)
2767 $res = $db->queryF(
2768 'SELECT login FROM usr_data ' .
2769 'WHERE login = %s AND (ext_account IS NULL OR ext_account = "") AND auth_mode = %s',
2770 ['text', 'text'],
2771 [$a_account, 'default']
2772 );
2773 if ($usr = $db->fetchAssoc($res)) {
2774 return $usr['login'];
2775 }
2776 }
2777 return null;
2778 }
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 2361 of file class.ilObjUser.php.

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

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

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

◆ _getAllUserAssignedStyles()

static ilObjUser::_getAllUserAssignedStyles ( )
static

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

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

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

3074 : Avatar
3075 {
3076 $define = new ilUserAvatarResolver($a_usr_id ?: ANONYMOUS_USER_ID);
3077 $define->setSize('xsmall');
3078 return $define->getAvatar();
3079 }
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 2653 of file class.ilObjUser.php.

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

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

3147 : ?string {
3148 if ($a_user_id > 0) {
3149 return self::_lookupPref($a_user_id, 'priv_feed_pass');
3150 }
3151 return null;
3152 }
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 3051 of file class.ilObjUser.php.

3053 : int {
3054 global $DIC;
3055 $ilDB = $DIC['ilDB'];
3056
3057 $query = 'SELECT obj_id FROM object_data WHERE import_id = ' .
3058 $ilDB->quote($i2_id, 'text');
3059
3060 $res = $ilDB->query($query);
3061 $id = 0;
3062 while ($row = $ilDB->fetchObject($res)) {
3063 $id = (int) $row->obj_id;
3064 }
3065 return $id;
3066 }
$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 2959 of file class.ilObjUser.php.

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

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

◆ _getLoginAttempts()

static ilObjUser::_getLoginAttempts ( int  $a_usr_id)
static

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

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

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

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

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

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

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

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

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

2075 : array
2076 {
2077 global $DIC;
2078 $ilDB = $DIC['ilDB'];
2079
2080 $ids = [];
2081 if (is_array($a_internalids)) {
2082 foreach ($a_internalids as $internalid) {
2083 if (is_numeric($internalid)) {
2084 $ids[] = $internalid;
2085 } else {
2086 $parsedid = ilUtil::__extractId($internalid, IL_INST_ID);
2087 if (is_numeric($parsedid) && $parsedid > 0) {
2088 $ids[] = $parsedid;
2089 }
2090 }
2091 }
2092 }
2093 if (count($ids) == 0) {
2094 $ids [] = -1;
2095 }
2096
2097 $query = 'SELECT usr_data.*, usr_pref.value AS language
2098 FROM usr_data
2099 LEFT JOIN usr_pref
2100 ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s
2101 WHERE ' . $ilDB->in('usr_data.usr_id', $ids, false, 'integer');
2102 $values[] = 'language';
2103 $types[] = 'text';
2104
2105 $query .= ' ORDER BY usr_data.lastname, usr_data.firstname ';
2106
2107 $data = [];
2108 $result = $ilDB->queryF($query, $types, $values);
2109 while ($row = $ilDB->fetchAssoc($result)) {
2110 $data[] = $row;
2111 }
2112 return $data;
2113 }
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 2300 of file class.ilObjUser.php.

2302 : array {
2303 if (!$period) {
2304 throw new ilException('no valid period given');
2305 }
2306
2307 global $DIC;
2308 $db = $DIC['ilDB'];
2309
2310 $res = $db->queryF(
2311 'SELECT usr_id FROM usr_data WHERE inactivation_date < %s AND active = %s',
2312 ['timestamp', 'integer'],
2313 [
2314 date('Y-m-d H:i:s', (time() - ($period * 24 * 60 * 60))),
2315 0
2316 ]
2317 );
2318
2319 $ids = [];
2320 while ($row = $db->fetchObject($res)) {
2321 $ids[] = (int) $row->usr_id;
2322 }
2323
2324 return $ids;
2325 }
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 3032 of file class.ilObjUser.php.

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

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

1992 : array {
1993 global $DIC;
1994 $ilDB = $DIC['ilDB'];
1995
1996 $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';
1997 $types[] = 'text';
1998 $values[] = 'language';
1999
2000 if (is_numeric($active) && $active > -1) {
2001 $query .= ' AND usr_data.active = %s';
2002 $values[] = $active;
2003 $types[] = 'integer';
2004 }
2005
2006 if ($ref_id != USER_FOLDER_ID) {
2007 $query .= ' AND usr_data.time_limit_owner = %s';
2008 $values[] = $ref_id;
2009 $types[] = 'integer';
2010 }
2011
2012 $query .= ' AND usr_data.usr_id != %s ';
2013 $values[] = ANONYMOUS_USER_ID;
2014 $types[] = 'integer';
2015
2016 $query .= ' ORDER BY usr_data.lastname, usr_data.firstname ';
2017
2018 $result = $ilDB->queryF($query, $types, $values);
2019 $data = [];
2020 while ($row = $ilDB->fetchAssoc($result)) {
2021 $data[] = $row;
2022 }
2023
2024 return $data;
2025 }

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

2030 : array {
2031 return self::_getUsersForIds($a_mem_ids, $active);
2032 }
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 2034 of file class.ilObjUser.php.

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

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

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

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

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

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

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

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

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

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

◆ _lookupActive()

static ilObjUser::_lookupActive ( int  $a_usr_id)
static

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

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

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

2712 : string
2713 {
2714 return (string) self::_lookup($a_usr_id, 'auth_mode');
2715 }
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 2526 of file class.ilObjUser.php.

2526 : string
2527 {
2528 return self::_lookup($a_user_id, 'client_ip') ?? '';
2529 }

◆ _lookupEmail()

static ilObjUser::_lookupEmail ( int  $a_user_id)
static

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

2516 : string
2517 {
2518 return self::_lookup($a_user_id, 'email') ?? '';
2519 }

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

+ Here is the caller graph for this function:

◆ _lookupExternalAccount()

static ilObjUser::_lookupExternalAccount ( int  $a_user_id)
static

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

2642 : string
2643 {
2644 return (string) self::_lookup($a_user_id, 'ext_account') ?? '';
2645 }

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

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

References $ilDB.

Referenced by ilUserFeedWriter\__construct(), 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 2608 of file class.ilObjUser.php.

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

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

2862 : string
2863 {
2864 return self::_lookup($a_user_id, 'first_login') ?? '';
2865 }

Referenced by ilFirstLoginLearningHistoryProvider\getEntries().

+ Here is the caller graph for this function:

◆ _lookupFullname()

static ilObjUser::_lookupFullname ( int  $a_user_id)
static

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

2489 : string
2490 {
2491 global $DIC;
2492 $ilDB = $DIC['ilDB'];
2493
2494 $fullname = '';
2495
2496 $set = $ilDB->queryF(
2497 'SELECT title, firstname, lastname FROM usr_data WHERE usr_id = %s',
2498 ['integer'],
2499 [$a_user_id]
2500 );
2501
2502 if ($rec = $ilDB->fetchAssoc($set)) {
2503 if ($rec['title']) {
2504 $fullname = $rec['title'] . ' ';
2505 }
2506 if ($rec['firstname']) {
2507 $fullname .= $rec['firstname'] . ' ';
2508 }
2509 if ($rec['lastname']) {
2510 $fullname .= $rec['lastname'];
2511 }
2512 }
2513 return $fullname;
2514 }
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(), ilTestEvaluationGUI\printResults(), ILIAS\Calendar\ConsultationHours\BookingDataProvider\read(), ilCalendarCategories\readConsultationHoursCalendar(), ilObjStudyProgrammeMembersGUI\removeCertificate(), ilObjStudyProgrammeMembersGUI\removeCertificateMulti(), ilCalendarMailNotification\send(), ilConsultationHoursGUI\sendInfoAboutUnassignedUsers(), ilExAssignmentReminder\sendReminders(), ilObjSurvey\sendTutorNotification(), ilTestEvaluationGUI\showResults(), 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 2521 of file class.ilObjUser.php.

2521 : string
2522 {
2523 return (string) self::_lookup($a_user_id, 'gender') ?? '';
2524 }

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

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

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(), ilSoapRBACAdministration\parseUserID(), ilStartUpGUI\processCode(), ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus(), 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 2557 of file class.ilObjUser.php.

2557 : string
2558 {
2559 global $DIC;
2560 $ilDB = $DIC['ilDB'];
2561 $lng = $DIC['lng'];
2562
2563 $q = 'SELECT value FROM usr_pref WHERE usr_id= ' .
2564 $ilDB->quote($a_usr_id, 'integer') . ' AND keyword = ' .
2565 $ilDB->quote('language', 'text');
2566 $r = $ilDB->query($q);
2567
2568 while ($row = $ilDB->fetchAssoc($r)) {
2569 return (string) $row['value'];
2570 }
2571 if (is_object($lng)) {
2572 return $lng->getDefaultLanguage();
2573 }
2574 return 'en';
2575 }
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 2857 of file class.ilObjUser.php.

2857 : string
2858 {
2859 return self::_lookup($a_user_id, 'last_login') ?? '';
2860 }

Referenced by ilCronDeleteInactiveUserReminderMail\removeEntriesFromTableIfLastLoginIsNewer().

+ Here is the caller graph for this function:

◆ _lookupLogin()

static ilObjUser::_lookupLogin ( int  $a_user_id)
static

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

2637 : string
2638 {
2639 return (string) self::_lookup($a_user_id, 'login') ?? '';
2640 }

Referenced by ilCourseXMLParser\__parseId(), ILIAS\Mail\Placeholder\MailSignatureUserLoginPlaceholder\addPlaceholder(), ILIAS\Certificate\Overview\CertificateOverviewTable\buildTableRows(), ilContactGUI\chatroomInvitationMessage(), ilChatUserActionProvider\collectActionsForTargetUser(), ilWorkspaceUserActionProvider\collectActionsForTargetUser(), ilOrgUnitUserAssignmentGUI\confirmRemove(), 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 2531 of file class.ilObjUser.php.

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

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

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

Referenced by ilChatUserActionProvider\acceptsMessages(), ilChatroomViewGUI\buildUserActions(), ilObjUserAccess\canBeDelivered(), ilUserUserActionProvider\collectActionsForTargetUser(), ilMailSearchObjectMembershipsTableGUI\fillRow(), ilMail\formatNamesForOutput(), ilSessionReminder\getEffectiveLeadTime(), ilBuddySystemLinkButton\getHtml(), ilUserUtil\getProfileLink(), ilTutorialSupportBlockGUI\hasContactEnabled(), 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 2990 of file class.ilObjUser.php.

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

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

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

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

2166 : bool {
2167 global $DIC;
2168 $ilDB = $DIC['ilDB'];
2169
2170 $query = 'UPDATE usr_data SET active = 0, inactivation_date = %s WHERE usr_id = %s';
2171 $affected = $ilDB->manipulateF($query, ['timestamp', 'integer'], [ilUtil::now(), $a_usr_id]);
2172
2173 if ($affected) {
2174 return true;
2175 } else {
2176 return false;
2177 }
2178 }
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 2684 of file class.ilObjUser.php.

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

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

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

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

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

◆ activateDeletionFlag()

ilObjUser::activateDeletionFlag ( )

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

1765 : void
1766 {
1767 $this->writePref('delete_flag', true);
1768 }
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 1245 of file class.ilObjUser.php.

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

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

1295 : void {
1296 $ilDB = $this->db;
1297 if ($a_time == 0) {
1298 $a_time = date('Y-m-d H:i:s');
1299 }
1300 ilSession::set('user_pc_clip', true);
1301 $ilDB->insert('personal_pc_clipboard', [
1302 'user_id' => ['integer', $this->getId()],
1303 'content' => ['clob', $a_content],
1304 'insert_time' => ['timestamp', $a_time],
1305 'order_nr' => ['integer', $a_nr]
1306 ]);
1307 }
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 1897 of file class.ilObjUser.php.

1897 : string
1898 {
1899 if (count($a_attr) > 0) {
1900 return implode(', ', $a_attr);
1901 }
1902 return '';
1903 }

◆ checkTimeLimit()

ilObjUser::checkTimeLimit ( )

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

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

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

+ Here is the caller graph for this function:

◆ clipboardDeleteAll()

ilObjUser::clipboardDeleteAll ( )

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

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

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

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

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

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

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

3095 : void {
3096 global $DIC;
3097 $irss = $DIC->resourceStorage();
3098
3099 $clean_dir = trim(str_replace('..', '', $a_dir));
3100 if ($clean_dir == '' || !is_dir($clean_dir)) {
3101 return;
3102 }
3103 $avatar_rid = (new ilObjUser($a_user_id))->getAvatarRid();
3104 if ($avatar_rid === null) {
3105 return;
3106 }
3107
3108 file_put_contents(
3109 $clean_dir . '/usr_' . $a_user_id . '.jpg',
3110 $irss->consume()->stream($avatar_rid)->getStream()->getContents()
3111 );
3112 }
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 2406 of file class.ilObjUser.php.

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

References $ilDB.

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

+ Here is the caller graph for this function:

◆ getActive()

ilObjUser::getActive ( )

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

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

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

1221 : ?string
1222 {
1223 if (!$a_auth_key) {
1224 return $this->auth_mode;
1225 }
1226 return ilAuthUtils::_getAuthMode($this->auth_mode);
1227 }
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 1498 of file class.ilObjUser.php.

1498 : Avatar
1499 {
1500 return self::_getAvatar($this->getId());
1501 }
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 1431 of file class.ilObjUser.php.

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

1389 : array {
1390 global $DIC;
1391
1392 $ilDB = $DIC['ilDB'];
1393
1394 $par = '';
1395 if ($a_top_nodes_only) {
1396 $par = ' AND parent = ' . $ilDB->quote(0, 'integer') . ' ';
1397 }
1398
1399 $type_str = ($a_type != '')
1400 ? ' AND type = ' . $ilDB->quote($a_type, 'text') . ' '
1401 : '';
1402 $q = 'SELECT * FROM personal_clipboard WHERE ' .
1403 'user_id = ' . $ilDB->quote($this->getId(), 'integer') . ' ' .
1404 $type_str . $par .
1405 ' ORDER BY order_nr';
1406 $objs = $ilDB->query($q);
1407 $objects = [];
1408 while ($obj = $ilDB->fetchAssoc($objs)) {
1409 if ($obj['type'] == 'mob') {
1410 $obj['title'] = ilObject::_lookupTitle($obj['item_id']);
1411 if (ilObject::_lookupType((int) $obj['item_id']) !== 'mob') {
1412 continue;
1413 }
1414 }
1415 if ($obj['type'] == 'incl') {
1416 $obj['title'] = ilMediaPoolPage::lookupTitle($obj['item_id']);
1417 if (!ilPageObject::_exists('mep', (int) $obj['item_id'], '-')) {
1418 continue;
1419 }
1420 }
1421 $objects[] = ['id' => $obj['item_id'],
1422 'type' => $obj['type'], 'title' => $obj['title'],
1423 'insert_time' => $obj['insert_time']];
1424 }
1425 return $objects;
1426 }
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 1234 of file class.ilObjUser.php.

1234 : string
1235 {
1236 return $this->ext_account;
1237 }
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 2327 of file class.ilObjUser.php.

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

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

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

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

1814 : string
1815 {
1816 return $this->buildTextFromArray($this->getGeneralInterests());
1817 }
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 1750 of file class.ilObjUser.php.

1750 : ?string
1751 {
1753 }

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

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

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

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

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

+ Here is the caller graph for this function:

◆ getLookingForHelpAsText()

ilObjUser::getLookingForHelpAsText ( )

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

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

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

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

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

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

◆ getOrgUnitsRepresentation()

ilObjUser::getOrgUnitsRepresentation ( )

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

1471 : string
1472 {
1474 }
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 1201 of file class.ilObjUser.php.

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

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

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

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

+ Here is the call graph for this function:

◆ getPersonalDataExportFile()

ilObjUser::getPersonalDataExportFile ( )

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

1691 : string
1692 {
1693 $dir = ilExport::_getExportDirectory($this->getId(), 'xml', 'usr', 'personal_data');
1694 if (!is_dir($dir)) {
1695 return '';
1696 }
1697 foreach (ilFileUtils::getDir($dir) as $entry) {
1698 if (is_int(strpos($entry['entry'], '.zip'))) {
1699 return $entry['entry'];
1700 }
1701 }
1702
1703 return '';
1704 }
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 1480 of file class.ilObjUser.php.

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

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()

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

1517 : string
1518 {
1519 global $DIC;
1520 $rbacreview = $DIC['rbacreview'];
1521 $profile = $DIC['user']->getProfile();
1522
1523 $language->loadLanguageModule('registration');
1524 $language->loadLanguageModule('crs');
1525
1526 $body = "{$language->txt('login')}: {$this->getLogin()}\n";
1527
1528 if ($this->profile_data->getTitle() !== '') {
1529 $body .= "{$language->txt('title')}: {$this->profile_data->getTitle()}\n";
1530 }
1531 if ($this->getGender() !== '') {
1532 $body .= ($language->txt('gender') . ': ' . $language->txt('gender_' . strtolower($this->getGender())) . "\n");
1533 }
1534 if ($this->getFirstname() !== '') {
1535 $body .= ($language->txt('firstname') . ': ' . $this->getFirstname() . "\n");
1536 }
1537 if ($this->getLastname() !== '') {
1538 $body .= ($language->txt('lastname') . ': ' . $this->getLastname() . "\n");
1539 }
1540 if ($this->getInstitution() !== '') {
1541 $body .= ($language->txt('institution') . ': ' . $this->getInstitution() . "\n");
1542 }
1543 if ($this->getDepartment() !== '') {
1544 $body .= ($language->txt('department') . ': ' . $this->getDepartment() . "\n");
1545 }
1546 if ($this->getStreet() !== '') {
1547 $body .= ($language->txt('street') . ': ' . $this->getStreet() . "\n");
1548 }
1549 if ($this->getCity() !== '') {
1550 $body .= ($language->txt('city') . ': ' . $this->getCity() . "\n");
1551 }
1552 if ($this->getZipcode() !== '') {
1553 $body .= ($language->txt('zipcode') . ': ' . $this->getZipcode() . "\n");
1554 }
1555 if ($this->getCountry() !== '') {
1556 $body .= ($language->txt('country') . ': ' . $this->getCountry() . "\n");
1557 }
1558 if ($this->getPhoneOffice() !== '') {
1559 $body .= ($language->txt('phone_office') . ': ' . $this->getPhoneOffice() . "\n");
1560 }
1561 if ($this->getPhoneHome() !== '') {
1562 $body .= ($language->txt('phone_home') . ': ' . $this->getPhoneHome() . "\n");
1563 }
1564 if ($this->getPhoneMobile() !== '') {
1565 $body .= ($language->txt('phone_mobile') . ': ' . $this->getPhoneMobile() . "\n");
1566 }
1567 if ($this->getFax() !== '') {
1568 $body .= ($language->txt('fax') . ': ' . $this->getFax() . "\n");
1569 }
1570 if ($this->getEmail() !== '') {
1571 $body .= ($language->txt('email') . ': ' . $this->getEmail() . "\n");
1572 }
1573 if ($this->getSecondEmail() !== null
1574 && $this->getSecondEmail() !== '') {
1575 $body .= ($language->txt('second_email') . ': ' . $this->getSecondEmail() . "\n");
1576 }
1577 if ($this->getHobby() !== '') {
1578 $body .= ($language->txt('hobby') . ': ' . $this->getHobby() . "\n");
1579 }
1580 if ($this->getComment() !== '') {
1581 $body .= ($language->txt('referral_comment') . ': ' . $this->getComment() . "\n");
1582 }
1583 if ($this->getMatriculation() !== '') {
1584 $body .= ($language->txt('matriculation') . ': ' . $this->getMatriculation() . "\n");
1585 }
1586 if ($this->getCreateDate() !== '') {
1591
1592 $body .= ($language->txt('create_date') . ': ' . $date . "\n");
1593 }
1594
1595 $gr = [];
1596 foreach ($rbacreview->getGlobalRoles() as $role) {
1597 if ($rbacreview->isAssigned($this->getId(), $role)) {
1598 $gr[] = ilObjRole::_lookupTitle($role);
1599 }
1600 }
1601 if (count($gr)) {
1602 $body .= ($language->txt('reg_role_info') . ': ' . implode(',', $gr) . "\n");
1603 }
1604
1605 // Time limit
1606 if ($this->getTimeLimitUnlimited()) {
1607 $body .= ($language->txt('time_limit') . ': ' . $language->txt('crs_unlimited') . "\n");
1608 } else {
1614 );
1616
1617 $start = new ilDateTime($this->getTimeLimitFrom(), IL_CAL_UNIX);
1618 $end = new ilDateTime($this->getTimeLimitUntil(), IL_CAL_UNIX);
1619
1620 $body .= $language->txt('time_limit') . ': ' .
1621 $language->txt('from') . ' ' .
1622 $start->get(IL_CAL_DATETIME) . ' ';
1623 $body .= $language->txt('to') . ' ' . $end->get(IL_CAL_DATETIME) . "\n";
1624 }
1625
1626 foreach ($profile->getAllUserDefinedFields() as $field) {
1627 $data = $field->retrieveValueFromUser($this);
1628 if ($data !== '') {
1629 $body .= "{$field->getLabel($this->lng)}: {$data}\n";
1630 }
1631 }
1632
1633 return $body;
1634 }
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 1151 of file class.ilObjUser.php.

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

References ANONYMOUS_USER_ID.

◆ getProfileStatusOfUsers()

static ilObjUser::getProfileStatusOfUsers ( array  $a_user_ids)
static

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

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

Referenced by ilInternalLink\searchUsers().

+ Here is the caller graph for this function:

◆ getPublicName()

ilObjUser::getPublicName ( )

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

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

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

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

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

1100 : ?int
1101 {
1103 }

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

+ Here is the caller graph for this function:

◆ getTimeLimitOwner()

ilObjUser::getTimeLimitOwner ( )

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

1090 : int
1091 {
1093 }

◆ getTimeLimitUnlimited()

ilObjUser::getTimeLimitUnlimited ( )

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

1120 : bool
1121 {
1123 }

Referenced by ilAccountMail\replacePlaceholders().

+ Here is the caller graph for this function:

◆ getTimeLimitUntil()

ilObjUser::getTimeLimitUntil ( )

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

1110 : ?int
1111 {
1113 }

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

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

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

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

Referenced by ilCronDeleteInactiveUserAccounts\run().

+ Here is the caller graph for this function:

◆ getUserIdsNeverLoggedIn()

static ilObjUser::getUserIdsNeverLoggedIn ( int  $thresholdInDays)
static

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

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

Referenced by ilCronDeleteNeverLoggedInUserAccounts\run().

+ Here is the caller graph for this function:

◆ getUserLoginsByEmail()

static ilObjUser::getUserLoginsByEmail ( string  $a_email)
static

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

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

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

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

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

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

Referenced by ilAuthFrontend\checkSimultaneousLogins().

+ Here is the caller graph for this function:

◆ hasDeletionFlag()

ilObjUser::hasDeletionFlag ( )

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

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

◆ hasProfilePicture()

ilObjUser::hasProfilePicture ( )

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

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

References ILIAS\Survey\Mode\getId().

+ Here is the call graph for this function:

◆ hasPublicProfile()

ilObjUser::hasPublicProfile ( )

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

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

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

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

◆ isAnonymous()

ilObjUser::isAnonymous ( )

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

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

References ILIAS\Survey\Mode\getId().

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

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

◆ isPasswordChangeDemanded()

ilObjUser::isPasswordChangeDemanded ( )

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

1159 : bool
1160 {
1161 if ($this->id === ANONYMOUS_USER_ID) {
1162 return false;
1163 }
1164
1165 if ($this->id === SYSTEM_USER_ID) {
1166 if (LocalUserPasswordManager::getInstance()->verifyPassword($this, base64_decode('aG9tZXI='))
1168 ) {
1169 return true;
1170 }
1171 return false;
1172 }
1173
1175 && ($this->getPasswordPolicyResetStatus()
1176 || ilSecuritySettings::_getInstance()->isPasswordChangeOnFirstLoginEnabled()
1177 && $this->getLastPasswordChangeTS() === 0
1178 && $this->is_self_registered === false);
1179 }
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 1181 of file class.ilObjUser.php.

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

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

1785 : bool
1786 {
1788 }

◆ lookupMatriculation()

static ilObjUser::lookupMatriculation ( int  $a_usr_id)
static

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

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

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

3070 : string {
3071 return ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_usr_id);
3072 }

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

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

◆ removeObjectFromClipboard()

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

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

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

◆ removeUserPicture()

ilObjUser::removeUserPicture ( )

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

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

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

+ Here is the caller graph for this function:

◆ resetLastPasswordChange()

ilObjUser::resetLastPasswordChange ( )

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

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

◆ resetOwner()

ilObjUser::resetOwner ( )

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

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

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

1706 : void
1707 {
1708 $file = ilExport::_getExportDirectory($this->getId(), 'xml', 'usr', 'personal_data') .
1709 '/' . $this->getPersonalDataExportFile();
1710 if (is_file($file)) {
1712 }
1713 }
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 $this->setOwner($owner);
1064 return;
1065 }
1066
1067 $this->active = 0;
1068 $this->setApproveDate(null);
1069
1070 if ($this->getId() > 0 && $current_active !== $active) {
1072 }
1073 }
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 1216 of file class.ilObjUser.php.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Referenced by shibUser\createFields().

+ Here is the caller graph for this function:

◆ setTimeLimitOwner()

ilObjUser::setTimeLimitOwner ( int  $a_owner)

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

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

Referenced by ilObjUserGUI\addValuesFromSystemInformationToUserSection().

+ Here is the caller graph for this function:

◆ setTimeLimitUnlimited()

ilObjUser::setTimeLimitUnlimited ( bool  $unlimited)

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

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

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

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

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)
$context
Definition: webdav.php:31

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

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

◆ userExists()

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

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

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

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

+ 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 }

Referenced by ilUserImportParser\addUDFDataToUser().

+ Here is the caller graph for this function:

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