120 protected \ILIAS\FileDelivery\Delivery\StreamDelivery
$delivery;
127 bool $a_call_by_reference =
false 135 $this->irss = $DIC->resourceStorage();
136 $this->auth_mode =
'default';
137 $this->passwd_type = self::PASSWD_PLAIN;
138 if ($a_user_id > 0) {
139 $this->
setId($a_user_id);
143 $this->prefs[
'language'] = $this->
ilias->ini->readVariable(
'language',
'default');
144 $this->skin = $this->
ilias->ini->readVariable(
'layout',
'skin');
146 $this->prefs[
'style'] = $this->
ilias->ini->readVariable(
'layout',
'style');
149 $this->app_event_handler = $DIC[
'ilAppEventHandler'];
150 $this->date_format_factory = (
new DataFactory())->dateFormat();
151 $this->delivery = $DIC->fileDelivery()->delivery();
166 $r =
$ilDB->queryF(
'SELECT * FROM usr_data ' .
167 'WHERE usr_id= %s', [
'integer'], [$this->
id]);
172 $data[
'passwd_type'] = self::PASSWD_CRYPTED;
187 if (!isset($this->prefs[
'language']) || $this->prefs[
'language'] ===
'') {
188 $this->prefs[
'language'] = $this->oldPrefs[
'language'] ??
'';
192 !isset($this->prefs[
'skin']) || $this->prefs[
'skin'] ===
'' ||
195 $this->prefs[
'skin'] = $this->oldPrefs[
'skin'] ??
'';
198 $this->skin = $this->prefs[
'skin'];
201 !isset($this->prefs[
'style']) ||
202 $this->prefs[
'style'] ===
'' ||
210 $this->prefs[
'skin'] = $this->
ilias->ini->readVariable(
'layout',
'skin');
211 $this->prefs[
'style'] = $this->
ilias->ini->readVariable(
'layout',
'style');
214 $ilErr->raiseError(
'<b>Error: There is no dataset with id ' .
215 $this->
id .
'!</b><br />class: ' . get_class($this) .
'<br />Script: ' . __FILE__ .
216 '<br />Line: ' . __LINE__,
$ilErr->FATAL);
232 $this->password_encoding_type = $password_encryption_type;
256 $this->
setLogin($a_data[
'login'] ??
'');
257 if (!($a_data[
'passwd_type'] ??
false)) {
258 $ilErr->raiseError(
'<b>Error: passwd_type missing in function assignData(). ' .
259 $this->
id .
'!</b><br />class: ' . get_class($this) .
'<br />Script: ' 260 . __FILE__ .
'<br />Line: ' . __LINE__,
$ilErr->FATAL);
262 if (($a_data[
'passwd'] ??
'') !=
'********' && strlen($a_data[
'passwd'] ??
'')) {
263 $this->
setPasswd($a_data[
'passwd'] ??
'', $a_data[
'passwd_type'] ??
'');
266 $this->
setGender((
string) ($a_data[
'gender'] ??
''));
267 $this->
setUTitle((
string) ($a_data[
'title'] ??
''));
268 $this->
setFirstname((
string) ($a_data[
'firstname'] ??
''));
269 $this->
setLastname((
string) ($a_data[
'lastname'] ??
''));
271 if (isset($a_data[
'birthday']) && is_string($a_data[
'birthday'])) {
279 $this->
setDepartment((
string) ($a_data[
'department'] ??
''));
280 $this->
setStreet((
string) ($a_data[
'street'] ??
''));
281 $this->
setCity((
string) ($a_data[
'city'] ??
''));
282 $this->
setZipcode((
string) ($a_data[
'zipcode'] ??
''));
283 $this->
setCountry((
string) ($a_data[
'country'] ??
''));
286 $this->
setPhoneHome((
string) ($a_data[
'phone_home'] ??
''));
288 $this->
setFax((
string) ($a_data[
'fax'] ??
''));
290 $this->
setEmail((
string) ($a_data[
'email'] ??
''));
292 $this->
setHobby((
string) ($a_data[
'hobby'] ??
''));
293 $this->
setClientIP((
string) ($a_data[
'client_ip'] ??
''));
303 $this->
setLastLogin((
string) ($a_data[
'last_login'] ??
''));
304 $this->
setFirstLogin((
string) ($a_data[
'first_login'] ??
''));
306 $this->
setLastUpdate((
string) ($a_data[
'last_update'] ??
''));
307 $this->create_date = $a_data[
'create_date'] ??
'';
308 $this->
setComment((
string) ($a_data[
'referral_comment'] ??
''));
309 $this->approve_date = ($a_data[
'approve_date'] ??
null);
310 $this->active = ($a_data[
'active'] ?? 0);
311 $this->agree_date = ($a_data[
'agree_date'] ??
null);
326 $this->
setAuthMode((
string) ($a_data[
'auth_mode'] ?? null));
332 $this->avatar_rid = (string) ($a_data[
'rid'] ?? self::NO_AVATAR_RID);
344 $ilAppEventHandler = $DIC[
'ilAppEventHandler'];
350 switch ($this->passwd_type) {
351 case self::PASSWD_PLAIN:
352 if (strlen($this->passwd)) {
353 LocalUserPasswordManager::getInstance()->encodePassword($this, $this->passwd);
360 case self::PASSWD_CRYPTED:
365 $ilErr->raiseError(
'<b>Error: passwd_type missing in function saveAsNew. ' .
366 $this->
id .
'!</b><br />class: ' . get_class($this) .
'<br />Script: ' . __FILE__ .
367 '<br />Line: ' . __LINE__,
$ilErr->FATAL);
370 if (!$this->active) {
379 'passwd' => [
'text', $pw_value],
386 'email' => [
'text', trim($this->email ??
'')],
387 'second_email' => [
'text', trim($this->second_email ??
'')],
401 'last_login' => [
'timestamp',
null],
402 'first_login' => [
'timestamp',
null],
403 'last_profile_prompt' => [
'timestamp',
null],
421 'loc_zoom' => [
'integer', (
int) $this->loc_zoom],
422 'last_password_change' => [
'integer', $this->last_password_change_ts],
425 'is_self_registered' => [
'integer', (
int) $this->is_self_registered],
427 $ilDB->insert(
'usr_data', $insert_array);
434 $mbox->createDefaultFolder();
437 $mail_options->createMailOptionsEntry();
439 $ilAppEventHandler->raise(
440 'components/ILIAS/User',
442 [
'user_obj' => $this]
458 } elseif ($this->active) {
465 'firstname' => [
'text', substr($this->firstname, 0, 128)],
466 'lastname' => [
'text', substr($this->lastname, 0, 128)],
467 'email' => [
'text', substr(trim($this->email), 0, 128)],
468 'second_email' => [
'text', trim($this->second_email ??
'')],
497 'loc_zoom' => [
'integer', (
int) $this->loc_zoom],
498 'login_attempts' => [
'integer', $this->login_attempts],
499 'last_password_change' => [
'integer', $this->last_password_change_ts],
500 'passwd_policy_reset' => [
'integer', $this->passwd_policy_reset],
503 'reg_hash' => [
'text',
null],
506 ($this->avatar_rid ?? self::NO_AVATAR_RID)
510 if ($this->agree_date ===
null || (is_string($this->agree_date) && strtotime($this->agree_date) !==
false)) {
513 switch ($this->passwd_type) {
514 case self::PASSWD_PLAIN:
515 if (strlen($this->passwd)) {
516 LocalUserPasswordManager::getInstance()->encodePassword($this, $this->passwd);
517 $update_array[
'passwd'] = [
'text', $this->
getPasswd()];
523 case self::PASSWD_CRYPTED:
528 $ilErr->raiseError(
'<b>Error: passwd_type missing in function update()' . $this->
id .
'!</b><br />class: ' .
529 get_class($this) .
'<br />Script: ' . __FILE__ .
'<br />Line: ' . __LINE__,
$ilErr->FATAL);
535 $ilDB->update(
'usr_data', $update_array, [
'usr_id' => [
'integer', $this->
id]]);
549 $ilAppEventHandler->raise(
550 'components/ILIAS/User',
552 [
'user_obj' => $this]
564 $ilDB->manipulateF(
'UPDATE usr_data SET agree_date = ' .
$ilDB->now() .
565 ' WHERE usr_id = %s', [
'integer'], [$this->
getId()]);
574 $ilDB = $DIC->database();
577 'SELECT ' . $a_field .
' FROM usr_data WHERE usr_id = %s',
583 return $set[$a_field];
593 $ilDB = $DIC[
'ilDB'];
595 $set =
$ilDB->queryF(
596 'SELECT title, firstname, lastname FROM usr_data WHERE usr_id = %s',
601 if ($rec =
$ilDB->fetchAssoc($set)) {
603 $fullname = $rec[
'title'] .
' ';
605 if ($rec[
'firstname']) {
606 $fullname .= $rec[
'firstname'] .
' ';
608 if ($rec[
'lastname']) {
609 $fullname .= $rec[
'lastname'];
617 return self::_lookup($a_user_id,
'email') ??
'';
622 return (
string) self::_lookup($a_user_id,
'gender') ??
'';
627 return self::_lookup($a_user_id,
'client_ip') ??
'';
638 $ilDB = $DIC[
'ilDB'];
641 'SELECT firstname, lastname, title, login FROM usr_data WHERE usr_id = %s',
645 if ($user_rec =
$ilDB->fetchAssoc(
$res)) {
646 return [
'user_id' => $a_user_id,
647 'firstname' => $user_rec[
'firstname'],
648 'lastname' => $user_rec[
'lastname'],
649 'title' => $user_rec[
'title'],
650 'login' => $user_rec[
'login']
653 return [
'user_id' => 0,
669 $ilDB = $DIC[
'ilDB'];
672 'SELECT * FROM usr_data WHERE usr_id = %s',
682 return (
string) self::_lookup($a_user_id,
'login') ??
'';
687 return (
string) self::_lookup($a_user_id,
'ext_account') ??
'';
698 $ilDB = $DIC[
'ilDB'];
700 if (!is_array($a_user_str)) {
702 'SELECT usr_id FROM usr_data WHERE login = %s',
708 if (is_array($user_rec)) {
709 return (
int) $user_rec[
'usr_id'];
716 'SELECT usr_id FROM usr_data ' .
717 ' WHERE ' .
$ilDB->in(
'login', $a_user_str,
false,
'text')
721 while ($rec =
$ilDB->fetchAssoc($set)) {
722 $ids[] = (
int) $rec[
'usr_id'];
730 return self::_lookup($a_user_id,
'last_login') ??
'';
735 return self::_lookup($a_user_id,
'first_login') ??
'';
748 'UPDATE usr_data SET ' .
749 'last_login = ' .
$ilDB->now() .
750 ' WHERE usr_id = %s',
757 'UPDATE usr_data SET ' .
758 'first_login = ' .
$ilDB->now() .
759 ' WHERE usr_id = %s',
763 $this->app_event_handler->raise(
764 'components/ILIAS/User',
766 [
'user_obj' => $this]
786 if (func_num_args() != 2) {
790 if (!isset($raw) || !isset($raw_retype)) {
794 if ($raw != $raw_retype) {
798 LocalUserPasswordManager::getInstance()->encodePassword($this, $raw);
802 SET passwd = %s, passwd_enc_type = %s, passwd_salt = %s 804 [
'text',
'text',
'text',
'integer'],
818 $ilDB = $DIC->database();
822 SELECT * FROM loginname_history 841 $ilDB = $DIC[
'ilDB'];
843 $ilDB->setLimit(1, 0);
846 SELECT login, history_date FROM loginname_history 847 WHERE usr_id = %s ORDER BY history_date DESC',
852 if (!is_array($row) || !count($row)) {
857 $row[
'login'], $row[
'history_date']
874 $lng = $DIC->language();
876 if (func_num_args() != 1) {
880 if (!isset($a_login)) {
884 $former_login = self::_lookupLogin($this->
getId());
887 if (0 == strcmp($a_login, $former_login)) {
892 $last_history_entry = self::_getLastHistoryDataByUserId($this->
getId());
894 $last_history_entry =
null;
898 if ((
int)
$ilSetting->get(
'allow_change_loginname') &&
900 self::_doesLoginnameExistInHistory($a_login)) {
902 } elseif ((
int)
$ilSetting->get(
'allow_change_loginname') &&
904 is_array($last_history_entry) &&
905 $last_history_entry[1] + (
int)
$ilSetting->get(
'loginname_change_blocking_time') > time()) {
908 $lng->
txt(
'changing_loginname_not_possible_info'),
919 if ((
int)
$ilSetting->get(
'allow_change_loginname') &&
921 self::_writeHistory($this->
getId(), $former_login);
925 $this->
login = $a_login;
944 self::_writePref($this->
id, $a_keyword, $a_value);
945 $this->
setPref($a_keyword, $a_value);
950 self::_deletePref($this->
getId(), $a_keyword);
953 public static function _deletePref(
int $a_user_id,
string $a_keyword): void
957 $ilDB = $DIC->database();
960 'DELETE FROM usr_pref WHERE usr_id = %s AND keyword = %s',
962 [$a_user_id, $a_keyword]
973 $ilDB = $DIC->database();
976 'DELETE FROM usr_pref WHERE usr_id = %s',
989 $ilDB = $DIC->database();
993 'usr_id' => [
'integer', $a_usr_id],
994 'keyword' => [
'text', $a_keyword],
997 'value' => [
'text',$a_value]
1004 self::_deleteAllPref($this->
id);
1005 foreach ($this->prefs as $keyword => $value) {
1006 self::_writePref($this->
id, $keyword, (
string) $value);
1012 if ($tz = $this->
getPref(
'user_tz')) {
1016 return $settings->getDefaultTimeZone();
1022 if ($format = $this->
getPref(
'time_format')) {
1026 return $settings->getDefaultTimeFormat();
1032 if (!($format = $this->
getPref(
'date_format'))) {
1034 $format = $settings->getDefaultDateFormat();
1039 return $this->date_format_factory->germanShort();
1042 return $this->date_format_factory->americanShort();
1046 return $this->date_format_factory->standard();
1053 return $this->date_format_factory->withTime24($this->
getDateFormat());
1055 return $this->date_format_factory->withTime12($this->
getDateFormat());
1058 public function setPref(
string $a_keyword, ?
string $a_value): void
1060 if ($a_keyword !=
'') {
1061 $this->prefs[$a_keyword] = $a_value;
1065 public function getPref(
string $a_keyword): ?string
1067 return $this->prefs[$a_keyword] ??
null;
1072 return (array_key_exists($a_keyword, $this->prefs));
1081 $ilDB = $DIC[
'ilDB'];
1083 $query =
'SELECT * FROM usr_pref WHERE usr_id = ' .
$ilDB->quote($a_usr_id,
'integer') .
' ' .
1084 'AND keyword = ' .
$ilDB->quote($a_keyword,
'text');
1095 if (is_array($this->prefs)) {
1098 $this->prefs = self::_getPreferences($this->
id);
1101 public function delete():
bool 1105 $rbacadmin = $DIC->rbac()->admin();
1108 $ilAppEventHandler = $DIC[
'ilAppEventHandler'];
1109 $ilAppEventHandler->raise(
1112 [
'usr_id' => $this->
getId()]
1117 $mapping->deleteUser($this->
getId());
1122 $mailbox->updateMailsOfDeletedUser($this->
getLogin());
1129 'DELETE FROM usr_data WHERE usr_id = %s',
1137 self::_deleteAllPref($this->
getId());
1145 $rbacadmin->removeUser($this->
getId());
1149 $q =
'DELETE FROM bookmark_tree WHERE tree = ' .
1153 $q =
'DELETE FROM bookmark_data WHERE user_id = ' .
1179 $tree->cascadingDelete();
1182 $this->cron_delete_user_reminder_mail->removeSingleUserFromTable($this->
getId());
1189 $ilOrgUnitUserAssignmentQueries->deleteAllAssignmentsOfUser($this->
getId());
1212 $this->fullname = ($this->utitle !=
'')
1213 ? $this->utitle .
' ' 1215 $this->fullname .= $this->firstname .
' ';
1233 if (!$a_max_strlen) {
1237 if (strlen($this->fullname) <= $a_max_strlen) {
1241 if ((strlen($this->utitle) + strlen($this->lastname) + 4) <= $a_max_strlen) {
1242 return ilUtil::stripSlashes($this->utitle .
' ' . substr($this->firstname, 0, 1) .
'. ' . $this->lastname);
1245 if ((strlen($this->firstname) + strlen($this->lastname) + 1) <= $a_max_strlen) {
1249 if ((strlen($this->lastname) + 3) <= $a_max_strlen) {
1258 $this->
login = $a_str;
1270 $this->passwd = $a_str;
1271 $this->passwd_type = $a_type;
1292 $this->gender = substr($a_str, -1);
1307 $this->utitle = $a_str;
1317 $this->firstname = $a_str;
1327 $this->lastname = $a_str;
1337 $this->institution = $a_str;
1347 $this->department = $a_str;
1357 $this->street = $a_str;
1367 $this->city = $a_str;
1377 $this->zipcode = $a_str;
1387 $this->country = $a_str;
1400 $this->sel_country = $a_val;
1413 $this->phone_office = $a_str;
1423 $this->phone_home = $a_str;
1433 $this->phone_mobile = $a_str;
1443 $this->fax = $a_str;
1453 $this->client_ip = $a_str;
1463 $this->matriculation = $a_str;
1475 $ilDB = $DIC[
'ilDB'];
1477 $query =
'SELECT matriculation FROM usr_data ' .
1478 'WHERE usr_id = ' .
$ilDB->quote($a_usr_id);
1481 return $row->matriculation ?:
'';
1486 $this->email = $a_str;
1506 $this->hobby = $a_str;
1516 $this->
setPref(
'language', $a_str);
1522 return $this->prefs[
'language'];
1527 $this->last_password_change_ts = $a_last_password_change_ts;
1542 $this->passwd_policy_reset = $status;
1549 $ilDB = $DIC->database();
1550 $lng = $DIC->language();
1552 $q =
'SELECT value FROM usr_pref WHERE usr_id= ' .
1553 $ilDB->quote($a_usr_id,
'integer') .
' AND keyword = ' .
1554 $ilDB->quote(
'language',
'text');
1557 while ($row =
$ilDB->fetchAssoc(
$r)) {
1558 return (
string) $row[
'value'];
1560 if (is_object(
$lng)) {
1572 $ilDB = $DIC[
'ilDB'];
1575 'UPDATE usr_data ' .
1576 ' SET ext_account = %s WHERE usr_id = %s',
1577 [
'text',
'integer'],
1578 [$a_ext_id, $a_usr_id]
1586 $ilDB = $DIC[
'ilDB'];
1589 'UPDATE usr_data ' .
1590 ' SET auth_mode = %s WHERE usr_id = %s',
1591 [
'text',
'integer'],
1592 [$a_auth_mode, $a_usr_id]
1614 $this->last_login = $a_str;
1624 $this->first_login = $a_str;
1634 $this->last_profile_prompt = $a_str;
1644 $this->last_update = $a_str;
1654 $this->referral_comment = $a_str;
1668 $this->approve_date = $a_str;
1682 $this->agree_date = $a_str;
1714 $ilDB = $DIC[
'ilDB'];
1716 $query =
'SELECT usr_id FROM usr_data ' .
1717 'WHERE active = ' .
$ilDB->quote(1,
'integer') .
' ' .
1718 'AND usr_id = ' .
$ilDB->quote($a_usr_id,
'integer');
1739 if ($this->active) {
1743 if ((!empty($storedActive) && empty($currentActive)) ||
1744 (empty($storedActive) && !empty($currentActive))) {
1745 $this->
setActive($currentActive, self::getUserIdByLogin(self::getLoginFromAuth()));
1754 return (
bool) self::_lookup($a_id,
'active');
1759 $this->skin = $a_str;
1764 $this->time_limit_owner = $a_owner;
1769 return $this->time_limit_owner ?: 7;
1774 $this->time_limit_from = $a_from;
1784 $this->time_limit_until = $a_until;
1794 $this->time_limit_unlimited = $a_unlimited;
1804 $this->time_limit_message = $a_time_limit_message;
1814 $this->login_attempts = $a_login_attempts;
1835 $this->profile_incomplete = $a_prof_inc;
1854 LocalUserPasswordManager::getInstance()->verifyPassword($this, base64_decode(
'aG9tZXI=')) &&
1866 $passwordResetOnFirstLogin = (
1867 $security->isPasswordChangeOnFirstLoginEnabled() &&
1872 return ($authModeAllowsPasswordChange && ($passwordResetOnFirstLogin || $passwordResetOnChangedPolicy));
1883 $max_pass_age = $security->getPasswordMaxAge();
1884 if ($max_pass_age > 0) {
1885 $max_pass_age_ts = ($max_pass_age * 86400);
1887 $current_ts = time();
1889 if (($current_ts - $pass_change_ts) > $max_pass_age_ts) {
1902 $current_ts = time();
1904 $password_age = (
int) (($current_ts - $pass_change_ts) / 86400);
1905 return $password_age;
1912 $ilDB = $DIC[
'ilDB'];
1916 $query =
'UPDATE usr_data SET last_password_change = %s ' .
1917 'WHERE usr_id = %s';
1918 $affected =
$ilDB->manipulateF(
1920 [
'integer',
'integer'],
1934 $query =
'UPDATE usr_data SET last_password_change = 0 ' .
1935 'WHERE usr_id = %s';
1936 $affected =
$ilDB->manipulateF(
1950 $this->latitude = $a_latitude;
1960 $this->longitude = $a_longitude;
1970 $this->loc_zoom = $a_locationzoom;
1991 string $a_session_id
1995 $ilDB = $DIC[
'ilDB'];
1997 $set =
$ilDB->queryf(
1999 SELECT COUNT(*) session_count 2000 FROM usr_session WHERE user_id = %s AND expires > %s AND session_id != %s ',
2001 [
'integer',
'integer',
'text'],
2002 [$a_user_id, time(), $a_session_id]
2004 $row =
$ilDB->fetchAssoc($set);
2005 return (
bool) $row[
'session_count'];
2013 $login = self::getLoginFromAuth();
2014 $id = self::_lookupId($login);
2026 $uid =
$GLOBALS[
'DIC'][
'ilAuthSession']->getUserId();
2027 $login = self::_lookupLogin($uid);
2031 $login = self::toUsernameWithoutDomain($login);
2044 $pos = strrpos($a_login,
'/');
2045 $pos2 = strrpos($a_login,
'\\');
2046 if ($pos ===
false || $pos < $pos2) {
2050 $a_login = substr($a_login, $pos + 1);
2062 $login = self::getLoginFromAuth();
2063 $set =
$ilDB->queryF(
2064 'SELECT active FROM usr_data WHERE login= %s',
2069 if ($rec =
$ilDB->fetchAssoc($set)) {
2070 if ($rec[
'active']) {
2080 return (
int) self::_lookupId($a_login);
2090 $ilDB = $DIC->database();
2093 'SELECT usr_id FROM usr_data ' .
2094 'WHERE email = %s and active = 1',
2099 while ($row =
$ilDB->fetchObject(
$res)) {
2100 $ids[] = (
int) $row->usr_id;
2114 $ilDB = $DIC->database();
2117 'SELECT login FROM usr_data ' .
2118 'WHERE email = %s and active = 1',
2123 while ($row =
$ilDB->fetchObject(
$res)) {
2124 $ids[] = $row->login;
2132 $login = self::_lookupLogin($a_userid);
2133 return $login ?:
null;
2139 public static function getAllUserLogins(): array
2146 $ilDB = $DIC[
'ilDB'];
2153 while ($row =
$ilDB->fetchAssoc(
$res)) {
2154 $logins[] = $row[
'login'];
2168 $ilDB = $DIC[
'ilDB'];
2169 $res =
$ilDB->query(
'SELECT * FROM usr_data WHERE ' .
2170 $ilDB->in(
'usr_id', $a_user_ids,
false,
'integer'));
2172 while ($row =
$ilDB->fetchAssoc(
$res)) {
2173 $user_data[$row[
'usr_id']] = $row;
2184 ?array $a_fields =
null,
2189 $ilDB = $DIC[
'ilDB'];
2193 if ($a_fields !==
null and is_array($a_fields)) {
2194 if (count($a_fields) == 0) {
2197 if (($usr_id_field = array_search(
'usr_id', $a_fields)) !==
false) {
2198 unset($a_fields[$usr_id_field]);
2201 $select = implode(
',', $a_fields) .
',usr_data.usr_id';
2203 if (in_array(
'online_time', $a_fields)) {
2204 $select .=
',ut_online.online_time ';
2208 $q =
'SELECT ' . $select .
' FROM usr_data ';
2212 if (in_array(
'online_time', $a_fields)) {
2213 $q .=
'LEFT JOIN ut_online ON usr_data.usr_id = ut_online.usr_id ';
2219 $q .=
'WHERE active = ' .
$ilDB->quote($active,
'integer');
2222 $q .=
'WHERE time_limit_unlimited= ' .
$ilDB->quote(0,
'integer');
2225 $qtemp =
$q .
', rbac_ua, object_data WHERE rbac_ua.rol_id = object_data.obj_id AND ' .
2226 $ilDB->like(
'object_data.title',
'text',
'%crs%') .
' AND usr_data.usr_id = rbac_ua.usr_id';
2229 while ($row =
$ilDB->fetchAssoc(
$r)) {
2230 $course_users[] = $row[
'usr_id'];
2232 if (count($course_users)) {
2233 $q .=
' WHERE ' .
$ilDB->in(
'usr_data.usr_id', $course_users,
true,
'integer') .
' ';
2240 $date = date(
'Y-m-d H:i:s', mktime(0, 0, 0, $session_data[
'm'], $session_data[
'd'], $session_data[
'y']));
2241 $q .=
' AND last_login < ' .
$ilDB->quote($date,
'timestamp');
2246 $q .=
' LEFT JOIN obj_members ON usr_data.usr_id = obj_members.usr_id ' .
2247 'WHERE obj_members.obj_id = (SELECT obj_id FROM object_reference ' .
2248 'WHERE ref_id = ' .
$ilDB->quote(
$ref_id,
'integer') .
') ';
2254 $rbacreview = $DIC[
'rbacreview'];
2257 $local_roles = $rbacreview->getRolesOfRoleFolder(
$ref_id,
false);
2258 if (is_array($local_roles) && count($local_roles)) {
2259 $q .=
' LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE ' .
2260 $ilDB->in(
'rbac_ua.rol_id', $local_roles,
false,
'integer') .
' ';
2267 $q .=
' LEFT JOIN rbac_ua ON usr_data.usr_id = rbac_ua.usr_id WHERE rbac_ua.rol_id = ' .
2268 $ilDB->quote($rol_id,
'integer');
2274 while ($row =
$ilDB->fetchAssoc(
$r)) {
2275 $result_arr[] = $row;
2288 $ilDB = $DIC[
'ilDB'];
2290 $q =
'SELECT count(*) as cnt FROM usr_pref up1, usr_pref up2 ' .
2291 ' WHERE up1.keyword= ' .
$ilDB->quote(
'style',
'text') .
2292 ' AND up1.value= ' .
$ilDB->quote($a_style,
'text') .
2293 ' AND up2.keyword= ' .
$ilDB->quote(
'skin',
'text') .
2294 ' AND up2.value= ' .
$ilDB->quote($a_skin,
'text') .
2295 ' AND up1.usr_id = up2.usr_id ';
2299 $cnt_rec =
$ilDB->fetchAssoc($cnt_set);
2301 return (
int) $cnt_rec[
'cnt'];
2311 $ilDB = $DIC[
'ilDB'];
2313 $q =
'SELECT DISTINCT up1.value style, up2.value skin FROM usr_pref up1, usr_pref up2 ' .
2314 ' WHERE up1.keyword = ' .
$ilDB->quote(
'style',
'text') .
2315 ' AND up2.keyword = ' .
$ilDB->quote(
'skin',
'text') .
2316 ' AND up1.usr_id = up2.usr_id';
2321 while ($sty_rec =
$ilDB->fetchAssoc($sty_set)) {
2322 $styles[] = $sty_rec[
'skin'] .
':' . $sty_rec[
'style'];
2329 string $a_from_skin,
2330 string $a_from_style,
2336 $ilDB = $DIC[
'ilDB'];
2338 $q =
'SELECT up1.usr_id usr_id FROM usr_pref up1, usr_pref up2 ' .
2339 ' WHERE up1.keyword= ' .
$ilDB->quote(
'style',
'text') .
2340 ' AND up1.value= ' .
$ilDB->quote($a_from_style,
'text') .
2341 ' AND up2.keyword= ' .
$ilDB->quote(
'skin',
'text') .
2342 ' AND up2.value= ' .
$ilDB->quote($a_from_skin,
'text') .
2343 ' AND up1.usr_id = up2.usr_id ';
2347 while ($usr_rec =
$ilDB->fetchAssoc($usr_set)) {
2348 self::_writePref($usr_rec[
'usr_id'],
'skin', $a_to_skin);
2349 self::_writePref($usr_rec[
'usr_id'],
'style', $a_to_style);
2371 string $a_time =
'',
2376 $ilDB = $DIC[
'ilDB'];
2378 if ($a_time ===
'') {
2379 $a_time = date(
'Y-m-d H:i:s');
2382 $item_set =
$ilDB->queryF(
2383 'SELECT * FROM personal_clipboard WHERE ' .
2384 'parent = %s AND item_id = %s AND type = %s AND user_id = %s',
2385 [
'integer',
'integer',
'text',
'integer'],
2386 [0, $a_item_id, $a_type, $this->
getId()]
2390 if (!$item_set->fetchRow()) {
2392 'INSERT INTO personal_clipboard ' .
2393 '(item_id, type, user_id, title, parent, insert_time, order_nr) VALUES ' .
2394 ' (%s,%s,%s,%s,%s,%s,%s)',
2395 [
'integer',
'text',
'integer',
'text',
'integer',
'timestamp',
'integer'],
2396 [$a_item_id, $a_type, $this->
getId(), $a_title, $a_parent, $a_time, $a_order_nr]
2400 'UPDATE personal_clipboard SET insert_time = %s ' .
2401 'WHERE user_id = %s AND item_id = %s AND type = %s AND parent = 0',
2402 [
'timestamp',
'integer',
'integer',
'text'],
2403 [$a_time, $this->
getId(), $a_item_id, $a_type]
2419 $a_time = date(
'Y-m-d H:i:s');
2422 $ilDB->insert(
'personal_pc_clipboard', [
2423 'user_id' => [
'integer', $this->
getId()],
2424 'content' => [
'clob', $a_content],
2425 'insert_time' => [
'timestamp', $a_time],
2426 'order_nr' => [
'integer', $a_nr]
2442 $set =
$ilDB->queryF(
'SELECT MAX(insert_time) mtime FROM personal_pc_clipboard ' .
2443 ' WHERE user_id = %s', [
'integer'], [$this->
getId()]);
2444 $row =
$ilDB->fetchAssoc($set);
2446 $set =
$ilDB->queryF(
2447 'SELECT * FROM personal_pc_clipboard ' .
2448 ' WHERE user_id = %s AND insert_time = %s ORDER BY order_nr ASC',
2449 [
'integer',
'timestamp'],
2450 [$this->
getId(), $row[
'mtime']]
2453 while ($row =
$ilDB->fetchAssoc($set)) {
2454 $content[] = $row[
'content'];
2467 $ilDB = $DIC[
'ilDB'];
2469 $set =
$ilDB->queryF(
2470 'SELECT * FROM personal_clipboard WHERE ' .
2471 'parent = %s AND type = %s AND user_id = %s',
2472 [
'integer',
'text',
'integer'],
2473 [0, $a_type, $this->
getId()]
2475 if (
$ilDB->fetchAssoc($set)) {
2487 'DELETE FROM personal_clipboard WHERE ' .
2488 'type = %s AND user_id = %s',
2489 [
'text',
'integer'],
2490 [$a_type, $this->
getId()]
2498 $ilDB = $DIC[
'ilDB'];
2500 $ilDB->manipulateF(
'DELETE FROM personal_clipboard WHERE ' .
2501 'user_id = %s', [
'integer'], [$this->
getId()]);
2508 string $a_type =
'',
2509 bool $a_top_nodes_only =
false 2513 $ilDB = $DIC[
'ilDB'];
2516 if ($a_top_nodes_only) {
2517 $par =
' AND parent = ' .
$ilDB->quote(0,
'integer') .
' ';
2520 $type_str = ($a_type !=
'')
2521 ?
' AND type = ' .
$ilDB->quote($a_type,
'text') .
' ' 2523 $q =
'SELECT * FROM personal_clipboard WHERE ' .
2524 'user_id = ' .
$ilDB->quote($this->
getId(),
'integer') .
' ' .
2526 ' ORDER BY order_nr';
2529 while ($obj =
$ilDB->fetchAssoc($objs)) {
2530 if ($obj[
'type'] ==
'mob') {
2536 if ($obj[
'type'] ==
'incl') {
2542 $objects[] = [
'id' => $obj[
'item_id'],
2543 'type' => $obj[
'type'],
'title' => $obj[
'title'],
2544 'insert_time' => $obj[
'insert_time']];
2554 string $a_insert_time
2558 $ilDB = $DIC[
'ilDB'];
2559 $ilUser = $DIC[
'ilUser'];
2561 $objs =
$ilDB->queryF(
2562 'SELECT * FROM personal_clipboard WHERE ' .
2563 'user_id = %s AND parent = %s AND insert_time = %s ' .
2564 ' ORDER BY order_nr',
2565 [
'integer',
'integer',
'timestamp'],
2566 [$ilUser->getId(), $a_parent, $a_insert_time]
2569 while ($obj =
$ilDB->fetchAssoc($objs)) {
2570 if ($obj[
'type'] ==
'mob') {
2573 $objects[] = [
'id' => $obj[
'item_id'],
2574 'type' => $obj[
'type'],
'title' => $obj[
'title'],
'insert_time' => $obj[
'insert_time']];
2589 $ilDB = $DIC[
'ilDB'];
2591 $q =
'SELECT DISTINCT user_id FROM personal_clipboard WHERE ' .
2592 'item_id = ' .
$ilDB->quote($a_id,
'integer') .
' AND ' .
2593 'type = ' .
$ilDB->quote($a_type,
'text');
2596 while ($user_rec =
$ilDB->fetchAssoc($user_set)) {
2597 $users[] = (
int) $user_rec[
'user_id'];
2609 $q =
'DELETE FROM personal_clipboard WHERE ' .
2610 'item_id = ' .
$ilDB->quote($a_item_id,
'integer') .
2611 ' AND type = ' .
$ilDB->quote($a_type,
'text') .
' ' .
2612 ' AND user_id = ' .
$ilDB->quote($this->
getId(),
'integer');
2621 $ilDB = $DIC[
'ilDB'];
2623 $query =
'SELECT obj_id FROM object_data WHERE import_id = ' .
2624 $ilDB->quote($i2_id,
'text');
2628 while ($row =
$ilDB->fetchObject(
$res)) {
2629 $id = (
int) $row->obj_id;
2640 return ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_usr_id);
2645 return self::lookupOrgUnitsRepresentation($this->
getId());
2650 $this->auth_mode = $a_str;
2663 $this->ext_account = $a_str;
2678 string $a_auth_mode,
2679 bool $a_read_auth_default =
false 2683 $ilDB = $DIC[
'ilDB'];
2686 $q =
'SELECT login,usr_id,ext_account,auth_mode FROM usr_data ' .
2687 'WHERE auth_mode = %s';
2689 $values[] = $a_auth_mode;
2691 $q .=
' OR auth_mode = %s ';
2693 $values[] =
'default';
2698 while ($row =
$ilDB->fetchObject(
$res)) {
2699 if ($row->auth_mode ==
'default') {
2700 $accounts[$row->usr_id] = $row->login;
2702 $accounts[$row->usr_id] = $row->ext_account;
2714 $ilDB = $DIC[
'ilDB'];
2717 $q =
'UPDATE usr_data SET active = 1, inactivation_date = NULL WHERE ' .
2718 $ilDB->in(
'usr_id', $a_usr_ids,
false,
'integer');
2721 $usrId_IN_usrIds =
$ilDB->in(
'usr_id', $a_usr_ids,
false,
'integer');
2723 $q =
'UPDATE usr_data SET active = 0 WHERE $usrId_IN_usrIds';
2728 SET inactivation_date = %s 2729 WHERE inactivation_date IS NULL 2730 AND $usrId_IN_usrIds 2738 return (
string) self::_lookup($a_usr_id,
'auth_mode');
2748 bool $tryFallback =
true 2751 $settings =
$GLOBALS[
'DIC']->settings();
2755 'SELECT * FROM usr_data WHERE ' .
2756 ' ext_account = %s AND auth_mode = %s',
2758 [$a_account, $a_auth]
2761 return $usr[
'login'];
2764 if (!$tryFallback) {
2770 'SELECT login FROM usr_data ' .
2771 'WHERE login = %s AND auth_mode = %s AND (ext_account IS NULL OR ext_account = "") ',
2773 [$a_account, $a_auth]
2776 return $usr[
'login'];
2782 'SELECT login FROM usr_data WHERE ' .
2783 ' ext_account = %s AND auth_mode = %s',
2785 [$a_account,
'default']
2788 return $usr[
'login'];
2792 'SELECT login FROM usr_data ' .
2793 'WHERE login = %s AND (ext_account IS NULL OR ext_account = "") AND auth_mode = %s',
2795 [$a_account,
'default']
2798 return $usr[
'login'];
2811 $ilDB = $DIC[
'ilDB'];
2813 $r =
$ilDB->query(
'SELECT count(*) AS cnt, auth_mode FROM usr_data ' .
2814 'GROUP BY auth_mode');
2816 while ($cnt =
$ilDB->fetchAssoc(
$r)) {
2817 $cnt_arr[$cnt[
'auth_mode']] = (
int) $cnt[
'cnt'];
2827 $ilDB = $DIC[
'ilDB'];
2832 $q =
'SELECT * FROM usr_data WHERE ' .
2833 ' email = %s AND (auth_mode = %s ';
2834 $types = [
'text',
'text'];
2835 $values = [$a_email,
'local'];
2838 $q .=
' OR auth_mode = %s';
2840 $values[] =
'default';
2846 $usr_set =
$ilDB->queryF(
$q, $types, $values);
2847 while ($usr_rec =
$ilDB->fetchAssoc($usr_set)) {
2848 $users[$usr_rec[
'usr_id']] = $usr_rec[
'login'];
2867 $stream = Streams::ofResource(fopen($tmp_file,
'rb'));
2872 $DIC->resourceStorage()->manage()->replaceWithStream(
2879 $rid = $DIC->resourceStorage()->manage()->stream(
2896 string $a_size =
'small',
2897 bool $a_force_pic =
false 2899 if (isset(self::$personal_image_cache[$this->
getId()][$a_size][(
int) $a_force_pic])) {
2900 return self::$personal_image_cache[$this->
getId()][$a_size][(
int) $a_force_pic];
2903 self::$personal_image_cache[$this->
getId()][$a_size][(
int) $a_force_pic] = self::_getPersonalPicturePath($this->
getId(), $a_size, $a_force_pic);
2905 return self::$personal_image_cache[$this->
getId()][$a_size][(
int) $a_force_pic];
2915 return self::_getAvatar($this->
getId());
2921 $define->setSize(
'xsmall');
2922 return $define->getAvatar();
2931 string $a_size =
'small',
2932 bool $a_force_pic =
false,
2933 bool $a_prevent_no_photo_image =
false,
2934 bool $html_export =
false 2937 $define->setForcePicture($a_force_pic);
2938 $define->setSize($a_size);
2939 return $define->getLegacyPictureURL();
2946 $a_dir = trim(str_replace(
'..',
'', $a_dir));
2947 if ($a_dir ==
'' || !is_dir($a_dir)) {
2952 $irss = $DIC->resourceStorage();
2957 $stream = $irss->
consume()->stream($rid)->getStream();
2958 $target = $a_dir .
'/usr_' . $a_user_id .
'.jpg';
2959 fwrite(fopen($target,
'wb'), (
string) $stream);
2966 $image_dir = $webspace_dir .
'/usr_images';
2968 'upload_' . $a_user_id .
'pic',
2969 'usr_' . $a_user_id .
'.' .
'jpg',
2970 'usr_' . $a_user_id .
'_small.jpg',
2971 'usr_' . $a_user_id .
'_xsmall.jpg',
2972 'usr_' . $a_user_id .
'_xxsmall.jpg',
2973 'upload_' . $a_user_id];
2974 foreach ($images as $image) {
2975 if (is_file($image_dir .
'/' . $image)) {
2976 copy($image_dir .
'/' . $image, $a_dir .
'/' . $image);
2983 bool $a_do_update =
true 2986 $rid = $this->irss->manage()->find($this->
getAvatarRid());
2993 $this->
setPref(
'profile_image',
'');
3001 foreach ($a_data as $field =>
$data) {
3002 $this->user_defined_data[
'f_' . $field] =
$data;
3008 return $this->user_defined_data ?: [];
3014 foreach ($this->user_defined_data as $field => $value) {
3015 if ($field !==
'usr_id' && $value !==
null) {
3016 $udata->set($field, $value);
3025 $this->user_defined_data = $udata->getAll();
3037 public function getProfileAsString(
Language $language):
string 3041 $rbacreview = $DIC[
'rbacreview'];
3046 $body = ($language->
txt(
'login') .
': ' . $this->
getLogin() .
"\n");
3049 $body .= ($language->
txt(
'title') .
': ' . $this->
getUTitle() .
"\n");
3052 $body .= ($language->
txt(
'gender') .
': ' . $language->
txt(
'gender_' . strtolower($this->
getGender())) .
"\n");
3055 $body .= ($language->
txt(
'firstname') .
': ' . $this->
getFirstname() .
"\n");
3058 $body .= ($language->
txt(
'lastname') .
': ' . $this->
getLastname() .
"\n");
3061 $body .= ($language->
txt(
'institution') .
': ' . $this->
getInstitution() .
"\n");
3064 $body .= ($language->
txt(
'department') .
': ' . $this->
getDepartment() .
"\n");
3067 $body .= ($language->
txt(
'street') .
': ' . $this->
getStreet() .
"\n");
3069 if (strlen($this->
getCity())) {
3070 $body .= ($language->
txt(
'city') .
': ' . $this->
getCity() .
"\n");
3073 $body .= ($language->
txt(
'zipcode') .
': ' . $this->
getZipcode() .
"\n");
3076 $body .= ($language->
txt(
'country') .
': ' . $this->
getCountry() .
"\n");
3082 $body .= ($language->
txt(
'phone_office') .
': ' . $this->
getPhoneOffice() .
"\n");
3085 $body .= ($language->
txt(
'phone_home') .
': ' . $this->
getPhoneHome() .
"\n");
3088 $body .= ($language->
txt(
'phone_mobile') .
': ' . $this->
getPhoneMobile() .
"\n");
3090 if (strlen($this->
getFax())) {
3091 $body .= ($language->
txt(
'fax') .
': ' . $this->
getFax() .
"\n");
3094 $body .= ($language->
txt(
'email') .
': ' . $this->
getEmail() .
"\n");
3098 $body .= ($language->
txt(
'second_email') .
': ' . $this->
getSecondEmail() .
"\n");
3101 $body .= ($language->
txt(
'hobby') .
': ' . $this->
getHobby() .
"\n");
3104 $body .= ($language->
txt(
'referral_comment') .
': ' . $this->
getComment() .
"\n");
3115 $body .= ($language->
txt(
'create_date') .
': ' . $date .
"\n");
3119 foreach ($rbacreview->getGlobalRoles() as $role) {
3120 if ($rbacreview->isAssigned($this->getId(), $role)) {
3125 $body .= ($language->
txt(
'reg_role_info') .
': ' . implode(
',', $gr) .
"\n");
3130 $body .= ($language->
txt(
'time_limit') .
': ' . $language->
txt(
'crs_unlimited') .
"\n");
3143 $body .= $language->
txt(
'time_limit') .
': ' .
3144 $language->
txt(
'from') .
' ' .
3155 foreach ($user_defined_fields->getDefinitions() as $field_id => $definition) {
3156 $data = $user_defined_data[
'f_' . $field_id] ??
'';
3160 preg_replace(
'/<br(\s*)?\/?>/i',
"\n",
$data)
3164 $body .= $definition[
'field_name'] .
': ' .
$data .
"\n";
3176 bool $create =
false 3179 $ilDB = $DIC[
'ilDB'];
3181 if ($user_id === 0) {
3185 $set =
$ilDB->queryF(
3186 'SELECT feed_hash from usr_data WHERE usr_id = %s',
3190 if (($rec =
$ilDB->fetchAssoc($set)) ===
null) {
3194 $feed_hash = $rec[
'feed_hash'];
3195 if (is_string($feed_hash) && strlen($feed_hash) === 32) {
3203 $hash = md5(random_int(1, 9999999) + str_replace(
' ',
'', microtime()));
3205 'UPDATE usr_data SET feed_hash = %s' .
3206 ' WHERE usr_id = %s',
3221 if ($a_user_id > 0) {
3222 return self::_lookupPref($a_user_id,
'priv_feed_pass');
3238 ($a_password ==
'') ?
'' : md5($a_password)
3252 $ilDB = $DIC[
'ilDB'];
3254 $q =
'SELECT DISTINCT login, usr_id FROM usr_data ' .
3257 $values[] = $a_login;
3259 if ($a_user_id != 0) {
3260 $q .=
' AND usr_id != %s ';
3261 $types[] =
'integer';
3262 $values[] = $a_user_id;
3265 $r =
$ilDB->queryF(
$q, $types, $values);
3267 if ($row =
$ilDB->fetchAssoc(
$r)) {
3268 return (
int) $row[
'usr_id'];
3277 string $a_external_account,
3282 $ilDB = $DIC[
'ilDB'];
3285 'SELECT * FROM usr_data ' .
3286 'WHERE ext_account = %s AND auth_mode = %s',
3288 [$a_external_account, $a_auth_mode]
3303 $ilDB = $DIC[
'ilDB'];
3304 $rbacreview = $DIC[
'rbacreview'];
3305 $ids = $rbacreview->assignedUsers($role_id);
3307 if (count($ids) == 0) {
3311 $query =
'SELECT usr_data.*, usr_pref.value AS language 3313 LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s 3314 WHERE ' .
$ilDB->in(
'usr_data.usr_id', $ids,
false,
'integer');
3315 $values[] =
'language';
3319 if (is_numeric($active) && $active > -1) {
3320 $query .=
' AND usr_data.active = %s';
3322 $types[] =
'integer';
3325 $query .=
' ORDER BY usr_data.lastname, usr_data.firstname ';
3327 $r =
$ilDB->queryF($query, $types, $values);
3329 while ($row =
$ilDB->fetchAssoc(
$r)) {
3346 $ilDB = $DIC[
'ilDB'];
3347 $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';
3349 $values[] =
'language';
3351 if (is_numeric($active) && $active > -1) {
3352 $query .=
' AND usr_data.active = %s';
3354 $types[] =
'integer';
3358 $query .=
' AND usr_data.time_limit_owner = %s';
3360 $types[] =
'integer';
3363 $query .=
' AND usr_data.usr_id != %s ';
3365 $types[] =
'integer';
3367 $query .=
' ORDER BY usr_data.lastname, usr_data.firstname ';
3369 $result =
$ilDB->queryF($query, $types, $values);
3371 while ($row =
$ilDB->fetchAssoc($result)) {
3388 return self::_getUsersForIds($a_mem_ids, $active);
3400 int $timelimitowner = -1
3404 $ilDB = $DIC[
'ilDB'];
3406 $query =
'SELECT usr_data.*, usr_pref.value AS language 3408 LEFT JOIN usr_pref ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s 3409 WHERE ' .
$ilDB->in(
'usr_data.usr_id', $a_mem_ids,
false,
'integer') .
' 3410 AND usr_data.usr_id != %s';
3411 $values[] =
'language';
3414 $types[] =
'integer';
3416 if (is_numeric($active) && $active > -1) {
3417 $query .=
' AND active = %s';
3419 $types[] =
'integer';
3422 if ($timelimitowner !=
USER_FOLDER_ID && $timelimitowner != -1) {
3423 $query .=
' AND usr_data.time_limit_owner = %s';
3424 $values[] = $timelimitowner;
3425 $types[] =
'integer';
3428 $query .=
' ORDER BY usr_data.lastname, usr_data.firstname ';
3430 $result =
$ilDB->queryF($query, $types, $values);
3432 while ($row =
$ilDB->fetchAssoc($result)) {
3449 $ilDB = $DIC[
'ilDB'];
3452 if (is_array($a_internalids)) {
3453 foreach ($a_internalids as $internalid) {
3454 if (is_numeric($internalid)) {
3455 $ids[] = $internalid;
3458 if (is_numeric($parsedid) && $parsedid > 0) {
3464 if (count($ids) == 0) {
3468 $query =
'SELECT usr_data.*, usr_pref.value AS language 3471 ON usr_pref.usr_id = usr_data.usr_id AND usr_pref.keyword = %s 3472 WHERE ' .
$ilDB->in(
'usr_data.usr_id', $ids,
false,
'integer');
3473 $values[] =
'language';
3476 $query .=
' ORDER BY usr_data.lastname, usr_data.firstname ';
3479 $result =
$ilDB->queryF($query, $types, $values);
3480 while ($row =
$ilDB->fetchAssoc($result)) {
3496 $ilDB = $DIC[
'ilDB'];
3501 'SELECT * FROM usr_pref WHERE usr_id = %s',
3506 while ($row =
$ilDB->fetchAssoc(
$r)) {
3507 $prefs[$row[
'keyword']] = $row[
'value'];
3524 $ilDB = $DIC[
'ilDB'];
3527 $set =
$ilDB->query(
3528 'SELECT usr_id FROM usr_pref ' .
3529 ' WHERE keyword = ' .
$ilDB->quote($a_keyword,
'text') .
3530 ' AND ' .
$ilDB->in(
'usr_id', $a_user_ids,
false,
'integer') .
3531 ' AND value = ' .
$ilDB->quote($a_val,
'text')
3533 while ($rec =
$ilDB->fetchAssoc($set)) {
3534 $users[] = $rec[
'usr_id'];
3544 $ilDB = $DIC[
'ilDB'];
3546 $query =
'SELECT login_attempts FROM usr_data WHERE usr_id = %s';
3547 $result =
$ilDB->queryF($query, [
'integer'], [$a_usr_id]);
3548 $record =
$ilDB->fetchAssoc($result);
3549 return (
int) ($record[
'login_attempts'] ?? 0);
3557 $ilDB = $DIC[
'ilDB'];
3559 $query =
'UPDATE usr_data SET login_attempts = (login_attempts + 1) WHERE usr_id = %s';
3560 $affected =
$ilDB->manipulateF($query, [
'integer'], [$a_usr_id]);
3574 $ilDB = $DIC[
'ilDB'];
3576 $query =
'UPDATE usr_data SET active = 0, inactivation_date = %s WHERE usr_id = %s';
3577 $affected =
$ilDB->manipulateF($query, [
'timestamp',
'integer'], [
ilUtil::now(), $a_usr_id]);
3591 return in_array($this->
getPref(
'public_profile'), [
'y',
'g']);
3612 $ilDB = $DIC[
'ilDB'];
3617 'SELECT * FROM loginname_history WHERE usr_id = %s AND login = %s AND history_date = %s',
3618 [
'integer',
'text',
'integer'],
3625 INSERT INTO loginname_history 3626 (usr_id, login, history_date) 3627 VALUES (%s, %s, %s)',
3628 [
'integer',
'text',
'integer'],
3640 bool $a_no_anonymous =
false 3644 $ilDB = $DIC->database();
3649 $atime = $pd_set->get(
'user_activity_time') * 60;
3654 if ($a_user_id === 0) {
3655 $where[] =
'user_id > 0';
3657 $where[] =
'user_id = ' .
$ilDB->quote($a_user_id,
'integer');
3660 if ($a_no_anonymous) {
3668 $where[] =
'expires > ' .
$ilDB->quote($ctime,
'integer');
3669 $where[] =
'(p.value IS NULL OR NOT p.value = ' .
$ilDB->quote(
'y',
'text') .
')';
3671 $where =
'WHERE ' . implode(
' AND ', $where);
3675 SELECT COUNT(user_id) num, user_id, firstname, lastname, title, login, last_login, MAX(ctime) ctime, context, agree_date 3677 LEFT JOIN usr_data u 3678 ON user_id = u.usr_id 3679 LEFT JOIN usr_pref p 3680 ON (p.usr_id = u.usr_id AND p.keyword = %s) 3682 GROUP BY user_id, firstname, lastname, title, login, last_login, context, agree_date 3683 ORDER BY lastname, firstname 3686 [
'hide_own_online_status']
3693 if ($atime <= 0 ||
$user[
'ctime'] + $atime > $ctime) {
3698 $log->
debug(
'Found users: ' . count($users));
3700 $hide_users = $DIC[
'legalDocuments']->usersWithHiddenOnlineStatus(
array_map(intval(...), array_column($users,
'user_id')));
3701 $users = array_filter(
3703 fn(
$user) => !in_array((
int)
$user[
'user_id'], $hide_users,
true)
3717 $ilDB = $DIC[
'ilDB'];
3722 $hashcode = substr(md5(uniqid(mt_rand(),
true)), 0, 16);
3726 SELECT COUNT(usr_id) cnt FROM usr_data 3727 WHERE reg_hash = %s',
3732 if ($row->cnt > 0) {
3747 [
'text',
'integer'],
3748 [$hashcode, $a_usr_id]
3767 $ilDB = $DIC[
'ilDB'];
3771 SELECT usr_id, create_date FROM usr_data 3772 WHERE reg_hash = %s',
3776 while ($row =
$ilDB->fetchAssoc(
$res)) {
3779 if ($oRegSettigs->getRegistrationHashLifetime() != 0 &&
3780 time() - $oRegSettigs->getRegistrationHashLifetime() > strtotime($row[
'create_date'])) {
3782 'reg_confirmation_hash_life_time_expired',
3783 (
int) $row[
'usr_id']
3792 [
'text',
'integer'],
3793 [
'', (
int) $row[
'usr_id']]
3796 return (
int) $row[
'usr_id'];
3804 if ($a_birthday && strlen($a_birthday)) {
3808 $this->birthday =
null;
3828 if ($periodInDays < 1) {
3832 $date = date(
'Y-m-d H:i:s', (time() - ($periodInDays * 24 * 60 * 60)));
3834 $query =
'SELECT usr_id FROM usr_data WHERE last_login IS NOT NULL AND last_login < %s';
3838 $types = [
'timestamp'];
3841 $res = $DIC->database()->queryF($query, $types, $values);
3842 while ($row = $DIC->database()->fetchAssoc(
$res)) {
3843 $ids[] = (
int) $row[
'usr_id'];
3855 int $thresholdInDays
3859 $date = date(
'Y-m-d H:i:s', (time() - ($thresholdInDays * 24 * 60 * 60)));
3861 $query =
'SELECT usr_id FROM usr_data WHERE last_login IS NULL AND create_date < %s';
3865 $types = [
'timestamp'];
3868 $res = $DIC->database()->queryF($query, $types, $values);
3869 while ($row = $DIC->database()->fetchAssoc(
$res)) {
3870 $ids[] = (
int) $row[
'usr_id'];
3886 $field =
'inactivation_date';
3895 $ilDB = $DIC[
'ilDB'];
3897 $date = date(
'Y-m-d H:i:s', (time() - ($period * 24 * 60 * 60)));
3899 $query =
"SELECT usr_id FROM usr_data WHERE $field < %s AND active = %s";
3901 $res =
$ilDB->queryF($query, [
'timestamp',
'integer'], [$date, 0]);
3905 $ids[] = (
int) $row->usr_id;
3915 $query =
'UPDATE object_data SET owner = 0 ' .
3916 'WHERE owner = ' .
$ilDB->quote($this->
getId(),
'integer');
3917 $ilDB->query($query);
3925 ?array $user_ids =
null 3929 $ilDB = $DIC->database();
3931 $q =
'SELECT DISTINCT ' .
$ilDB->upper(
$ilDB->substr(
'lastname', 1, 1)) .
' let' .
3934 ($user_ids !==
null ?
' AND ' .
$ilDB->in(
'usr_id', $user_ids,
false,
'integer') :
'') .
3939 while ($let_rec =
$ilDB->fetchAssoc($let_set)) {
3940 $let[$let_rec[
'let']] = $let_rec[
'let'];
3946 array $a_usr_ids = []
3950 $ilDB = $DIC[
'ilDB'];
3952 $query =
'SELECT count(*) num FROM object_data od ' .
3953 'JOIN usr_data ud ON obj_id = usr_id ' .
3954 'WHERE ' .
$ilDB->in(
'obj_id', $a_usr_ids,
false,
'integer') .
' ';
3957 return $num_rows == count($a_usr_ids);
3960 public function exportPersonalData():
void 3962 if (!isset($this->
user)) {
3964 $this->
user = $DIC->user();
3966 $export_consumer = (
new ExportFactory())->consumer()->handler();
3967 $configs = $export_consumer->exportConfig()->allExportConfigs();
3969 $config = $configs->getElementByClassName(
'ilUserExportConfig');
3970 $config->setExportType(
'personal_data');
3971 $export = $export_consumer->createStandardExportByObject(
3972 $this->
user->getId(),
3976 $stream = Streams::ofString($export->getIRSSInfo()->getStream()->getContents());
3977 $file_name = $export->getIRSSInfo()->getFileName();
3978 $export->getIRSS()->delete($export_consumer->exportStakeholderHandler());
3979 $this->delivery->deliver($stream, $file_name);
3985 if (!is_dir($dir)) {
3989 if (is_int(strpos($entry[
'entry'],
'.zip'))) {
3990 return $entry[
'entry'];
4001 if (is_file($file)) {
4008 bool $a_profile_data,
4015 $imp->addSkipImporter(
'components/ILIAS/Bookmarks');
4016 if (!$a_profile_data) {
4017 $imp->addSkipEntity(
'components/ILIAS/User',
'usr_profile');
4020 $imp->addSkipEntity(
'components/ILIAS/User',
'usr_setting');
4023 $imp->addSkipEntity(
'components/ILIAS/Notes',
'user_notes');
4026 $imp->addSkipEntity(
'components/ILIAS/Calendar',
'calendar');
4029 $a_file[
'tmp_name'],
4032 'components/ILIAS/User' 4048 return self::_isAnonymous($this->
getId());
4068 return (
bool) $this->
getPref(
'delete_flag');
4073 $this->is_self_registered = $status;
4091 $this->interests_general = $value ?? [];
4115 $this->interests_help_offered = $value ?? [];
4139 $this->interests_help_looking = $value ?? [];
4165 if (count($a_attr) > 0) {
4166 return implode(
', ', $a_attr);
4175 $ilDB = $DIC[
'ilDB'];
4177 if (!$this->
getId()) {
4181 $set =
$ilDB->query(
'SELECT field_id,value' .
4182 ' FROM usr_data_multi' .
4183 ' WHERE usr_id = ' .
$ilDB->quote($this->getId(),
'integer') .
4185 while ($row =
$ilDB->fetchAssoc($set)) {
4186 $values[$row[
'field_id']][] = $row[
'value'];
4189 if (isset($values[
'interests_general'])) {
4194 if (isset($values[
'interests_help_offered'])) {
4199 if (isset($values[
'interests_help_looking'])) {
4210 $ilDB = $DIC[
'ilDB'];
4212 if (!$this->
getId()) {
4226 foreach ($map as
$id => $values) {
4227 if (is_array($values) && count($values)) {
4228 foreach ($values as $value) {
4229 $value = trim($value);
4231 $uniq_id =
$ilDB->nextId(
'usr_data_multi');
4233 $ilDB->manipulate(
'INSERT usr_data_multi' .
4234 ' (id,usr_id,field_id,value) VALUES' .
4235 ' (' .
$ilDB->quote($uniq_id,
'integer') .
4236 ',' .
$ilDB->quote($this->
getId(),
'integer') .
4238 ',' .
$ilDB->quote($value,
'text') .
4250 $ilDB = $DIC[
'ilDB'];
4252 if (!$this->
getId()) {
4256 $ilDB->manipulate(
'DELETE FROM usr_data_multi' .
4257 ' WHERE usr_id = ' .
$ilDB->quote($this->getId(),
'integer'));
4262 ?
int $a_user_id =
null,
4263 ?
string $a_field_id =
null 4267 $ilDB = $DIC[
'ilDB'];
4271 $sql =
'SELECT DISTINCT(value)' .
4272 ' FROM usr_data_multi' .
4273 ' WHERE ' .
$ilDB->like(
'value',
'text',
'%' . $a_term .
'%');
4275 $sql .=
' AND field_id = ' .
$ilDB->quote($a_field_id,
'text');
4278 $sql .=
' AND usr_id <> ' .
$ilDB->quote($a_user_id,
'integer');
4280 $sql .=
' ORDER BY value';
4281 $set =
$ilDB->query($sql);
4282 while ($row =
$ilDB->fetchAssoc($set)) {
4283 $res[] = $row[
'value'];
4302 $ilDB = $DIC->database();
4304 $set =
$ilDB->query(
4305 'SELECT * FROM usr_pref ' .
4306 ' WHERE keyword = ' .
$ilDB->quote(
'public_profile',
'text') .
4307 ' AND ' .
$ilDB->in(
'usr_id', $a_user_ids,
false,
'integer')
4315 while ($rec =
$ilDB->fetchAssoc($set)) {
4316 if ($rec[
'value'] ==
'g') {
4317 $r[
'global'][] = $rec[
'usr_id'];
4318 $r[
'public'][] = $rec[
'usr_id'];
4320 if ($rec[
'value'] ==
'y') {
4321 $r[
'local'][] = $rec[
'usr_id'];
4322 $r[
'public'][] = $rec[
'usr_id'];
4325 foreach ($a_user_ids as
$id) {
4326 if (!in_array($id,
$r[
'public'])) {
4327 $r[
'not_public'][] =
$id;
getCurrentLanguage()
returns the current language (may differ from user's pref setting!)
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static hasActiveSession(int $a_user_id, string $a_session_id)
setUTitle(string $a_str)
set user title (note: don't mix up this method with setTitle() that is derived from ilObject and sets...
setProfileIncomplete(bool $a_prof_inc)
static get(string $a_var)
setTimeLimitUnlimited(bool $a_unlimited)
static array static setUseRelativeDates(bool $a_status)
set use relative dates
static _setFeedPass(int $a_user_id, string $a_password)
Set news feed password for user.
setClientIP(string $a_str)
setAvatarRid(?string $avatar_rid)
getStoredActive(int $a_id)
get user active state
setLastLogin(string $a_str)
static _getUsersForRole(int $role_id, int $active=-1)
return array of complete users which belong to a specific role
resetPassword(string $raw, string $raw_retype)
Resets the user password.
refreshLogin()
updates the login data of a 'user'
static _getLoginAttempts(int $a_usr_id)
static _destroyByUserId(int $a_user_id)
Destroy session.
static copyProfilePicturesToDirectory(int $a_user_id, string $a_dir)
static _deleteUser(int $a_usr_id)
getPersonalPicturePath(string $a_size='small', bool $a_force_pic=false)
static _lookupLanguage(int $a_usr_id)
buildTextFromArray(array $a_attr)
Convert multi-text values to plain text.
static getLogger(string $a_component_id)
Get component logger.
static _getAllUserData(?array $a_fields=null, int $active=-1)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAuthMode(?string $a_auth_mode)
writePref(string $a_keyword, string $a_value)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setAgreeDate(?string $a_str)
array $interests_help_looking
static styleExists(string $style_id)
static getUserIdsByInactivityPeriod(int $periodInDays)
Get ids of all users that have been inactive for at least the given period.
static lookupMatriculation(int $a_usr_id)
static getFirstLettersOfLastnames(?array $user_ids=null)
Get first letters of all lastnames.
__construct(int $a_user_id=0, bool $a_call_by_reference=false)
static getProfileStatusOfUsers(array $a_user_ids)
Get profile status.
static _verifyRegistrationHash(string $a_hash)
Verifies a registration hash.
assignData(array $a_data)
loads a record 'user' from array
fetchAssoc(ilDBStatement $statement)
static _externalAccountExists(string $a_external_account, string $a_auth_mode)
Check if an external account name already exists.
setMatriculation(string $a_str)
static _lookupFullname(int $a_user_id)
isPasswordChangeDemanded()
getGeneralInterestsAsText()
Get general interests as plain text.
getDefaultLanguage()
Return default language.
getOrgUnitsRepresentation()
Class for user related exception handling in ILIAS.
setPhoneOffice(string $a_str)
addToPCClipboard(string $a_content, string $a_time, int $a_nr)
Add a page content item to PC clipboard (should go to another class)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static _moveUsersToStyle(string $a_from_skin, string $a_from_style, string $a_to_skin, string $a_to_style)
static _getPreferences(int $user_id)
get preferences for user
removeObjectFromClipboard(int $a_item_id, string $a_type)
getPasswordPolicyResetStatus()
static _removeTrackingDataForUser(int $user_id)
to be called from IlObjUser
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
updateLogin(string $a_login)
update login name
setSelectedCountry(string $a_val)
Set selected country (selection drop down)
deletePref(string $a_keyword)
static _lookupLastLogin(int $a_user_id)
array $interests_help_offered
string $time_limit_message
static array $personal_image_cache
setFullname()
builds a string with title + firstname + lastname method is used to build fullname in member variable...
static _writeAuthMode(int $a_usr_id, string $a_auth_mode)
static _lookupName(int $a_user_id)
lookup user name
static resetToDefaults()
reset to defaults
static _lookupId($a_user_str)
static lookupTitle(int $a_page_id)
static _deleteSettingsOfUser(int $a_user)
getFullname(int $a_max_strlen=0)
removeUserPicture(bool $a_do_update=true)
static getUserIdsByEmail(string $a_email)
static _lookupPref(int $a_usr_id, string $a_keyword)
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
loadLanguageModule(string $a_module)
static _checkExternalAuthAccount(string $a_auth, string $a_account, bool $tryFallback=true)
check whether external account and authentication method matches with a user
static getUserSubsetByPreferenceValue(array $a_user_ids, string $a_keyword, string $a_val)
For a given set of user IDs return a subset that has a given user preference set. ...
getCreateDate()
Get create date in YYYY-MM-DD HH-MM-SS format.
static _lookupExternalAccount(int $a_user_id)
static _getUsersForGroup(array $a_mem_ids, int $active=-1)
return user data for group members
static _deleteByUser(int $a_usr_id)
static _needsExternalAccountByAuthMode($a_auth_mode)
Check if chosen auth mode needs an external account entry.
static setLanguage(ilLanguage $a_lng)
static _lookupAuthMode(int $a_usr_id)
login()
description: > Example for rendring a login glyph.
setPasswordSalt(?string $password_salt)
static lookupOrgUnitsRepresentation(int $a_usr_id)
lookup org unit representation
static _lookupGender(int $a_user_id)
setTimeLimitUntil(?int $a_until)
static _getAuthModeName($a_auth_key)
static _uploadPersonalPicture(string $tmp_file, int $obj_id)
Create a personal picture image file from a temporary image file.
setLoginAttempts(int $a_login_attempts)
static now()
Return current timestamp in Y-m-d H:i:s format.
static _deleteAllPref(int $a_user_id)
Deletes a userpref value of the user from the database.
static _getExportDirectory(int $a_obj_id, string $a_type="xml", string $a_obj_type="", string $a_entity="")
Get export directory for an repository object
setInstitution(string $a_str)
getPublicName()
returns firstname lastname and login if profile is public, login otherwise
deleteUserDefinedFieldEntries()
getAuthMode(bool $a_auth_key=false)
static _deleteUser(int $a_usr_id)
getOfferingHelpAsText()
Get help offering as plain text.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLatitude(?string $a_latitude)
setComment(string $a_str)
setPasswd(string $a_str, string $a_type=ilObjUser::PASSWD_PLAIN)
updateUserDefinedFields()
int $last_password_change_ts
static _getAvatar(int $a_usr_id)
setExternalAccount(string $a_str)
static _getNumberOfUsersForStyle(string $a_skin, string $a_style)
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
setPasswordPolicyResetStatus(bool $status)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setBirthday(?string $a_birthday)
static _writeExternalAccount(int $a_usr_id, string $a_ext_id)
static _getInstance()
Get singleton instance of this class.
bool $time_limit_unlimited
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...
static getUserIdByLogin(string $a_login)
writeAccepted()
write accept date of user agreement
static _getLastHistoryDataByUserId(int $a_usr_id)
Returns the last used loginname and the changedate of the passed user_id.
ilAppEventHandler $app_event_handler
setActive(bool $a_active, int $a_owner=0)
set user active state and updates system fields appropriately
resetLastPasswordChange()
txt(string $a_topic, string $a_default_lang_fallback_mod="")
getClipboardObjects(string $a_type='', bool $a_top_nodes_only=false)
get all clipboard objects of user and specified type
static userExists(array $a_usr_ids=[])
static _lookupClientIP(int $a_user_id)
setDepartment(string $a_str)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupTitle(int $obj_id)
static deleteEntriesOfUser(int $a_user_id)
setOfferingHelp(?array $value=null)
getLastPasswordChangeTS()
static getLoginFromAuth()
Gets the username from $ilAuth, and converts it into an ILIAS login name.
clipboardDeleteObjectsOfType(string $a_type)
static getUserLoginsByEmail(string $a_email)
getLoginByUserId(int $a_userid)
This describes how a letter or a picture avatar could be modified during construction of UI...
static _getFeedPass(int $a_user_id)
Lookup news feed password for user.
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
static _generateRegistrationHash(int $a_usr_id)
Generates a unique hashcode for activating a user profile after registration.
static styleExistsForSkinId(string $skin_id, string $style_id)
setApproveDate(?string $a_str)
set date the user account was activated null indicates that the user has not yet been activated ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _setUserInactive(int $a_usr_id)
setPhoneHome(string $a_str)
static _getNumberOfUsersPerAuthMode()
get number of users per auth mode
static _toggleActiveStatusOfUsers(array $a_usr_ids, bool $a_status)
static _loginExists(string $a_login, int $a_user_id=0)
check if a login name already exists You may exclude a user from the check by giving his user id as 2...
static removeForUser(int $user_id)
Remove all notifications for given user.
getPref(string $a_keyword)
setInactivationDate(?string $inactivation_date)
syncActive()
synchronizes current and stored user active values for the owner value to be set correctly, this function should only be called when an admin is approving a user account
static _getUsersOnline(int $a_user_id=0, bool $a_no_anonymous=false)
reads all active sessions from db and returns users that are online OR returns only one active user i...
updateOwner()
update owner of object in db
static _deletePref(int $a_user_id, string $a_keyword)
static _getUserData(array $a_internalids)
return user data for given user ids
checkUserId()
check user id with login name
Class ilObjForumAdministration.
static _writeHistory(int $a_usr_id, string $a_login)
getLookingForHelpAsText()
Get help looking for as plain text.
setIsSelfRegistered(bool $status)
static getDir(string $a_dir, bool $a_rec=false, ?string $a_sub_dir="")
get directory
static _lookupFields(int $a_user_id)
lookup fields (deprecated; use more specific methods instead)
bool $passwd_policy_reset
setPref(string $a_keyword, ?string $a_value)
Class ilUserAvatarResolver.
static _getUserIdsByInactivationPeriod(int $period)
get ids of all users that have been inactivated since at least the given period
setFirstLogin(string $a_str)
setCountry(string $a_str)
queryF(string $query, array $types, array $values)
getPCClipboardContent()
Add a page content item to PC clipboard (should go to another class)
static _isAnonymous(int $usr_id)
existsPref(string $a_keyword)
importPersonalData(array $a_file, bool $a_profile_data, bool $a_settings, bool $a_notes, bool $a_calendar)
foreach($mandatory_scripts as $file) $timestamp
setPhoneMobile(string $a_str)
getSelectedCountry()
Get selected country (selection drop down)
static deleteByUserId(int $a_user_id)
setLastPasswordChangeTS(int $a_last_password_change_ts)
setLastname(string $a_str)
setPasswordEncodingType(?string $password_encryption_type)
ILIAS FileDelivery Delivery StreamDelivery $delivery
static _getPersonalPicturePath(int $a_usr_id, string $a_size='small', bool $a_force_pic=false, bool $a_prevent_no_photo_image=false, bool $html_export=false)
static _doesLoginnameExistInHistory(string $a_login)
Checks whether the passed loginname already exists in history.
static _getUsersForClipboadObject(string $a_type, int $a_id)
get all users, that have a certain object within their clipboard
static deleteUserPortfolios(int $a_user_id)
Delete all portfolio data for user.
Class ilObjAuthSettingsGUI.
getPersonalDataExportFile()
static findInterests(string $a_term, ?int $a_user_id=null, ?string $a_field_id=null)
static skinExists(string $skin_id, ?ilSystemStyleConfig $system_style_config=null)
Check whether a skin exists.
static _incrementLoginAttempts(int $a_usr_id)
string $last_profile_prompt
static _lookupFeedHash(int $user_id, bool $create=false)
Lookup news feed hash for user.
setLastProfilePrompt(string $a_str)
static _getImportedUserId(string $i2_id)
static _getUsersForFolder(int $ref_id, int $active)
get users for a category or from system folder
setLanguage(string $a_str)
static _readUsersProfileData(array $a_user_ids)
static _lookup(int $a_user_id, string $a_field)
static __extractId(string $ilias_id, int $inst_id)
extract ref id from role title, e.g.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static toUsernameWithoutDomain(string $a_login)
Static function removes Microsoft domain name from username webdav related.
__construct(Container $dic, ilPlugin $plugin)
setTimeLimitOwner(int $a_owner)
updateMultiTextFields(bool $a_create=false)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
setSecondEmail(?string $second_email)
string $password_encoding_type
static _writePref(int $a_usr_id, string $a_keyword, string $a_value)
setLongitude(?string $a_longitude)
setLocationZoom(?int $a_locationzoom)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
DateFormatFactory $date_format_factory
setLastPasswordChangeToNow()
setZipcode(string $a_str)
ilCronDeleteInactiveUserReminderMail $cron_delete_user_reminder_mail
setTimeLimitMessage(string $a_time_limit_message)
static _lookupFirstLogin(int $a_user_id)
debug(string $message, array $context=[])
Class for user related exception handling in ILIAS.
setUserDefinedData(array $a_data)
static _lookupType(int $id, bool $reference=false)
setGeneralInterests(?array $value=null)
setTimeLimitFrom(?int $a_from)
getClipboardChilds(int $a_parent, string $a_insert_time)
Get children of an item.
setFirstname(string $a_str)
string $inactivation_date
static _lookupEmail(int $a_user_id)
static clear(string $a_var)
static _getInstance()
Get instance of ilSecuritySettings.
getPasswordEncodingType()
static set(string $a_var, $a_val)
Set a value.
static _getUsersForIds(array $a_mem_ids, int $active=-1, int $timelimitowner=-1)
return user data for given user id
setAuthMode(?string $a_str)
setCurrentLanguage(string $a_val)
Set current language.
static _lookupActive(int $a_usr_id)
hasPublicProfile()
returns true if public is profile, false otherwise
static _getAllUserAssignedStyles()
setLastUpdate(string $a_str)
static getUserIdsNeverLoggedIn(int $thresholdInDays)
Get ids of all users that have never logged in.
static _removeTrackingDataForUser(int $user_id)
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
static _getLocalAccountsForEmail(string $a_email)
clipboardHasObjectsOfType(string $a_type)
Check whether clipboard has objects of a certain type.
static _lookupLogin(int $a_user_id)
setLookingForHelp(?array $value=null)